Publishing The Documentation

The Python template automatically generates documentation for your project. Provided that you document your source code with Python docstrings, the Python template should be set up to use sphinx to generate nicely formatted html documentation, using the command

tox -e docs

We use readthedocs to host our documentation, as it is then easily accessible to all and sundry. At this stage you’ll need to create an account on readthedocs. This is easy and free.

Once you have an account, you can import your project manually readthedocs_import, filling in the project name and the project url (github/etc)

Fill in the boxes Fill in the boxes

Now you need to connect your readthedocs project to your GitHub project, we use a webhook to do this. Go to the admin area of your readthedocs project, and add a github_incoming_webhook integration.

Fill in the boxes

This will guide you through the process and give a url you can add to your GitHub project. Return to GitHub and go to project settings.

Fill in the boxes

And enter the readthedocs url into the URL field.

Fill in the boxes

Test it out. Your documentation on readthedocs should now be automatically updated each time you push a commit to GitHub. You should go to build menu in your readthedocs project.

Fill in the boxes