File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -595,14 +595,18 @@ file_excerpt
595
595
596
596
.. code-block :: twig
597
597
598
- {{ file|file_excerpt(line = null ) }}
598
+ {{ file|file_excerpt(line, srcContext = 3 ) }}
599
599
600
600
``file ``
601
601
**type **: ``string ``
602
- ``line `` *(optional) *
602
+ ``line ``
603
+ **type **: ``integer ``
604
+ ``srcContext `` *(optional) *
603
605
**type **: ``integer ``
604
606
605
- Generates an excerpt of seven lines around the given ``line ``.
607
+ Generates an excerpt of a code file around the given ``line `` number. The
608
+ ``srcContext `` argument defines the total number of lines to display around the
609
+ given line number (use ``-1 `` to display the whole file).
606
610
607
611
format_file
608
612
~~~~~~~~~~~
@@ -639,12 +643,14 @@ file_link
639
643
640
644
.. code-block :: twig
641
645
642
- {{ file|file_link(line = null ) }}
646
+ {{ file|file_link(line) }}
643
647
644
- ``line `` *(optional) *
648
+ ``file ``
649
+ **type **: ``string ``
650
+ ``line ``
645
651
**type **: ``integer ``
646
652
647
- Generates a link to the provided file ( and optionally line number) using
653
+ Generates a link to the provided file and line number using
648
654
a preconfigured scheme.
649
655
650
656
.. _reference-twig-tags :
You can’t perform that action at this time.
0 commit comments