aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/ocda/meta/metadoc.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/ocda/meta/metadoc.d')
-rw-r--r--src/sisudoc/ocda/meta/metadoc.d157
1 files changed, 14 insertions, 143 deletions
diff --git a/src/sisudoc/ocda/meta/metadoc.d b/src/sisudoc/ocda/meta/metadoc.d
index 624761c..e284674 100644
--- a/src/sisudoc/ocda/meta/metadoc.d
+++ b/src/sisudoc/ocda/meta/metadoc.d
@@ -61,6 +61,8 @@ template spineAbstraction() {
import sisudoc.ocda.io_in.paths_source;
import sisudoc.ocda.io_in.read_config_files;
import sisudoc.ocda.io_in.read_source_files;
+ import sisudoc.ocda.meta.doc_matters;
+ mixin spineDocMatters;
mixin spineBiblio;
enum makeMeta { make, meta }
enum docAbst { doc_abstract_obj, doc_has }
@@ -142,149 +144,18 @@ template spineAbstraction() {
) {
writeln("step4 commence → (doc.matters) [", _manifest.src.filename, "]");
}
- struct ST_DocumentMatters {
- auto generator_program() {
- struct Prog_ {
- string project_name() {
- return "spine";
- }
- string name() {
- return program_info.name;
- }
- string ver() {
- return program_info.ver;
- }
- @trusted string name_and_version() {
- return program_info.name_and_version;
- }
- @trusted string name_version_and_compiler() {
- return program_info.name_version_and_compiler;
- }
- string url_home() {
- return "https://sisudoc.org";
- }
- string url_git() {
- return "https://git.sisudoc.org/projects/";
- }
- auto compiler() {
- return program_info.compiler;
- }
- auto time_output_generated() {
- return program_info.time_output_generated;
- }
- }
- return Prog_();
- }
- auto generated_time() {
- auto _st = Clock.currTime(UTC());
- auto _time = _st.year.to!string
- ~ "-" ~ _st.month.to!int.to!string // prefer as month number
- ~ "-" ~ _st.day.to!string
- ~ " [" ~ _st.isoWeek.to!string ~ "/" ~ _st.dayOfWeek.to!int.to!string ~ "]"
- ~ " " ~ _st.hour.to!string
- ~ ":" ~ _st.minute.to!string
- ~ ":" ~ _st.second.to!string;
- return _time;
- }
- ConfComposite conf_make_meta() {
- return _make_and_meta_struct;
- }
- auto doc_digest() {
- return doc_digests;
- }
- auto has() {
- return _doc_has_struct;
- }
- auto env() {
- struct Env_ {
- auto pwd() {
- return _manifest.env.pwd;
- }
- auto home() {
- return _manifest.env.home;
- }
- }
- return Env_();
- }
- auto opt() {
- struct Opt_ {
- auto action() {
- /+ getopt options, commandline instructions, raw
- - processing instructions --epub --html etc.
- - command line config instructions --output
- +/
- return _opt_action;
- }
- }
- return Opt_();
- }
- auto src() {
- return _manifest.src;
- }
- auto src_path_info() {
- return spinePathsSRC!()(_manifest.env.pwd, _manifest.src.file_with_absolute_path); // would like (to have and use) relative path
- }
- auto pod() {
- return _manifest.pod;
- }
- auto sqlite() {
- struct SQLite_ {
- string filename() {
- string _fn = "";
- string _pth = "";
- if (_opt_action.sqliteDB_filename.length > 0) {
- _fn = _opt_action.sqliteDB_filename;
- } 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;
- }
- string path() {
- string _pth = "";
- if (_opt_action.sqliteDB_path.length > 0) {
- _pth = _opt_action.sqliteDB_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;
- }
- string cgi_filename() {
- string _fn = "";
- if (_opt_action.cgi_sqlite_search_filename.length > 0) {
- _fn = _opt_action.cgi_sqlite_search_filename;
- } else if (_make_and_meta_struct.conf.w_srv_cgi_search_script.length > 0) {
- _fn = _make_and_meta_struct.conf.w_srv_cgi_search_script;
- }
- return _fn;
- }
- string cgi_filename_d() {
- string _fn = "";
- if (_opt_action.cgi_sqlite_search_filename_d.length > 0) {
- _fn = _opt_action.cgi_sqlite_search_filename_d;
- } else if (_make_and_meta_struct.conf.w_srv_cgi_search_script_raw_fn_d.length > 0) {
- _fn = _make_and_meta_struct.conf.w_srv_cgi_search_script_raw_fn_d;
- }
- return _fn;
- }
- }
- return SQLite_();
- }
- auto output_path() {
- return _make_and_meta_struct.conf.output_path;
- }
- auto srcs() {
- struct SRC_ {
- auto file_insert_list() {
- return _header_body_insertfilelist_imagelist.insert_file_list;
- }
- auto image_list() {
- return _doc_has_struct.imagelist;
- }
- }
- return SRC_();
- }
- }
- auto doc_matters = ST_DocumentMatters();
+ /+ ↓ doc_matters, built by the one constructor a loaded abstraction also
+ uses, so that the two paths cannot describe a document differently
+ +/
+ auto doc_matters = docMattersMake(
+ program_info,
+ _opt_action,
+ _manifest,
+ _make_and_meta_struct,
+ _doc_has_struct,
+ doc_digests,
+ _header_body_insertfilelist_imagelist.insert_file_list,
+ );
if ((_opt_action.debug_do)
|| (_opt_action.debug_do_stages)
) {