Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow snippets to be executed and replaced with output #330

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

mfontanini
Copy link
Owner

This adds the +exec_replace attribute that is basically an +exec except the output of the snippet's execution replaces the snippet itself. This allows using tools that emit ascii art, colorize outputs, etc.

I added a new set of configs to enable this (-X as a cli parameter and snippet.exec_replace.enable in the config file) as this adds a whole other level of danger when running someone else's presentation so I don't think the configs for exec are enough to protect users.

Fixes #292

@calebdw
Copy link
Contributor

calebdw commented Aug 4, 2024

I added a new set of configs to enable this (-X as a cli parameter and snippet.exec_replace.enable in the config file) as this adds a whole other level of danger when running someone else's presentation

I'm not sure I see how exec + replace is any more dangerous than exec?

@mfontanini
Copy link
Owner Author

Because it happens automatically on presentation load. So you open a presentation and this runs code without user intervention

@DrunkenToast
Copy link
Contributor

Good call with -X, fan of that.
I think I like the replace better than the pre_process, although I am not sure if it is clear whether or not it render the replaced output as markdown or not.

@mfontanini
Copy link
Owner Author

I'll merge this as is, if someone has a better name please shout

@mfontanini mfontanini merged commit cdc8cbd into master Aug 10, 2024
6 checks passed
@mfontanini mfontanini deleted the feat/snippet-exec-replace branch August 10, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

+render should work on all supported languages
3 participants