The ansi target, txt table styles, kdesc reference from ref/, typeface and table-width fixes (from dev fcec5e2e77ac)

Since the previous release: Machine::read_string() (the fs::path/std::string
overload pair split); kdesc -c and -u rendered from the ref/ reflection
klammerset; a fit column's tex width measured in TeX over every entry;
@typeface resolving to the family its css declares (a store directory name
now works in html) and hieroglyphs in @unicode_examples set in their
typeface; the ansi target -- plain text with the type styles a terminal can
show, identical to txt once the escape sequences are stripped -- with the
txt @table carrying :header_style, :style and :hline; @block anchoring,
@table spacing and the Image_quality state variable; and the rewritten
doc/klammertext_for_llm.md.
This commit is contained in:
ack committed 2026-09-12 18:11:48 +02:00
1 parent 760fda5470
commit 9b0d0d7897
34 files changed
+895 -394

No files matched your search

+19 -10
View File
@@ -31,8 +31,12 @@ class Subsuper(klammer_base.Klammer_base):
# this marker where the typeface is needed, and @document collects the
# markers, resolves and localizes each typeface, declares it, and replaces
# the marker with whatever inline switch the target needs (a font-switch
# command for tex, nothing for html, which carries the family name in the
# span's own style). Same shape as the __CAPTION__ markers.
# command for tex; for html the marker sits IN the span's font-family value
# and becomes the family name the store resolved the typeface to, which
# is what the localized css declares -- the name as WRITTEN may be the
# store's directory name, "noto-sans-egyptian-hieroglyphs", and a span
# carrying that matched no @font-face until 2026-09-12). Same shape as
# the __CAPTION__ markers.
#
# SYNC: typeface_marker_rgx in sks/document/document_class.h -- a C++/Python
# pair, so the constant cannot be single-sourced the way a .k/.py pair can
@@ -53,18 +57,23 @@ class Typeface(klammer_base.Klammer_base):
# hieroglyphs, cuneiform -- and would resize them unpredictably.
# The family name is quoted -- an unquoted digit-initial word
# ("Source Sans 3") is invalid CSS -- with SINGLE quotes, because
# this sits inside a double-quoted html attribute.
style = (f"font-family: '{self.name}', serif; "
f"font-size-adjust: none")
# this sits inside a double-quoted html attribute. What is quoted
# here is the MARKER: @document replaces it with the resolved
# family name (see the marker note above).
style = "', serif; font-size-adjust: none"
if float(self.scale) != 1.0:
style += f"; font-size: {float(self.scale)}em"
# The STYLE is markup, so its typographically active characters are
# hidden: the html target's transforms turn a single quote into a
# curly one, which broke the css font-family value. The TEXT is
# writer content and is deliberately left alone -- its quotes and
# dashes should be transformed.
return (typeface_marker(self.name, self.scale)
+ f'<span style="{klammer_base.hide_typographic(style)}">'
# curly one, which broke the css font-family value. The MARKER is
# not hidden: a hyphen in the typeface name would become a KTESC
# sequence, which on the :files path is still there when @document
# looks for the marker. The TEXT is writer content and is
# deliberately left alone -- its quotes and dashes should be
# transformed.
hide = klammer_base.hide_typographic
return (f'<span style="{hide("font-family: " + chr(39))}'
+ typeface_marker(self.name, self.scale) + hide(style) + '">'
+ f'{self.text}</span>')
def tex(self):