Format text in a link in reStructuredText

前端 未结 4 2068
再見小時候
再見小時候 2020-11-28 22:57

How do you format text within a denoted link in reStructuredText?

Specifically, I wish to generate the following HTML from my rst:



        
4条回答
  •  囚心锁ツ
    2020-11-28 23:06

    This construct:

    Here you have |optparse.OptionParser|_.
    
    .. |optparse.OptionParser| replace:: ``optparse.OptionParser`` documentation
    .. _optparse.OptionParser: http://docs.python.org/library/optparse.html
    

    produces this HTML (some linebreaks added):

    Here you have optparse.OptionParser documentation.

    I realize that this is not exactly what you asked for, but maybe it's close enough. See also http://docutils.sourceforge.net/FAQ.html#is-nested-inline-markup-possible.

提交回复
热议问题