martinevald.net

dtepr (GitHub)

Delegating text processor for Unix systems.

Reads and processes text from the standard input, and writes the result to either the standard output or an internal program buffer. Flow is controlled through directives in the text. The program buffer can be executed through an external command, whose output will be read back and inserted into the standard output.

Example

infile.html.dte

<p>Here's a HTML file. It was generated by <code><:p:>echo $USER<:x:></code>
on <i><:p:>date -Iseconds<:x:></i>.</p>

Invocation through dtepr:

cat infile.html.dte|dtepr $SHELL

Example output:

<p>Here's a HTML file. It was generated by <code>radiant</code>
on <i>2022-11-08T21:13:11+01:00</i>.</p>

Building and installing

Requires CMake 3.12 or newer, and a decently POSIX compliant system.

An out-of-source build is recommended:

$ cmake -B build -DCMAKE_RELEASE_TYPE=Release -DBUILD_TESTS=0
$ cmake --build build

Installing is optional (may require superuser privileges):

$ cmake --install build

Directives

The following directives are supported:

Directives can be escaped with backslash:

Backslashes can also be escaped as expected: \\