This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Generating documentation with Sphinx #101
Labels
Comments
Open
Open
umitozmen
added a commit
to umitozmen/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
AndriusVaitkus97
added a commit
to AndriusVaitkus97/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
AndriusVaitkus97
added a commit
to AndriusVaitkus97/rse-classwork-2020
that referenced
this issue
Nov 18, 2020
Open
Open
DavidScobie
referenced
this issue
in DavidScobie/rse-classwork-2020
Nov 18, 2020
Open
liamchalcroft
added a commit
to liamchalcroft/rse-classwork-2020
that referenced
this issue
Nov 19, 2020
Open
rmapjs1
added a commit
to rmapjs1/rse-classwork-2020
that referenced
this issue
Jan 6, 2021
Answering UCL UCL-RITS#101
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This exercise will introduce you to the basics of Sphinx using the same code you looked at in the previous exercise (#100).
Setup
week06/average-squares-example
folder that you used in the previous issue.Understanding
average_squares
folder and your task is to generate some documentation to go alongside it.Exercises
Getting started with Sphinx
docs
folder alongside theaverage_squares
folder - this is where your documentation for the project will be storeddocs
folder runsphinx-quickstart
to generate the scaffolding files that Sphinx needsno
forSeparate source and build directories
- this should be the default but if chosen incorrectly will mean your folder structure won't match up to the instructions belowsphinx-build . _build/html
ormake html
to generate html docs_build/html/index.html
to see the built documentation in a browserModifying
index.rst
index.rst
file - this is the master document that serves as the entrypoint and welcome page to the documentation.Adding content and structure
docs
folder create a subfolder calledcontent
.docs/content
create a file calledaverage-squares-docs.rst
with the following contents:toctree
directive inindex.rst
so that this new file is included.Using Docstrings to create documentation
As you saw in the previous exercise (#100) the code in this project contains some docstrings - let's show this in our Sphinx generated documentation
autodoc
functioncontent/average-squares-docs.rst
file to include docstrings from the code automatically?docs/conf.py
in the following way so it is easier for Sphinx to find the location of the codeUpdating your PR
Commit the changes to your branch, updating the PR you created in the previous exercise. Add a comment with
Answers UCL-RITS/rse-classwork-2020#101
Explore further features of Sphinx
There are many additional features of Sphinx - explore them if you have time. For example:
The text was updated successfully, but these errors were encountered: