Extension for python-markdown that adds markdown syntax for badges.
Project description
Badge
Summary
The markdown-badge extension adds support for badges to Markdown documents. Badges are otherwise known as Labels or Tags, and the UI used to create them is often described as a Chip or a Pill.
Syntax
Badges are created using the following syntax:
{{ type "optional explicit title within double quotes" }}
type
will be used as the CSS class name and as default title. It must be a
single word. So, for instance:
{{ note "Alpha" }}
will render:
<span class="badge note">
<span class="badge-title">Alpha</span>
</span>
Optionally, you can use custom titles. For instance:
{{ danger "Warning" }}
will render:
<span class="badge danger">
<span class="badge-title">Warning</span>
</span>
If you don't want a title, use a blank string ""
:
This is a badge without a title: {{ important "" }}
results in:
<span class="badge danger"></span>
You can also provide additional CSS class names separated by spaces. The first class should be the "type." For example:
{{ danger highlight blink "Don't try this at home" }}
will render:
<span class="badge danger highlight blink">
<span class="badge-title">Don't try this at home</span>
</span>
Styling
There is no CSS included as part of this extension. Check out the default Sphinx theme for inspiration.
Usage
See Extensions for general extension usage. Use badge
as the
name of the extension.
This extension does not accept any special configuration options.
A trivial example:
markdown.markdown(some_text, extensions=['badge'])
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
Hashes for markdown_badge-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6ce5d2a4f56913005d8ea9ea20daab223648ae0942f839d77d51782c9f31e49 |
|
MD5 | 5031d2ab29075484b501056d3fdfd3f9 |
|
BLAKE2b-256 | 6124ef53dade38ca0b8ce36f5bf82c7810e25c41c0a4f9bf964a75801c804f95 |