diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-06-23 14:01:43 -0400 | 
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-10-17 19:07:20 -0400 | 
| commit | d542315e97260128706af55652964f18e9fdc4bb (patch) | |
| tree | cfa3a68fa463eaf433fb562fd69a1a0b968e0b4e /src | |
| parent | harvest reorganized (diff) | |
harvests reorganized; adjustments: output, pathsdoc-reform_v0.7.3
Diffstat (limited to 'src')
| -rwxr-xr-x | src/doc_reform/doc_reform.d | 10 | ||||
| -rw-r--r-- | src/doc_reform/meta/defaults.d | 2 | ||||
| -rw-r--r-- | src/doc_reform/meta/metadoc_harvest.d | 7 | ||||
| -rw-r--r-- | src/doc_reform/meta/metadoc_harvests_authors.d | 143 | ||||
| -rw-r--r-- | src/doc_reform/meta/metadoc_harvests_topics.d | 143 | ||||
| -rw-r--r-- | src/doc_reform/output/paths_output.d | 154 | ||||
| -rw-r--r-- | src/doc_reform/source/paths_source.d | 13 | 
7 files changed, 385 insertions, 87 deletions
| diff --git a/src/doc_reform/doc_reform.d b/src/doc_reform/doc_reform.d index d48851b..0fa326d 100755 --- a/src/doc_reform/doc_reform.d +++ b/src/doc_reform/doc_reform.d @@ -804,5 +804,15 @@ void main(string[] args) {      if (_opt_action.harvest_authors) {        DocReformMetaDocHarvestsAuthors!()(hvst.harvests, _opt_action);      } +    if (!(_opt_action.quiet)) { +      import doc_reform.output.paths_output; +      auto out_pth = DocReformPathsHTML!()(_opt_action.output_dir_set, ""); +      if (_opt_action.harvest_authors) { +        writeln("- ", out_pth.harvest("authors.html")); +      } +      if (_opt_action.harvest_topics) { +        writeln("- ", out_pth.harvest("topics.html")); +      } +    }    }  } diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index 4a4ae8f..ace121b 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -101,7 +101,7 @@ template DocReformHarvest() {          string   uid                  = "";          string   date_published       = "";          string[] topic_register_arr   = []; -        string   path_html_seg        = ""; +        string   path_html_segtoc     = "";          string   path_html_scroll     = "";          string   path_epub            = "";          string   url_html_seg         = ""; diff --git a/src/doc_reform/meta/metadoc_harvest.d b/src/doc_reform/meta/metadoc_harvest.d index 2a83814..83c6d35 100644 --- a/src/doc_reform/meta/metadoc_harvest.d +++ b/src/doc_reform/meta/metadoc_harvest.d @@ -21,7 +21,8 @@ template DocReformMetaDocHarvest() {      mixin InternalMarkup;      auto markup = InlineMarkup();      import doc_reform.output.paths_output; -    auto pth_html                   = DocReformPathsHTML!()(doc_matters.output_path, doc_matters.src.language); +    auto pth_html_abs               = DocReformPathsHTML!()(doc_matters.output_path, doc_matters.src.language); +    auto pth_html_rel               = DocReformDocRootTreeHTML!()(doc_matters.src.language);      hvst.harvest.title              = doc_matters.conf_make_meta.meta.title_full;      hvst.harvest.author             = doc_matters.conf_make_meta.meta.creator_author;      hvst.harvest.author_surname     = doc_matters.conf_make_meta.meta.creator_author_surname; @@ -32,8 +33,8 @@ template DocReformMetaDocHarvest() {      hvst.harvest.uid                = doc_matters.src.doc_uid;      hvst.harvest.date_published     = doc_matters.conf_make_meta.meta.date_published;      hvst.harvest.topic_register_arr = doc_matters.conf_make_meta.meta.classify_topic_register_arr; -    hvst.harvest.path_html_scroll   = pth_html.fn_scroll(doc_matters.src.filename); -    hvst.harvest.path_html_seg      = pth_html.fn_seg(doc_matters.src.filename, "toc"); +    hvst.harvest.path_html_scroll   = pth_html_rel.fn_scroll(doc_matters.src.filename); +    hvst.harvest.path_html_segtoc   = pth_html_rel.fn_seg(doc_matters.src.filename, "toc");      return hvst.harvest;    }  } diff --git a/src/doc_reform/meta/metadoc_harvests_authors.d b/src/doc_reform/meta/metadoc_harvests_authors.d index d780221..950d1ff 100644 --- a/src/doc_reform/meta/metadoc_harvests_authors.d +++ b/src/doc_reform/meta/metadoc_harvests_authors.d @@ -19,21 +19,33 @@ template DocReformMetaDocHarvestsAuthors() {      H  harvests,      O  _opt_action,    ) { -      string[] authors = []; -      authors ~= format(q"┃ -<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8"> -<title>Metadata Harvest - Authors</title> -<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -<meta name="dc.title" content= "metadata harvest, Authors & Topics - information Structuring Universe, Structured information Serialised Units" /> -<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" /> -<meta name="generator" content="doc_reform" /> -<link rel="generator" href="http://sisudoc.org" /> -<link href="../../_sisu/css/harvest.css" rel="stylesheet"> -<style TYPE="text/css"> -/* DocReform harvest css default stylesheet */ +string theme_dark_0 = format(q"┃ +  body { +    color: #CCCCCC; +    background: #000000; +    background-color: #000000; +  } +  a:link { +    color: #FFFFFF; +    text-decoration: none; +  } +  a:visited { +    color: #999999; +    text-decoration: none; +  } +  a:hover { +    color: #000000; +    background-color: #555555; +  } +  a:hover img { +    background-color: #000000; +  } +  a:active { +    color: #888888; +    text-decoration: underline; +  } +┃"); +string theme_light_0 = format(q"┃    body {      color: black;      background: #ffffff; @@ -58,7 +70,80 @@ template DocReformMetaDocHarvestsAuthors() {      color: #003399;      text-decoration: underline;    } - +┃"); +string theme_dark_1 = format(q"┃ +  h1 { +    color: white; +    background: #000000; +  } +  p.letter { +    color: white; +    background: #333333; +  } +  p.lev0 { +    color: white; +    background: #000000; +  } +  p.lev1 { +    color: white; +    background: #333333; +  } +  p.lev2 { +    background: #555555; +  } +  p.lev3 { +    background: #777777; +  } +  p.lev4 { +    background: #aaaaaa; +  } +  p.lev5 { +  } +┃"); +string theme_light_1 = format(q"┃ +  h1 { +    color: white; +    background: #000088; +  } +  p.letter { +    color: white; +    background: #880000; +  } +  p.lev0 { +    color: white; +    background: #000000; +  } +  p.lev1 { +    color: white; +    background: #444444; +  } +  p.lev2 { +    background: #888888; +  } +  p.lev3 { +    background: #bbbbbb; +  } +  p.lev4 { +    background: #eeeeee; +  } +  p.lev5 { +  } +┃"); +      string[] authors = []; +      authors ~= format(q"┃ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Metadata Harvest - Authors</title> +<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> +<meta name="dc.title" content= "metadata harvest, Authors & Topics - information Structuring Universe, Structured information Serialised Units" /> +<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" /> +<meta name="generator" content="doc_reform" /> +<link rel="generator" href="http://sisudoc.org" /> +<link href="../../_sisu/css/harvest.css" rel="stylesheet"> +<style TYPE="text/css"> +/* DocReform harvest css default stylesheet */%s    .norm, .bold {      line-height: 150%%;      margin-left: 1em; @@ -81,6 +166,7 @@ template DocReformMetaDocHarvestsAuthors() {      margin-right: 6px;      text-align: left;    } +  h0, h1, h2, h3, h4, h5, h6, h7 { text-shadow: .2em .2em .3em #999999; }    h1 {      font-size: 120%%;      font-weight: bold; @@ -120,41 +206,31 @@ template DocReformMetaDocHarvestsAuthors() {      margin-bottom: 0px;      margin-right: 6px;      text-align: left; -    color: white; -    background: #880000;    }    p.lev0 {      font-size: 120%%;      margin-left: 1em; -    color: white; -    background: #000000;    } -    p.lev1 {      font-size: 110%%;      margin-left: 2em; -    color: white; -    background: #444444;    }    p.lev2 {      font-size: 100%%;      margin-left: 3em; -    background: #888888;    }    p.lev3 {      font-size: 90%%;      margin-left: 4em; -    background: #bbbbbb;    }    p.lev4 {      font-size: 80%%;      margin-left: 5em; -    background: #eeeeee;    }    p.lev5 {      font-size: 80%%;      margin-left: 6em; -  } +  }%s  </style>  <link rel="shortcut icon" href="../_sisu/image/rb7.ico" />  </head> @@ -169,7 +245,10 @@ template DocReformMetaDocHarvestsAuthors() {  <p class="tiny"><a href="../../en/manifest/authors.html">English</a>   </p>  <hr />  <p><a href="#A">A</a>, <a href="#B">B</a>, <a href="#C">C</a>, <a href="#D">D</a>, <a href="#E">E</a>, <a href="#F">F</a>, <a href="#G">G</a>, <a href="#H">H</a>, <a href="#I">I</a>, <a href="#J">J</a>, <a href="#K">K</a>, <a href="#L">L</a>, <a href="#M">M</a>, <a href="#N">N</a>, <a href="#O">O</a>, <a href="#P">P</a>, <a href="#Q">Q</a>, <a href="#R">R</a>, <a href="#S">S</a>, <a href="#T">T</a>, <a href="#U">U</a>, <a href="#V">V</a>, <a href="#W">W</a>, <a href="#X">X</a>, <a href="#Y">Y</a>, <a href="#Z">Z</a>,  -┃") ~ "\n"; +┃", +  _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, +  _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, +) ~ "\n";        string[string] _au;        string[] _auth_date_title;        string[] _author_date_title; @@ -191,7 +270,7 @@ template DocReformMetaDocHarvestsAuthors() {              doc_harvest.author_surname_fn,              (doc_harvest.date_published.length > 0)                ? doc_harvest.date_published : "", -            "url", +            doc_harvest.path_html_segtoc,              doc_harvest.title,              doc_harvest.language,            ); @@ -201,7 +280,7 @@ template DocReformMetaDocHarvestsAuthors() {            ~= format(q"┃<p class="publication">%s "<a href="%s">%s</a>" [%s]</p>┃",              (doc_harvest.date_published.length > 0)                ? doc_harvest.date_published : "", -            "url", +            doc_harvest.path_html_segtoc,              doc_harvest.title,              doc_harvest.language,            ); @@ -236,8 +315,10 @@ template DocReformMetaDocHarvestsAuthors() {  </body>  </html>  ┃") ~ "\n"; +    import doc_reform.output.paths_output; +    auto out_pth = DocReformPathsHTML!()(_opt_action.output_dir_set, "");      try { -      auto f = File("authors.html", "w"); +      auto f       = File(out_pth.harvest("authors.html"), "w");        foreach (o; authors) {          f.writeln(o);        } diff --git a/src/doc_reform/meta/metadoc_harvests_topics.d b/src/doc_reform/meta/metadoc_harvests_topics.d index f0aed57..a5a481c 100644 --- a/src/doc_reform/meta/metadoc_harvests_topics.d +++ b/src/doc_reform/meta/metadoc_harvests_topics.d @@ -62,19 +62,33 @@ template DocReformMetaDocHarvestsTopics() {            _topic_register.sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable).release.join("\n"),          );        } -      topics ~= format(q"┃<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8"> -<title>Metadata Harvest - Topics</title> -<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -<meta name="dc.title" content= "metadata harvest, Authors & Topics - information Structuring Universe, Structured information Serialised Units" /> -<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" /> -<meta name="generator" content="doc_reform" /> -<link rel="generator" href="http://sisudoc.org" /> -<link href="../../_sisu/css/harvest.css" rel="stylesheet"> -<style TYPE="text/css"> -/* DocReform harvest css default stylesheet */ +string theme_dark_0 = format(q"┃ +  body { +    color: #CCCCCC; +    background: #000000; +    background-color: #000000; +  } +  a:link { +    color: #FFFFFF; +    text-decoration: none; +  } +  a:visited { +    color: #999999; +    text-decoration: none; +  } +  a:hover { +    color: #000000; +    background-color: #555555; +  } +  a:hover img { +    background-color: #000000; +  } +  a:active { +    color: #888888; +    text-decoration: underline; +  } +┃"); +string theme_light_0 = format(q"┃    body {      color: black;      background: #ffffff; @@ -99,7 +113,78 @@ template DocReformMetaDocHarvestsTopics() {      color: #003399;      text-decoration: underline;    } - +┃"); +string theme_dark_1 = format(q"┃ +  h1 { +    color: white; +    background: #000000; +  } +  p.letter { +    color: white; +    background: #333333; +  } +  p.lev0 { +    color: white; +    background: #000000; +  } +  p.lev1 { +    color: white; +    background: #333333; +  } +  p.lev2 { +    background: #555555; +  } +  p.lev3 { +    background: #777777; +  } +  p.lev4 { +    background: #aaaaaa; +  } +  p.lev5 { +  } +┃"); +string theme_light_1 = format(q"┃ +  h1 { +    color: white; +    background: #000088; +  } +  p.letter { +    color: white; +    background: #880000; +  } +  p.lev0 { +    color: white; +    background: #000000; +  } +  p.lev1 { +    color: white; +    background: #444444; +  } +  p.lev2 { +    background: #888888; +  } +  p.lev3 { +    background: #bbbbbb; +  } +  p.lev4 { +    background: #eeeeee; +  } +  p.lev5 { +  } +┃"); +      topics ~= format(q"┃<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Metadata Harvest - Topics</title> +<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> +<meta name="dc.title" content= "metadata harvest, Authors & Topics - information Structuring Universe, Structured information Serialised Units" /> +<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" /> +<meta name="generator" content="doc_reform" /> +<link rel="generator" href="http://sisudoc.org" /> +<link href="../../_sisu/css/harvest.css" rel="stylesheet"> +<style TYPE="text/css"> +/* DocReform harvest css default stylesheet */%s    .norm, .bold {      line-height: 150%%;      margin-left: 1em; @@ -122,6 +207,7 @@ template DocReformMetaDocHarvestsTopics() {      margin-right: 6px;      text-align: left;    } +  h0, h1, h2, h3, h4, h5, h6, h7 { text-shadow: .2em .2em .3em #999999; }    h1 {      font-size: 120%%;      font-weight: bold; @@ -161,41 +247,31 @@ template DocReformMetaDocHarvestsTopics() {      margin-bottom: 0px;      margin-right: 6px;      text-align: left; -    color: white; -    background: #880000;    }    p.lev0 {      font-size: 120%%;      margin-left: 1em; -    color: white; -    background: #000000;    } -    p.lev1 {      font-size: 110%%;      margin-left: 2em; -    color: white; -    background: #444444;    }    p.lev2 {      font-size: 100%%;      margin-left: 3em; -    background: #888888;    }    p.lev3 {      font-size: 90%%;      margin-left: 4em; -    background: #bbbbbb;    }    p.lev4 {      font-size: 80%%;      margin-left: 5em; -    background: #eeeeee;    }    p.lev5 {      font-size: 80%%;      margin-left: 6em; -  } +  }%s  </style>  <link rel="shortcut icon" href="../_sisu/image/rb7.ico" />  </head> @@ -210,7 +286,10 @@ template DocReformMetaDocHarvestsTopics() {  <hr />  <p class="tiny"><a href="../../en/manifest/topics.html">English</a>   </p>  <hr /> -┃") ~ "\n"; +┃", +  _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, +  _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, +) ~ "\n";        char _prev_k = "_".to!char;        int _kn;        foreach(k0; @@ -250,7 +329,7 @@ template DocReformMetaDocHarvestsTopics() {                  }                }                topics ~= format(q"┃<p class="work"><a href="%s">"%s"</a> -%s┃", -                "url", +                t_a_.path_html_segtoc,                  t_a_.title,                  _auth,                ) ~ "\n"; @@ -289,7 +368,7 @@ template DocReformMetaDocHarvestsTopics() {                      }                    }                    topics ~= format(q"┃<p class="work"><a href="%s">%s</a> -%s┃", -                    "url", +                    t_a_.path_html_segtoc,                      t_a_.title,                      _auth,                    ) ~ "\n"; @@ -329,7 +408,7 @@ template DocReformMetaDocHarvestsTopics() {                        }                      }                      topics ~= format(q"┃<p class="work"><a href="%s">%s</a> -%s┃", -                      "url", +                      t_a_.path_html_segtoc,                        t_a_.title,                        _auth,                      ) ~ "\n"; @@ -369,7 +448,7 @@ template DocReformMetaDocHarvestsTopics() {                          }                        }                        topics ~= format(q"┃ <p class="work"><a href="%s">%s</a> -%s┃", -                        "url", +                        t_a_.path_html_segtoc,                          t_a_.title,                          _auth,                        ) ~ "\n"; @@ -396,8 +475,10 @@ template DocReformMetaDocHarvestsTopics() {  </body>  </html>  ┃") ~ "\n"; +    import doc_reform.output.paths_output; +    auto out_pth = DocReformPathsHTML!()(_opt_action.output_dir_set, "");      try { -      auto f = File("topics.html", "w"); +      auto f       = File(out_pth.harvest("topics.html"), "w");        foreach (o; topics) {          f.writeln(o);        } diff --git a/src/doc_reform/output/paths_output.d b/src/doc_reform/output/paths_output.d index c11d31e..795da4c 100644 --- a/src/doc_reform/output/paths_output.d +++ b/src/doc_reform/output/paths_output.d @@ -10,13 +10,12 @@ import doc_reform.meta.rgx;  template DocReformOutPaths() {    auto DocReformOutPaths(Po,Lng)(      Po  output_pth_root, -    Lng lng, +    Lng lng = "",    ) {      struct _PathsStruct {        string output_root() {          return (output_pth_root.length > 0) -        ? output_pth_root -        : "sisugen"; +        ? output_pth_root : "";        }        string output_base() {          return asNormalizedPath(output_root.chainPath(lng)).array; @@ -32,8 +31,7 @@ template DocReformOutPathSQLite() {      struct _PathsStruct {        string output_root() {          return (output_pth_root.length > 0) -        ? output_pth_root -        : "sisugen"; +        ? output_pth_root : "";        }        string output_base() {          return asNormalizedPath(output_root).array; @@ -114,28 +112,34 @@ template DocReformPathsUrl() {      return _UrlPathsStruct();    }  } -template DocReformPathsHTML() { +template DocReformDocRootTreeHTML() {    mixin DocReformRgxInit;    static auto rgx = Rgx(); -  auto DocReformPathsHTML(Po,Lng)( -    Po  output_pth_root, -    Lng lng, -  ) { -    auto out_pth = DocReformOutPaths!()(output_pth_root, lng); +  auto DocReformDocRootTreeHTML(Lng)(Lng lng) { +    auto lng_pth = DocReformOutPaths!()("", lng);      string base_dir = "html";      string suffix = ".html";      struct _PathsStruct {        string base_filename(string fn_src) {          return fn_src.baseName.stripExtension;        } +      string base_filename_scroll(string fn_src) { +        return base_filename(fn_src) ~ "." ~ lng; +      } +      string base_filename_seg(string fn_src) { +        return base_filename(fn_src) ~ "." ~ lng; +      } +      string docroot() { +        return asNormalizedPath(lng_pth.output_root).array; +      }        string base() { -        return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array; +        return asNormalizedPath((lng).chainPath(base_dir)).array;        }        string image() { -        return asNormalizedPath((out_pth.output_root).chainPath("image")).array; +        return asNormalizedPath("image").array;        }        string css() { -        return asNormalizedPath((out_pth.output_root).chainPath("css")).array; +        return asNormalizedPath("css").array;        }        string fn_seg_css() {          return asNormalizedPath(css.chainPath("html_seg.css")).array; @@ -144,19 +148,19 @@ template DocReformPathsHTML() {          return asNormalizedPath(css.chainPath("html_scroll.css")).array;        }        string seg(string fn_src) { -        return asNormalizedPath(base.chainPath(base_filename(fn_src))).array; +        return asNormalizedPath(base.chainPath(base_filename_seg(fn_src))).array;        }        string fn_scroll(string fn_src) { -        return asNormalizedPath(base.chainPath(base_filename(fn_src) ~ suffix)).array; +        return asNormalizedPath(base.chainPath(base_filename_scroll(fn_src) ~ suffix)).array;        }        string fn_seg(string fn_src, string seg_filename) {          return asNormalizedPath(seg(fn_src).chainPath(seg_filename ~ suffix)).array;        }        string tail_seg(string fn_src) { -        return lng ~ "/html/" ~ base_filename(fn_src); +        return lng ~ "/html/" ~ base_filename_seg(fn_src);        }        string tail_fn_scroll(string fn_src) { -        return lng ~ "/html/" ~ base_filename(fn_src) ~ suffix; +        return lng ~ "/html/" ~ base_filename_scroll(fn_src) ~ suffix;        }        string tail_fn_seg(string fn_src, string seg_filename) {          return lng ~ "/html/" ~ seg(fn_src) ~ "/" ~ seg_filename ~ suffix; @@ -165,6 +169,114 @@ template DocReformPathsHTML() {      return _PathsStruct();    }  } +template DocReformPathsHTML() { +  mixin DocReformRgxInit; +  static auto rgx = Rgx(); +  auto DocReformPathsHTML(Po,Lng)( +    Po  root_pth, +    Lng lng, +  ) { +    auto doc_tree = DocReformDocRootTreeHTML!()(lng); +    string base_dir = "html"; +    string suffix = ".html"; +    struct _PathsStruct { +      string docroot() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.docroot)).array; +      } +      string harvest(string fn_harvest) { +        return docroot ~ "/" ~ fn_harvest; +      } +      string base() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.base)).array; +      } +      string image() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.image)).array; +      } +      string css() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.css)).array; +      } +      string fn_seg_css() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_seg_css)).array; +      } +      string fn_scroll_css() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_scroll_css)).array; +      } +      string seg(string fn_src) { +        return asNormalizedPath(root_pth.chainPath(doc_tree.seg(fn_src))).array; +      } +      string fn_scroll(string fn_src) { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_scroll(fn_src))).array; +      } +      string fn_seg(string fn_src, string seg_filename) { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_seg(fn_src, seg_filename))).array; +      } +      string tail_seg(string fn_src) { +        return doc_tree.tail_seg(fn_src); +      } +      string tail_fn_scroll(string fn_src) { +        return doc_tree.tail_fn_scroll(fn_src); +      } +      string tail_fn_seg(string fn_src, string seg_filename) { +        return doc_tree.tail_fn_seg(fn_src, seg_filename); +      } +    } +    return _PathsStruct(); +  } +} +template DocReformUrlPathsHTML() { +  mixin DocReformRgxInit; +  static auto rgx = Rgx(); +  auto DocReformUrlPathsHTML(Po,Lng)( +    Po  root_pth, +    Lng lng, +  ) { +    auto doc_tree = DocReformDocRootTreeHTML!()(lng); +    string base_dir = "html"; +    string suffix = ".html"; +    struct _PathsStruct { +      string docroot() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.docroot)).array; +      } +      string harvest(string fn_harvest) { +        return docroot ~ "/" ~ fn_harvest; +      } +      string base() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.base)).array; +      } +      string image() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.image)).array; +      } +      string css() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.css)).array; +      } +      string fn_seg_css() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_seg_css)).array; +      } +      string fn_scroll_css() { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_scroll_css)).array; +      } +      string seg(string fn_src) { +        return asNormalizedPath(root_pth.chainPath(doc_tree.seg(fn_src))).array; +      } +      string fn_scroll(string fn_src) { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_scroll(fn_src))).array; +      } +      string fn_seg(string fn_src, string seg_filename) { +        return asNormalizedPath(root_pth.chainPath(doc_tree.fn_seg(fn_src, seg_filename))).array; +      } +      string tail_seg(string fn_src) { +        return doc_tree.tail_seg(fn_src); +      } +      string tail_fn_scroll(string fn_src) { +        return doc_tree.tail_fn_scroll(fn_src); +      } +      string tail_fn_seg(string fn_src, string seg_filename) { +        return doc_tree.tail_fn_seg(fn_src, seg_filename); +      } +    } +    return _PathsStruct(); +  } +}  template DocReformPathsEPUB() {    mixin DocReformRgxInit;    static auto rgx = Rgx(); @@ -179,7 +291,7 @@ template DocReformPathsEPUB() {          return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;        }        string base_filename(string fn_src) { -        return fn_src.baseName.stripExtension; +        return fn_src.baseName.stripExtension ~ "." ~ lng;        }        string epub_file(string fn_src) {          return asNormalizedPath(base.chainPath(base_filename(fn_src) ~ ".epub")).array; @@ -277,12 +389,12 @@ template DocReformPathsODT() {          return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;        }        string odt_file() { -        return asNormalizedPath(base_pth.chainPath(doc_matters.src.filename_base ~ ".odt")).array; +        return asNormalizedPath(base_pth.chainPath(doc_matters.src.doc_uid_out ~ ".odt")).array;        }        string dirtop(string type) {          return (type == "zip")          ? "".chainPath("").array -        : asNormalizedPath(base_pth.chainPath(doc_matters.src.filename_base)).array; +        : asNormalizedPath(base_pth.chainPath(doc_matters.src.doc_uid_out)).array;        }        string mimetype(string type="fs") {          assert(type == "zip" || "fs"); diff --git a/src/doc_reform/source/paths_source.d b/src/doc_reform/source/paths_source.d index bf4ee55..408d227 100644 --- a/src/doc_reform/source/paths_source.d +++ b/src/doc_reform/source/paths_source.d @@ -199,6 +199,19 @@ template PathMatters() {              }              return _uid;            } +          string doc_uid_out() { +            string _uid; +            if (is_pod && !(pod_name_with_path.empty)) { +              if (pod_name_with_path.baseName == filename_base) { +                _uid = filename_base ~ "." ~ lng; +              } else { +                _uid = pod_name_with_path.baseName ~ mkup.sep ~ filename_base ~ "." ~ lng; +              } +            } else { +              _uid = "_" ~ filename_base ~ "." ~ lng; +            } +            return _uid; +          }            string docname_composite_unique_per_src_doc() {              string _fn;              if (pod_name_with_path.baseName == filename_base) { | 
