diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-11-29 18:37:41 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 23920cdf33513ead479801568735f4d6545422aa (patch) | |
tree | 6be80cc175d8d32fde9aeb6488f76b5d7dc87723 /src/sdp/meta | |
parent | paths, manifest (diff) |
0.21.0 paths, pod manifest source alternativedoc-reform_v0.0.21
- sisupod.manifest
- list alternative processable files with paths
e.g.:
media/text/en/live-manual.ssm
media/text/fr/live-manual.ssm
...
- name file followed by list of language codes
e.g.:
live-manual.ssm
en, ca, de, es, fr, it, ja, pl, ro
live-manual_next.ssm
en, de, es, fr, it, ja
Diffstat (limited to 'src/sdp/meta')
-rw-r--r-- | src/sdp/meta/metadoc.d | 35 | ||||
-rw-r--r-- | src/sdp/meta/rgx.d | 7 |
2 files changed, 29 insertions, 13 deletions
diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d index f36af09..b028f8d 100644 --- a/src/sdp/meta/metadoc.d +++ b/src/sdp/meta/metadoc.d @@ -31,13 +31,13 @@ template SiSUabstraction() { enum makeMeta { make, meta } enum docAbst { doc_abstraction, section_keys, segnames, segnames_0_4, images } static auto rgx = Rgx(); - auto SiSUabstraction(Fn,O,E)( - Fn fn_src, + auto SiSUabstraction(M,O,E)( + M _manifest, O _opt_action, - E env, + E _env, ){ - auto sdl_root_config_share = configRead!()("config_share", env); - auto sdl_root_config_local = configRead!()("config_local", env); + auto sdl_root_config_share = configRead!()("config_share", _env); + auto sdl_root_config_local = configRead!()("config_local", _env); auto conf_files_composite_make = confFilesSDLtoStruct!()(sdl_root_config_share, sdl_root_config_local); /+ ↓ read file (filename with path) +/ /+ ↓ file tuple of header and content +/ @@ -45,7 +45,7 @@ template SiSUabstraction() { writeln(__LINE__, ":", __FILE__, ": step1 commence → (get document header & body & insert files)"); } auto _header_body_inserts = - SiSUrawMarkupContent!()(fn_src); + SiSUrawMarkupContent!()(_manifest.src_fn); static assert(!isTypeTuple!(_header_body_inserts)); static assert(_header_body_inserts.length==3); debug(steps) { @@ -106,25 +106,29 @@ template SiSUabstraction() { return _k; } auto source_filename() { - string _k = fn_src; + string _k = _manifest.src_fn; return _k; } auto src_path_info() { - string _pwd = env["pwd"]; - auto _k = SiSUpathsSRC!()(_pwd, fn_src); + string _pwd = _env["pwd"]; + auto _k = SiSUpathsSRC!()(_pwd, _manifest.src_fn); return _k; } auto opt_action() { + /+ getopt options, commandline instructions, raw + - processing instructions --epub --html etc. + - command line config instructions --output-path + +/ auto _k = _opt_action; return _k; } auto environment() { - auto _k = env; + auto _k = _env; return _k; } auto language() { string _k; - if (auto m = fn_src.match(rgx.language_code_and_filename)) { + if (auto m = (_manifest.src_fn).match(rgx.language_code_and_filename)) { _k = m.captures[1]; } else { _k = "en"; @@ -135,6 +139,15 @@ template SiSUabstraction() { string[] _k = _header_body_inserts[headBody.insert_filelist]; return _k; } + auto pod_manifest() { + /+ extensive information on + - source processing paths + - repetition of opt_action with additional processing, including + - output path if any + +/ + auto _k = _manifest; + return _k; + } auto image_list() { auto _k = _images; return _k; diff --git a/src/sdp/meta/rgx.d b/src/sdp/meta/rgx.d index 70f48bb..73f7bfe 100644 --- a/src/sdp/meta/rgx.d +++ b/src/sdp/meta/rgx.d @@ -197,10 +197,13 @@ static template SiSUrgxInit() { static nbsp_and_space = ctRegex!(` [ ]`, "mg"); static nbsp_char_and_space = ctRegex!(`░[ ]`, "mg"); static src_pth = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])$`); - static src_pth_contents = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+)/sisudoc[.]txt$`); + static src_pth_contents = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+)/sisupod[.]manifest$`); static src_pth_zip = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.]zip)$`); static src_pth_unzip_pod = ctRegex!(`^(?P<path>media/text/[a-z]{2}/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`); - static src_pth_types = ctRegex!(`^(?P<path>[/]?[a-zA-Z0-9._-]+/)*(?P<gotfile>(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])|(?P<filelist>[a-zA-Z0-9._-]+/sisudoc[.]txt)|(?P<filezip>[a-zA-Z0-9._-]+[.]zip))$`); + static src_pth_types = + ctRegex!(`^(?P<path>[/]?[a-zA-Z0-9._-]+/)*(?P<gotfile>(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])|(?P<filelist>[a-zA-Z0-9._-]+/sisupod[.]manifest)|(?P<filezip>[a-zA-Z0-9._-]+[.]zip))$`); + static pod_content_location = + ctRegex!(`^(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])(?P<languages>(?:\s+[a-z]{2}(?:,|$))+)`, "mg"); static src_fn = ctRegex!(`^([/]?(?:[a-zA-Z0-9._-]+/)*)(?P<fn_src>(?P<fn_base>[a-zA-Z0-9._-]+)[.](?P<fn_src_suffix>ss[tm]))$`); static src_fn_master = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssm)$`); |