Retaining inline code inside references in Sphinx

随声附和 提交于 2019-12-03 22:04:24

If you have a look at :ref: documentation in its official web site about inline markups:

:ref:

To support cross-referencing to arbitrary locations in any document, the standard reST labels are used. For this to work label names must be unique throughout the entire documentation ...

I think (as @Kevin Horn) it's no possible right now, because it's only used to create links (without rst formatting) with other sections in your project. Then if you write something like this:

.. _somestuff:

``this is code``, this is not!
==============================

.. _another_somestuff:

this is another code!
========================

If I link with these sections:

Have a look at :ref:`somestuff`
Have a look at :ref:`another_somestuff`
Have a look at :ref:`this link <somestuff>`

The result is:


Have a look at this is code, this is not!

Have a look at this is another code!

Have a look at this link


The style is the same in all of them .

Note: the italic/bold words symbolize links

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!