diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-01-27 20:58:33 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | bc6971c1d19d4dcb80f872de6aa1f39a1584b738 (patch) | |
tree | da2364eb1a4166fd5bab76c06a33d52d61956139 | |
parent | header body insert_file_list, template (diff) |
read src file and split into head and body, template
-rw-r--r-- | org/ao_read_source_files.org | 13 | ||||
-rw-r--r-- | org/sdp.org | 4 | ||||
-rwxr-xr-x | src/sdp.d | 4 | ||||
-rw-r--r-- | src/sdp/ao_read_source_files.d | 13 |
4 files changed, 28 insertions, 6 deletions
diff --git a/org/ao_read_source_files.org b/org/ao_read_source_files.org index 350ee19..c362f9a 100644 --- a/org/ao_read_source_files.org +++ b/org/ao_read_source_files.org @@ -75,12 +75,25 @@ template SiSUconfigSDLangHub() { +/ template SiSUmarkupRaw() { private import + ao_rgx; + private import + std.array, std.exception, + std.path, std.regex, std.stdio, + std.traits, + std.typecons, std.utf, std.conv : to; + mixin SiSUrgxInit; auto rgx = Rgx(); + auto rawsrc = MarkupRaw(); + auto SiSUmarkupRaw(Fn)(Fn fn_src) { + auto _0_header_1_body_content_2_insert_filelist_tuple = + rawsrc.sourceContentSplitIntoHeaderAndBody(rawsrc.sourceContent(fn_src), fn_src); + return _0_header_1_body_content_2_insert_filelist_tuple; + } struct MarkupRaw { final sourceContent(in string fn_src) { auto raw = MarkupRawUnit(); diff --git a/org/sdp.org b/org/sdp.org index 48a4e12..86f0c98 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -190,7 +190,6 @@ mixin SiSUnode; mixin SiSUbiblio; mixin SiSUrgxInitFlags; mixin SiSUconfigSDLangHub; -mixin SiSUmarkupRaw; mixin outputHub; #+END_SRC @@ -198,7 +197,6 @@ mixin outputHub; #+NAME: sdp_args #+BEGIN_SRC d -auto raw = MarkupRaw(); /+ struct DocumentParts { string[string][] contents; @@ -381,7 +379,7 @@ enforce( /+ ↓ read file (filename with path) +/ /+ ↓ file tuple of header and content +/ auto _0_header_1_body_content_2_insert_filelist_tuple = - raw.sourceContentSplitIntoHeaderAndBody(raw.sourceContent(fn_src), fn_src); + SiSUmarkupRaw!()(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); debug(header_and_body) { @@ -48,9 +48,7 @@ void main(string[] args) { mixin SiSUbiblio; mixin SiSUrgxInitFlags; mixin SiSUconfigSDLangHub; - mixin SiSUmarkupRaw; mixin outputHub; - auto raw = MarkupRaw(); /+ struct DocumentParts { string[string][] contents; @@ -196,7 +194,7 @@ void main(string[] args) { /+ ↓ read file (filename with path) +/ /+ ↓ file tuple of header and content +/ auto _0_header_1_body_content_2_insert_filelist_tuple = - raw.sourceContentSplitIntoHeaderAndBody(raw.sourceContent(fn_src), fn_src); + SiSUmarkupRaw!()(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); debug(header_and_body) { diff --git a/src/sdp/ao_read_source_files.d b/src/sdp/ao_read_source_files.d index f25ed7e..c7616a2 100644 --- a/src/sdp/ao_read_source_files.d +++ b/src/sdp/ao_read_source_files.d @@ -5,12 +5,25 @@ +/ template SiSUmarkupRaw() { private import + ao_rgx; + private import + std.array, std.exception, + std.path, std.regex, std.stdio, + std.traits, + std.typecons, std.utf, std.conv : to; + mixin SiSUrgxInit; auto rgx = Rgx(); + auto rawsrc = MarkupRaw(); + auto SiSUmarkupRaw(Fn)(Fn fn_src) { + auto _0_header_1_body_content_2_insert_filelist_tuple = + rawsrc.sourceContentSplitIntoHeaderAndBody(rawsrc.sourceContent(fn_src), fn_src); + return _0_header_1_body_content_2_insert_filelist_tuple; + } struct MarkupRaw { final sourceContent(in string fn_src) { auto raw = MarkupRawUnit(); |