Skip to main content

Templateless markdown template engine

Project description

markright v­1.1.1

Templateless markdown template engine

Install

pip install markright

Python usage

Create a README.md file containing:

Existing value: &shy;<!---foo--><!---/foo-->

Missing value: &shy;<!---bar-->bar<!---/bar-->

Create python script markright_test.py with code like:

from markright import mark

data = {
    "foo": "foo"
}

mark("README.md", data)
mark("README.md", data, True)  # if you want to keep missing variables in the markup

Run your script python ./markright_test.py and you will get README.md looks pretty awsome after rendering, for example on gitlab :

Existing value: &shy;<!---foo-->foo<!---/foo-->

Missing value: &shy;<!---bar-->bar<!---/bar-->

If you forgot to keep the missing variables, you will get the result:

Existing value: &shy;<!---foo-->foo<!---/foo-->

Missing value: &shy;<!---bar--><!---/bar-->

Restarting the script does not require clearing the template, just run the script again with new data!

CLI Usage

markright -h # for help
markright -f README.md -d data.json # take data from json file
markright -f README.md -d data.ini # take data from [markright] section of ini file
markright -f README.md -d '{"foo": "bar"}' # data from json string

markright -f README.md -d data.json --dirt # if you want to keep missing variables

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

markright-1.1.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

markright-1.1.1-py3-none-any.whl (3.3 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