Document language for dates; @eval pathname resolution and :cwd (from dev bc7cd62b6f68)

@date/@datetime gain :lang (German: "16. Juni 1910") over a document-wide
Language state variable, and :number for the numeric form (en 6/16/1910,
de 16.06.1910 per DIN 5008).  @eval finds Python modules next to the file
that names them regardless of the cwd, and the new :cwd option runs an
eval in a chosen working directory (@source_file uses it to resolve
against the document).  Two new test suites ship in tst/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-27 20:25:49 +02:00
parent f84603ee19
commit 61b21d1397
12 changed files with 309 additions and 15 deletions

View File

@@ -80,3 +80,17 @@ An <id> is the value of the ^:id argument for an image.
:pattern [\s\S]*
:python_cast (lambda s: __import__("kutil").filename_list(s))
@@@
@@@argtype language |
an ISO 639-1 language code (two lowercase letters) selecting the language
of text a klammer generates, e.g. en (English) or de (German). The
languages actually available are listed by the klammer that uses the
argument (^@date and ^@datetime); an unknown code reports them.
:pattern [a-z][a-z]
@@@
# The document-wide language for generated text. A klammer's own :lang
# argument overrides it; see the language argtype above. Consumers today:
# @date and @datetime (month names and date form). Set it for a whole
# document with @@@state Language :value de @@@
@@@state Language :desc Language (ISO 639-1) for generated text :value en @@@