aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/spine.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc_reform/spine.d')
-rwxr-xr-xsrc/doc_reform/spine.d78
1 files changed, 38 insertions, 40 deletions
diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d
index 006ea1b..2ebdae2 100755
--- a/src/doc_reform/spine.d
+++ b/src/doc_reform/spine.d
@@ -172,25 +172,25 @@ string program_name = "spine";
"workon" : false,
];
string[string] settings = [
- "output" : "", //_cfg.www_doc_root, // "/srv/www/spine/static" or "/var/www/html"
- "www-http" : "", //_cfg.www_http, // "http" or "https"
- "www-host" : "", //_cfg.www_host, // start with "localhost" ?
- "www-host-doc-root" : "", //_cfg.www_host_doc_root, // start with "localhost" ?
- "www-url-doc-root" : "", //_cfg.www_url_doc_root, // start with "http://localhost" ?
- "cgi-http" : "", //_cfg.cgi_http, // suggest
- "cgi-host" : "", //_cfg.cgi_host, // suggest
- "cgi-bin-root" : "", //_cfg.cgi_bin_root, // suggest "/var/www/cgi/cgi-bin"
- "cgi-sqlite-search-filename" : "", //_cfg.cgi_filename, // suggest "spine_search" (though "spine-search" would have been preferable?)
- "cgi-url-root" : "", //_cfg.cgi_url_root, // start with "http://localhost/cgi-bin" ?
- "cgi-url-action" : "", //_cfg.cgi_url_action, // start with "http://localhost/cgi-bin/spine-search"
- "cgi-search-title" : "", //_cfg.cgi_search_form_title, // e.g. "≅ SiSU Spine search"
+ "output" : "",
+ "www-http" : "",
+ "www-host" : "",
+ "www-host-doc-root" : "",
+ "www-url-doc-root" : "",
+ "cgi-http" : "",
+ "cgi-host" : "",
+ "cgi-bin-root" : "",
+ "cgi-sqlite-search-filename" : "",
+ "cgi-url-root" : "",
+ "cgi-url-action" : "",
+ "cgi-search-title" : "",
"config" : "",
- "lang" : "all", //_cfg.default_language, // suggest "all" or "en" (default which language to process)
- "set-papersize" : "", //_cfg.default_papersize, // suggest: a4
- "set-textwrap" : "", //_cfg.default_text_wrap, // suggest: 80
- "set-digest" : "", //_cfg.default_hash_digest, // suggest: sha256
- "sqlite-db-path" : "", //_cfg.db_sqlite_path, // suggest: "/var/www/sqlite"
- "sqlite-db-filename" : "", //_cfg.db_sqlite_filename, // suggest: "spine-search.db"
+ "lang" : "all",
+ "set-papersize" : "",
+ "set-textwrap" : "",
+ "set-digest" : "",
+ "sqlite-db-path" : "",
+ "sqlite-db-filename" : "",
];
auto helpInfo = getopt(args,
std.getopt.config.passThrough,
@@ -199,10 +199,10 @@ string program_name = "spine";
"assert", "set optional assertions on", &opts["assertions"],
"cgi-search-form-codegen", "generates (pre-compiled) d code for search of specified db", &opts["cgi-search-form-codegen"],
"cgi-bin-root", "path to cgi-bin directory", &settings["cgi-bin-root"],
- "cgi-sqlite-search-filename", "cgi-bin sqlite search form name", &settings["cgi-sqlite-search-filename"],
"cgi-url-root", "url to cgi-bin (to find cgi-bin)", &settings["cgi-url-root"],
"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"],
+ "cgi-search-title", "if generating a cgi search form the title to use for it", &settings["cgi-search-title"],
+ "cgi-sqlite-search-filename", "=[filename] default is spine-search", &settings["cgi-sqlite-search-filename"],
"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"],
@@ -217,6 +217,7 @@ string program_name = "spine";
"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"],
+ "lang", "=[lang code e.g. =en or =en,es]", &settings["lang"],
"latex", "output for pdfs", &opts["latex"],
"latex-color-links", "mono or color links for pdfs", &opts["latex-color-links"],
"light", "default light theme", &opts["light"],
@@ -224,6 +225,7 @@ string program_name = "spine";
"ocn-off", "object cite numbers", &opts["ocn-off"],
"odf", "open document format text (--odt)", &opts["odf"],
"odt", "open document format text", &opts["odt"],
+ "output", "=/path/to/output/dir specify where to place output", &settings["output"],
"parallel", "parallelisation", &opts["parallel"],
"parallel-subprocesses", "nested parallelisation", &opts["parallel-subprocesses"],
"pdf", "latex output for pdfs", &opts["pdf"],
@@ -251,6 +253,8 @@ string program_name = "spine";
"sqlite-discrete", "process discrete sqlite output", &opts["sqlite-discrete"],
"sqlite-db-create", "create db, create tables", &opts["sqlite-db-create"],
"sqlite-db-drop", "drop tables & db", &opts["sqlite-db-drop"],
+ "sqlite-db-filename", "sqlite db to create, populate & make available for search", &settings["sqlite-db-filename"],
+ "sqlite-db-path", "sqlite db path", &settings["sqlite-db-path"],
"sqlite-db-recreate", "create db, create tables", &opts["sqlite-db-recreate"],
"sqlite-delete", "sqlite output", &opts["sqlite-delete"],
"sqlite-insert", "sqlite output", &opts["sqlite-insert"],
@@ -267,13 +271,7 @@ string program_name = "spine";
"very-verbose", "output to terminal", &opts["very-verbose"],
"workon", "(reserved for some matters under development & testing)", &opts["workon"],
"xhtml", "xhtml output", &opts["xhtml"],
- "cgi-search-title", "if generating a cgi search form the title to use for it", &settings["cgi-search-title"],
- "cgi-sqlite-search-filename", "=[filename] default is spine-search", &settings["cgi-sqlite-search-filename"],
"config", "=/path/to/config/file/including/filename", &settings["config"],
- "lang", "=[lang code e.g. =en or =en,es]", &settings["lang"],
- "output", "=/path/to/output/dir specify where to place output", &settings["output"],
- "sqlite-db-path", "sqlite db path", &settings["sqlite-db-path"],
- "sqlite-db-filename", "sqlite db to create, populate & make available for search", &settings["sqlite-db-filename"],
// "sqlite-db-filename", "=[filename].sql.db", &settings["sqlite-db-filename"],
);
if (helpInfo.helpWanted) {
@@ -466,12 +464,6 @@ string program_name = "spine";
@trusted string cgi_bin_root() {
return settings["cgi-bin-root"];
}
- @trusted string cgi_url_root() {
- return settings["cgi-url-root"];
- }
- @trusted string cgi_url_action() {
- return settings["cgi-url-action"];
- }
@trusted string cgi_search_title() {
return settings["cgi-search-title"];
}
@@ -483,6 +475,12 @@ string program_name = "spine";
? (settings["cgi-sqlite-search-filename"].translate(['-' : "_"]) ~ ".d")
: "";
}
+ @trusted string cgi_url_root() {
+ return settings["cgi-url-root"];
+ }
+ @trusted string cgi_url_action() {
+ return settings["cgi-url-action"];
+ }
@trusted string hash_digest_type() {
return settings["set-digest"];
}
@@ -492,16 +490,16 @@ string program_name = "spine";
@trusted string latex_papersize() {
return settings["set-papersize"];
}
- @trusted string webserver_host_name() {
+ @trusted string webserver_host_name() {
return settings["www-host"];
}
- @trusted string webserver_host_doc_root() {
+ @trusted string webserver_host_doc_root() {
return settings["www-host-doc-root"];
}
- @trusted string webserver_url_doc_root() {
+ @trusted string webserver_url_doc_root() {
return settings["www-url-doc-root"];
}
- @trusted string webserver_http() {
+ @trusted string webserver_http() {
return settings["www-http"];
}
@trusted bool parallelise() {
@@ -662,7 +660,7 @@ string program_name = "spine";
_conf_file_details = configFilePaths!()(_manifested, _env, _opt_action.config_path_set);
auto _config_local_site_struct = readConfigSite!()(_conf_file_details, _opt_action, _cfg);
import doc_reform.meta.conf_make_meta_yaml;
- _siteConfig = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_siteConfig, _manifested, _opt_action); // - get local site config
+ _siteConfig = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_siteConfig, _manifested, _opt_action, _cfg); // - get local site config
break;
}
}
@@ -670,7 +668,7 @@ string program_name = "spine";
} else { /+ local site config +/
auto _config_local_site_struct = readConfigSite!()(_conf_file_details, _opt_action, _cfg);
import doc_reform.meta.conf_make_meta_yaml;
- _siteConfig = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_siteConfig, _manifested, _opt_action); // - get local site config
+ _siteConfig = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_siteConfig, _manifested, _opt_action, _cfg); // - get local site config
}
if (_opt_action.show_config) {
import doc_reform.meta.metadoc_show_config;
@@ -886,7 +884,7 @@ string program_name = "spine";
) {
writeln("--->\nstepX commence → (document abstraction)");
}
- auto t = spineAbstraction!()(_env, program_info, _opt_action, manifest, _make_and_meta_struct);
+ auto t = spineAbstraction!()(_env, program_info, _opt_action, _cfg, manifest, _make_and_meta_struct);
static assert(t.length==2);
auto doc_abstraction = t[dAM.abstraction];
auto doc_matters = t[dAM.matters];
@@ -1000,7 +998,7 @@ string program_name = "spine";
) {
writeln("--->\nstepX commence → (document abstraction)");
}
- auto t = spineAbstraction!()(_env, program_info, _opt_action, manifest, _make_and_meta_struct);
+ auto t = spineAbstraction!()(_env, program_info, _opt_action, _cfg, manifest, _make_and_meta_struct);
static assert(t.length==2);
auto doc_abstraction = t[dAM.abstraction];
auto doc_matters = t[dAM.matters];