gpt4 book ai didi

python - 全局设置 linenothreshold

转载 作者:行者123 更新时间:2023-12-01 05:49:39 25 4
gpt4 key购买 nike

选项linenothreshold允许控制代码块必须具有的最小行数,以便为其生成行号。我希望能够在全局范围内指定它(例如在 conf.py 中)?

最佳答案

可以在 conf.py 中添加的内容之一是

rst_prolog

A string of reStructuredText that will be included at the beginning of every source file that is read. New in version 1.0

所以如果你添加类似的内容

rst_prolog = '''
.. highlight:: python
:linenothreshold: 0

'''

这会做你想做的事。

是的,它确实是 rst_prolog 而不是 rst_prologue

关于python - 全局设置 linenothreshold,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14822255/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com