pip install sphinx
pip install sphinx-rtd-theme
# https://sphinx-themes.org/#themes
mkdir docs
cd docs
sphinx-quickstart
sphinx-apidoc -o ./docs .
Note: The sub folders without __init__.py
are ignored by sphinx-apidoc.
# config.py
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
language = 'zh_CN'
html_theme = 'sphinx_rtd_theme'
# index.rst
modules