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: add +image to code blocks to consume their output as an image #429

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

mfontanini
Copy link
Owner

This adds a new +image attribute to code blocks. This inherits +exec_replace (meaning it has the same semantics and requires being enabled with the same parameters) but it assumes the output of the executed block is an image and renders it as such.

This means a presentation like the following one:

hi
----

```bash +image
curl -s -L -o - 'https://github.com/mfontanini/presenterm/blob/master/examples/doge.png?raw=true'
```

Renders like this
image

For this to work, the entire output of the code snippet must be an image written to stdout.

An application of this feature could be to have text to image conversions to create titles on the fly. Hopefully this opens up the door for more creative ideas users will definitely have.

@mfontanini mfontanini merged commit 22af066 into master Jan 29, 2025
6 checks passed
@mfontanini mfontanini deleted the feat/code-to-image branch January 29, 2025 01:07
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.

1 participant