Width and height argtypes, kdesc --argtypes from ref/, txt @define/@left_right/@columns, kdiag --check value validation (from dev d6993110e9b3)
Also: the klammertext argtype (descriptions kept as source), txt table wrapping and :hpos/:offset, @c between ‹ ›, txt section headings, the ktext newline-only trim, capitalize(), and the argtype test suite. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b0d0d7897
commit
0ead40f272
39 files changed
+734
-158
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ string, so a "^#" or a bare "^@" inside it was read as Klammertext and usually
|
||||
failed the file, which is not what "verbatim" can mean.
|
||||
@@
|
||||
|
||||
@@c.html,tex :: @eval code_block.Code_fragment(K) eval@
|
||||
@@c.html,tex,txt :: @eval code_block.Code_fragment(K) eval@
|
||||
@@
|
||||
|
||||
# :cwd makes the filename resolve against the DOCUMENT's directory, not
|
||||
|
||||
@@ -349,6 +349,18 @@ class Code_fragment(klammer_base.Klammer_base):
|
||||
def tex(self):
|
||||
return f"{{\\tt {tex_line(self.code_text.strip())}}}"
|
||||
|
||||
def txt(self):
|
||||
# Plain text has no face to switch to: the fragment is its own text.
|
||||
# As in html_line/tex_line, the Klammertext specials are quoted for
|
||||
# the @eval read-back (a bare "@" in the result would be a klammer
|
||||
# without a beginning) and the typographically active characters
|
||||
# hidden, so a "--" in code stays two hyphens.
|
||||
result = klammer_base.hide_typographic(quote_specials(self.code_text.strip()))
|
||||
# Surround code symbols with ‹ and ›, though there are conflicts in Swiss
|
||||
# German, Italian and some Scandinavian languages. Should be clear in
|
||||
# context, though.
|
||||
result = "\u2039" + result + "\u203A"
|
||||
return result
|
||||
|
||||
def extract_marked_region(src, marker, filename):
|
||||
"""The region of `src` between two lines that are exactly "//<marker>".
|
||||
|
||||
Reference in new issue
Block a user