aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/io_out/odt.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2021-10-05 12:39:53 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2021-11-27 19:40:42 -0500
commit02718313824caa0e87eb0f1448684ff8d2dbe4d1 (patch)
treecb916873c46c57d18643d26fb6731f5258824a0f /src/doc_reform/io_out/odt.d
parentnix related config, direnv else minor (diff)
primarily org related
Diffstat (limited to 'src/doc_reform/io_out/odt.d')
-rw-r--r--src/doc_reform/io_out/odt.d372
1 files changed, 186 insertions, 186 deletions
diff --git a/src/doc_reform/io_out/odt.d b/src/doc_reform/io_out/odt.d
index e23e409..5183342 100644
--- a/src/doc_reform/io_out/odt.d
+++ b/src/doc_reform/io_out/odt.d
@@ -40,7 +40,7 @@
- docReform object numbering
- standard SiSU object citation numbering & system
- - Hompages:
+ - Homepages:
[https://www.doc_reform.org]
[https://www.sisudoc.org]
@@ -658,78 +658,78 @@ template outputODT() {
// mixin outputXmlODT;
@safe string odt_head(I)(I doc_matters) {
string _has_tables = format(q"┃
- <style:style style:name="Table1" style:family="table">
- <style:table-properties style:width="16.999cm" table:align="margins"/>
- </style:style>
- <style:style style:name="Table1.A" style:family="table-column">
- <style:table-column-properties style:column-width="16.999cm" style:rel-column-width="65535*"/>
- </style:style>
- <style:style style:name="Table1.B" style:family="table-column">
- <style:table-column-properties style:column-width="8.499cm" style:rel-column-width="32767*"/>
- </style:style>
- <style:style style:name="Table1.C" style:family="table-column">
- <style:table-column-properties style:column-width="5.666cm" style:rel-column-width="21845*"/>
- </style:style>
- <style:style style:name="Table1.D" style:family="table-column">
- <style:table-column-properties style:column-width="4.349cm" style:rel-column-width="16383*"/>
- </style:style>
- <style:style style:name="Table1.E" style:family="table-column">
- <style:table-column-properties style:column-width="3.399cm" style:rel-column-width="13107*"/>
- </style:style>
- <style:style style:name="Table1.F" style:family="table-column">
- <style:table-column-properties style:column-width="2.833cm" style:rel-column-width="10922*"/>
- </style:style>
- <style:style style:name="Table1.G" style:family="table-column">
- <style:table-column-properties style:column-width="2.428cm" style:rel-column-width="9362*"/>
- </style:style>
- <style:style style:name="Table1.H" style:family="table-column">
- <style:table-column-properties style:column-width="2.124cm" style:rel-column-width="8191*"/>
- </style:style>
- <style:style style:name="Table2" style:family="table">
- <style:table-properties style:width="16.999cm" table:align="margins"/>
- </style:style>
- <style:style style:name="Table2.A" style:family="table-column">
- <style:table-column-properties style:column-width="16.999cm" style:rel-column-width="65535*"/>
- </style:style>
- <style:style style:name="Table2.B" style:family="table-column">
- <style:table-column-properties style:column-width="8.499cm" style:rel-column-width="32767*"/>
- </style:style>
- <style:style style:name="Table2.C" style:family="table-column">
- <style:table-column-properties style:column-width="5.666cm" style:rel-column-width="21845*"/>
- </style:style>
- <style:style style:name="Table2.D" style:family="table-column">
- <style:table-column-properties style:column-width="4.349cm" style:rel-column-width="16383*"/>
- </style:style>
- <style:style style:name="Table2.E" style:family="table-column">
- <style:table-column-properties style:column-width="3.999cm" style:rel-column-width="13107*"/>
- </style:style>
- <style:style style:name="Table2.F" style:family="table-column">
- <style:table-column-properties style:column-width="2.833cm" style:rel-column-width="10922*"/>
- </style:style>
- <style:style style:name="Table2.G" style:family="table-column">
- <style:table-column-properties style:column-width="2.428cm" style:rel-column-width="9362*"/>
- </style:style>
- <style:style style:name="Table2.H" style:family="table-column">
- <style:table-column-properties style:column-width="2.124cm" style:rel-column-width="8191*"/>
- </style:style>
- <style:style style:name="Table2.I" style:family="table-column">
- <style:table-column-properties style:column-width="1.8887cm" style:rel-column-width="7281*"/>
- </style:style>
- <style:style style:name="Table2.J" style:family="table-column">
- <style:table-column-properties style:column-width="1.6999cm" style:rel-column-width="6553*"/>
- </style:style>
- <style:style style:name="Table2.K" style:family="table-column">
- <style:table-column-properties style:column-width="1.5453cm" style:rel-column-width="5957*"/>
- </style:style>
- <style:style style:name="Table2.L" style:family="table-column">
- <style:table-column-properties style:column-width="1.416cm" style:rel-column-width="5461*"/>
- </style:style>
- <style:style style:name="Table2.M" style:family="table-column">
- <style:table-column-properties style:column-width="1.307" style:rel-column-width="5041*"/>
- </style:style>
- <style:style style:name="Table2.N" style:family="table-column">
- <style:table-column-properties style:column-width="1.214cm" style:rel-column-width="4681*"/>
- </style:style>
+ <style:style style:name="Table1" style:family="table">
+ <style:table-properties style:width="16.999cm" table:align="margins"/>
+ </style:style>
+ <style:style style:name="Table1.A" style:family="table-column">
+ <style:table-column-properties style:column-width="16.999cm" style:rel-column-width="65535*"/>
+ </style:style>
+ <style:style style:name="Table1.B" style:family="table-column">
+ <style:table-column-properties style:column-width="8.499cm" style:rel-column-width="32767*"/>
+ </style:style>
+ <style:style style:name="Table1.C" style:family="table-column">
+ <style:table-column-properties style:column-width="5.666cm" style:rel-column-width="21845*"/>
+ </style:style>
+ <style:style style:name="Table1.D" style:family="table-column">
+ <style:table-column-properties style:column-width="4.349cm" style:rel-column-width="16383*"/>
+ </style:style>
+ <style:style style:name="Table1.E" style:family="table-column">
+ <style:table-column-properties style:column-width="3.399cm" style:rel-column-width="13107*"/>
+ </style:style>
+ <style:style style:name="Table1.F" style:family="table-column">
+ <style:table-column-properties style:column-width="2.833cm" style:rel-column-width="10922*"/>
+ </style:style>
+ <style:style style:name="Table1.G" style:family="table-column">
+ <style:table-column-properties style:column-width="2.428cm" style:rel-column-width="9362*"/>
+ </style:style>
+ <style:style style:name="Table1.H" style:family="table-column">
+ <style:table-column-properties style:column-width="2.124cm" style:rel-column-width="8191*"/>
+ </style:style>
+ <style:style style:name="Table2" style:family="table">
+ <style:table-properties style:width="16.999cm" table:align="margins"/>
+ </style:style>
+ <style:style style:name="Table2.A" style:family="table-column">
+ <style:table-column-properties style:column-width="16.999cm" style:rel-column-width="65535*"/>
+ </style:style>
+ <style:style style:name="Table2.B" style:family="table-column">
+ <style:table-column-properties style:column-width="8.499cm" style:rel-column-width="32767*"/>
+ </style:style>
+ <style:style style:name="Table2.C" style:family="table-column">
+ <style:table-column-properties style:column-width="5.666cm" style:rel-column-width="21845*"/>
+ </style:style>
+ <style:style style:name="Table2.D" style:family="table-column">
+ <style:table-column-properties style:column-width="4.349cm" style:rel-column-width="16383*"/>
+ </style:style>
+ <style:style style:name="Table2.E" style:family="table-column">
+ <style:table-column-properties style:column-width="3.999cm" style:rel-column-width="13107*"/>
+ </style:style>
+ <style:style style:name="Table2.F" style:family="table-column">
+ <style:table-column-properties style:column-width="2.833cm" style:rel-column-width="10922*"/>
+ </style:style>
+ <style:style style:name="Table2.G" style:family="table-column">
+ <style:table-column-properties style:column-width="2.428cm" style:rel-column-width="9362*"/>
+ </style:style>
+ <style:style style:name="Table2.H" style:family="table-column">
+ <style:table-column-properties style:column-width="2.124cm" style:rel-column-width="8191*"/>
+ </style:style>
+ <style:style style:name="Table2.I" style:family="table-column">
+ <style:table-column-properties style:column-width="1.8887cm" style:rel-column-width="7281*"/>
+ </style:style>
+ <style:style style:name="Table2.J" style:family="table-column">
+ <style:table-column-properties style:column-width="1.6999cm" style:rel-column-width="6553*"/>
+ </style:style>
+ <style:style style:name="Table2.K" style:family="table-column">
+ <style:table-column-properties style:column-width="1.5453cm" style:rel-column-width="5957*"/>
+ </style:style>
+ <style:style style:name="Table2.L" style:family="table-column">
+ <style:table-column-properties style:column-width="1.416cm" style:rel-column-width="5461*"/>
+ </style:style>
+ <style:style style:name="Table2.M" style:family="table-column">
+ <style:table-column-properties style:column-width="1.307" style:rel-column-width="5041*"/>
+ </style:style>
+ <style:style style:name="Table2.N" style:family="table-column">
+ <style:table-column-properties style:column-width="1.214cm" style:rel-column-width="4681*"/>
+ </style:style>
┃",);
string _odt_head = format(q"┃<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xl="https://www.w3.org/1999/xlink" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="https://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="https://openoffice.org/2004/office" xmlns:ooow="https://openoffice.org/2004/writer" xmlns:oooc="https://openoffice.org/2004/calc" xmlns:dom="https://www.w3.org/2001/xml-events" xmlns:xforms="https://www.w3.org/2002/xforms" xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="https://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="https://www.w3.org/1999/xhtml" xmlns:grddl="https://www.w3.org/2003/g/data-view#" xmlns:tableooo="https://openoffice.org/2009/table" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="https://www.w3.org/TR/css3-text/" office:version="1.2">
@@ -773,123 +773,123 @@ template outputODT() {
string delimit = "";
string doc_odt = "";
string _txt = "";
- foreach (part; doc_matters.has.keys_seq.scroll) {
- foreach (obj; doc_abstraction[part]) {
- switch (obj.metainfo.is_of_part) {
- case "frontmatter": assert(part == "head" || "toc");
- switch (obj.metainfo.is_of_type) {
- case "para":
- switch (obj.metainfo.is_a) {
- case "heading":
- _txt = delimit ~ odt_format.heading(obj, doc_matters);
- goto default;
- case "toc":
- _txt = odt_format.para(obj, doc_matters);
- goto default;
- default:
- doc_odt ~= _txt;
- _txt = "";
- break;
- }
- break;
- default: break;
- }
- break;
- case "body": assert(part == "body" || "head"); // surprise
- switch (obj.metainfo.is_of_type) {
- case "para":
- switch (obj.metainfo.is_a) {
- case "heading":
- _txt = delimit ~ odt_format.heading(obj, doc_matters);
- goto default;
- case "para":
- _txt = odt_format.para(obj, doc_matters);
- goto default;
- default:
- doc_odt ~= _txt;
- _txt = "";
- break;
- }
- break;
- case "block":
- switch (obj.metainfo.is_a) {
- case "quote":
- _txt = odt_format.quote(obj, doc_matters);
- goto default;
- case "group":
- _txt = odt_format.group(obj, doc_matters);
- goto default;
- case "block":
- _txt = odt_format.block(obj, doc_matters);
- goto default;
- case "verse":
- _txt = odt_format.verse(obj, doc_matters);
- goto default;
- case "code":
- _txt = odt_format.code(obj, doc_matters);
- goto default;
- case "table":
- _txt = odt_format.table(obj, doc_matters);
- goto default;
- default:
- doc_odt ~= _txt;
- _txt = "";
- break;
- }
- break;
- default: break;
- }
- break;
- case "backmatter":
- assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
- switch (obj.metainfo.is_of_type) {
- case "para":
- switch (obj.metainfo.is_a) {
- case "heading":
- _txt = delimit ~ odt_format.heading(obj, doc_matters);
- goto default;
- case "endnote": assert(part == "endnotes");
- _txt = odt_format.para(obj, doc_matters);
- goto default;
- case "glossary": assert(part == "glossary");
- _txt = odt_format.para(obj, doc_matters);
- goto default;
- case "bibliography": assert(part == "bibliography");
- _txt = odt_format.para(obj, doc_matters);
- goto default;
- case "bookindex": assert(part == "bookindex");
- _txt = odt_format.para(obj, doc_matters);
- goto default;
- case "blurb": assert(part == "blurb");
- _txt = odt_format.para(obj, doc_matters);
- goto default;
- default:
- doc_odt ~= _txt;
- _txt = "";
- break;
- }
- break;
- default: break;
- }
- break;
- case "comment":
- break;
- default:
- { /+ debug +/
- if (doc_matters.opt.action.debug_do
- && doc_matters.opt.action.verbose) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
- writeln(__FILE__, ":", __LINE__, ": ", obj.text);
- }
- }
- break;
+ foreach (part; doc_matters.has.keys_seq.scroll) {
+ foreach (obj; doc_abstraction[part]) {
+ switch (obj.metainfo.is_of_part) {
+ case "frontmatter": assert(part == "head" || "toc");
+ switch (obj.metainfo.is_of_type) {
+ case "para":
+ switch (obj.metainfo.is_a) {
+ case "heading":
+ _txt = delimit ~ odt_format.heading(obj, doc_matters);
+ goto default;
+ case "toc":
+ _txt = odt_format.para(obj, doc_matters);
+ goto default;
+ default:
+ doc_odt ~= _txt;
+ _txt = "";
+ break;
+ }
+ break;
+ default: break;
+ }
+ break;
+ case "body": assert(part == "body" || "head"); // surprise
+ switch (obj.metainfo.is_of_type) {
+ case "para":
+ switch (obj.metainfo.is_a) {
+ case "heading":
+ _txt = delimit ~ odt_format.heading(obj, doc_matters);
+ goto default;
+ case "para":
+ _txt = odt_format.para(obj, doc_matters);
+ goto default;
+ default:
+ doc_odt ~= _txt;
+ _txt = "";
+ break;
+ }
+ break;
+ case "block":
+ switch (obj.metainfo.is_a) {
+ case "quote":
+ _txt = odt_format.quote(obj, doc_matters);
+ goto default;
+ case "group":
+ _txt = odt_format.group(obj, doc_matters);
+ goto default;
+ case "block":
+ _txt = odt_format.block(obj, doc_matters);
+ goto default;
+ case "verse":
+ _txt = odt_format.verse(obj, doc_matters);
+ goto default;
+ case "code":
+ _txt = odt_format.code(obj, doc_matters);
+ goto default;
+ case "table":
+ _txt = odt_format.table(obj, doc_matters);
+ goto default;
+ default:
+ doc_odt ~= _txt;
+ _txt = "";
+ break;
+ }
+ break;
+ default: break;
+ }
+ break;
+ case "backmatter":
+ assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
+ switch (obj.metainfo.is_of_type) {
+ case "para":
+ switch (obj.metainfo.is_a) {
+ case "heading":
+ _txt = delimit ~ odt_format.heading(obj, doc_matters);
+ goto default;
+ case "endnote": assert(part == "endnotes");
+ _txt = odt_format.para(obj, doc_matters);
+ goto default;
+ case "glossary": assert(part == "glossary");
+ _txt = odt_format.para(obj, doc_matters);
+ goto default;
+ case "bibliography": assert(part == "bibliography");
+ _txt = odt_format.para(obj, doc_matters);
+ goto default;
+ case "bookindex": assert(part == "bookindex");
+ _txt = odt_format.para(obj, doc_matters);
+ goto default;
+ case "blurb": assert(part == "blurb");
+ _txt = odt_format.para(obj, doc_matters);
+ goto default;
+ default:
+ doc_odt ~= _txt;
+ _txt = "";
+ break;
+ }
+ break;
+ default: break;
+ }
+ break;
+ case "comment":
+ break;
+ default:
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.text);
+ }
+ }
+ break;
}
}
}
return doc_odt;
}
-
+
@safe string odt_tail() {
string _odt_tail = format(q"┃<text:p text:style-name="P_normal">spine: &lt;<text:a xl:type="simple" xl:href="https://www.doc_reform.org">www.doc_reform.org</text:a>&gt; and &lt;<text:a xl:type="simple" xl:href="https://www.sisudoc.org">www.sisudoc.org</text:a>&gt;</text:p>
</office:text></office:body></office:document-content>┃",);
@@ -2090,7 +2090,7 @@ template outputODT() {
pth_odt.manifest_rdf("fs"); /+ (manifest.rdf) +/
pth_odt.settings_xml("fs"); /+ (settings.xml) +/
pth_odt.styles_xml("fs"); /+ (styles_xml) +/
-
+
pth_odt.content_xml("fs");
pth_odt.manifest_xml("fs");
pth_odt.meta_xml("fs");