锚替换为'#id1','#id2','#id3'... Sphinx [英] Anchor replace with '#id1' , '#id2' , '#id3' ... Sphinx
问题描述
我在第一个文件中使用数字命名,但是在构建后,锚点被替换为#id1",#id2",#id3"....
I named using number in rst file but after building it the anchor is replaced with '#id1', '#id2', '#id3' ....
我只需要用数字来命名锚点....但是我不知道如何...
I need to name the anchor using only number....but I don't know how...
这是我的第一个文件.
实际代码
*************
Screen(HTS)
*************
Quote
=============
1101
------------------
.. raw:: html
:file: _static/1101.html
1151
------------------
.. raw:: html
:file: _static/1151.html
1152
------------------
.. raw:: html
:file: _static/1152.html
1103
------------------
.. raw:: html
:file: _static/1103.html
推荐答案
首先,下划线和上划线的长度必须与文本的长度相同.
First of all, the underlines and overlines must be the same length as the text.
不幸的是,您需要以数字开头的锚点,但是Sphinx不支持此功能.您可以改用以字符串开头的任意锚.请参见交叉引用任意位置的文档:ref:
.这是一个例子.
Unfortunately you want anchors that start with numbers, but Sphinx does not support this. You could instead use an arbitrary anchor that starts with a string. See the documentation for Cross-referencing arbitrary locations with :ref:
. Here's an example.
***********
Screen(HTS)
***********
Quote
=====
.. _section-1101:
1101
----
这篇关于锚替换为'#id1','#id2','#id3'... Sphinx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!