Skip to main content

kdlj2-web

An example of using Jinja2 and KDL as building blocks to build robust, possibly dynamic website markup and interpolation pipelines with a friendly syntax.

This example is very small. It has a simple file browser (only when using the debug HTTP server), and an example invoices table.

Quick Guide

After installing through pipx or uv or anything else,

  • Put your static assets in static/.

  • Write your page templates in the top level of templates/.

    • Snippets to be used inside pages should go on templates/partials/.
    • Layouts a page should inherit should go on templates/layouts/.
  • Run kdlj2-web to render your pages!

    • As a debug server: python kdlj2-web serve --port=1234
    • To a static file folder: python kdlj2-web build --outdir=my-path/
    • Add custom options: python kdlj2-web --opts theme=dark serve
  • If you want your static and template directories in a different location, you can use the -s argument, like so: python kdlj2-web -s my_webroot/ ...

Other Tools

A few auxiliary tools ship with this package, kd-to-html and html-to-kdl. Notice that the latter uses lxml.html's parsing semantics, which automatically wraps a sequence of top-level elements in div or span, and gets cranky if you try to use non-standard HTML elements.

$ echo 'p "hello"; p { - "world,"; b "o mighty"; }; br; - "that I so much"; i "crave!"' | kdl-to-html
<div<<p>hello</p><p>world,<b>o mighty</b></p><br></br>that I so much<i>crave!</i></div>

$ echo '<p>hello</p><p>world,<b>o mighty</b></p><br></br>that I so much<i>crave!</i>' | html-to-kdl
div {
  p "hello"
  p {
  	- "world,"
  	b "o mighty"
  }
  br
  - "that I so much"
  i "crave!
}
"```

## Copyright

(c)2026 Gustavo Ramos Rehermann (wallabra) <gr.wallabra@proton.me>.

All code and assets in this project are made available under the Cooperative
Non-Violent Public License: [about](https://thufie.lain.haus/NPL.html),
[raw](https://git.pixie.town/thufie/thufie-site/raw/branch/main/files/CNPLv7.md),
[ScanCode LicenseDB](https://scancode-licensedb.aboutcode.org/cooperative-non-violent-7.0.html).

Please see [LICENSE.md](./LICENSE.md).

Metadata

Release files for kdlj2-web 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kdlj2-web 0.1.5
File Size Uploaded Provenance
kdlj2_web-0.1.5.tar.gz 68.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kdlj2-web 0.1.5
File Interpreter ABI Platform
kdlj2_web-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 91.3 kB

Release files / kdlj2_web-0.1.5.tar.gz

Download URL kdlj2_web-0.1.5.tar.gz
Size 68.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2d3dec1e020e980c0be560e9f7ea19365edead3bdd48472f164d5d72e439fdf1
BLAKE2b-256 checksum
How to use checksums
d994db0d0b5608ade57698a42d18b6e585b824ec6ad9568f816e626f2b5c44f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / kdlj2_web-0.1.5-py3-none-any.whl

Download URL kdlj2_web-0.1.5-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4f27d75347bf1a14a5e6d4e9b0cdbc06bcacfcbc43d89fc718db998346c8708
BLAKE2b-256 checksum
How to use checksums
f9a706b6059190723d2eb01c4d8aeb0618e76240e3865b34def5f4a5efbf46d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for kdlj2-web 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page