Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload html documentation generated from sphinx to github?

I just documented loads of my code and learnt how to use sphinx to generate the documentation. I want to include that into my GitHub project page but I do not know how to. Does anyone know existing tutorial or simple step to do so?

like image 743
leon Avatar asked Oct 12 '09 10:10

leon


People also ask

How do I publish a document on GitHub?

Publishing from a branchOn GitHub, navigate to your site's repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Pages. Under "Build and deployment", under "Source", select Deploy from a branch.

Does Sphinx support markdown?

To support Markdown-based documentation, Sphinx can use MyST-Parser. MyST-Parser is a Docutils bridge to markdown-it-py, a Python package for parsing the CommonMark Markdown flavor.


2 Answers

github will serve static content for you using their github pages feature. Essentially, you create a branch called gh-pages, into which you commit your static pages. The pages are then served at you.github.com/yourproject.

See the instructions at http://pages.github.com/.

You will likely run into an issue using Sphinx on github, because Sphinx uses directories with leading underscores. You can fix this by adding a file called .nojekyll in the the directory with the generated sphinx html.

like image 158
John Paulett Avatar answered Sep 22 '22 21:09

John Paulett


John Paulett's answer is obviously correct and likely sufficient for most users already (+1).

Alternatively you might want to check out Ben Welsh's thorough tutorial Sphinx documentation on GitHub, which provides step by step instructions as well as a convenient Fabric based script/task tying those together to get you started to Quickly publish documentation alongside your code [...] via a single command.

like image 24
Steffen Opel Avatar answered Sep 19 '22 21:09

Steffen Opel