3
使用Sphinx,如何根据输出格式进行替换?如何在Sphinx中执行输出格式相关替换
基本上,我想有这样的事情
if html:
|CLICK| unicode:: U+21E8
elif latex:
|CLICK| raw:: latex
$\LongRightArrow$
,但我似乎无法得到正确的语法。
使用Sphinx,如何根据输出格式进行替换?如何在Sphinx中执行输出格式相关替换
基本上,我想有这样的事情
if html:
|CLICK| unicode:: U+21E8
elif latex:
|CLICK| raw:: latex
$\LongRightArrow$
,但我似乎无法得到正确的语法。
改为使用.. only::
指令。虽然通常用标记(或作为斯芬克斯所说标记)中使用时,输出格式是可用作为标记,以及:
.. only:: html
.. raw:: html
<a href="http://www.google.com">google</a>
.. only:: latex
latex specific
正式文件: http://sphinx.pocoo.org/markup/misc.html?highlight=format#including-content-based-on-tags