Templateless markdown template engine
Project description
markright v1.1.1
Templateless markdown template engine
Install
pip install markright
Python usage
Create a README.md
file containing:
Existing value: ­<!---foo--><!---/foo-->
Missing value: ­<!---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: ­<!---foo-->foo<!---/foo-->
Missing value: ­<!---bar-->bar<!---/bar-->
If you forgot to keep the missing variables, you will get the result:
Existing value: ­<!---foo-->foo<!---/foo-->
Missing value: ­<!---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)
Built Distribution
Close
Hashes for markright-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16bf9b536804f4d4bf13f8aa4d05665c36fb2512aebc85d1e562b286f286605a |
|
MD5 | cf3a97ea4753d31de35939643f193cd1 |
|
BLAKE2b-256 | 88dfcc102515042374551b4d58e2c9739a68cf460f442a5ac5c0082aef597eba |