aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/spine.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2020-03-29 18:29:44 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2020-05-20 11:27:23 -0400
commiteed0938b23d13ec4f2ef4588ccdb2e7abc0c1552 (patch)
tree4e015ce076795100792412b76156330e80440c37 /src/doc_reform/spine.d
parentmeson using dub (diff)
0.10.0 search sqlite & cgi
Diffstat (limited to 'src/doc_reform/spine.d')
-rwxr-xr-xsrc/doc_reform/spine.d266
1 files changed, 142 insertions, 124 deletions
diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d
index 3f422b4..3a64726 100755
--- a/src/doc_reform/spine.d
+++ b/src/doc_reform/spine.d
@@ -112,134 +112,140 @@ string program_name = "spine";
}
}
bool[string] opts = [
- "abstraction" : false,
- "assertions" : false,
- "concordance" : false,
- "dark" : false,
- "debug" : false,
- "digest" : false,
- "epub" : false,
- "harvest" : false,
- "harvest-authors" : false,
- "harvest-topics" : false,
- "harvest-link" : false,
- "html" : false,
- "html-seg" : false,
- "html-scroll" : false,
- "latex" : false,
- "latex-color-links" : false,
- "light" : false,
- "manifest" : false,
- "hide-ocn" : false,
- "ocn-off" : false,
- "odf" : false,
- "odt" : false,
- "parallel" : false,
- "parallel-subprocesses" : false,
- "pdf" : false,
- "pdf-color-links" : false,
- "quiet" : false,
- "pod" : false,
- "serial" : false,
- "show-summary" : false,
- "show-metadata" : false,
- "show-make" : false,
- "show-config" : false,
- "source" : false,
- "sqlite-discrete" : false,
- "sqlite-db-create" : false,
- "sqlite-db-drop" : false,
- "sqlite-db-recreate" : false,
- "sqlite-delete" : false,
- "sqlite-insert" : false,
- "sqlite-update" : false,
- "text" : false,
- "verbose" : false,
- "very-verbose" : false,
- "xhtml" : false,
- "section_toc" : true,
- "section_body" : true,
- "section_endnotes" : true,
- "section_glossary" : true,
- "section_biblio" : true,
- "section_bookindex" : true,
- "section_blurb" : true,
- "backmatter" : true,
- "skip-output" : false,
- "theme-dark" : false,
- "theme-light" : false,
- "workon" : false,
+ "abstraction" : false,
+ "assertions" : false,
+ "cgi-search-form-codegen" : false,
+ "concordance" : false,
+ "dark" : false,
+ "debug" : false,
+ "digest" : false,
+ "epub" : false,
+ "harvest" : false,
+ "harvest-authors" : false,
+ "harvest-topics" : false,
+ "html" : false,
+ "html-link-harvest" : false,
+ "html-link-search" : false,
+ "html-seg" : false,
+ "html-scroll" : false,
+ "latex" : false,
+ "latex-color-links" : false,
+ "light" : false,
+ "manifest" : false,
+ "hide-ocn" : false,
+ "ocn-off" : false,
+ "odf" : false,
+ "odt" : false,
+ "parallel" : false,
+ "parallel-subprocesses" : false,
+ "pdf" : false,
+ "pdf-color-links" : false,
+ "quiet" : false,
+ "pod" : false,
+ "serial" : false,
+ "show-summary" : false,
+ "show-metadata" : false,
+ "show-make" : false,
+ "show-config" : false,
+ "source" : false,
+ "sqlite-discrete" : false,
+ "sqlite-db-create" : false,
+ "sqlite-db-drop" : false,
+ "sqlite-db-recreate" : false,
+ "sqlite-delete" : false,
+ "sqlite-insert" : false,
+ "sqlite-update" : false,
+ "text" : false,
+ "verbose" : false,
+ "very-verbose" : false,
+ "xhtml" : false,
+ "section_toc" : true,
+ "section_body" : true,
+ "section_endnotes" : true,
+ "section_glossary" : true,
+ "section_biblio" : true,
+ "section_bookindex" : true,
+ "section_blurb" : true,
+ "backmatter" : true,
+ "skip-output" : false,
+ "theme-dark" : false,
+ "theme-light" : false,
+ "workon" : false,
];
string[string] settings = [
+ "cgi-sqlite-search-filename" : "", // "spine-search"
"config" : "",
"output" : "",
"lang" : "all",
- "sqlite-filename" : "documents",
+ "sqlite-db-filename" : "", // "spine-search.db"
];
auto helpInfo = getopt(args,
std.getopt.config.passThrough,
- "abstraction", "--abstraction document abstraction ", &opts["abstraction"],
- "assert", "--assert set optional assertions on", &opts["assertions"],
- "concordance", "--concordance file for document", &opts["concordance"],
- "dark", "--dark alternative dark theme", &opts["dark"],
- "debug", "--debug", &opts["debug"],
- "digest", "--digest hash digest for each object", &opts["digest"],
- "epub", "--epub process epub output", &opts["epub"],
- "harvest", "--harvest extract info on authors & topics from document header metadata", &opts["harvest"],
- "harvest-authors", "--harvest-authors extract info on authors from document header metadata", &opts["harvest-authors"],
- "harvest-topics", "--harvest-topics extract info on topics from document header metadata", &opts["harvest-topics"],
- "harvest-link", "--harvest-link place links back to harvest in segmented html", &opts["harvest-link"],
- "html", "--html process html output", &opts["html"],
- "html-seg", "--html-seg process html output", &opts["html-seg"],
- "html-scroll", "--html-seg process html output", &opts["html-scroll"],
- "latex", "--latex output for pdfs", &opts["latex"],
- "latex-color-links", "--latex-color-links mono or color links for pdfs", &opts["latex-color-links"],
- "light", "--light default light theme", &opts["light"],
- "manifest", "--manifest process manifest output", &opts["manifest"],
- "hide-ocn", "--hide-ocn object cite numbers", &opts["hide-ocn"],
- "ocn-off", "--ocn-off object cite numbers", &opts["ocn-off"],
- "odf", "--odf open document format text (--odt)", &opts["odf"],
- "odt", "--odt open document format text", &opts["odt"],
- "parallel", "--parallel parallelisation", &opts["parallel"],
- "parallel-subprocesses", "--parallel-subprocesses nested parallelisation", &opts["parallel-subprocesses"],
- "quiet|q", "--quiet output to terminal", &opts["quiet"],
- "pdf", "--pdf latex output for pdfs", &opts["pdf"],
- "pdf-color-links", "--pdf-color-links mono or color links for pdfs", &opts["pdf-color-links"],
- "pod", "--pod spine (doc reform) pod source content bundled", &opts["pod"],
- "serial", "--serial serial processing", &opts["serial"],
- "show-summary", "--show-summary", &opts["show-summary"],
- "show-make", "--show-make", &opts["show-make"],
- "show-metadata", "--show-metadata", &opts["show-metadata"],
- "show-config", "--show-config", &opts["show-config"],
- "source", "--source markup source text content", &opts["source"],
- "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"],
- "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"],
- "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"],
- "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"],
- "sqlite-delete", "--sqlite-delete process sqlite output", &opts["sqlite-delete"],
- "sqlite-insert", "--sqlite-insert process sqlite output", &opts["sqlite-insert"],
- "sqlite-update", "--sqlite-update process sqlite output", &opts["sqlite-update"],
- "text", "--text process text output", &opts["text"],
- "txt", "--txt process text output", &opts["text"],
- "verbose|v", "--verbose output to terminal", &opts["verbose"],
- "very-verbose", "--very-verbose output to terminal", &opts["very-verbose"],
- "xhtml", "--xhtml process xhtml output", &opts["xhtml"],
- "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"],
- "section-body", "--section-body process document body (default)", &opts["section_body"],
- "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"],
- "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"],
- "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"],
- "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"],
- "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"],
- "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"],
- "skip-output", "--skip-output", &opts["skip-output"],
- "theme-dark", "--theme-dark alternative dark theme", &opts["theme-dark"],
- "theme-light", "--theme-light default light theme", &opts["theme-light"],
- "workon", "--workon (reserved for some matters under development & testing)", &opts["workon"],
- "config", "--config=/path/to/config/file/including/filename", &settings["config"],
- "output", "--output=/path/to/output/dir specify where to place output", &settings["output"],
- "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"],
- "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"],
+ "abstraction", "--abstraction document abstraction ", &opts["abstraction"],
+ "assert", "--assert set optional assertions on", &opts["assertions"],
+ "cgi-search-form-codegen", "--cgi-search-form-codegen pre-compiled d code search of specified db", &opts["cgi-search-form-codegen"],
+ "concordance", "--concordance file for document", &opts["concordance"],
+ "dark", "--dark alternative dark theme", &opts["dark"],
+ "debug", "--debug", &opts["debug"],
+ "digest", "--digest hash digest for each object", &opts["digest"],
+ "epub", "--epub process epub output", &opts["epub"],
+ "harvest", "--harvest extract info on authors & topics from document header metadata", &opts["harvest"],
+ "harvest-authors", "--harvest-authors extract info on authors from document header metadata", &opts["harvest-authors"],
+ "harvest-topics", "--harvest-topics extract info on topics from document header metadata", &opts["harvest-topics"],
+ "html", "--html process html output", &opts["html"],
+ "html-link-harvest", "--html-link-harvest place links back to harvest in segmented html", &opts["html-link-harvest"],
+ "html-link-search", "--html-link-search html embedded search submission", &opts["html-link-search"],
+ "html-seg", "--html-seg process html output", &opts["html-seg"],
+ "html-scroll", "--html-seg process html output", &opts["html-scroll"],
+ "latex", "--latex output for pdfs", &opts["latex"],
+ "latex-color-links", "--latex-color-links mono or color links for pdfs", &opts["latex-color-links"],
+ "light", "--light default light theme", &opts["light"],
+ "manifest", "--manifest process manifest output", &opts["manifest"],
+ "hide-ocn", "--hide-ocn object cite numbers", &opts["hide-ocn"],
+ "ocn-off", "--ocn-off object cite numbers", &opts["ocn-off"],
+ "odf", "--odf open document format text (--odt)", &opts["odf"],
+ "odt", "--odt open document format text", &opts["odt"],
+ "parallel", "--parallel parallelisation", &opts["parallel"],
+ "parallel-subprocesses", "--parallel-subprocesses nested parallelisation", &opts["parallel-subprocesses"],
+ "quiet|q", "--quiet output to terminal", &opts["quiet"],
+ "pdf", "--pdf latex output for pdfs", &opts["pdf"],
+ "pdf-color-links", "--pdf-color-links mono or color links for pdfs", &opts["pdf-color-links"],
+ "pod", "--pod spine (doc reform) pod source content bundled", &opts["pod"],
+ "serial", "--serial serial processing", &opts["serial"],
+ "show-summary", "--show-summary", &opts["show-summary"],
+ "show-make", "--show-make", &opts["show-make"],
+ "show-metadata", "--show-metadata", &opts["show-metadata"],
+ "show-config", "--show-config", &opts["show-config"],
+ "source", "--source markup source text content", &opts["source"],
+ "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"],
+ "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"],
+ "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"],
+ "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"],
+ "sqlite-delete", "--sqlite-delete process sqlite output", &opts["sqlite-delete"],
+ "sqlite-insert", "--sqlite-insert process sqlite output", &opts["sqlite-insert"],
+ "sqlite-update", "--sqlite-update process sqlite output", &opts["sqlite-update"],
+ "text", "--text process text output", &opts["text"],
+ "txt", "--txt process text output", &opts["text"],
+ "verbose|v", "--verbose output to terminal", &opts["verbose"],
+ "very-verbose", "--very-verbose output to terminal", &opts["very-verbose"],
+ "xhtml", "--xhtml process xhtml output", &opts["xhtml"],
+ "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"],
+ "section-body", "--section-body process document body (default)", &opts["section_body"],
+ "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"],
+ "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"],
+ "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"],
+ "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"],
+ "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"],
+ "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"],
+ "skip-output", "--skip-output", &opts["skip-output"],
+ "theme-dark", "--theme-dark alternative dark theme", &opts["theme-dark"],
+ "theme-light", "--theme-light default light theme", &opts["theme-light"],
+ "workon", "--workon (reserved for some matters under development & testing)", &opts["workon"],
+ "cgi-sqlite-search-filename", "--cgi-sqlite-search-filename=[filename]", &settings["cgi-sqlite-search-filename"],
+ "config", "--config=/path/to/config/file/including/filename", &settings["config"],
+ "output", "--output=/path/to/output/dir specify where to place output", &settings["output"],
+ "sqlite-db-filename", "--sqlite-db-filename=[filename].sql.db", &settings["sqlite-db-filename"],
+ "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"],
);
if (helpInfo.helpWanted) {
defaultGetoptPrinter("Some information about the program.", helpInfo.options);
@@ -249,6 +255,9 @@ string program_name = "spine";
@trusted bool assertions() {
return opts["assertions"];
}
+ @trusted bool cgi_search_form_codegen() {
+ return opts["cgi-search-form-codegen"];
+ }
@trusted bool concordance() {
return opts["concordance"];
}
@@ -275,8 +284,11 @@ string program_name = "spine";
@trusted bool epub() {
return opts["epub"];
}
- @trusted bool harvest_link() {
- return (opts["harvest-link"]) ? true : false;
+ @trusted bool html_harvest_link() {
+ return (opts["html-link-harvest"]) ? 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;
@@ -414,7 +426,13 @@ string program_name = "spine";
return settings["output"];
}
auto sqlite_filename() {
- return settings["sqlite-filename"];
+ return settings["sqlite-db-filename"];
+ }
+ auto cgi_sqlite_search_filename() {
+ return settings["cgi-sqlite-search-filename"];
+ }
+ auto cgi_sqlite_search_filename_d() {
+ return (settings["cgi-sqlite-search-filename"].translate(['-' : "_"]) ~ ".d");
}
@trusted bool parallelise() {
bool _is;
@@ -719,7 +737,7 @@ string program_name = "spine";
) {
writeln("step0 commence → (without processing files)");
}
- outputHubOp!()(_env, _opt_action);
+ outputHubOp!()(_env, _opt_action, _make_and_meta_struct);
if ((_opt_action.debug_do)
|| (_opt_action.very_verbose)
) {