Skip to content

feat: allow specifying where snippet output will go#658

Merged
mfontanini merged 1 commit intomasterfrom
feat/exec-output
Jun 27, 2025
Merged

feat: allow specifying where snippet output will go#658
mfontanini merged 1 commit intomasterfrom
feat/exec-output

Conversation

@mfontanini
Copy link
Owner

@mfontanini mfontanini commented Jun 26, 2025

This adds a way of specifying where the output of an executable snippet will go, so it's not always shown right below the snippet. This can be useful in particular to place code in another column when the code itself is already long enough. To do this you need to:

  • Create a +exec snippet and add a +id:<name> attribute.
  • Add a comment command snippet_output: <name>. The output of the snippet will be placed here.

For example:

<!-- column_layout: [1, 1] -->

<!-- column: 0 -->
```bash +exec +id:foo
echo "hello world"
echo "the time is $(date)"
```

<!-- column: 1 -->

<!-- snippet_output: foo -->

Looks like:

image

The +id property may have more uses in the future but for now this is all it can be used for.

Closes #540

PS: this needs more testing and some better error reporting but I'm fried already.

@mfontanini mfontanini merged commit 2adf920 into master Jun 27, 2025
4 checks passed
@mfontanini mfontanini deleted the feat/exec-output branch June 27, 2025 21:20
@mfontanini
Copy link
Owner Author

PS: this made snippet output with font size > 1 look a bit weird. I'm restructuring tests so I can catch these issues once and for all; should have something tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to customize where the output of the command shall locate

1 participant