Generate reference documentation
PyCharm helps produce the formatted API documentation, using the following documentation generators:
Mind the following:
The documentation generators should be properly installed on your machine. For more information, refer to their respective download and installation pages.
PyCharm recognizes the docstring format and uses the documentation source directory defined in the Python Integrated Tools page of the Settings dialog.
Select DocUtil task run/debug configuration, and change it as required: specify the configuration name, input and output directories, and optional keys.
Launch this run/debug configuration, as described in the section Run and rerun applications.
Ensure that the Sphinx package has been installed with the Python interpreter (Settings | Project <project name> | Python Interpreter). For more information about installing a package, refer to Install, uninstall, and upgrade packages.
In the main menu, go to Tools | Sphinx quickstart.
If the Sphinx working directory is not specified in the Python Integrated Tools page, the Set working directory dialog opens, suggesting to specify the path to the documentation.
note
If the Sphinx working directory is specified in your project, this dialog will not appear.
In the console that opens in PyCharm, answer the questions provided by the sphinx-quickstart utility. In particular, specify the source directory, where the generated conf.py file will be stored. If, answering this question, you just press Enter, PyCharm will use either the path you've specified in the previous step, or the path specified in the Sphinx working directory field of the Python Integrated Tools page.
tip
The sphinx-quickstart utility is performed only once for a particular directory. If you want to generate the Sphinx infrastructure in a different directory, specify it in the Sphinx working directory field of the Python Integrated Tools page.
Open the Run/Debug Configuration dialog in one of the following ways:
Select Run | Edit Configurations from the main menu.
With the Navigation bar visible (View | Appearance | Navigation Bar), choose Edit Configurations from the run/debug configuration selector.
Press AltShiftF10 and then press 00.
In the Run/Debug Configuration dialog, click on the toolbar or press AltInsert. The list shows the run/debug configuration templates.
Select Sphinx task run/debug configuration, and change it as required: specify the configuration name, input and output directories.
Launch this run/debug configuration, as described in the section Run and rerun applications.
Thanks for your feedback!