... | ... |
@@ -486,8 +486,10 @@ developer generate beautiful and readable PHP code: |
486 | 486 |
* ``outdent()``: Outdents the generated code (see ``Twig_Node_Block`` for a |
487 | 487 |
usage example). |
488 | 488 |
|
489 |
-Creating a Twig Extension |
|
489 |
+.. _creating_extensions: |
|
490 |
+ |
|
491 |
+Creating an Extension |
|
492 |
+--------------------- |
|
490 | 493 |
|
491 | 494 |
The main motivation for writing an extension is to move often used code into a |
492 | 495 |
reusable class like adding support for internationalization. An extension can |
... | ... |
@@ -330,7 +330,7 @@ escaping strategy), except those using the ``raw`` filter: |
330 | 330 |
{{ article.to_html|raw }} |
331 | 331 |
|
332 | 332 |
You can also change the escaping mode locally by using the ``autoescape`` tag |
333 |
-(see the :doc:`autoescape<../tags/autoescape>` doc for the syntax used before |
|
333 |
+(see the :doc:`autoescape<tags/autoescape>` doc for the syntax used before |
|
334 | 334 |
Twig 1.8): |
335 | 335 |
|
336 | 336 |
.. code-block:: jinja |
... | ... |
@@ -324,7 +324,7 @@ Using the Template name to set the default Escaping Strategy |
324 | 324 |
The ``autoescape`` option determines the default escaping strategy to use when |
325 | 325 |
no escaping is applied on a variable. When Twig is used to mostly generate |
326 | 326 |
HTML files, you can set it to ``html`` and explicitly change it to ``js`` when |
327 |
-you have some dynamic JavaScript files thanks to the ``autoescape`` tag:: |
|
327 |
+you have some dynamic JavaScript files thanks to the ``autoescape`` tag: |
|
328 | 328 |
|
329 | 329 |
.. code-block:: jinja |
330 | 330 |
|
... | ... |
@@ -710,7 +710,8 @@ Twig can be easily extended. |
710 | 710 |
If you are looking for new tags, filters, or functions, have a look at the Twig official |
711 | 711 |
`extension repository`_. |
712 | 712 |
|
713 |
-If you want to create your own, read :doc:`extensions`. |
|
713 |
+If you want to create your own, read the :ref:`Creating an |
|
714 |
+Extension<creating_extensions>` chapter. |
|
714 | 715 |
|
715 | 716 |
.. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle |
716 | 717 |
.. _`Jinja syntax plugin`: http://jinja.pocoo.org/2/documentation/integration |