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

Allow to query the language set for a raw block #4639

Closed
jvoisin opened this issue Jul 29, 2024 · 3 comments
Closed

Allow to query the language set for a raw block #4639

jvoisin opened this issue Jul 29, 2024 · 3 comments
Labels
feature request New feature or request

Comments

@jvoisin
Copy link

jvoisin commented Jul 29, 2024

Description

Currently, it's possible to do something like this #show raw.where(block: true): it => { … }, it would be nice to have a similar #show raw.where(language: "python"): it => { … }, #show raw.where(language: false): it => { … }, or maybe #show raw.where(language: ["python", "zig"]): it => { … }

Use Case

I'm currently using raw blocks to draw ascii-art diagrams, in markdown transpiled to typst via pandoc (yes.), and I'd like to center them, but not have real code snippet centered.

An easy solution would be to wrap the diagrams in figure, but since I'm writing things in markdown via pandoc, I'd love to only have a single .typ with all the typst code living there.

Another less niche use-case would be per-language theming.

@jvoisin jvoisin added the feature request New feature or request label Jul 29, 2024
@JamesxX
Copy link
Sponsor

JamesxX commented Jul 29, 2024

Does #show raw.where(lang: "py"): ... not do the trick?

@jvoisin
Copy link
Author

jvoisin commented Jul 29, 2024

#show raw.where(lang: ""): ... doesn't

@jvoisin
Copy link
Author

jvoisin commented Jul 29, 2024

But #show raw.where(lang: none): ... does, amazing!

Thanks <3

@jvoisin jvoisin closed this as completed Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants