代言人 [英] Substitution in Admonitions

查看:110
本文介绍了代言人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在警告语中进行替换?

How can I do a substitution in an admonition?

例如:

|p| account

.. note::

    **Been using |p| separately and now integrating?**

在我的狮身人面像conf.py中,我定义了替换规则|解释|到解释之前的第一个文件(至少这是我的理解):

In my sphinx conf.py I define a replacement rule which gets appended to the rst file prior to interpretation (at least that is how I understand it):

rst_epilog = '.. |p| replace:: Labnext'

我在本段中的第一个替换操作没有失败。但是,note指令中的替代项不适用。有什么解决方法吗?

My first substitution in the paragraph works without fail. However the substitution in the note directive isn't applied. Any work arounds?

谢谢

迈克

推荐答案

如果删除了强调(双星号),则注释中的替换有效。不支持内联标记的嵌套。

The substitution in the note works if you remove the strong emphasis (double asterisks). Nesting of inline markup is not supported.

参考:

  • http://sphinx-doc.org/rest.html#inline-markup
  • http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup
  • http://docutils.sourceforge.net/FAQ.html#is-nested-inline-markup-possible

如果您需要继续强调,这里提供了一种解决方法:

Here is a workaround if you need to keep the strong emphasis:


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

  1. In conf.py, use the following definition:

rst_epilog = '.. |p| replace:: **Labnext**'


  • 在您的.rst文件中,使用此标记:

  • In your .rst file, use this markup:

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


  • 这篇关于代言人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