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-3.0.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orji-3.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for orji-3.0.0.tar.gz
Algorithm Hash digest
SHA256 306ab37c4a0b41f2e8c48e86529d0341bfcad4a72d44d34afaa1e7d2ba8ce764
MD5 ee707d6186aa075bf042363f5feb4a42
BLAKE2b-256 342d9d1f1cc30a71a5333e97fa803685386b8a6f863e8aa3d95c0f3682d01f58

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for orji-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a9b799bd4d838fb8c4d1c21a630cf5c6ea7f430e6ff7cf817ed64a3adfc71a2
MD5 8184d0692c4f5305f1cd7c2264b5ac27
BLAKE2b-256 a52a88d789e53b3c85417678f7b0f011158195fa0230d256e8c0a4d5fb455d9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page