patterns icon indicating copy to clipboard operation
patterns copied to clipboard

Convert to mkdocs

Open bentsherman opened this issue 3 years ago • 10 comments

This PR converts the docs from asciidoc to markdown / mkdocs material. This conversion is a prerequisite to merging the Nextflow docs, patterns, and Seqera training into a single docs site, which will be markdown. The PR includes the HTML build in public, so the Github pages just needs to be reconfigured to point to public directory.

To install mkdocs:

pip install mkdocs-material

To serve the website during development:

mkdocs serve

To build the static HTML:

mkdocs build

Easy!

bentsherman avatar Jun 20 '22 12:06 bentsherman

I am following Paolo's convention here. He builds the asciidoc to html and commits it to the repository, then Github Pages hosts it. I figure we will adopt a different practice once we move forward with the website overhaul.

bentsherman avatar Jun 20 '22 21:06 bentsherman

Ah ok. Mkdocs Material actually has built in functionality specifically for GitHub Actions / Pages where it builds and commits to a gh-pages branch for you but yeah like you say, no big deal especially as it's short term.

ewels avatar Jun 21 '22 05:06 ewels

This looks nice. One thing, the mkdocs build creates the HTML into public/ instead it should be docs/ to make it work with GitHub pages.

It would be nice also to add a GH action to automate the process

pditommaso avatar Jun 21 '22 07:06 pditommaso

If we're going down this route: https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions

Preference is to clean the built files out of the main development branch. The above built-in functionality builds and pushes the compiled static output to a separate branch called gh-pages which only ever contains rendered site. Then you configure the repo to build GitHub Pages from that branch.

I much prefer it as the git commit history is clean and it's clear what's editable and what's not.

ewels avatar Jun 21 '22 12:06 ewels

I like Phil's idea. I will try to set it up.

bentsherman avatar Jun 21 '22 12:06 bentsherman

Finally! test action is good to go. deploy action should work once you merge, and then you'll need to change the Github Pages settings to use gh-pages branch.

bentsherman avatar Jun 21 '22 13:06 bentsherman

then you'll need to change the Github Pages settings to use gh-pages branch

How?

pditommaso avatar Jun 22 '22 11:06 pditommaso

Go to Settings > Pages and then you will see the option under Source. You can change the branch and I also think you'll need to change the directory to root.

bentsherman avatar Jun 22 '22 12:06 bentsherman

Looks like I have access to these settings too so happy to do it once we merge 👍🏻

ewels avatar Jun 22 '22 13:06 ewels

https://github.com/nextflow-io/patterns/settings/pages

Branch isn't there yet, but should appear once this PR is merged and the GitHub Action runs:

image

ewels avatar Jun 22 '22 13:06 ewels

Was missing this. Merging

pditommaso avatar Oct 27 '22 18:10 pditommaso

Great stuff - thank you @pditommaso ! The GitHub action worked and we now have the generated site in the gh-pages branch: https://github.com/nextflow-io/patterns

The repo settings now need updating as mentioned in my comment above. I'm not sure what happened between June and now, but I no longer have admin access to this repo so can't see the settings to do it myself now sorry.

The patterns site is broken for now until this switch is pulled: http://nextflow-io.github.io/patterns/index.html

Phil

ewels avatar Oct 27 '22 19:10 ewels

I just pressed a button 😄

pditommaso avatar Oct 27 '22 19:10 pditommaso

he patterns site is broken for now until this switch is pulled: http://nextflow-io.github.io/patterns/index.html

What is missing for this?

pditommaso avatar Oct 27 '22 19:10 pditommaso

Go to Settings > Pages and then you will see the option under Source. You can change the branch and I also think you'll need to change the directory to root.

bentsherman avatar Oct 27 '22 20:10 bentsherman

See the screenshot in my comment above:

https://github.com/nextflow-io/patterns/settings/pages

image

ewels avatar Oct 27 '22 21:10 ewels