From 1f8b96b650ea645c1a92b40f29c8625b6228d53a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 1 Sep 2021 15:40:20 -0400 Subject: metadata "curate" replaces "harvest" - "curated metadata" instead of "metadata harvest" - css color change to related pages, light theme --- .envrc-local_ | 24 +- README.md | 28 +- doc/man/man1/spine.1 | 18 +- meson.build | 6 +- org/config_meson.org | 6 +- org/config_misc.org | 2 +- org/config_nix.org | 38 +- org/default_misc.org | 22 +- org/default_paths.org | 8 +- org/out_curate_metadata.org | 1034 ++++++++++++++++++++++++ org/out_harvest_metadata.org | 1034 ------------------------ org/out_metadata.org | 70 +- org/out_xmls.org | 2 +- org/output_show.org | 2 +- org/spine.org | 80 +- org/spine_info.org | 46 +- src/doc_reform/io_out/metadata.d | 28 +- src/doc_reform/io_out/paths_output.d | 8 +- src/doc_reform/io_out/xmls.d | 2 +- src/doc_reform/meta/defaults.d | 16 +- src/doc_reform/meta/metadoc_curate.d | 92 +++ src/doc_reform/meta/metadoc_curate_authors.d | 494 +++++++++++ src/doc_reform/meta/metadoc_curate_topics.d | 654 +++++++++++++++ src/doc_reform/meta/metadoc_harvest.d | 92 --- src/doc_reform/meta/metadoc_harvests_authors.d | 494 ----------- src/doc_reform/meta/metadoc_harvests_topics.d | 654 --------------- src/doc_reform/spine.d | 82 +- sundry/spine_search_cgi/.envrc-local_ | 14 +- 28 files changed, 2525 insertions(+), 2525 deletions(-) create mode 100644 org/out_curate_metadata.org delete mode 100644 org/out_harvest_metadata.org create mode 100644 src/doc_reform/meta/metadoc_curate.d create mode 100644 src/doc_reform/meta/metadoc_curate_authors.d create mode 100644 src/doc_reform/meta/metadoc_curate_topics.d delete mode 100644 src/doc_reform/meta/metadoc_harvest.d delete mode 100644 src/doc_reform/meta/metadoc_harvests_authors.d delete mode 100644 src/doc_reform/meta/metadoc_harvests_topics.d diff --git a/.envrc-local_ b/.envrc-local_ index 0ceb0ea..8b9d535 100644 --- a/.envrc-local_ +++ b/.envrc-local_ @@ -91,23 +91,23 @@ $SpineBIN/spine --very-verbose --sqlite-discrete --output="$SpineOUTversioned" $ $SpineBIN/spine --verbose --pod --html --epub --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* #+END_SRC -*** harvest (authors topics) +*** curate (authors topics) #+BEGIN_SRC sh -$SpineBIN/spine --very-verbose --harvest --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --very-verbose --curate --output="$SpineOUTversioned" $SpinePOD/* #+END_SRC -*** html, harvest +*** html, curate #+BEGIN_SRC sh -$SpineBIN/spine --verbose --dark --html --html-link-harvest --harvest --output="$SpineOUTversioned" $SpinePOD/* -$SpineBIN/spine --very-verbose --html --html-link-harvest --harvest --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --verbose --dark --html --html-link-curate --curate --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --very-verbose --html --html-link-curate --curate --output="$SpineOUTversioned" $SpinePOD/* #+END_SRC -*** composite command: source pod, html, epub, harvest, sqlite +*** composite command: source pod, html, epub, curate, sqlite #+BEGIN_SRC sh -$SpineBIN/spine --verbose --dark --pod --epub --html --html-link-harvest --harvest --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --verbose --dark --pod --epub --html --html-link-curate --curate --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* #+END_SRC ** sequential tasks @@ -135,10 +135,10 @@ $SpineBIN/spine --very-verbose --sqlite-db-drop --output="$SpineOUTversioned" $SpineBIN/spine --very-verbose --sqlite-db-create --sqlite-update --output="$SpineOUTversioned" $SpinePOD/* #+END_SRC -*** composite command: source pod, html, epub, harvest, sqlite +*** composite command: source pod, html, epub, curate, sqlite #+BEGIN_SRC sh -$SpineBIN/spine --verbose --no-parallel --dark --pod --epub --html --html-link-harvest --harvest --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --verbose --no-parallel --dark --pod --epub --html --html-link-curate --curate --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* #+END_SRC ** config [./pod/].dr/config_local_site @@ -167,7 +167,7 @@ $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local *** generate html linked to search form #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) @@ -183,10 +183,10 @@ $SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" - $SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUTstatic $SpinePOD/* #+END_SRC -*** generate html (linked to search form), sql output, harvest COMPOSITE +*** generate html (linked to search form), sql output, curate COMPOSITE #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --output="$SpineOUTstatic" $SpinePOD/* #+END_SRC *** make search form diff --git a/README.md b/README.md index 00a2d69..3a02b2f 100644 --- a/README.md +++ b/README.md @@ -135,12 +135,12 @@ at the time of writing this provides the following output: --debug debug --digest hash digest for each object --epub process epub output - --harvest extract info on authors & topics from document header metadata - --harvest-authors extract info on authors from document header metadata - --harvest-topics extract info on topics from document header metadata + --curate extract info on authors & topics from document header metadata + --curate-authors extract info on authors from document header metadata + --curate-topics extract info on topics from document header metadata --hide-ocn object cite numbers --html process html output - --html-link-harvest place links back to harvest in segmented html + --html-link-curate place links back to curate in segmented html --html-link-search html embedded search submission --html-seg process html output --html-scroll process html output @@ -207,24 +207,24 @@ if configuartion has not been set or to overide the set configration specify note: ~webDocRoot should be the path to web doc root, provide a suitable output path. - spine -v --html --html-link-search --html-link-harvest --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* + spine -v --html --html-link-search --html-link-curate --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* - spine -v --html --html-link-search --html-link-harvest --epub --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* + spine -v --html --html-link-search --html-link-curate --epub --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* - spine -v --html --epub --latex --odt --harvest --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* + spine -v --html --epub --latex --odt --curate --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* -## harvest +## curate if you have a document collection with documents that have metadata headers a -summary of the collection can be made using the harvest command +summary of the collection can be made using the curate command - spine -v --harvest --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* + spine -v --curate --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* - spine -v --harvest ~spineMarkupSamples/pod/* + spine -v --curate ~spineMarkupSamples/pod/* - spine -v --html --html-link-search --html-link-harvest --harvest --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* + spine -v --html --html-link-search --html-link-curate --curate --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* - spine -v --html --html-link-search --html-link-harvest --harvest ~spineMarkupSamples/pod/* + spine -v --html --html-link-search --html-link-curate --curate ~spineMarkupSamples/pod/* ## sqlite @@ -308,7 +308,7 @@ cgi-bin directory spine -v --html --html-link-search --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* - spine -v --html --html-link-search --cgi-sqlite-search-filename="spine-search" --html-link-harvest --harvest --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* + spine -v --html --html-link-search --cgi-sqlite-search-filename="spine-search" --html-link-curate --curate --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* ### create db & search form diff --git a/doc/man/man1/spine.1 b/doc/man/man1/spine.1 index 64a916a..5701e03 100644 --- a/doc/man/man1/spine.1 +++ b/doc/man/man1/spine.1 @@ -152,17 +152,17 @@ not implemented .B --epub [path + filename] produces an epub document .TP -.B --harvest [path to files] +.B --curate [path to files] extract and present info on authors & topics from document header metadata. makes two lists of sisu output based on the sisu markup documents in a directory: list of author and authors works (year and titles), and; list by topic with titles and author. Makes use of header metadata fields (author, title, date, topic_register). .TP -.B --harvest-authors [path to files] +.B --curate-authors [path to files] extract and present info on authors from metadata in document headers .TP -.B --harvest-topics [path to files] +.B --curate-topics [path to files] extract and present info on topics from metadata in document headers .TP .B --hide-ocn @@ -172,9 +172,9 @@ turn visibility of object numbers off produces html output in two forms (i) segmented text with table of contents (toc.html and index.html) and (ii) the document in a single file (scroll.html). .TP -.B --html-link-harvest -within html output creates link to the document set metadata harvest output -part of --html output instruction and assumes that --harvest has been or will +.B --html-link-curate +within html output creates link to the document set metadata curate output +part of --html output instruction and assumes that --curate has been or will be run .TP .B --html-link-search @@ -550,9 +550,9 @@ pod (directory may contain multiple documents) .TP note: ~webDocRoot should be the path to web doc root, provide a suitable output path. .TP -spine -v --html --html-link-search --html-link-harvest --harvest --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* +spine -v --html --html-link-search --html-link-curate --curate --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* .TP -spine -v --html --html-link-search --html-link-harvest --epub --harvest --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* +spine -v --html --html-link-search --html-link-curate --epub --curate --output=`echo ~webDocRoot` ~spineMarkupSamples/pod/* .TP spine -v --sqlite-db-create --sqlite-db-filename="spine.search.db" --output=`echo ~webDocRoot` ~spineMarkupSamples/pod .TP @@ -4031,7 +4031,7 @@ matches are found. .SH SEE ALSO sisu(1), sisu-epub(1), - sisu-harvest(1), + sisu-curate(1), sisu-html(1), sisu-odf(1), sisu-pdf(1), diff --git a/meson.build b/meson.build index 8f1c5d4..67ccfe5 100644 --- a/meson.build +++ b/meson.build @@ -35,9 +35,9 @@ spine_src = [ 'src/doc_reform/meta/doc_debugs.d', 'src/doc_reform/meta/metadoc.d', 'src/doc_reform/meta/metadoc_from_src.d', - 'src/doc_reform/meta/metadoc_harvest.d', - 'src/doc_reform/meta/metadoc_harvests_authors.d', - 'src/doc_reform/meta/metadoc_harvests_topics.d', + 'src/doc_reform/meta/metadoc_curate.d', + 'src/doc_reform/meta/metadoc_curate_authors.d', + 'src/doc_reform/meta/metadoc_curate_topics.d', 'src/doc_reform/meta/metadoc_object_setter.d', 'src/doc_reform/meta/metadoc_show_config.d', 'src/doc_reform/meta/metadoc_show_make.d', diff --git a/org/config_meson.org b/org/config_meson.org index 1366f8b..27aac22 100644 --- a/org/config_meson.org +++ b/org/config_meson.org @@ -150,9 +150,9 @@ spine_src = [ 'src/doc_reform/meta/doc_debugs.d', 'src/doc_reform/meta/metadoc.d', 'src/doc_reform/meta/metadoc_from_src.d', - 'src/doc_reform/meta/metadoc_harvest.d', - 'src/doc_reform/meta/metadoc_harvests_authors.d', - 'src/doc_reform/meta/metadoc_harvests_topics.d', + 'src/doc_reform/meta/metadoc_curate.d', + 'src/doc_reform/meta/metadoc_curate_authors.d', + 'src/doc_reform/meta/metadoc_curate_topics.d', 'src/doc_reform/meta/metadoc_object_setter.d', 'src/doc_reform/meta/metadoc_show_config.d', 'src/doc_reform/meta/metadoc_show_make.d', diff --git a/org/config_misc.org b/org/config_misc.org index 587a47c..2b024f8 100644 --- a/org/config_misc.org +++ b/org/config_misc.org @@ -152,7 +152,7 @@ find data/sisudir/media/text -name *.ss[tm] | sort | xargs ~dr/bin/spine-ldc -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=/var/www/html \ ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod/* -~dr/bin/spine-ldc -v --html --harvest-link --output=/var/www/html \ +~dr/bin/spine-ldc -v --html --curate-link --output=/var/www/html \ ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod/* ~dr/bin/spine-ldc -q --show-config --html --output=/var/www/html ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod diff --git a/org/config_nix.org b/org/config_nix.org index 2268ac6..49bb6f8 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -227,23 +227,23 @@ $SpineBIN/spine --very-verbose --sqlite-discrete --output="$SpineOUTversioned" $ $SpineBIN/spine --verbose --pod --html --epub --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* ,#+END_SRC -,*** harvest (authors topics) +,*** curate (authors topics) ,#+BEGIN_SRC sh -$SpineBIN/spine --very-verbose --harvest --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --very-verbose --curate --output="$SpineOUTversioned" $SpinePOD/* ,#+END_SRC -,*** html, harvest +,*** html, curate ,#+BEGIN_SRC sh -$SpineBIN/spine --verbose --dark --html --html-link-harvest --harvest --output="$SpineOUTversioned" $SpinePOD/* -$SpineBIN/spine --very-verbose --html --html-link-harvest --harvest --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --verbose --dark --html --html-link-curate --curate --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --very-verbose --html --html-link-curate --curate --output="$SpineOUTversioned" $SpinePOD/* ,#+END_SRC -,*** composite command: source pod, html, epub, harvest, sqlite +,*** composite command: source pod, html, epub, curate, sqlite ,#+BEGIN_SRC sh -$SpineBIN/spine --verbose --dark --pod --epub --html --html-link-harvest --harvest --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --verbose --dark --pod --epub --html --html-link-curate --curate --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* ,#+END_SRC ,** sequential tasks @@ -271,10 +271,10 @@ $SpineBIN/spine --very-verbose --sqlite-db-drop --output="$SpineOUTversioned" $SpineBIN/spine --very-verbose --sqlite-db-create --sqlite-update --output="$SpineOUTversioned" $SpinePOD/* ,#+END_SRC -,*** composite command: source pod, html, epub, harvest, sqlite +,*** composite command: source pod, html, epub, curate, sqlite ,#+BEGIN_SRC sh -$SpineBIN/spine --verbose --no-parallel --dark --pod --epub --html --html-link-harvest --harvest --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* +$SpineBIN/spine --verbose --no-parallel --dark --pod --epub --html --html-link-curate --curate --sqlite-discrete --output="$SpineOUTversioned" $SpinePOD/* ,#+END_SRC ,** config [./pod/].dr/config_local_site @@ -303,7 +303,7 @@ $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local ,*** generate html linked to search form ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* ,#+END_SRC ,*** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) @@ -319,10 +319,10 @@ $SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="< $SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --output=$SpineOUTstatic $SpinePOD/* ,#+END_SRC -,*** generate html (linked to search form), sql output, harvest COMPOSITE +,*** generate html (linked to search form), sql output, curate COMPOSITE ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --sqlite-update --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --output="$SpineOUTstatic" $SpinePOD/* ,#+END_SRC ,*** make search form @@ -934,10 +934,10 @@ nix-build && sudo cp -vi result/share/cgi-bin/spine_search $SpineCgiBIN/. $SpineBIN/spine -v --show-config --config=$SpinePOD/.dr ,#+END_SRC -,*** generate html (linked to search form & harvest) +,*** generate html (linked to search form & curate) ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>"--output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>"--output=$SpineOUTstatic $SpinePOD/* ,#+END_SRC ,*** generate sql output @@ -946,11 +946,11 @@ $SpineBIN/spine -v --html --html-link-search --html-link-harvest --sqlite-db-fil SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --output=$SpineOUTstatic $SpinePOD/* ,#+END_SRC -,*** generate harvest +,*** generate curate ,#+BEGIN_SRC sh -$SpineBIN/spine -v --harvest --output=$SpineOUTstatic $SpinePOD/* -$SpineBIN/spine -v --html --html-link-harvest --harvest --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --curate --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* ,#+END_SRC ,*** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) @@ -959,10 +959,10 @@ $SpineBIN/spine -v --html --html-link-harvest --harvest --output=$SpineOUTstati $SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --output="$SpineOUTstatic" ,#+END_SRC -,*** generate html (linked to search form), sql output, harvest +,*** generate html (linked to search form), sql output, curate ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --sqlite-update --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --sqlite-update --output=$SpineOUTstatic $SpinePOD/* ,#+END_SRC ,*** make search form diff --git a/org/default_misc.org b/org/default_misc.org index 50a932c..0a1dad4 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -29,7 +29,7 @@ +/ module doc_reform.meta.defaults; <> -<> +<> <> <> <> @@ -85,14 +85,14 @@ template spineNode() { } #+END_SRC -** template: harvest +** template: curate -#+NAME: meta_defaults_template_harvest +#+NAME: meta_defaults_template_curate_metadata #+BEGIN_SRC d -template spineHarvest() { - @safe auto spineHarvest() { - struct _Harvest { - struct Harvest { +template spineCurateMetadata() { + @safe auto spineCurateMetadata() { + struct _Curate { + struct Curate { string title = ""; string[] author_arr = []; string author = ""; @@ -114,11 +114,11 @@ template spineHarvest() { string url_html_scroll = ""; string url_epub = ""; } - Harvest harvest; - Harvest[] harvests; - Harvest[][string][string][string][string] subject_trees; + Curate curate; + Curate[] curates; + Curate[][string][string][string][string] subject_trees; } - return _Harvest(); + return _Curate(); } } #+END_SRC diff --git a/org/default_paths.org b/org/default_paths.org index 376201f..1eae1c7 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -1188,8 +1188,8 @@ template spinePathsHTML() { string doc_root() { return ((output_path_root.chainPath(doc_tree.doc_root)).asNormalizedPath).array; } - string harvest(string fn_harvest) { - return doc_root ~ "/" ~ fn_harvest; + string curate(string fn_curate) { + return doc_root ~ "/" ~ fn_curate; } string internal_base() { return ((doc_tree.base).asNormalizedPath).array; @@ -1255,10 +1255,10 @@ template spineUrlsHTML() { string doc_root() { return url_doc_root ~ ((doc_tree.doc_root).asNormalizedPath).array; } - string harvest(string fn_harvest) { + string curate(string fn_curate) { return format(q"┃%s/%s┃", doc_root, - fn_harvest, + fn_curate, ); } string base() { diff --git a/org/out_curate_metadata.org b/org/out_curate_metadata.org new file mode 100644 index 0000000..e085fe7 --- /dev/null +++ b/org/out_curate_metadata.org @@ -0,0 +1,1034 @@ +-*- mode: org -*- +#+TITLE: spine (doc_manifest) metadata (multidocument) curates +#+DESCRIPTION: documents - structuring, various output representations & search +#+FILETAGS: :spine:hub: +#+AUTHOR: Ralph Amissah +#+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]] +#+COPYRIGHT: Copyright (C) 2015 - 2021 Ralph Amissah +#+LANGUAGE: en +#+STARTUP: content hideblocks hidestars noindent entitiespretty +#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t +#+PROPERTY: header-args :exports code +#+PROPERTY: header-args+ :noweb yes +#+PROPERTY: header-args+ :eval no +#+PROPERTY: header-args+ :results no +#+PROPERTY: header-args+ :cache no +#+PROPERTY: header-args+ :padline no +#+PROPERTY: header-args+ :mkdirp yes + +* document curate _summary_ :module:spine:metadoc_show_summary: + +- html + ~dr/bin/spine-ldc -v --html --html-link-curate --curate \ + --output=/var/www/html \ + ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod/* + +** _module template_ metadoc curate + +#+HEADER: :tangle "../src/doc_reform/meta/metadoc_curate.d" +#+BEGIN_SRC d +<> +module doc_reform.meta.metadoc_curate; +template spineMetaDocCurate() { + @safe auto spineMetaDocCurate(T,H)( + T doc_matters, + H hvst, + ) { + <> + mixin InternalMarkup; + <> + <> + } +} +#+END_SRC + +** init +*** imports + +#+NAME: metadoc_curate_imports +#+BEGIN_SRC d +import + doc_reform.meta.defaults, + doc_reform.meta.rgx; +import + std.array, + std.exception, + std.regex, + std.stdio, + std.string, + std.typecons, + std.uni, + std.utf, + std.conv : to; +#+END_SRC + +*** initialize :report: + +#+NAME: metadoc_curate_initialize +#+BEGIN_SRC d +static auto mkup = InlineMarkup(); +#+END_SRC + +** curate summary + +#+NAME: meta_metadoc_curate_summary +#+BEGIN_SRC d +auto min_repeat_number = 66; +auto char_repeat_number = (doc_matters.conf_make_meta.meta.title_full.length + + doc_matters.conf_make_meta.meta.creator_author.length + 4); +char_repeat_number = (char_repeat_number > min_repeat_number) +? char_repeat_number +: min_repeat_number; +writefln( + "%s\n\"%s\", %s\n%s\n%s\n%s", + mkup.repeat_character_by_number_provided("-", char_repeat_number), + doc_matters.conf_make_meta.meta.title_full, + doc_matters.conf_make_meta.meta.creator_author, + doc_matters.src.filename, + doc_matters.conf_make_meta.meta.classify_topic_register_arr, + mkup.repeat_character_by_number_provided("-", char_repeat_number), +); +#+END_SRC + +** return curate + +#+NAME: meta_metadoc_curate +#+BEGIN_SRC d +import doc_reform.io_out.paths_output; +auto pth_html_abs = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); +auto pth_html_rel = spineDocRootTreeHTML!()(doc_matters.src.language); +hvst.curate.title = doc_matters.conf_make_meta.meta.title_full; +hvst.curate.author = doc_matters.conf_make_meta.meta.creator_author; +hvst.curate.author_surname = doc_matters.conf_make_meta.meta.creator_author_surname; +hvst.curate.author_surname_fn = doc_matters.conf_make_meta.meta.creator_author_surname_fn; +hvst.curate.author_arr = doc_matters.conf_make_meta.meta.creator_author_arr; +hvst.curate.language_original = doc_matters.conf_make_meta.meta.original_language; +hvst.curate.language = doc_matters.src.language; +hvst.curate.uid = doc_matters.src.doc_uid; +hvst.curate.date_published = doc_matters.conf_make_meta.meta.date_published; +hvst.curate.topic_register_arr = doc_matters.conf_make_meta.meta.classify_topic_register_arr; +hvst.curate.path_html_metadata = pth_html_rel.fn_metadata(doc_matters.src.filename); +hvst.curate.path_html_scroll = pth_html_rel.fn_scroll(doc_matters.src.filename); +hvst.curate.path_html_segtoc = pth_html_rel.fn_seg(doc_matters.src.filename, "toc"); +hvst.curate.path_abs_html_scroll = pth_html_abs.fn_scroll(doc_matters.src.filename); +hvst.curate.path_abs_html_segtoc = pth_html_abs.fn_seg(doc_matters.src.filename, "toc"); +return hvst.curate; +#+END_SRC + +** _module template_ metadoc curate topics +*** _module template_ metadoc curate topics template + +#+HEADER: :tangle "../src/doc_reform/meta/metadoc_curate_topics.d" +#+BEGIN_SRC d +<> +module doc_reform.meta.metadoc_curate_topics; + import + std.algorithm, + std.array, + std.exception, + std.regex, + std.stdio, + std.string, + std.conv : to; + import + doc_reform.meta.defaults, + doc_reform.meta.rgx; + mixin spineCurateMetadata; + mixin InternalMarkup; +template spineMetaDocCuratesTopics() { + static auto mkup = InlineMarkup(); + void spineMetaDocCuratesTopics(H,M,O)( + H hvst, + M _make_and_meta_struct, + O _opt_action, + ) { + <> + <> +<> +<> +<> +<> +<> +<> + <> + topics +<> + <> + } +} +#+END_SRC + +*** order topic register + +#+NAME: curated_topics +#+BEGIN_SRC d +auto min_repeat_number = 42; +string[] _document_topic_register; +string[] _topic_register; +string[] _sub_topic_register; +string[] topics = []; +string _auth = ""; +foreach(k, doc_curate; hvst.curates) { + _topic_register = []; + foreach(topic; doc_curate.topic_register_arr.sort) { + _sub_topic_register = []; + string _spaces; + string[] subject_tree = topic.split(mkup.sep); + switch (subject_tree.length) { + case 1: + hvst.subject_trees[subject_tree[0]]["_a"]["_a"]["_a"] ~= doc_curate; + break; + case 2: + hvst.subject_trees[subject_tree[0]][subject_tree[1]]["_a"]["_a"] ~= doc_curate; + break; + case 3: + hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]]["_a"] ~= doc_curate; + break; + case 4: + hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]][subject_tree[3]] ~= doc_curate; + break; + default: + break; + } + _topic_register ~= _sub_topic_register.join("\n"); + } + auto char_repeat_number = (doc_curate.title.length + + doc_curate.author.length + 16); + char_repeat_number = (char_repeat_number > min_repeat_number) + ? char_repeat_number + : min_repeat_number; + _document_topic_register ~= format( + "\"%s\", %s%s\n%s", + doc_curate.title, + doc_curate.author, + (doc_curate.date_published.length > 0) ? " (" ~ doc_curate.date_published ~ ")" : "", + _topic_register.sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable).release.join("\n"), + ); +} +#+END_SRC + +*** curated topics html head + +#+NAME: curated_topics_html_head_1 +#+BEGIN_SRC d + topics ~= format(q"┃ + + + +Curated metadata - Topics +#+END_SRC + +*** curated topics html head + +#+NAME: curated_topics_html_head_2 +#+BEGIN_SRC d + + + + + +

