No generation of the module index “modindex” when using Sphinx

Short version run sphinx-apidoc -o . mymodule uncomment and modify conf.py. For this example, sys.path.insert(0, os.path.abspath(‘mymodule’)) re-run make html Long answer I can reproduce the issue with this sample module: $cat mymodule/mymodule.py def fn1(): ”’First function”’ pass def fn2(): ”’Second function”’ pass Running sphinx-quickstart produces the following tree: $tree . ├── Makefile ├── _build ├── … Read more

How to include the toctree in the sidebar of each page

You can customize your html sidebar in conf.py. The default html sidebar consists of 4 templates: [‘localtoc.html’, ‘relations.html’, ‘sourcelink.html’, ‘searchbox.html’] In conf.py you could change localtoc.html to globaltoc.html like this: html_sidebars = { ‘**’: [‘globaltoc.html’, ‘relations.html’, ‘sourcelink.html’, ‘searchbox.html’] } Since this in the end this will be used in HTML files, this should work on … 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

How can I link/reference another reST file in the documentation?

To create links between different reStructuredText (.rst) files you can use the inline markup provided by sphinx. See the documentation under the heading Cross-referencing documents on top of the file you define its label .. _my-reference-label: then you can link to it from other documents using :ref:`my-reference-label`. I do not believe you need to use … Read more

Format text in a link in reStructuredText

This construct: Here you have |optparse.OptionParser|_. .. |optparse.OptionParser| replace:: “optparse.OptionParser“ documentation .. _optparse.OptionParser: http://docs.python.org/library/optparse.html produces this HTML (some linebreaks added): <p>Here you have <a class=”reference external” href=”http://docs.python.org/library/optparse.html”> <tt class=”docutils literal”><span class=”pre”>optparse.OptionParser</span></tt> documentation</a>. </p> I realize that this is not exactly what you asked for, but maybe it’s close enough. See also http://docutils.sourceforge.net/FAQ.html#is-nested-inline-markup-possible.

Sphinx error: Unknown directive type “automodule” or “autoclass”

The same thing happened to me! To fix it, go to the line in conf.py that says something like this: extensions = [‘sphinx.ext.todo’, ‘sphinx.ext.viewcode’] Yours will probably look different. Anyway, add ‘sphinx.ext.autodoc’ to the list. e.g. extensions = [‘sphinx.ext.todo’, ‘sphinx.ext.viewcode’, ‘sphinx.ext.autodoc’] If it was: extensions = [] then you’d change it to: extensions = [‘sphinx.ext.autodoc’] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)