~/talk

Sphinx autodoc: automated API documentation

Talkat EuroPython 2015 · 2015-07-20..07-26· [python]
slides:none on file

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

  1. 0:00Intro
  2. 3:01What is the reason you do not write docstrings.
  3. 4:10What is Sphinx?
  4. 4:24The history of Sphinx (short ver.)
  5. 5:17Sphinx Before and After
  6. 6:45Sphinx extensions (built-in)
  7. 7:06library code example
  8. 7:44How to install Sphinx
  9. 8:22How to start a Sphinx project
  10. 9:46Current files structure
  11. 10:29setup autodoc extension
  12. 11:09Add automodule directive to your doc
  13. 12:46How does it work?
  14. 13:52Danger code
  15. 14:19execution guard on import
  16. 15:32"info field lists" for arguments
  17. 16:56Code example in a docstring
  18. 17:39Syntax highlighted output
  19. 18:58setup doctest extension
  20. 19:21Result of "make doctest"
  21. 20:40Individual pages for each modules
  22. 21:35setup autosummary extension
  23. 22:09Replace automodule with autosummary
  24. 22:56Output of autosummary
  25. 24:07setup coverage extension
  26. 26:19Why don't you write docstrings?
  27. 27:41Options for autodoc
  28. 29:13SV sphinxcontrib-httpdomain 3rd party ext
  29. 30:54Translation into other languages
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.