diff options
Diffstat (limited to 'src/doc_reform/output/paths_output.d')
-rw-r--r-- | src/doc_reform/output/paths_output.d | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/doc_reform/output/paths_output.d b/src/doc_reform/output/paths_output.d index f33db27..615a666 100644 --- a/src/doc_reform/output/paths_output.d +++ b/src/doc_reform/output/paths_output.d @@ -264,6 +264,73 @@ template DocReformPathsEPUB() { return _PathsStruct(); } } +template DocReformPathsODT() { + mixin DocReformRgxInit; + static auto rgx = Rgx(); + auto DocReformPathsODT(M)( + M doc_matters, + ) { + auto out_pth = DocReformOutPaths!()( doc_matters.output_path, doc_matters.src.language); + string base_dir = "odf"; + struct _PathsStruct { + string base_pth() { // dir will contain odt document file (also debug file tree) + return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array; + } + // string base_filename() { + // return doc_matters.src.filename_base; + // } + string odt_file() { + return asNormalizedPath(base_pth.chainPath(doc_matters.src.filename_base ~ ".odt")).array; + } + string dirtop(string type) { + return (type == "zip") + ? "".chainPath("").array + : asNormalizedPath(base_pth.chainPath(doc_matters.src.filename_base)).array; + } + string mimetype(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("mimetype")).array; + } + string manifest_rdf(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("manifest.rdf")).array; + } + string settings_xml(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("settings.xml")).array; + } + string styles_xml(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("styles.xml")).array; + } + string image_dir(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("Pictures")).array; + } + string image(string image_fn_src, string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(image_dir(type).chainPath(image_fn_src)).array; + } + string content_xml(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("content.xml")).array; + } + string meta_inf_dir(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("META-INF")).array; + } + string manifest_xml(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(meta_inf_dir(type).chainPath("manifest.xml")).array; + } + string meta_xml(string type="fs") { + assert(type == "zip" || "fs"); + return asNormalizedPath(dirtop(type).chainPath("meta.xml")).array; + } + } + return _PathsStruct(); + } +} template DocReformPathsSQLiteDiscrete() { mixin DocReformRgxInit; static auto rgx = Rgx(); |