我正在用Sphinx编写一些文档,我想打印出一些仅用于HTML文档的文本块,而不是用于LaTeX文档。有些东西告诉我,我应该能够用sphinx.ext.ifconfig
做到这一点,但我无法弄清楚如何做到这一点。有谁知道怎么做?
答案 0 :(得分:27)
无需延期。只需使用only directive即可。它的工作原理如下:
.. only:: latex The stuff in here only appears in the latex output. .. only:: html The stuff in this block only appears in the HTML output. It's often useful to use this directive with it: .. raw:: html It's good for embedding stuff, like video.