全局设置linenothreshold

2024-04-27 04:47:58 发布

您现在位置:Python中文网/ 问答频道 /正文

选项linenothreshold允许控制代码块生成行号所必须的最小行数。我希望能够全局地指定它(例如在conf.py)?你知道吗


Tags: pyconf选项全局行号控制代码linenothreshold
1条回答
网友
1楼 · 发布于 2024-04-27 04:47:58

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。你知道吗

相关问题 更多 >