Skip to main content

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>'

# you can also specify version
text = """;;VERv1.2.3;;"""
md.convert(text)
'<p><span class="badge badge-version">v1.2.3</span></p>'

Options

  • inline_style - if True, the CSS style will be set inline rather so no additional CSS file(s) are required
  • auto_capitalize - if True, the tag will be automatically capitalized
  • rounded_corners - if False, the edges of the badge will be square-ish
  • text_color - color of the text (use HEX with # e.g. #FFFFFF)
  • fix_color - color of the Fix tag
  • change_color - color of the Change tag
  • improvement_color - color of the Improvement tag
  • new_color - color of the New tag
  • docs_color - color of the Docs tag
  • efficiency_color - color of the Efficency tag
  • version_color - color of the Version 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: 16px;
  color: #ffffff;
  vertical-align: baseline;
  white-space: nowrap;
  background-color: #999999;
  padding: 2px 9px;
  border-radius: 9px;
  text-align: center;
}
.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;
}
.badge-remove {
  background-color: #4F1319;
}
.badge-version {
  min-width: 75px;
  font-weight: 600;
  font-size: 16px;
  line-height: 18px;
  background-color: #35087E;
}
.badge-square {
  border-radius: 2px;
}

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_changelog-0.0.4.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markdown_changelog-0.0.4-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file markdown_changelog-0.0.4.tar.gz.

File metadata

  • Download URL: markdown_changelog-0.0.4.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for markdown_changelog-0.0.4.tar.gz
Algorithm Hash digest
SHA256 12767b57952f80003ec08ecf09c7cfb552fb23362ce0571c78d63ea419092a23
MD5 841b2743bac0d37d91dbd1a582d744e9
BLAKE2b-256 81a68ae745a3504dc370506ffc435b2107ebfc0d65d6d7ee0dc2a93608b560d1

See more details on using hashes here.

File details

Details for the file markdown_changelog-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: markdown_changelog-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for markdown_changelog-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2138aaa8fda7c271bb2a631eb1814184d1f78c403752886b6c0a786cd8c64f50
MD5 40eae8bde6aad499b71d5660ee53a55e
BLAKE2b-256 b2c18a1d4a7986efbd561fccd80286a8a3f98dd20034de0d47134d448e02cfb3

See more details on using hashes here.

Supported by

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