aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/spine.org
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 /org/spine.org
parentmeson using dub (diff)
0.10.0 search sqlite & cgi
Diffstat (limited to 'org/spine.org')
-rw-r--r--org/spine.org274
1 files changed, 149 insertions, 125 deletions
diff --git a/org/spine.org b/org/spine.org
index 79787c2..253720f 100644
--- a/org/spine.org
+++ b/org/spine.org
@@ -41,7 +41,7 @@ struct Version {
#+NAME: spine_version_current_set
#+BEGIN_SRC d
-enum _ver = Version(0, 9, 2);
+enum _ver = Version(0, 10, 0);
#+END_SRC
** compilation restrictions (supported compilers)
@@ -353,134 +353,140 @@ scope(failure) {
#+NAME: spine_args
#+BEGIN_SRC d
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);
@@ -497,6 +503,9 @@ struct OptActions {
@trusted bool assertions() {
return opts["assertions"];
}
+ @trusted bool cgi_search_form_codegen() {
+ return opts["cgi-search-form-codegen"];
+ }
@trusted bool concordance() {
return opts["concordance"];
}
@@ -523,8 +532,11 @@ struct OptActions {
@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;
@@ -662,7 +674,13 @@ struct OptActions {
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;
@@ -997,7 +1015,7 @@ if (!(_opt_action.skip_output)) {
) {
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)
) {
@@ -1488,6 +1506,12 @@ struct DocumentMatters {
@safe string filename() {
return _opt_action.sqlite_filename;
}
+ @safe string cgi_filename() {
+ return _opt_action.cgi_sqlite_search_filename;
+ }
+ @safe string cgi_filename_d() {
+ return _opt_action.cgi_sqlite_search_filename_d;
+ }
}
return SQLite_();
}