diff options
| author | Paul Buetow <paul@buetow.org> | 2023-03-25 15:00:49 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-03-25 15:00:49 +0200 |
| commit | 9ad249a38a07f57c1bb9d14302ea59d478d9f6b8 (patch) | |
| tree | 62bce2032c2016156647bbf85fa53007b4f82cbb | |
| parent | d4312e01eac3262bc959ee0d549c345da205237f (diff) | |
can also use "<< <<< and >>>" from templates themselves
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | lib/template.source.sh | 12 |
2 files changed, 11 insertions, 2 deletions
@@ -168,7 +168,6 @@ See more entries about DTail and Golang: Blablabla... ``` - ### Alternative configuration file path If you don't want to mess with `gemtexter.conf`, you can use an alternative config file path in `~/.config/gemtexter.conf`, which takes precedence if it exists. Another way is to set the `CONFIG_FILE_PATH` environment variable, e.g.: diff --git a/lib/template.source.sh b/lib/template.source.sh index 38d9d3d..ec49490 100644 --- a/lib/template.source.sh +++ b/lib/template.source.sh @@ -57,7 +57,7 @@ $line" echo "$line" ;; esac - done + done | $SED 's/^\[\[\[/<<</; s/^\]\]\]/>>>/; s/^\[\[/<</;' } template::_line () { @@ -123,4 +123,14 @@ Just so that you know' >>> << :' assert::equals "$(template::_generate <<< "$template4")" '' + + local -r template5='[[ echo foo +[[[ + echo bar +]]]' + local -r expect5='<< echo foo +<<< + echo bar +>>>' + assert::equals "$(template::_generate <<< "$template5")" "$expect5" } |
