python-sphinx

Sphinx: Place heading between automethod entries

女生的网名这么多〃 提交于 2020-04-14 08:18:01
问题 I'm using Sphinx to document a class with a lot of methods. I'd like to group the methods into sections, separated by headers, like this: .. autoclass:: MyClass .. automethod:: __init__ FooBar Methods -------------- .. automethod:: foo .. automethod:: bar BazQux Methods -------------- .. automethod:: baz .. automethod:: qux But that doesn't seem to work. Is it possible to somehow break the method list up into named sections? 回答1: Sections with headings are top-level constructs and they can't

Sphinx: autodoc can`t import module

删除回忆录丶 提交于 2020-03-23 14:09:09
问题 I have following problem with sphinx. My project structure is |--project |--api |--__init__.py |--rpc.py |--v1 |--__init__.py |--model.py |--build |--source |--conf.py |--Makefile In conf.py I Have import os import sys sys.path.insert(0, os.path.abspath('..')) If I run pipenv run sphinx-build ./source ./build I got following errors: WARNING: autodoc: failed to import module 'api.rpc'; the following exception was raised: No module named 'api' WARNING: autodoc: failed to import module 'api';

Sphinx: Use a different directive for a different output format

。_饼干妹妹 提交于 2020-03-15 07:15:06
问题 Assume you have a reStructuredText document and want to export it in two formats using Sphinx 2.x: HTML and PDF. You want to put some slightly different contents in these two formats. For example, the text "I am HTML" appears in the HTML version whereas "I am PDF" appears in the PDF version in the same location of the document. Use a replace directive like below will give you "I am HTML" regardless of the export format. .. |foo| replace:: HTML ⋮ I am |foo| Can you use a different directive

Sphinx extension - installation of sphinxcontrib-bibtex

最后都变了- 提交于 2020-03-05 04:42:07
问题 Osx 10.11.6 El Capitan I need help in the installation of sphinxcontrib-bibtex (https://github.com/mcmtroffaes/sphinxcontrib-bibtex). I tried in many ways, but I could not compile using the make command. ➜ thesis_source git:(master) ✗ make html Running Sphinx v1.6.3 loading translations [es]... done Extension error: Could not import extension sphinxcontrib.bibtex (exception: No module named oset) make: *** [html] Error 1 Osx 10.11.6 El Capitan Sphinx 1.7.4 sphinxcontrib-bibtex 0.4.0

Documenting multiple Python packages on one Sphinx page

拜拜、爱过 提交于 2020-03-05 03:53:30
问题 I'm trying to create Sphinx documentation for several Python packages. I've been able to make a main page that lists the two packages I've made, like so: However, when I click through either of the packages, The modules are listed, but without any of their docstrings/documentation: When I make documentation for one of the folders ( data-analytics-bc3-api , for example), I can make a single page without issue, following the instructions here. However, when I try to make one page that covers

Sphinx Latex break line autodoc

有些话、适合烂在心里 提交于 2020-03-05 01:34:12
问题 I am making my python docs with sphinx-apidoc. But some text seems messed up because the line does not break in certain cases. I have tried to set latex_elements on config.py with preamble, but the result is the same. You can also see that the methods table also is a little confusing with a word in front of the other. latex_elements = { 'papersize': 'a4paper', 'pointsize': '12pt', 'figure_align': 'htbp', 'preamble': r''' \usepackage[draft]{minted} \fvset{breaklines=true} ''', } Have you had

Sphinx Latex break line autodoc

柔情痞子 提交于 2020-03-05 01:31:53
问题 I am making my python docs with sphinx-apidoc. But some text seems messed up because the line does not break in certain cases. I have tried to set latex_elements on config.py with preamble, but the result is the same. You can also see that the methods table also is a little confusing with a word in front of the other. latex_elements = { 'papersize': 'a4paper', 'pointsize': '12pt', 'figure_align': 'htbp', 'preamble': r''' \usepackage[draft]{minted} \fvset{breaklines=true} ''', } Have you had

Sphinx Latex break line autodoc

大兔子大兔子 提交于 2020-03-05 01:31:01
问题 I am making my python docs with sphinx-apidoc. But some text seems messed up because the line does not break in certain cases. I have tried to set latex_elements on config.py with preamble, but the result is the same. You can also see that the methods table also is a little confusing with a word in front of the other. latex_elements = { 'papersize': 'a4paper', 'pointsize': '12pt', 'figure_align': 'htbp', 'preamble': r''' \usepackage[draft]{minted} \fvset{breaklines=true} ''', } Have you had

Sphinx c++ documentation : having working links in code-blocks

别说谁变了你拦得住时间么 提交于 2020-02-28 06:05:28
问题 I have written a Sphinx documentation for a C++ API. The class and function reference works fine, with clickable links. However, if I write a code block with .. code-block:: cpp , nothing is recognized as documented class and functions, and they are not clickable. Is code-block not interconnected at all with Sphinx C++ Domain? Is there any workaround? Thanks! 来源: https://stackoverflow.com/questions/52645716/sphinx-c-documentation-having-working-links-in-code-blocks

Sphinx c++ documentation : having working links in code-blocks

最后都变了- 提交于 2020-02-28 06:05:11
问题 I have written a Sphinx documentation for a C++ API. The class and function reference works fine, with clickable links. However, if I write a code block with .. code-block:: cpp , nothing is recognized as documented class and functions, and they are not clickable. Is code-block not interconnected at all with Sphinx C++ Domain? Is there any workaround? Thanks! 来源: https://stackoverflow.com/questions/52645716/sphinx-c-documentation-having-working-links-in-code-blocks