Documentation 训诫中的替代

Documentation 训诫中的替代,documentation,python-sphinx,substitution,restructuredtext,Documentation,Python Sphinx,Substitution,Restructuredtext,我怎样才能在警告中做替换 例如: |p| account .. note:: **Been using |p| separately and now integrating?** 在我的sphinx conf.py中,我定义了一个替换规则,该规则在解释之前附加到rst文件中(至少我是这样理解的): 我在这一段中的第一次替换毫无疑问有效。但是,note指令中的替换不适用。有什么解决办法吗 谢谢 Mike如果你去掉强强调符号(双星号),便笺中的替换就起作用了。不支持内联标记的嵌套 参考

我怎样才能在警告中做替换

例如:

|p| account

.. note::

    **Been using |p| separately and now integrating?**
在我的sphinx conf.py中,我定义了一个替换规则,该规则在解释之前附加到rst文件中(至少我是这样理解的):

我在这一段中的第一次替换毫无疑问有效。但是,note指令中的替换不适用。有什么解决办法吗

谢谢


Mike

如果你去掉强强调符号(双星号),便笺中的替换就起作用了。不支持内联标记的嵌套

参考资料:


如果您需要保持重点,这里有一个解决方法:

  • 在conf.py中,使用以下定义:

    rst_epilog = '.. |p| replace:: **Labnext**'
    
  • 在.rst文件中,使用以下标记:

    .. note::
    
      **Been using** |p| **separately and now integrating?**
    

  • 这对我这样的新手来说有点困难。完美的解释。谢谢
    .. note::
    
      **Been using** |p| **separately and now integrating?**