aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/abstraction.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-02-18 12:42:01 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitf0c4dcbc6b00dd66b115bd27953b7e54710b6ae3 (patch)
treef76801fa9b6608e52098b0425131326845c9cfe7 /src/sdp/abstraction.d
parent0.13.2 ref scope (return) (diff)
0.13.3 tuples, sdp & doc_abstraction (flag marked up links & endnotes)
Diffstat (limited to 'src/sdp/abstraction.d')
-rw-r--r--src/sdp/abstraction.d46
1 files changed, 22 insertions, 24 deletions
diff --git a/src/sdp/abstraction.d b/src/sdp/abstraction.d
index 380be1d..77a5512 100644
--- a/src/sdp/abstraction.d
+++ b/src/sdp/abstraction.d
@@ -34,11 +34,9 @@ template SiSUabstraction() {
mixin SiSUbiblio;
mixin SiSUrgxInitFlags;
mixin outputHub;
- // auto sdl_root_configuration = ConfigHub!()("conf.sdl", env);
- // auto sdl_root_doc_make = ConfigHub!()("sisu_document_make", env);
- // auto confsdl = HeaderExtractSDL();
- // auto conf_settings_aa = confsdl.configSettingsSDLangToAAmake(sdl_root_configuration);
- // auto conf_doc_make_aa = confsdl.documentMakeSDLangToAAmake(sdl_root_doc_make);
+ enum headBody { header, body_content, insert_filelist }
+ enum makeMeta { make, meta }
+ enum docAbst { doc_abstraction, section_keys, segnames, images }
auto rgx = Rgx();
auto SiSUabstraction(Fn,O,E)(Fn fn_src, O opts, E env){
auto sdl_root_configuration = ConfigHub!()("conf.sdl", env);
@@ -48,33 +46,33 @@ template SiSUabstraction() {
auto conf_doc_make_aa = confsdl.documentMakeSDLangToAAmake(sdl_root_doc_make);
/+ ↓ read file (filename with path) +/
/+ ↓ file tuple of header and content +/
- auto _0_header_1_body_content_2_insert_filelist_tuple =
+ auto _header_body_inserts =
SiSUrawMarkupContent!()(fn_src);
- static assert(!isTypeTuple!(_0_header_1_body_content_2_insert_filelist_tuple));
- static assert(_0_header_1_body_content_2_insert_filelist_tuple.length==3);
+ static assert(!isTypeTuple!(_header_body_inserts));
+ static assert(_header_body_inserts.length==3);
debug(header_and_body) {
writeln(header);
- writeln(_0_header_1_body_content_2_insert_filelist_tuple.length);
- writeln(_0_header_1_body_content_2_insert_filelist_tuple.length[1][0]);
+ writeln(_header_body_inserts.length);
+ writeln(_header_body_inserts.length[headBody.body_content][0]);
}
/+ ↓ split header into make and meta +/
- auto _0_make_1_dochead_meta_tuple =
- SiSUheaderExtractHub!()(_0_header_1_body_content_2_insert_filelist_tuple[0], conf_doc_make_aa);
- static assert(!isTypeTuple!(_0_make_1_dochead_meta_tuple));
- static assert(_0_make_1_dochead_meta_tuple.length==2);
+ auto _make_and_meta =
+ SiSUheaderExtractHub!()(_header_body_inserts[headBody.header], conf_doc_make_aa);
+ static assert(!isTypeTuple!(_make_and_meta));
+ static assert(_make_and_meta.length==2);
/+ ↓ document abstraction: process document, return abstraction as tuple +/
auto da = SiSUdocAbstraction!()(
- (_0_header_1_body_content_2_insert_filelist_tuple[1]),
- (_0_make_1_dochead_meta_tuple[0]),
- (_0_make_1_dochead_meta_tuple[1]),
+ (_header_body_inserts[headBody.body_content]),
+ (_make_and_meta[makeMeta.make]),
+ (_make_and_meta[makeMeta.meta]),
opts
);
static assert(!isTypeTuple!(da));
static assert(da.length==4);
- auto doc_abstraction = da[0]; // head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~blurb;
- string[][string] _document_section_keys_sequenced = da[1];
- string[] _doc_html_segnames = da[2];
- auto _images = da[3];
+ auto doc_abstraction = da[docAbst.doc_abstraction]; // head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~blurb;
+ string[][string] _document_section_keys_sequenced = da[docAbst.section_keys];
+ string[] _doc_html_segnames = da[docAbst.segnames];
+ auto _images = da[docAbst.images];
struct DocumentMatters {
string[] keys_seq_seg() {
string[] _k = _document_section_keys_sequenced["seg"];
@@ -89,11 +87,11 @@ template SiSUabstraction() {
return _k;
}
auto dochead_make() {
- string[string][string] _k = _0_make_1_dochead_meta_tuple[0];
+ string[string][string] _k = _make_and_meta[makeMeta.make];
return _k;
}
auto dochead_meta() {
- string[string][string] _k = _0_make_1_dochead_meta_tuple[1];
+ string[string][string] _k = _make_and_meta[makeMeta.meta];
return _k;
}
auto source_filename() {
@@ -110,7 +108,7 @@ template SiSUabstraction() {
return _k;
}
auto file_insert_list() {
- string[] _k = _0_header_1_body_content_2_insert_filelist_tuple[2];
+ string[] _k = _header_body_inserts[headBody.insert_filelist];
return _k;
}
auto image_list() {