Conditional output in Sphinx Documentation
问题 I'm writing some documentation with Sphinx and I'd like to print out a certain block of text only for HTML documentation, not for LaTeX documentation. Something tells me I should be able to do this with sphinx.ext.ifconfig but I can't figure out how. Does anyone know how to do this? 回答1: No extension is required. Just use the only directive. It works like this: .. only:: latex The stuff in here only appears in the latex output. .. only:: html The stuff in this block only appears in the HTML