introduction
This is a rehype plugin that parses Obsidian’s callout syntax
ES Module only
features
title and content can be formatted as normal markdown
delem strong red
support all obsidan callout types
nested callouts
outer calloutouter content
nested callout
outer titleouter content
nested calloutnested content
foldable with +
or -
A plus sign expands the callout by default, and a minus sign collapses it instead.
Are callouts foldable?
Yes! In a foldable callout, the contents are hidden when the callout is collapsed.
Are callouts foldable?
Yes! In a foldable callout, the contents are hidden when the callout is collapsed.
usage
The generated HTML of the above code would be:
in Astro:
Configuration
default config:
style callouts
Class names are embedded in the generated HTML, so you can style them in your CSS.
a preset css file is provided in: node_modules/rehype-callout/callout.css
, you can import it or just copy it.
prefix
to avoid css confilictcustomize the prefix config option.
by default, {prefix:“callout”}.
output with config {prefix:"custom-prefix"} will like this
dark mode
dark modesurpport dark mode by css variables