You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Flag to parse everything in the same path as the template
* Logic for 'include' flag
* Option to define a different 'include' path
* Logic for `include-path` option
* Document new `--include` flag and `--include-path` option
* Update **tera cli** usage documentation
* Tera's **include** example
* Tera's **inheritance** example
* Update markdown README file
Copy file name to clipboardExpand all lines: README.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,12 @@ By default, your ENV variables will be loaded at the root of the context data. F
125
125
126
126
While the syntax is a little more verbose, paired with `--fail-on-collision`, this option allows ensuring that nothing happens in your back.
127
127
128
+
### External files
129
+
130
+
Using the `--include` flag, the command will scan recursively for files that could be [included](https://tera.netlify.app/docs/#include), used as [macros](https://tera.netlify.app/docs/#macros) or for [inheritance](https://tera.netlify.app/docs/#inheritance). By default, it will scan the folder where the main template is located, unless the `--include-path` option is given.
131
+
132
+
From this repository, you can test **include** feature with the command `USER="[YOURNAME]" tera --template data/include/hello.txt --include --env-only` and test **inheritance** feature with `USER="[YOURNAME]" tera --template data/inheritance/child.txt --inherit --env-only`.
133
+
128
134
### Output
129
135
130
136
By default,
@@ -159,13 +165,20 @@ Passing the `-a | --escape` flag allows escaping the content.
159
165
be raised
160
166
--fail-on-collision if you prefer your data to override the ENV
161
167
-h, --help Prints help information
168
+
-i, --include This flag tells the command to parse all templates found in the same
169
+
path where the given template is located [aliases: inherit]
162
170
-s, --stdin The context data can be passed using stdin
163
171
-V, --version Prints version information
164
172
165
173
OPTIONS:
166
-
--env-key <env-key> By default, if --env is set, the environment variables will be
167
-
attached at the root of the context. This is convenient but may end
168
-
up conflicting with your data. To prevent collisions, you can
169
-
provide a custom key with this option
170
-
-o, --out <out> Optional output file. If not passed, using stdout
171
-
-t, --template <template> Location of the template
174
+
--env-key <env-key>
175
+
By default, if --env is set, the environment variables will be attached at the root of
176
+
the context. This is convenient but may end up conflicting with your data. To prevent
177
+
collisions, you can provide a custom key with this option
178
+
179
+
--include-path <include-path>
180
+
Option to define a different path from which search and parse templates [aliases:
181
+
inherit-path]
182
+
183
+
-o, --out <out> Optional output file. If not passed, using stdout
184
+
-t, --template <template> Location of the template
Copy file name to clipboardExpand all lines: README_src.adoc
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,12 @@ By default, your ENV variables will be loaded at the root of the context data. F
99
99
100
100
While the syntax is a little more verbose, paired with `--fail-on-collision`, this option allows ensuring that nothing happens in your back.
101
101
102
+
=== External files
103
+
104
+
Using the `--include` flag, the command will scan recursively for files that could be https://tera.netlify.app/docs/#include[included], used as https://tera.netlify.app/docs/#macros[macros] or for https://tera.netlify.app/docs/#inheritance[inheritance]. By default, it will scan the folder where the main template is located, unless the `--include-path` option is given.
105
+
106
+
From this repository, you can test *include* feature with the command `USER="[YOURNAME]" tera --template data/include/hello.txt --include --env-only` and test *inheritance* feature with `USER="[YOURNAME]" tera --template data/inheritance/child.txt --inherit --env-only`.
0 commit comments