How can I sync documentation with Github Pages?

后端 未结 10 1331
鱼传尺愫
鱼传尺愫 2020-12-12 10:14

I have a project together with several people and we have a README.md file with a bunch of GitHub Flavored Markdown that is rendered on our GitHub page. We also

10条回答
  •  温柔的废话
    2020-12-12 10:36

    Another possibility for the method described by Nathan and Brand Rhodes is to use a great tool: FlatDoc created by Rico Sta. Cruz.

    FlatDoc will load by ajax the documentation (README.md or any other markdown file), parse it and display with all goodies and even a sidebar menu for navigation!

    It has build in its api a helper method to load files from GitHub repo master (but can also load anywhere else from the web).

    Instructions

    Start with copying the following html template into your index.html in your gh-pages branch. Continue with:

    • Replacing "USER" with your GitHub username
    • Replacing "REPO" with your GitHub repo name
    • Replacing "Your Project" with your project name

    in the file. Try it out locally in your browser. Then commit and push the changes. Now your github page will allways be updated with your README.md file in your master branch.

    If the default theme is not satisfying for you you can re-style it with your own css.

提交回复
热议问题