aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/out_odt.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-21 00:25:19 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-22 13:09:35 -0400
commit515c44399843c62336a0102e933f9fbd7289743d (patch)
tree97cb7a699872c7d235a5833933c415458aff074e /org/out_odt.org
parentmetadata: use document's language (diff)
odt: office:meta from the document, not the run
Three faults in four lines of the odt metadata. meta:creation-date and dc:date were taken from generated_time, the run's own clock, so two runs over unchanged markup produced different odt bytes. They now carry the document's own instant, so an odt is a function of its source. That was the last clock stamp in any writer: every output format is now reproducible. generated_time is a human-readable run stamp, of the form "2026-9-17 [38/3] 18:39:35", with unpadded numbers and an iso week in brackets. It is not a valid xsd:dateTime, which is what ODF asks for in both of those fields, so what was written there was malformed as well as unstable. dc:language now carries the document's own language tag. The instant is doc_matters.modified_utc, moved there from epub3.d in this commit: epub3 needs the same value for its dcterms:modified, and one definition cannot drift from the other. generated_time now has no caller and is left in place. (assisted by Claude-Code)
Diffstat (limited to 'org/out_odt.org')
-rw-r--r--org/out_odt.org15
1 files changed, 11 insertions, 4 deletions
diff --git a/org/out_odt.org b/org/out_odt.org
index 4dbb549..b28e8d1 100644
--- a/org/out_odt.org
+++ b/org/out_odt.org
@@ -2544,7 +2544,13 @@ _images.join("\n"),
string meta_xml(M)(
auto ref M doc_matters,
) {
- /+ (meta_xml includes output time-stamp) +/
+ /+ ↓ office:meta carries the document's own date and language, not the run's
+ time-stamp. Both dates were taken from doc_matters.generated_time, which
+ is a human-readable run stamp ("2026-9-17 [38/3] 18:39:35") and not a
+ valid xsd:dateTime, which is what ODF asks for here; so the field was
+ malformed and different on every run. dc:language was a hard-coded
+ "en-US".
+ +/
string _meta_xml = format(q"┃<?xml version="1.0" encoding="UTF-8"?>
#+END_SRC
@@ -2555,7 +2561,7 @@ string meta_xml(M)(
<meta:generator>%s</meta:generator>
<meta:creation-date>%s</meta:creation-date>
<dc:date>%s</dc:date>
- <dc:language>en-US</dc:language>
+ <dc:language>%s</dc:language>
</office:meta>
</office:document-meta>
#+END_SRC
@@ -2564,8 +2570,9 @@ string meta_xml(M)(
#+BEGIN_SRC d
┃",
doc_matters.generator_program.name_and_version,
-doc_matters.generated_time,
-doc_matters.generated_time,
+doc_matters.modified_utc,
+doc_matters.modified_utc,
+doc_matters.src.language_tag,
);
return _meta_xml;
}