悬停时显示 header 永久链接(鹈鹕)
Show header permalink on hover (pelican)
如何获得悬停时显示的可点击“固定链接”(例如 h2
headers),类似于 this。
我正在使用 pelican 框架并在 restructuredText 中编写。我不知道要在堆栈中的哪个位置进行调整以启用此功能(pelican?首先?jinja2?)
这叫做标签。用法记录在 ref
role.
下
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. There are two ways in which you can refer to labels:
If you place a label directly before a section title, you can reference to it with :ref:label-name
. For example:
.. _my-reference-label:
Section to cross-reference
--------------------------
This is the text of the section.
It refers to the section itself, see :ref:`my-reference-label`.
编辑
对于 Pelican,有一个名为 headerid
的插件可以呈现永久链接。
您可以通过 Markdown TOC extension 的选项获得它。
只需在 pelicanconf.py:
中将 permalink
选项设置为 True
MARKDOWN = {
'extension_configs': {
'markdown.extensions.toc': {'permalink': 'True'}
}
}
如何获得悬停时显示的可点击“固定链接”(例如 h2
headers),类似于 this。
我正在使用 pelican 框架并在 restructuredText 中编写。我不知道要在堆栈中的哪个位置进行调整以启用此功能(pelican?首先?jinja2?)
这叫做标签。用法记录在 ref
role.
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. There are two ways in which you can refer to labels:
If you place a label directly before a section title, you can reference to it with :ref:
label-name
. For example:.. _my-reference-label: Section to cross-reference -------------------------- This is the text of the section. It refers to the section itself, see :ref:`my-reference-label`.
编辑
对于 Pelican,有一个名为 headerid
的插件可以呈现永久链接。
您可以通过 Markdown TOC extension 的选项获得它。
只需在 pelicanconf.py:
中将permalink
选项设置为 True
MARKDOWN = {
'extension_configs': {
'markdown.extensions.toc': {'permalink': 'True'}
}
}