Sphinx autodoc: automated API documentation
summary
Covers how to generate API documentation from Python code using Sphinx's autodoc extension plus autosummary to automatically list modules, and shows how to use the coverage and doctest extensions to find undocumented APIs and verify examples. Explains setup steps (installing Sphinx, enabling autodoc/autosummary/coverage/doctest), writing docstrings with doctest-format examples, and running make html/coverage/doctest to produce and validate docs.
AI-written summary · about
chapters (29)
- 0:00Intro
- 3:01What is the reason you do not write docstrings.
- 4:10What is Sphinx?
- 4:24The history of Sphinx (short ver.)
- 5:17Sphinx Before and After
- 6:45Sphinx extensions (built-in)
- 7:06library code example
- 7:44How to install Sphinx
- 8:22How to start a Sphinx project
- 9:46Current files structure
- 10:29setup autodoc extension
- 11:09Add automodule directive to your doc
- 12:46How does it work?
- 13:52Danger code
- 14:19execution guard on import
- 15:32"info field lists" for arguments
- 16:56Code example in a docstring
- 17:39Syntax highlighted output
- 18:58setup doctest extension
- 19:21Result of "make doctest"
- 20:40Individual pages for each modules
- 21:35setup autosummary extension
- 22:09Replace automodule with autosummary
- 22:56Output of autosummary
- 24:07setup coverage extension
- 26:19Why don't you write docstrings?
- 27:41Options for autodoc
- 29:13SV sphinxcontrib-httpdomain 3rd party ext
- 30:54Translation into other languages
related talks
02h 28mWriting Documentation with Sphinx and reStructuredText
02h 59mDocumenting your code from docstrings to automated builds
01h 06mDocument your code
34mWriting multi-language documentation using Sphinx
22mStatic Sites with Sphinx and Markdown
30mMaking Your Documentation Interactive with PyScript
30mAutoDocish: Automated-ish Dataset Documentation
18mThanks, I Made It with Quartodoc
