mdformat-obsidian
An mdformat plugin for Obsidian Flavored Markdown. This plugin directly supports Callouts, inline footnotes, task lists with custom markers, and dollar math. See the test directory for supported formats.
[!NOTE] The format for GitHub Alerts differs slightly from Obsidian, so they are not fully compatible. Obsidian supports folding, custom titles, and is case insensitive. To improve interoperability, this package makes the stylistic choice of capitalizing the text within
[!...].
mdformat Usage
Add this package wherever you use mdformat and the plugin will be auto-recognized. No additional configuration necessary. See additional information on mdformat plugins here
Tip: this package specifies an "extra" ('recommended') for plugins that work well with GFM:
- mdformat-beautysh
- mdformat-black
- mdformat-config
- mdformat-frontmatter
- mdformat-simple-breaks
- mdformat-web
- mdformat-wikilink
Pre-Commit
repos:
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.18
hooks:
- id: mdformat
additional_dependencies:
- mdformat-obsidian
# Or
# - "mdformat-obsidian[recommended]"
pipx
pipx install mdformat
pipx inject mdformat mdformat-obsidian
# Or
# pipx inject mdformat "mdformat-obsidian[recommended]"
HTML Rendering
To generate HTML output, obsidian_plugin can be imported from mdit_plugins. For more guidance on MarkdownIt, see the docs: https://markdown-it-py.readthedocs.io/en/latest/using.html#the-parser
from markdown_it import MarkdownIt
from mdformat_obsidian.mdit_plugins import obsidian_plugin
md = MarkdownIt()
md.use(obsidian_plugin)
text = "> [!tip] Callouts can have custom titles\n> Like this one."
md.render(text)
# <blockquote>
# <div data-callout-metadata="" data-callout-fold="" data-callout="tip" class="callout">
# <div class="callout-title">
# <div class="callout-title-inner">Callouts can have custom titles</div>
# </div>
# <div class="callout-content">
# <p>Like this one.</p>
# </div>
# </div>
# </blockquote>
[!WARNING] The outer
<blockquote>tag is preserved to maintain compatibility with standard Markdown parsers. For full accessibility, you may want to replace this with a<div>in post-processing, as the>blockquote syntax is being repurposed for callouts.
Contributing
See CONTRIBUTING.md
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdformat_obsidian-0.2.0.tar.gz.
File metadata
- Download URL: mdformat_obsidian-0.2.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41dfa70b05bb6885b2e737dc2af894875ff6e32fb74883a2ec9df7c3df62227e
|
|
| MD5 |
3636fadd54423246ef80fb16601c3bb6
|
|
| BLAKE2b-256 |
8f9a1c777df7303ecf2c1052f76c37793593c6ae7ad77156fb3be2cd3138a5a2
|
Provenance
The following attestation bundles were made for mdformat_obsidian-0.2.0.tar.gz:
Publisher:
tests.yml on KyleKing/mdformat-obsidian
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdformat_obsidian-0.2.0.tar.gz -
Subject digest:
41dfa70b05bb6885b2e737dc2af894875ff6e32fb74883a2ec9df7c3df62227e - Sigstore transparency entry: 2195038346
- Sigstore integration time:
-
Permalink:
KyleKing/mdformat-obsidian@c72025812e6e1b4881025d16b74edb95fdedcadd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/KyleKing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tests.yml@c72025812e6e1b4881025d16b74edb95fdedcadd -
Trigger Event:
push
-
Statement type:
File details
Details for the file mdformat_obsidian-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mdformat_obsidian-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4413c5654ca57429acd3e853181ece82135b38659993113dad5aabbb2ef3c33f
|
|
| MD5 |
69256a06e65ed41ba8a38eaa03f359a0
|
|
| BLAKE2b-256 |
a9def11bfd7042485c058849a67df79d301458b29a6d6610bf7cbca85c5b5e14
|
Provenance
The following attestation bundles were made for mdformat_obsidian-0.2.0-py3-none-any.whl:
Publisher:
tests.yml on KyleKing/mdformat-obsidian
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdformat_obsidian-0.2.0-py3-none-any.whl -
Subject digest:
4413c5654ca57429acd3e853181ece82135b38659993113dad5aabbb2ef3c33f - Sigstore transparency entry: 2195038349
- Sigstore integration time:
-
Permalink:
KyleKing/mdformat-obsidian@c72025812e6e1b4881025d16b74edb95fdedcadd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/KyleKing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tests.yml@c72025812e6e1b4881025d16b74edb95fdedcadd -
Trigger Event:
push
-
Statement type: