Org mode to jinja2 templating.
Project description
OrJi
OrJi is a command line tool to generate text files using jinja2 and orgmode files. It can be used to generate LaTeX, Markdown or HTML or any other kind of text from an orgmode file.
It is somewhat inspired by j2cli.
Quickstart
Simple org mode file used with simple template.
simple.org
* A normal note
Just a note
* TODO Wash car :morning:
Car wash.
* TODO File taxes :evening:
File taxes for wife too.
* DONE Watch TV
simple.jinja2
{% for note in root %}
{%- if note.state == "TODO" -%}
# {{ note.name }} ({% for tag in note.tags %}{{ tag }}{% endfor %})
{{ note.body }}
{% endif %}
{% endfor %}
Running:
orji cat simple.org simple.jinja2
Will output:
# Wash car (morning)
Car wash.
# File taxes (evening)
File taxes for wife too.
Why?
The practical itch I was scratching was editing and writing small blocks of content in orgzly on my phone and being able to kick off a small script that either turned it into a nice letter PDF or CV pdf or updated the markdown on my website.
It also lets me maintain separation of concerns on personal documents by keeping content in org files and style in jinja2 templates.
Install
OrJi can be installed with pip:
pip install orji
As a command line app, it is typically best installed via pipx.
pipx install orji
Using OrJi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file orji-3.2.1.tar.gz
.
File metadata
- Download URL: orji-3.2.1.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d1eee23f92ea9486dda1b1ec08fdb4ad79d78af8ebb15c0dbf1cb43bf09ecf3 |
|
MD5 | f7121ba29b4b78aacd01efe3b1228877 |
|
BLAKE2b-256 | 6e2175bdd5001e77449c221cdf9b88b8ccb1d597256f453a600af129d3d7b4c1 |
File details
Details for the file orji-3.2.1-py3-none-any.whl
.
File metadata
- Download URL: orji-3.2.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 916496d8a9cd0655f479548aaabdf7db2ba99dd3de05013bb01c53606a610734 |
|
MD5 | 4f437aaf41dfefb9598a087d4e50af87 |
|
BLAKE2b-256 | 972cf766cd5e34a7faa7848502c02c590d978167f01efd5d68a7a0eaacd0a050 |