Curated metadata - Topics (output organised by language & filetype)

+ +

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  +

+
+#+END_SRC + +*** curated topics html head theme insert + +#+NAME: curated_topics_html_head_theme +#+BEGIN_SRC d +┃", + _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, + _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, + inline_search_form(_make_and_meta_struct), +) ~ "\n"; +#+END_SRC + +*** curated topics html + +#+NAME: curated_topics_html +#+BEGIN_SRC d +char _prev_k = "_".to!char; +int _kn; +foreach(k0; + hvst.subject_trees.keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) +) { + if (k0.toUpper.to!(char[])[0] != _prev_k) { + topics ~= format(q"┃

%s

┃", + k0.toUpper.to!(char[])[0], + k0.toUpper.to!(char[])[0], + ); + _prev_k = k0.toUpper.to!(char[])[0]; + } + if (k0 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), k0,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln("", k0); + } + if ("_a" in hvst.subject_trees[k0]) { + foreach (t_a_; + hvst.subject_trees[k0]["_a"]["_a"]["_a"] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃ %s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

"%s" - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln("- ", t_a_.title, " - ", t_a_.author); + } + } + } + foreach(k1; + hvst.subject_trees[k0].keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) + ) { + if (k1 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), + k1.translate([' ' : "_"]), k1,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" ", k1); + } + if ("_a" in hvst.subject_trees[k0][k1]) { + foreach (t_a_; + hvst.subject_trees[k0][k1]["_a"]["_a"] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃ %s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

%s - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" - ", t_a_.title, " - ", t_a_.author); + } + } + } + } + foreach(k2; + hvst.subject_trees[k0][k1].keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) + ) { + if (k2 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), + k2.translate([' ' : "_"]), k2,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" ", k2); + } + if ("_a" in hvst.subject_trees[k0][k1][k2]) { + foreach (t_a_; + hvst.subject_trees[k0][k1][k2]["_a"] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃ %s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

%s - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" - ", t_a_.title, " - ", t_a_.author); + } + } + } + } + foreach(k3; + hvst.subject_trees[k0][k1][k2].keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) + ) { + if (k3 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), k2.translate([' ' : "_"]), + k3.translate([' ' : "_"]), k3,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" ", k3); + } + { + foreach (t_a_; + hvst.subject_trees[k0][k1][k2][k3] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃%s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

%s - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" - ", t_a_.title, " - ", t_a_.author); + } + } + } + } + } + } + } + } +} +#+END_SRC + +*** curated topics write + +#+NAME: curated_topics_html_write +#+BEGIN_SRC d +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"); + foreach (o; topics) { + f.writeln(o); + } +} catch (ErrnoException ex) { + // Handle error +} +#+END_SRC + +** _module template_ metadoc curates authors +*** _module template_ metadoc curate authors + +#+HEADER: :tangle "../src/doc_reform/meta/metadoc_curate_authors.d" +#+BEGIN_SRC d +<> +module doc_reform.meta.metadoc_curate_authors; + import + std.algorithm, + std.array, + std.exception, + std.regex, + std.stdio, + std.string, + std.conv : to; + import + doc_reform.meta.defaults, + doc_reform.meta.rgx; + mixin spineCurateMetadata; + mixin InternalMarkup; +template spineMetaDocCuratesAuthors() { + static auto mkup = InlineMarkup(); + void spineMetaDocCuratesAuthors(H,M,O)( + H curates, + M _make_and_meta_struct, + O _opt_action, + ) { + <> +<> +<> +<> +<> +<> +<> + authors +<> + <> + } +} +#+END_SRC + +*** curated authors html head + +#+NAME: curated_authors_html_head_1 +#+BEGIN_SRC d + string[] authors = []; + authors ~= format(q"┃ + + + + +Curated metadata - Authors +#+END_SRC + +*** curated authors html head + +#+NAME: curated_authors_html_head_2 +#+BEGIN_SRC d + + + + + +

