Mercurial > hgrepos > Python > libs > ConfigMix
diff docs/introduction.rst @ 708:e692216f8756
Allow also "," characters to act as a separator within a filter-chain.
The first filter is introduced by a "|", optional other ones may be introduced
by a "|" or a ",".
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Tue, 15 Aug 2023 11:14:51 +0200 |
| parents | 3a9d661d33b5 |
| children | a8bcb22341cd |
line wrap: on
line diff
--- a/docs/introduction.rst Tue Aug 15 10:41:22 2023 +0200 +++ b/docs/introduction.rst Tue Aug 15 11:14:51 2023 +0200 @@ -460,9 +460,14 @@ {{[namespace:]variable[|filter[|filter...]]}} +or:: + + {{[namespace:]variable[|filter[,filter...]]}} + I.e.: between double curly braces an optional `namespace` name followed by -a colon ``:``, the `variable` and then zero or more filters, each one -introduced by a pipe symbol ``|``. +a colon ``:``, the `variable` and then zero or more filters, the first one +introduced by a pipe symbol ``|`` the following ones introduced by a +comma ``,`` or a pipe symbol ``|``. The comma ``,`` should be preferred. Variables are expanded *lately* at runtime -- exactly when calling :py:meth:`.Configuration.getvar_s`, @@ -474,13 +479,20 @@ *must* be quoted (see :ref:`quoting`) when using variable interpolation syntax. +.. note:: Commata ``,`` and pipe symbols ``|`` are not allowed within + filter names. + Filter functions ~~~~~~~~~~~~~~~~ Interpolated values can be processed through a series of filter functions:: - {{my.variable|filter1|filter2}} + {{my.variable|filter1|filter2|filter3}} + +or:: + + {{my.variable|filter1,filter2,filter3}} Available filter functions are:
