We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 327ee85 commit 412f112Copy full SHA for 412f112
reference/twig_reference.rst
@@ -567,14 +567,18 @@ file_excerpt
567
568
.. code-block:: twig
569
570
- {{ file|file_excerpt(line) }}
+ {{ file|file_excerpt(line, srcContext = 3) }}
571
572
``file``
573
**type**: ``string``
574
``line``
575
**type**: ``integer``
576
+``srcContext`` *(optional)*
577
+ **type**: ``integer``
578
-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).
582
583
format_file
584
~~~~~~~~~~~
0 commit comments