如何访问``conf.py''中的“ sphinx -build -t abc”之类的标签?
根据sphinx的文档,tags
对象在conf.py
( master )。但是,我得到:attributeError:'nontype'对象没有属性'有'
conf.py
:
if tags.has('abc'):
pip list
:
Package Version
------------ ---------
Sphinx 5.0.2
如何访问标签sphinx -build -t abc
在conf.py
中?
According to Sphinx' documentation there is a tags
object available in conf.py
(master). However, I get: AttributeError: 'NoneType' object has no attribute 'has'
conf.py
:
if tags.has('abc'):
pip list
:
Package Version
------------ ---------
Sphinx 5.0.2
How to access tags like sphinx-build -t abc
in conf.py
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
in
conf.py
中检查'
您可以在
'abc'
由Sphinx注射到构建过程中conf.py
中,没有任何导入。You can check for
'abc'
inconf.py
like this:or if you need to check the boolean value of your tag:
tags
get injected by Sphinx into theconf.py
during a build and is available without any import.