Does anyone have a filter for alert / callout styling in PDF output? #9821
Replies: 5 comments 15 replies
-
Hm, I didn't notice this new extension, and I can't get it to work, so I must be doing something wrong.
How is this supposed to work? You can also just use fenced divs; for HTML or ODT / DOCX you can use a fenced div with a class & custom-style to link to a CSS class or ODT/DOCX style for the callout. For Typst, I've used the gentle-clues package, and have some code to convert a fenced div to the Typst gentle-clues syntax directly (https://typst.app/universe/package/gentle-clues/), you can do the same sort of thing for LaTeX. |
Beta Was this translation helpful? Give feedback.
-
I corrected the Pandoc manual alerts example here: #9826 |
Beta Was this translation helpful? Give feedback.
-
After much digging, I managed to find one pretty promising filter, but I haven't tested it yet: https://github.com/kdheepak/kdheepak.github.io/blob/8e6c244420fb09e2e4a44986e424ee7ed09e96ca/_quarto/alert.lua Source: https://kdheepak.com/blog/pandoc-lua-filter-for-alerts/ |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@FeralFlora — I added a parser for custom titles in my filter, so this markdown: > [!tip]
> GFM Alert.
> Some **Tip content**.
> More content: H~2~O.
> [!warning] A Custom title
> GFM Alert with custom title.
>
> My **warning** content.
> Some *more* content.
:::note
Fenced Div.
Some note content.
More *content*.
:::
::: {.important title="Custom Title"}
Some content.
::: becomes this Typst: ODT (you need a custom reference doc with styles added): Plain text:
Filter: https://github.com/iandol/dotpandoc/blob/master/filters/alerts.lua |
Beta Was this translation helpful? Give feedback.
-
Since alerts are very minimally styled, they need to have styling applied using something like a filter. Without that, they're not really appealing to use.
Unfortunately, I haven't seen any such filter floating about, and I don't have the experience to create one myself at the moment.
So I was wondering if anyone here had come across or created such a filter for alert / callout styling?
Beta Was this translation helpful? Give feedback.
All reactions