Curated metadata - Authors (output organised by language & filetype)

+ +

+
+

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  +#+END_SRC + +*** curated authors html theme inserts + +#+NAME: curated_authors_html_head_theme +#+BEGIN_SRC d +┃", + _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, + _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, + inline_search_form(_make_and_meta_struct), +) ~ "\n"; + string[string] _au; + string[] _auth_date_title; + string[] _author_date_title; + string _prev_auth = ""; + char _prev_k = "_".to!char; + foreach(doc_curate; + curates + .multiSort!( + "toUpper(a.author_surname_fn) < toUpper(b.author_surname_fn)", + "a.date_published < b.date_published", + "a.title < b.title", + SwapStrategy.unstable + ) + ) { + if (doc_curate.author_surname_fn != _prev_auth) { + _au[doc_curate.author_surname_fn] + = format(q"┃

%s

%s "%s" [ %s ]

┃", + doc_curate.author_surname.translate([' ' : "_"]), + doc_curate.author_surname_fn, + (doc_curate.date_published.length > 0) + ? doc_curate.date_published : "", + doc_curate.path_html_segtoc, + doc_curate.title, + doc_curate.path_html_metadata, + doc_curate.language, + ); + _prev_auth = doc_curate.author_surname_fn; + } else { + _au[doc_curate.author_surname_fn] + ~= format(q"┃

%s "%s" [ %s ]

┃", + (doc_curate.date_published.length > 0) + ? doc_curate.date_published : "", + doc_curate.path_html_segtoc, + doc_curate.title, + doc_curate.path_html_metadata, + doc_curate.language, + ); + } + _author_date_title ~= format(q"┃%s %s "%s" [ %s ]%s┃", + doc_curate.author_surname_fn, + (doc_curate.date_published.length > 0) + ? "(" ~ doc_curate.date_published ~ ")" : "", + doc_curate.title, + doc_curate.path_html_metadata, + doc_curate.language, + (_opt_action.very_verbose) ? "\n " ~ doc_curate.path_abs_html_scroll : "", + ); + } + foreach (k; _au.keys.sort) { + if (k.toUpper.to!(char[])[0] != _prev_k) { + authors ~= format(q"┃

%s

