A simple plugin that converts Obsidian style callouts and converts them into mkdocs supported 'admonitions' (a.k.a. callouts).
Project description
mkdocs-callouts
A simple plugin that converts Obsidian style callouts and converts them into mkdocs supported 'admonitions' (a.k.a. callouts).
Setup
Install the plugin using pip:
pip install mkdocs-callouts
Activate the plugin in mkdocs.yml
, note that some markdown_extensions are required for this plugin to function correctly:
markdown_extensions:
- nl2br
- admonition
- pymdownx.details
- pymdownx.superfences
plugins:
- search
- callouts
Note: If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set, but now you have to enable it explicitly.
Usage
mkdocs-callouts converts the following:
> [!INFO] Title
> An information callout from Obsidian
> inspired by the syntax from the Microsoft Docs
and turns it into:
!!! info "Title"
An admonition block for MkDocs.
Allowing you to edit your notes
with confidence using Obsidian.
Foldable blocks
Foldable blocks are also supported. (> [!INFO]- Foldable closed by default
, > [!INFO]+ Foldable open by default
)
Inline blocks
To turn a callout block into an inline block you can use the |left
or |right
syntax in the type notation like so:
> [!INFO|left] -> !!! info inline (alt: [!INFO | left])
> [!INFO|inline] -> !!! info inline
> [!INFO|right] -> !!! info inline end
> [!INFO|inline end] -> !!! info inline end
The following also works, but Obsidian may not render the block type correctly.
> [!INFO inline] --> !!! info inline
> [!INFO inline end] --> !!! info inline end
To get more information about inline blocks, or how to add your own custom callout blocks, check the Material Mkdocs Documentation.
Aliases
Obsidian allows the use of aliases when creating callouts, mkdocs-callouts converts these to the corresponding block type. Should you wish to disable this behaviour then you can do so by setting aliases
to false
in the plugin configuration:
plugins:
- search
- callouts:
aliases: false
Breakless lists (New in 1.11.0)
Markdown specification requires a blank line between list items and other block elements, whereas Obsidian does not require this. This plugin will by default automatically add a blank line between list items and callout blocks (if none are present). Should you wish to disable this behaviour then you can do so by setting breakless_lists
to false
in the plugin configuration:
plugins:
- search
- callouts:
breakless_lists: false
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mkdocs_callouts-1.14.0.tar.gz
.
File metadata
- Download URL: mkdocs_callouts-1.14.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02635434ae4c8b69bcd4f8a8af9930ad9eb157a84efff17955a172f1e6622467 |
|
MD5 | 753998c2fde8c52ce7efe15e9801f7a4 |
|
BLAKE2b-256 | 7c5cdbe0a903c1b2685323780255d0ca5e96951bd7ae0948cbe233c64d9bb7d0 |
File details
Details for the file mkdocs_callouts-1.14.0-py3-none-any.whl
.
File metadata
- Download URL: mkdocs_callouts-1.14.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38e36b09a4e8927473a659641ff256071072cea5bc271054cc3aa4cd550736a6 |
|
MD5 | e39e94242ae9f32737851a60e8afb74c |
|
BLAKE2b-256 | 4cc23c885a967da50ce8c92ac03196097a595144701503a0f3a9e58c40011a5b |