- Rust 72.5%
- Lua 27.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .samples | ||
| nvim | ||
| src | ||
| ztl-base | ||
| ztl-res | ||
| .gitignore | ||
| .make-docs.sh | ||
| .pre-commit-config.yaml | ||
| .rustfmt.toml | ||
| Cargo.toml | ||
| DEVELOPER.md | ||
| GUIDE.md | ||
| LICENSE | ||
| NEWS.md | ||
| README.md | ||
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}
Generate Links without Hassle
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