Python-Markdown extension for easy changelog tagging
Project description
Markdown-changelog
Markdown extension to enable easy addition of changelog badges to your documentation
Installation
The easiest way to install markdown-changelog
is to use pip
pip install markdown-changelog
Usage
Changelog adds the ability to insert styled <span>TAG</span>
tags that with appropriate CSS are rendered as
changelog badges in your documentation. The syntax requires the text to be surrounded by double semi-colon (;) signs.
To add a badge to your documentation simply surround the appropriate tag with double ;
.
import markdown
text = """;;fix;;"""
md = markdown.Markdown(extensions=["changelog"])
md.convert(text)
'<p><span class="badge badge-fix">Fix</span></p>'
# or
md = markdown.Markdown(extensions=["markdown_changelog.changelog"])
md.convert(text)
'<p><span class="badge badge-fix">Fix</span></p>'
# or
from markdown_changelog import ChangelogExtension
md = markdown.Markdown(extensions=[ChangelogExtension()])
md.convert(text)
'<p><span class="badge badge-fix">Fix</span></p>'
Options
inline_style
- ifTrue
, the CSS style will be set inline rather so no additional CSS file(s) are requiredauto_capitalize
- ifTrue
, the tag will be automatically capitalizedtext_color
- color of the text (use HEX with # e.g. #FFFFFF)fix_color
- color of theFix
tagchange_color
- color of theChange
tagimprovement_color
- color of theImprovement
tagnew_color
- color of theNew
tagdocs_color
- color of theDocs
tagefficiency_color
- color of theEfficency
tag
Supported tags
The following tags are supported by default:
- fix
- change (or changes changed)
- improvement (or improvements, enhancement, enhancements)
- new (or feature)
- efficiency
- docs (or documentation)
All must be wrapped in double ;
CCS
Minimum style required to render the badges correctly. You can instead use the inline_style=True
if you want the
style to be set on each item separately
.badge {
display: inline-block;
font-size: 14px;
line-height: 14px;
color: #ffffff;
vertical-align: baseline;
white-space: nowrap;
background-color: #999999;
padding: 2px 9px;
border-radius: 9px;
}
.badge-fix {
background-color: #dc3545;
}
.badge-change {
background-color: #fd7e14;
}
.badge-improvement {
background-color: #007bff;
}
.badge-new {
background-color: #28a745;
}
.badge-docs {
background-color: #6610f2;
}
.badge-efficiency {
background-color: #17a2b8;
}
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
Built Distribution
Hashes for markdown_changelog-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f72ba76fcb193836de4fd6dadcc764a89f9eef122c4ed15feefa6a326e29a51 |
|
MD5 | 814ae7e0d68c824447f1e1252b8275c8 |
|
BLAKE2b-256 | 25e130f6263289a6e98717503ce65004d27c7fc06e013152e9c64e8d6c781b74 |