diff options
| author | user <user@clank> | 2026-08-27 16:04:37 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-27 16:04:37 +0200 |
| commit | 5151e42f22b404cf41dc8b409bcdfcd4b39444ea (patch) | |
| tree | da8424903e12bf41a6144b065e06529df4f8e947 /docs/shaders.md | |
| parent | docs: the landing page stops arguing (diff) | |
| download | slosh-5151e42f22b404cf41dc8b409bcdfcd4b39444ea.tar.gz slosh-5151e42f22b404cf41dc8b409bcdfcd4b39444ea.tar.xz slosh-5151e42f22b404cf41dc8b409bcdfcd4b39444ea.zip | |
README/docs: spell the dash --, as the rest of the tree does
Every C comment, commit message and generated config in this repo
writes the aside dash as a spaced double hyphen; the Markdown alone
used U+2014, some 220 of them. One spelling, and the ASCII one -- the
prose now matches the code it documents.
Mechanical (every occurrence was the spaced form, checked including
the one inside a code fence, where it was comment text), so the words
themselves are untouched.
Diffstat (limited to 'docs/shaders.md')
| -rw-r--r-- | docs/shaders.md | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/docs/shaders.md b/docs/shaders.md index ca93f3e..a455645 100644 --- a/docs/shaders.md +++ b/docs/shaders.md @@ -6,7 +6,7 @@ and before the chrome that goes over them, which is why "contents, not chrome" falls out of the paint order rather than needing a rule. For the frame, see [chrome shaders](chrome.md). -Cells only — foreground, background, attributes. Text and width are never +Cells only -- foreground, background, attributes. Text and width are never touched, because rewriting text would desync selection and copy. ```kdl @@ -55,33 +55,33 @@ shaders { | | | |---|---| -| variables | `x` `y` — the cell, inside the rect the pass runs over | -| | `cols` `rows` — the size of that rect | -| | `curx` `cury` `cursor` — the cursor, and whether this pane has it | -| | `focused` — 0 or 1 | -| | `t` — milliseconds, for animation | -| | `since` — milliseconds the pane has been in its current state | -| | `above` `below` — lines of scrollback hidden past the viewport's top and bottom edges, both 0 at the present | +| variables | `x` `y` -- the cell, inside the rect the pass runs over | +| | `cols` `rows` -- the size of that rect | +| | `curx` `cury` `cursor` -- the cursor, and whether this pane has it | +| | `focused` -- 0 or 1 | +| | `t` -- milliseconds, for animation | +| | `since` -- milliseconds the pane has been in its current state | +| | `above` `below` -- lines of scrollback hidden past the viewport's top and bottom edges, both 0 at the present | | operators | `+ - * / %` (integer; division by zero is 0, not a crash) | | | `< > <= >= == != && \|\| !` give 0 or 1, so `(x < 10) * 200` is a rule | -| | `& \| ^ ~ << >>` on the 32-bit value, binding **tighter** than comparison — so `x & 7 == 0` asks what it looks like, unlike C | -| | `a ? b : c` — both sides are evaluated, then one is chosen | +| | `& \| ^ ~ << >>` on the 32-bit value, binding **tighter** than comparison -- so `x & 7 == 0` asks what it looks like, unlike C | +| | `a ? b : c` -- both sides are evaluated, then one is chosen | | functions | `min(a,b)` `max(a,b)` `abs(a)` `clamp(v,lo,hi)` | -| | `dist(x1,y1,x2,y2)` — counts a row double, because a cell is about twice as tall as it is wide | -| | `sin(deg)` `cos(deg)` — **degrees** in, −255..255 out, so `128 + sin(t / 4) / 2` is a breathe | -| constants | `PI` = 180, `TAU` = 360 — pi as an *angle*, which is what it is here: a half turn | +| | `dist(x1,y1,x2,y2)` -- counts a row double, because a cell is about twice as tall as it is wide | +| | `sin(deg)` `cos(deg)` -- **degrees** in, −255..255 out, so `128 + sin(t / 4) / 2` is a breathe | +| constants | `PI` = 180, `TAU` = 360 -- pi as an *angle*, which is what it is here: a half turn | `PI` being a half turn is what makes a radian-shaped formula port across as written: `sin(TAU * x / cols)` is one cycle over the pane's width, `PI / 2` is a quarter turn, `PI / 6` is thirty degrees. It is also *more* exact than radians -could be in a language with no fractions — a sixth of a turn is 30 whole degrees, +could be in a language with no fractions -- a sixth of a turn is 30 whole degrees, where `3.14159 / 6` in integers is 0. For the same reason there is no `deg2rad` or `rad2deg`: there is one angle unit, and a conversion could only lose the angle or invent a second scale to disagree with. There are no loops and no recursion, on purpose: a config cannot spin and there is nothing to sandbox. An expression that does not compile drops that one shader -with a warning — never the config, and never a half-strength version of what you +with a warning -- never the config, and never a half-strength version of what you asked for. The expression produces the **strength**, never the colour. That keeps the mixing @@ -94,7 +94,7 @@ frame, which is the honest price of animation. ## Ready-made Thirty-two presets are in -`contrib/shaders` — +`contrib/shaders` -- a cursor line, a crosshair, a torch, a phosphor CRT, sonar pings that follow your cursor. Each is a file you can paste into your config or `include`. @@ -150,7 +150,7 @@ chrome> :load shine the same, for the presets that shi ``` `:paste` prints the document back as a `shaders { }` block with `where=` on every -entry — and that block can be typed straight back in, which is the point of +entry -- and that block can be typed straight back in, which is the point of borrowing the syntax rather than inventing one. A test reads it off the screen, clears the pane, types it back and compares the cells. @@ -160,7 +160,7 @@ counts (`1 chrome, 1 content`) say where the passes went, which is the only way see that an entry's `where=` did what you meant. Nothing in the prompt parses KDL. A file goes over by path and a pasted block via a -temporary file, because the session already has the parser — and a second reader of +temporary file, because the session already has the parser -- and a second reader of a config file would be a second opinion about what it says, exactly where comments meet quoted strings. @@ -187,6 +187,6 @@ the config exactly like a built-in. Skeleton, Makefile and the rules a shader has to keep: `contrib/shader-plugin`. -It is native code in the session's process, so install ones you trust — the same +It is native code in the session's process, so install ones you trust -- the same standing as `shell` and a layout's `command=`, which can already run anything as you. |
