python-sphinx

How should I solve the conflict of OptionParser and sphinx-build in a large project?

蓝咒 提交于 2020-01-04 06:51:58
问题 I have a large Python project with many external libraries I don't want to touch and I want to generate the documentation with sphinx. My problem is, whenever I execute "make html", I get this error: ... usage: sphinx-build [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: sphinx-build --help [cmd1 cmd2 ...] or: sphinx-build --help-commands or: sphinx-build cmd --help error: option -b not recognized make: *** [html] Fehler 1 I already figured out that this problem occurs when there is

How should I solve the conflict of OptionParser and sphinx-build in a large project?

喜夏-厌秋 提交于 2020-01-04 06:51:21
问题 I have a large Python project with many external libraries I don't want to touch and I want to generate the documentation with sphinx. My problem is, whenever I execute "make html", I get this error: ... usage: sphinx-build [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: sphinx-build --help [cmd1 cmd2 ...] or: sphinx-build --help-commands or: sphinx-build cmd --help error: option -b not recognized make: *** [html] Fehler 1 I already figured out that this problem occurs when there is

Is 3-space indentation required in reST?

房东的猫 提交于 2020-01-03 08:47:09
问题 I'm documenting my Python code using Sphinx, and read in the Python developer's guide (and I think elsewhere as well) that reST files use an indentation of 3 spaces: All reST files use an indentation of 3 spaces; no tabs are allowed. This is the case for the example I copied for my index file, and some other files where my IDE picked up the 3-space indentation and used it for the whole page. The sphinx-apidoc extension also uses 3 spaces for the modules.rst file it builds. On the other hand,

Sphinx-quickstart doesn't work

我与影子孤独终老i 提交于 2020-01-02 06:13:19
问题 I am trying to install sphinx on a remote machine. Since I don't have an access to the root, I did this: $bash $mkdir -p ~/local/lib/python2.7/site-packages $export PYTHONPATH=$PYTHONPATH:~/local/lib/python2.7/site-packages $export PATH=$PATH::~/local/lib/python2.7/site-packages $easy_install -U --prefix=$HOME/local Sphinx But apparently, $easy_install doesn't build sphinx-quickstart; when I type $sphinx-quickstart I get the following message: bash: sphinx-quickstart: command not found I

Non-TOC headings within a Restructuredtext page

不羁的心 提交于 2020-01-02 04:54:11
问题 I'm writing some documentation using Sphinx. Is there a way to format headings within a page which do not become part of the TOC? Ideally with some hierarchy that is reflected in formatting? E.g. I want to do My page TOC heading =================== Subheading (not in TOC, and should be formatted e.g. smaller than the heading) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub-subheading (not in TOC, and formatted e.g. smaller than the subheading) ###############################

Sphinx, the best practices

给你一囗甜甜゛ 提交于 2020-01-02 00:50:25
问题 I just started to use Sphinx tool to generate a documentation for my code. But I'm a bit confused because it's not as easy as I expected. I create the Sphinx doc using: sphinx-quickstart and then I create my *.rst files into the "source" folder. Seems like I need to create a *.rst file for each module I want to create a document for. For test.py, I create test.rst. Inside test.rst, I have: .. automodule:: test :members: :show-inheritance: Then inside test.py, I have: """ .. module:: test

How do I add a 'previous chapter' and 'next chapter' link in documentation generated by Sphinx?

£可爱£侵袭症+ 提交于 2020-01-01 10:50:30
问题 When I look at documentation, the most pages have a previous chapter and next chapter link/button at the bottom, for example virtualenv. I can't find out how to accomplish this for my project documentation using the Sphinx documentation tool. Could someone tell me how this works or point me to a useful resource (although I already searched a lot)? 回答1: The sphinx-doc.org documentation on templating mentions the next and prev variables: The next document for the navigation. This variable is

Force Sphinx to interpret Markdown in Python docstrings instead of reStructuredText

安稳与你 提交于 2020-01-01 06:27:11
问题 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 recommonmark in my extensions. How can I make sphinx parse markdown in my docstrings? 回答1: Sphinx's autodoc extension emits an event named autodoc-process-docstring every time it processes a doc-string. You can hook into that mechanism to convert the

Force Sphinx to interpret Markdown in Python docstrings instead of reStructuredText

ぃ、小莉子 提交于 2020-01-01 06:27:09
问题 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 recommonmark in my extensions. How can I make sphinx parse markdown in my docstrings? 回答1: Sphinx's autodoc extension emits an event named autodoc-process-docstring every time it processes a doc-string. You can hook into that mechanism to convert the

Structuring Sphinx documentation

拥有回忆 提交于 2020-01-01 04:30:10
问题 I have started documenting a Python project using Sphinx. It is the first time I use it - I am used to tools which work with a JavaDoc-like syntax, and I have some doubts. Since I want the documentation to appear near the code, I make use of the .. automodule:: , .. autoclass:: and .. automethod:: directives. So the structure of my documentation is as follows: index.rst contains the TOC and .. automodule:: my_main_package and then the top-level __init__.py contains directives like ..