aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ao_read_source_files.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-01-29 16:54:15 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit4f20bd5582bc9ed864f0e43f030a4e76259cf6f0 (patch)
treebbbc5ba31d4154d154405c8be2de14b24b1b60e2 /org/ao_read_source_files.org
parent0.12.1 abstraction template (diff)
org file reorganise
Diffstat (limited to 'org/ao_read_source_files.org')
-rw-r--r--org/ao_read_source_files.org214
1 files changed, 107 insertions, 107 deletions
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;
- <<imports_std>>
- <<ao_config_file_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;<BR>
- - open markup files<BR>
- - if master file scan for addional files to import/insert
-+/
-template SiSUmarkupRaw() {
- private import
- ao_rgx;
- <<imports_std>>
- 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;
- <<ao_markup_source_raw_read_file_source_string>>
- <<ao_markup_source_raw_doc_header_and_content_split>>
- <<ao_markup_source_raw_source_line_array>>
- <<ao_markup_source_raw_read_in_file>>
- <<ao_markup_source_raw_tuple_of_header_and_body>>
- <<ao_markup_source_raw_get_insert_source_line_array>>
- }
- struct Inserts {
- private import ao_defaults; // ao_defaults.d
- auto scan_subdoc_source(
- char[][] markup_sourcefile_insert_content,
- string fn_src
- ) {
- mixin SiSUrgxInitFlags;
- <<ao_inserts_scan>>
- foreach (line; markup_sourcefile_insert_content) {
- <<ao_inserts_scan_loop>>
- } // end src subdoc (inserts) loop
- <<ao_inserts_scan_post>>
- }
- auto scan_master_src_for_insert_files_and_import_content(
- char[][] sourcefile_body_content,
- string fn_src
- ) {
- mixin SiSUrgxInitFlags;
- <<ao_master_doc_scan_for_insert_filenames>>
- foreach (line; sourcefile_body_content) {
- <<ao_master_doc_scan_for_insert_filenames_loop>>
- } // end src doc loop
- <<ao_master_doc_scan_for_insert_filenames_post>>
- }
- }
-}
-#+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;
+ <<imports_std>>
+ <<ao_config_file_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() {
<<imports_std>>
@@ -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;<BR>
+ - open markup files<BR>
+ - if master file scan for addional files to import/insert
++/
+template SiSUmarkupRaw() {
+ private import
+ ao_rgx;
+ <<imports_std>>
+ 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;
+ <<ao_markup_source_raw_read_file_source_string>>
+ <<ao_markup_source_raw_doc_header_and_content_split>>
+ <<ao_markup_source_raw_source_line_array>>
+ <<ao_markup_source_raw_read_in_file>>
+ <<ao_markup_source_raw_tuple_of_header_and_body>>
+ <<ao_markup_source_raw_get_insert_source_line_array>>
+ }
+ struct Inserts {
+ private import ao_defaults;
+ auto scan_subdoc_source(
+ char[][] markup_sourcefile_insert_content,
+ string fn_src
+ ) {
+ mixin SiSUrgxInitFlags;
+ <<ao_inserts_scan>>
+ foreach (line; markup_sourcefile_insert_content) {
+ <<ao_inserts_scan_loop>>
+ } // end src subdoc (inserts) loop
+ <<ao_inserts_scan_post>>
+ }
+ auto scan_master_src_for_insert_files_and_import_content(
+ char[][] sourcefile_body_content,
+ string fn_src
+ ) {
+ mixin SiSUrgxInitFlags;
+ <<ao_master_doc_scan_for_insert_filenames>>
+ foreach (line; sourcefile_body_content) {
+ <<ao_master_doc_scan_for_insert_filenames_loop>>
+ } // end src doc loop
+ <<ao_master_doc_scan_for_insert_filenames_post>>
+ }
+ }
+}
+#+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: