我正在记录 Djagno 2.2 应用程序。
Django documentation指出链接至的设置为
Add :mod:`django.contrib.auth` to your :setting:`INSTALLED_APPS`...
在我的文档中,声明为
The length is defined in the :setting:`URL_ID_LENGTH`
使用 Sphinx
生成文档时make html
给予警告
:docstring of app.models.Class.function:4: WARNING: Unknown interpreted text role "setting".
我已将sphinx.ext.intersphinx
添加到 Sphinx 的conf.py
。
答案 0 :(得分:2)
根据Django documentation,它具有自己的特定标记。
您需要将Django conf.py中的djangodocs
添加到您的计算机中:
extensions = [
"djangodocs",
'sphinx.ext.extlinks',
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
]
然后将djangodocs
extension file放入您的docs/_ext/djangodocs.py
。
最后import its path像这样:
sys.path.append(abspath(join(dirname(__file__), "_ext")))