Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify that macros shadow other macros/functions #4181

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/tags/macro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ via the ``from`` tag:
.. caution::

As macros imported via ``from`` are called like functions, be careful to
not override existing functions:
not shadow existing functions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest saying be careful that they shadow existing functions (the current wording makes it look like it is an issue to perform such shadowing, but if you don't intent to use the function, there is no issue)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


.. code-block:: twig

Expand Down Expand Up @@ -113,7 +113,7 @@ Imported macros are not available in the body of ``embed`` tags, you need
to explicitly re-import macros inside the tag.

When calling ``import`` or ``from`` from a ``block`` tag, the imported macros
are only defined in the current block and they override macros defined at the
are only defined in the current block and they shadow macros defined at the
template level with the same names.

Checking if a Macro is defined
Expand Down