Sphinx文档生成器提供only markup。例如,只有当外部文件的html生成器出现时,以下代码才会包含该外部文件:
.. only:: html
.. include:: a.rst但是我该如何设置“唯一不”呢?以下代码似乎不起作用,即使使用大括号也是如此:
.. only:: not html
.. include:: b.rst发布于 2015-09-07 07:38:13
根据Sphinx documentation,.. only:: not html应该是指定它的正确方式。以下代码适用于我使用sphinx-build 1.2.2的情况:
.. only:: html
This should be HTML format only.
.. only:: text
This should be text format only.
.. only:: not html
.. include:: nohtml.rst
This should be in everything except HTML.
.. only:: not text
.. include:: notext.rst
This should be in everything except Text.https://stackoverflow.com/questions/29998458
复制相似问题