diff options
Diffstat (limited to 'src/sdp/meta')
-rw-r--r-- | src/sdp/meta/metadoc.d | 111 | ||||
-rw-r--r-- | src/sdp/meta/read_config_files.d | 12 | ||||
-rw-r--r-- | src/sdp/meta/rgx.d | 1 |
3 files changed, 28 insertions, 96 deletions
diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d index 129e53c..cbc5d51 100644 --- a/src/sdp/meta/metadoc.d +++ b/src/sdp/meta/metadoc.d @@ -42,8 +42,7 @@ template SiSUabstraction() { /+ ↓ read file (filename with path) +/ /+ ↓ file tuple of header and content +/ debug(steps) { - writeln(__LINE__, ":", __FILE__, - ": step1 commence → (get document header & body & insert file list & if needed image list)" + writeln("step1 commence → (get document header & body & insert file list & if needed image list)" ); } auto _header_body_insertfilelist_imagelist @@ -51,7 +50,7 @@ template SiSUabstraction() { static assert(!isTypeTuple!(_header_body_insertfilelist_imagelist)); static assert(_header_body_insertfilelist_imagelist.length==4); debug(steps) { - writeln(__LINE__, ":", __FILE__, ": step1 complete"); + writeln("- step1 complete"); } debug(header_and_body) { writeln(header); @@ -60,21 +59,19 @@ template SiSUabstraction() { } /+ ↓ split header into make and meta +/ debug(steps) { - writeln(__LINE__, ":", __FILE__, - ": step2 commence → (doc header: make & meta as struct)" - ); + writeln("step2 commence → (read document header - toml or sdlang, return struct)"); } auto _make_and_meta_struct = docHeaderMakeAndMetaTupExtractAndConvertToStruct!()( conf_files_composite_make, _header_body_insertfilelist_imagelist[headBody.header] - ); // breakage ... + ); debug(steps) { - writeln(__LINE__, ":", __FILE__, ": step2 complete"); + writeln("- step2 complete"); } /+ ↓ document abstraction: process document, return abstraction as tuple +/ debug(steps) { - writeln(__LINE__, ":", __FILE__, ": step3 commence → (document abstraction (da); da keys; segnames; doc_matters)"); + writeln("step3 commence → (document abstraction (da); da keys; segnames; doc_matters)"); } auto da = SiSUdocAbstraction!()( _header_body_insertfilelist_imagelist[headBody.body_content], @@ -89,15 +86,14 @@ template SiSUabstraction() { string[] _doc_epub_segnames_0_4 = da[docAbst.segnames_0_4]; auto _images = da[docAbst.images]; debug(steps) { - writeln(__LINE__, ":", __FILE__, ": step3 complete"); + writeln("- step3 complete"); } debug(steps) { - writeln(__LINE__, ":", __FILE__, ": step4 commence → (doc_matters)"); + writeln("step4 commence → (doc_matters)"); } struct DocumentMatters { auto conf_make_meta() { // TODO meld with all make instructions - auto _k = _make_and_meta_struct; - return _k; + return _make_and_meta_struct; } auto env() { struct Env_ { @@ -123,51 +119,15 @@ template SiSUabstraction() { return Opt_(); } auto src() { + return _manifest.src; + } + auto src_path_info() { + return SiSUpathsSRC!()(_manifest.env.pwd, _manifest.src.file_with_absolute_path); // would like (to have and use) relative path + } + auto srcs() { struct SRC_ { - auto is_pod() { - return _manifest.src.is_pod; - } - auto filename() { - return _manifest.src.filename; - } - auto language() { - return _manifest.src.lng; - } - auto path_info() { - auto _k = SiSUpathsSRC!()(_manifest.env.pwd, _manifest.src.file_with_absolute_path); // would like (to have and use) relative path - return _k; - } - auto file_with_absolute_path() { - auto _k = _manifest.src.file_with_absolute_path; - return _k; - } - auto absolute_path_to_src() { - auto _k = _manifest.src.absolute_path_to_src; - return _k; - } - auto base_dir() { - auto _k = _manifest.src.base_dir; - return _k; - } - auto base_parent_dir_path() { - auto _k = _manifest.src.base_parent_dir_path; - return _k; - } - auto base_dir_path() { - auto _k = _manifest.src.base_dir_path; - return _k; - } - auto media_dir_path() { - auto _k = _manifest.src.media_dir_path; - return _k; - } - auto base_parent_dir() { - auto _k = _manifest.src.base_parent_dir; - return _k; - } auto file_insert_list() { - string[] _k = _header_body_insertfilelist_imagelist[headBody.insert_file_list]; - return _k; + return _header_body_insertfilelist_imagelist[headBody.insert_file_list]; } auto image_list() { return _images; @@ -176,48 +136,19 @@ template SiSUabstraction() { return SRC_(); } auto pod() { - struct Pod_ { - auto src_is_pod() { - return _manifest.pod.src_is_pod; - } - auto manifest_list_of_filenames() { - return _manifest.pod.manifest_list_of_filenames; - } - auto manifest_list_of_languages() { - return _manifest.pod.manifest_list_of_languages; - } - auto manifest_filename() { - return _manifest.pod.manifest_filename; - } - auto manifest_path() { - return _manifest.pod.manifest_path; - } - auto manifest_file_with_path() { - return _manifest.pod.manifest_file_with_path; - } - auto config_dirs() { - return _manifest.pod.config_dirs; - } - auto image_dirs() { - return _manifest.pod.image_dirs; - } - } - return Pod_(); + return _manifest.pod; } auto xml() { struct XML_ { auto keys_seq() { /+ contains .seg & .scroll sequences +/ - auto _k = _document_section_keys_sequenced; - return _k; + return _document_section_keys_sequenced; } string[] segnames() { - string[] _k = _doc_html_segnames; - return _k; + return _doc_html_segnames; } string[] segnames_lv_0_to_4() { - string[] _k = _doc_epub_segnames_0_4; - return _k; + return _doc_epub_segnames_0_4; } } return XML_(); @@ -228,7 +159,7 @@ template SiSUabstraction() { } auto doc_matters = DocumentMatters(); debug(steps) { - writeln(__LINE__, ":", __FILE__, ": step4 complete"); + writeln("- step4 complete"); } auto t = tuple(doc_abstraction, doc_matters); static assert(t.length==2); diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d index 52446e8..15a7a67 100644 --- a/src/sdp/meta/read_config_files.d +++ b/src/sdp/meta/read_config_files.d @@ -16,8 +16,8 @@ static template configInSite() { auto possible_config_path_locations = conf_file_details.possible_config_path_locations.local_site; string config_file_str; debug(io) { - writeln("in config filename: ", conf_sdl); - writeln("in config possible path locations: ", possible_config_path_locations); + writeln("WARNING (io debug) in config filename: ", conf_sdl); + writeln("WARNING (io debug) in config possible path locations: ", possible_config_path_locations); } foreach(pth; possible_config_path_locations) { auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array; @@ -27,7 +27,7 @@ static template configInSite() { try { if (exists(conf_file)) { debug(io) { - writeln("in config file found: ", conf_file); + writeln("WARNING (io debug) in config file found: ", conf_file); } config_file_str = conf_file.readText; break; @@ -53,8 +53,8 @@ static template configInDoc() { auto possible_config_path_locations = conf_file_details.possible_config_path_locations.document; string config_file_str; debug(io) { - writeln("in config filename: ", conf_sdl); - writeln("in config possible path locations: ", possible_config_path_locations); + writeln("WARNING (io debug) in config filename: ", conf_sdl); + writeln("WARNING (io debug) in config possible path locations: ", possible_config_path_locations); } foreach(pth; possible_config_path_locations) { auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array; @@ -64,7 +64,7 @@ static template configInDoc() { try { if (exists(conf_file)) { debug(io) { - writeln("in config file found: ", conf_file); + writeln("WARNING (io debug) in config file found: ", conf_file); } config_file_str = conf_file.readText; break; diff --git a/src/sdp/meta/rgx.d b/src/sdp/meta/rgx.d index c196ad2..fe9e36d 100644 --- a/src/sdp/meta/rgx.d +++ b/src/sdp/meta/rgx.d @@ -212,6 +212,7 @@ static template SiSUrgxInit() { static src_fn_find_inserts = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`); static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[ti])$`); static src_base_parent_dir_name = ctRegex!(`[/](?P<dir>(?:[a-zA-Z0-9._-]+))(?:/media/text/[a-z]{2})$`); // formalizes dir structure + static src_formalised_file_path_parts = ctRegex!(`(?P<pth>(?:[/a-zA-Z0-9._-]+?)(?P<dir>[a-zA-Z0-9._-]+))(?:/media/text/[a-z]{2})$`); // formalized dir structure /+ inline markup footnotes endnotes +/ static inline_notes_al = ctRegex!(`【(?:[*+]\s+|\s*)(.+?)】`, "mg"); static inline_notes_al_gen = ctRegex!(`【.+?】`, "m"); |