python-sphinx

Force Sphinx to interpret Markdown in Python docstrings instead of reStructuredText

Force Sphinx to interpret Markdown in Python docstrings instead of reStructuredText Question: I’m using Sphinx to document a python project. I would like to use Markdown in my docstrings to format them. Even if I use the recommonmark extension, it only covers the .md files written manually, not the docstrings. I use autodoc, napoleon and …

Total answers: 4

Python Sphinx include directive: ignore the header from included file

Python Sphinx include directive: ignore the header from included file Question: I found .. include:: directive very useful for text reuse: the same parts could be inserted in different documents. But there is a problem with header levels. For example, if I have part.rst with second level header part.rst Header level 2 —————- My text …

Total answers: 2

Include files in Sphinx output on any path

Include files in Sphinx output on any path Question: I have a project that I’m documenting where I’ve ended up with a structure like docs/ conf.py development/ architecture.rst uimockups/ index.html static/ <supporting css and js files> mockup1/ index.html ui1.html ui2.html mockup2/ index.html ui1.html ui2.html Where everything under uimockups is just a static site. For organizational …

Total answers: 2

Including ipynb files in sphinx index.rst when they are located in a subdirectory

Including ipynb files in sphinx index.rst when they are located in a subdirectory Question: I am stuck with pythons sphinx. My directory tree looks like this: | – project_root | | – importable_project | | | – importable_module.py | | | – another_importable_module.py | | | – Tutorials | | | | – tutorial1.ipynb | …

Total answers: 2

How can I prevent Sphinx from listing "object" as a base class?

How can I prevent Sphinx from listing "object" as a base class? Question: I have this class: class Class: pass The documentation generated by sphinx (in case it matters, I used the autodoc extension) looks like this: class package.Class      Bases: object The inheritance from object isn’t useful information for the reader, and therefore I …

Total answers: 4

Include my markdown README into Sphinx

Include my markdown README into Sphinx Question: I would like to include my project’s README.md into my Sphinx documentation like in Can sphinx link to documents that are not located in directories below the root document? – which is that in the resulting Sphinx html documentation I click on a link in the table of …

Total answers: 7

How to specify different return types in python docstring

How to specify different return types in python docstring Question: I’m currently writing documentation for my python package using Sphinx and the autodoc plugin. For a function return value I can e.g. write :returns: int: count which tells sphinx that there is a return value of type int, named count. I now got a function …

Total answers: 2

What is the difference between var, cvar and ivar in python's sphinx?

What is the difference between var, cvar and ivar in python's sphinx? Question: I was reading through the sphinx documentation pages and ironically found that the documentation on the difference between var, ivar, and cvar very lacking. I was wondering if someone could explain the difference between each of the different name spaces in inline …

Total answers: 3

Python – How NOT to sort Sphinx output in alphabetical order

Python – How NOT to sort Sphinx output in alphabetical order Question: With Sphinx for Python how is it possible to avoid having all the method/function names sorted alphabetically in HTML? I want to keep them in the very same order as they are found in the source code. Asked By: Alex Poca || Source …

Total answers: 2

OS X install of Sphinx: The 'sphinx-build' and 'sphinx-quickstart' not found

OS X install of Sphinx: The 'sphinx-build' and 'sphinx-quickstart' not found Question: There have been several ‘unanswered’ postings on this topic pertaining finding ‘sphinx-build’ not being able to be found: sphinx-build -h command not found in Mac OS Sphinx was installed upon OSX using both: python3 -m pip install sphinx brew install sphinx In either …

Total answers: 5