Skip to content

Commit

Permalink
Eval settings: rename fragment to reveal
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj committed Feb 5, 2025
1 parent 635d474 commit 6b9190b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,15 @@ write ASCII escape codes directly to the screen with
In order to do that, for example, we could configure `kitten` code snippets
to evaluate using [Kitty]'s command `icat`. This uses the `none` container
setting to ensure that the resulting output is not wrapped in a code block,
and the `fragment` and `replace` settings immediately replace the snippet.
and the `reveal` and `replace` settings immediately replace the snippet.

---
patat:
eval:
kitten:
command: sed 's/^/kitten /' | bash
replace: true
fragment: false
reveal: false
container: none
...

Expand Down Expand Up @@ -702,7 +702,7 @@ _evaluator_ by specifying this in the YAML metadata:
eval:
ruby:
command: irb --noecho --noverbose
fragment: true # Optional
reveal: true # Optional
replace: false # Optional
container: code # Optional
...
Expand All @@ -722,7 +722,7 @@ contain `eval` settings.

Aside from the command, there are four more options:

- `fragment`: Introduce a pause (see [fragments](#fragmented-slides)) in
- `reveal`: Introduce a pause (see [fragments](#fragmented-slides)) in
between showing the original code block and the output. Defaults to `true`.
- `replace`: Remove the original code block and replace it with the output
rather than appending the output in a new code block. Defaults to `false`.
Expand All @@ -735,16 +735,18 @@ Aside from the command, there are four more options:
- `stderr`: Include output from standard error. Defaults to `true`.
- `wrap`: this is a deprecated name for `container`, used in version 0.11 and
earlier.
- `fragment`: this is a deprecated name for `reveal`, used in version 0.13 and
earlier.

Setting `fragment: false` and `replace: true` offers a way to "filter" code
Setting `reveal: false` and `replace: true` offers a way to "filter" code
blocks, which can be used to render ASCII graphics.

---
patat:
eval:
figlet:
command: figlet
fragment: false
reveal: false
replace: true
...

Expand Down
2 changes: 1 addition & 1 deletion lib/Patat/Presentation/Settings.hs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ instance A.FromJSON EvalSettings where
parseJSON = A.withObject "FromJSON EvalSettings" $ \o -> EvalSettings
<$> o A..: "command"
<*> o A..:? "replace" A..!= False
<*> o A..:? "fragment" A..!= True
<*> deprecated "fragment" "reveal" True o
<*> deprecated "wrap" "container" EvalContainerCode o
<*> o A..:? "stderr" A..!= True
where
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/inputs/eval01.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ patat:
eval:
command: bash
replace: true
fragment: true
reveal: true
...

# Slide 1
Expand Down

0 comments on commit 6b9190b

Please sign in to comment.