Skip to main content

mdninja + markdown + jinja2 = beautiful HTML

Project description

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

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

mdninja-1.0.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

mdninja-1.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file mdninja-1.0.2.tar.gz.

File metadata

  • Download URL: mdninja-1.0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for mdninja-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d73965aa9e02547e8da7435b21d0ecd3a8f4748e175eb0357318a32e79f02b88
MD5 956438956775fba9527d956b52e1967d
BLAKE2b-256 0fe6875fb800329fd0b67eea5a77017ff2c989b404d9535f2ba5a7a506d95769

See more details on using hashes here.

File details

Details for the file mdninja-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: mdninja-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for mdninja-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e947ddb5c6b381cb915589e4c68e60fe5fd693168af6f0004cfd12f0f93d740
MD5 af182e4c54f3a3b2573d4de67845802d
BLAKE2b-256 f63a5ddc895ce82d65dd078225294dddffc6305e53d267454d2e96db19149f49

See more details on using hashes here.

Supported by

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