python-sphinx

Python Sphinx autodoc not rendering on readthedocs

有些话、适合烂在心里 提交于 2021-02-10 05:14:02
问题 I have a Python package hosted on Github called spike2py. I have prepared my docs using Sphinx and .rst files. These files are hosted on GitHub here. I am able to successfully run make html locally and obtain the desired output. That is, the Reference Guide part of the documentation contains the API automatically generated using the docstring I have included in my code, and referenced using calls to autoclass and autofunction (reference_guide.rst). For example, here is what the first part of

Python Sphinx autodoc not rendering on readthedocs

笑着哭i 提交于 2021-02-10 05:10:53
问题 I have a Python package hosted on Github called spike2py. I have prepared my docs using Sphinx and .rst files. These files are hosted on GitHub here. I am able to successfully run make html locally and obtain the desired output. That is, the Reference Guide part of the documentation contains the API automatically generated using the docstring I have included in my code, and referenced using calls to autoclass and autofunction (reference_guide.rst). For example, here is what the first part of

autodoc directive works locally but not on readthedocs

荒凉一梦 提交于 2021-02-10 03:08:04
问题 My repo is located on github here: https://github.com/AshleySetter/optoanalysis And the docs are in https://github.com/AshleySetter/optoanalysis/tree/master/optoanalysis/docs ReadTheDocs doesn't fail but the produced documentation (hosted here: https://optoanalysis.readthedocs.io/en/latest/) doesn't display the doc strings that should be produced by the ..autodoc:: command. However it runs fine locally and displays the documentation when I open the build/html/index.html file. On ReadTheDocs

autodoc directive works locally but not on readthedocs

柔情痞子 提交于 2021-02-10 03:06:26
问题 My repo is located on github here: https://github.com/AshleySetter/optoanalysis And the docs are in https://github.com/AshleySetter/optoanalysis/tree/master/optoanalysis/docs ReadTheDocs doesn't fail but the produced documentation (hosted here: https://optoanalysis.readthedocs.io/en/latest/) doesn't display the doc strings that should be produced by the ..autodoc:: command. However it runs fine locally and displays the documentation when I open the build/html/index.html file. On ReadTheDocs

Python convert sphinx RST to HTML

北战南征 提交于 2021-02-10 02:55:27
问题 I have tried this code: from docutils.core import publish_string text = publish_string(open(file_path, 'r').read(), writer_name='html') But it says: <p>Unknown directive type "toctree".</p> So it won't work with some specific sphinx directives. What is the easiest way to do same stuff for sphinx RST files? upd. Seems like it must be: sphinx-build -b singlehtml -D extensions='sphinx.ext.autodoc' -D master_doc='index' -C /mypath/docs . How can I call that from Python code instead of console?

Python convert sphinx RST to HTML

﹥>﹥吖頭↗ 提交于 2021-02-10 02:48:45
问题 I have tried this code: from docutils.core import publish_string text = publish_string(open(file_path, 'r').read(), writer_name='html') But it says: <p>Unknown directive type "toctree".</p> So it won't work with some specific sphinx directives. What is the easiest way to do same stuff for sphinx RST files? upd. Seems like it must be: sphinx-build -b singlehtml -D extensions='sphinx.ext.autodoc' -D master_doc='index' -C /mypath/docs . How can I call that from Python code instead of console?

Python convert sphinx RST to HTML

不问归期 提交于 2021-02-10 02:47:49
问题 I have tried this code: from docutils.core import publish_string text = publish_string(open(file_path, 'r').read(), writer_name='html') But it says: <p>Unknown directive type "toctree".</p> So it won't work with some specific sphinx directives. What is the easiest way to do same stuff for sphinx RST files? upd. Seems like it must be: sphinx-build -b singlehtml -D extensions='sphinx.ext.autodoc' -D master_doc='index' -C /mypath/docs . How can I call that from Python code instead of console?

Python convert sphinx RST to HTML

被刻印的时光 ゝ 提交于 2021-02-10 02:47:10
问题 I have tried this code: from docutils.core import publish_string text = publish_string(open(file_path, 'r').read(), writer_name='html') But it says: <p>Unknown directive type "toctree".</p> So it won't work with some specific sphinx directives. What is the easiest way to do same stuff for sphinx RST files? upd. Seems like it must be: sphinx-build -b singlehtml -D extensions='sphinx.ext.autodoc' -D master_doc='index' -C /mypath/docs . How can I call that from Python code instead of console?

Make viewcode show module sources

一曲冷凌霜 提交于 2021-02-10 02:28:08
问题 I am trying to make a cookbook out of some Python snippets using Sphinx. Each snippet is a self-contained Python script and has a tutorial-type doctsring. I want to have a source link in the generated documentation to display the script contents. But viewcode does not seem to create this link for the module, but only for a function or a class with a docstring. Is there a way to coax sphinx.ext.viewcode to display the script code without having any class/function in it? 回答1: I hope you haven't

Creating a literal text block in Sphinx

淺唱寂寞╮ 提交于 2021-02-09 11:12:51
问题 I would like to make a directory tree in a docstring and have it rendered without change to my Sphinx documentation, but I am having trouble. I have tried using: single, double, and triple back-ticks; literal :code: ; and literal .. code-block:: python to get this to work. I imagine the latter two did not work because this block is also not valid Python/code. In addition I have varied the number and type of indentation and spacing, to no avail. My example (using three back-ticks to delineate