Include my markdown README into Sphinx

You need to edit your readme_link.rst as follows: Readme File =========== .. mdinclude:: ../../README.md Note that the section header is designated with = characters rather than – characters. There are two factors that contribute to that. How include works Standard include (not mdinclude) actually reads the content of the source file and simply copies the … Read more

Documenting class attributes with type annotations

I do not think you can put an Attribute section inside of your docstring to get your desired results. I tried giving each attribute a doc comment and specified the type and desired comment. class DataHolder: “”” Class to hold some data Each attribute needs its own doc comment with its type “”” #: bool: … Read more

How to expand all the subsections on the sidebar toctree in Sphinx?

Well, i lost approximately 3.4M neurons trying to read sphinx source code (was it written by a bunch of rabbid reckless raccoons ?! so many levels of abstraction). So : make your own sphinx theme (use a 3rd party theme as a base, very easy. I use ‘readable’ theme for that) in the directory where … Read more

Python – How NOT to sort Sphinx output in alphabetical order

From the sphinx.ext.autodoc documentation: autodoc_member_order This value selects if automatically documented members are sorted alphabetical (value ‘alphabetical’), by member type (value ‘groupwise’) or by source order (value ‘bysource’). The default is alphabetical. Note that for source order, the module must be a Python module with the source code available. So somewhere in your conf.py file, … Read more

Using Sphinx to write personal websites and blogs

I’ve done it at http://reinout.vanrees.org/weblog. The key trick is to add a preprocessor step. I’ve got my blog entries in a weblog/yyyy/mm/dd/ folder structure. A script iterates through that folder structure, creating index.txt files in every directory, listing the sub-items. The normal Sphinx process then renders those index.txt files. I added a custom Sphinx processor … Read more

How to make an internal link to a heading in sphinx restructuredtext without creating arbitrary labels?

reStructuredText supports implicit hyperlink targets. From the reStructuredText quick reference: Section titles, footnotes, and citations automatically generate hyperlink targets (the title text or footnote/citation label is used as the hyperlink name). So the following text (lifted from the reStructuredText quick reference, spelling mistakes and all): Titles are targets, too ======================= Implict references, like `Titles are … Read more

Which files should I tell my VCS to ignore when using Sphinx for documentation? [closed]

If you take a look at the contents of Makefile you’ll see something as follows: BUILDDIR = build … clean: -rm -rf $(BUILDDIR)/* This means that make clean just removes the build directory so, with regard to version control, ignoring the contents of the build directory should be enough as you already suspected.