A fast static note set generator with extra features
  • Rust 72.5%
  • Lua 27.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-28 22:26:23 +00:00
.samples doc: Add more examples for release notes 2026-01-10 22:09:50 +00:00
nvim fix: use faster interval tree, correct LaTeX ranges 2026-04-28 22:26:23 +00:00
src release: 0.3.0 2026-02-17 10:05:19 +00:00
ztl-base fix: use faster interval tree, correct LaTeX ranges 2026-04-28 22:26:23 +00:00
ztl-res release: 0.2.0 2026-01-10 21:33:54 +00:00
.gitignore Split binary into base and resource; Update nvim plugin 2025-11-20 09:42:09 +00:00
.make-docs.sh style(rustfmt): Update pre-commits to include rustfmt 2025-12-13 14:38:50 +00:00
.pre-commit-config.yaml style(stylua): Add code formatting for nvim plugin 2025-12-18 17:45:17 +00:00
.rustfmt.toml style(rustfmt): Add rustfmt style configuration 2025-12-13 14:51:29 +00:00
Cargo.toml feat: Parallelize ankify subcommand 2026-02-16 00:08:00 +00:00
DEVELOPER.md docs: Improve feature section 2025-12-13 15:27:56 +00:00
GUIDE.md feat(cards,watch): Add card span; Better watch stats 2025-12-15 21:58:24 +00:00
LICENSE Initial commit 2024-09-22 14:59:48 +02:00
NEWS.md release: 0.3.0 2026-02-17 10:05:19 +00:00
README.md fix: Overflow in range calculation for Latex error messages 2025-12-21 16:04:38 +00:00

Zettel Tools for Lorenz

A fast static note generator in a single binary with everything built-in.

We support sourcing from Markdown, LaTeX and BibTeX files and export to HTML for live-preview, Anki card sets and publishing to Mastodon.

The repository provides a terminal tool written in Rust to generate note cache and a Neovim plugin for navigation and highlighting.

Furthermore, the Neovim plugin integrates with Telescope picker to follow any thread of notes and display previews of PDFs and website anchors.

Installation

Install ztl.nvim bundled with ZTL binary

Add plugin configuration to your lazy.nvim plugins folder

return {
	"https://codeberg.org/losch/ztl",
	dependencies = { "vhyrro/luarocks.nvim", "nvim-lua/plenary.nvim" },
	lazy = false,

	cond = function(plugin)
		plugin.dir = plugin.dir .. "/nvim/"
		return true
	end,

	config = function(plugin)
		require("luarocks-nvim").setup({ rocks = {"toml"} })
		require("ztl.utils").make_ztl_available() -- download and install binary from repo's latest release
    end
}
Install ZTL binary from source
cargo install --git https://codeberg.org/losch/ztl ztl

Features

The feature set of ZTL grows out of personal use, and hence is tailored to my interests. At core, I develop ZTL to provide me with a simple tool for writing, identifying and linking notes, but over time I also added some bells and whistles for special needs. The following highlights some special features of ZTL.

Simple and Rich Content Support

Markdown is an excellent markup language for writing notes, and its core features are sufficient for my usecase. If necessary, ZTL also supports LaTeX formats for more rich content (such as algorithms, equations, TiKZ etc).

In side-by-side comparison the syntax for markdown,

# tpawk9 Encoding for optimal retrieval practice

The initial encoding technique is important in retrieval practice. Connecting
the to-be-learned to already established [memory codes](k4e29j) gives a head-start
for any further spaced out retrieval practice sessions.

[...]

## nell5y Encoding in melody learning

For efficient melody learning, muscle, ear and cognitive capabilities are
possible strategies for encoding.

[...]

and the syntax for LaTeX with theorem blocks, custom commands and operators,

\begin{definition}[label=1k5i7v, name=Polar Cones]
    The polar \r{cone}{2zn8yr} is defined as
    \begin{align*}
        C^\ominus = \set{x\in\hilber}{\sup\innerp{C}{x} \leq 0}.
    \end{align*}

    \begin{theorem}[label=6af37y, name=Cones of Proximal Operators]
        % ...
    \end{theorem}
\end{definition}

Combine the concept of modal editing with ViM and Telescope pickers to create new links without hassle.

Excellent Diagnostic Information

We provide diagnostic informations when building the note set to a ZTL repository. This includes invalid note keys, missing HTML fragments and invalid fields.

Render Notes with Templates

Similar to a static page generator (such as Zola), ZTL generates rendered notes (or cards in fact), with the help of templates. They allow customization in style, without changing the note set:

Note Linkage

Targeting a specific section, page or anchor in a target note, is a central ability of a note taking system. We support different views of outgoing notes, such as page, anchor, search for PDFs, anchor for websites and macro for notes.

For example, to select the words cognitive capabilities in the note nell5y, you can write the following link [memory codes](nell5y#macro=z.4fcvEE) generating the required view. If you are note familiar with vim syntax, it works like this, z. center current line, 4fc find the fourth occurence of c, vEE visually select the ending of two words.

Generate Cards for Studying

You can source a set of cards from your notes by including special fields into your note content. The note itself provides the context, and the card field-value pairs specific modifiers. A card class (cloze here) is formatted with a Tera template, which yields one, or more, cards.

Learning with Texts

We also support visual highlighting for writing text in a foreign language. Furthermore, linking allows us to follow one, or more, root stems of words and write dictionaries for them.

Publish Notes to Mastodon

The Mastodon threading model is suited for publishing notes. You can publish your public notes directly to your favorite, supported Mastodon server.

Extensible and Modular

The ZTL binary generated a unified representation of your files into a repository. This includes notes and file span informations.

The Neovim plugin is a shim layer around this information to hook into Neovim's system of interpreting highlight groups and inline text. As such, it is very easy to add support for other editors.

Subcommands

Subcommands support of ztl

$ ztl
A fast static note generator with everything built-in

Usage: ztl [OPTIONS] [COMMAND]

Commands:
  init      Initialize a new ZTL repository
  list      List all notes
  build     Build all notes from scratch
  watch     Watch files and rebuild
  ankify    Generate anki card deck (apkg) from notes
  schedule  Create a schedule from current active notes
  publish   Publish notes to Mastodon instance
  help      Print this message or the help of the given subcommand(s)

Options:
  -d, --debug...         Enable debugging
  -f, --format <FORMAT>  Output format [default: human] [possible values: human, json]
  -r, --root <ROOT>      Root folder of ZTL repository [default: ]
  -h, --help             Print help
  -V, --version          Print version