nested inputcollapsedrender.valid / surface retained / 2 hidden branches
karabiner / semantic text folding
Lacuna keeps the short reading and the fuller explanation in the same source. Collapse it for pace, expand it for context, or package the hidden structure for a reversible plain-text handoff.
nested inputcollapsedrender.valid / surface retained / 2 hidden branches
one source / three readings
There is no detached annotation database to reconcile. The surface phrase, its optional depth, and its replacement live together and can nest inside one another.
[surface](extra)Collapsed output keeps surface. Expanded output writes surface + extra, preserving the sentence around both forms.
canvasexpandedcanvas, the empty space,{expanded}{collapsed}Collapsed output chooses the second branch. Expanded output chooses the first. Either branch can contain another expansion or replacement.
hidden structureexpandedworking spacePortable mode emits readable marker-bearing text and a Lacuna map. A later automatic pass can restore the expanded reading without the author markup.
canvas[[1]]map1 / expand / extraauthor → parse → render
Use the CLI on a file or pipe text through standard input. The parser resolves nested structures before the renderer selects a reading, so depth does not depend on brittle search-and-replace passes.
Compose compact prose and optional context in the same line. Code spans and lightweight bold syntax remain available for terminal reading.
An expansion can contain a replacement; a replacement branch can contain another expansion. The tree is resolved before output is chosen.
An unmatched bracket or brace is rendered as visible text and produces a lint warning on stderr instead of failing silently.
Render collapsed, expanded, portable, strip, or automatic output. Terminal color can distinguish inserted and replaced language without changing the text.
local utility / macOS
The core renderer is a Python CLI. The optional screenshot wrapper adds a Karabiner-triggered capture and OCR route through Tesseract and jq.
./install.sh lacunaThe repository installer performs a sparse checkout and places the tool in the local automations directory with a command on PATH.
echo 'This [canvas](, the empty space,)' | lacuna expandedUse --color=auto|always|never for terminal emphasis and --quiet only when lint warnings are intentionally handled elsewhere.