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:
1 parent
d14da90bbf
commit
ed7bedf5a7
13 files changed
+335
-41
No files matched your search
@@ -58,7 +58,7 @@ def block_width(text_width, indent):
|
||||
return max(1, int(text_width) - indent)
|
||||
|
||||
def add_caption(element, caption_label, number, caption_text,
|
||||
side="top", indent=0):
|
||||
side="top", indent=0, centered=False):
|
||||
"""Attach a caption to an already-laid-out block.
|
||||
|
||||
`element` is the block's text, indented by `indent` columns of NBSP.
|
||||
@@ -95,10 +95,14 @@ def add_caption(element, caption_label, number, caption_text,
|
||||
# marker substitution, so a caption that arrived there as plain text
|
||||
# got none of it: ":number false" silently lost its rule. The label
|
||||
# is what says "number me", not the presence of the marker.
|
||||
# `centered` rides in the marker's name as a "+center" flag, which the
|
||||
# numbering pass reads off: a figure's caption is centred under it, as
|
||||
# in html and tex; a table's or a listing's stays at the block's edge.
|
||||
flag = "+center" if centered else ""
|
||||
if number:
|
||||
caption = kutil.caption_marker(caption_label, caption_text, None)
|
||||
caption = kutil.caption_marker(caption_label + flag, caption_text, None)
|
||||
elif caption_text:
|
||||
caption = kutil.caption_marker("", caption_text, None)
|
||||
caption = kutil.caption_marker(flag, caption_text, None)
|
||||
else:
|
||||
return element
|
||||
# Marked laid-out, like the block: with no indent the caption begins
|
||||
|
||||
Reference in new issue
Block a user