autodoc

Sphinx autodoc functions within module

半腔热情 提交于 2021-02-18 12:42:14
问题 I am just getting started with sphinx and willing to learn. I would like to break up my various functions into different sections within my index.rst file. So each function has it's own header. So for example if I have a python file named test.py and within that file I have 2 functions: def foo(): """This prints bar""" print("bar") def bar(): """This prints foo""" print("foo") How could I within the index.rst separate the 2 functions within my test.py file? :mod:`test` -- foo .. automodule::

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

sphinx autodoc for python doesn't show anything (on readthedocs)

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-09 11:01:17
问题 I have this python package that I'd like to automatically document using Sphinx. I've inserted docstrings in every functions and classes. I made an account on ReadTheDocs, and did the setup accordingly (i.e., a docs/ dir with a conf.py file). Then, basically, I've tried almost everything: every combination of autodoc:: , autofunction:: , autoclass:: ; I tried using the same conf.py file as other packages which documented API (with specific changes made according to my case, of course); but it

How can I show inherited members of a class in my Sphinx documentation?

穿精又带淫゛_ 提交于 2021-02-08 12:45:55
问题 I want to document some classes which all derive from the same base class with some common attributes and I would like to repeat the documentation for every attribute in the subclasses, so that I can see all the attributes for a class in a single place. So for instance I have this code: class Base(object): """Base class.""" #: First attribute a = int #: Second attribute b = str class FirstChild(Base): """First Child of Base.""" #: Child attribute c = float class SecondChild(Base): """Second

How can I show inherited members of a class in my Sphinx documentation?

本小妞迷上赌 提交于 2021-02-08 12:45:15
问题 I want to document some classes which all derive from the same base class with some common attributes and I would like to repeat the documentation for every attribute in the subclasses, so that I can see all the attributes for a class in a single place. So for instance I have this code: class Base(object): """Base class.""" #: First attribute a = int #: Second attribute b = str class FirstChild(Base): """First Child of Base.""" #: Child attribute c = float class SecondChild(Base): """Second

sphinx-apidoc picks up submodules, but autodoc doesn't document them

懵懂的女人 提交于 2021-02-07 14:19:27
问题 I've been working on a project for PyQt5 ( found here: https://github.com/MaVCArt/StyledPyQt5 ) which uses a package structure to make imports a bit more logical. I've been relatively successful in documenting the code so far with Sphinx, at least up until I introduced the package structure. ( before, everything was in one folder ) The following is the problem: when I run sphinx-apidoc, everything runs fine, no errors. What's more, autodoc picks up all my submodules just fine. This is the

Include __main__.py in sphinx-apidoc generated files

回眸只為那壹抹淺笑 提交于 2021-02-05 08:27:33
问题 I am not able to add my __main__.py file correctly and its functions while generating RST file with sphinx-apidoc . Other files and classes are generated correctly. I works only if I run sphinx-apidoc with -P parameter which includes private modules. But I do not want to add private methods of other modules, I need these from __main__.py only. __main__.py looks like this: def main(): """ main() description here """ f1() f2() if __name__ == '__main__': main() I would like to have main() , f1()

Sphinx does not recognize subfolders

若如初见. 提交于 2021-02-05 03:20:33
问题 I'm new in using Sphinx . I'm able to create HTML documentations as long as my files are in the source top folder. As soon as I'm putting them in a subfolder in the source directory , Sphinx does not include the document into the build. Sphinx tells me after generating that the test document is not included. So, it sees the file but does not include it. Did I miss anything? Do I have to specify any subfolders in the index.rst file or in the config.py ? My index.rst file: Welcome to python

genindex and modindex footer links don't work in readthedocs.io

纵饮孤独 提交于 2021-01-29 06:49:46
问题 I have a Python project using Sphinx for docs. I am building the docs remotely on readthedocs.io service. I used sphinx-quickstart and it generated an index.rst file with these links in the footer: Indices and tables ~~~~~~~~~~~~~~~~~~ * :ref:`genindex` * :ref:`modindex` * :ref:`search` When I push changes to readthedocs.io and build the docs, my build succeeds. Docs that I manually linked via toctree directive all work fine. The search link works fine. But the genindex link goes to an empty