beanbag-docutils¶
This is a set of extensions to the Sphinx ReStructuredText-based documentation system used by our products to help generate better documentation
Amongst other enhancements, this package offers:
A parser for the Beanbag docstring format (a variation on the Google docstring format), which we use for Python and JavaScript documentation
Enhancements for Sphinx’s intersphinx system to provide per-page intersphinx resolution options (useful for pages, such as release notes, that need to link to different versions of the same docs, such as Django or Python)
Enhancements to ReStructuredText references to let a reference name span lines (useful for long Python/JavaScript module/class names)
Linking code references to GitHub documentation
High-DPI image embedding
A role for HTTP status codes
Access to document-defined metadata in a structured form when parsing documents
Installation¶
It’s very easy to get going. Just install beanbag-docutils like so:
$ pip install beanbag-docutils
We like to place ours in a doc-requirements.txt file in each of our
repositories, and use:
$ pip install -r doc-requirements.txt
Sphinx Extensions¶
The following extensions are provided:
autodoc_utilsEnables parsing of the Beanbag docstring format for Python.
Advanced options for defining excluded and deprecated classes/functions to skip, either in a Sphinx project’s
conf.pyor directly in the Python modules.
collect_filesAllows arbitrary supplemental files to be “collected” along with any of your documentation.
django_utilsRoles and directives for describing Django-related concepts in your documentation.
Automatic support for resolving “lazy” localized strings, so they appear correctly.
extlinksAn improved version of Sphinx’s own
sphinx.ext.extlinksthat supports anchors in the string passed to the role (e.g.,:myext:`name#anchor`).
githubProvides links to the appropriate versions of the tree in GitHub for any source code references, instead of bundling copies of the source code with the documentation.
http_roleProvides a
httprole for specifying HTTP status codes and linking them to useful documentation.
image_srcsetsDrop-in support for generating
<img srcset="...">images using the built-inimagedirective. Appropriate images can be automatically determined or manually specified.
intersphinx_utilsAllows individual documentation pages to specify which intersphinx mappings should be used if multiple mappings contained the same reference. Useful for having, say, different release notes pages linking to different versions of Python or Django documentation.
json_writerAn enhanced JSON writer that contains structured data for the docs-wide Table of Contents, and HTML for in-page anchors for docs.
Added in version 2.2.
metadataExtracts metadata from
metadirectives into the document’s metadata, allowing tools or custom doc rendering platforms to access it.
Added in version 2.2.
ref_utilsAllows Python and JavaScript references to span multiple lines, in case of very long class or module paths.
retina_imagesCollects all high-DPI versions of images (e.g., any with a
@2xin the filename) for the resulting documentation.
See Also¶
- Release Notes
- beanbag-docutils 2.4
- beanbag-docutils 2.3
- beanbag-docutils 2.2
- beanbag-docutils 2.1.1
- beanbag-docutils 2.1
- beanbag-docutils 2.0
- beanbag-docutils 1.9
- beanbag-docutils 1.8.1
- beanbag-docutils 1.8
- beanbag-docutils 1.7.1
- beanbag-docutils 1.7
- beanbag-docutils 1.6
- beanbag-docutils 1.5
- beanbag-docutils 1.4.1
- beanbag-docutils 1.4
- beanbag-docutils 1.3
- beanbag-docutils 1.2
- beanbag-docutils 1.1
- beanbag-docutils 1.0
Other Projects:
Review Board - Our extensible open source code review product.
RBCommons - Our Review Board SaaS.
Django Evolution - Advanced schema migration for Django, compatible with Django’s migrations.
Djblets - A set of utilities and infrastructure for Django-based projects.
kgb - Function spies for Python unit tests.
RBTools - Command line tools for Review Board and RBCommons.