┃", + k.toUpper.to!(char[])[0], + k.toUpper.to!(char[])[0], + ); + _prev_k = k.toUpper.to!(char[])[0]; + } + authors ~= _au[k]; + } +#+END_SRC + +*** curated authors write + +#+NAME: curated_authors_html_write +#+BEGIN_SRC d +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"); + foreach (o; authors) { + f.writeln(o); + } +} catch (ErrnoException ex) { + // Handle error +} +if (_opt_action.verbose + || _opt_action.very_verbose +) { + foreach(_adt; _author_date_title.sort) { + writeln(_adt); + } +} +#+END_SRC + +** curated authors & topics shared html +*** themes +**** head + +#+NAME: curated_html_themes_0 +#+BEGIN_SRC d +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; + } + a.lev0:hover { + color : #FFFFFF; + background-color : #000000; + } + a.lev1:hover { + color : #FFFFFF; + background : #333333; + } + a.lev2:hover { + color : #FFFFFF; + background : #555555; + } + a.lev3:hover { + color : #FFFFFF; + background : #777777; + } + input { + color : #FFFFFF; + background-color : #777777; + } +┃"); +string theme_light_0 = format(q"┃ + body { + color : #000000; + background : #FFFFFF; + background-color : #FFFFFF; + } + a:link { + color : #003399; + text-decoration : none; + } + a:visited { + color : #003399; + text-decoration : none; + } + a:hover { + color : #000000; + background-color : #f9f9aa; + } + a:hover img { + background-color : #FFFFFF; + } + a:active { + color : #003399; + text-decoration : underline; + } + a.lev0:hover { + color : #000000; + background-color : #FFFFFF; + } + a.lev1:hover { + color : #FFFFFF; + background : #444444; + } + a.lev2:hover { + background : #888888; + } + a.lev3:hover { + background : #BBBBBB; + } + input { + color : #000000; + background-color : #FFFFFF; + } +┃"); +#+END_SRC + +**** levels + +#+NAME: curated_html_themes_1 +#+BEGIN_SRC css +string theme_dark_1 = format(q"┃ + h1 { + color : #FFFFFF; + background : #000000; + } + p.letter { + color : #FFFFFF; + background : #333333; + } + p.lev0 { + color : #FFFFFF; + background : #000000; + } + p.lev1 { + color : #FFFFFF; + background : #333333; + } + p.lev2 { + background : #555555; + } + p.lev3 { + background : #777777; + } + p.lev4 { + background : #AAAAAA; + } + p.lev5 { + } +┃"); +string theme_light_1 = format(q"┃ + h1 { + color : #FFFFFF; + background : #1A3A7A; + } + p.letter { + color : #FFFFFF; + background : #1A3A7A; + } + p.lev0 { + color : #FFFFFF; + background : #000000; + } + p.lev1 { + color : #FFFFFF; + background : #444444; + } + p.lev2 { + background : #888888; + } + p.lev3 { + background : #BBBBBB; + } + p.lev4 { + background : #EEEEEE; + } + p.lev5 { + } +┃"); +#+END_SRC + +*** search form + +#+NAME: curated_html_search +#+BEGIN_SRC d +@safe string inline_search_form(M)( + M _make_and_meta_truct, +) { + string o; + string _form; + if (_opt_action.html_search_link) { + o = format(q"┃ +
+ + + +
┃", + _make_and_meta_struct.conf.w_srv_cgi_action, + (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.empty) + ? "" + : "\n ", + ); + } else { + o = ""; + } + return o; +} +#+END_SRC + +*** curated html head + +#+NAME: curated_html_head +#+BEGIN_SRC d + + + + + + + + +#+END_SRC + +*** curated html bottom + +#+NAME: curated_html_bottom +#+BEGIN_SRC d + ~= format(q"┃ +
+ + + + + + + + +┃") ~ "\n"; +#+END_SRC + +* document header including copyright & license + +#+NAME: doc_header_including_copyright_and_license +#+BEGIN_SRC txt +/+ +- Name: Spine, Doc Reform [a part of] + - Description: documents, structuring, processing, publishing, search + - static content generator + + - Author: Ralph Amissah + [ralph.amissah@gmail.com] + + - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights + Reserved. + + - License: AGPL 3 or later: + + Spine (SiSU), a framework for document structuring, publishing and + search + + Copyright (C) Ralph Amissah + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU AFERO General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program. If not, see [https://www.gnu.org/licenses/]. + + If you have Internet connection, the latest version of the AGPL should be + available at these locations: + [https://www.fsf.org/licensing/licenses/agpl.html] + [https://www.gnu.org/licenses/agpl.html] + + - Spine (by Doc Reform, related to SiSU) uses standard: + - docReform markup syntax + - standard SiSU markup syntax with modified headers and minor modifications + - docReform object numbering + - standard SiSU object citation numbering & system + + - Hompages: + [https://www.doc_reform.org] + [https://www.sisudoc.org] + + - Git + [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] + ++/ +#+END_SRC + +* __END__ diff --git a/org/out_harvest_metadata.org b/org/out_harvest_metadata.org deleted file mode 100644 index c3d4fff..0000000 --- a/org/out_harvest_metadata.org +++ /dev/null @@ -1,1034 +0,0 @@ --*- mode: org -*- -#+TITLE: spine (doc_manifest) metadata (multidocument) harvests -#+DESCRIPTION: documents - structuring, various output representations & search -#+FILETAGS: :spine:hub: -#+AUTHOR: Ralph Amissah -#+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]] -#+COPYRIGHT: Copyright (C) 2015 - 2021 Ralph Amissah -#+LANGUAGE: en -#+STARTUP: content hideblocks hidestars noindent entitiespretty -#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t -#+PROPERTY: header-args :exports code -#+PROPERTY: header-args+ :noweb yes -#+PROPERTY: header-args+ :eval no -#+PROPERTY: header-args+ :results no -#+PROPERTY: header-args+ :cache no -#+PROPERTY: header-args+ :padline no -#+PROPERTY: header-args+ :mkdirp yes - -* document harvest _summary_ :module:spine:metadoc_show_summary: - -- html - ~dr/bin/spine-ldc -v --html --html-link-harvest --harvest \ - --output=/var/www/html \ - ~grotto/repo/git.repo/code/project-spine/doc-reform-markup/markup_samples/markup/pod/* - -** _module template_ metadoc harvest - -#+HEADER: :tangle "../src/doc_reform/meta/metadoc_harvest.d" -#+BEGIN_SRC d -<> -module doc_reform.meta.metadoc_harvest; -template spineMetaDocHarvest() { - @safe auto spineMetaDocHarvest(T,H)( - T doc_matters, - H hvst, - ) { - <> - mixin InternalMarkup; - <> - <> - } -} -#+END_SRC - -** init -*** imports - -#+NAME: metadoc_harvest_imports -#+BEGIN_SRC d -import - doc_reform.meta.defaults, - doc_reform.meta.rgx; -import - std.array, - std.exception, - std.regex, - std.stdio, - std.string, - std.typecons, - std.uni, - std.utf, - std.conv : to; -#+END_SRC - -*** initialize :report: - -#+NAME: metadoc_harvest_initialize -#+BEGIN_SRC d -static auto mkup = InlineMarkup(); -#+END_SRC - -** harvest summary - -#+NAME: meta_metadoc_harvest_summary -#+BEGIN_SRC d -auto min_repeat_number = 66; -auto char_repeat_number = (doc_matters.conf_make_meta.meta.title_full.length - + doc_matters.conf_make_meta.meta.creator_author.length + 4); -char_repeat_number = (char_repeat_number > min_repeat_number) -? char_repeat_number -: min_repeat_number; -writefln( - "%s\n\"%s\", %s\n%s\n%s\n%s", - mkup.repeat_character_by_number_provided("-", char_repeat_number), - doc_matters.conf_make_meta.meta.title_full, - doc_matters.conf_make_meta.meta.creator_author, - doc_matters.src.filename, - doc_matters.conf_make_meta.meta.classify_topic_register_arr, - mkup.repeat_character_by_number_provided("-", char_repeat_number), -); -#+END_SRC - -** return harvest - -#+NAME: meta_metadoc_harvest -#+BEGIN_SRC d -import doc_reform.io_out.paths_output; -auto pth_html_abs = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); -auto pth_html_rel = spineDocRootTreeHTML!()(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; -hvst.harvest.author_surname_fn = doc_matters.conf_make_meta.meta.creator_author_surname_fn; -hvst.harvest.author_arr = doc_matters.conf_make_meta.meta.creator_author_arr; -hvst.harvest.language_original = doc_matters.conf_make_meta.meta.original_language; -hvst.harvest.language = doc_matters.src.language; -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_metadata = pth_html_rel.fn_metadata(doc_matters.src.filename); -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"); -hvst.harvest.path_abs_html_scroll = pth_html_abs.fn_scroll(doc_matters.src.filename); -hvst.harvest.path_abs_html_segtoc = pth_html_abs.fn_seg(doc_matters.src.filename, "toc"); -return hvst.harvest; -#+END_SRC - -** _module template_ metadoc harvest topics -*** _module template_ metadoc harvest topics template - -#+HEADER: :tangle "../src/doc_reform/meta/metadoc_harvests_topics.d" -#+BEGIN_SRC d -<> -module doc_reform.meta.metadoc_harvests_topics; - import - std.algorithm, - std.array, - std.exception, - std.regex, - std.stdio, - std.string, - std.conv : to; - import - doc_reform.meta.defaults, - doc_reform.meta.rgx; - mixin spineHarvest; - mixin InternalMarkup; -template spineMetaDocHarvestsTopics() { - static auto mkup = InlineMarkup(); - void spineMetaDocHarvestsTopics(H,M,O)( - H hvst, - M _make_and_meta_struct, - O _opt_action, - ) { - <> - <> -<> -<> -<> -<> -<> -<> - <> - topics -<> - <> - } -} -#+END_SRC - -*** order topic register - -#+NAME: harvested_topics -#+BEGIN_SRC d -auto min_repeat_number = 42; -string[] _document_topic_register; -string[] _topic_register; -string[] _sub_topic_register; -string[] topics = []; -string _auth = ""; -foreach(k, doc_harvest; hvst.harvests) { - _topic_register = []; - foreach(topic; doc_harvest.topic_register_arr.sort) { - _sub_topic_register = []; - string _spaces; - string[] subject_tree = topic.split(mkup.sep); - switch (subject_tree.length) { - case 1: - hvst.subject_trees[subject_tree[0]]["_a"]["_a"]["_a"] ~= doc_harvest; - break; - case 2: - hvst.subject_trees[subject_tree[0]][subject_tree[1]]["_a"]["_a"] ~= doc_harvest; - break; - case 3: - hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]]["_a"] ~= doc_harvest; - break; - case 4: - hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]][subject_tree[3]] ~= doc_harvest; - break; - default: - break; - } - _topic_register ~= _sub_topic_register.join("\n"); - } - auto char_repeat_number = (doc_harvest.title.length - + doc_harvest.author.length + 16); - char_repeat_number = (char_repeat_number > min_repeat_number) - ? char_repeat_number - : min_repeat_number; - _document_topic_register ~= format( - "\"%s\", %s%s\n%s", - doc_harvest.title, - doc_harvest.author, - (doc_harvest.date_published.length > 0) ? " (" ~ doc_harvest.date_published ~ ")" : "", - _topic_register.sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable).release.join("\n"), - ); -} -#+END_SRC - -*** harvested topics html head - -#+NAME: harvested_topics_html_head_1 -#+BEGIN_SRC d - topics ~= format(q"┃ - - - -Metadata Harvest - Topics -#+END_SRC - -*** harvested topics html head - -#+NAME: harvested_topics_html_head_2 -#+BEGIN_SRC d - - - - - -

Metadata Harvest - Topics (output organised by language & filetype)

- -

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  -

-
-#+END_SRC - -*** harvested topics html head theme insert - -#+NAME: harvested_topics_html_head_theme -#+BEGIN_SRC d -┃", - _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, - _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, - inline_search_form(_make_and_meta_struct), -) ~ "\n"; -#+END_SRC - -*** harvested topics html - -#+NAME: harvested_topics_html -#+BEGIN_SRC d -char _prev_k = "_".to!char; -int _kn; -foreach(k0; - hvst.subject_trees.keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) -) { - if (k0.toUpper.to!(char[])[0] != _prev_k) { - topics ~= format(q"┃

%s

┃", - k0.toUpper.to!(char[])[0], - k0.toUpper.to!(char[])[0], - ); - _prev_k = k0.toUpper.to!(char[])[0]; - } - if (k0 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), k0,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln("", k0); - } - if ("_a" in hvst.subject_trees[k0]) { - foreach (t_a_; - hvst.subject_trees[k0]["_a"]["_a"]["_a"] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃ %s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

"%s" - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln("- ", t_a_.title, " - ", t_a_.author); - } - } - } - foreach(k1; - hvst.subject_trees[k0].keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) - ) { - if (k1 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), - k1.translate([' ' : "_"]), k1,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" ", k1); - } - if ("_a" in hvst.subject_trees[k0][k1]) { - foreach (t_a_; - hvst.subject_trees[k0][k1]["_a"]["_a"] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃ %s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

%s - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" - ", t_a_.title, " - ", t_a_.author); - } - } - } - } - foreach(k2; - hvst.subject_trees[k0][k1].keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) - ) { - if (k2 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), - k2.translate([' ' : "_"]), k2,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" ", k2); - } - if ("_a" in hvst.subject_trees[k0][k1][k2]) { - foreach (t_a_; - hvst.subject_trees[k0][k1][k2]["_a"] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃ %s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

%s - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" - ", t_a_.title, " - ", t_a_.author); - } - } - } - } - foreach(k3; - hvst.subject_trees[k0][k1][k2].keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) - ) { - if (k3 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), k2.translate([' ' : "_"]), - k3.translate([' ' : "_"]), k3,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" ", k3); - } - { - foreach (t_a_; - hvst.subject_trees[k0][k1][k2][k3] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃%s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

%s - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" - ", t_a_.title, " - ", t_a_.author); - } - } - } - } - } - } - } - } -} -#+END_SRC - -*** harvested topics write - -#+NAME: harvested_topics_html_write -#+BEGIN_SRC d -import doc_reform.io_out.paths_output; -auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, ""); -try { - auto f = File(out_pth.harvest("topics.html"), "w"); - foreach (o; topics) { - f.writeln(o); - } -} catch (ErrnoException ex) { - // Handle error -} -#+END_SRC - -** _module template_ metadoc harvests authors -*** _module template_ metadoc harvest authors - -#+HEADER: :tangle "../src/doc_reform/meta/metadoc_harvests_authors.d" -#+BEGIN_SRC d -<> -module doc_reform.meta.metadoc_harvests_authors; - import - std.algorithm, - std.array, - std.exception, - std.regex, - std.stdio, - std.string, - std.conv : to; - import - doc_reform.meta.defaults, - doc_reform.meta.rgx; - mixin spineHarvest; - mixin InternalMarkup; -template spineMetaDocHarvestsAuthors() { - static auto mkup = InlineMarkup(); - void spineMetaDocHarvestsAuthors(H,M,O)( - H harvests, - M _make_and_meta_struct, - O _opt_action, - ) { - <> -<> -<> -<> -<> -<> -<> - authors -<> - <> - } -} -#+END_SRC - -*** harvested authors html head - -#+NAME: harvested_authors_html_head_1 -#+BEGIN_SRC d - string[] authors = []; - authors ~= format(q"┃ - - - - -Metadata Harvest - Authors -#+END_SRC - -*** harvested authors html head - -#+NAME: harvested_authors_html_head_2 -#+BEGIN_SRC d - - - - - -

Metadata Harvest - Authors (output organised by language & filetype)

- -

-
-

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  -#+END_SRC - -*** harvested authors html theme inserts - -#+NAME: harvested_authors_html_head_theme -#+BEGIN_SRC d -┃", - _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, - _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, - inline_search_form(_make_and_meta_struct), -) ~ "\n"; - string[string] _au; - string[] _auth_date_title; - string[] _author_date_title; - string _prev_auth = ""; - char _prev_k = "_".to!char; - foreach(doc_harvest; - harvests - .multiSort!( - "toUpper(a.author_surname_fn) < toUpper(b.author_surname_fn)", - "a.date_published < b.date_published", - "a.title < b.title", - SwapStrategy.unstable - ) - ) { - if (doc_harvest.author_surname_fn != _prev_auth) { - _au[doc_harvest.author_surname_fn] - = format(q"┃

%s

%s "%s" [ %s ]

