Filter enabling syntactic sugar for using custom typst functions in .qmd file #10381
cl-roberts
started this conversation in
Show and Tell
Replies: 2 comments
-
Cool! I'll note that Quarto ships with some built-in functionality that's close to that:
![]() |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is really cool, @cl-roberts — I was looking for exactly this functionality recently! I'm a bit too used to the HTML/CSS world where I define a style once 😅 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I made a filter for using typst functions in a
.qmd
file by wrapping content in a div rather than disparate typst code blocks. This filter is heavily inspired by/generalized from this one in the ams template.The usual way
I find it cumbersome to wrap content in typst code blocks, i.e.
This way
Instead, I find it more natural to declare the function in a single typst block (or template file):
and call it using a div:
Note that the div class is named using the typst function name preceded by the project name (as determined as the parent directory to the
_extensions
folder) and an'-'
.Beta Was this translation helpful? Give feedback.
All reactions