Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ready-to-build docs folder with the mkdocs tool #207

Merged
merged 22 commits into from
Sep 23, 2019
Merged

Conversation

Javi
Copy link
Contributor

@Javi Javi commented Dec 20, 2018

Fixes #196
In order to build the site for uploading (to GH pages for example) or serving locally, you need to run mkdocs, which is available from brew, apt-get, choco and others.

From then, mkdocs serve will host the site locally, and mkdocs gh-deploy compiles the site and pushes it to the gh-pages branch.

Currently the user guide looks like this:
untitled

And the first iteration of the analyser looks like this:
image

Some known things to improve on:

  • Depend on mumuki-styles and the JSON viewer instead of having a drop-in
  • Add a rich text editor to the spec textarea (maybe Ace?)
  • Improve styles and copy
  • A few small code refactors such as separating the analyser into another puse html file

@ghost ghost assigned Javi Dec 20, 2018
@ghost ghost added the pending-review label Dec 20, 2018
@Javi
Copy link
Contributor Author

Javi commented Dec 20, 2018

I've made the input monospaced as it should have been in the first place, thanks to @rodri042 for the tip!

image

Copy link
Member

@flbulgarelli flbulgarelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it! I will test it locally and share my thougths.

@flbulgarelli
Copy link
Member

flbulgarelli commented Dec 21, 2018

@Javi I couldn't start the server. I got the following:

INFO    -  Building documentation... 
WARNING -  Config value: 'nav'. Warning: Unrecognised configuration name: nav 
ERROR   -  Config value: 'theme'. Error: Unrecognised theme. 

Aborted with 1 Configuration Errors!

Which mkdocs version are you using? Could you provide more installation instructions, please?

@Javi
Copy link
Contributor Author

Javi commented Dec 21, 2018

Should be fixed now! Also added instructions to top post:

mkdocs serve will host the site locally, and mkdocs gh-deploy compiles the site and pushes it to the gh-pages branch.

@ghost ghost assigned flbulgarelli Dec 24, 2018
@flbulgarelli
Copy link
Member

In addition to the improvements already mentioned, I'd add some kind of explanation and/or samples of what you can actually try. Perhaps a combo with a list of samples ready to be copied on the editor.

Also, it would be nice to be able to have an additional simplified try-it for just coding a program and selecting the language, and generating the AST.

@flbulgarelli
Copy link
Member

Also, we should stop copying mulang.js and instead deploying it as a npm package

@flbulgarelli
Copy link
Member

Depend on mumuki-styles and the JSON viewer instead of having a drop-in

I don't see any native npm/bower support for mkdocs at first glance. Perhaps we could have a docs/devinit like the following pseudo-bash-code:

echo "[Mulang::Docs] Cleaning up resources..."
rm docs/js/mulang.js
rm docs/js/mumuk-styles.js
rm docs/css/mumuki-styles.js

echo "[Mulang::Docs] Installing mulang.js..."
wget https://github.com/mumuki/mulang/releases/download/v4.2.0/mulang.js.zip | unzip > docs/js/mulang.js

echo "[Mulang::Docs] Installing mumuki-styles..."
wget https://raw.githubusercontent.com/mumuki/mumuki-styles/master/dist/css/mumuki-styles.css docs/css/mumuki-styles.css
wget https://raw.githubusercontent.com/mumuki/mumuki-styles/master/dist/javascripts/mumuki-styles.js docs/js/mumuki-styles.js

echo "[Mulang::Docs] Building the docs for first time..."
mkdocs build

echo "[Mulang::Docs] Done! Now run mkdocs serve"

@Javi
Copy link
Contributor Author

Javi commented Jan 8, 2019

@flbulgarelli Is there a published npm version of Mulang?

@flbulgarelli
Copy link
Member

flbulgarelli commented Jan 8, 2019

@flbulgarelli Is there a published npm version of Mulang?

yes! Check here https://www.npmjs.com/package/mulang

Usage:

$ npm install mulang
const mulang = require('mulang');
> mulang.analyse({
       "sample" : {
            "tag" : "CodeSample",
            "language" : "Haskell",
            "content" : "x = 1"
         },
       "spec" : {
            "smellsSet" : { "tag" : "NoSmells" },
            "expectations" : [
               {
                    "binding" : "*",
                    "inspection" : "Declares:x"
                 }
            ]
         }
    })
{ signatures: [],
  smells: [],
  expectationResults: [ { expectation: [Object], result: true } ],
  tag: 'AnalysisCompleted',
  intermediateLanguage: null }

@flbulgarelli
Copy link
Member

I have just pushed JS compiled version for 4.5.2. We should update this PR.

@flbulgarelli
Copy link
Member

Also, we should put the docs in sync with current readme

@flbulgarelli
Copy link
Member

I have just removed cinder from source control. We should do the same with json-viewer

@flbulgarelli
Copy link
Member

flbulgarelli commented Sep 8, 2019

Pending tasks:

@flbulgarelli
Copy link
Member

Deployed site with current changes

@flbulgarelli flbulgarelli merged commit 67897d0 into master Sep 23, 2019
@flbulgarelli flbulgarelli deleted the site-docs branch September 23, 2019 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Github page for this project
2 participants