Images in plain text and the terminal; bounded build parallelism (from dev 16f82cc887af)

- @image under txt and ansi is a picture in characters, in five styles
  (Image_txt_style: halfblock the default, shade, ascii, quadrant,
  braille), sized to the terminal's width less a margin when ktext runs
  in one, every cell in its own colours under ansi; a figure's caption
  is centred under it and no txt caption is ruled off any more.
- The build compiles as many files at once as the machine has cores
  (JOBS; make -C com JOBS=1 for a small machine): the sub-makes' bare -j
  meant unlimited parallelism and exhausted 8 GB machines. The three
  install pages say "make -C com".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ackandClaude Fable 5.1 committed 2026-09-30 16:13:23 +02:00
1 parent d14da90bbf
commit ed7bedf5a7
13 files changed
+335 -41

No files matched your search

+26 -2
View File
@@ -9,6 +9,22 @@
@@@
@@@state Image_output_dir :desc Output directory for images :value img @@@
@@@state Image_txt_style
:desc How an image is drawn in characters under txt and ansi:
halfblock (two pixels per cell in full colour under ansi -- the
nearest to the raster, and the default; under txt a solid
block, since its picture is only its colours), shade (block
shades, coloured tiles under ansi), ascii (a density ramp of
typewriter characters), quadrant (four sub-pixels per cell, two
colours per cell under ansi), braille (eight dots per cell).
:value halfblock
@@@
@@@state Image_txt_dark_background
:desc Under txt and ansi, the density ramp assumes a dark terminal
background (true): bright pixels are the dense characters.
false reverses it for a light background.
:value true
@@@
@@@state Image_default_width :desc Default width for images :value .667w @@@
@@ -45,10 +61,18 @@
An image read from a file. The basename names the file, which is looked
for in the image search path and converted to a format the target can use.
^:width is the image's width in the text column, ^:hpos and ^:offset place
it there, and the caption arguments caption it.
it there, and the caption arguments caption it. Under txt and ansi the
image is drawn in characters (the Image_txt_style state variable:
halfblock, the default, or shade, ascii, quadrant, braille), and ansi
colours them; the
measure is the terminal's width
less a small margin when ktext runs in one, else the text width, and
^:width applies to that (a fraction, a number of columns, or f for all of
it). The Image_txt_dark_background state variable (true) reverses the
ramp for a light terminal.
@@
@@image.html,tex :: @eval image.Image(K) eval@ @@
@@image.html,tex,txt :: @eval image.Image(K) eval@ @@
@@image_grid.k
image_specs.rest(2)