Skip to main content

Org mode to jinja2 templating.

Project description

OrJi

Main branch status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orji-4.0.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

orji-4.0.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file orji-4.0.0.tar.gz.

File metadata

  • Download URL: orji-4.0.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for orji-4.0.0.tar.gz
Algorithm Hash digest
SHA256 2d7eb3be0e7f95258c7a893c5b4c16df57783509e5b6f0b9557005bc9134a9ea
MD5 36e035816ea2f42f1ebbc6896c3ec351
BLAKE2b-256 9f445ddd603feedd5c3f7bb7dbbac914645700e38ebdaea99f0eed823a01e01a

See more details on using hashes here.

File details

Details for the file orji-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: orji-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for orji-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fee85fe6439acf1751d93615ce707777aac2c430524658f4de96e1e1aef9d0c7
MD5 2cc70202ca3ab89fcd1641acf13b4b5e
BLAKE2b-256 4d3e573f6cf33471dfc41e6e682601336501a683551a94dabb60a070ccd3304e

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