我是Sphinx的新手,我似乎没有找到实现这一点的方法。我希望能够在进行过程中快速注释/取消注释单个toctree条目,而不必删除行。我使用Latex来做这件事,以便在我的项目仍在进行中时减少编译时间。
例如,我想要实现这样的结果:
.. toctree::
file1
file2
.. file3 (I want to comment/uncomment this, easily)
file4
.. file5 (this also fails)
..
file6 (this also fails)什么才是正确的方法呢?
发布于 2021-04-08 21:04:31
看起来我可能已经找到了接近解决方案的东西(到目前为止最接近的)。它包括将..不缩进,也就是说,与toctree指令处于同一级别。例如,我得到了这样的东西:
.. toctree::
Title 1 <file1>
Title 2 <file2>
Title 4 <file4>
.. the comment starts here
Title 3 <file3>
Title 5 <file5>
etc有了这个,我能得到的“注释/取消注释”的最好方法是选择目标行,并将其分别拖放到已注释/未注释区域。
发布于 2021-04-07 23:57:23
您是否尝试过使用toctree指令下的:hidden:选项?我想你需要有两个单独的toctree指令来实现这一点:
.. toctree::
visiblefile1
visiblefile2
.. toctree::
:hidden:
hiddenfile1
hiddenfile2另请参见sphinx-doc.org。
也许这会得到可以接受的结果。这并不完全是注释/取消注释,但它达到了相同的结果。
https://stackoverflow.com/questions/66917406
复制相似问题