Cheatography
https://cheatography.com
Step by step instruction to automatically generate docs with Sphinx
for Python project
INSTALLATIONconda install sphinx | Install sphinx package | conda install sphinx_rtd_theme | Install theme for docs |
INITIAL SETUPmkdir docs | Create docs folder in project directory | cd docs | Move to docs directory | sphinx-quickstart | Fill in details about your project |
MODIFY CONFIGURATION FILE (docs/source/conf.py)## Uncomment and add path to project files (lines 13-15)
import os
import sys
sys.path.insert(0, os.path.abspath('../project_dir'))
## Update extensions (line 30)
extensions = ['sphinx.ext.autodoc','sphinx.ext.napoleon']
## Update the theme (line 50)
html_theme = 'sphinx_rtd_theme'
|
| | GENERATE DOCSsphinx-apidoc -o docs/source project_dir | Generates automatically rst files for each module | make html | Build the html files with documentation | xcopy build\html . | Copy files for publishing on github |
sphinx-apidoc needs to be rerun if the new module is added
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets