From 05d9cdf01446f1e100eb874cb0bd2c0710a048b7 Mon Sep 17 00:00:00 2001 From: Florian Spreckelsen <f.spreckelsen@indiscale.com> Date: Fri, 29 Nov 2024 14:30:02 +0100 Subject: [PATCH] DOC: Extend documentation for variable replacement in transformers --- src/doc/converters/transform_functions.rst | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/doc/converters/transform_functions.rst b/src/doc/converters/transform_functions.rst index 22df35c8..ecd47d2d 100644 --- a/src/doc/converters/transform_functions.rst +++ b/src/doc/converters/transform_functions.rst @@ -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 -- GitLab