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.0.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distributions

mdninja-1.0.0-py3.6.egg (3.8 kB view hashes)

Uploaded Source

mdninja-1.0.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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