在 Sphinx reST 中包含机密信息
我在其自己的“copy.rst”文档中有保密文本。如何将其包含在目录树中而不显示出来?
I have the confidentiality text in its own "copy.rst" document. How can I include it without it showing up in the toctree?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
:hidden:
选项将 copy.rst 添加到单独的目录树中:您也可以什么都不做(只需将 copy.rst 与其他 .rst 文件一起保留)并忽略“copy.rst::警告:文档不包含在任何目录树中”消息。
Add copy.rst to a separate toctree with the
:hidden:
option:You could also do nothing (just keep copy.rst with the other .rst files) and simply ignore the "copy.rst:: WARNING: document isn't included in any toctree" message.
正确的方法是
不要在任何
.. toctree:
中包含copy.rst
。这样,该页面就不会出现在下一个/上一个页面中。将
:orphan:
写入copy.rst
的第一行。这样您就不会看到任何编译器警告。The correct way would be
Do not include
copy.rst
in any.. toctree:
. This way this page will not come in next/previous.Write
:orphan:
to the first line ofcopy.rst
. This way you will not see any compiler warning.