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

+11 -2
View File
@@ -1,3 +1,4 @@
#include <algorithm>
#include <set>
#include <utility>
#include "machine.h"
@@ -402,11 +403,19 @@ void Machine::mark_literal_klammer_content(katom_list& katoms)
// Find where literal content starts.
// Skip bars_before_literal bars (separating preceding positional args).
// If options are present, skip past the bar after them.
// Options are identified by :name katoms before any bar.
// Options are identified by :name katoms before any bar -- but only
// a name THE KLAMMER DECLARES. Any ":word" counted until 2026-09-20,
// so code holding one before a bar ("@c ls :w | wc c@", a regex's
// "(?:a|b)") had its text up to the bar taken for options and the
// file failed with 'Optional argument ":w" not defined' -- an error
// about an option the author never wrote, in content that is
// promised to be read as nothing but text.
const auto& optional_names = klammer.m_parameters.m_optional_names;
auto literal_start = k + 1;
bool has_options = false;
for (auto j = k + 1; j < close; ++j) {
if (j->m_type == katom_t::option_name) {
if (j->m_type == katom_t::option_name &&
std::ranges::count(optional_names, std::string(j->m_text, 1)) > 0) {
has_options = true;
}
if (j->m_type == katom_t::bar) {