From 4f20bd5582bc9ed864f0e43f030a4e76259cf6f0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 29 Jan 2017 16:54:15 -0500 Subject: org file reorganise --- org/ao_read_source_files.org | 214 +++++++++++++++++++++---------------------- 1 file changed, 107 insertions(+), 107 deletions(-) (limited to 'org/ao_read_source_files.org') diff --git a/org/ao_read_source_files.org b/org/ao_read_source_files.org index f537e6a..24b95e4 100644 --- a/org/ao_read_source_files.org +++ b/org/ao_read_source_files.org @@ -13,9 +13,8 @@ #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 0. Code Skeleton / Outline / Structure (tangles) :tangle: -** 1. config files (conf.sdl & sisu_document_make) :ao_config_files: -*** config files, read in +* 1. get config file :config: +** 0. config files, read in #+BEGIN_SRC d :tangle ../src/sdp/ao_read_config_files.d /++ @@ -30,108 +29,6 @@ template ConfigIn() { } #+END_SRC -*** config files get sdlang root tag - -#+BEGIN_SRC d :tangle ../src/sdp/ao_read_config_files.d -/+ - -+/ -template ConfigSDLang() { - import sdlang; - <> - <> -} -#+END_SRC - -** 2. ao_markup_source_raw.d: :ao_markup_source_raw: - -#+BEGIN_SRC d :tangle ../src/sdp/ao_read_source_files.d -/++ - module ao_read_source_files;
- - open markup files
- - if master file scan for addional files to import/insert -+/ -template SiSUmarkupRaw() { - private import - ao_rgx; - <> - 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(); - auto source_txt_str = - raw.markupSourceReadIn(fn_src); - return source_txt_str; - } - final auto sourceContentSplitIntoHeaderAndBody(in string source_txt_str, in string fn_src="") { - auto raw = MarkupRawUnit(); - string[] insert_file_list; - auto t = - raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str); - auto header_raw = t[0]; - auto sourcefile_body_content = t[1]; - if (match(fn_src, rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise - auto ins = Inserts(); - auto tu = - ins.scan_master_src_for_insert_files_and_import_content(sourcefile_body_content, fn_src); - static assert(!isTypeTuple!(tu)); - sourcefile_body_content = tu[0]; - insert_file_list = tu[1].dup; - } - t = tuple( - header_raw, - sourcefile_body_content, - insert_file_list - ); - static assert(t.length==3); - return t; - } - } - struct MarkupRawUnit { - private import std.file; - <> - <> - <> - <> - <> - <> - } - struct Inserts { - private import ao_defaults; // ao_defaults.d - auto scan_subdoc_source( - char[][] markup_sourcefile_insert_content, - string fn_src - ) { - mixin SiSUrgxInitFlags; - <> - foreach (line; markup_sourcefile_insert_content) { - <> - } // end src subdoc (inserts) loop - <> - } - auto scan_master_src_for_insert_files_and_import_content( - char[][] sourcefile_body_content, - string fn_src - ) { - mixin SiSUrgxInitFlags; - <> - foreach (line; sourcefile_body_content) { - <> - } // end src doc loop - <> - } - } -} -#+END_SRC - -* 1. get config file :config: ** read config file, source string (conf.sdl & sisu_document_make) :file:config: #+name: ao_config_file_in @@ -171,6 +68,20 @@ final string ConfigIn(C,E)(C conf_sdl, E env) { } #+END_SRC +** 0. config files get sdlang root tag + +#+BEGIN_SRC d :tangle ../src/sdp/ao_read_config_files.d +/+ + ++/ +template ConfigSDLang() { + import sdlang; + <> + <> +} +#+END_SRC + + ** config file get sdl root tag :file:conf:sdlang: #+name: ao_config_file_sdlang @@ -200,7 +111,6 @@ auto ConfigSDLang(string configuration, string conf_sdl_filename) { #+BEGIN_SRC d :tangle ../src/sdp/ao_read_config_files.d /+ - +/ template ConfigHub() { <> @@ -231,7 +141,6 @@ private import std.conv : to; #+END_SRC - *** config hub import sdlang #+name: ao_config_file_import_mixin #+BEGIN_SRC d @@ -250,6 +159,95 @@ final auto ConfigHub(C,E)(C conf_sdl, E env) { #+END_SRC * 2. get markup source, read file + +** 0. ao_markup_source_raw.d: :ao_markup_source_raw: + +#+BEGIN_SRC d :tangle ../src/sdp/ao_read_source_files.d +/++ + module ao_read_source_files;
+ - open markup files
+ - if master file scan for addional files to import/insert ++/ +template SiSUmarkupRaw() { + private import + ao_rgx; + <> + 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(); + auto source_txt_str = + raw.markupSourceReadIn(fn_src); + return source_txt_str; + } + final auto sourceContentSplitIntoHeaderAndBody(in string source_txt_str, in string fn_src="") { + auto raw = MarkupRawUnit(); + string[] insert_file_list; + auto t = + raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str); + auto header_raw = t[0]; + auto sourcefile_body_content = t[1]; + if (match(fn_src, rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise + auto ins = Inserts(); + auto tu = + ins.scan_master_src_for_insert_files_and_import_content(sourcefile_body_content, fn_src); + static assert(!isTypeTuple!(tu)); + sourcefile_body_content = tu[0]; + insert_file_list = tu[1].dup; + } + t = tuple( + header_raw, + sourcefile_body_content, + insert_file_list + ); + static assert(t.length==3); + return t; + } + } + struct MarkupRawUnit { + private import std.file; + <> + <> + <> + <> + <> + <> + } + struct Inserts { + private import ao_defaults; + auto scan_subdoc_source( + char[][] markup_sourcefile_insert_content, + string fn_src + ) { + mixin SiSUrgxInitFlags; + <> + foreach (line; markup_sourcefile_insert_content) { + <> + } // end src subdoc (inserts) loop + <> + } + auto scan_master_src_for_insert_files_and_import_content( + char[][] sourcefile_body_content, + string fn_src + ) { + mixin SiSUrgxInitFlags; + <> + foreach (line; sourcefile_body_content) { + <> + } // end src doc loop + <> + } + } +} +#+END_SRC + ** get markup source, read file :source:markup: *** [#A] read file, source string :string: @@ -558,3 +556,5 @@ auto t = tuple( ); return t; #+END_SRC + +* 3. config files (conf.sdl & sisu_document_make) :ao_config_files: -- cgit v1.2.3