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 | |
| parent | html, bespoke homepage, symlink toc.html index.html (diff) | |
replace directory listing, blank index.html
| -rw-r--r-- | org/out_curate_metadata.org | 6 | ||||
| -rw-r--r-- | org/out_latex.org | 34 | ||||
| -rw-r--r-- | org/out_metadata.org | 27 | ||||
| -rw-r--r-- | org/out_odt.org | 86 | ||||
| -rw-r--r-- | org/out_src_pod.org | 16 | ||||
| -rw-r--r-- | org/out_xmls.org | 41 | ||||
| -rw-r--r-- | org/output_hub.org | 8 | ||||
| -rw-r--r-- | src/doc_reform/io_out/epub3.d | 4 | ||||
| -rw-r--r-- | src/doc_reform/io_out/html.d | 30 | ||||
| -rw-r--r-- | src/doc_reform/io_out/hub.d | 8 | ||||
| -rw-r--r-- | src/doc_reform/io_out/latex.d | 34 | ||||
| -rw-r--r-- | src/doc_reform/io_out/metadata.d | 27 | ||||
| -rw-r--r-- | src/doc_reform/io_out/odt.d | 86 | ||||
| -rw-r--r-- | src/doc_reform/io_out/source_pod.d | 4 | ||||
| -rw-r--r-- | src/doc_reform/io_out/xmls.d | 7 | ||||
| -rw-r--r-- | src/doc_reform/meta/metadoc_curate_authors.d | 4 | ||||
| -rw-r--r-- | src/doc_reform/meta/metadoc_curate_topics.d | 2 | ||||
| -rw-r--r-- | views/configuration.txt | 3 | 
18 files changed, 270 insertions, 157 deletions
| diff --git a/org/out_curate_metadata.org b/org/out_curate_metadata.org index 9022463..e06ea5c 100644 --- a/org/out_curate_metadata.org +++ b/org/out_curate_metadata.org @@ -452,7 +452,7 @@ foreach(k0;  import doc_reform.io_out.paths_output;  auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, "");  try { -  auto f       = File(out_pth.curate("topics.html"), "w"); +  auto f = File(out_pth.curate("topics.html"), "w");    foreach (o; topics) {      f.writeln(o);    } @@ -528,7 +528,7 @@ template spineMetaDocCuratesAuthors() {  <h1>⌘ Curated metadata - Authors (output organised by language & filetype)</h1>  <div class="flex-menu-bar">  <div class="flex-menu-option"> -<p>[<a href="../../index.html"> ≅ HOME </a>] +<p>[<a href="../../index.html"> ⟰ HOME </a> | <a href="../index.html"> ≅ Collection </a>]   [<a href="topics.html"> ⌘ Curated metadata - Topics </a>] </p>  </div>  %s @@ -614,7 +614,7 @@ template spineMetaDocCuratesAuthors() {  import doc_reform.io_out.paths_output;  auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, "");  try { -  auto f       = File(out_pth.curate("authors.html"), "w"); +  auto f = File(out_pth.curate("authors.html"), "w");    foreach (o; authors) {      f.writeln(o);    } diff --git a/org/out_latex.org b/org/out_latex.org index adab6e2..d1b6aff 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -203,17 +203,23 @@ void writeOutputLaTeX(T,M)(      if (doc_matters.opt.action.vox_gt0) {        writeln(" ", pth_latex.latex_file_with_path(paper_size_orientation));      } -    auto f = File(pth_latex.latex_file_with_path(paper_size_orientation), "w"); -    f.writeln(latex_content.head); -    f.writeln(latex_content.content); -    f.writeln(latex_content.tail); -    foreach (image; doc_matters.srcs.image_list) { -      string fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; -      string fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; -      if (exists(fn_src_in)) { -        fn_src_in.copy(fn_src_out_file); +    { +      auto f = File(pth_latex.latex_file_with_path(paper_size_orientation), "w"); +      f.writeln(latex_content.head); +      f.writeln(latex_content.content); +      f.writeln(latex_content.tail); +      foreach (image; doc_matters.srcs.image_list) { +        string fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; +        string fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; +        if (exists(fn_src_in)) { +          fn_src_in.copy(fn_src_out_file); +        }        }      } +    if (!exists(pth_latex.latex_path_stuff ~ "/index.html")) { +      auto f = File(pth_latex.latex_path_stuff ~"/index.html", "w"); +      f.writeln(""); +    }    } catch (ErrnoException ex) {      // handle error    } @@ -272,8 +278,14 @@ void writeOutputLaTeXstyStatic(        if (!exists(pth_latex.base_sty)) {          (pth_latex.base_sty).mkdirRecurse;        } -      auto f = File(pth_latex.latex_document_header_sty(filename), "w"); -      f.writeln(latex_sty); +      { +        auto f = File(pth_latex.latex_document_header_sty(filename), "w"); +        f.writeln(latex_sty); +      } +      if (!exists(pth_latex.base_sty ~ "/index.html")) { +        auto f = File(pth_latex.base_sty ~"/index.html", "w"); +        f.writeln(""); +      }      } catch (ErrnoException ex) {        // handle error      } diff --git a/org/out_metadata.org b/org/out_metadata.org index aa57303..84c374c 100644 --- a/org/out_metadata.org +++ b/org/out_metadata.org @@ -88,12 +88,17 @@ metadata_ ~= format(q"┃<body lang="en" xml:lang="en">  ┃");  metadata_ ~= "<div class=\"flex-menu-bar\"><div class=\"flex-menu-option\">";  if (doc_matters.opt.action.html_link_curate) { -  metadata_ ~= format(q"┃<p>[<a href="../../../index.html"> <b>≅</b> ≅ HOME </a>] ⌘ Curated metadata: -   [<a href="../../authors.html"> Authors </a>] -   [<a href="../../topics.html"> Topics </a>]</p> -┃"); +  metadata_ ~= format(q"┃<p>[<a href="%s"> <b>⟰</b> HOME </a> | <a href="../../index.html"> ≅ Collection </a>]  [ +   <a href="../../authors.html"> 🖋 Authors </a> | +   <a href="../../topics.html"> ⌘ Topics </a>]</p> +┃", +(doc_matters.opt.action.webserver_url_doc_root.length > 0) +  ? doc_matters.opt.action.webserver_url_doc_root +  : doc_matters.conf_make_meta.conf.w_srv_data_root_url +  , // HOME index.html equivalent _cfg.www_url_doc_root, +);  } else { -  metadata_ ~= format(q"┃<p>[<a href="../../../index.html"> ≅ <b>HOME</b> </a>] +  metadata_ ~= format(q"┃<p>[<a href="../../../index.html"> ≅ <b>HOME</b> </a> <a href="../../index.html"> ≅ Collection </a>]  ┃");  }  metadata_ ~= "</div>" ~ inline_search_form(doc_matters) ~ "</div><hr />"; @@ -265,9 +270,15 @@ metadata_write_output(doc_matters, metadata_);      if (!exists(pth_html.base)) {        pth_html.base.mkdirRecurse;      } -    auto f = File(pth_html.fn_scroll("metadata." ~ doc_matters.src.filename), "w"); -    foreach (o; metadata_) { -      f.writeln(o); +    { +      auto f = File(pth_html.fn_scroll("metadata." ~ doc_matters.src.filename), "w"); +      foreach (o; metadata_) { +        f.writeln(o); +      } +    } +    if (!exists(pth_html.base ~ "/index.html")) { +      auto f = File(pth_html.base ~"/index.html", "w"); +      f.writeln("");      }    } catch (ErrnoException ex) {      // Handle error 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 diff --git a/org/out_src_pod.org b/org/out_src_pod.org index 9f66c3f..b59b217 100644 --- a/org/out_src_pod.org +++ b/org/out_src_pod.org @@ -143,6 +143,10 @@ if (doc_matters.opt.action.source_or_pod) {      pths_pod.doc_lng(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.mkdirRecurse;    }  } +if (!exists(pths_pod.pod_dir_() ~ "/index.html")) { +  auto f = File(pths_pod.pod_dir_() ~"/index.html", "w"); +  f.writeln(""); +}  #+END_SRC  ** copy :copy: @@ -565,13 +569,13 @@ if (exists(fn_pod)) {  # skip  .dub/**  tmp/** -*_.org -*_.d -*_.txt -*_ -*~ +,*_.org +,*_.d +,*_.txt +,*_ +,*~  \#* -*.\#* +,*.\#*  #+END_SRC  *** document pod structure diff --git a/org/out_xmls.org b/org/out_xmls.org index d9c4800..febee54 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -439,7 +439,7 @@ import  ) {    string o;    string metadata_links = ((doc_matters.opt.action.html_link_curate) -    ? format(q"┃<p class="small">[<a href="%s"> ≅ </a>|<a href="%s"> %s </a>|<a href="%sepub/%s.%s.epub"> ◆ </a>|%s%s<a href="%smetadata.%s.html"> ⌘• </a>|<a href="%s../../authors.html"> ⌘A </a>|<a href="%s../../topics.html"> ⌘T </a>]</p>┃", +    ? format(q"┃<p class="small"><a href="%s">⟰ </a> [<a href="%s"> %s </a><a href="%sepub/%s.%s.epub"> ◆ </a>%s%s<a href="%smetadata.%s.html"> ⌘• </a>]  <a href="%s../../index.html"> ≅ </a>|<a href="%s../../authors.html"> 🖋 </a>|<a href="%s../../topics.html"> ⌘ </a>|</p>┃",          (doc_matters.opt.action.webserver_url_doc_root.length > 0)            ? doc_matters.opt.action.webserver_url_doc_root            : doc_matters.conf_make_meta.conf.w_srv_data_root_url @@ -458,7 +458,7 @@ import            ~ doc_matters.src.filename_base            ~  "."            ~ doc_matters.src.lng -          ~ ".a4.portrait.pdf\"> □ </a>|") +          ~ ".a4.portrait.pdf\"> □ </a>")          : "",          (doc_matters.opt.action.html_link_pdf || doc_matters.opt.action.html_link_pdf_letter)          ? ("<a href=\"" @@ -467,12 +467,13 @@ import            ~ doc_matters.src.filename_base            ~  "."            ~ doc_matters.src.lng -          ~ ".letter.portrait.pdf\"> □ </a>|") +          ~ ".letter.portrait.pdf\"> □ </a>")          : "",          (type == "seg") ? "../" : "",          doc_matters.src.filename_base,          (type == "seg") ? "../" : "",          (type == "seg") ? "../" : "", +        (type == "seg") ? "../" : "",        )      : "");    o = format(q"┃<!DOCTYPE html> @@ -2007,9 +2008,15 @@ default:      if (!exists(pth_html.base)) {        pth_html.base.mkdirRecurse;      } -    auto f = File(pth_html.fn_scroll(doc_matters.src.filename), "w"); -    foreach (o; doc) { -      f.writeln(o); +    { +      auto f = File(pth_html.fn_scroll(doc_matters.src.filename), "w"); +      foreach (o; doc) { +        f.writeln(o); +      } +    } +    if (!exists(pth_html.base ~ "/index.html")) { +      auto f = File(pth_html.base ~"/index.html", "w"); +      f.writeln("");      }    } catch (ErrnoException ex) {      // Handle error @@ -2373,10 +2380,16 @@ default:      if (!exists(pth_html.css)) {        (pth_html.css).mkdirRecurse;      } -    auto f = File(pth_html.fn_seg_css, "w"); -    f.writeln(css.html_seg); -    f = File(pth_html.fn_scroll_css, "w"); -    f.writeln(css.html_scroll); +    { +      auto f = File(pth_html.fn_seg_css, "w"); +      f.writeln(css.html_seg); +      f = File(pth_html.fn_scroll_css, "w"); +      f.writeln(css.html_scroll); +    } +    if (!exists(pth_html.css ~ "/index.html")) { +      auto f = File(pth_html.css ~"/index.html", "w"); +      f.writeln(""); +    }    } catch (ErrnoException ex) {      // Handle error    } @@ -2409,6 +2422,10 @@ default:          }        }      } +    if (!exists(pth_html.image ~ "/index.html")) { +      auto f = File(pth_html.image ~"/index.html", "w"); +      f.writeln(""); +    }    }  }  #+END_SRC @@ -3140,6 +3157,10 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS      if (!exists(pth_epub3.base)) {        pth_epub3.base.mkdirRecurse;      } +    if (!exists(pth_epub3.base ~ "/index.html")) { +      auto f = File(pth_epub3.base ~"/index.html", "w"); +      f.writeln(""); +    }      { /+ debug +/        if (doc_matters.opt.action.debug_do_epub) {          if (!exists(pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename))) { diff --git a/org/output_hub.org b/org/output_hub.org index 179a008..c4de132 100644 --- a/org/output_hub.org +++ b/org/output_hub.org @@ -81,11 +81,11 @@ template outputHubInitialize() {          && !(opt_action.output_dir_set ~ "/index.html").exists      ) {        writeln(_bespoke_homepage); -      if (("./spine-bespoke-output/html/homepage.index.html").exists) { -        writeln("copy bespoke html homepage\n./spine-bespoke-output/html/homepage.index.html -> ", opt_action.output_dir_set, "/index.html"); -        "./spine-bespoke-output/html/homepage.index.html".copy(opt_action.output_dir_set ~ "/index.html"); +      if ((_bespoke_homepage).exists) { +        writeln("copy bespoke html homepage\n", _bespoke_homepage, " -> ", opt_action.output_dir_set, "/index.html"); +        _bespoke_homepage.copy(opt_action.output_dir_set ~ "/index.html");        } else { -        writeln("place bespoke homepage in ./spine-bespoke-output/html/homepage.index.html"); +        writeln("place bespoke homepage in ", _bespoke_homepage);        }      }      if ( diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index 7a646fb..c94863b 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -638,6 +638,10 @@ template outputEPub3() {        if (!exists(pth_epub3.base)) {          pth_epub3.base.mkdirRecurse;        } +      if (!exists(pth_epub3.base ~ "/index.html")) { +        auto f = File(pth_epub3.base ~"/index.html", "w"); +        f.writeln(""); +      }        { /+ debug +/          if (doc_matters.opt.action.debug_do_epub) {            if (!exists(pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename))) { diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index 29f7f4e..9e108c6 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -245,9 +245,15 @@ template outputHTML() {        if (!exists(pth_html.base)) {          pth_html.base.mkdirRecurse;        } -      auto f = File(pth_html.fn_scroll(doc_matters.src.filename), "w"); -      foreach (o; doc) { -        f.writeln(o); +      { +        auto f = File(pth_html.fn_scroll(doc_matters.src.filename), "w"); +        foreach (o; doc) { +          f.writeln(o); +        } +      } +      if (!exists(pth_html.base ~ "/index.html")) { +        auto f = File(pth_html.base ~"/index.html", "w"); +        f.writeln("");        }      } catch (ErrnoException ex) {        // Handle error @@ -550,10 +556,16 @@ template outputHTML() {        if (!exists(pth_html.css)) {          (pth_html.css).mkdirRecurse;        } -      auto f = File(pth_html.fn_seg_css, "w"); -      f.writeln(css.html_seg); -      f = File(pth_html.fn_scroll_css, "w"); -      f.writeln(css.html_scroll); +      { +        auto f = File(pth_html.fn_seg_css, "w"); +        f.writeln(css.html_seg); +        f = File(pth_html.fn_scroll_css, "w"); +        f.writeln(css.html_scroll); +      } +      if (!exists(pth_html.css ~ "/index.html")) { +        auto f = File(pth_html.css ~"/index.html", "w"); +        f.writeln(""); +      }      } catch (ErrnoException ex) {        // Handle error      } @@ -580,6 +592,10 @@ template outputHTML() {            }          }        } +      if (!exists(pth_html.image ~ "/index.html")) { +        auto f = File(pth_html.image ~"/index.html", "w"); +        f.writeln(""); +      }      }    }  } diff --git a/src/doc_reform/io_out/hub.d b/src/doc_reform/io_out/hub.d index 06c684e..308d05a 100644 --- a/src/doc_reform/io_out/hub.d +++ b/src/doc_reform/io_out/hub.d @@ -180,11 +180,11 @@ template outputHubInitialize() {          && !(opt_action.output_dir_set ~ "/index.html").exists      ) {        writeln(_bespoke_homepage); -      if (("./spine-bespoke-output/html/homepage.index.html").exists) { -        writeln("copy bespoke html homepage\n./spine-bespoke-output/html/homepage.index.html -> ", opt_action.output_dir_set, "/index.html"); -        "./spine-bespoke-output/html/homepage.index.html".copy(opt_action.output_dir_set ~ "/index.html"); +      if ((_bespoke_homepage).exists) { +        writeln("copy bespoke html homepage\n", _bespoke_homepage, " -> ", opt_action.output_dir_set, "/index.html"); +        _bespoke_homepage.copy(opt_action.output_dir_set ~ "/index.html");        } else { -        writeln("place bespoke homepage in ./spine-bespoke-output/html/homepage.index.html"); +        writeln("place bespoke homepage in ", _bespoke_homepage);        }      }      if ( diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index 56ae9fe..231d0c5 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -1349,17 +1349,23 @@ template outputLaTeX() {        if (doc_matters.opt.action.vox_gt0) {          writeln(" ", pth_latex.latex_file_with_path(paper_size_orientation));        } -      auto f = File(pth_latex.latex_file_with_path(paper_size_orientation), "w"); -      f.writeln(latex_content.head); -      f.writeln(latex_content.content); -      f.writeln(latex_content.tail); -      foreach (image; doc_matters.srcs.image_list) { -        string fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; -        string fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; -        if (exists(fn_src_in)) { -          fn_src_in.copy(fn_src_out_file); +      { +        auto f = File(pth_latex.latex_file_with_path(paper_size_orientation), "w"); +        f.writeln(latex_content.head); +        f.writeln(latex_content.content); +        f.writeln(latex_content.tail); +        foreach (image; doc_matters.srcs.image_list) { +          string fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; +          string fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; +          if (exists(fn_src_in)) { +            fn_src_in.copy(fn_src_out_file); +          }          }        } +      if (!exists(pth_latex.latex_path_stuff ~ "/index.html")) { +        auto f = File(pth_latex.latex_path_stuff ~"/index.html", "w"); +        f.writeln(""); +      }      } catch (ErrnoException ex) {        // handle error      } @@ -1399,8 +1405,14 @@ template outputLaTeXstyInit() {          if (!exists(pth_latex.base_sty)) {            (pth_latex.base_sty).mkdirRecurse;          } -        auto f = File(pth_latex.latex_document_header_sty(filename), "w"); -        f.writeln(latex_sty); +        { +          auto f = File(pth_latex.latex_document_header_sty(filename), "w"); +          f.writeln(latex_sty); +        } +        if (!exists(pth_latex.base_sty ~ "/index.html")) { +          auto f = File(pth_latex.base_sty ~"/index.html", "w"); +          f.writeln(""); +        }        } catch (ErrnoException ex) {          // handle error        } diff --git a/src/doc_reform/io_out/metadata.d b/src/doc_reform/io_out/metadata.d index 3fab452..2686d15 100644 --- a/src/doc_reform/io_out/metadata.d +++ b/src/doc_reform/io_out/metadata.d @@ -331,9 +331,15 @@ string theme_light_1 = format(q"┃          if (!exists(pth_html.base)) {            pth_html.base.mkdirRecurse;          } -        auto f = File(pth_html.fn_scroll("metadata." ~ doc_matters.src.filename), "w"); -        foreach (o; metadata_) { -          f.writeln(o); +        { +          auto f = File(pth_html.fn_scroll("metadata." ~ doc_matters.src.filename), "w"); +          foreach (o; metadata_) { +            f.writeln(o); +          } +        } +        if (!exists(pth_html.base ~ "/index.html")) { +          auto f = File(pth_html.base ~"/index.html", "w"); +          f.writeln("");          }        } catch (ErrnoException ex) {          // Handle error @@ -372,12 +378,17 @@ string theme_light_1 = format(q"┃      ┃");      metadata_ ~= "<div class=\"flex-menu-bar\"><div class=\"flex-menu-option\">";      if (doc_matters.opt.action.html_link_curate) { -      metadata_ ~= format(q"┃<p>[<a href="../../../index.html"> <b>≅</b> ≅ HOME </a>] ⌘ Curated metadata: -       [<a href="../../authors.html"> Authors </a>] -       [<a href="../../topics.html"> Topics </a>]</p> -    ┃"); +      metadata_ ~= format(q"┃<p>[<a href="%s"> <b>⟰</b> HOME </a> | <a href="../../index.html"> ≅ Collection </a>]  [ +       <a href="../../authors.html"> 🖋 Authors </a> | +       <a href="../../topics.html"> ⌘ Topics </a>]</p> +    ┃", +    (doc_matters.opt.action.webserver_url_doc_root.length > 0) +      ? doc_matters.opt.action.webserver_url_doc_root +      : doc_matters.conf_make_meta.conf.w_srv_data_root_url +      , // HOME index.html equivalent _cfg.www_url_doc_root, +    );      } else { -      metadata_ ~= format(q"┃<p>[<a href="../../../index.html"> ≅ <b>HOME</b> </a>] +      metadata_ ~= format(q"┃<p>[<a href="../../../index.html"> ≅ <b>HOME</b> </a> <a href="../../index.html"> ≅ Collection </a>]      ┃");      }      metadata_ ~= "</div>" ~ inline_search_form(doc_matters) ~ "</div><hr />"; diff --git a/src/doc_reform/io_out/odt.d b/src/doc_reform/io_out/odt.d index 8604684..df52149 100644 --- a/src/doc_reform/io_out/odt.d +++ b/src/doc_reform/io_out/odt.d @@ -999,6 +999,10 @@ template outputODT() {      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;    }    @safe string mimetype() { @@ -2049,48 +2053,54 @@ template outputODT() {        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 diff --git a/src/doc_reform/io_out/source_pod.d b/src/doc_reform/io_out/source_pod.d index 7c08a89..f61721c 100644 --- a/src/doc_reform/io_out/source_pod.d +++ b/src/doc_reform/io_out/source_pod.d @@ -128,6 +128,10 @@ template spinePod() {            pths_pod.doc_lng(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.mkdirRecurse;          }        } +      if (!exists(pths_pod.pod_dir_() ~ "/index.html")) { +        auto f = File(pths_pod.pod_dir_() ~"/index.html", "w"); +        f.writeln(""); +      }        if (doc_matters.opt.action.debug_do_pod        && doc_matters.opt.action.vox_gt1) {          writeln(__LINE__, ": ", diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index 048b614..c38844c 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -320,7 +320,7 @@ template outputXHTMLs() {      ) {        string o;        string metadata_links = ((doc_matters.opt.action.html_link_curate) -        ? format(q"┃<p class="small">[<a href="%s"> ≅ </a>|<a href="%s"> %s </a>|<a href="%sepub/%s.%s.epub"> ◆ </a>|%s%s<a href="%smetadata.%s.html"> ⌘• </a>|<a href="%s../../authors.html"> ⌘A </a>|<a href="%s../../topics.html"> ⌘T </a>]</p>┃", +        ? format(q"┃<p class="small"><a href="%s">⟰ </a> [<a href="%s"> %s </a><a href="%sepub/%s.%s.epub"> ◆ </a>%s%s<a href="%smetadata.%s.html"> ⌘• </a>]  <a href="%s../../index.html"> ≅ </a>|<a href="%s../../authors.html"> 🖋 </a>|<a href="%s../../topics.html"> ⌘ </a>|</p>┃",              (doc_matters.opt.action.webserver_url_doc_root.length > 0)                ? doc_matters.opt.action.webserver_url_doc_root                : doc_matters.conf_make_meta.conf.w_srv_data_root_url @@ -339,7 +339,7 @@ template outputXHTMLs() {                ~ doc_matters.src.filename_base                ~  "."                ~ doc_matters.src.lng -              ~ ".a4.portrait.pdf\"> □ </a>|") +              ~ ".a4.portrait.pdf\"> □ </a>")              : "",              (doc_matters.opt.action.html_link_pdf || doc_matters.opt.action.html_link_pdf_letter)              ? ("<a href=\"" @@ -348,12 +348,13 @@ template outputXHTMLs() {                ~ doc_matters.src.filename_base                ~  "."                ~ doc_matters.src.lng -              ~ ".letter.portrait.pdf\"> □ </a>|") +              ~ ".letter.portrait.pdf\"> □ </a>")              : "",              (type == "seg") ? "../" : "",              doc_matters.src.filename_base,              (type == "seg") ? "../" : "",              (type == "seg") ? "../" : "", +            (type == "seg") ? "../" : "",            )          : "");        o = format(q"┃<!DOCTYPE html> diff --git a/src/doc_reform/meta/metadoc_curate_authors.d b/src/doc_reform/meta/metadoc_curate_authors.d index ee78b23..574b6d1 100644 --- a/src/doc_reform/meta/metadoc_curate_authors.d +++ b/src/doc_reform/meta/metadoc_curate_authors.d @@ -394,7 +394,7 @@ string theme_light_1 = format(q"┃  <h1>⌘ Curated metadata - Authors (output organised by language & filetype)</h1>  <div class="flex-menu-bar">  <div class="flex-menu-option"> -<p>[<a href="../../index.html"> ≅ HOME </a>] +<p>[<a href="../../index.html"> ⟰ HOME </a> | <a href="../index.html"> ≅ Collection </a>]   [<a href="topics.html"> ⌘ Curated metadata - Topics </a>] </p>  </div>  %s @@ -480,7 +480,7 @@ string theme_light_1 = format(q"┃      import doc_reform.io_out.paths_output;      auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, "");      try { -      auto f       = File(out_pth.curate("authors.html"), "w"); +      auto f = File(out_pth.curate("authors.html"), "w");        foreach (o; authors) {          f.writeln(o);        } diff --git a/src/doc_reform/meta/metadoc_curate_topics.d b/src/doc_reform/meta/metadoc_curate_topics.d index 82f0060..304bd00 100644 --- a/src/doc_reform/meta/metadoc_curate_topics.d +++ b/src/doc_reform/meta/metadoc_curate_topics.d @@ -648,7 +648,7 @@ string theme_light_1 = format(q"┃      import doc_reform.io_out.paths_output;      auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, "");      try { -      auto f       = File(out_pth.curate("topics.html"), "w"); +      auto f = File(out_pth.curate("topics.html"), "w");        foreach (o; topics) {          f.writeln(o);        } diff --git a/views/configuration.txt b/views/configuration.txt index 7728c94..5f49a1a 100644 --- a/views/configuration.txt +++ b/views/configuration.txt @@ -4,9 +4,6 @@ struct Cfg {    string www_url_doc_root         = "http://localhost";    string www_url_doc_subroot      = "/spine";    string processing_path_doc_root = "/srv/www/spine"; -  // string processing_path_doc_root = "/srv/www/spine"; -  // string processing_path_doc_root = "/srv/www"; -  // string processing_path_doc_subroot = "/spine";    string cgi_bin_root             = "/var/www/cgi/cgi-bin";    string cgi_bin_subpath          = "/cgi-bin";    string cgi_filename             = "spine_search"; | 
