HTML variables in Sphinx

前端 未结 1 660
天涯浪人
天涯浪人 2021-01-28 17:31

I\'m trying to have a variable in conf.py that inserts a link that is applied on a string:

rst_epilog = \"\"\"
.. |support| replace:: `support team 

        
1条回答
  •  盖世英雄少女心
    2021-01-28 17:53

    Use this substitution definition:

    .. |support| replace:: support team support@blabla.com
    

    support@blabla.com is automatically recognized as a mailto link.

    The |support| substitution reference produces the following output:

    support team support@blabla.com
    

    An alternative is to use a raw-html role (see http://docutils.sourceforge.net/docs/ref/rst/roles.html#raw).

    Add this to conf.py:

    rst_epilog = """
    .. role:: raw-html(raw)
       :format: html
    
    .. |support| replace:: :raw-html:`support team`
    """
    

    0 讨论(0)
提交回复
热议问题