katom types from ref/ in groups, @table :leading in lines of text and :rulesep, @code under txt, one table style attribute, literal-klammer options (from dev 2e453744f5e9)

kdesc --katoms is Klammertext rendered from ref/, the types in titled groups,
with --katoms full for the regex column.  @table :leading L is L lines of the
surrounding text in html as in pdf (default 1), and :rulesep spaces the
horizontal rules.  The html table has one style attribute, so :column_width
fractions take effect again.  @code and @source_listing render in plain
text; captions are numbered per kind there, and a table needs no blank line
around it.  @c takes :nd, and an option-shaped word before a bar inside
literal code is code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ackandClaude Fable 5.1 committed 2026-09-21 22:37:13 +02:00
1 parent 63956c00e5
commit 217c0f3fc5
23 files changed
+625 -290

No files matched your search

+27 -13
View File
@@ -84,7 +84,8 @@ klammerset; give it `@read sks/sks.k @` in the input if it needs one.
| The document body is the first argument | For `@document` the body goes in the **`:text` option** (or `:files`). A positional body is an error. |
| `x@i` is "x, then italic" | A letter may not touch an opening `@`: `x@i` could be the close of a klammer named `x`. Write `x @i`. Brackets and sentence punctuation may abut: `(@i-x)`, `@i x @.` |
| `:files ch1` names a file `ch1` | A bare word means **`kt/ch1.kt`** beside the root file. A name with a directory or extension is a pathname. |
| `@font` sets the font | Retired. `@typeface name \| text @` is the temporary change; `@document :serif_typeface` etc. set the roles. |
| `@font` sets the font | Retired. `@typeface name \| text @` is the temporary change; `@document :serif_typeface` etc. set the roles. `:scale N` means N times the text as it appears, the same in html and pdf; `:middle` centres a script that does not sit on the baseline (hieroglyphs); `:lift 0.15em` shifts one that draws its glyphs off it. Put those in the klammer that names the font (`@egyptian`), never on a Latin typeface. |
| `:raise`, `:class`, `:import` as option names | An option name becomes a Python attribute, so a Python keyword is a SyntaxError at the first application, reported against the `.k`. Choose another word (`:lift`). |
---
@@ -139,6 +140,8 @@ while every argument is letters and digits: `@i-italic`, `@sup-2-3`, `@date@`.
code@
@c a | b c@ ← inline: same rule, and the close must be "c@"
@c ls :w | wc c@ ← an option-shaped word and a bar are code too; only an
option the klammer HAS (@c :nd | text c@) is read as one
```
`@c` and `@code` are the in-line and block forms of the same thing. Code that
@@ -262,8 +265,8 @@ are the limited ones.
| | |
|---|---|
| inline | `@i` italic, `@b` bold, `@t` typewriter, `@u` underline, `@s` sans, `@r` roman, `@ri` roman italic, `@c` inline code (literal; close `c@`), `@sup base \| script @`, `@sub`, `@ts scale \| text @` resize, `@color rgb :text`, `@typeface name \| text :scale @`, `@cjk` (needs an installed CJK typeface) |
| structure | `@s1`…`@s7` numbered headings, `@h1`…`@h7` unnumbered, `@part`, `@preface`, `@par`, `@newpage`, `@vspace lines`, `@vfill`, `@nl` line break |
| inline | `@i` italic, `@b` bold, `@t` typewriter, `@u` underline, `@s` sans, `@r` roman, `@ri` roman italic, `@c` inline code (literal; close `c@`), `@sup base \| script @`, `@sub`, `@ts scale \| text @` resize, `@color rgb :text`, `@typeface name \| text :scale :middle :lift @`, `@egyptian text @` (hieroglyphs, NewGardinerOmni, shipped), `@chinese text @` (needs Noto Serif SC installed: `kdesc --typeface install <dir>`) |
| structure | `@s1`…`@s7` numbered headings (`:n 5` forces the number), `@h1`…`@h7` unnumbered, `@part`, `@preface`, `@par`, `@newpage`, `@vspace lines`, `@vfill`, `@nl` line break. Headings are numbered **only inside a `@document`**, in every target; a fragment's heading is its bare title |
| blocks | `@code` (inline listing), `@source_listing file :marker P`, `@quote text \| attribution @`, `@note`, `@indent :left :right`, `@center`, `@right`, `@block to \| content @` (absolute placement), `@columns items :n @`, `@multicolumn text :n :gap @`, `@lines` |
| lists | `@ul :bullet`, `@ol :initial`, `@define :style` term/definition, `@qa question \| answer @` — items separated by `\|` |
| tables | `@table` — cells by `\|`, rows by `\|\|` (§6); `@rowcolor` |
@@ -275,13 +278,13 @@ are the limited ones.
Bar depth is the dimension: one `|` separates items, two `||` separates rows.
Argument order is free for options, fixed for positionals.
**Coverage today** (`kdesc --coverage`; 89 klammers): html, tex and pdf cover
nearly all. **txt and ansi cover 40**, among them `@b @i @t @u @s @r @ri @ts
**Coverage today** (`kdesc --coverage`; 83 klammers): html, tex and pdf cover
nearly all. **txt and ansi cover 60**, among them `@b @i @t @u @s @r @ri @ts
@typeface`, `@s1`–`@s7`, `@par @newpage @vspace @vfill @nl`, `@indent @right
@lines @qa`, `@ul @ol`, `@table @tbl @reference @define @left_right`,
`@footnote @link`, `@date @datetime`, `@c`. Not for txt: `@code
@source_listing @image @image_grid @quote @note @center @block @columns
@multicolumn @sup @sub @color @h1`–`@h7`.
`@footnote @link`, `@date @datetime`, `@c @code @source_listing @columns`,
`@h1`–`@h7`. Not for txt: `@image @image_grid @quote @note @center @block
@multicolumn @sup @sub @color`.
`@u` has no html definition. A klammer applied under a target that lacks it is
an **error**, never silently dropped.
@@ -311,6 +314,11 @@ the range (here: one sum per column).
- `:cell_hpos l c r` per column; `:justify <cells> <pos>; …` per cell.
- Lines: default under the header and at the bottom; `:hline`/`:vline`
replace them (`all`, `none`, or indexed ranges); `:grid` for all lines.
- Vertical rhythm, the same in html and pdf: **`:leading L`** is the row
height in lines of the surrounding text (default `1`: as dense as a
paragraph); **`:rulesep R`** is the space between a horizontal line and
the text either side, as a multiple of the standard amount (`0` = none;
a pdf table with vertical lines gets none).
- `:colspan`/`:rowspan` with the indexed-range syntax; `:allow_break true`
makes a page-breaking table (pdf).
- `:calc` — `;`-separated `<row>(<col>) = <op> <operands>`, prefix `+ - * /`
@@ -331,7 +339,7 @@ the range (here: one sum per column).
| `html` | a directory `<name>/` with `index.html`, `css/`, `fonts/`, `js/` | self-contained, fonts localized; `book` structure adds navigation, search |
| `tex` | `<name>.tex` | XeLaTeX source; fonts via fontspec from the font store |
| `pdf` | `<name>.pdf` | `tex` plus a xelatex run (TeX Live required) |
| `txt` | `<name>.txt` | plain text filled to `Target_txt_width` (72), blocks indented by `Target_txt_indent` (3); tables ruled and padded; captions numbered; **40 of 89 klammers** (§5) |
| `txt` | `<name>.txt` | plain text filled to `Target_txt_width` (72), blocks indented by `Target_txt_indent` (2); tables ruled and padded (`:leading`, `:rulesep` and `:colsep` have no meaning here: a row is a line of characters); `@c` set between `‹ ›` (`@c :nd \| text c@` omits them); listings flush left under their caption; headings numbered inside a `@document`; captions numbered per kind; **60 of 83 klammers** (§5) |
| `ansi` | txt + SGR escape sequences | `@b`/`@i`/`@u` and table header styles shown by a terminal; **identical to txt once the escape sequences are stripped**; pick it with `-t ansi -d`; a terminal needs a font with an italic face (macOS Terminal: Menlo, not Monaco) |
`k`, `o`, `*` also appear in `kdesc -t`: they are declaration pseudo-targets
@@ -344,10 +352,16 @@ quality of cached photographs, 85), `Target_txt_width`, `Target_txt_indent`,
Typefaces: the **font store** is closed-world (no network). The distribution
ships eb-garamond, crimson-pro, open-sans, source-sans-3, inconsolata,
source-code-pro, noto-sans-egyptian-hieroglyphs, noto-sans-cuneiform (see
`kdesc --typeface`); more are installed with `kdesc --typeface install <dir>`
into `KLAMMERTEXT_FONTS`. An unknown typeface is an error listing the available
ones. CJK is deliberately not shipped.
source-code-pro, noto-sans-egyptian-hieroglyphs, noto-sans-cuneiform and
newgardineromni (see `kdesc --typeface`); more are installed with
`kdesc --typeface install <dir>` into `KLAMMERTEXT_FONTS`. An unknown typeface
is an error listing the available ones. CJK is deliberately not shipped:
`@chinese` errors until Noto Serif SC is installed, and `kdesc -u` says so.
Two traps: a text font may carry OpenType features that rewrite plain text
(EB Garamond sets `^9053^` as a raised 9053, since a caret before figures
means superscript to it — show Klammertext codes in `@t` or `@c`, which are
monospace); and the txt/ansi targets pass a `@typeface` through unchanged,
so the terminal's own font decides what a script looks like there.
---