aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/outputs/io_out/odt.d
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 /src/sisudoc/outputs/io_out/odt.d
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 'src/sisudoc/outputs/io_out/odt.d')
-rw-r--r--src/sisudoc/outputs/io_out/odt.d15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/sisudoc/outputs/io_out/odt.d b/src/sisudoc/outputs/io_out/odt.d
index 711be50..40d760d 100644
--- a/src/sisudoc/outputs/io_out/odt.d
+++ b/src/sisudoc/outputs/io_out/odt.d
@@ -959,20 +959,27 @@ template outputODT() {
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"?>
<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xl="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.2">
<office:meta>
<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>
┃",
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;
}