-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a new `wrap` section to the `eval` configuration. By default, the output is wrapped in a code block again with the original syntax highlighting. You can customize this behaviour by setting `wrap` to: * `code`: the default setting. * `raw`: no formatting applied. * `rawInline`: no formatting applied and no trailing newline. You can use `rawInline` to draw graphics. In order to do that, for example, we could configure `kitten` code snippets to evaluate using [Kitty]'s command `icat`. This uses the `rawInline` code setting to ensure that the resulting output is not wrapped in a code block, and the `fragment` and `replace` settings immediately replace the snippet: --- patat: eval: kitten: command: sed 's/^/kitten /' | bash replace: true fragment: false wrap: rawInline ... See, for example: ```kitten icat --align left dank-meme.jpg ```
- Loading branch information
Showing
6 changed files
with
173 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
patat: | ||
eval: | ||
shImplicit: | ||
command: sh | ||
wrap: code | ||
replace: true | ||
fragment: false | ||
shCode: | ||
command: sh | ||
wrap: code | ||
replace: true | ||
fragment: false | ||
shRaw: | ||
command: sh | ||
wrap: raw | ||
replace: true | ||
fragment: false | ||
shInline: | ||
command: sh | ||
wrap: rawInline | ||
replace: true | ||
fragment: false | ||
... | ||
|
||
# Implicit eval slide | ||
|
||
~~~{.shImplicit} | ||
printf '\e[1;34m%-6s\e[m' "This is text" | ||
~~~ | ||
|
||
# Code eval slide | ||
|
||
~~~{.shCode} | ||
printf '\e[1;34m%-6s\e[m' "This is text" | ||
~~~ | ||
|
||
# Raw eval slide | ||
|
||
~~~{.shRaw} | ||
printf '\e[1;34m%-6s\e[m' "This is text" | ||
~~~ | ||
|
||
Newline here... | ||
|
||
# Raw Inline eval slide | ||
|
||
~~~{.shInline} | ||
printf '\e[1;34m%-6s\e[m' "This is text" | ||
~~~ | ||
|
||
No newline here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[33m eval06.md [0m | ||
|
||
[34m# Implicit eval slide[0m | ||
|
||
[m [0m[40;37m [0m | ||
[m [0m[40;37m [1;34mThis is text[m [0m | ||
[m [0m[40;37m [0m | ||
|
||
[33m 1 / 4 [0m | ||
|
||
[m{slide}[0m | ||
[33m eval06.md [0m | ||
|
||
[34m# Code eval slide[0m | ||
|
||
[m [0m[40;37m [0m | ||
[m [0m[40;37m [1;34mThis is text[m [0m | ||
[m [0m[40;37m [0m | ||
|
||
[33m 2 / 4 [0m | ||
|
||
[m{slide}[0m | ||
[33m eval06.md [0m | ||
|
||
[34m# Raw eval slide[0m | ||
|
||
[m[1;34mThis is text[m[0m | ||
|
||
[mNewline here...[0m | ||
|
||
[33m 3 / 4 [0m | ||
|
||
[m{slide}[0m | ||
[33m eval06.md [0m | ||
|
||
[34m# Raw Inline eval slide[0m | ||
|
||
[m[1;34mThis is text[m[0m | ||
[mNo newline here...[0m | ||
|
||
[33m 4 / 4 [0m |