摆脱“重复标签"狮身人面像中的警告 [英] Get rid of "duplicate label" warning in Sphinx

查看:101
本文介绍了摆脱“重复标签"狮身人面像中的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Sphinx 中,我收到大量警告,例如:

In Sphinx I get a ton of warnings like:

/PATH/FILENAME:LINE: WARNING: duplicate label LABELNAME, other instance in /PATH/FILENAME

似乎将所有部分标题都视为标签",并且在多个文件中使用了一堆部分标题.例如,每个版本的每个发行说明都有一页,并且在每个版本中都有改进"部分.和修复".

It seems to see all section titles as "label"s and there is a bunch of section titles that are used in multiple files. For example we have a one page per release note per version, and in every version there is "Improvements" and "Fixes".

如何消除所有这些警告?应该让它们静音,还是应该使用不同的切片方法?

How would one get rid of all of these warnings? Should they just be silenced, or is there a different way for sectioning that you are supposed to use?

一个例子是标签gamepad"在 desktop.rstvr-controls.rst

One example is the label "gamepad" in desktop.rst and vr-controls.rst

作为参考,我们仍然使用Sphinx 2.4.4我在变更日志中没有看到任何似乎相关的内容.

For reference, we still use Sphinx 2.4.4 I haven't seen anything in the changelogs that seemed related.

推荐答案

问题是我们仍在使用已弃用的 conf.py 选项作为 recommonmark.根据 recommonmark.readthedocs.io/en/latest,我们仍在使用 Sphinx-1.3 及更早版本的选项/改变

The issue was us still using a deprecated conf.py option for recommonmark. We were still using the option for Sphinx-1.3 and earlier as per recommonmark.readthedocs.io/en/latest/ Changing

from recommonmark.parser import CommonMarkParser

source_parsers = {
    '.md': CommonMarkParser,
}

source_suffix = ['.rst', '.md']

extensions = ['recommonmark']

修复了问题.

非常感谢@StevePiercy 让我知道我们已弃用的配置.

Big thanks to @StevePiercy for making me aware of our deprecated config.

这篇关于摆脱“重复标签"狮身人面像中的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