mdbook-obsidian
mdBook preprocessor to render Obsidian specific syntax in mdBook.
To see the list of existing and supported syntax, see this GitHub issue.
⚠️ WIP ⚠️
This mdBook preprocessor is very much work-in-progress and currently only supports a small subset of the total Obsidian specific syntax. Contributions to expand the supported syntax are more than welcome <3
If you'd like to take over maintainership or ownership of this crate, please get in touch via an issue in the GitHub repo of this crate.
Usage
First, install the preprocessor:
Then, add the preprocessor to your book.toml
:
[]
= ["Jill Doe"]
= "en"
= false
= "src"
= "My awesome Book"
# ADD THIS
[]
Development
How it works
The way this preprocessor works is primarily by using regexes to search for specific patterns like
and then replacing it with the corresponding HTML code like
CALLOUT_TYPE
CALLOUT_BODY
Expanding the preprocessor
The currently supported syntax is tracked in this GitHub issue
To add support for some currently unsupported syntax, expand the existing existing main render loop in lib.rs
/// Apply to all chapters
with a function that calls the corresponding parsing logic.
In your parsing logic, use regex or any other methods to scan for the specific pattern of the syntax you want to support and replace it with the corresponding HTML code.