From 118ea61dc79bf9b1c45bbf81b31361a749e32fdd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 11 Aug 2021 03:06:47 -0400 Subject: spine search and configuration related --- org/spine.org | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) (limited to 'org/spine.org') diff --git a/org/spine.org b/org/spine.org index ad2cf86..c27a3be 100644 --- a/org/spine.org +++ b/org/spine.org @@ -31,32 +31,7 @@ ** 0. set configuration tangle SET :configuration: -#+HEADER: :tangle "../views/configuration_suggested.txt" -#+BEGIN_SRC d -/+ obt - org-mode generated file +/ -struct Cfg { - string www_http = "http"; - string www_doc_root = "/srv/www/spine/static"; // "/var/www/html" - string www_domain = "localhost"; - string www_domain_doc_root = "localhost"; - string www_url_doc_root = "http://localhost"; - string cgi_bin_root = "/var/www/cgi/cgi-bin/"; // "/usr/lib/cgi-bin" - string cgi_bin_part = "cgi-bin"; - string cgi_filename = "spine_search"; // "spine-search" - string cgi_url_root = "http://localhost/cgi-bin"; - string cgi_port = ""; - string cgi_user = ""; - string cgi_url_action = "http://localhost/cgi-bin/spine_search"; - string cgi_title = "≅ SiSU Spine search"; - string db_sqlite_doc_root = "/srv/www/spine/static/sqlite/"; - string db_sqlite_filename = "spine.search.db"; - string default_language = "en"; - string default_papersize = "a4"; - string default_text_wrap = "80"; - string default_hash_digest = "sha256"; -} -enum _cfg = Cfg(); -#+END_SRC +see: cfte_configuation.org ** program version struct @@ -490,6 +465,7 @@ string[string] settings = [ "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" ]; #+END_SRC @@ -578,6 +554,7 @@ auto helpInfo = getopt(args, "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"], ); @@ -697,6 +674,9 @@ struct OptActions { @trusted bool source_or_pod() { return (opts["pod"] || opts["source"]) ? true : false; } + @trusted string sqlite_db_path() { + return settings["sqlite-db-path"]; + } @trusted string sqlite_db_filename() { return settings["sqlite-db-filename"]; } @@ -775,6 +755,9 @@ struct OptActions { @trusted string sqlite_filename() { return settings["sqlite-db-filename"]; } + @trusted string sqlite_path() { + return settings["sqlite-db-path"]; + } @trusted string cgi_bin_root() { return settings["cgi-bin-root"]; } @@ -1689,13 +1672,23 @@ struct DocumentMatters { struct SQLite_ { @safe string filename() { string _fn = ""; + string _pth = ""; if (_opt_action.sqlite_filename.length > 0) { _fn = _opt_action.sqlite_filename; - } else if (_make_and_meta_struct.conf.w_srv_db_sqlite.length > 0) { - _fn = _make_and_meta_struct.conf.w_srv_db_sqlite; + } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.length > 0) { + _fn = _make_and_meta_struct.conf.w_srv_db_sqlite_filename; } return _fn; } + @safe string path() { + string _pth = ""; + if (_opt_action.sqlite_path.length > 0) { + _pth = _opt_action.sqlite_path; + } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_path.length > 0) { + _pth = _make_and_meta_struct.conf.w_srv_db_sqlite_path; + } + return _pth; + } @safe string cgi_filename() { string _fn = ""; if (_opt_action.cgi_sqlite_search_filename.length > 0) { -- cgit v1.2.3