How to make sphinx look for modules in virtualenv while building html?

The problem is correctly spotted by Mathijs. $ which sphinx-build /usr/local/bin/sphinx-build I solved this issue installing sphinx itself in the virtual environment. With the environment activated: $ source /home/migonzalvar/envs/myenvironment/bin/activate $ pip install sphinx $ which sphinx-build /home/migonzalvar/envs/myenvironment/bin/sphinx-build It seems neat enough.

Automatically Generating Documentation for All Python Package Contents

You can try using sphinx-apidoc. $ sphinx-apidoc –help Usage: sphinx-apidoc [options] -o <output_path> <module_path> [exclude_paths, …] Look recursively in <module_path> for Python modules and packages and create one reST file with automodule directives per package in the <output_path>. You can mix sphinx-apidoc with sphinx-quickstart in order to create the whole doc project like this: $ … Read more

Parsing reStructuredText into HTML

Try something like this: >>> from docutils.core import publish_string >>> publish_string(“*anurag*”, writer_name=”html”) publish_string accepts a strings and outputs a string or you can use publish_parts to get specific parts of html document e.g. >>> from docutils.core import publish_parts >>> print publish_parts(“*anurag*”, writer_name=”html”)[‘html_body’] <p><em>anurag</em></p>

Modifying content width of the Sphinx theme ‘Read the Docs’

Another option is to create a stylesheet in source/_static with just the css you want, e.g. .wy-nav-content { max-width: none; } or .wy-nav-content { max-width: 1200px !important; } Make sure the directory is referenced in source/conf.py – I believe by default there’s a line to do this, i.e. # Add any paths that contain custom … Read more

Are there any real alternatives to reStructuredText for Python documentation? [closed]

I have created a Sphinx extension that parses both Google style and NumPy style docstrings, and converts them to standard reStructuredText. To use it, simply install it: $ pip install sphinxcontrib-napoleon And enable it in conf.py: # conf.py # Add autodoc and napoleon to the extensions list extensions = [‘sphinx.ext.autodoc’, ‘sphinxcontrib.napoleon’] More documentation on napoleon … Read more

How to include a local table of contents into Sphinx doc?

I’m not 100% sure this is what you’re looking for, but the .. contents:: directive may help. By default, it’ll give you the headings for the whole page, wherever you put the directive. With :local: specified, it will generate a local TOC for the headings below where you put the directive (handy for sub-section tocs). … Read more

How do we embed images in sphinx docs?

From the documenation: There are two image directives: image and figure. An image is a simple picture. A figure consists of image data (including image options), an optional caption (a single paragraph), and an optional legend (arbitrary body elements). For page-based output media, figures might float to a different position if this helps the page … Read more

Multi-line description of a parameter description in python docstring

Good research effort from the Original Poster. It is a surprise that the canonical sphinx documentation does not give a multi-line example on params, despite the fact that multi-line document is inevitable due to the 79-character guideline in PEP8. In practice, considering that your parameter name itself is typically a word or even longer snake_case_words, … Read more