Skip to content
Snippets Groups Projects
Commit 05d9cdf0 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

DOC: Extend documentation for variable replacement in transformers

parent 10b4c47e
No related branches found
No related tags found
2 merge requests!217TST: Make NamedTemporaryFiles Windows-compatible,!204Allow variable replacement in parameters of transformer functions
Pipeline #58379 passed
......@@ -38,8 +38,33 @@ An example that splits the variable ``a`` and puts the generated list in ``b`` i
Report:
tags: $b
This splits the string in '$a' and stores the resulting list in '$b'. This is here used to add a
list valued property to the Report Record.
This splits the string in '$a' and stores the resulting list in
'$b'. This is here used to add a list valued property to the Report
Record. Note that from LinkAhead Crawler 0.11.0 onwards, the value of
``marker`` in the above example can also be read in from a variable in
the usual ``$`` notation:
.. code-block:: yaml
# ... variable ``separator`` is defined somewhere above this part, e.g.,
# by reading a config file.
Experiment:
type: Dict
match: ".*"
transform:
param_split:
in: $a
out: $b
functions:
- split:
marker: $separator # Now the separator is read in from a
# variable, so we can, e.g., change from
# '|' to ';' without changing the cfood
# definition.
records:
Report:
tags: $b
There are a number of transform functions that are defined by default (see
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment