Skip to main content

Markdown extension: a classier syntax for admonitions

Project description

markdown-callouts

Extension for Python-Markdown: a classier syntax for admonitions

PyPI GitHub GitHub Workflow Status

Installation

pip install markdown-callouts

If using MkDocs, enable the extension in mkdocs.yml:

markdown_extensions:
  - callouts

Continue to the documentation site.

Usage

This adds a new block-level syntax to Markdown, to put a paragraph of text into a block that's specially highlighted and set apart from the rest of the text.

Example:

NOTE: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.

Result, using mkdocs-material:

Screenshot

Collapsible blocks also have a syntax for them:

>? NOTE: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
> nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
> massa, nec semper lorem quam in massa.

This instead shows up as an initially-closed <details> block.

Graceful degradation

This extension produces the same results as the admonition extension, but with a syntax that is much less intrusive and has a very reasonable fallback look for "vanilla" renderers.

E.g. compare what you would've seen above if we actually wrote that Markdown and fed it to GitHub's Markdown parser:

"Callouts" syntax

NOTE: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.

"Admonition" syntax

!!! note

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.

Continue to the documentation site.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markdown_callouts-0.4.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

markdown_callouts-0.4.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file markdown_callouts-0.4.0.tar.gz.

File metadata

  • Download URL: markdown_callouts-0.4.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for markdown_callouts-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7ed2c90486967058a73a547781121983839522d67041ae52c4979616f1b2b746
MD5 20f92ca493c8a7bf495a304a21691290
BLAKE2b-256 8773ae5aa379f6f7fea9d0bf4cba888f9a31d451d90f80033ae60ae3045770d5

See more details on using hashes here.

Provenance

File details

Details for the file markdown_callouts-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for markdown_callouts-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed0da38f29158d93116a0d0c6ecaf9df90b37e0d989b5337d678ee6e6d6550b7
MD5 263813ce3d0d419ee37ea51d5f2e6815
BLAKE2b-256 1db57b0a0a52c82bfccd830af2a8cc8add1c5bc932e0204922434954a631dd51

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page