首页 > 解决方案 > 在 sphinx 文档中启用 `todo` 功能

问题描述

我正在尝试使用功能,我在sphinx-docstodo上找到了一个链接和以下语法

.. todo::

但它说我需要设置todo_include_todosTrue,默认情况下False,我需要更新哪个文件才能启用?

我发现另一个 SO post Sphinx todo box 没有显示,但不认为它提到了我需要设置配置的文件。

标签: python-sphinxrestructuredtext

解决方案


sphinx.ext.todo是一个 Sphinx 扩展,可以通过将其添加到您的扩展列表中来启用conf.py

extensions = [
    'extname',
    'sphinx.ext.todo',
]

启用后,您需要通过将值设置为 来配置它todo_include_todosTrue也在您的conf.py:

# Display todos by setting to True
todo_include_todos = True

待办事项的主题支持各不相同。

另请参阅http://www.sphinx-doc.org/en/stable/config.html#confval-extensions


推荐阅读