UCL-COMP0233-24-25 / RSE-Classwork

6 stars 86 forks source link

Generating documentation with Sphinx #20

Open dpshelio opened 3 weeks ago

dpshelio commented 3 weeks ago

This exercise will introduce you to the basics of Sphinx using the same code you looked at in the previous exercise.

Setup

(Note: You will be able to complete this exercise even if you haven't finished the previous one - the only difference is that some of your generated documentation will be different)

Understanding

Exercises

Getting started with Sphinx

Modifying index.rst

Adding content and structure

Average Squares Documentation
=============================

Using Docstrings to create documentation

As you saw in the previous exercise the code in this project contains some docstrings - let's show this in our Sphinx generated documentation

# -- Path setup --------------------------------------------------------------

import os
import sys
sys.path.insert(0, os.path.abspath('..'))

Updating your PR

Commit the changes to your branch, updating the PR you created in the previous exercise. Add a comment with Answers UCL-COMP0233-24-25/RSE-Classwork#20

Explore further features of Sphinx

There are many additional features of Sphinx - explore them if you have time. For example:


Sample solution as changes made on sphinx-setup branch