tshepang
tshepang

Reputation: 12459

Setting linenothreshold globally

The option linenothreshold allows one to control the minimum number of lines a code block must have in order to generate line numbers for it. I would love to be able to specify this globally (e.g. in conf.py)?

Upvotes: 1

Views: 113

Answers (1)

Geoff Reedy
Geoff Reedy

Reputation: 36011

One of the things that can be added in conf.py is

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

So if you add something like

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

'''

that will do what you want.

And yes, it really is rst_prolog not rst_prologue.

Upvotes: 2

Related Questions