diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-07-13 07:44:03 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 22cea68385b57a1593f5751e49cfdd41d8067997 (patch) | |
tree | 9e61339eb58679977c24962b1cfd2f50aa7f2998 /org | |
parent | sdl extract and composite conf (make) (diff) |
0.18.0 rename meta from ao (considered adr)
Diffstat (limited to 'org')
-rw-r--r-- | org/default_misc.org | 38 | ||||
-rw-r--r-- | org/default_paths.org | 8 | ||||
-rw-r--r-- | org/default_regex.org | 62 | ||||
-rw-r--r-- | org/imports.org | 14 | ||||
-rw-r--r-- | org/meta_abstraction.org (renamed from org/ao_doc_abstraction.org) | 643 | ||||
-rw-r--r-- | org/meta_conf_make_meta.org (renamed from org/ao_conf_make_meta.org) | 62 | ||||
-rw-r--r-- | org/meta_debugs.org (renamed from org/ao_debugs.org) | 76 | ||||
-rw-r--r-- | org/meta_read_source_files.org (renamed from org/ao_read_source_files.org) | 96 | ||||
-rw-r--r-- | org/output_xmls_css.org | 4 | ||||
-rw-r--r-- | org/sdp.org | 290 |
10 files changed, 775 insertions, 518 deletions
diff --git a/org/default_misc.org b/org/default_misc.org index 4fe8a7b..993d2a0 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -11,33 +11,33 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:ao: +#+FILETAGS: :sdp:rel:meta: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 0. ao defaults :module:sdp:ao_defaults: +* 0. meta defaults :module:sdp:meta_defaults: ** 0. module template #+name: tangle_defaults -#+BEGIN_SRC d :tangle ../src/sdp/ao/defaults.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/defaults.d /++ default settings +/ -module sdp.ao.defaults; +module sdp.meta.defaults; template SiSUregisters() { - <<ao_defaults_imports>> - <<ao_defaults_template_registers>> + <<meta_defaults_imports>> + <<meta_defaults_template_registers>> } -<<ao_defaults_template_init_flags>> -<<ao_defaults_template_node>> -<<ao_defaults_template_biblio>> +<<meta_defaults_template_init_flags>> +<<meta_defaults_template_node>> +<<meta_defaults_template_biblio>> <<defaults_template_markup>> <<defaults_template_language_codes>> #+END_SRC ** imports -#+name: ao_defaults_imports +#+name: meta_defaults_imports #+BEGIN_SRC d import std.algorithm, @@ -63,7 +63,7 @@ import ** settings metadata associative array indexes :settings: **** conf associative array -#+name: ao_defaults_template_registers +#+name: meta_defaults_template_registers #+BEGIN_SRC d string[string][string] conf_aa_empty() { auto conf_ = [ @@ -144,7 +144,7 @@ string[string][string] conf_aa_empty() { **** meta (metadata) associative array -#+name: ao_defaults_template_registers +#+name: meta_defaults_template_registers #+BEGIN_SRC d string[string][string] meta_aa_empty() { auto meta_ = [ @@ -212,7 +212,7 @@ string[string][string] meta_aa_empty() { ** metadata associative array indexes :header: -#+name: ao_defaults_template_registers +#+name: meta_defaults_template_registers #+BEGIN_SRC d auto ptr_head_main = [ @@ -310,7 +310,7 @@ auto config_jsonstr = `{ *** notes headers -#+name: ao_defaults_template +#+name: meta_defaults_template #+BEGIN_SRC d /+ /+ @@ -390,7 +390,7 @@ header. ** template: flags regex initialize :regex_flags: -#+name: ao_defaults_template_init_flags +#+name: meta_defaults_template_init_flags #+BEGIN_SRC d template SiSUrgxInitFlags() { /+ regex flags +/ @@ -434,7 +434,7 @@ template SiSUrgxInitFlags() { } #+END_SRC -#+name: ao_defaults_template_node +#+name: meta_defaults_template_node #+BEGIN_SRC d template SiSUnode() { string[string] node_metadata_heading_str() { @@ -482,7 +482,7 @@ template SiSUnode() { ** template: bibliography :biblio: -#+name: ao_defaults_template_biblio +#+name: meta_defaults_template_biblio #+BEGIN_SRC d template SiSUbiblio() { // required: deemed_author (author || editor); year; fulltitle; @@ -562,7 +562,7 @@ import std.conv : to; #+END_SRC -* 2. defaults shared by ao & output (generic) +* 2. defaults shared by meta & output (generic) ** template: internal markup :markup: #+name: defaults_template_markup @@ -693,7 +693,7 @@ template SiSUlanguageCodes() { * +set colors for terminal+ (unused) :colors:terminal: -#+name: ao_ansi_colors +#+name: meta_ansi_colors #+BEGIN_SRC d string[string] scr_txt_color = [ "off" : "\033[0m", diff --git a/org/default_paths.org b/org/default_paths.org index 3a250a0..2a414bd 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -11,7 +11,7 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:file:path: +#+FILETAGS: :sdp:rel:path:file: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] @@ -22,14 +22,14 @@ /++ read configuration files<BR> - read config files<BR> - ao_config_files.d + meta_config_files.d +/ module sdp.output.paths_source; import std.array, std.path, std.regex, std.stdio; -import sdp.ao.rgx; +import sdp.meta.rgx; template SiSUpathsSRC() { mixin SiSUrgxInit; auto rgx = Rgx(); @@ -93,7 +93,7 @@ import std.array, std.path, std.regex, std.stdio; -import sdp.ao.rgx; +import sdp.meta.rgx; <<template_paths_sisupod>> <<template_paths_sisupod_zipped_archive>> <<template_paths_sisupod_unzipped_filesystem>> diff --git a/org/default_regex.org b/org/default_regex.org index e1f8d26..95167b4 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -11,11 +11,11 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:ao: +#+FILETAGS: :sdp:rel:meta: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 0. ao ctRegex :module:sdp:ao_rgx: +* 0. meta ctRegex :module:sdp:meta_rgx: [[./sdp.org][sdp]] [[./][org/]] http://dlang.org/phobos/std_regex.html - Plain string, in which case it's compiled to bytecode before matching. @@ -24,16 +24,16 @@ http://dlang.org/phobos/std_regex.html ** 0. module template -#+name: tangle_ao_rgx -#+BEGIN_SRC d :tangle ../src/sdp/ao/rgx.d +#+name: tangle_meta_rgx +#+BEGIN_SRC d :tangle ../src/sdp/meta/rgx.d /++ regex: regular expressions used in sisu document parser +/ -module sdp.ao.rgx; +module sdp.meta.rgx; template SiSUrgxInit() { - import sdp.ao.defaults; + import sdp.meta.defaults; struct Rgx { - <<ao_rgx>> + <<meta_rgx>> <<prgmkup_rgx>> } } @@ -41,7 +41,7 @@ template SiSUrgxInit() { ** misc :misc: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ misc +/ static true_dollar = ctRegex!(`\$`, "gm"); @@ -76,7 +76,7 @@ static numeric_col = ctRegex!(`^[ 0-9,.$£₤ ** comments :comment: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ comments +/ static comment = ctRegex!(`^%+ `); @@ -85,7 +85,7 @@ static comments = ctRegex!(`^%+ |^%+$`); ** config -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ header +/ static make_simple_substitutions_rb = ctRegex!(`(?P<substitution>/(?P<match>.+?)/,[ ]*['"](?P<replace>.+?)['"])`); @@ -95,7 +95,7 @@ static make_simple_substitutions_d = ctRegex!(`(?P<substitu ** native headers *** native header :native:header: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ header +/ static main_headers = @@ -114,7 +114,7 @@ static raw_author_munge = ctRegex!(`(\S.+?),\s+(.+ *** subheader :native:subheader: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ head +/ static native_subhead_creator = ctRegex!(`^(?:author|translator|illustrator)$`, "m"); @@ -131,7 +131,7 @@ static native_subhead_make = ctRegex!(`^(?:cover_imag ** heading & paragraph operators :paragraph:operator: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ heading & paragraph operators +/ static heading_a = ctRegex!(`^:?[A][~] `, "m"); @@ -162,7 +162,7 @@ static para_attribs = ctRegex!(`^_(?:(?:[0-9]) ** blocked markup *** blocked markup :block:tic: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ blocked markup +/ static block_open = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)|^[{]table(~h)?(?P<columns>(?:[ ]+[0-9]+;)+)[}]"); @@ -171,7 +171,7 @@ static block_poem_open = ctRegex!("^((poem[{].*?$ ** blocked markup tics :block:tic: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ blocked markup tics +/ static block_tic_open = ctRegex!("^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); // what of numbered code? @@ -186,7 +186,7 @@ static block_tic_close = ctRegex!("^(`{3})$","m") *** blocked markup curly :block:curly: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ blocked markup curly +/ static block_curly_open = ctRegex!(`^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)`); @@ -207,7 +207,7 @@ static block_curly_table_special_markup = ctRegex!(`^[{]table((~h) *** block sub-matches :block:curly: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d static table_head_instructions = ctRegex!(`(?P<c_heading>h)?(?:[ ]+c(?P<c_num>[0-9]);)?(?P<c_widths>(?:[ ]+[0-9]+[lr]?;)+)`); static table_col_widths_and_alignment = ctRegex!(`(?P<width>[0-9]+)(?P<align>[lr]?)`); @@ -220,7 +220,7 @@ static table_col_separator_nl = ctRegex!(`[┊]$`, "mg") ** inline markup footnotes endnotes :inline:footnote: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ inline markup footnotes endnotes +/ static inline_notes_curly_gen = ctRegex!(`~\{.+?\}~`, "m"); @@ -246,7 +246,7 @@ static note_ref = ctRegex!(`^\S+?noteref_( *** links/ urls :inline:footnote: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d static inline_url_generic = ctRegex!(`(?:^|[}(\[ ])(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_#]`, "mg"); static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]\S*)`, "mg"); @@ -258,14 +258,14 @@ static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P<c *** images :images: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d static image = ctRegex!(`([a-zA-Z0-9._-]+?\.(?:png|gif|jpg))`, "mg"); #+END_SRC *** inline markup book index :inline:bookindex: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ inline markup book index +/ static book_index = ctRegex!(`^=\{\s*(.+?)\}$`, "m"); @@ -275,7 +275,7 @@ static book_index_close = ctRegex!(`^(.*?)\}$`, "m ** no obj_cite_number object :ocn:off:object: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ no obj_cite_number object +/ static obj_cite_number_off = ctRegex!(`~#$`, "m"); @@ -285,7 +285,7 @@ static obj_cite_number_off_all = ctRegex!(`[~-]#$`, "m"); ** no obj_cite_number block :ocn:off:block: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ no obj_cite_number block +/ static obj_cite_number_off_block = ctRegex!(`^--~#$`); @@ -296,7 +296,7 @@ static obj_cite_number_block_marks = ctRegex!(`^--[+~-]#$`); ** ignore outside code blocks :block:code: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ ignore outside code blocks +/ static skip_from_regular_parse = ctRegex!(`^(--[+~-]#|-[\\]{2}-|=[.\\]{2}=)$`); @@ -304,7 +304,7 @@ static skip_from_regular_parse = ctRegex!(`^(--[+~-]#|-[\\]{2}-|=[.\\]{2}=)$` ** line & page breaks :break: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ line & page breaks +/ static break_line_within_object = ctRegex!(`[\\]{2}( |$)`); @@ -317,7 +317,7 @@ static parent = ctRegex!(`([0-7]):([0-9] ** json :json: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ json +/ static tailing_comma = ctRegex!(`,$`, "m"); @@ -325,7 +325,7 @@ static tailing_comma = ctRegex!(`,$`, "m"); ** biblio tags :biblio:tags: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ biblio tags +/ static biblio_tags = ctRegex!(`^(is|au|author_raw|author|author_arr|editor_raw|ed|editor_arr|ti|title|subtitle|fulltitle|lng|language|trans|src|jo|journal|in|vol|volume|edn|edition|yr|year|pl|place|pb|pub|publisher|url|pg|pages|note|short_name|id):\s+(.+)`); @@ -334,7 +334,7 @@ static biblio_abbreviations = ctRegex!(`^(au|ed|ti|lng ** bookindex split :bookindex:split: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ bookindex split +/ static bi_main_terms_split = ctRegex!(`\s*;\s*`); @@ -345,7 +345,7 @@ static bi_term_and_obj_cite_numbers_match = ctRegex!(`^(.+?)\+(\d+)` ** language codes :language:codes: -#+name: ao_rgx +#+name: meta_rgx #+BEGIN_SRC d /+ language codes +/ auto language_codes = @@ -363,7 +363,7 @@ http://dlang.org/phobos/std_regex.html ** 0. module template -#+name: tangle_ao_rgx +#+name: tangle_meta_rgx #+BEGIN_SRC d :tangle ../src/sdp/output/rgx.d /++ regex: regular expressions used in sisu document parser @@ -390,7 +390,7 @@ static xhtml_greater_than = ctRegex!(`[>]`); // > static xhtml_line_break = ctRegex!(` [\\]{2}`); // <br /> #+END_SRC -* 2. ctRegex defaults shared by ao & output (generic) +* 2. ctRegex defaults shared by meta & output (generic) ** misc generic #+name: prgmkup_rgx diff --git a/org/imports.org b/org/imports.org index a76cd3f..a67f24d 100644 --- a/org/imports.org +++ b/org/imports.org @@ -14,21 +14,21 @@ #+FILETAGS: :sdp:rel:imports: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) -* 1. imports for ao +* 1. imports for meta ** package dir -#+BEGIN_SRC d :tangle ../src/sdp/ao/package.d -module sdp.ao; -<<imports_for_ao_general>> +#+BEGIN_SRC d :tangle ../src/sdp/meta/package.d +module sdp.meta; +<<imports_for_meta_general>> #+END_SRC ** import list -#+NAME: imports_for_ao_general +#+NAME: imports_for_meta_general #+BEGIN_SRC d public import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; /+ std +/ public import std.array, diff --git a/org/ao_doc_abstraction.org b/org/meta_abstraction.org index dae2285..afc5eb1 100644 --- a/org/ao_doc_abstraction.org +++ b/org/meta_abstraction.org @@ -11,111 +11,22 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:ao: +#+FILETAGS: :sdp:rel:meta: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 0. the document notes -** abstraction -- abstract for downstream processing - - identify document structure and objects - - identify document structure (headings/levels/sections) - - identify objects - - set document, generate common abstraction for downstream parsing - - set different document sections, toc, body, endnotes, book index, etc. - - object numbers, heading/ chapter numbering etc, endnote numbers - - unify object representations - - multiple markups for same object type given single representation - - extract object attributes - - unify inline markup on objects - - inline markup made easier to identify - -- simplify downstream parsing - -** document sections - -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| -| front matter | head | | | | | | | -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| -| toc | toc | | | generated: headings | | | | -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| -| body | body | | | default section | | | | -| | | | | - heading | | | | -| | | | | - para | | | | -| | | | | - code | | | | -| | | | | - poem | | | | -| | | | | - group | | | | -| | | | | - block | | | | -| | | | | - quote | | | | -| | | | | - table | | | | -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| -| back matter | endnote | | | generated: inline note markup | | | | -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| -| | glossary | | | identified section, limited markup | | | | -| | | | | - the heading | | | | -| | | | | - paragraph | | | | -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| -| | bibliography | | | generated from inline special markup | | | | -| | | | | appended to paragraphs contained in body section | | | | -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| -| | blurb | | | identified section, limited markup | | | | -| | | | | - the heading | | | | -| | | | | - paragraphs | | | | -|--------------+--------------+---+---+--------------------------------------------------+---+---+---| - -** objects - -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| | | identified by | object notes | attributes | inline | embedded | special | -| | | | | | | appended | characters | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| para | heading | level markers | | | - italics | - endnotes | | -| | | at start of line | | | | - bibliography | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| | paragraph | delimited by two new lines | default object | - indent | - bold | - endnotes | | -| | | | [discard leading & | - bullet | - italics | - bibliography | | -| | | | newline whitespace] | | - underscore | | | -| | | | | | - strikethrough | | | -| | | | | | - superscript | | | -| | | | | | - subscript | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| block | | open and close tags | | | | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| TODO | quote | | | - language? | | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| TODO | group | | - inline markup applied | - language? | as paragraph | - endnotes | | -| | | | - [discard leading & | | | - bibliography | | -| | | | newline whitespace] | | | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| TODO | block | | - inline markup applied | | as paragraph | - endnotes | | -| | | | - whitespace indentation | | | - bibliography | | -| | | | & newlines | | | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| | poem / verse | open and close tags | verse is the object | | | - endnotes | | -| | | | - inline markup applied | | | - bibliography | | -| | | (for poem) | - whitespace indentation | | | | | -| | | | & newlines | | | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| | code | | - contents untouched | - syntax | | | | -| | | | - whitespace indentation | - numbered | | | | -| | | | & newlines | | | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| -| | table | | | - column width | | | | -| | | | | - heading row | | | | -|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| - -* 1. Document Abstraction :module:sdp:ao_abstract_doc_source: +* 1. Document Abstraction :module:sdp:meta_metadoc_from_src: Process markup document, create document abstraction. ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/abstract_doc_source.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/metadoc_from_src.d /++ document abstraction: abstraction of sisu markup for downstream processing - ao_abstract_doc_source.d + meta_metadoc_from_src.d +/ -module sdp.ao.abstract_doc_source; +module sdp.meta.metadoc_from_src; template SiSUdocAbstraction() { /+ ↓ abstraction imports +/ <<abs_top_imports>> @@ -195,32 +106,32 @@ template SiSUdocAbstraction() { <<abs_functions_table>> /+ abstraction functions ↑ +/ /+ ↓ abstraction function emitters +/ - <<ao_emitters_ocn>> + <<meta_emitters_ocn>> /+ +/ - <<ao_emitters_obj_inline_markup_munge>> - <<ao_emitters_obj_inline_markup>> - <<ao_emitters_obj_inline_markup_and_anchor_tags_and_misc>> - <<ao_emitters_obj_inline_markup_table_of_contents>> - <<ao_emitters_obj_inline_markup_private>> - <<ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags>> - <<ao_emitters_obj_inline_markup_close>> + <<meta_emitters_obj_inline_markup_munge>> + <<meta_emitters_obj_inline_markup>> + <<meta_emitters_obj_inline_markup_and_anchor_tags_and_misc>> + <<meta_emitters_obj_inline_markup_table_of_contents>> + <<meta_emitters_obj_inline_markup_private>> + <<meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags>> + <<meta_emitters_obj_inline_markup_close>> /+ +/ - <<ao_emitters_obj_attributes>> - <<ao_emitters_obj_attributes_public>> - <<ao_emitters_obj_attributes_private>> - <<ao_emitters_obj_attributes_private_an_attribute>> - <<ao_emitters_obj_attributes_private_json>> - <<ao_emitters_obj_attributes_private_close>> + <<meta_emitters_obj_attributes>> + <<meta_emitters_obj_attributes_public>> + <<meta_emitters_obj_attributes_private>> + <<meta_emitters_obj_attributes_private_an_attribute>> + <<meta_emitters_obj_attributes_private_json>> + <<meta_emitters_obj_attributes_private_close>> /+ +/ - <<ao_emitters_book_index_nugget>> - <<ao_emitters_book_index_report_indented>> - <<ao_emitters_book_index_report_section>> + <<meta_emitters_book_index_nugget>> + <<meta_emitters_book_index_report_indented>> + <<meta_emitters_book_index_report_section>> /+ +/ - <<ao_emitters_endnotes>> + <<meta_emitters_endnotes>> /+ +/ - <<ao_emitters_bibliography>> + <<meta_emitters_bibliography>> /+ +/ - <<ao_emitters_metadata>> + <<meta_emitters_metadata>> /+ abstraction functions emitters ↑ +/ /+ ↓ abstraction functions assertions +/ <<abs_functions_assertions>> @@ -231,11 +142,11 @@ template SiSUdocAbstraction() { ** 1. _pre loop processing_ :pre: *** imports :imports: -[[./ao_defaults.org][ao_defaults]] +[[./meta_defaults.org][meta_defaults]] #+name: abs_top_imports #+BEGIN_SRC d -import sdp.ao; +import sdp.meta; import std.algorithm, std.container, @@ -243,9 +154,9 @@ import std.json, std.path; import - sdp.ao.defaults, - sdp.ao.object_setter, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.object_setter, + sdp.meta.rgx; #+END_SRC *** mixins :mixins: @@ -320,57 +231,58 @@ enum DomTags { none, open, close, close_and_open, open_still, } #+name: abs_top_init_struct #+BEGIN_SRC d -void heading_ancestors(O)( - auto return ref O obj, - return ref string[] lv_ancestors, +auto obj_heading_ancestors(O)( + O obj, + string[] lv_ancestors_txt, ) { switch (obj.heading_lev_markup) { case 0: - lv_ancestors[0] = obj.text.to!string; + lv_ancestors_txt[0] = obj.text.to!string; foreach(k; 1..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 1: - lv_ancestors[1] = obj.text.to!string; + lv_ancestors_txt[1] = obj.text.to!string; foreach(k; 2..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 2: - lv_ancestors[2] = obj.text.to!string; + lv_ancestors_txt[2] = obj.text.to!string; foreach(k; 3..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 3: - lv_ancestors[3] = obj.text.to!string; + lv_ancestors_txt[3] = obj.text.to!string; foreach(k; 4..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 4: - lv_ancestors[4] = obj.text.to!string; + lv_ancestors_txt[4] = obj.text.to!string; foreach(k; 5..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 5: - lv_ancestors[5] = obj.text.to!string; + lv_ancestors_txt[5] = obj.text.to!string; foreach(k; 6..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 6: - lv_ancestors[6] = obj.text.to!string; - lv_ancestors[7] = ""; + lv_ancestors_txt[6] = obj.text.to!string; + lv_ancestors_txt[7] = ""; goto default; case 7: - lv_ancestors[7] = obj.text.to!string; + lv_ancestors_txt[7] = obj.text.to!string; goto default; default: - obj.heading_ancestors_text = lv_ancestors.dup; + obj.heading_ancestors_text = lv_ancestors_txt.dup; } + return obj; } #+END_SRC @@ -378,7 +290,11 @@ void heading_ancestors(O)( #+name: abs_top_init_struct #+BEGIN_SRC d -auto dom_set_markup_tags(int[] dom, int lev) { +auto obj_dom_set_markup_tags(O)( + O obj, + int[] dom, + int lev +) { foreach (i; 0 .. 8) { if (i < lev) { if (dom[i] == DomTags.open @@ -415,7 +331,8 @@ auto dom_set_markup_tags(int[] dom, int lev) { debug(dom_magic_numbers) { writeln("marked up: ", lev, ": ", dom); } - return dom; + obj.dom_markedup = dom.dup; + return obj; } #+END_SRC @@ -423,7 +340,11 @@ auto dom_set_markup_tags(int[] dom, int lev) { #+name: abs_top_init_struct #+BEGIN_SRC d -auto dom_set_collapsed_tags(int[] dom, int lev) { +auto obj_dom_set_collapsed_tags(O)( + O obj, + int[] dom, + int lev +) { foreach (i; 0 .. 8) { if (i < lev) { if (dom[i] == DomTags.open @@ -460,7 +381,8 @@ auto dom_set_collapsed_tags(int[] dom, int lev) { debug(dom_magic_numbers) { writeln("collapsed: ", lev, ": ", dom); } - return dom; + obj.dom_collapsed = dom.dup; + return obj; } #+END_SRC @@ -521,7 +443,7 @@ string[string] obj_cite_number_poem = [ "start" : "", "end" : "" ]; -string[] lv_ancestors = [ "", "", "", "", "", "", "", "", ]; +string[] lv_ancestors_txt = [ "", "", "", "", "", "", "", "", ]; int[string] lv = [ "lv" : State.off, "h0" : State.off, @@ -583,6 +505,8 @@ comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; comp_obj_heading_.ptr_html_segnames = html_segnames_ptr; comp_obj_heading_.anchor_tags = ["toc"]; +comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; +comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; auto toc_head = comp_obj_heading_; html_segnames_ptr_cntr++; the_table_of_contents_section = [ @@ -722,6 +646,8 @@ if there is a glossary section you need to: comp_obj_heading_.heading_lev_collapsed = 1; comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; the_glossary_section ~= comp_obj_heading_; comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; @@ -736,6 +662,8 @@ if there is a glossary section you need to: comp_obj_heading_.heading_lev_collapsed = 2; comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; comp_obj_heading_.anchor_tags = ["glossary"]; the_glossary_section ~= comp_obj_heading_; } else { @@ -804,6 +732,8 @@ if there is a blurb section you need to: comp_obj_heading_.heading_lev_collapsed = 1; comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; the_blurb_section ~= comp_obj_heading_; comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; @@ -819,6 +749,8 @@ if there is a blurb section you need to: comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; comp_obj_heading_.anchor_tags = ["blurb"]; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; the_blurb_section ~= comp_obj_heading_; } else if (line.matchFirst(rgx.heading) && (opt_action["backmatter"] && opt_action["section_blurb"])) { @@ -1191,7 +1123,7 @@ if ((type["heading"] == State.on) obj_cite_number, // int cntr, // int heading_ptr, // int - lv_ancestors, // string[] + lv_ancestors_txt, // string[] an_object["is"], // string html_segnames_ptr, // int substantive_object_and_anchor_tags_tuple[sObj.notes_reg], @@ -1721,16 +1653,23 @@ the_document_head_section ~= the_document_body_section[0]; the_document_body_section=the_document_body_section[1..$]; #+END_SRC -*** _minor loops_ :post: -**** 1. loop: backmatter loop up to lev4: html_segnames, set backmatter pointers +*** _post main-loop loops_ :post: +**** 1. _loop backmatter:_ loop up to lev4, extract html_segnames, set pointers + +this extra loop is needed to determine pre and (in particular) next segment for +html, that is then used in a subsequent loop -could optimise by -- skipping second and third pass unless the output html seg or epub is being made! -NOTE there are issues attempting to do this on first pass -- as +NOTE there are issues attempting to do this on first pass as: - backmatter is created out of sequence and - it is not certain which are present -it is quite neat to have all in one place as we have here: + + - it is quite neat to have all in one place as we have here + + - could optimise a bit by + - skipping second (and third) loop unless the html seg or epub output is + selected + +***** section: endnotes #+name: abs_post #+BEGIN_SRC d @@ -1745,6 +1684,12 @@ if (the_endnotes_section.length > 1) { } html_segnames_ptr_cntr++; } +#+END_SRC + +***** section: glossary + +#+name: abs_post +#+BEGIN_SRC d if (the_glossary_section.length > 1) { html_segnames ~= "glossary"; html_segnames_ptr = html_segnames_ptr_cntr; @@ -1756,6 +1701,12 @@ if (the_glossary_section.length > 1) { } html_segnames_ptr_cntr++; } +#+END_SRC + +***** section: bibliography + +#+name: abs_post +#+BEGIN_SRC d if (the_bibliography_section.length > 1) { html_segnames ~= "bibliography"; html_segnames_ptr = html_segnames_ptr_cntr; @@ -1767,6 +1718,12 @@ if (the_bibliography_section.length > 1) { } html_segnames_ptr_cntr++; } +#+END_SRC + +***** section: book index + +#+name: abs_post +#+BEGIN_SRC d if (the_bookindex_section["scroll"].length > 1) { html_segnames ~= "bookindex"; html_segnames_ptr = html_segnames_ptr_cntr; @@ -1784,6 +1741,12 @@ if (the_bookindex_section["scroll"].length > 1) { } html_segnames_ptr_cntr++; } +#+END_SRC + +***** section: blurb + +#+name: abs_post +#+BEGIN_SRC d if (the_blurb_section.length > 1) { html_segnames ~= "blurb"; html_segnames_ptr = html_segnames_ptr_cntr; @@ -1797,7 +1760,7 @@ if (the_blurb_section.length > 1) { } #+END_SRC -**** 2. loop: all objects structural relationships (sections, segments, objects) +**** 2. _loop all objects:_ encode _structural relationships_ (sections, segments, objects) needed for DOM structure, segnames & subtoc, backmatter pointers & unique image list @@ -1824,6 +1787,8 @@ Build here: during the third pass all previous and next segment names are known next are not yet known for backmatter during the second pass +***** images + #+name: abs_post #+BEGIN_SRC d string[] _images; @@ -1835,6 +1800,12 @@ auto extract_images(S)(S content_block) { return images_; } string[] segnames_0_4; +#+END_SRC + +***** section: head + +#+name: abs_post +#+BEGIN_SRC d foreach (ref obj; the_document_head_section) { if (obj.is_a == "heading") { debug(dom) { @@ -1843,19 +1814,27 @@ foreach (ref obj; the_document_head_section) { if (obj.heading_lev_markup <= 4) { segnames_0_4 ~= obj.segment_anchor_tag; } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } +#+END_SRC + +***** section: toc + +#+name: abs_post +#+BEGIN_SRC d if (the_table_of_contents_section["scroll"].length > 1) { + /+ scroll +/ dom_markedup_buffer = dom_markedup.dup; dom_collapsed_buffer = dom_collapsed.dup; foreach (ref obj; the_table_of_contents_section["scroll"]) { @@ -1867,18 +1846,20 @@ if (the_table_of_contents_section["scroll"].length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } + /+ seg +/ dom_markedup = dom_markedup_buffer.dup; dom_collapsed = dom_collapsed_buffer.dup; foreach (ref obj; the_table_of_contents_section["seg"]) { @@ -1897,15 +1878,19 @@ if (the_table_of_contents_section["scroll"].length > 1) { || (opt_action["html-scroll"]) || (opt_action["html-seg"]) || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } +#+END_SRC + +***** section: document body + +#+name: abs_post +#+BEGIN_SRC d /+ multiple 1~ levels, loop through document body +/ if (the_document_body_section.length > 1) { foreach (ref obj; the_document_body_section) { @@ -1924,22 +1909,29 @@ if (the_document_body_section.length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } else if (obj.is_a == "para") { _images ~= extract_images(obj.text); } } } auto images=uniq(_images.sort()); +#+END_SRC + +***** section: endnotes + +#+name: abs_post +#+BEGIN_SRC d /+ optional only one 1~ level +/ if (the_endnotes_section.length > 1) { dom_markedup_buffer = dom_markedup.dup; @@ -1961,19 +1953,26 @@ if (the_endnotes_section.length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } +#+END_SRC + +***** section: glossary + +#+name: abs_post +#+BEGIN_SRC d /+ optional only one 1~ level +/ if (the_glossary_section.length > 1) { foreach (ref obj; the_glossary_section) { @@ -1991,19 +1990,26 @@ if (the_glossary_section.length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } +#+END_SRC + +***** section: bibliography + +#+name: abs_post +#+BEGIN_SRC d /+ optional only one 1~ level +/ if (the_bibliography_section.length > 1) { foreach (ref obj; the_bibliography_section) { @@ -2021,21 +2027,29 @@ if (the_bibliography_section.length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } +#+END_SRC + +***** section: book index (scroll, seg) + +#+name: abs_post +#+BEGIN_SRC d /+ optional only one 1~ level +/ if (the_bookindex_section["scroll"].length > 1) { + /+ scroll +/ dom_markedup_buffer = dom_markedup.dup; dom_collapsed_buffer = dom_collapsed.dup; foreach (ref obj; the_bookindex_section["scroll"]) { @@ -2052,18 +2066,20 @@ if (the_bookindex_section["scroll"].length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } + /+ seg +/ dom_markedup = dom_markedup_buffer.dup; dom_collapsed = dom_collapsed_buffer.dup; foreach (ref obj; the_bookindex_section["seg"]) { @@ -2081,19 +2097,26 @@ if (the_bookindex_section["scroll"].length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } +#+END_SRC + +***** section: blurb + +#+name: abs_post +#+BEGIN_SRC d /+ optional only one 1~ level +/ if (the_blurb_section.length > 1) { foreach (ref obj; the_blurb_section) { @@ -2111,42 +2134,53 @@ if (the_blurb_section.length > 1) { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } +} +#+END_SRC + +**** TODO update BUG? + +#+name: abs_post +#+BEGIN_SRC d /+ TODO - note create/insert heading object sole purpose eof close all open tags sort out: - obj.dom_markedup = dom_markedup; - obj.dom_collapsed = dom_collapsed; +/ - dom_markedup = dom_set_markup_tags(dom_markedup, 0); - dom_collapsed = dom_set_collapsed_tags(dom_collapsed, 0); - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "empty"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_heading_.segment_anchor_tag = ""; - comp_obj_heading_.marked_up_level = ""; - comp_obj_heading_.heading_lev_markup = 9; - comp_obj_heading_.heading_lev_collapsed = 9; - comp_obj_heading_.parent_ocn = 0; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.dom_markedup = dom_markedup.dup; - comp_obj_heading_.dom_collapsed = dom_collapsed.dup; - the_dom_tail_section ~= comp_obj_heading_; -} +comp_obj_heading_ = comp_obj_heading_.init; +comp_obj_heading_.use = "empty"; +comp_obj_heading_.is_of = "para"; +comp_obj_heading_.is_a = "heading"; +comp_obj_heading_.ocn = 0; +comp_obj_para.obj_cite_number = ""; +comp_obj_heading_.segment_anchor_tag = ""; +comp_obj_heading_.marked_up_level = ""; +comp_obj_heading_.heading_lev_markup = 9; +comp_obj_heading_.heading_lev_collapsed = 9; +comp_obj_heading_.parent_ocn = 0; +comp_obj_heading_.parent_lev_markup = 0; +comp_obj_heading_.dom_markedup = dom_markedup.dup; +comp_obj_heading_.dom_collapsed = dom_collapsed.dup; +obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0); +obj_dom_set_collapsed_tags(comp_obj_heading_, dom_collapsed, 0); +obj_heading_ancestors(comp_obj_heading_, lv_ancestors_txt); +comp_obj_heading_ = obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0); +comp_obj_heading_ = obj_dom_set_collapsed_tags(comp_obj_heading_, dom_collapsed, 0); +comp_obj_heading_ = obj_heading_ancestors(comp_obj_heading_, lv_ancestors_txt); +the_dom_tail_section ~= comp_obj_heading_; #+END_SRC ** 4. _return document tuple_ :post: @@ -2178,7 +2212,8 @@ auto document_the = [ #+BEGIN_SRC d string[][string] document_section_keys_sequenced = [ "seg": ["head", "toc_seg", "body",], - "scroll": ["head", "toc_scroll", "body",] + "scroll": ["head", "toc_scroll", "body",], + "sql": ["head", "body",] ]; if (document_the["endnotes"].length > 1) { document_section_keys_sequenced["seg"] ~= "endnotes"; @@ -2187,13 +2222,16 @@ if (document_the["endnotes"].length > 1) { if (document_the["glossary"].length > 1) { document_section_keys_sequenced["seg"] ~= "glossary"; document_section_keys_sequenced["scroll"] ~= "glossary"; + document_section_keys_sequenced["sql"] ~= "glossary"; } if (document_the["bibliography"].length > 1) { document_section_keys_sequenced["seg"] ~= "bibliography"; document_section_keys_sequenced["scroll"] ~= "bibliography"; + document_section_keys_sequenced["sql"] ~= "bibliography"; } if (document_the["bookindex_seg"].length > 1) { document_section_keys_sequenced["seg"] ~= "bookindex_seg"; + document_section_keys_sequenced["sql"] ~= "bookindex_seg"; } if (document_the["bookindex_scroll"].length > 1) { document_section_keys_sequenced["scroll"] ~= "bookindex_scroll"; @@ -2201,6 +2239,7 @@ if (document_the["bookindex_scroll"].length > 1) { if (document_the["blurb"].length > 1) { document_section_keys_sequenced["seg"] ~= "blurb"; document_section_keys_sequenced["scroll"] ~= "blurb"; + document_section_keys_sequenced["sql"] ~= "blurb"; } if ((opt_action["html"]) || (opt_action["html-scroll"]) @@ -4357,7 +4396,7 @@ auto table_substantive_munge_special(O,T)( **** object :object: ***** ocn :ocn: -#+name: ao_emitters_ocn +#+name: meta_emitters_ocn #+BEGIN_SRC d struct OCNemitter { int obj_cite_number, obj_cite_number_; @@ -4383,7 +4422,7 @@ struct OCNemitter { ****** { struct, inline markup munge -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d struct ObjInlineMarkupMunge { string[string] obj_txt; @@ -4403,7 +4442,7 @@ struct ObjInlineMarkupMunge { ****** url links -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d string url_links(Ot)(Ot obj_txt_in) { debug(asserts) { @@ -4466,7 +4505,7 @@ struct ObjInlineMarkupMunge { ****** footnotes endnotes markup -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d auto footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in, bool reset_note_numbers) { debug(asserts) { @@ -4528,7 +4567,7 @@ struct ObjInlineMarkupMunge { ****** object notes and links -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d private auto object_notes_and_links_(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) in { @@ -4590,7 +4629,7 @@ struct ObjInlineMarkupMunge { - identified text by heading level marker followed by text until two new lines - general markup -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d auto munge_heading(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) in { @@ -4624,7 +4663,7 @@ struct ObjInlineMarkupMunge { - footnotes/endnotes - links -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d auto munge_para(Ot)(Ot obj_txt_in) in { @@ -4649,7 +4688,7 @@ struct ObjInlineMarkupMunge { ****** quote -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d string munge_quote(Ot)(Ot obj_txt_in) in { @@ -4674,7 +4713,7 @@ struct ObjInlineMarkupMunge { - links - newlines detected and kept? -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d auto munge_group(string obj_txt_in) in { } @@ -4696,7 +4735,7 @@ struct ObjInlineMarkupMunge { - links - newlines detected and kept? -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d auto munge_block(Ot)(Ot obj_txt_in) in { @@ -4722,7 +4761,7 @@ struct ObjInlineMarkupMunge { - footnotes/endnotes - links? -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d auto munge_verse(Ot)(Ot obj_txt_in) in { @@ -4747,7 +4786,7 @@ struct ObjInlineMarkupMunge { - no general markup - one special character represented by mkup.nbsp ░ -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d string munge_code(Ot)(Ot obj_txt_in) in { @@ -4768,7 +4807,7 @@ struct ObjInlineMarkupMunge { - table block identified by open an close tags - table markup -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d string munge_table(Ot)(Ot obj_txt_in) in { @@ -4786,7 +4825,7 @@ struct ObjInlineMarkupMunge { ****** comment -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d string munge_comment(Ot)(Ot obj_txt_in) in { @@ -4804,7 +4843,7 @@ struct ObjInlineMarkupMunge { ****** } -#+name: ao_emitters_obj_inline_markup_munge +#+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d } #+END_SRC @@ -4812,7 +4851,7 @@ struct ObjInlineMarkupMunge { ***** toc, tags, object inline markup :markup:inline: ****** { -#+name: ao_emitters_obj_inline_markup +#+name: meta_emitters_obj_inline_markup #+BEGIN_SRC d struct ObjInlineMarkup { auto rgx = Rgx(); @@ -4822,7 +4861,7 @@ struct ObjInlineMarkup { ****** object inline markup and anchor tags :markup:inline: -#+name: ao_emitters_obj_inline_markup_and_anchor_tags_and_misc +#+name: meta_emitters_obj_inline_markup_and_anchor_tags_and_misc #+BEGIN_SRC d auto obj_inline_markup_and_anchor_tags_and_misc(O,K,Ma)( O obj_, @@ -4912,7 +4951,7 @@ struct ObjInlineMarkup { ****** toc (table of contents), build, gather headings :markup:inline: -#+name: ao_emitters_obj_inline_markup_table_of_contents +#+name: meta_emitters_obj_inline_markup_table_of_contents #+BEGIN_SRC d auto _clean_heading_toc_(Toc)( Toc heading_toc_, @@ -5092,14 +5131,14 @@ struct ObjInlineMarkup { ****** private: -#+name: ao_emitters_obj_inline_markup_private +#+name: meta_emitters_obj_inline_markup_private #+BEGIN_SRC d private: #+END_SRC ******* make heading number & segment anchor tags if instructed :markup:inline:segment:anchor:tags: -#+name: ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags +#+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d static string _configured_auto_heading_numbering_and_segment_anchor_tags(M,O,Ma)( M munge_, @@ -5240,7 +5279,7 @@ private: ******* make segment anchor tags if not provided :markup:inline:segment:anchor:tags: -#+name: ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags +#+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d static string _make_segment_anchor_tags_if_none_provided(M,Lv)(M munge_, Lv lev_) { debug(asserts) { @@ -5272,7 +5311,7 @@ private: ******** unittests -#+name: ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags +#+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d unittest { string txt_lev="1"; @@ -5322,7 +5361,7 @@ private: ****** } -#+name: ao_emitters_obj_inline_markup_close +#+name: meta_emitters_obj_inline_markup_close #+BEGIN_SRC d } #+END_SRC @@ -5330,7 +5369,7 @@ private: ***** object attrib :attributes: ****** { attributes structure open, public -#+name: ao_emitters_obj_attributes +#+name: meta_emitters_obj_attributes #+BEGIN_SRC d struct ObjAttributes { string[string] _obj_attrib; @@ -5338,7 +5377,7 @@ struct ObjAttributes { ****** emitter obj attributes, public -#+name: ao_emitters_obj_attributes_public +#+name: meta_emitters_obj_attributes_public #+BEGIN_SRC d string obj_attributes(Oi,OR,OH)( Oi obj_is_, @@ -5413,7 +5452,7 @@ struct ObjAttributes { ****** private -#+name: ao_emitters_obj_attributes_private +#+name: meta_emitters_obj_attributes_private #+BEGIN_SRC d private: string _obj_attributes; @@ -5422,7 +5461,7 @@ struct ObjAttributes { ******* attrubutes ******** para & blocks -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _para_and_blocks(Ot)(Ot obj_txt_in) in { @@ -5458,7 +5497,7 @@ struct ObjAttributes { ******** heading -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _heading(Ot)(Ot obj_txt_in) in { @@ -5478,7 +5517,7 @@ struct ObjAttributes { ******** para -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _para(Ot)(Ot obj_txt_in) in { @@ -5498,7 +5537,7 @@ struct ObjAttributes { ******** quote -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _quote(Ot)(Ot obj_txt_in) in { @@ -5518,7 +5557,7 @@ struct ObjAttributes { ******** group -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _group(Ot)(Ot obj_txt_in) in { @@ -5538,7 +5577,7 @@ struct ObjAttributes { ******** block -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _block(Ot)(Ot obj_txt_in) in { @@ -5558,7 +5597,7 @@ struct ObjAttributes { ******** verse -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _verse(Ot)(Ot obj_txt_in) in { @@ -5578,7 +5617,7 @@ struct ObjAttributes { ******** code -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _code(Ot)(Ot obj_txt_in) in { @@ -5598,7 +5637,7 @@ struct ObjAttributes { ******** table -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _table(Ot)(Ot obj_txt_in) in { @@ -5618,7 +5657,7 @@ struct ObjAttributes { ******** comment -#+name: ao_emitters_obj_attributes_private_an_attribute +#+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _comment(Ot)(Ot obj_txt_in) in { @@ -5638,7 +5677,7 @@ struct ObjAttributes { ******* set additional attribute values, parse as json -#+name: ao_emitters_obj_attributes_private_json +#+name: meta_emitters_obj_attributes_private_json #+BEGIN_SRC d string _set_additional_values_parse_as_json(OA,Oi,OH)( OA _obj_attrib, @@ -5672,7 +5711,7 @@ struct ObjAttributes { ****** } -#+name: ao_emitters_obj_attributes_private_close +#+name: meta_emitters_obj_attributes_private_close #+BEGIN_SRC d } #+END_SRC @@ -5680,7 +5719,7 @@ struct ObjAttributes { **** book index :book:index: ***** book index nugget hash :hash:nugget: -#+name: ao_emitters_book_index_nugget +#+name: meta_emitters_book_index_nugget #+BEGIN_SRC d struct BookIndexNuggetHash { string main_term, sub_term, sub_term_bits; @@ -5766,7 +5805,7 @@ struct BookIndexNuggetHash { ***** book index (sort &) report indented :report:indented: -#+name: ao_emitters_book_index_report_indented +#+name: meta_emitters_book_index_report_indented #+BEGIN_SRC d struct BookIndexReportIndent { int mkn, skn; @@ -5802,7 +5841,7 @@ struct BookIndexReportIndent { ***** book index (sort &) report section :report:section: ****** { book index struct open -#+name: ao_emitters_book_index_report_section +#+name: meta_emitters_book_index_report_section #+BEGIN_SRC d struct BookIndexReportSection { int mkn, skn; @@ -5812,7 +5851,7 @@ struct BookIndexReportSection { ****** bookindex write section -#+name: ao_emitters_book_index_report_section +#+name: meta_emitters_book_index_report_section #+BEGIN_SRC d auto bookindex_write_section(BI)( BI bookindex_unordered_hashes @@ -5847,7 +5886,7 @@ struct BookIndexReportSection { ****** book index (sort &) build section :report:section: -#+name: ao_emitters_book_index_report_section +#+name: meta_emitters_book_index_report_section #+BEGIN_SRC d auto bookindex_build_abstraction_section(BI,N,B)( BI bookindex_unordered_hashes, @@ -6010,14 +6049,14 @@ struct BookIndexReportSection { ****** } -#+name: ao_emitters_book_index_report_section +#+name: meta_emitters_book_index_report_section #+BEGIN_SRC d } #+END_SRC **** (end)notes section :endnotes:section: -#+name: ao_emitters_endnotes +#+name: meta_emitters_endnotes #+BEGIN_SRC d struct NotesSection { string[string] object_notes; @@ -6028,7 +6067,7 @@ struct NotesSection { ***** { gather notes for endnote section struct open -#+name: ao_emitters_endnotes +#+name: meta_emitters_endnotes #+BEGIN_SRC d private auto gather_notes_for_endnote_section( ObjGenericComposite[] contents_am, @@ -6090,7 +6129,7 @@ struct NotesSection { ***** gathered notes -#+name: ao_emitters_endnotes +#+name: meta_emitters_endnotes #+BEGIN_SRC d private auto gathered_notes() in { @@ -6110,7 +6149,7 @@ struct NotesSection { ***** endnote objects -#+name: ao_emitters_endnotes +#+name: meta_emitters_endnotes #+BEGIN_SRC d private auto endnote_objects( int obj_cite_number, @@ -6205,7 +6244,7 @@ struct NotesSection { ***** } -#+name: ao_emitters_endnotes +#+name: meta_emitters_endnotes #+BEGIN_SRC d } #+END_SRC @@ -6213,14 +6252,14 @@ struct NotesSection { **** bibliography :bibliography: ***** { biblio struct -#+name: ao_emitters_bibliography +#+name: meta_emitters_bibliography #+BEGIN_SRC d struct Bibliography { #+END_SRC ***** biblio -#+name: ao_emitters_bibliography +#+name: meta_emitters_bibliography #+BEGIN_SRC d public JSONValue[] _bibliography_(Bi,BJ)( return ref Bi biblio_unsorted_incomplete, @@ -6258,7 +6297,7 @@ struct Bibliography { ***** biblio unsorted complete -#+name: ao_emitters_bibliography +#+name: meta_emitters_bibliography #+BEGIN_SRC d final private JSONValue[] _biblio_unsorted_complete_(Bi,BJ)( Bi biblio_unordered, @@ -6299,7 +6338,7 @@ struct Bibliography { ***** biblio sort -#+name: ao_emitters_bibliography +#+name: meta_emitters_bibliography #+BEGIN_SRC d final private JSONValue[] biblio_sort(BJ)(BJ biblio_unordered) { debug(asserts) { @@ -6323,7 +6362,7 @@ struct Bibliography { ***** biblio debug -#+name: ao_emitters_bibliography +#+name: meta_emitters_bibliography #+BEGIN_SRC d void biblio_debug(BJ)(BJ biblio_sorted) { debug(asserts) { @@ -6341,7 +6380,7 @@ struct Bibliography { ***** } -#+name: ao_emitters_bibliography +#+name: meta_emitters_bibliography #+BEGIN_SRC d } #+END_SRC @@ -6349,7 +6388,7 @@ struct Bibliography { **** node structure metadata :structure:metadata:node: ***** { metadata node struct -#+name: ao_emitters_metadata +#+name: meta_emitters_metadata #+BEGIN_SRC d struct NodeStructureMetadata { int lv, lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7; @@ -6360,7 +6399,7 @@ struct NodeStructureMetadata { ***** node metadata emitter -#+name: ao_emitters_metadata +#+name: meta_emitters_metadata #+BEGIN_SRC d ObjGenericComposite node_location_emitter(Lv,Ta,N,C,P,I)( Lv lev_markup_number, @@ -6424,7 +6463,7 @@ struct NodeStructureMetadata { ***** node metadata emitter heading, (including most segnames & their pointers) -#+name: ao_emitters_metadata +#+name: meta_emitters_metadata #+BEGIN_SRC d ObjGenericComposite node_emitter_heading(T,L,Lm,Lc,Ta,N,C,P,LA,I,PSn,fNr,fNs,fL)( T _text, @@ -6435,7 +6474,7 @@ struct NodeStructureMetadata { N obj_cite_number_, C cntr_, P ptr_, - LA lv_ancestors, + LA lv_ancestors_txt, I is_, PSn html_segnames_ptr, fNr flag_notes_reg, @@ -6452,7 +6491,7 @@ struct NodeStructureMetadata { static assert(is(typeof(obj_cite_number_) == int)); static assert(is(typeof(cntr_) == int)); static assert(is(typeof(ptr_) == int)); - static assert(is(typeof(lv_ancestors) == string[])); + static assert(is(typeof(lv_ancestors_txt) == string[])); static assert(is(typeof(is_) == string)); static assert(is(typeof(html_segnames_ptr) == int)); } @@ -6564,7 +6603,7 @@ struct NodeStructureMetadata { _comp_obj_heading_.heading_lev_collapsed = (!(lev_collapsed_number.empty) ? lev_collapsed_number.to!int : 0); _comp_obj_heading_.parent_ocn = p_["obj_cite_number"]; _comp_obj_heading_.parent_lev_markup = p_["lev_markup_number"]; - _comp_obj_heading_.heading_ancestors_text = lv_ancestors; + _comp_obj_heading_.heading_ancestors_text = lv_ancestors_txt; _comp_obj_heading_.ptr_doc_object = cntr_; _comp_obj_heading_.ptr_html_segnames = ((lev_markup_number == "4") ? html_segnames_ptr : 0); _comp_obj_heading_.ptr_heading = ptr_; @@ -6619,7 +6658,7 @@ struct NodeStructureMetadata { ***** } -#+name: ao_emitters_metadata +#+name: meta_emitters_metadata #+BEGIN_SRC d } #+END_SRC @@ -6854,35 +6893,38 @@ template docSectKeysSeq() { auto scroll() { return document_section_keys_sequenced["scroll"]; } + auto sql() { + return document_section_keys_sequenced["sql"]; + } } return doc_sect_keys_seq(); } } #+END_SRC -* 2. Object Setter (Set Abstract Object) :module:sdp:ao_object_setter: +* 2. Object Setter (Set Abstract Object) :module:sdp:meta_object_setter: set abstracted objects for downstream processing ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/object_setter.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/object_setter.d /++ object setter: setting of sisu objects for downstream processing - ao_object_setter.d + meta_object_setter.d +/ -module sdp.ao.object_setter; +module sdp.meta.object_setter; template ObjectSetter() { /+ structs +/ - <<ao_structs_init>> + <<meta_structs_init>> } #+END_SRC ** 1. initialize structs :struct: *** heading attribute -#+name: ao_structs_init +#+name: meta_structs_init #+BEGIN_SRC d struct HeadingAttrib { string lev = "9"; @@ -6897,7 +6939,7 @@ struct HeadingAttrib { *** [#A] _composite object_ -#+name: ao_structs_init +#+name: meta_structs_init #+BEGIN_SRC d struct ObjGenericComposite { // size_t id; @@ -6932,6 +6974,7 @@ struct ObjGenericComposite { int heading_lev_collapsed = 9; int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0,]; int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0,]; + int[] heading_ancestors = [ 0, 0, 0, 0, 0, 0, 0, 0,]; string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ]; string[] lev4_subtoc = []; int heading_array_ptr = 0; @@ -6946,7 +6989,7 @@ struct ObjGenericComposite { *** The Objects: generic composite object array -#+name: ao_structs_init +#+name: meta_structs_init #+BEGIN_SRC d struct TheObjects { ObjGenericComposite[] oca; diff --git a/org/ao_conf_make_meta.org b/org/meta_conf_make_meta.org index 25bcd4d..5e4cb6d 100644 --- a/org/ao_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -11,14 +11,14 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:ao: +#+FILETAGS: :sdp:rel:meta: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 0. header extract (native & sdlang) to AA :module:sdp:ao_conf_make_meta: +* 0. header extract (native & sdlang) to AA :module:sdp:meta_conf_make_meta: ** module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/conf_make_meta.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/conf_make_meta.d /++ extract native/orig header return associative array<BR> @@ -29,7 +29,7 @@ converting the metadata and make instructions to a common json format used by program internally. Moved to associative array. +/ -module sdp.ao.conf_make_meta; +module sdp.meta.conf_make_meta; template docHeaderMakeAndMetaTupExtractAndConvertToAA() { import std.exception, @@ -41,9 +41,9 @@ template docHeaderMakeAndMetaTupExtractAndConvertToAA() { std.conv : to; import sdlang; import - sdp.ao.conf_make_meta_native, - sdp.ao.conf_make_meta_sdlang, - sdp.ao.rgx; + sdp.meta.conf_make_meta_native, + sdp.meta.conf_make_meta_sdlang, + sdp.meta.rgx; mixin SiSUrgxInit; mixin SiSUheaderExtractNative; mixin SiSUextractSDLang; @@ -70,15 +70,15 @@ template docHeaderMakeAndMetaTupExtractAndConvertToAA() { } #+END_SRC -* A. module sdlang :module:sdp:ao_conf_make_meta_sdlang: +* A. module sdlang :module:sdp:meta_conf_make_meta_sdlang: ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/conf_make_meta_sdlang.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/conf_make_meta_sdlang.d /++ sdlang headers<BR> extract sdlang header return sdlang +/ -module sdp.ao.conf_make_meta_sdlang; +module sdp.meta.conf_make_meta_sdlang; template SiSUextractSDLang() { import std.exception, @@ -90,20 +90,20 @@ template SiSUextractSDLang() { std.utf, std.conv : to; import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; struct extractSDL { mixin SiSUregisters; mixin SiSUrgxInit; auto rgx = Rgx(); - <<ao_conf_make_meta_sdl>> + <<meta_conf_make_meta_sdl>> } } #+END_SRC ** 1. sdlang header _extract root Tag_ :sdlang:root:tag: -#+name: ao_conf_make_meta_sdl +#+name: meta_conf_make_meta_sdl #+BEGIN_SRC d private auto docHeaderSDLtagGet(Hs)(Hs src_header) { debug(asserts){ @@ -158,7 +158,7 @@ private auto docHeaderSDLtagGet(Hs)(Hs src_header) { ** 2a. _sdlang to associative array_ -#+name: ao_conf_make_meta_sdl +#+name: meta_conf_make_meta_sdl #+BEGIN_SRC d private auto sdlangToAA(C,Tag)(C conf, Tag conf_sdlang) { debug(asserts){ @@ -200,7 +200,7 @@ private auto sdlangToAA(C,Tag)(C conf, Tag conf_sdlang) { ** 2b. sdlang header to _associative array_ make sdlTag in :sdlang:aa: -#+name: ao_conf_make_meta_sdl +#+name: meta_conf_make_meta_sdl #+BEGIN_SRC d private auto docHeaderSDLtoAA(Ma, Tag)(Ma dochead_make, Tag header_sdlang) { debug(asserts){ @@ -250,15 +250,15 @@ private auto docHeaderSDLtoAA(Ma, Tag)(Ma dochead_make, Tag header_sdlang) { } #+END_SRC -* B. module native document header :module:sdp:ao_conf_make_meta_native: +* B. module native document header :module:sdp:meta_conf_make_meta_native: ** module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/conf_make_meta_native.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/conf_make_meta_native.d /++ native headers using<br>@title:<BR>:subtitle:<BR>type tags<BR> extract native/orig header return associative array +/ -module sdp.ao.conf_make_meta_native; +module sdp.meta.conf_make_meta_native; template SiSUheaderExtractNative() { import std.exception, @@ -270,8 +270,8 @@ template SiSUheaderExtractNative() { std.utf, std.conv : to; import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; struct HeaderDocMetadataAndMakeNativeToAA { mixin SiSUregisters; mixin SiSUrgxInitFlags; @@ -279,14 +279,14 @@ template SiSUheaderExtractNative() { auto rgx = Rgx(); enum State { off, on } string hm, hs; - <<ao_markup_header_extract_native>> + <<meta_markup_header_extract_native>> } } #+END_SRC ** native header document metadata in associative array :aa: -#+name: ao_markup_header_extract_native +#+name: meta_markup_header_extract_native #+BEGIN_SRC d auto header_metadata_and_make_aa(H,Me,Ma)( H header, @@ -482,7 +482,7 @@ body { ** native header extract to string object :string: -#+name: ao_markup_header_extract_native +#+name: meta_markup_header_extract_native #+BEGIN_SRC d private auto native_header_extract(L,Lo,O,T)( L line, @@ -532,7 +532,7 @@ private auto native_header_extract(L,Lo,O,T)( ** native header reset states :reset: -#+name: ao_markup_header_extract_native +#+name: meta_markup_header_extract_native #+BEGIN_SRC d auto header_reset_states_common(Lo,O,T)( return ref Lo line_occur, @@ -555,7 +555,7 @@ auto header_reset_states_common(Lo,O,T)( ** hub: native header start :hub: -#+name: ao_markup_header_extract_native +#+name: meta_markup_header_extract_native #+BEGIN_SRC d private auto headerNativeToAA(Hn)(Hn src_header) { debug(asserts){ @@ -611,16 +611,16 @@ private auto headerNativeToAA(Hn)(Hn src_header) { } #+END_SRC -* 0. composite make :module:sdp:ao_composite_make: +* 0. composite make :module:sdp:meta_composite_make: ** TODO 0. template *** composite make -#+BEGIN_SRC d :tangle ../src/sdp/ao/composite_make.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/composite_make.d /++ output hub<BR> check & generate output types requested +/ -module sdp.ao.composite_make; +module sdp.meta.composite_make; template compositeMkCnf() { <<imports>> mixin SiSUrgxInit; @@ -688,7 +688,7 @@ template compositeMkCnf() { #+END_SRC *** composite make aa -#+BEGIN_SRC d :tangle ../src/sdp/ao/composite_make.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/composite_make.d /++ output hub<BR> check & generate output types requested @@ -733,6 +733,6 @@ template compositeMkCnfAA() { #+name: imports #+BEGIN_SRC d -import sdp.ao; +import sdp.meta; import std.array; #+END_SRC diff --git a/org/ao_debugs.org b/org/meta_debugs.org index 1111d55..fb34b34 100644 --- a/org/ao_debugs.org +++ b/org/meta_debugs.org @@ -11,18 +11,18 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:ao: +#+FILETAGS: :sdp:rel:meta: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 1. abstraction debugs :module:sdp:ao_doc_debugs: +* 1. abstraction debugs :module:sdp:meta_doc_debugs: ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/doc_debugs.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/doc_debugs.d /++ output debugs +/ -module sdp.ao.doc_debugs; +module sdp.meta.doc_debugs; template SiSUdebugs() { <<debug_imports>> auto SiSUdebugs(S,T)( @@ -32,11 +32,11 @@ template SiSUdebugs() { mixin SiSUrgxInit; mixin InternalMarkup; <<initialize>> - <<ao_output_debugs>> + <<meta_output_debugs>> debug(checkdoc) { if ((doc_matters.opt_action["debug"])) { - <<ao_output_debugs_summary>> - <<ao_output_debugs_checkdoc>> + <<meta_output_debugs_summary>> + <<meta_output_debugs_checkdoc>> } } } @@ -48,8 +48,8 @@ template SiSUdebugs() { #+name: debug_imports #+BEGIN_SRC d import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; import std.algorithm, std.array, @@ -79,7 +79,7 @@ string key; ** (parent) :parent: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(parent) { writefln( @@ -107,7 +107,7 @@ debug(parent) { ** (dumpdoc) :objects: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(dumpdoc) { writefln( @@ -131,7 +131,7 @@ debug(dumpdoc) { ** (segnames) :objects: -#+name: ao_output_debugs_checkdoc +#+name: meta_output_debugs_checkdoc #+BEGIN_SRC d debug(checkdoc) { void out_segnames(S,T)( @@ -154,7 +154,7 @@ debug(checkdoc) { ** shared output section arrange *** out toc -#+name: ao_output_debugs_checkdoc +#+name: meta_output_debugs_checkdoc #+BEGIN_SRC d debug(checkdoc) { void out_toc(S)( @@ -178,7 +178,7 @@ debug(checkdoc) { *** out endnotes :endnotes: -#+name: ao_output_debugs_checkdoc +#+name: meta_output_debugs_checkdoc #+BEGIN_SRC d debug(checkdoc) { void out_endnotes(S)( @@ -200,7 +200,7 @@ debug(checkdoc) { *** out bookindex :bookindex: -#+name: ao_output_debugs_checkdoc +#+name: meta_output_debugs_checkdoc #+BEGIN_SRC d debug(checkdoc) { void out_bookindex(S)( @@ -224,7 +224,7 @@ debug(checkdoc) { ** sections *** heading_section :heading: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_head) { key="head"; @@ -244,7 +244,7 @@ debug(section_head) { *** toc_section (seg & scroll) **** toc -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_toc) { key="toc_seg"; @@ -254,7 +254,7 @@ debug(section_toc) { **** toc seg -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_toc_seg) { key="toc_seg"; @@ -264,7 +264,7 @@ debug(section_toc_seg) { **** toc scroll -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_toc_scroll) { key="toc_scroll"; @@ -272,7 +272,7 @@ debug(section_toc_scroll) { } #+END_SRC -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(segnames) { writeln(__LINE__); @@ -282,7 +282,7 @@ debug(segnames) { *** body_section :body: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_body) { key="body"; @@ -301,7 +301,7 @@ debug(section_body) { *** dom structure :body: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(toc_nav_dom) { enum DomTags { none, open, close, close_and_open, open_still, } @@ -364,7 +364,7 @@ debug(toc_nav_dom) { *** endnotes_section (seg & scroll) :endnotes: **** endnotes -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_endnotes) { key="endnotes"; @@ -374,7 +374,7 @@ debug(section_endnotes) { **** endnotes seg -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_endnotes_seg) { key="endnotes"; @@ -384,7 +384,7 @@ debug(section_endnotes_seg) { *** glossary_section :glossary: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_glossary) { key="glossary"; @@ -403,7 +403,7 @@ debug(section_glossary) { *** bibliography_section (seg & scroll) :bibliography: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_bibliography) { key="bibliography"; @@ -423,7 +423,7 @@ debug(section_bibliography) { *** bookindex_section (seg & scroll) :bookindex: **** bookindex -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_bookindex) { key="bookindex_seg"; @@ -433,7 +433,7 @@ debug(section_bookindex) { **** bookindex seg -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_bookindex_seg) { key="bookindex_seg"; @@ -443,7 +443,7 @@ debug(section_bookindex_seg) { **** bookindex scroll -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(section_bookindex_scroll) { key="bookindex_scroll"; @@ -453,7 +453,7 @@ debug(section_bookindex_scroll) { *** section_blurb :blurb: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(blurb_section) { key="blurb"; @@ -472,7 +472,7 @@ debug(blurb_section) { ** (objects) :objects: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(objects) { writefln( @@ -496,7 +496,7 @@ debug(objects) { ** (headermakejson) :json:header: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(headermakejson) { writefln( @@ -528,7 +528,7 @@ debug(headermakejson) { ** (headermetadatajson) :json:header: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(headermetadatajson) { writefln( @@ -656,7 +656,7 @@ debug(headermetadatajson) { ** anchor tags -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(anchor) { writefln( @@ -684,7 +684,7 @@ debug(anchor) { ** (headings) :headings: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(heading) { // heading foreach (k; doc_matters.keys_seq.seg) { @@ -705,7 +705,7 @@ debug(heading) { // heading ** (summary) [+1] :summary: -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(headings) { writefln( @@ -730,7 +730,7 @@ debug(headings) { } #+END_SRC -#+name: ao_output_debugs +#+name: meta_output_debugs #+BEGIN_SRC d debug(summary) { string[string] check = [ @@ -741,7 +741,7 @@ debug(summary) { *** compare number of obj_cite_number for known sisu markup output (checkdoc) -#+name: ao_output_debugs_summary +#+name: meta_output_debugs_summary #+BEGIN_SRC d debug(checkdoc) { if (auto mfn=match(doc_matters.source_filename, rgx.src_fn)) { diff --git a/org/ao_read_source_files.org b/org/meta_read_source_files.org index 7bbaca9..06c3cb7 100644 --- a/org/ao_read_source_files.org +++ b/org/meta_read_source_files.org @@ -11,7 +11,7 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:ao:read:file +#+FILETAGS: :sdp:rel:meta:read:file #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] @@ -20,29 +20,29 @@ #+name: imports_std #+BEGIN_SRC d import - sdp.ao, + sdp.meta, std.file, std.path; #+END_SRC -* 1. get _config file_ (read in) :module:sdp:ao_read_config_files: +* 1. get _config file_ (read in) :module:sdp:meta_read_config_files: ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/read_config_files.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/read_config_files.d /++ read configuration files<BR> - read config files<BR> - ao_config_files.d + meta_config_files.d +/ -module sdp.ao.read_config_files; -<<ao_config_file_in>> -<<ao_config_file_sdl>> -<<ao_config_file_hub>> +module sdp.meta.read_config_files; +<<meta_config_file_in>> +<<meta_config_file_sdl>> +<<meta_config_file_hub>> #+END_SRC ** 1. read config file, (conf.sdl & sisu_document_make) :file:config: -#+name: ao_config_file_in +#+name: meta_config_file_in #+BEGIN_SRC d template configIn() { <<imports_std>> @@ -84,7 +84,7 @@ template configIn() { ** 2. config files get sdlang root tag *** 0. template -#+name: ao_config_file_sdl +#+name: meta_config_file_sdl #+BEGIN_SRC d /+ @@ -92,13 +92,13 @@ template configIn() { template ConfigSDLang() { import sdlang; <<imports_std>> - <<ao_config_file_sdlang>> + <<meta_config_file_sdlang>> } #+END_SRC *** config file get sdl root tag :file:conf:sdlang: -#+name: ao_config_file_sdlang +#+name: meta_config_file_sdlang #+BEGIN_SRC d auto ConfigSDLang(string configuration, string conf_sdl_filename) { Tag sdl_root_conf; @@ -116,19 +116,19 @@ auto ConfigSDLang(string configuration, string conf_sdl_filename) { ** 3. config file (conf.sdl & sisu_document_make) :file:config:hub: *** 0. template -#+name: ao_config_file_hub +#+name: meta_config_file_hub #+BEGIN_SRC d /+ +/ template configRead() { <<imports_std>> - <<ao_config_file_import_sdlang>> - <<ao_config_file_sdlang_hub>> + <<meta_config_file_import_sdlang>> + <<meta_config_file_sdlang_hub>> } #+END_SRC *** config hub import sdlang -#+name: ao_config_file_import_mixin +#+name: meta_config_file_import_mixin #+BEGIN_SRC d import sdlang; #+END_SRC @@ -137,7 +137,7 @@ import sdlang; Read in sdl config file name given, and return sdl root -#+name: ao_config_file_sdlang_hub +#+name: meta_config_file_sdlang_hub #+BEGIN_SRC d final auto configRead(C,E)(C conf_sdl, E env) { auto configuration = configIn!()(conf_sdl, env); @@ -146,19 +146,19 @@ final auto configRead(C,E)(C conf_sdl, E env) { } #+END_SRC -* 2. get _markup source_, read file :module:sdp:ao_read_source_files: +* 2. get _markup source_, read file :module:sdp:meta_read_source_files: ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/read_source_files.d +#+BEGIN_SRC d :tangle ../src/sdp/meta/read_source_files.d /++ - module ao_read_source_files;<BR> + module meta_read_source_files;<BR> - open markup files<BR> - if master file scan for addional files to import/insert +/ -module sdp.ao.read_source_files; +module sdp.meta.read_source_files; template SiSUrawMarkupContent() { import - sdp.ao.rgx; + sdp.meta.rgx; <<imports_std>> mixin SiSUrgxInit; auto rgx = Rgx(); @@ -201,36 +201,36 @@ template SiSUrawMarkupContent() { } struct MarkupRawUnit { 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>> + <<meta_markup_source_raw_read_file_source_string>> + <<meta_markup_source_raw_doc_header_and_content_split>> + <<meta_markup_source_raw_source_line_array>> + <<meta_markup_source_raw_read_in_file>> + <<meta_markup_source_raw_tuple_of_header_and_body>> + <<meta_markup_source_raw_get_insert_source_line_array>> } struct Inserts { - import sdp.ao.defaults; + import sdp.meta.defaults; auto scan_subdoc_source( char[][] markup_sourcefile_insert_content, string fn_src ) { mixin SiSUrgxInitFlags; - <<ao_inserts_scan>> + <<meta_inserts_scan>> foreach (line; markup_sourcefile_insert_content) { - <<ao_inserts_scan_loop>> + <<meta_inserts_scan_loop>> } // end src subdoc (inserts) loop - <<ao_inserts_scan_post>> + <<meta_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>> + <<meta_master_doc_scan_for_insert_filenames>> foreach (line; sourcefile_body_content) { - <<ao_master_doc_scan_for_insert_filenames_loop>> + <<meta_master_doc_scan_for_insert_filenames_loop>> } // end src doc loop - <<ao_master_doc_scan_for_insert_filenames_post>> + <<meta_master_doc_scan_for_insert_filenames_post>> } } } @@ -239,7 +239,7 @@ template SiSUrawMarkupContent() { ** get markup source, read file :source:markup: *** [#A] read file, source string :string: -#+name: ao_markup_source_raw_read_file_source_string +#+name: meta_markup_source_raw_read_file_source_string #+BEGIN_SRC d final private string readInMarkupSource(in char[] fn_src) { enforce( @@ -276,7 +276,7 @@ catch (ErrnoException ex) { here you split document header and body, an array.length == 2 split is on first match of level A~ (which is required) -#+name: ao_markup_source_raw_doc_header_and_content_split +#+name: meta_markup_source_raw_doc_header_and_content_split #+BEGIN_SRC d final private char[][] header0Content1(in string src_text) { /+ split string on _first_ match of "^:?A~\s" into [header, content] array/tuple +/ @@ -295,7 +295,7 @@ final private char[][] header0Content1(in string src_text) { *** source line array :array: -#+name: ao_markup_source_raw_source_line_array +#+name: meta_markup_source_raw_source_line_array #+BEGIN_SRC d final private char[][] markupSourceLineArray(in char[] src_text) { char[][] source_line_arr = @@ -310,7 +310,7 @@ final private char[][] markupSourceLineArray(in char[] src_text) { **** read in file -#+name: ao_markup_source_raw_read_in_file +#+name: meta_markup_source_raw_read_in_file #+BEGIN_SRC d auto markupSourceReadIn(in string fn_src) { auto rgx = Rgx(); @@ -325,7 +325,7 @@ auto markupSourceReadIn(in string fn_src) { **** tuple header and body content -#+name: ao_markup_source_raw_tuple_of_header_and_body +#+name: meta_markup_source_raw_tuple_of_header_and_body #+BEGIN_SRC d auto markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { string[] file_insert_list = []; @@ -344,7 +344,7 @@ auto markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { **** get insert source line array -#+name: ao_markup_source_raw_get_insert_source_line_array +#+name: meta_markup_source_raw_get_insert_source_line_array #+BEGIN_SRC d final char[][] getInsertMarkupSourceContentRawLineArray( in char[] fn_src_insert, @@ -366,7 +366,7 @@ final char[][] getInsertMarkupSourceContentRawLineArray( *** scan inserts (sub-document) source :scan_insert_src: **** scan subdoc source -#+name: ao_inserts_scan +#+name: meta_inserts_scan #+BEGIN_SRC d char[][] contents_insert; auto type1 = flags_type_init; @@ -376,7 +376,7 @@ auto markup_src_file_path = fn_pth_full.captures[1]; **** loop insert (sub-document) -#+name: ao_inserts_scan_loop +#+name: meta_inserts_scan_loop #+BEGIN_SRC d if (type1["curly_code"] == 1) { type1["header_make"] = 0; @@ -452,7 +452,7 @@ if (type1["curly_code"] == 1) { **** post loop -#+name: ao_inserts_scan_post +#+name: meta_inserts_scan_post #+BEGIN_SRC d return contents_insert; #+END_SRC @@ -460,7 +460,7 @@ return contents_insert; *** scan document source :scan_src: **** scan doc source -#+name: ao_master_doc_scan_for_insert_filenames +#+name: meta_master_doc_scan_for_insert_filenames #+BEGIN_SRC d char[][] contents; auto type = flags_type_init; @@ -471,7 +471,7 @@ string[] insert_file_list =[]; **** include inserts: _loop master_ scan for inserts (insert documents) -#+name: ao_master_doc_scan_for_insert_filenames_loop +#+name: meta_master_doc_scan_for_insert_filenames_loop #+BEGIN_SRC d if (type["curly_code"] == 1) { if (line.matchFirst(rgx.block_curly_code_close)) { @@ -533,7 +533,7 @@ if (type["curly_code"] == 1) { **** post loop -#+name: ao_master_doc_scan_for_insert_filenames_post +#+name: meta_master_doc_scan_for_insert_filenames_post #+BEGIN_SRC d debug(insert_file) { writeln(__LINE__); diff --git a/org/output_xmls_css.org b/org/output_xmls_css.org index 0a9afb5..1adb168 100644 --- a/org/output_xmls_css.org +++ b/org/output_xmls_css.org @@ -11,11 +11,11 @@ #+PROPERTY: header-args :padline no :exports code :noweb yes #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport -#+FILETAGS: :sdp:rel:ao: +#+FILETAGS: :sdp:rel:output: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 0. ao css defaults :module:sdp:output_xmls_css: +* 0. output css defaults :module:sdp:output_xmls_css: ** 0. module template #+BEGIN_SRC d :tangle ../src/sdp/output/xmls_css.d diff --git a/org/sdp.org b/org/sdp.org index d4e40b4..63557ed 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -25,7 +25,7 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 17, 0); +enum ver = Version(0, 18, 0); #+END_SRC * 1. sdp (sisu document parser) :sdp: @@ -50,7 +50,7 @@ enum ver = Version(0, 17, 0); module sdp.sisu_document_parser; import sdp.conf.compile_time_info, - sdp.ao.abstraction; + sdp.meta.metadoc; <<imports_sdp>> <<mixin_sdp_version>> <<mixin_pre_main>> @@ -92,22 +92,22 @@ unittest { #+NAME: imports_sdp #+BEGIN_SRC d /+ sdp: sisu document parser, see http://sisudoc.org +/ -import sdp.ao; +import sdp.meta; import std.getopt, std.process; import - sdp.ao.abstraction_summary, - sdp.ao.abstract_doc_source, - sdp.ao.composite_make, - sdp.ao.conf_make_meta, - // sdp.ao.conf_make_meta_native, - sdp.ao.conf_make_meta_sdlang, - sdp.ao.defaults, - sdp.ao.doc_debugs, - sdp.ao.read_config_files, - sdp.ao.read_source_files, - sdp.ao.rgx, + sdp.meta.metadoc_summary, + sdp.meta.metadoc_from_src, + sdp.meta.composite_make, + sdp.meta.conf_make_meta, + // sdp.meta.conf_make_meta_native, + sdp.meta.conf_make_meta_sdlang, + sdp.meta.defaults, + sdp.meta.doc_debugs, + sdp.meta.read_config_files, + sdp.meta.read_source_files, + sdp.meta.rgx, sdp.output.hub, sdp.output.paths_source; #+END_SRC @@ -116,17 +116,17 @@ import ├── src │ ├── sdp.d │ └── sdp -│ ├── ao_abstract_doc_source.d +│ ├── meta_metadoc_from_src.d │ ├── ... │ └── compile_time_info.d └── views └── version.txt -[[./ao_abstract_doc_source.org][ao_abstract_doc_source]] -[[./ao_conf_make_meta.org][ao_conf_make_meta]] -[[./ao_defaults.org][ao_defaults]] -[[./ao_output_debugs.org][ao_output_debugs]] -[[./ao_read_source_files.org][ao_read_source_files]] +[[./meta_metadoc_from_src.org][meta_metadoc_from_src]] +[[./meta_conf_make_meta.org][meta_conf_make_meta]] +[[./meta_defaults.org][meta_defaults]] +[[./meta_output_debugs.org][meta_output_debugs]] +[[./meta_read_source_files.org][meta_read_source_files]] [[./compile_time_info.org][compile time info]] [[./output.org][output]] [[./sdp.org][sdp]] @@ -386,7 +386,7 @@ if (doc_matters.opt_action["verbose"]) { } #+END_SRC **** 1. _debug_ (document parts, checkdoc) :debug:checkdoc: -- [[./ao_output_debugs.org][ao_output_debugs]] +- [[./meta_output_debugs.org][meta_output_debugs]] #+NAME: sdp_each_file_do_debugs_checkdoc #+BEGIN_SRC d @@ -435,8 +435,8 @@ break; // terminate, stop * 2. _document abstraction functions_ :module:sdp:abstraction: ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/abstraction.d -module sdp.ao.abstraction; +#+BEGIN_SRC d :tangle ../src/sdp/meta/metadoc.d +module sdp.meta.metadoc; template SiSUabstraction() { <<imports_sdp>> <<sdp_mixin>> @@ -458,7 +458,7 @@ template SiSUabstraction() { #+END_SRC ** 1. (a) _read in raw file_ (b) split content into: _doc header & doc content_ -- [[./ao_read_source_files.org][ao_read_source_files]] +- [[./meta_read_source_files.org][meta_read_source_files]] - read in the source marked up document and - split the document into: @@ -486,7 +486,7 @@ debug(header_and_body) { #+END_SRC ** 2. _document metadata_ & _make instructions_ :doc:header:metadata:make: -- [[./ao_conf_make_meta.org][ao_conf_make_meta]] +- [[./meta_conf_make_meta.org][meta_conf_make_meta]] - read document header, split into: - metadata @@ -531,7 +531,7 @@ auto _make_and_conf_composite_static_plus_docheader_aa = compositeMkCnfAA!()( #+END_SRC ** 4. _document abstraction, tuple_ (pre-output-processing) :processing: -- [[./ao_doc_abstraction.org][ao_doc_abstraction]] +- [[./meta_abstraction.org][meta_abstraction]] - prepare the document abstraction used in downstream processing @@ -629,21 +629,21 @@ struct DocumentMatters { auto doc_matters = DocumentMatters(); #+END_SRC -* 3. document abstraction _summary_ :module:sdp:abstraction_summary: +* 3. document abstraction _summary_ :module:sdp:metadoc_summary: ** 0. module template -#+BEGIN_SRC d :tangle ../src/sdp/ao/abstraction_summary.d -module sdp.ao.abstraction_summary; +#+BEGIN_SRC d :tangle ../src/sdp/meta/metadoc_summary.d +module sdp.meta.metadoc_summary; template SiSUabstractionSummary() { auto SiSUabstractionSummary(S,T)( auto return ref const S doc_abstraction, auto return ref T doc_matters, ) { - <<abstraction_summary_imports>> + <<metadoc_summary_imports>> mixin InternalMarkup; - <<abstraction_summary_initialize>> + <<metadoc_summary_initialize>> if (doc_matters.opt_action["verbose"]) { - <<ao_abstraction_summary>> + <<meta_metadoc_summary>> } } } @@ -652,11 +652,11 @@ template SiSUabstractionSummary() { ** init *** imports -#+name: abstraction_summary_imports +#+name: metadoc_summary_imports #+BEGIN_SRC d import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; import std.array, std.exception, @@ -672,14 +672,14 @@ import *** initialize :report: -#+name: abstraction_summary_initialize +#+name: metadoc_summary_initialize #+BEGIN_SRC d auto markup = InlineMarkup(); #+END_SRC ** (last ocn) -#+name: ao_abstraction_summary +#+name: meta_metadoc_summary #+BEGIN_SRC d string[string] check = [ "last_obj_cite_number" : "NA [debug \"checkdoc\" not run]", @@ -697,7 +697,7 @@ foreach (k; doc_matters.keys_seq.seg) { ** summary -#+name: ao_abstraction_summary +#+name: meta_metadoc_summary #+BEGIN_SRC d auto min_repeat_number = 66; auto char_repeat_number = (doc_matters.dochead_meta["title"]["full"].length @@ -743,3 +743,217 @@ writefln( markup.repeat_character_by_number_provided("-", min_repeat_number), ); #+END_SRC + +* __END__ +dev notes + +** sdp glossary / terms + +|------+-------------------------------------| +| sdp | sisu document parser | +|------+-------------------------------------| +| dmso | document markup, structure, objects | +|------+-------------------------------------| +| meta | meta document, document abstraction | +| mda | meta, meta document abstraction | +| adr | abstract document representation | +| dar | document abstract representation | +| (da) | (document abstraction) | +| | (code representation of document) | +|------+-------------------------------------| +| ao | abstract objects | +| | (code representation of objects) | +|------+-------------------------------------| + +consider +|-------+----------------------------------------------| +| dao | document abstraction, objects | +|-------+----------------------------------------------| +| daso | document abstraction, structure, objects | +|-------+----------------------------------------------| +| drso | document representation, structure, objects | +|-------+----------------------------------------------| +| daows | document abstraction, objects with structure | +|-------+----------------------------------------------| + +** the document notes +*** document sections +**** summary + +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| section | part | opt. | | objects | ocn | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| front matter | head | * | | | no | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| toc | toc | | | generated from headings | no | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| body | body | * | | default section | yes | | | +| | | | | - headings | | | | +| | | | | - paras | | | | +| | | | | - code | | | | +| | | | | - poem | | | | +| | | | | - group | | | | +| | | | | - block | | | | +| | | | | - quote | | | | +| | | | | - table | | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| back matter | endnote | | | generated from inline note markup | no (each endnote belongs to | | | +| | | | | | a (body) object) | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| | glossary | | | identified section, limited markup | possibly, to make searchable | | | +| | | | | - heading | hidden | | | +| | | | | - paras | | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| | bibliography | | | generated from inline special markup | possibly, to make searchable | | | +| | | | | appended to paragraphs contained in body section | hidden | | | +| | | | | - heading | | | | +| | | | | - paras | | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| | book index | | | generated from inline special markup | possibly, special numbering or | | | +| | | | | - heading | could use term as anchor? | | | +| | | | | - paras | to make searchable | | | +| | | | | | hidden | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| +| | blurb | | | identified section, limited markup | no (unless non-substantive | | | +| | | | | - heading | given special numbering) | | | +| | | | | - paras | | | | +|--------------+--------------+------+---+--------------------------------------------------+--------------------------------+---+---| + +**** on abstraction + +- abstract for downstream processing + - identify document structure and objects + - identify document structure (headings/levels/sections) + - identify objects (headings, paragraphs, tables, code blocks, verse ...) + - set document, generate common abstraction for downstream parsing + - set different _document sections_: + - _head_, toc, _body_, endnotes, glossary, bibliography, book index, blurb + - _object numbers_, heading/ chapter numbering etc, endnote numbers + - _regular ocn_ + - body objects + - glossary objects + - bibliography objects + - _special ocn_ + - non substantive text (provide special numbers) + - blurb objects + - book index + - special (_exceptions_) + - endnotes + - unify object representations + - multiple markups for same object type given single representation + - extract object attributes + - unify inline markup on objects + - inline markup made easier to identify + +- simplify downstream parsing + +*** objects +**** summary + +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | | identified by | object notes | attributes | inline | embedded | special | +| | | | | | | appended | characters | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| para | heading | level markers | | | - italics | - endnotes | | +| | | at start of line | | | | - bibliography | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | paragraph | delimited by two new lines | default object | - indent | - bold | - endnotes | | +| | | | [discard leading & | - bullet | - italics | - bibliography | | +| | | | newline whitespace] | | - underscore | | | +| | | | | | - strikethrough | | | +| | | | | | - superscript | | | +| | | | | | - subscript | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| block | | open and close tags | | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| TODO | quote | | | - language? | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| TODO | group | | - inline markup applied | - language? | as paragraph | - endnotes | | +| | | | - [discard leading & | | | - bibliography | | +| | | | newline whitespace] | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| TODO | block | | - inline markup applied | | as paragraph | - endnotes | | +| | | | - whitespace indentation | | | - bibliography | | +| | | | & newlines | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | poem / verse | open and close tags | verse is the object | | | - endnotes | | +| | | | - inline markup applied | | | - bibliography | | +| | | (for poem) | - whitespace indentation | | | | | +| | | | & newlines | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | code | | - contents untouched | - syntax | | | | +| | | | - whitespace indentation | - numbered | | | | +| | | | & newlines | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | table | | | - column width | | | | +| | | | | - heading row | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| + +**** ocn + +|-------------+----------------------+-----------------------+--------------+---| +| *objects | section / part | ocn described | how used* | | +|-------------+----------------------+-----------------------+--------------+---| +| regular ocn | | | | | +|-------------+----------------------+-----------------------+--------------+---| +| | body objects | seq. digit | anchor | | +| | | | visible | | +|-------------+----------------------+-----------------------+--------------+---| +| | glossary objects | seq. digit | anchor | | +| | | | not-visible | | +| | | | (for search) | | +|-------------+----------------------+-----------------------+--------------+---| +| | bibliography objects | seq. digit | anchor | | +| | | | not-visible | | +| | | | (for search) | | +|-------------+----------------------+-----------------------+--------------+---| +| special ocn | | | | | +|-------------+----------------------+-----------------------+--------------+---| +| | non-substantive text | x char + seq. digit | anchor | | +| | | | not-visible | | +| | | | (for search) | | +|-------------+----------------------+-----------------------+--------------+---| +| | book index | i char + seq. digit | anchor | | +| | | | not-visible | | +| | | | (for search) | | +|-------------+----------------------+-----------------------+--------------+---| +| exceptions | | | | | +|-------------+----------------------+-----------------------+--------------+---| +| | endnotes | ocn of parent object | anchor | | +| | | + footnote seq. digit | visible | | +|-------------+----------------------+-----------------------+--------------+---| + +** make config - _composite make_ + +work on composite make a unification of make instructions for each document run + +extract instructions from all config files, unify the make instructions and +provide the result as a single set of make instructions for each document parsed + +|----+---------------------------------+----------------------------------------+----------------+---+---| +| | make instruction source | | | | | +|----+---------------------------------+----------------------------------------+----------------+---+---| +| 0. | unify the following as a single | take into account all the instructions | | | | +| | set of make instructions | provided below, provide interface | | | | +|----+---------------------------------+----------------------------------------+----------------+---+---| +| 1. | config | local site specific | every document | | | +|----+---------------------------------+----------------------------------------+----------------+---+---| +| 2. | document_make | to be applied to all documents | every document | | | +| | | (unless subsequently overridden) | | | | +|----+---------------------------------+----------------------------------------+----------------+---+---| +| 3. | document header make | make instructions contained | per document | | | +| | | in document header | | | | +|----+---------------------------------+----------------------------------------+----------------+---+---| +| 4. | command line instruction | make instruction passed | every document | | | +|----+---------------------------------+----------------------------------------+----------------+---+---| + +- local, site specific (site local instructions such as the site's url, cgi + location etc.) +- general, document_make config file (to be applied to all documents unless + overridden by document or command line instruction) +- each document header, make (the document header contains metadata and may + include make instructions for that document) + - make + - meta +- command line instruction, make (some make instructions may be passed through + the command line) |