sphinx-apidoc

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()

Getting started with Sphinx when your source files aren't in the project base folder

北城余情 提交于 2020-05-27 13:07:03
问题 Alright, I've been struggling with Sphinx not producing any documentation from the docstrings I've written in this example code. Its a simple implementation of a stack in Python. You probably need not read all of this: src/stack.py class Stack: """Stack A simple implementation of a stack data structure in Python. """ def __init__(self): self._data = [] def push(self,item): """Push Push an item on to the stack. Args: arg: Item to be pushed to the top of the stack """ self._data.append(item)

Sphinx's autodoc's automodule having apparently no effect

南笙酒味 提交于 2020-02-15 10:23:53
问题 I am running Sphinx on a rst file containing automodule but it does not seem to have any effect. Here are the details: I have a Python project with a file agent.py containing a class Agent in it. I also have a subdirectory apidoc with a file agent.rst in it (generated by sphinx-apidoc ): agent module ============ .. automodule:: agent :members: :undoc-members: :show-inheritance: I run sphinx with sphinx-build -b html apidoc apidoc/_build with the project's directory as the current working

Sphinx's autodoc's automodule having apparently no effect

淺唱寂寞╮ 提交于 2020-02-15 10:20:47
问题 I am running Sphinx on a rst file containing automodule but it does not seem to have any effect. Here are the details: I have a Python project with a file agent.py containing a class Agent in it. I also have a subdirectory apidoc with a file agent.rst in it (generated by sphinx-apidoc ): agent module ============ .. automodule:: agent :members: :undoc-members: :show-inheritance: I run sphinx with sphinx-build -b html apidoc apidoc/_build with the project's directory as the current working

Sphinx's autodoc's automodule having apparently no effect

大憨熊 提交于 2020-02-15 10:20:12
问题 I am running Sphinx on a rst file containing automodule but it does not seem to have any effect. Here are the details: I have a Python project with a file agent.py containing a class Agent in it. I also have a subdirectory apidoc with a file agent.rst in it (generated by sphinx-apidoc ): agent module ============ .. automodule:: agent :members: :undoc-members: :show-inheritance: I run sphinx with sphinx-build -b html apidoc apidoc/_build with the project's directory as the current working

How to automatically add parameter types in sphinx documentation

孤人 提交于 2020-01-23 05:42:05
问题 I am currently trying to implement automatic documentation creation with Sphinx (using the extensions sphinx-apidoc and napoleon). This works quite well, but it would be even better if the typehints (PEP484 convention) are added automatically to the params list. I was wondering whether this is possible. More concretely: (from the napoleon example) def function_with_pep484_type_annotations(param1: int, param2: str) -> bool: """Example function with PEP 484 type annotations. Args: param1: The