Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crdoconnor/orji
Org-mode jinja2 swiss army knife.
https://github.com/crdoconnor/orji
j2cli jinja jinja2 org-mode orgmode orgzly
Last synced: about 1 month ago
JSON representation
Org-mode jinja2 swiss army knife.
- Host: GitHub
- URL: https://github.com/crdoconnor/orji
- Owner: crdoconnor
- License: mit
- Created: 2022-11-27T14:10:41.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-12T10:36:46.000Z (5 months ago)
- Last Synced: 2024-09-15T05:26:33.158Z (about 2 months ago)
- Topics: j2cli, jinja, jinja2, org-mode, orgmode, orgzly
- Language: Gherkin
- Homepage: https://hitchdev.com/orji
- Size: 313 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# OrJi
[![Main branch status](https://github.com/crdoconnor/orji/actions/workflows/regression.yml/badge.svg)](https://github.com/crdoconnor/orji/actions/workflows/regression.yml)
OrJi is a command line tool to generate text files using [jinja2](https://en.wikipedia.org/wiki/Jinja_(template_engine))
and [orgmode](https://en.wikipedia.org/wiki/Org-mode) 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](https://github.com/kolypto/j2cli).
## Quickstart
Simple org mode file used with simple template.
simple.org
```
* A normal noteJust 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:
```bash
orji out 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](https://orgzly.com/) 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](https://en.wikipedia.org/wiki/Separation_of_concerns) on personal documents by keeping content in org files and style in jinja2 templates.
## Install
OrJi can be installed with pip:
```bash
pip install orji
```As a command line app, it is typically best installed via
[pipx](https://pipx.pypa.io/stable/).```bash
pipx install orji
```### Using OrJi
- [Demonstration of all template features](https://hitchdev.com/orji/using/all-template-features)
- [Deliberately trigger a template failure](https://hitchdev.com/orji/using/deliberate-failure)
- [Insert file](https://hitchdev.com/orji/using/insert)
- [Example of Generated LaTeX A4 CV](https://hitchdev.com/orji/using/latex-cv)
- [Example of Generated LaTeX A4 Letter](https://hitchdev.com/orji/using/latex-letter)
- [Convert chunks of orgmode text into markdown](https://hitchdev.com/orji/using/markdown)
- [Use a python module with template variables and methods](https://hitchdev.com/orji/using/module)
- [Templated with more than one note](https://hitchdev.com/orji/using/orji-run-multiple)
- [Run](https://hitchdev.com/orji/using/orji-run)