Skip to main content

mkdocs-callouts

Build Status GitHub latest commit PyPi MIT license codecov

A simple plugin that converts Obsidian style callouts and converts them into mkdocs supported 'admonitions' (a.k.a. callouts).

[!NOTE] For GitHub's callout syntax, this markdown extension might be what you want instead: https://github.com/dahlia/markdown-gfm-admonition

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:
      aliases: true  # Enable/disable alias support (default: true)
      breakless_lists: true  # Enable/disable breakless list support (default: true)
      title_from_first_bold: false  # Use the first lone bold content as the title (default: false)

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins 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

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

First bold line as title

If the first line of a callout block is in bold, it can be used as the title for the admonition block. To enable this behaviour, set first_bold_as_title to true in the plugin configuration. Behavior is disabled by default, see #34

> [!INFO]
> **This is the title**
> This is the content of the callout block.

Will render as:

!!! info "This is the title"
    This is the content of the callout block.
plugins:
  - search
  - callouts:
      title_from_first_bold: true

Release files for mkdocs-callouts 1.17.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-callouts 1.17.1
File Size Uploaded
mkdocs_callouts-1.17.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-callouts 1.17.1
File Interpreter ABI Platform
mkdocs_callouts-1.17.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 kB

Release files / mkdocs_callouts-1.17.1.tar.gz

Download URL mkdocs_callouts-1.17.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
21d4350da8c2075a70e9f1bb53485bb9b3c1e968dc856fce43b2554e0ebdc6b8
BLAKE2b-256 checksum
How to use checksums
50f8a174f4111a3d804734a445a1bcf5668ba30d7d7bbdba029ba3060d5e33d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mkdocs_callouts-1.17.1-py3-none-any.whl

Download URL mkdocs_callouts-1.17.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6db15c3a32b95e986e04ac86a713a83249603f56b9ba782a02b106245270807a
BLAKE2b-256 checksum
How to use checksums
94fb6477451a2ee6bb5c0db09a188f93d3b9ad8711787ecf46844bd7b1273ff9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.17.1 This release

2 release files

1.17.0

2 release files

1.16.1

2 release files

1.16.0

2 release files

1.15.0

2 release files

1.14.1

2 release files

1.14.0

2 release files

1.13.1

2 release files

1.13.0

2 release files

1.12.0

2 release files

1.11.1

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.1

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page