diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-25 18:18:51 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-27 17:12:28 -0400 |
commit | 9125357297e005a555586c354be18ea03701d342 (patch) | |
tree | 0ee41623282ae0e886e227caabde551581d73518 /org/out_odt.org | |
parent | html, bespoke homepage, symlink toc.html index.html (diff) |
replace directory listing, blank index.html
Diffstat (limited to 'org/out_odt.org')
-rw-r--r-- | org/out_odt.org | 86 |
1 files changed, 48 insertions, 38 deletions
diff --git a/org/out_odt.org b/org/out_odt.org index 170d87e..2f24159 100644 --- a/org/out_odt.org +++ b/org/out_odt.org @@ -927,48 +927,54 @@ void writeOutputODT(W,I)( if (!exists(pth_odt.base_pth)) { // check pth_odt.base_pth.mkdirRecurse; } - string fn; - File f; - { fn = pth_odt.mimetype("zip"); - ODTzip(odt_content.mimetype, fn); - } - { fn = pth_odt.manifest_rdf("zip"); - ODTzip(odt_content.manifest_rdf, fn); - } - { fn = pth_odt.settings_xml("zip"); - ODTzip(odt_content.settings_xml, fn); - } - { fn = pth_odt.styles_xml("zip"); - ODTzip(odt_content.styles_xml, fn); - } - { fn = pth_odt.content_xml("zip"); - ODTzip(odt_content.content_xml, fn); - } - { fn = pth_odt.manifest_xml("zip"); - ODTzip(odt_content.manifest_xml, fn); - } - { fn = pth_odt.meta_xml("zip"); - ODTzip(odt_content.meta_xml, fn); - } - { /+ (images) +/ - foreach (image; doc_matters.srcs.image_list) { - auto fn_src = doc_matters.src.image_dir_path ~ "/" ~ image; - auto fn_out = pth_odt.image_dir("zip") ~ "/" ~ image; - if (exists(fn_src)) { - { - auto zip_arc_member_file = new ArchiveMember(); - zip_arc_member_file.name = fn_out; - auto zip_data = new OutBuffer(); - zip_data.write(cast(char[]) ((fn_src).read)); - zip_arc_member_file.expandedData = zip_data.toBytes(); - zip.addMember(zip_arc_member_file); - createZipFile!()(fn_odt, zip.build()); + { + string fn; + File f; + { fn = pth_odt.mimetype("zip"); + ODTzip(odt_content.mimetype, fn); + } + { fn = pth_odt.manifest_rdf("zip"); + ODTzip(odt_content.manifest_rdf, fn); + } + { fn = pth_odt.settings_xml("zip"); + ODTzip(odt_content.settings_xml, fn); + } + { fn = pth_odt.styles_xml("zip"); + ODTzip(odt_content.styles_xml, fn); + } + { fn = pth_odt.content_xml("zip"); + ODTzip(odt_content.content_xml, fn); + } + { fn = pth_odt.manifest_xml("zip"); + ODTzip(odt_content.manifest_xml, fn); + } + { fn = pth_odt.meta_xml("zip"); + ODTzip(odt_content.meta_xml, fn); + } + { /+ (images) +/ + foreach (image; doc_matters.srcs.image_list) { + auto fn_src = doc_matters.src.image_dir_path ~ "/" ~ image; + auto fn_out = pth_odt.image_dir("zip") ~ "/" ~ image; + if (exists(fn_src)) { + { + auto zip_arc_member_file = new ArchiveMember(); + zip_arc_member_file.name = fn_out; + auto zip_data = new OutBuffer(); + zip_data.write(cast(char[]) ((fn_src).read)); + zip_arc_member_file.expandedData = zip_data.toBytes(); + zip.addMember(zip_arc_member_file); + createZipFile!()(fn_odt, zip.build()); + } } } } + if (doc_matters.opt.action.vox_gt0) { + writeln(" ", pth_odt.odt_file); + } } - if (doc_matters.opt.action.vox_gt0) { - writeln(" ", pth_odt.odt_file); + if (!exists(pth_odt.base_pth ~ "/index.html")) { + auto f = File(pth_odt.base_pth ~"/index.html", "w"); + f.writeln(""); } } catch (ErrnoException ex) { // Handle error @@ -1063,6 +1069,10 @@ void dirtree(I)( if (!exists(pth_odt.base_pth)) { pth_odt.base_pth.mkdirRecurse; } + if (!exists(pth_odt.base_pth ~ "/index.html")) { + auto f = File(pth_odt.base_pth ~"/index.html", "w"); + f.writeln(""); + } // return 0; } #+END_SRC |