From 41139a3438a6dfd3f52ed4cd3e0e7e70ffb01f96 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 4 Mar 2016 15:06:34 -0500 Subject: track --- org/ao_abstract_doc_source.org | 4 +- org/ao_assertions.org | 4 +- org/ao_defaults.org | 4 +- org/ao_emitters_and_interfaces.org | 4 +- org/ao_markup_source_raw.org | 98 -------------------------------------- org/ao_object_setter.org | 4 +- org/ao_output_debugs.org | 4 +- org/ao_read_markup_source.org | 98 ++++++++++++++++++++++++++++++++++++++ org/ao_rgx.org | 4 +- org/ao_scan_inserts.org | 4 +- org/ao_utils.org | 4 +- org/sdp.org | 23 ++++++--- 12 files changed, 133 insertions(+), 122 deletions(-) delete mode 100644 org/ao_markup_source_raw.org create mode 100644 org/ao_read_markup_source.org (limited to 'org') diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index ea334a9..6694fa0 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * document abstraction :abstract: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] Process markup document, create document abstraction. ** initialize #+name: abs_init diff --git a/org/ao_assertions.org b/org/ao_assertions.org index a253e33..b041541 100644 --- a/org/ao_assertions.org +++ b/org/ao_assertions.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * assertions :mixin:assert: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ** mixin template: assertions on markup document structure :doc_structure: #+name: ao_assertions #+BEGIN_SRC d :exports none diff --git a/org/ao_defaults.org b/org/ao_defaults.org index 73dba74..27039c7 100644 --- a/org/ao_defaults.org +++ b/org/ao_defaults.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * defaults :template:defaults: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ** template: header :header: #+name: ao_defaults_templates #+BEGIN_SRC d :exports none diff --git a/org/ao_emitters_and_interfaces.org b/org/ao_emitters_and_interfaces.org index 3ef1dff..0f80bc9 100644 --- a/org/ao_emitters_and_interfaces.org +++ b/org/ao_emitters_and_interfaces.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * emitters & interfaces -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ao_interface.d ao_emitter.d various emitters and their interfaces (where available) diff --git a/org/ao_markup_source_raw.org b/org/ao_markup_source_raw.org deleted file mode 100644 index 5923116..0000000 --- a/org/ao_markup_source_raw.org +++ /dev/null @@ -1,98 +0,0 @@ -#+TITLE: sdp markup source raw -#+AUTHOR: Ralph Amissah -#+EMAIL: ralph.amissah@gmail.com -#+STARTUP: indent -#+LANGUAGE: en -#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil -:t f:t *:t <:t -#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc -#+OPTIONS: author:nil email:nil creator:nil timestamp:nil -#+OPTIONS: ^:nil _:nil -#+EXPORT_SELECT_TAGS: export -#+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: -#+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) - -* markup source raw :markup: -[[./sdp.org][sdp]] - -** source string :string: -#+name: ao_markup_source_raw -#+BEGIN_SRC d :exports none -final private string markupSourceString(in char[] fn_src) { - enforce( - exists(fn_src)!=0, - "file not found" - ); - string source_txt_str; - try { - if (exists(fn_src)) { - source_txt_str = readText(fn_src); // ok - } - } - catch (ErrnoException ex) { - // Handle errors - } - catch (UTFException ex) { - // Handle validation errors - } - catch (FileException ex) { - // Handle errors - } - std.utf.validate(source_txt_str); - return source_txt_str; -} -#+END_SRC - -** source line array :array: -#+name: ao_markup_source_raw -#+BEGIN_SRC d :exports none -final private char[][] markupSourceLineArray(in string src_text) { - char[][] source_line_arr = - split(cast(char[]) src_text, rgx.line_delimiter); - return source_line_arr; -} -#+END_SRC - -** insert source content raw line array :array: -#+name: ao_markup_source_raw -#+BEGIN_SRC d :exports none -final char[][] markupInsertSourceContentRawLineArray(in char[] fn_src) { - enforce( - match(fn_src, rgx.src_fn_find_inserts), - "not a sisu markup filename" - ); - auto source_txt_str = markupSourceString(fn_src); - auto source_line_arr = markupSourceLineArray(source_txt_str); - return source_line_arr; -} -#+END_SRC - -** source content raw line array :array: -#+name: ao_markup_source_raw -#+BEGIN_SRC d :exports none -final char[][] markupSourceContentRawLineArray(in char[] fn_src) { - enforce( - match(fn_src, rgx.src_pth), - "not a sisu markup filename" - ); - auto source_txt_str = markupSourceString(fn_src); - auto source_line_arr = markupSourceLineArray(source_txt_str); - return source_line_arr; -} -#+END_SRC - -* tangles :tangle: -** code structure: :ao_markup_source_raw.d: -#+name: tangle_ao_markup_source_raw -#+BEGIN_SRC d :tangle ../lib/sdp/ao_markup_source_raw.d :padline no :exports none :noweb yes -/* - markup source raw - ao_markup_source_raw.d -*/ -mixin template SiSUmarkupRaw() { - class MarkupRaw { - auto rgx = new Rgx(); - <> - } -} -#+END_SRC diff --git a/org/ao_object_setter.org b/org/ao_object_setter.org index 836e14a..f6b9322 100644 --- a/org/ao_object_setter.org +++ b/org/ao_object_setter.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * object setter :object:set: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ** struct :struct: #+name: ao_object_setter #+BEGIN_SRC d :exports none diff --git a/org/ao_output_debugs.org b/org/ao_output_debugs.org index ecad21f..4891df9 100644 --- a/org/ao_output_debugs.org +++ b/org/ao_output_debugs.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * output debugs :debug:output: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ** (parent) :parent: #+name: ao_output_debugs #+BEGIN_SRC d :exports none diff --git a/org/ao_read_markup_source.org b/org/ao_read_markup_source.org new file mode 100644 index 0000000..d6cb0dc --- /dev/null +++ b/org/ao_read_markup_source.org @@ -0,0 +1,98 @@ +#+TITLE: sdp read markup source +#+AUTHOR: Ralph Amissah +#+EMAIL: ralph.amissah@gmail.com +#+STARTUP: indent +#+LANGUAGE: en +#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil -:t f:t *:t <:t +#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc +#+OPTIONS: author:nil email:nil creator:nil timestamp:nil +#+OPTIONS: ^:nil _:nil +#+EXPORT_SELECT_TAGS: export +#+EXPORT_EXCLUDE_TAGS: noexport +#+FILETAGS: :sdp:rel:ao: +#+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) + +* read markup source :markup: +[[./sdp.org][sdp]] [[./][org/]] + +** source string :string: +#+name: ao_read_markup_source +#+BEGIN_SRC d :exports none +final private string markupSourceString(in char[] fn_src) { + enforce( + exists(fn_src)!=0, + "file not found" + ); + string source_txt_str; + try { + if (exists(fn_src)) { + source_txt_str = readText(fn_src); // ok + } + } + catch (ErrnoException ex) { + // Handle errors + } + catch (UTFException ex) { + // Handle validation errors + } + catch (FileException ex) { + // Handle errors + } + std.utf.validate(source_txt_str); + return source_txt_str; +} +#+END_SRC + +** source line array :array: +#+name: ao_read_markup_source +#+BEGIN_SRC d :exports none +final private char[][] markupSourceLineArray(in string src_text) { + char[][] source_line_arr = + split(cast(char[]) src_text, rgx.line_delimiter); + return source_line_arr; +} +#+END_SRC + +** insert source content raw line array :array: +#+name: ao_read_markup_source +#+BEGIN_SRC d :exports none +final char[][] markupInsertSourceContentRawLineArray(in char[] fn_src) { + enforce( + match(fn_src, rgx.src_fn_find_inserts), + "not a sisu markup filename" + ); + auto source_txt_str = markupSourceString(fn_src); + auto source_line_arr = markupSourceLineArray(source_txt_str); + return source_line_arr; +} +#+END_SRC + +** source content raw line array :array: +#+name: ao_read_markup_source +#+BEGIN_SRC d :exports none +final char[][] markupSourceContentRawLineArray(in char[] fn_src) { + enforce( + match(fn_src, rgx.src_pth), + "not a sisu markup filename" + ); + auto source_txt_str = markupSourceString(fn_src); + auto source_line_arr = markupSourceLineArray(source_txt_str); + return source_line_arr; +} +#+END_SRC + +* tangles :tangle: +** code structure: :ao_read_markup_source.d: +#+name: tangle_ao_read_markup_source +#+BEGIN_SRC d :tangle ../lib/sdp/ao_read_markup_source.d :padline no :exports none :noweb yes +/* + read markup source + ao_read_markup_source.d +*/ +mixin template SiSUmarkupRaw() { + class MarkupRaw { + auto rgx = new Rgx(); + <> + } +} +#+END_SRC diff --git a/org/ao_rgx.org b/org/ao_rgx.org index eecad70..39767eb 100644 --- a/org/ao_rgx.org +++ b/org/ao_rgx.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * regex :regex: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ** misc :misc: #+name: ao_rgx #+BEGIN_SRC d :exports none diff --git a/org/ao_scan_inserts.org b/org/ao_scan_inserts.org index f595ea5..5da6b0a 100644 --- a/org/ao_scan_inserts.org +++ b/org/ao_scan_inserts.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * inserts :inserts: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ** scan inserts (sub-document) source :scan_insert_src: *** scan subdoc source diff --git a/org/ao_utils.org b/org/ao_utils.org index 1cc3313..9f3bdb5 100644 --- a/org/ao_utils.org +++ b/org/ao_utils.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil#+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:ao: +#+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) * utils :utils: -[[./sdp.org][sdp]] +[[./sdp.org][sdp]] [[./][org/]] ** set colors for terminal :colors:terminal: #+name: ao_utils #+BEGIN_SRC d :exports none diff --git a/org/sdp.org b/org/sdp.org index 885f022..d93825f 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -9,11 +9,11 @@ #+OPTIONS: ^:nil _:nil #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:hub: +#+FILETAGS: :sdp:rel:hub: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) -* sdp.d sisu document parser :sdp.d: -[[../maker.org][maker.org makefile]] +* sdp.d sisu document parser +[[../maker.org][maker.org makefile]] [[./][org/]] Deal with imports. Take command line instructions and process files as instructed. @@ -22,7 +22,8 @@ Take command line instructions and process files as instructed. [[./ao_assertions.org][ao_assertions]] [[./ao_defaults.org][ao_defaults]] [[./ao_emitters_and_interfaces.org][ao_emitters_and_interfaces: ao_emitter; ao_interface]] -[[./ao_markup_source_raw.org][ao_markup_source_raw]] +[[./ao_read_markup_source.org][ao_read_markup_source]] +// [[./ao_read_markup_source.org][ao_read_markup_source]] [[./ao_object_setter.org][ao_object_setter]] [[./ao_output_debugs.org][ao_output_debugs]] [[./ao_rgx.org][ao_rgx]] @@ -54,7 +55,7 @@ import lib.sdp.ao_defaults, // sdp/ao_defaults.d lib.sdp.ao_emitter, // sdp/ao_emitter.d lib.sdp.ao_interface, // sdp/ao_interface.d - lib.sdp.ao_markup_source_raw, // sdp/ao_markup_source_raw.d + lib.sdp.ao_read_markup_source, // sdp/ao_read_markup_source.d lib.sdp.ao_object_setter, // sdp/ao_object_setter.d lib.sdp.ao_output_debugs, // sdp/ao_output_debugs.d lib.sdp.ao_rgx, // sdp/ao_rgx.d @@ -63,6 +64,7 @@ import // std.conv; import std.conv : to; #+END_SRC + ** argv [+3] :argv: *** argv mixins & init #+name: sdp_argv @@ -116,6 +118,7 @@ scope(failure) { // writeln("1"); } #+END_SRC + *** argv loop #+name: sdp_argv #+BEGIN_SRC d :exports none @@ -129,6 +132,7 @@ foreach(cmdlnins; argv) { } } #+END_SRC + *** each file [+2] :file: **** filename provided [+1] ***** scope :scope: @@ -161,8 +165,9 @@ enforce( "not a sisu markup filename" ); #+END_SRC + ***** read file :file:read: -[[./ao_markup_source_raw.org][ao_markup_source_raw]] +[[./ao_read_markup_source.org][ao_read_markup_source]] #+name: sdp_each_file_do #+BEGIN_SRC d :exports none @@ -180,6 +185,7 @@ debug(insert) { writeln(m.captures[2]); } #+END_SRC + ****** incorporate any inserts [[./ao_scan_inserts.org][ao_scan_inserts]] @@ -202,6 +208,7 @@ debug(raw) { } } #+END_SRC + ***** send for processing :processing: #+name: sdp_each_file_do #+BEGIN_SRC d :exports none @@ -217,6 +224,7 @@ auto bookindex_unordered_hashes = t[3]; auto biblio = t[4]; // destroy(t); #+END_SRC + ***** debug document parts (checkdoc) #+name: sdp_each_file_do #+BEGIN_SRC d :exports none @@ -235,6 +243,7 @@ debug(checkdoc) { // compose abstract document markup state // append book index #+END_SRC + ***** on exit #+name: sdp_each_file_do #+BEGIN_SRC d :exports none @@ -249,6 +258,7 @@ scope(exit) { destroy(biblio); } #+END_SRC + **** no filename provided #+name: sdp_no_filename_provided #+BEGIN_SRC d :exports none @@ -257,6 +267,7 @@ writeln("no recognized filename"); break; // terminate, stop #+END_SRC + * tangles :tangle: ** code structure :sdp.d: #+name: tangle_sdp -- cgit v1.2.3