Get More reST: Making Changes
Explore how to document Python functions using reStructuredText within docstrings. Understand how to format descriptions, parameters, return values, and custom fields in Sphinx to create clear, readable, and well-structured code documentation.
We'll cover the following...
What is reST?
The documentation strings in Python functions are interpreted as reStructured Text (reST). This is a markup language, like Markdown, that attempts to preserve readability. It includes both in-line markups, such as bold text, lists, and directives instructing the document generator to create special blocks, such as inserting images or a table of contents.
Making some changes
We can use reST to create fields in the documentation strings by surrounding a word with colons. Here is how we might document the post method.
The documentation style chosen here was just one ...