-
Notifications
You must be signed in to change notification settings - Fork 47
Description
As discussed under #9, more closely integrating and structuring the existing documentation with the mocket
source code would be desirable. I am raising this issue or discussing how to actually do this.
Current documentation
At the time of writing, the README
describes all existing mocket
documentation. The outlinks in the section "How to use it" are all still relevant despite their age. Many examples are also given in the section "Example of how to mock an HTTP[S] call" and onwards.
Currently the codebase does not seem to make use of docstrings.
Requirements for the new documentation
Here are some concerns I came up with that might need a second opinion:
-
A separate
docs/
directory with plain text will get out of sync with the code and is unmaintainable, so a system to automatically derive documentation from docstrings etc. in the code and test it and so forth seems worthwhile. -
The project already uses
reStrucuturedText
(RST) markup so it makes sense to use a system that uses that as well (instead of e.g. MarkDown). -
It should have an option to collect all in-code documentation into some kind of (HTML?) document for referencing à la Rust's
cargo
. Hosting such documentation online would be a second step that would be useful for raising the visibility ofmocket
, but that depends on the resources available to themocket
maintainers and is outside the scope of this issue. Just giving downstream users the options to compile such a document (locally) is already valuable. -
Despite the first requirement, we already have a few general examples of
mocket
usage (instead of demonstration of a specific class or function). A documentation system that also supports some kind ofexamples/
directory that is checked / compiled as part of the documentation workflow would be nice.
On the topic of the above requirement, this webpage sketches out the different types and purposes of Python documentation and might be relevant on deciding how to focus documentation efforts.
Frameworks to choose from
The first search engine hit already gives quite an impressive list (see there). Here are some notes on only some of the systems listed:
-
Sphinx already uses RST.
-
Read The Docs seems the most prevalent in the Python ecosystem. I believe it is also linked to the webhosting service they seem to provide.
-
doctest
Already in the standard library, but I don't believe it does more than validate code examples within docstrings. Not sure if it supports RST. -
Doxygen It seems a bit silly to use this language-agnostic tool for a Python project given all the other Python-specific projects. I am pretty sure it does not support RST. I also do not like it personally.
Does anybody have recommendations / previous experience? Do we need a longer list of options to choose from?
Next steps
Once there some kind of consensus on what to use, I suggest that the first step would be to (raise a new issue to) put the relevant parts of all the current documentation under version control in this repository and integrate it in the chosen system and work from there.
There is also the machine-generated documentation that seems pretty extensive but which I personally would not feel comfortable providing for downstream users without people with experience with the code base validating and committing each of its claims (but maybe I am just not following along with the times).
As discussed under the aforementioned #9, further prose documentation on each item in the API interface can be based on the extensive test suite.