mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Adding a unit test to verify the use of the `linenothreshold` option provided by the `highlight` directive [1]. The included document to test will introduce two sets of `code-block` and `literalinclude` directives where the first entry generates contents using line numbers and the second entry generates contents not using line numbers, respectfully. [1]: https://github.com/sphinx-doc/sphinx/blob/v1.8.4/sphinx/transforms/post_transforms/code.py#L85 Signed-off-by: James Knight <james.d.knight@live.com>
24 lines
396 B
ReStructuredText
24 lines
396 B
ReStructuredText
Code Blocks and Literal Includes with Line Numbers via linenothreshold
|
|
======================================================================
|
|
|
|
.. highlight:: python
|
|
:linenothreshold: 5
|
|
|
|
.. code-block::
|
|
|
|
class Foo:
|
|
pass
|
|
|
|
class Bar:
|
|
def baz():
|
|
pass
|
|
|
|
.. code-block::
|
|
|
|
# comment
|
|
value = True
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
.. literalinclude:: literal-short.inc
|