【问题标题】:Export html in sphinx without custom admonitions在没有自定义警告的情况下在 sphinx 中导出 html
【发布时间】:2020-01-27 20:15:37
【问题描述】:

在我的另一个问题Show/hide part of text (question/answer) in sphinx file 之后,我想做的是导出一个html(或任何格式)没有这个标签(例如一个没有所有admonitionhtml指令。

我阅读了.. only:: 指令,但您似乎可以从html 中排除整个页面,并将其放入latex 中。

【问题讨论】:

  • 你真的试过这个吗?您是否尝试在 only 指令下缩进内容?您可以通过将指令相互缩进来嵌套指令。
  • 不知道我可以嵌套指令。谢谢!如果您将评论作为回复,我会将其标记为解决方案。

标签: python-sphinx


【解决方案1】:

您可以通过将指令相互缩进来嵌套指令。

.. only:: html

    ..  admonition:: Solution
        :class: toggle

        * Go to the dexterity-controlpanel (http://localhost:8080/Plone/@@dexterity-types)
        * Click on *Page* (http://127.0.0.1:8080/Plone/dexterity-types/Document)
        * Select the tab *Behaviors* (http://127.0.0.1:8080/Plone/dexterity-types/Document/@@behaviors)
        * Check the box next to *Lead Image* and save.

【讨论】:

    猜你喜欢
    • 2014-10-03
    • 2011-03-23
    • 2011-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    • 1970-01-01
    • 2019-07-06
    相关资源
    最近更新 更多