You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(The first part of this background discussion. The proposal is marked PROPOSAL below.)
A while back I created #8988. It considered this example markdown:
::: note
This is a note.
:::
and one idea was that this could become Typst code like this:
#note[This is a note.]
This will only work if a Typst note function has been defined, so @jgm suggested that only special classes, e.g., starting typst-, might be passed through to Typst. A lua filter might convert the note class to typst-foo-note (where foo is a prefix that acts as a namespace) and the emitted Typst code might be this:
#foo-note[This is a note.]
I have been doing something like this for a while, using a custom writer. It will output this:
#bbf-note[
This is a note.
]
If there are multiple classes the calls are nested, e.g., this:
::: {.note .gray}
Another note.
:::
outputs this:
#bbf-gray[
#bbf-note[
Another note.
]]
PROPOSAL
I'd prefer to use the built-in Typst writer, so I took a look at Pandoc Typst properties. They don't seem to designed to call styling functions such as my bbf-note but I wonder whether they could be extended to do so.
I believe that they currently only use key=value attributes, and not classes, so potentially a typst:func class could specify a function to be used in place of the element that would otherwise be used (nothing for span, block for div, table for table etc.). This:
::: {typst:breakable=false}
div
:::
currently outputs this:
#block(breakable: false)[
div
]
and this:
::: {typst:bbf-note typst:breakable=false}
div
:::
would output this:
#bbf-note(breakable: false)[
div
]
Does this sound like a reasonable idea? If so, I'd be happy to make a more complete proposal.
The text was updated successfully, but these errors were encountered:
(The first part of this background discussion. The proposal is marked PROPOSAL below.)
A while back I created #8988. It considered this example markdown:
and one idea was that this could become Typst code like this:
This will only work if a Typst
note
function has been defined, so @jgm suggested that only special classes, e.g., startingtypst-
, might be passed through to Typst. A lua filter might convert thenote
class totypst-foo-note
(wherefoo
is a prefix that acts as a namespace) and the emitted Typst code might be this:I have been doing something like this for a while, using a custom writer. It will output this:
If there are multiple classes the calls are nested, e.g., this:
outputs this:
PROPOSAL
I'd prefer to use the built-in Typst writer, so I took a look at Pandoc Typst properties. They don't seem to designed to call styling functions such as my
bbf-note
but I wonder whether they could be extended to do so.I believe that they currently only use
key=value
attributes, and not classes, so potentially atypst:func
class could specify a function to be used in place of the element that would otherwise be used (nothing for span, block for div, table for table etc.). This:currently outputs this:
and this:
would output this:
Does this sound like a reasonable idea? If so, I'd be happy to make a more complete proposal.
The text was updated successfully, but these errors were encountered: