From dadc2caf1369f8268ada37b0a9779d2bb1c6cee4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 26 May 2022 11:01:21 -0400 Subject: html links to output, flags for a bit finer control --- src/doc_reform/io_out/metadata.d | 39 ++++++++++++++---------- src/doc_reform/io_out/xmls.d | 17 ++++++++--- src/doc_reform/meta/metadoc_curate_authors.d | 2 +- src/doc_reform/meta/metadoc_curate_topics.d | 2 +- src/doc_reform/spine.d | 45 ++++++++++++++++++---------- 5 files changed, 68 insertions(+), 37 deletions(-) (limited to 'src/doc_reform') diff --git a/src/doc_reform/io_out/metadata.d b/src/doc_reform/io_out/metadata.d index e3c04c1..395cda9 100644 --- a/src/doc_reform/io_out/metadata.d +++ b/src/doc_reform/io_out/metadata.d @@ -56,7 +56,7 @@ template outputMetadata() { ) { string o; string _form; - if (doc_matters.opt.action.html_search_link) { + if (doc_matters.opt.action.html_link_search) { o = format(q"┃
@@ -352,7 +352,7 @@ string theme_light_1 = format(q"┃ ┃"); metadata_ ~= "
"; - if (doc_matters.opt.action.html_curate_link) { + if (doc_matters.opt.action.html_link_curate) { metadata_ ~= format(q"┃

[  HOME ] Curated metadata: [ Authors ] [ Topics ]

@@ -368,7 +368,7 @@ string theme_light_1 = format(q"┃ writeln("ERROR no Title information provided in document header ", doc_matters.src.filename_base); } if (!(doc_matters.conf_make_meta.meta.creator_author.empty)) { - if (doc_matters.opt.action.html_curate_link) { + if (doc_matters.opt.action.html_link_curate) { metadata_ ~= "

Author: " ~ doc_matters.conf_make_meta.meta.creator_author ~ "

"; } else { @@ -395,24 +395,31 @@ string theme_light_1 = format(q"┃ writeln("WARNING no summary of text provided in document header ", doc_matters.src.filename_base); } metadata_ ~= "

source: " ~ doc_matters.src.filename_base ~ "

"; - metadata_ ~= "

● markup source: [" - ~ " zipped pod ] " - ~ "[" - ~ " pod tree ]

"; + if (doc_matters.opt.action.html_link_markup_source) { + metadata_ ~= "

● markup source: [" + ~ " zipped pod ] " + ~ "[" + ~ " pod tree ]"; + } metadata_ ~= "

● outputs: [" ~ " ▣ html scroll ] " ~ "[" ~ " ▤ html seg ]" ~ "[" ~ " ◆ epub ]"; - if (doc_matters.opt.action.html_pdf_link) { + if ((doc_matters.opt.action.html_link_pdf) || (doc_matters.opt.action.html_link_pdf_a4)) { metadata_ ~= "[" - ~ " □ a4 pdf ]

"; - } else { - metadata_ ~= "

"; + ~ " □ pdf (a4) ]"; + } + if ((doc_matters.opt.action.html_link_pdf) || (doc_matters.opt.action.html_link_pdf_letter)) { + metadata_ ~= "[" + ~ " □ pdf (U.S. letter) ]"; } + metadata_ ~= "

"; if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) { metadata_ ~= "

Topics:

"; string[] _top = ["", "", "", "", ""]; @@ -421,7 +428,7 @@ string theme_light_1 = format(q"┃ if (subject_tree.length > 0) { if (subject_tree[0] != _top[0]) { _top[0] = subject_tree[0]; - if (doc_matters.opt.action.html_curate_link) { + if (doc_matters.opt.action.html_link_curate) { metadata_ ~= "

" @@ -436,7 +443,7 @@ string theme_light_1 = format(q"┃ if (subject_tree[1] != _top[1]) { _top[1] = subject_tree[1]; _top[2] = ""; _top[3] = ""; _top[4] = ""; - if (doc_matters.opt.action.html_curate_link) { + if (doc_matters.opt.action.html_link_curate) { metadata_ ~= "

4) { if (subject_tree[4] != _top[4]) { _top[4] = subject_tree[4]; - if (doc_matters.opt.action.html_curate_link) { + if (doc_matters.opt.action.html_link_curate) { metadata_ ~= "

@@ -289,8 +289,8 @@ template outputXHTMLs() { string type, ) { string o; - string metadata_links = ((doc_matters.opt.action.html_curate_link) - ? format(q"┃

[ ≅ | %s | ◆ |%s m | A | T ]

┃", + string metadata_links = ((doc_matters.opt.action.html_link_curate) + ? format(q"┃

[ ≅ | %s | ◆ |%s%s m | A | T ]

┃", (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 @@ -302,7 +302,7 @@ template outputXHTMLs() { (type == "seg") ? "../../" : "../", doc_matters.src.filename_base, doc_matters.src.lng, - (doc_matters.opt.action.html_pdf_link) + (doc_matters.opt.action.html_link_pdf || doc_matters.opt.action.html_link_pdf_a4) ? (" □ |") : "", + (doc_matters.opt.action.html_link_pdf || doc_matters.opt.action.html_link_pdf_letter) + ? (" □ |") + : "", (type == "seg") ? "../" : "", doc_matters.src.filename_base, (type == "seg") ? "../" : "", diff --git a/src/doc_reform/meta/metadoc_curate_authors.d b/src/doc_reform/meta/metadoc_curate_authors.d index 16669b2..373b896 100644 --- a/src/doc_reform/meta/metadoc_curate_authors.d +++ b/src/doc_reform/meta/metadoc_curate_authors.d @@ -74,7 +74,7 @@ template spineMetaDocCuratesAuthors() { ) { string o; string _form; - if (_opt_action.html_search_link) { + if (_opt_action.html_link_search) { o = format(q"┃
diff --git a/src/doc_reform/meta/metadoc_curate_topics.d b/src/doc_reform/meta/metadoc_curate_topics.d index 07e1a56..b8d8ed4 100644 --- a/src/doc_reform/meta/metadoc_curate_topics.d +++ b/src/doc_reform/meta/metadoc_curate_topics.d @@ -74,7 +74,7 @@ template spineMetaDocCuratesTopics() { ) { string o; string _form; - if (_opt_action.html_search_link) { + if (_opt_action.html_link_search) { o = format(q"┃
diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index 6d1a133..1cd811e 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -136,7 +136,10 @@ string program_name = "spine"; "curate-topics" : false, "html" : false, "html-link-curate" : false, + "html-link-markup" : false, "html-link-pdf" : false, + "html-link-pdf-a4" : false, + "html-link-pdf-letter" : false, "html-link-search" : false, "html-seg" : false, "html-scroll" : false, @@ -238,7 +241,10 @@ string program_name = "spine"; "hide-ocn", "object cite numbers", &opts["hide-ocn"], "html", "process html output", &opts["html"], "html-link-curate", "place links back to curate in segmented html", &opts["html-link-curate"], - "html-link-pdf", "provide a link to pdf a4 output", &opts["html-link-pdf"], + "html-link-markup", "provide html link to markup source, shared optionally", &opts["html-link-markup"], + "html-link-pdf", "provide html link to pdf a4 & letter output", &opts["html-link-pdf"], + "html-link-pdf-a4", "provide html link to pdf a4 output", &opts["html-link-pdf-a4"], + "html-link-pdf-letter", "provide html link to pdf letter size output", &opts["html-link-pdf-letter"], "html-link-search", "html embedded search submission", &opts["html-link-search"], "html-seg", "process html output", &opts["html-seg"], "html-scroll", "process html output", &opts["html-scroll"], @@ -398,6 +404,15 @@ string program_name = "spine"; @trusted bool debug_do_xmls() { return (opts["debug"] || opts["debug-html"] || opts["debug-epub"]) ? true : false; } + @trusted bool curate() { + return (opts["curate"] || opts["curate-authors"] || opts["curate-topics"]) ? true : false; + } + @trusted bool curate_authors() { + return (opts["curate"] || opts["curate-authors"]) ? true : false; + } + @trusted bool curate_topics() { + return (opts["curate"] || opts["curate-topics"]) ? true : false; + } @trusted bool digest() { return opts["digest"]; } @@ -407,23 +422,23 @@ string program_name = "spine"; @trusted bool generated_by() { return opts["generated-by"]; } - @trusted bool html_curate_link() { + @trusted bool html_link_curate() { return (opts["html-link-curate"]) ? true : false; } - @trusted bool html_pdf_link() { + @trusted bool html_link_markup_source() { + return (opts["html-link-markup"]) ? true : false; + } + @trusted bool html_link_pdf() { return (opts["html-link-pdf"]) ? true : false; } - @trusted bool html_search_link() { - return (opts["html-link-search"]) ? true : false; + @trusted bool html_link_pdf_a4() { + return (opts["html-link-pdf-a4"]) ? true : false; } - @trusted bool curate() { - return (opts["curate"] || opts["curate-authors"] || opts["curate-topics"]) ? true : false; + @trusted bool html_link_pdf_letter() { + return (opts["html-link-pdf-letter"]) ? true : false; } - @trusted bool curate_authors() { - return (opts["curate"] || opts["curate-authors"]) ? true : false; - } - @trusted bool curate_topics() { - return (opts["curate"] || opts["curate-topics"]) ? true : false; + @trusted bool html_link_search() { + return (opts["html-link-search"]) ? true : false; } @trusted bool html() { return (opts["html"] || opts["html-seg"] || opts["html-scroll"]) ? true : false; @@ -446,12 +461,12 @@ string program_name = "spine"; @trusted bool latex_document_header_sty() { return (opts["latex-init"] || opts["latex-header-sty"] || opts["pdf-init"]) ? true : false; } - @trusted bool odt() { - return (opts["odf"] || opts["odt"]) ? true : false; - } @trusted bool manifest() { return opts["manifest"]; } + @trusted bool odt() { + return (opts["odf"] || opts["odt"]) ? true : false; + } @trusted bool ocn_hidden() { return opts["hide-ocn"]; } -- cgit v1.2.3