【发布时间】:2019-06-19 11:34:15
【问题描述】:
我正在学习 Sphinx 来记录我的 Django 项目。
我的项目结构是这样的
app
|- docs
|- build
|- source
|- conf.py
|- index.rst
|- make.bat
|- Makefile
|- src
|- authentication
|- __init__.py
|- models.py
|- ...
|- myapp
|- __init__.py
|- settings.py
|- wsgi.py
|- manage.py
在`app/docs/source/conf.py中,查找doc的路径设置为
import os
import sys
sys.path.insert(0, os.path.abspath('../../src'))
并且index.rst有内容
App's documentation!
=============================================
.. automodule:: manage
:members:
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
在运行中
make html
它会生成包含默认内容且没有来自 Django 应用程序的内容的空白文档页面。
我创建了许多应用程序,每个应用程序都包含许多文件。我想从整个 Django 应用程序的文档字符串中自动生成文档。
【问题讨论】:
标签: django python-sphinx django-sphinx