mdninja + markdown + jinja2 = beautiful HTML documents
mdninja is a document processor that converts markdown documents into HTML document by applying Jinja2 templating.
Installation
pip install mdninja
Usage
Simple use:
mdninja doc.md -o doc.html
If you want to use a different template:
mdninja doc.md -o doc.html --template=stylish.html
The default template is:
<!DOCTYPE html>
<html>
<head>
<title>{% for title in meta.title %}{{title}} {% endfor %}</title>
</head>
<body>
<h1>{% for title in meta.title %}{{title}} {% endfor %}</h1>
{{ body }}
<hr/>
</body>
</html>
Metadata (like title above) is added to the document by adding metadata headers like this at the top of the file
Title: A simple document
Alternatively, you can specify the meatadata using a YAML style header too:
--- title: A simple document ---
Metadata
Release files for mdninja 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdninja-1.0.3.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdninja-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.2 kB
Release files / mdninja-1.0.3.tar.gz
| Download URL | mdninja-1.0.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9132b81c648c6b6f0bdf7be4e2cc7d823c2ca07356c6203829d46a789263c150
|
|
BLAKE2b-256 checksum How to use checksums |
248a8c2e271fac8d3e26e7bbc404c2e01595ded365a652267e90d62346d1ca7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / mdninja-1.0.3-py3-none-any.whl
| Download URL | mdninja-1.0.3-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0216ca77edcaa3c849e08a687b2aabc19a7899bc0856a6209fb68ced3d2ff99
|
|
BLAKE2b-256 checksum How to use checksums |
5a7949c314837f5e6242ec32fd00dcbdc1d9617984019fc6b866ad9af1dcbc27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|