katom types from ref/ in groups, @table :leading in lines of text and :rulesep, @code under txt, one table style attribute, literal-klammer options (from dev 2e453744f5e9)

kdesc --katoms is Klammertext rendered from ref/, the types in titled groups,
with --katoms full for the regex column.  @table :leading L is L lines of the
surrounding text in html as in pdf (default 1), and :rulesep spaces the
horizontal rules.  The html table has one style attribute, so :column_width
fractions take effect again.  @code and @source_listing render in plain
text; captions are numbered per kind there, and a table needs no blank line
around it.  @c takes :nd, and an option-shaped word before a bar inside
literal code is code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ackandClaude Fable 5.1 committed 2026-09-21 22:37:13 +02:00
1 parent 63956c00e5
commit 217c0f3fc5
23 files changed
+625 -290

No files matched your search

+21 -5
View File
@@ -158,10 +158,17 @@ static std::string text_target()
return color_enabled(std::cout) ? "ansi" : "txt";
}
void show_special_characters()
// The Machine for a description kdesc renders from the ref/ klammerset.
static Machine ref_machine()
{
Machine M;
M.read(M.m_state.value("KLAMMERTEXT_HOME") + "/ref/ref.k");
return M;
}
void show_special_characters()
{
Machine M = ref_machine();
M.read_string("@b Writing characters with diacritics and non-English characters @\n\n");
M.read_string("@diacritics_examples@");
M.read_string("@extended_latin_examples@");
@@ -171,20 +178,29 @@ void show_special_characters()
void show_unicode_examples()
{
Machine M;
M.read(M.m_state.value("KLAMMERTEXT_HOME") + "/ref/ref.k");
Machine M = ref_machine();
M.read_string("@unicode_examples@");
std::cout << "\n" << M.apply(text_target()) << "\n\n";
}
void show_argtype_definitions()
{
Machine M;
M.read(M.m_state.value("KLAMMERTEXT_HOME") + "/ref/ref.k");
Machine M = ref_machine();
M.read_string("@argtype_definitions@");
std::cout << "\n" << M.apply(text_target()) << "\n\n";
}
// The katom table is wider than the text: four columns, the last of them a
// sentence. The width is the klammer's argument rather than a state
// variable set here, so the paragraphs above the table keep the text width.
void describe_katoms(bool show_regex)
{
Machine M = ref_machine();
M.read_string(std::string("@katom_descriptions :txt_width ") +
(show_regex ? "160 :regex" : "120") + " @");
std::cout << "\n" << M.apply(text_target()) << "\n\n";
}
int main(int argc, char* argv[])
{
try {