┃", - doc_harvest.author_surname.translate([' ' : "_"]), - doc_harvest.author_surname_fn, - (doc_harvest.date_published.length > 0) - ? doc_harvest.date_published : "", - doc_harvest.path_html_segtoc, - doc_harvest.title, - doc_harvest.path_html_metadata, - doc_harvest.language, - ); - _prev_auth = doc_harvest.author_surname_fn; - } else { - _au[doc_harvest.author_surname_fn] - ~= format(q"┃

%s "%s" [ %s ]

┃", - (doc_harvest.date_published.length > 0) - ? doc_harvest.date_published : "", - doc_harvest.path_html_segtoc, - doc_harvest.title, - doc_harvest.path_html_metadata, - doc_harvest.language, - ); - } - _author_date_title ~= format(q"┃%s %s "%s" [ %s ]%s┃", - doc_harvest.author_surname_fn, - (doc_harvest.date_published.length > 0) - ? "(" ~ doc_harvest.date_published ~ ")" : "", - doc_harvest.title, - doc_harvest.path_html_metadata, - doc_harvest.language, - (_opt_action.very_verbose) ? "\n " ~ doc_harvest.path_abs_html_scroll : "", - ); - } - foreach (k; _au.keys.sort) { - if (k.toUpper.to!(char[])[0] != _prev_k) { - authors ~= format(q"┃

%s

┃", - k.toUpper.to!(char[])[0], - k.toUpper.to!(char[])[0], - ); - _prev_k = k.toUpper.to!(char[])[0]; - } - authors ~= _au[k]; - } -#+END_SRC - -*** harvested authors write - -#+NAME: harvested_authors_html_write -#+BEGIN_SRC d -import doc_reform.io_out.paths_output; -auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, ""); -try { - auto f = File(out_pth.harvest("authors.html"), "w"); - foreach (o; authors) { - f.writeln(o); - } -} catch (ErrnoException ex) { - // Handle error -} -if (_opt_action.verbose - || _opt_action.very_verbose -) { - foreach(_adt; _author_date_title.sort) { - writeln(_adt); - } -} -#+END_SRC - -** harvested authors & topics shared html -*** themes -**** head - -#+NAME: harvested_html_themes_0 -#+BEGIN_SRC d -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; - } - a.lev0:hover { - color : #FFFFFF; - background-color : #000000; - } - a.lev1:hover { - color : #FFFFFF; - background : #333333; - } - a.lev2:hover { - color : #FFFFFF; - background : #555555; - } - a.lev3:hover { - color : #FFFFFF; - background : #777777; - } - input { - color : #FFFFFF; - background-color : #777777; - } -┃"); -string theme_light_0 = format(q"┃ - body { - color : #000000; - background : #FFFFFF; - background-color : #FFFFFF; - } - a:link { - color : #003399; - text-decoration : none; - } - a:visited { - color : #003399; - text-decoration : none; - } - a:hover { - color : #000000; - background-color : #f9f9aa; - } - a:hover img { - background-color : #FFFFFF; - } - a:active { - color : #003399; - text-decoration : underline; - } - a.lev0:hover { - color : #000000; - background-color : #FFFFFF; - } - a.lev1:hover { - color : #FFFFFF; - background : #444444; - } - a.lev2:hover { - background : #888888; - } - a.lev3:hover { - background : #BBBBBB; - } - input { - color : #000000; - background-color : #FFFFFF; - } -┃"); -#+END_SRC - -**** levels - -#+NAME: harvested_html_themes_1 -#+BEGIN_SRC d -string theme_dark_1 = format(q"┃ - h1 { - color : #FFFFFF; - background : #000000; - } - p.letter { - color : #FFFFFF; - background : #333333; - } - p.lev0 { - color : #FFFFFF; - background : #000000; - } - p.lev1 { - color : #FFFFFF; - background : #333333; - } - p.lev2 { - background : #555555; - } - p.lev3 { - background : #777777; - } - p.lev4 { - background : #AAAAAA; - } - p.lev5 { - } -┃"); -string theme_light_1 = format(q"┃ - h1 { - color : #FFFFFF; - background : #000088; - } - p.letter { - color : #FFFFFF; - background : #880000; - } - p.lev0 { - color : #FFFFFF; - background : #000000; - } - p.lev1 { - color : #FFFFFF; - background : #444444; - } - p.lev2 { - background : #888888; - } - p.lev3 { - background : #BBBBBB; - } - p.lev4 { - background : #EEEEEE; - } - p.lev5 { - } -┃"); -#+END_SRC - -*** search form - -#+NAME: harvested_html_search -#+BEGIN_SRC d -@safe string inline_search_form(M)( - M _make_and_meta_truct, -) { - string o; - string _form; - if (_opt_action.html_search_link) { - o = format(q"┃ -
- - - -
┃", - _make_and_meta_struct.conf.w_srv_cgi_action, - (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.empty) - ? "" - : "\n ", - ); - } else { - o = ""; - } - return o; -} -#+END_SRC - -*** harvested html head - -#+NAME: harvested_html_head -#+BEGIN_SRC d - - - - - - - - -#+END_SRC - -*** harvested html bottom - -#+NAME: harvested_html_bottom -#+BEGIN_SRC d - ~= format(q"┃ -
- - - - - - - - -┃") ~ "\n"; -#+END_SRC - -* document header including copyright & license - -#+NAME: doc_header_including_copyright_and_license -#+BEGIN_SRC txt -/+ -- Name: Spine, Doc Reform [a part of] - - Description: documents, structuring, processing, publishing, search - - static content generator - - - Author: Ralph Amissah - [ralph.amissah@gmail.com] - - - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights - Reserved. - - - License: AGPL 3 or later: - - Spine (SiSU), a framework for document structuring, publishing and - search - - Copyright (C) Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU AFERO General Public License as published by the - Free Software Foundation, either version 3 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see [https://www.gnu.org/licenses/]. - - If you have Internet connection, the latest version of the AGPL should be - available at these locations: - [https://www.fsf.org/licensing/licenses/agpl.html] - [https://www.gnu.org/licenses/agpl.html] - - - Spine (by Doc Reform, related to SiSU) uses standard: - - docReform markup syntax - - standard SiSU markup syntax with modified headers and minor modifications - - docReform object numbering - - standard SiSU object citation numbering & system - - - Hompages: - [https://www.doc_reform.org] - [https://www.sisudoc.org] - - - Git - [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] - -+/ -#+END_SRC - -* __END__ diff --git a/org/out_metadata.org b/org/out_metadata.org index 6688bca..b8c2652 100644 --- a/org/out_metadata.org +++ b/org/out_metadata.org @@ -1,5 +1,5 @@ -*- mode: org -*- -#+TITLE: spine (doc_manifest) metadata (document harvest) +#+TITLE: spine (doc_manifest) metadata (document curate) #+DESCRIPTION: documents - structuring, publishing in multiple formats & search #+FILETAGS: :spine:output:metadata: #+AUTHOR: Ralph Amissah @@ -16,7 +16,7 @@ #+PROPERTY: header-args+ :padline no #+PROPERTY: header-args+ :mkdirp yes -* document harvest _summary_ :module:spine:metadoc_show_summary: +* document curate _summary_ :module:spine:metadoc_show_summary: ** _module template_ metadoc document metadata @@ -26,14 +26,14 @@ module doc_reform.io_out.metadata; template outputMetadata() { @safe void outputMetadata(T)( T doc_matters) { - <> + <> <> -<> -<> -<> -<> -<> -<> +<> +<> +<> +<> +<> +<> <> <> } @@ -84,8 +84,8 @@ metadata_ ~= format(q"┃ ┃"); metadata_ ~= "
"; -if (doc_matters.opt.action.html_harvest_link) { - metadata_ ~= format(q"┃

