python-sphinx - 在重构文本中添加自定义锻炼环境 block

标签 python-sphinx restructuredtext docutils

有格式化练习的环境吗?类似的东西

.. exercise:: Count to 10

   Write down all the numbers from 1 to (including 10)

即这是一份指导性文档,要求读者阅读该 Material 。

最佳答案

您可以使用 admonition 添加自定义语义和样式。

例如示例:

.. admonition:: description

        Here is some info for basic Plone troubleshooting, especially with add-on modules.

生成的输出将具有 admonition-description CSS 类。然后你可以使用 CSS、:after:before 伪选择器进行样式设置,例如如果您想在文本旁边添加练习图标。

随机示例文件

关于python-sphinx - 在重构文本中添加自定义锻炼环境 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19788880/

相关文章:

python-sphinx - 狮身人面像 : how to exclude imports in automodule?

python - Sphinx automodule 显示模块名称?

python - docs.python.org 是否使用 sphinx.ext.autodoc?

python-sphinx - Sphinx:在笔记部分之后恢复列表编号

python - 使用 Sphinx 转换为 HTML 时如何在 reStructuredText 中转义单引号

具有轻量级标记的 Javascript API 文档框架

code-snippets - Sphinx、reStructuredText 显示/隐藏代码片段

reStructuredText 中带有超链接的图像

python - 如何在自定义 python-sphinx 指令/扩展中使用现有指令?

latex - 我可以在 reStructuredText 中使用内联原始 LaTeX