Private sections of text possible in RestructuredText files?

一笑奈何 提交于 2019-12-14 01:28:16

问题


I'm in the process of converting some of my company's documentation from .md to .rst to be displayed in ReadTheDocs.com

In some of these documents there are Internal sections that are not intended for our customers' consumption.

Is there a way to mark these sections such that Sphinx doesn't render it into HTML?


回答1:


Use the ifconfig directive.

In your docs:

.. ifconfig:: internal

   This stuff is only included in the built docs for internal versions.

In your conf.py's setup function:

def setup(app):
    app.add_config_value('internal', '', 'env')


来源:https://stackoverflow.com/questions/49701524/private-sections-of-text-possible-in-restructuredtext-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!