[ HOME ] Metadata Harvest +if (doc_matters.opt.action.html_curate_link) { + metadata_ ~= format(q"┃

[ HOME ] Curated metadata [ Authors ] [ Topics ]

┃"); @@ -100,7 +100,7 @@ if (!(doc_matters.conf_make_meta.meta.title_full.empty)) { 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_harvest_link) { + if (doc_matters.opt.action.html_curate_link) { metadata_ ~= "

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

"; } else { @@ -145,7 +145,7 @@ if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) { if (subject_tree.length > 0) { if (subject_tree[0] != _top[0]) { _top[0] = subject_tree[0]; - if (doc_matters.opt.action.html_harvest_link) { + if (doc_matters.opt.action.html_curate_link) { metadata_ ~= "

" @@ -160,7 +160,7 @@ if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) { if (subject_tree[1] != _top[1]) { _top[1] = subject_tree[1]; _top[2] = ""; _top[3] = ""; _top[4] = ""; - if (doc_matters.opt.action.html_harvest_link) { + if (doc_matters.opt.action.html_curate_link) { metadata_ ~= "

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

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

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

-Metadata Harvest - Topics +Curated metadata - Topics #+END_SRC -#+NAME: harvested_topics_html_head_2 +#+NAME: curated_topics_html_head_2 #+BEGIN_SRC d #+END_SRC -*** harvested html head +*** curated html head -#+NAME: harvested_html_head +#+NAME: curated_html_head #+BEGIN_SRC d - + - + + + + + + + +

Curated metadata - Authors (output organised by language & filetype)

+ +

+
+

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  +┃", + _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, + _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, + inline_search_form(_make_and_meta_struct), +) ~ "\n"; + string[string] _au; + string[] _auth_date_title; + string[] _author_date_title; + string _prev_auth = ""; + char _prev_k = "_".to!char; + foreach(doc_curate; + curates + .multiSort!( + "toUpper(a.author_surname_fn) < toUpper(b.author_surname_fn)", + "a.date_published < b.date_published", + "a.title < b.title", + SwapStrategy.unstable + ) + ) { + if (doc_curate.author_surname_fn != _prev_auth) { + _au[doc_curate.author_surname_fn] + = format(q"┃

%s

%s "%s" [ %s ]

┃", + doc_curate.author_surname.translate([' ' : "_"]), + doc_curate.author_surname_fn, + (doc_curate.date_published.length > 0) + ? doc_curate.date_published : "", + doc_curate.path_html_segtoc, + doc_curate.title, + doc_curate.path_html_metadata, + doc_curate.language, + ); + _prev_auth = doc_curate.author_surname_fn; + } else { + _au[doc_curate.author_surname_fn] + ~= format(q"┃

%s "%s" [ %s ]

┃", + (doc_curate.date_published.length > 0) + ? doc_curate.date_published : "", + doc_curate.path_html_segtoc, + doc_curate.title, + doc_curate.path_html_metadata, + doc_curate.language, + ); + } + _author_date_title ~= format(q"┃%s %s "%s" [ %s ]%s┃", + doc_curate.author_surname_fn, + (doc_curate.date_published.length > 0) + ? "(" ~ doc_curate.date_published ~ ")" : "", + doc_curate.title, + doc_curate.path_html_metadata, + doc_curate.language, + (_opt_action.very_verbose) ? "\n " ~ doc_curate.path_abs_html_scroll : "", + ); + } + foreach (k; _au.keys.sort) { + if (k.toUpper.to!(char[])[0] != _prev_k) { + authors ~= format(q"┃

%s

┃", + k.toUpper.to!(char[])[0], + k.toUpper.to!(char[])[0], + ); + _prev_k = k.toUpper.to!(char[])[0]; + } + authors ~= _au[k]; + } + authors + ~= format(q"┃ +
+ + + + + + + + +┃") ~ "\n"; + 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"); + foreach (o; authors) { + f.writeln(o); + } + } catch (ErrnoException ex) { + // Handle error + } + if (_opt_action.verbose + || _opt_action.very_verbose + ) { + foreach(_adt; _author_date_title.sort) { + writeln(_adt); + } + } + } +} diff --git a/src/doc_reform/meta/metadoc_curate_topics.d b/src/doc_reform/meta/metadoc_curate_topics.d new file mode 100644 index 0000000..1fdc760 --- /dev/null +++ b/src/doc_reform/meta/metadoc_curate_topics.d @@ -0,0 +1,654 @@ +/+ +- Name: Spine, Doc Reform [a part of] + - Description: documents, structuring, processing, publishing, search + - static content generator + + - Author: Ralph Amissah + [ralph.amissah@gmail.com] + + - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights + Reserved. + + - License: AGPL 3 or later: + + Spine (SiSU), a framework for document structuring, publishing and + search + + Copyright (C) Ralph Amissah + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU AFERO General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program. If not, see [https://www.gnu.org/licenses/]. + + If you have Internet connection, the latest version of the AGPL should be + available at these locations: + [https://www.fsf.org/licensing/licenses/agpl.html] + [https://www.gnu.org/licenses/agpl.html] + + - Spine (by Doc Reform, related to SiSU) uses standard: + - docReform markup syntax + - standard SiSU markup syntax with modified headers and minor modifications + - docReform object numbering + - standard SiSU object citation numbering & system + + - Hompages: + [https://www.doc_reform.org] + [https://www.sisudoc.org] + + - Git + [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] + ++/ +module doc_reform.meta.metadoc_curate_topics; + import + std.algorithm, + std.array, + std.exception, + std.regex, + std.stdio, + std.string, + std.conv : to; + import + doc_reform.meta.defaults, + doc_reform.meta.rgx; + mixin spineCurateMetadata; + mixin InternalMarkup; +template spineMetaDocCuratesTopics() { + static auto mkup = InlineMarkup(); + void spineMetaDocCuratesTopics(H,M,O)( + H hvst, + M _make_and_meta_struct, + O _opt_action, + ) { + @safe string inline_search_form(M)( + M _make_and_meta_truct, + ) { + string o; + string _form; + if (_opt_action.html_search_link) { + o = format(q"┃ +
+ + + +
┃", + _make_and_meta_struct.conf.w_srv_cgi_action, + (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.empty) + ? "" + : "\n ", + ); + } else { + o = ""; + } + return o; + } + auto min_repeat_number = 42; + string[] _document_topic_register; + string[] _topic_register; + string[] _sub_topic_register; + string[] topics = []; + string _auth = ""; + foreach(k, doc_curate; hvst.curates) { + _topic_register = []; + foreach(topic; doc_curate.topic_register_arr.sort) { + _sub_topic_register = []; + string _spaces; + string[] subject_tree = topic.split(mkup.sep); + switch (subject_tree.length) { + case 1: + hvst.subject_trees[subject_tree[0]]["_a"]["_a"]["_a"] ~= doc_curate; + break; + case 2: + hvst.subject_trees[subject_tree[0]][subject_tree[1]]["_a"]["_a"] ~= doc_curate; + break; + case 3: + hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]]["_a"] ~= doc_curate; + break; + case 4: + hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]][subject_tree[3]] ~= doc_curate; + break; + default: + break; + } + _topic_register ~= _sub_topic_register.join("\n"); + } + auto char_repeat_number = (doc_curate.title.length + + doc_curate.author.length + 16); + char_repeat_number = (char_repeat_number > min_repeat_number) + ? char_repeat_number + : min_repeat_number; + _document_topic_register ~= format( + "\"%s\", %s%s\n%s", + doc_curate.title, + doc_curate.author, + (doc_curate.date_published.length > 0) ? " (" ~ doc_curate.date_published ~ ")" : "", + _topic_register.sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable).release.join("\n"), + ); + } +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; + } + a.lev0:hover { + color : #FFFFFF; + background-color : #000000; + } + a.lev1:hover { + color : #FFFFFF; + background : #333333; + } + a.lev2:hover { + color : #FFFFFF; + background : #555555; + } + a.lev3:hover { + color : #FFFFFF; + background : #777777; + } + input { + color : #FFFFFF; + background-color : #777777; + } +┃"); +string theme_light_0 = format(q"┃ + body { + color : #000000; + background : #FFFFFF; + background-color : #FFFFFF; + } + a:link { + color : #003399; + text-decoration : none; + } + a:visited { + color : #003399; + text-decoration : none; + } + a:hover { + color : #000000; + background-color : #f9f9aa; + } + a:hover img { + background-color : #FFFFFF; + } + a:active { + color : #003399; + text-decoration : underline; + } + a.lev0:hover { + color : #000000; + background-color : #FFFFFF; + } + a.lev1:hover { + color : #FFFFFF; + background : #444444; + } + a.lev2:hover { + background : #888888; + } + a.lev3:hover { + background : #BBBBBB; + } + input { + color : #000000; + background-color : #FFFFFF; + } +┃"); +string theme_dark_1 = format(q"┃ + h1 { + color : #FFFFFF; + background : #000000; + } + p.letter { + color : #FFFFFF; + background : #333333; + } + p.lev0 { + color : #FFFFFF; + background : #000000; + } + p.lev1 { + color : #FFFFFF; + background : #333333; + } + p.lev2 { + background : #555555; + } + p.lev3 { + background : #777777; + } + p.lev4 { + background : #AAAAAA; + } + p.lev5 { + } +┃"); +string theme_light_1 = format(q"┃ + h1 { + color : #FFFFFF; + background : #1A3A7A; + } + p.letter { + color : #FFFFFF; + background : #1A3A7A; + } + p.lev0 { + color : #FFFFFF; + background : #000000; + } + p.lev1 { + color : #FFFFFF; + background : #444444; + } + p.lev2 { + background : #888888; + } + p.lev3 { + background : #BBBBBB; + } + p.lev4 { + background : #EEEEEE; + } + p.lev5 { + } +┃"); + topics ~= format(q"┃ + + + +Curated metadata - Topics + + + + + + + + + + + + + +

Curated metadata - Topics (output organised by language & filetype)

+ +

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  +

+
+┃", + _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, + _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, + inline_search_form(_make_and_meta_struct), +) ~ "\n"; + char _prev_k = "_".to!char; + int _kn; + foreach(k0; + hvst.subject_trees.keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) + ) { + if (k0.toUpper.to!(char[])[0] != _prev_k) { + topics ~= format(q"┃

%s

┃", + k0.toUpper.to!(char[])[0], + k0.toUpper.to!(char[])[0], + ); + _prev_k = k0.toUpper.to!(char[])[0]; + } + if (k0 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), k0,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln("", k0); + } + if ("_a" in hvst.subject_trees[k0]) { + foreach (t_a_; + hvst.subject_trees[k0]["_a"]["_a"]["_a"] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃ %s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

"%s" - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln("- ", t_a_.title, " - ", t_a_.author); + } + } + } + foreach(k1; + hvst.subject_trees[k0].keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) + ) { + if (k1 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), + k1.translate([' ' : "_"]), k1,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" ", k1); + } + if ("_a" in hvst.subject_trees[k0][k1]) { + foreach (t_a_; + hvst.subject_trees[k0][k1]["_a"]["_a"] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃ %s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

%s - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" - ", t_a_.title, " - ", t_a_.author); + } + } + } + } + foreach(k2; + hvst.subject_trees[k0][k1].keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) + ) { + if (k2 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), + k2.translate([' ' : "_"]), k2,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" ", k2); + } + if ("_a" in hvst.subject_trees[k0][k1][k2]) { + foreach (t_a_; + hvst.subject_trees[k0][k1][k2]["_a"] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃ %s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

%s - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" - ", t_a_.title, " - ", t_a_.author); + } + } + } + } + foreach(k3; + hvst.subject_trees[k0][k1][k2].keys + .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) + ) { + if (k3 != "_a") { + topics ~= format(q"┃

%s

┃", + k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), k2.translate([' ' : "_"]), + k3.translate([' ' : "_"]), k3,) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" ", k3); + } + { + foreach (t_a_; + hvst.subject_trees[k0][k1][k2][k3] + .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) + ) { + _auth = []; + if (t_a_.author_arr.length < 2) { + _auth = format(q"┃%s┃", + t_a_.author_surname.translate([' ' : "_"]), + t_a_.author, + ); + } else { + foreach (a; t_a_.author_arr) { + _auth ~= format(q"┃ %s,┃", + t_a_.author_surname.translate([' ' : "_"]), + a, + ); + } + } + topics ~= format(q"┃

%s - %s [ %s ]┃", + t_a_.path_html_segtoc, + t_a_.title, + _auth, + t_a_.path_html_metadata, + t_a_.language, + ) ~ "\n"; + if (_opt_action.very_verbose) { + writeln(" - ", t_a_.title, " - ", t_a_.author); + } + } + } + } + } + } + } + } + } + topics + ~= format(q"┃ +


+ + + + + + + + +┃") ~ "\n"; + 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"); + foreach (o; topics) { + f.writeln(o); + } + } catch (ErrnoException ex) { + // Handle error + } + } +} diff --git a/src/doc_reform/meta/metadoc_harvest.d b/src/doc_reform/meta/metadoc_harvest.d deleted file mode 100644 index 3135323..0000000 --- a/src/doc_reform/meta/metadoc_harvest.d +++ /dev/null @@ -1,92 +0,0 @@ -/+ -- Name: Spine, Doc Reform [a part of] - - Description: documents, structuring, processing, publishing, search - - static content generator - - - Author: Ralph Amissah - [ralph.amissah@gmail.com] - - - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights - Reserved. - - - License: AGPL 3 or later: - - Spine (SiSU), a framework for document structuring, publishing and - search - - Copyright (C) Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU AFERO General Public License as published by the - Free Software Foundation, either version 3 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see [https://www.gnu.org/licenses/]. - - If you have Internet connection, the latest version of the AGPL should be - available at these locations: - [https://www.fsf.org/licensing/licenses/agpl.html] - [https://www.gnu.org/licenses/agpl.html] - - - Spine (by Doc Reform, related to SiSU) uses standard: - - docReform markup syntax - - standard SiSU markup syntax with modified headers and minor modifications - - docReform object numbering - - standard SiSU object citation numbering & system - - - Hompages: - [https://www.doc_reform.org] - [https://www.sisudoc.org] - - - Git - [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] - -+/ -module doc_reform.meta.metadoc_harvest; -template spineMetaDocHarvest() { - @safe auto spineMetaDocHarvest(T,H)( - T doc_matters, - H hvst, - ) { - import - doc_reform.meta.defaults, - doc_reform.meta.rgx; - import - std.array, - std.exception, - std.regex, - std.stdio, - std.string, - std.typecons, - std.uni, - std.utf, - std.conv : to; - mixin InternalMarkup; - static auto mkup = InlineMarkup(); - import doc_reform.io_out.paths_output; - auto pth_html_abs = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); - auto pth_html_rel = spineDocRootTreeHTML!()(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; - hvst.harvest.author_surname_fn = doc_matters.conf_make_meta.meta.creator_author_surname_fn; - hvst.harvest.author_arr = doc_matters.conf_make_meta.meta.creator_author_arr; - hvst.harvest.language_original = doc_matters.conf_make_meta.meta.original_language; - hvst.harvest.language = doc_matters.src.language; - 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_metadata = pth_html_rel.fn_metadata(doc_matters.src.filename); - 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"); - hvst.harvest.path_abs_html_scroll = pth_html_abs.fn_scroll(doc_matters.src.filename); - hvst.harvest.path_abs_html_segtoc = pth_html_abs.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 deleted file mode 100644 index 182b1cd..0000000 --- a/src/doc_reform/meta/metadoc_harvests_authors.d +++ /dev/null @@ -1,494 +0,0 @@ -/+ -- Name: Spine, Doc Reform [a part of] - - Description: documents, structuring, processing, publishing, search - - static content generator - - - Author: Ralph Amissah - [ralph.amissah@gmail.com] - - - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights - Reserved. - - - License: AGPL 3 or later: - - Spine (SiSU), a framework for document structuring, publishing and - search - - Copyright (C) Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU AFERO General Public License as published by the - Free Software Foundation, either version 3 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see [https://www.gnu.org/licenses/]. - - If you have Internet connection, the latest version of the AGPL should be - available at these locations: - [https://www.fsf.org/licensing/licenses/agpl.html] - [https://www.gnu.org/licenses/agpl.html] - - - Spine (by Doc Reform, related to SiSU) uses standard: - - docReform markup syntax - - standard SiSU markup syntax with modified headers and minor modifications - - docReform object numbering - - standard SiSU object citation numbering & system - - - Hompages: - [https://www.doc_reform.org] - [https://www.sisudoc.org] - - - Git - [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] - -+/ -module doc_reform.meta.metadoc_harvests_authors; - import - std.algorithm, - std.array, - std.exception, - std.regex, - std.stdio, - std.string, - std.conv : to; - import - doc_reform.meta.defaults, - doc_reform.meta.rgx; - mixin spineHarvest; - mixin InternalMarkup; -template spineMetaDocHarvestsAuthors() { - static auto mkup = InlineMarkup(); - void spineMetaDocHarvestsAuthors(H,M,O)( - H harvests, - M _make_and_meta_struct, - O _opt_action, - ) { - @safe string inline_search_form(M)( - M _make_and_meta_truct, - ) { - string o; - string _form; - if (_opt_action.html_search_link) { - o = format(q"┃ -
- - - -
┃", - _make_and_meta_struct.conf.w_srv_cgi_action, - (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.empty) - ? "" - : "\n ", - ); - } else { - o = ""; - } - return o; - } -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; - } - a.lev0:hover { - color : #FFFFFF; - background-color : #000000; - } - a.lev1:hover { - color : #FFFFFF; - background : #333333; - } - a.lev2:hover { - color : #FFFFFF; - background : #555555; - } - a.lev3:hover { - color : #FFFFFF; - background : #777777; - } - input { - color : #FFFFFF; - background-color : #777777; - } -┃"); -string theme_light_0 = format(q"┃ - body { - color : #000000; - background : #FFFFFF; - background-color : #FFFFFF; - } - a:link { - color : #003399; - text-decoration : none; - } - a:visited { - color : #003399; - text-decoration : none; - } - a:hover { - color : #000000; - background-color : #f9f9aa; - } - a:hover img { - background-color : #FFFFFF; - } - a:active { - color : #003399; - text-decoration : underline; - } - a.lev0:hover { - color : #000000; - background-color : #FFFFFF; - } - a.lev1:hover { - color : #FFFFFF; - background : #444444; - } - a.lev2:hover { - background : #888888; - } - a.lev3:hover { - background : #BBBBBB; - } - input { - color : #000000; - background-color : #FFFFFF; - } -┃"); -string theme_dark_1 = format(q"┃ - h1 { - color : #FFFFFF; - background : #000000; - } - p.letter { - color : #FFFFFF; - background : #333333; - } - p.lev0 { - color : #FFFFFF; - background : #000000; - } - p.lev1 { - color : #FFFFFF; - background : #333333; - } - p.lev2 { - background : #555555; - } - p.lev3 { - background : #777777; - } - p.lev4 { - background : #AAAAAA; - } - p.lev5 { - } -┃"); -string theme_light_1 = format(q"┃ - h1 { - color : #FFFFFF; - background : #000088; - } - p.letter { - color : #FFFFFF; - background : #880000; - } - p.lev0 { - color : #FFFFFF; - background : #000000; - } - p.lev1 { - color : #FFFFFF; - background : #444444; - } - p.lev2 { - background : #888888; - } - p.lev3 { - background : #BBBBBB; - } - p.lev4 { - background : #EEEEEE; - } - p.lev5 { - } -┃"); - string[] authors = []; - authors ~= format(q"┃ - - - - -Metadata Harvest - Authors - - - - - - - - - - - - - -

Metadata Harvest - Authors (output organised by language & filetype)

- -

-
-

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  -┃", - _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, - _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, - inline_search_form(_make_and_meta_struct), -) ~ "\n"; - string[string] _au; - string[] _auth_date_title; - string[] _author_date_title; - string _prev_auth = ""; - char _prev_k = "_".to!char; - foreach(doc_harvest; - harvests - .multiSort!( - "toUpper(a.author_surname_fn) < toUpper(b.author_surname_fn)", - "a.date_published < b.date_published", - "a.title < b.title", - SwapStrategy.unstable - ) - ) { - if (doc_harvest.author_surname_fn != _prev_auth) { - _au[doc_harvest.author_surname_fn] - = format(q"┃

%s

%s "%s" [ %s ]

┃", - doc_harvest.author_surname.translate([' ' : "_"]), - doc_harvest.author_surname_fn, - (doc_harvest.date_published.length > 0) - ? doc_harvest.date_published : "", - doc_harvest.path_html_segtoc, - doc_harvest.title, - doc_harvest.path_html_metadata, - doc_harvest.language, - ); - _prev_auth = doc_harvest.author_surname_fn; - } else { - _au[doc_harvest.author_surname_fn] - ~= format(q"┃

%s "%s" [ %s ]

┃", - (doc_harvest.date_published.length > 0) - ? doc_harvest.date_published : "", - doc_harvest.path_html_segtoc, - doc_harvest.title, - doc_harvest.path_html_metadata, - doc_harvest.language, - ); - } - _author_date_title ~= format(q"┃%s %s "%s" [ %s ]%s┃", - doc_harvest.author_surname_fn, - (doc_harvest.date_published.length > 0) - ? "(" ~ doc_harvest.date_published ~ ")" : "", - doc_harvest.title, - doc_harvest.path_html_metadata, - doc_harvest.language, - (_opt_action.very_verbose) ? "\n " ~ doc_harvest.path_abs_html_scroll : "", - ); - } - foreach (k; _au.keys.sort) { - if (k.toUpper.to!(char[])[0] != _prev_k) { - authors ~= format(q"┃

%s

┃", - k.toUpper.to!(char[])[0], - k.toUpper.to!(char[])[0], - ); - _prev_k = k.toUpper.to!(char[])[0]; - } - authors ~= _au[k]; - } - authors - ~= format(q"┃ -
- - - - - - - - -┃") ~ "\n"; - import doc_reform.io_out.paths_output; - auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, ""); - try { - auto f = File(out_pth.harvest("authors.html"), "w"); - foreach (o; authors) { - f.writeln(o); - } - } catch (ErrnoException ex) { - // Handle error - } - if (_opt_action.verbose - || _opt_action.very_verbose - ) { - foreach(_adt; _author_date_title.sort) { - writeln(_adt); - } - } - } -} diff --git a/src/doc_reform/meta/metadoc_harvests_topics.d b/src/doc_reform/meta/metadoc_harvests_topics.d deleted file mode 100644 index 5848723..0000000 --- a/src/doc_reform/meta/metadoc_harvests_topics.d +++ /dev/null @@ -1,654 +0,0 @@ -/+ -- Name: Spine, Doc Reform [a part of] - - Description: documents, structuring, processing, publishing, search - - static content generator - - - Author: Ralph Amissah - [ralph.amissah@gmail.com] - - - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights - Reserved. - - - License: AGPL 3 or later: - - Spine (SiSU), a framework for document structuring, publishing and - search - - Copyright (C) Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU AFERO General Public License as published by the - Free Software Foundation, either version 3 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see [https://www.gnu.org/licenses/]. - - If you have Internet connection, the latest version of the AGPL should be - available at these locations: - [https://www.fsf.org/licensing/licenses/agpl.html] - [https://www.gnu.org/licenses/agpl.html] - - - Spine (by Doc Reform, related to SiSU) uses standard: - - docReform markup syntax - - standard SiSU markup syntax with modified headers and minor modifications - - docReform object numbering - - standard SiSU object citation numbering & system - - - Hompages: - [https://www.doc_reform.org] - [https://www.sisudoc.org] - - - Git - [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] - -+/ -module doc_reform.meta.metadoc_harvests_topics; - import - std.algorithm, - std.array, - std.exception, - std.regex, - std.stdio, - std.string, - std.conv : to; - import - doc_reform.meta.defaults, - doc_reform.meta.rgx; - mixin spineHarvest; - mixin InternalMarkup; -template spineMetaDocHarvestsTopics() { - static auto mkup = InlineMarkup(); - void spineMetaDocHarvestsTopics(H,M,O)( - H hvst, - M _make_and_meta_struct, - O _opt_action, - ) { - @safe string inline_search_form(M)( - M _make_and_meta_truct, - ) { - string o; - string _form; - if (_opt_action.html_search_link) { - o = format(q"┃ -
- - - -
┃", - _make_and_meta_struct.conf.w_srv_cgi_action, - (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.empty) - ? "" - : "\n ", - ); - } else { - o = ""; - } - return o; - } - auto min_repeat_number = 42; - string[] _document_topic_register; - string[] _topic_register; - string[] _sub_topic_register; - string[] topics = []; - string _auth = ""; - foreach(k, doc_harvest; hvst.harvests) { - _topic_register = []; - foreach(topic; doc_harvest.topic_register_arr.sort) { - _sub_topic_register = []; - string _spaces; - string[] subject_tree = topic.split(mkup.sep); - switch (subject_tree.length) { - case 1: - hvst.subject_trees[subject_tree[0]]["_a"]["_a"]["_a"] ~= doc_harvest; - break; - case 2: - hvst.subject_trees[subject_tree[0]][subject_tree[1]]["_a"]["_a"] ~= doc_harvest; - break; - case 3: - hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]]["_a"] ~= doc_harvest; - break; - case 4: - hvst.subject_trees[subject_tree[0]][subject_tree[1]][subject_tree[2]][subject_tree[3]] ~= doc_harvest; - break; - default: - break; - } - _topic_register ~= _sub_topic_register.join("\n"); - } - auto char_repeat_number = (doc_harvest.title.length - + doc_harvest.author.length + 16); - char_repeat_number = (char_repeat_number > min_repeat_number) - ? char_repeat_number - : min_repeat_number; - _document_topic_register ~= format( - "\"%s\", %s%s\n%s", - doc_harvest.title, - doc_harvest.author, - (doc_harvest.date_published.length > 0) ? " (" ~ doc_harvest.date_published ~ ")" : "", - _topic_register.sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable).release.join("\n"), - ); - } -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; - } - a.lev0:hover { - color : #FFFFFF; - background-color : #000000; - } - a.lev1:hover { - color : #FFFFFF; - background : #333333; - } - a.lev2:hover { - color : #FFFFFF; - background : #555555; - } - a.lev3:hover { - color : #FFFFFF; - background : #777777; - } - input { - color : #FFFFFF; - background-color : #777777; - } -┃"); -string theme_light_0 = format(q"┃ - body { - color : #000000; - background : #FFFFFF; - background-color : #FFFFFF; - } - a:link { - color : #003399; - text-decoration : none; - } - a:visited { - color : #003399; - text-decoration : none; - } - a:hover { - color : #000000; - background-color : #f9f9aa; - } - a:hover img { - background-color : #FFFFFF; - } - a:active { - color : #003399; - text-decoration : underline; - } - a.lev0:hover { - color : #000000; - background-color : #FFFFFF; - } - a.lev1:hover { - color : #FFFFFF; - background : #444444; - } - a.lev2:hover { - background : #888888; - } - a.lev3:hover { - background : #BBBBBB; - } - input { - color : #000000; - background-color : #FFFFFF; - } -┃"); -string theme_dark_1 = format(q"┃ - h1 { - color : #FFFFFF; - background : #000000; - } - p.letter { - color : #FFFFFF; - background : #333333; - } - p.lev0 { - color : #FFFFFF; - background : #000000; - } - p.lev1 { - color : #FFFFFF; - background : #333333; - } - p.lev2 { - background : #555555; - } - p.lev3 { - background : #777777; - } - p.lev4 { - background : #AAAAAA; - } - p.lev5 { - } -┃"); -string theme_light_1 = format(q"┃ - h1 { - color : #FFFFFF; - background : #000088; - } - p.letter { - color : #FFFFFF; - background : #880000; - } - p.lev0 { - color : #FFFFFF; - background : #000000; - } - p.lev1 { - color : #FFFFFF; - background : #444444; - } - p.lev2 { - background : #888888; - } - p.lev3 { - background : #BBBBBB; - } - p.lev4 { - background : #EEEEEE; - } - p.lev5 { - } -┃"); - topics ~= format(q"┃ - - - -Metadata Harvest - Topics - - - - - - - - - - - - - -

Metadata Harvest - Topics (output organised by language & filetype)

- -

ABCDEFGHIJKLMNOPQRSTUVWXYZ,  -

-
-┃", - _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, - _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, - inline_search_form(_make_and_meta_struct), -) ~ "\n"; - char _prev_k = "_".to!char; - int _kn; - foreach(k0; - hvst.subject_trees.keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) - ) { - if (k0.toUpper.to!(char[])[0] != _prev_k) { - topics ~= format(q"┃

%s

┃", - k0.toUpper.to!(char[])[0], - k0.toUpper.to!(char[])[0], - ); - _prev_k = k0.toUpper.to!(char[])[0]; - } - if (k0 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), k0,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln("", k0); - } - if ("_a" in hvst.subject_trees[k0]) { - foreach (t_a_; - hvst.subject_trees[k0]["_a"]["_a"]["_a"] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃ %s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

"%s" - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln("- ", t_a_.title, " - ", t_a_.author); - } - } - } - foreach(k1; - hvst.subject_trees[k0].keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) - ) { - if (k1 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), - k1.translate([' ' : "_"]), k1,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" ", k1); - } - if ("_a" in hvst.subject_trees[k0][k1]) { - foreach (t_a_; - hvst.subject_trees[k0][k1]["_a"]["_a"] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃ %s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

%s - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" - ", t_a_.title, " - ", t_a_.author); - } - } - } - } - foreach(k2; - hvst.subject_trees[k0][k1].keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) - ) { - if (k2 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), - k2.translate([' ' : "_"]), k2,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" ", k2); - } - if ("_a" in hvst.subject_trees[k0][k1][k2]) { - foreach (t_a_; - hvst.subject_trees[k0][k1][k2]["_a"] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃ %s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

%s - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" - ", t_a_.title, " - ", t_a_.author); - } - } - } - } - foreach(k3; - hvst.subject_trees[k0][k1][k2].keys - .sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable) - ) { - if (k3 != "_a") { - topics ~= format(q"┃

%s

┃", - k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), k2.translate([' ' : "_"]), - k3.translate([' ' : "_"]), k3,) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" ", k3); - } - { - foreach (t_a_; - hvst.subject_trees[k0][k1][k2][k3] - .multiSort!("toUpper(a.title) < toUpper(b.title)", "a.author < b.author", SwapStrategy.unstable) - ) { - _auth = []; - if (t_a_.author_arr.length < 2) { - _auth = format(q"┃%s┃", - t_a_.author_surname.translate([' ' : "_"]), - t_a_.author, - ); - } else { - foreach (a; t_a_.author_arr) { - _auth ~= format(q"┃ %s,┃", - t_a_.author_surname.translate([' ' : "_"]), - a, - ); - } - } - topics ~= format(q"┃

%s - %s [ %s ]┃", - t_a_.path_html_segtoc, - t_a_.title, - _auth, - t_a_.path_html_metadata, - t_a_.language, - ) ~ "\n"; - if (_opt_action.very_verbose) { - writeln(" - ", t_a_.title, " - ", t_a_.author); - } - } - } - } - } - } - } - } - } - topics - ~= format(q"┃ -


- - - - - - - - -┃") ~ "\n"; - import doc_reform.io_out.paths_output; - auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, ""); - try { - auto f = File(out_pth.harvest("topics.html"), "w"); - foreach (o; topics) { - f.writeln(o); - } - } catch (ErrnoException ex) { - // Handle error - } - } -} diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index 752d3ee..0893572 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -66,9 +66,9 @@ import doc_reform.conf.compile_time_info, doc_reform.meta, doc_reform.meta.metadoc, - doc_reform.meta.metadoc_harvest, - doc_reform.meta.metadoc_harvests_authors, - doc_reform.meta.metadoc_harvests_topics, + doc_reform.meta.metadoc_curate, + doc_reform.meta.metadoc_curate_authors, + doc_reform.meta.metadoc_curate_topics, doc_reform.meta.metadoc_from_src, doc_reform.meta.conf_make_meta_structs, doc_reform.meta.conf_make_meta_json, @@ -88,7 +88,7 @@ string program_name = "spine"; mixin spineRgxIn; mixin spineBiblio; mixin outputHub; - auto hvst = spineHarvest!(); + auto hvst = spineCurateMetadata!(); string flag_action; string arg_unrecognized; enum dAM { abstraction, matters } @@ -119,11 +119,11 @@ string program_name = "spine"; "debug" : false, "digest" : false, "epub" : false, - "harvest" : false, - "harvest-authors" : false, - "harvest-topics" : false, + "curate" : false, + "curate-authors" : false, + "curate-topics" : false, "html" : false, - "html-link-harvest" : false, + "html-link-curate" : false, "html-link-search" : false, "html-seg" : false, "html-scroll" : false, @@ -202,16 +202,16 @@ string program_name = "spine"; "cgi-url-action", "url to post to cgi-bin search form", &settings["cgi-url-action"], "cgi-search-title", "title for cgi-bin search form", &settings["cgi-search-title"], "concordance", "file for document", &opts["concordance"], + "curate", "extract info on authors & topics from document header metadata", &opts["curate"], + "curate-authors", "extract info on authors from document header metadata", &opts["curate-authors"], + "curate-topics", "extract info on topics from document header metadata", &opts["curate-topics"], "dark", "alternative dark theme", &opts["dark"], "debug", "debug", &opts["debug"], "digest", "hash digest for each object", &opts["digest"], "epub", "process epub output", &opts["epub"], - "harvest", "extract info on authors & topics from document header metadata", &opts["harvest"], - "harvest-authors", "extract info on authors from document header metadata", &opts["harvest-authors"], - "harvest-topics", "extract info on topics from document header metadata", &opts["harvest-topics"], "hide-ocn", "object cite numbers", &opts["hide-ocn"], "html", "process html output", &opts["html"], - "html-link-harvest", "place links back to harvest in segmented html", &opts["html-link-harvest"], + "html-link-curate", "place links back to curate in segmented html", &opts["html-link-curate"], "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"], @@ -314,20 +314,20 @@ string program_name = "spine"; @trusted bool epub() { return opts["epub"]; } - @trusted bool html_harvest_link() { - return (opts["html-link-harvest"]) ? true : false; + @trusted bool html_curate_link() { + return (opts["html-link-curate"]) ? true : false; } @trusted bool html_search_link() { return (opts["html-link-search"]) ? true : false; } - @trusted bool harvest() { - return (opts["harvest"] || opts["harvest-authors"] || opts["harvest-topics"]) ? true : false; + @trusted bool curate() { + return (opts["curate"] || opts["curate-authors"] || opts["curate-topics"]) ? true : false; } - @trusted bool harvest_authors() { - return (opts["harvest"] || opts["harvest-authors"]) ? true : false; + @trusted bool curate_authors() { + return (opts["curate"] || opts["curate-authors"]) ? true : false; } - @trusted bool harvest_topics() { - return (opts["harvest"] || opts["harvest-topics"]) ? true : false; + @trusted bool curate_topics() { + return (opts["curate"] || opts["curate-topics"]) ? true : false; } @trusted bool html() { return (opts["html"] || opts["html-seg"] || opts["html-scroll"]) ? true : false; @@ -520,7 +520,7 @@ string program_name = "spine"; } else if ( opts["abstraction"] || concordance - || harvest + || curate || html || epub || odt @@ -569,7 +569,7 @@ string program_name = "spine"; opts["abstraction"] || concordance || source_or_pod - || harvest + || curate || html || epub || odt @@ -584,7 +584,7 @@ string program_name = "spine"; return ( opts["abstraction"] || epub - || harvest + || curate || html || html_seg || html_scroll @@ -604,7 +604,7 @@ string program_name = "spine"; @trusted bool meta_processing_general() { return ( opts["abstraction"] - || harvest + || curate || html || epub || odt @@ -921,18 +921,18 @@ string program_name = "spine"; import doc_reform.meta.metadoc_show_config; spineShowConfig!()(doc_matters); } - if (doc_matters.opt.action.harvest) { - auto _hvst = spineMetaDocHarvest!()(doc_matters, hvst); + if (doc_matters.opt.action.curate) { + auto _hvst = spineMetaDocCurate!()(doc_matters, hvst); if ( _hvst.title.length > 0 && _hvst.author_surname_fn.length > 0 ) { - hvst.harvests ~= _hvst; + hvst.curates ~= _hvst; } else { if ((doc_matters.opt.action.debug_do) || (doc_matters.opt.action.very_verbose) ) { - writeln("WARNING harvest: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); + writeln("WARNING curate: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); } } } @@ -1035,18 +1035,18 @@ string program_name = "spine"; import doc_reform.meta.metadoc_show_config; spineShowConfig!()(doc_matters); } - if (doc_matters.opt.action.harvest) { - auto _hvst = spineMetaDocHarvest!()(doc_matters, hvst); + if (doc_matters.opt.action.curate) { + auto _hvst = spineMetaDocCurate!()(doc_matters, hvst); if ( _hvst.title.length > 0 && _hvst.author_surname_fn.length > 0 ) { - hvst.harvests ~= _hvst; + hvst.curates ~= _hvst; } else { if ((doc_matters.opt.action.debug_do) || (doc_matters.opt.action.very_verbose) ) { - writeln("WARNING harvest: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); + writeln("WARNING curate: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); } } } @@ -1086,21 +1086,21 @@ string program_name = "spine"; } } } - if (hvst.harvests.length > 0) { - if (_opt_action.harvest_topics) { - spineMetaDocHarvestsTopics!()(hvst, _make_and_meta_struct, _opt_action); + if (hvst.curates.length > 0) { + if (_opt_action.curate_topics) { + spineMetaDocCuratesTopics!()(hvst, _make_and_meta_struct, _opt_action); } - if (_opt_action.harvest_authors) { - spineMetaDocHarvestsAuthors!()(hvst.harvests, _make_and_meta_struct, _opt_action); + if (_opt_action.curate_authors) { + spineMetaDocCuratesAuthors!()(hvst.curates, _make_and_meta_struct, _opt_action); } if (!(_opt_action.quiet)) { import doc_reform.io_out.paths_output; auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, ""); - if (_opt_action.harvest_authors) { - writeln("- ", out_pth.harvest("authors.html")); + if (_opt_action.curate_authors) { + writeln("- ", out_pth.curate("authors.html")); } - if (_opt_action.harvest_topics) { - writeln("- ", out_pth.harvest("topics.html")); + if (_opt_action.curate_topics) { + writeln("- ", out_pth.curate("topics.html")); } } } else { writeln("NO HARVESTS"); } diff --git a/sundry/spine_search_cgi/.envrc-local_ b/sundry/spine_search_cgi/.envrc-local_ index 17e48ee..d14a371 100644 --- a/sundry/spine_search_cgi/.envrc-local_ +++ b/sundry/spine_search_cgi/.envrc-local_ @@ -82,10 +82,10 @@ nix-build && sudo cp -vi result/share/cgi-bin/spine_search $SpineCgiBIN/. $SpineBIN/spine -v --show-config --config=$SpinePOD/.dr #+END_SRC -*** generate html (linked to search form & harvest) +*** generate html (linked to search form & curate) #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search"--output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search"--output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** generate sql output @@ -94,11 +94,11 @@ $SpineBIN/spine -v --html --html-link-search --html-link-harvest --sqlite-db-fil SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUTstatic $SpinePOD/* #+END_SRC -*** generate harvest +*** generate curate #+BEGIN_SRC sh -$SpineBIN/spine -v --harvest --output=$SpineOUTstatic $SpinePOD/* -$SpineBIN/spine -v --html --html-link-harvest --harvest --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --curate --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) @@ -107,10 +107,10 @@ $SpineBIN/spine -v --html --html-link-harvest --harvest --output=$SpineOUTstati $SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --output="$SpineOUTstatic" #+END_SRC -*** generate html (linked to search form), sql output, harvest +*** generate html (linked to search form), sql output, curate #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-update --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-update --output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** make search form -- cgit v1.2.3