From d542315e97260128706af55652964f18e9fdc4bb Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 23 Jun 2019 14:01:43 -0400 Subject: harvests reorganized; adjustments: output, paths --- src/doc_reform/meta/defaults.d | 2 +- src/doc_reform/meta/metadoc_harvest.d | 7 +- src/doc_reform/meta/metadoc_harvests_authors.d | 143 +++++++++++++++++++------ src/doc_reform/meta/metadoc_harvests_topics.d | 143 +++++++++++++++++++------ 4 files changed, 229 insertions(+), 66 deletions(-) (limited to 'src/doc_reform/meta') 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"┃ - - - - -Metadata Harvest - Authors - - - - - - - @@ -169,7 +245,10 @@ template DocReformMetaDocHarvestsAuthors() {

English   


ABCDEFGHIJKLMNOPQRSTUVWXYZ,  -┃") ~ "\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"┃

%s "%s" [%s]

┃", (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() { ┃") ~ "\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"┃ - - - -Metadata Harvest - Topics - - - - - - - @@ -210,7 +286,10 @@ template DocReformMetaDocHarvestsTopics() {

English   


-┃") ~ "\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"┃

"%s" -%s┃", - "url", + t_a_.path_html_segtoc, t_a_.title, _auth, ) ~ "\n"; @@ -289,7 +368,7 @@ template DocReformMetaDocHarvestsTopics() { } } topics ~= format(q"┃

%s -%s┃", - "url", + t_a_.path_html_segtoc, t_a_.title, _auth, ) ~ "\n"; @@ -329,7 +408,7 @@ template DocReformMetaDocHarvestsTopics() { } } topics ~= format(q"┃

%s -%s┃", - "url", + t_a_.path_html_segtoc, t_a_.title, _auth, ) ~ "\n"; @@ -369,7 +448,7 @@ template DocReformMetaDocHarvestsTopics() { } } topics ~= format(q"┃

%s -%s┃", - "url", + t_a_.path_html_segtoc, t_a_.title, _auth, ) ~ "\n"; @@ -396,8 +475,10 @@ template DocReformMetaDocHarvestsTopics() { ┃") ~ "\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); } -- cgit v1.2.3