Skip to content

Commit 412f112

Browse files
committed
Revert "[#7939] revert some changes (revert them for 3.2)"
This reverts commit 32c72bd.
1 parent 327ee85 commit 412f112

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

reference/twig_reference.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,18 @@ file_excerpt
567567

568568
.. code-block:: twig
569569
570-
{{ file|file_excerpt(line) }}
570+
{{ file|file_excerpt(line, srcContext = 3) }}
571571
572572
``file``
573573
**type**: ``string``
574574
``line``
575575
**type**: ``integer``
576+
``srcContext`` *(optional)*
577+
**type**: ``integer``
576578

577-
Generates an excerpt of a code file around the given ``line`` number.
579+
Generates an excerpt of a code file around the given ``line`` number. The
580+
``srcContext`` argument defines the total number of lines to display around the
581+
given line number (use ``-1`` to display the whole file).
578582

579583
format_file
580584
~~~~~~~~~~~

0 commit comments

Comments
 (0)