[Obsidian][obsidian] callouts for Python-Markdown

January 12, 2025 · View on GitHub

Made by Ukrainian License

This is an extension for Python-Markdown which allows you to use Obsidian-style callouts:

> [!warning]
> Here's a callout block.

> [!tip] Callouts can have custom titles
> Like this one.

It will be rendered kinda like this:

Warning

Here's a callout block.

[!TIP] Callouts can have custom titles Like this one.

For a full reference, please, see the Obsidian's documentation on this.

Usage

Simply enable the extension like this:

import markdown

md = markdown.Markdown(extensions=['obsidian_callouts'])
print(md.convertFile('page.md'))

MkDocs

It can be used with MkDocs as following:

# mkdocs.yml
markdown_extensions:
  - obsidian_callouts

It is also installed along with my mkdocs-obsidian-bridge.

Credits

During the implementation of this plugin, I was using the official Python-Markdown as an inspiration and the example.