首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sphinx文档生成器:“唯一”不?

Sphinx文档生成器:“唯一”不?
EN

Stack Overflow用户
提问于 2015-05-02 12:39:54
回答 1查看 1.3K关注 0票数 4

Sphinx文档生成器提供only markup。例如,只有当外部文件的html生成器出现时,以下代码才会包含该外部文件:

代码语言:javascript
复制
.. only:: html

   .. include:: a.rst

但是我该如何设置“唯一不”呢?以下代码似乎不起作用,即使使用大括号也是如此:

代码语言:javascript
复制
.. only:: not html

   .. include:: b.rst
EN

回答 1

Stack Overflow用户

发布于 2015-09-07 07:38:13

根据Sphinx documentation.. only:: not html应该是指定它的正确方式。以下代码适用于我使用sphinx-build 1.2.2的情况:

代码语言:javascript
复制
.. 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.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29998458

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档