markdown-code-blocks
A stupid simple bit of code which combines mistune and pygments to convert markdown into html. Very similar to github markdown, but for python.
Installation
pip install markdown-code-blocks
Usage
The library provides a single function highlight which takes in a markdown
string and returns html.
You can also use the cli markdown-code-blocks-highlight. It optionally
takes a single filename (defaulting to stdin) and writes to stdout.
For example:
markdown-code-blocks-highlight f.md > f.htm
pygments css
I'd suggest grabbing a theme file from pygments-css (or any other provider of pygments themes -- if you google there's a bunch of them).
This library will use the class .highlight so be sure to change out whatever
class the theme uses with that.
Most themes (for whatever reason) don't add styles for diff display. I usually do something like this:
.highlight .gi { color: #070; }
.highlight .gd { color: #911; }
Metadata
Release files for markdown-code-blocks 3.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markdown_code_blocks-3.2.0.tar.gz | 3.4 kB | Without provenance | Details for markdown_code_blocks-3.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markdown_code_blocks-3.2.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for markdown_code_blocks-3.2.0-py2.py3-none-any.whl |
Total release size: 7.3 kB
Release files / markdown_code_blocks-3.2.0.tar.gz
| Download URL | markdown_code_blocks-3.2.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa9c4de3b3655cff7fbb90daee50f5346f8998496402a3ade4ff4be8fac8166a
|
|
BLAKE2b-256 checksum How to use checksums |
3bd0c0261f983f3216c0eed0048e0439cd7c9b29a1faf3e82fdb46da683659f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / markdown_code_blocks-3.2.0-py2.py3-none-any.whl
| Download URL | markdown_code_blocks-3.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c12a65c498453c8fab07000858dcaf4aa35d49dde62b183bbeefc91b06c355f6
|
|
BLAKE2b-256 checksum How to use checksums |
fa996329f0d5ad66762b35e01169c2473c67a24c3e024fa7c09acfc09357ceba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for markdown-code-blocks 3.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.