我正在记录 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
中。
最佳答案
根据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")))
关于django - Django 文档字符串和 Sphinx 的未知解释文本角色 "setting",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56803854/