diff --git a/docs/config-dynvars.md b/docs/config-dynvars.md index 1652cc7..ed78e36 100644 --- a/docs/config-dynvars.md +++ b/docs/config-dynvars.md @@ -7,7 +7,15 @@ dynvariables: : ``` -Dynvariables (*dynamic* variables) will be interpreted by the shell before being substituted. +You can also use multi-line (see [yaml related doc](https://yaml-multiline.info/)). +For example: +```yaml +dynvariables: + : >- + + + +``` For example: ```yaml @@ -16,10 +24,13 @@ dynvariables: dvar2: "echo 'this is some test' | rev | tr ' ' ','" dvar3: /tmp/my_shell_script.sh user: "echo $USER" - config_file: test -f "{{@@ user_config @@}}" && echo "{{@@ user_config @@}}" || echo "{{@@ dfl_config @@}}" + config_file: >- + test -f "{{@@ base_config @@}}" && + echo "{{@@ base_config @@}}" || + echo "{{@@ dfl_config @@}}" variables: - user_config: "profile_{{@@ user @@}}_uid.yaml" + base_config: "profile_base.yaml" dfl_config: "profile_default.yaml" ``` -They have the same properties as [Variables](config-file.md#variables). \ No newline at end of file +They have the same properties as [Variables](config-variables.md). \ No newline at end of file diff --git a/docs/config-file.md b/docs/config-file.md index 2631ef6..5ab1ab2 100644 --- a/docs/config-file.md +++ b/docs/config-file.md @@ -29,9 +29,11 @@ parametrize the following elements of the config: * `import_configs` * Profiles' `import` * Profiles' `include` +* `actions` +* `transformations` -`actions` and `transformations` also support the use of variables, -but those are resolved when the action/transformation is executed +Note that variables used in `actions` and `transformations` +are resolved when the action/transformation is executed (See [Dynamic actions](config-actions.md#dynamic-actions), [Dynamic transformations](config-transformations.md#dynamic-transformations) and [Templating](templating.md)). @@ -51,19 +53,24 @@ then be available during [templating](templating.md). Here are some rules on the use of variables in configs: -* [Interpreted variables](config-dynvars.md) are executed in their own file. -* [Interpreted variables](config-dynvars.md) and - [variables](config-dynvars.md) are templated before - [interpreted variables](config-dynvars.md) are executed. -* Config files do not have access to variables defined above in the import tree. -* `dynvariables` take precedence over `variables`. +* [dynvariables](config-dynvars.md) are executed in their own file. +* [dynvariables](config-dynvars.md) and + [variables](config-variables.md) are templated before + [dynvariables](config-dynvars.md) are executed. +* Config files do not have access to variables defined above in the import tree + (variables defined in importing config are not seen by the imported config file, + where *import* can be any of `import_configs`, `import_variables`, `import_actions`, + profile's `import` and profile's `include`) +* [dynvariables](config-dynvars.md) take precedence over [variables](config-variables.md). * Profile `(dyn)variables` take precedence over any other `(dyn)variables`. * Profile `(dyn)variables` take precedence over profile's included `(dyn)variables`. * External/imported `(dyn)variables` take precedence over `(dyn)variables` defined inside the main config file. -* [User variables](config-uservars.md) are ignored if +* [uservariables](config-uservars.md) are ignored if any other variable with the same key is defined. +For more see the [CONTRIBUTING doc](/CONTRIBUTING.md). + ## Permissions Dotdrop allows to control the permissions applied to a dotfile using the