From 4749683d540b2554c66bf4734d41393e6410066f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 17 Oct 2017 12:55:09 -0400 Subject: meta_abstraction, a renaming, minor --- org/meta_abstraction.org | 289 ++++++++++++++++++++-------------------- src/sdp/meta/metadoc_from_src.d | 212 ++++++++++++++--------------- 2 files changed, 250 insertions(+), 251 deletions(-) diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index 008de53..299d70c 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -228,9 +228,9 @@ struct OCNset { OCNset obj_cite_digits; int obj_cite_digit_, obj_cite_digit_off, obj_cite_digit_bkidx, obj_cite_digit_type; auto object_citation_number = OCNemitter(); -int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; -int[] dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; -int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; +int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; +int[] dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; +int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; int[] dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; enum DomTags { none, open, close, close_and_open, open_still, } #+END_SRC @@ -298,7 +298,7 @@ pure auto obj_heading_ancestors(O)( #+name: abs_top_init_struct #+BEGIN_SRC d -pure auto obj_dom_set_markup_tags(O)( +pure auto obj_dom_structure_set_markup_tags(O)( O obj, int[] dom, int lev @@ -685,20 +685,20 @@ if there is a glossary section you need to: the_glossary_section ~= comp_obj_heading_; } else { _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur); - comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "glossary"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "glossary"; - comp_obj_para.text = line.to!string.strip; - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.indent_hang = indent["hang_position"]; - comp_obj_para.indent_base = indent["base_position"]; - comp_obj_para.bullet = bullet; - the_glossary_section ~= comp_obj_para; + comp_obj_para = comp_obj_para.init; + comp_obj_para.of_part = "backmatter"; + comp_obj_para.of_section = "glossary"; + comp_obj_para.is_of = "para"; + comp_obj_para.is_a = "glossary"; + comp_obj_para.text = line.to!string.strip; + comp_obj_para.ocn = 0; + comp_obj_para.obj_cite_number = ""; + comp_obj_para.obj_cite_number_off = ""; + comp_obj_para.obj_cite_number_type = 0; + comp_obj_para.indent_hang = indent["hang_position"]; + comp_obj_para.indent_base = indent["base_position"]; + comp_obj_para.bullet = bullet; + the_glossary_section ~= comp_obj_para; } obj_type_status["ocn_status"] = OCNstatus.on; } @@ -796,23 +796,23 @@ if there is a blurb section you need to: comp_obj_heading_.heading_lev_collapsed = an_object["lev_collapsed_number"].to!int; // make int, remove need to conv comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; - the_blurb_section ~= comp_obj_heading_; + the_blurb_section ~= comp_obj_heading_; } else { _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur); - comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "blurb"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "blurb"; - comp_obj_para.text = line.to!string.strip; - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.indent_hang = indent["hang_position"]; - comp_obj_para.indent_base = indent["base_position"]; - comp_obj_para.bullet = bullet; - the_blurb_section ~= comp_obj_para; + comp_obj_para = comp_obj_para.init; + comp_obj_para.of_part = "backmatter"; + comp_obj_para.of_section = "blurb"; + comp_obj_para.is_of = "para"; + comp_obj_para.is_a = "blurb"; + comp_obj_para.text = line.to!string.strip; + comp_obj_para.ocn = 0; + comp_obj_para.obj_cite_number = ""; + comp_obj_para.obj_cite_number_off = ""; + comp_obj_para.obj_cite_number_type = 0; + comp_obj_para.indent_hang = indent["hang_position"]; + comp_obj_para.indent_base = indent["base_position"]; + comp_obj_para.bullet = bullet; + the_blurb_section ~= comp_obj_para; } obj_type_status["ocn_status"] = OCNstatus.on; } @@ -966,7 +966,7 @@ if (line.matchFirst(rgx.book_index) debug(comment) { writeln(line); } - an_object[an_object_key] ~= line ~= "\n"; + an_object[an_object_key] ~= line ~= "\n"; comp_obj_comment = comp_obj_comment.init; comp_obj_comment.of_part = "comment"; // breaks flow comp_obj_comment.of_section = "comment"; // breaks flow @@ -1882,7 +1882,7 @@ foreach (ref obj; the_document_head_section) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1914,7 +1914,7 @@ if (the_table_of_contents_section["scroll"].length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1939,7 +1939,7 @@ if (the_table_of_contents_section["scroll"].length > 1) { || (opt_action["html-scroll"]) || (opt_action["html-seg"]) || (opt_action["epub"])) { - obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1977,7 +1977,7 @@ if (the_document_body_section.length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -2024,7 +2024,7 @@ if (the_endnotes_section.length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -2064,7 +2064,7 @@ if (the_glossary_section.length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -2108,7 +2108,7 @@ if (the_bibliography_section.length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -2157,7 +2157,7 @@ if (the_bookindex_section["scroll"].length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -2195,7 +2195,7 @@ if (the_bookindex_section["scroll"].length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -2240,7 +2240,7 @@ if (the_blurb_section.length > 1) { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -2280,10 +2280,10 @@ 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; -comp_obj_heading_ = obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0); +comp_obj_heading_ = obj_dom_structure_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_; +// the_dom_tail_section ~= comp_obj_heading_; // remove tail for now, decide on later #+END_SRC ** 4. _return document tuple_ :post: @@ -2519,7 +2519,7 @@ void _start_block_(L,T,N)( } #+END_SRC -***** block (various) curly open :curly: +****** block (various) curly open :curly: #+name: abs_functions_block #+BEGIN_SRC d @@ -2607,7 +2607,7 @@ void _start_block_(L,T,N)( obj_type_status["curly_table_special_markup"] = TriState.on; #+END_SRC -***** block (various) tic open :tic: +****** block (various) tic open :tic: #+name: abs_functions_block #+BEGIN_SRC d @@ -3194,7 +3194,7 @@ void _poem_block_(L,O,T,C,N,CMM)( processing.remove("verse"); ++cntr; } - obj_cite_number_poem["end"] = obj_cite_digits.on.to!string; + obj_cite_number_poem["end"] = obj_cite_digits.on.to!string; obj_type_status["blocks"] = TriState.closing; obj_type_status["poem"] = TriState.closing; obj_type_status["curly_poem"] = TriState.off; @@ -3522,7 +3522,7 @@ void _block_flag_line_empty_(B,N,CMM)( assertions_flag_types_block_status_none_or_closed(obj_type_status); #+END_SRC -***** make: quote block +****** make: quote block #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d @@ -3572,7 +3572,7 @@ void _block_flag_line_empty_(B,N,CMM)( ++cntr; #+END_SRC -***** make: group block +****** make: group block #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d @@ -3622,7 +3622,7 @@ void _block_flag_line_empty_(B,N,CMM)( ++cntr; #+END_SRC -***** make: block +****** make: block #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d @@ -3671,7 +3671,7 @@ void _block_flag_line_empty_(B,N,CMM)( ++cntr; #+END_SRC -***** make: poem +****** make: poem #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d @@ -3712,7 +3712,7 @@ void _block_flag_line_empty_(B,N,CMM)( processing.remove("verse"); #+END_SRC -***** make: code block +****** make: code block #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d @@ -3762,7 +3762,7 @@ void _block_flag_line_empty_(B,N,CMM)( ++cntr; #+END_SRC -***** make: table +****** make: table #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d @@ -4595,7 +4595,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** url links +******* url links #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -4658,7 +4658,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** footnotes endnotes markup +******* footnotes endnotes markup #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -4720,7 +4720,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** object notes and links +******* object notes and links #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -4780,7 +4780,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** heading +******* heading - identified text by heading level marker followed by text until two new lines - general markup @@ -4810,7 +4810,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** para +******* para - paragraph text without other identification until two new lines - general markup - paragraph attributes @@ -4841,7 +4841,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** quote +******* quote #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -4859,7 +4859,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** group +******* group - group block identified by open an close tags - general markup - paragraph attributes @@ -4881,7 +4881,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** block +******* block - group block identified by open an close tags - general markup - paragraph attributes @@ -4907,7 +4907,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** verse (poem) +******* verse (poem) - sub part of poem block which is identified by open an close tags, separated from other verse by double newline - newlines - indentation @@ -4933,7 +4933,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** code +******* code - newlines - indentation - possibly identify syntax for coloring (obj attribute) @@ -4958,7 +4958,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** table +******* table - table block identified by open an close tags - table markup @@ -4978,7 +4978,7 @@ static struct ObjInlineMarkupMunge { } #+END_SRC -****** comment +******* comment #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -5014,7 +5014,7 @@ static struct ObjInlineMarkup { string[string] obj_txt; #+END_SRC -****** object inline markup and anchor tags :markup:inline: +******* object inline markup and anchor tags :markup:inline: #+name: meta_emitters_obj_inline_markup_and_anchor_tags_and_misc #+BEGIN_SRC d @@ -5103,7 +5103,7 @@ static struct ObjInlineMarkup { } #+END_SRC -****** toc (table of contents), build, gather headings :markup:inline: +******* toc (table of contents), build, gather headings :markup:inline: #+name: meta_emitters_obj_inline_markup_table_of_contents #+BEGIN_SRC d @@ -5156,53 +5156,53 @@ static struct ObjInlineMarkup { _anchor_tag, ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.bullet = false; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc = comp_obj_toc.init; + comp_obj_toc.of_part = "frontmatter"; + comp_obj_toc.of_section = "toc"; + comp_obj_toc.is_of = "para"; + comp_obj_toc.is_a = "toc"; + comp_obj_toc.ocn = 0; + comp_obj_toc.obj_cite_number = ""; + comp_obj_toc.obj_cite_number_off = ""; + comp_obj_toc.obj_cite_number_type = 0; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.bullet = false; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } else { indent=[ "hang_position" : 0, "base_position" : 0, ]; - comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.bullet = false; - comp_obj_toc.text = "Table of Contents"; - comp_obj_toc.inline_links = true; + comp_obj_toc = comp_obj_toc.init; + comp_obj_toc.of_part = "frontmatter"; + comp_obj_toc.of_section = "toc"; + comp_obj_toc.is_of = "para"; + comp_obj_toc.is_a = "toc"; + comp_obj_toc.ocn = 0; + comp_obj_toc.obj_cite_number = ""; + comp_obj_toc.obj_cite_number_off = ""; + comp_obj_toc.obj_cite_number_type = 0; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.bullet = false; + comp_obj_toc.text = "Table of Contents"; + comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } - comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.bullet = false; - comp_obj_toc.inline_links = true; + comp_obj_toc = comp_obj_toc.init; + comp_obj_toc.of_part = "frontmatter"; + comp_obj_toc.of_section = "toc"; + comp_obj_toc.is_of = "para"; + comp_obj_toc.is_a = "toc"; + comp_obj_toc.ocn = 0; + comp_obj_toc.obj_cite_number = ""; + comp_obj_toc.obj_cite_number_off = ""; + comp_obj_toc.obj_cite_number_type = 0; + comp_obj_toc.bullet = false; + comp_obj_toc.inline_links = true; switch (obj_["lev_markup_number"].to!int) { case 0: indent=[ @@ -5211,11 +5211,11 @@ static struct ObjInlineMarkup { ]; toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "toc.fnSuffix"; toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 1: .. case 3: indent=[ @@ -5227,11 +5227,11 @@ static struct ObjInlineMarkup { heading_toc_, ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 4: toc_txt_ = format( @@ -5247,11 +5247,11 @@ static struct ObjInlineMarkup { "hang_position" : obj_["lev_markup_number"].to!int, "base_position" : obj_["lev_markup_number"].to!int, ]; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 5: .. case 7: toc_txt_ = format( @@ -5276,11 +5276,11 @@ static struct ObjInlineMarkup { "hang_position" : obj_["lev_markup_number"].to!int, "base_position" : obj_["lev_markup_number"].to!int, ]; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; default: break; @@ -5291,14 +5291,14 @@ static struct ObjInlineMarkup { } #+END_SRC -****** private: +******* 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: +******** make heading number & segment anchor tags if instructed :markup:inline:segment:anchor:tags: #+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d @@ -5438,7 +5438,7 @@ private: } #+END_SRC -******* make segment anchor tags if not provided :markup:inline:segment:anchor:tags: +******** make segment anchor tags if not provided :markup:inline:segment:anchor:tags: #+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d @@ -5536,7 +5536,7 @@ struct ObjAttributes { string[string] _obj_attrib; #+END_SRC -****** emitter obj attributes, public +******* emitter obj attributes, public #+name: meta_emitters_obj_attributes_public #+BEGIN_SRC d @@ -5611,7 +5611,7 @@ struct ObjAttributes { } #+END_SRC -****** private +******* private #+name: meta_emitters_obj_attributes_private #+BEGIN_SRC d @@ -5619,7 +5619,6 @@ struct ObjAttributes { string _obj_attributes; #+END_SRC -******* attrubutes ******** para & blocks #+name: meta_emitters_obj_attributes_private_an_attribute @@ -5836,7 +5835,7 @@ struct ObjAttributes { } #+END_SRC -******* set additional attribute values, parse as json +******** set additional attribute values, parse as json #+name: meta_emitters_obj_attributes_private_json #+BEGIN_SRC d @@ -6010,7 +6009,7 @@ struct BookIndexReportSection { static auto munge = ObjInlineMarkupMunge(); #+END_SRC -****** bookindex write section +******* bookindex write section #+name: meta_emitters_book_index_report_section #+BEGIN_SRC d @@ -6045,7 +6044,7 @@ struct BookIndexReportSection { } #+END_SRC -****** book index (sort &) build section :report:section: +******* book index (sort &) build section :report:section: #+name: meta_emitters_book_index_report_section #+BEGIN_SRC d @@ -6296,7 +6295,7 @@ struct NotesSection { } #+END_SRC -***** gathered notes +****** gathered notes #+name: meta_emitters_endnotes #+BEGIN_SRC d @@ -6316,7 +6315,7 @@ struct NotesSection { } #+END_SRC -***** endnote objects +****** endnote objects #+name: meta_emitters_endnotes #+BEGIN_SRC d @@ -6436,7 +6435,7 @@ struct NotesSection { struct Bibliography { #+END_SRC -***** biblio +****** biblio #+name: meta_emitters_bibliography #+BEGIN_SRC d @@ -6474,7 +6473,7 @@ struct Bibliography { } #+END_SRC -***** biblio unsorted complete +****** biblio unsorted complete #+name: meta_emitters_bibliography #+BEGIN_SRC d @@ -6515,7 +6514,7 @@ struct Bibliography { } #+END_SRC -***** biblio sort +****** biblio sort #+name: meta_emitters_bibliography #+BEGIN_SRC d @@ -6539,7 +6538,7 @@ struct Bibliography { } #+END_SRC -***** biblio debug +****** biblio debug #+name: meta_emitters_bibliography #+BEGIN_SRC d @@ -6576,7 +6575,7 @@ struct NodeStructureMetadata { static auto rgx = Rgx(); #+END_SRC -***** node metadata emitter +****** node metadata emitter #+name: meta_emitters_metadata #+BEGIN_SRC d @@ -6639,7 +6638,7 @@ struct NodeStructureMetadata { } #+END_SRC -***** node metadata emitter heading, (including most segnames & their pointers) +****** node metadata emitter heading, (including most segnames & their pointers) #+name: meta_emitters_metadata #+BEGIN_SRC d diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d index b164a64..b4bee7a 100644 --- a/src/sdp/meta/metadoc_from_src.d +++ b/src/sdp/meta/metadoc_from_src.d @@ -79,9 +79,9 @@ template SiSUdocAbstraction() { OCNset obj_cite_digits; int obj_cite_digit_, obj_cite_digit_off, obj_cite_digit_bkidx, obj_cite_digit_type; auto object_citation_number = OCNemitter(); - int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; - int[] dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; - int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + int[] dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; int[] dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; enum DomTags { none, open, close, close_and_open, open_still, } pure auto obj_heading_ancestors(O)( @@ -137,7 +137,7 @@ template SiSUdocAbstraction() { } return obj; } - pure auto obj_dom_set_markup_tags(O)( + pure auto obj_dom_structure_set_markup_tags(O)( O obj, int[] dom, int lev @@ -482,20 +482,20 @@ template SiSUdocAbstraction() { the_glossary_section ~= comp_obj_heading_; } else { _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur); - comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "glossary"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "glossary"; - comp_obj_para.text = line.to!string.strip; - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.indent_hang = indent["hang_position"]; - comp_obj_para.indent_base = indent["base_position"]; - comp_obj_para.bullet = bullet; - the_glossary_section ~= comp_obj_para; + comp_obj_para = comp_obj_para.init; + comp_obj_para.of_part = "backmatter"; + comp_obj_para.of_section = "glossary"; + comp_obj_para.is_of = "para"; + comp_obj_para.is_a = "glossary"; + comp_obj_para.text = line.to!string.strip; + comp_obj_para.ocn = 0; + comp_obj_para.obj_cite_number = ""; + comp_obj_para.obj_cite_number_off = ""; + comp_obj_para.obj_cite_number_type = 0; + comp_obj_para.indent_hang = indent["hang_position"]; + comp_obj_para.indent_base = indent["base_position"]; + comp_obj_para.bullet = bullet; + the_glossary_section ~= comp_obj_para; } obj_type_status["ocn_status"] = OCNstatus.on; } @@ -580,23 +580,23 @@ template SiSUdocAbstraction() { comp_obj_heading_.heading_lev_collapsed = an_object["lev_collapsed_number"].to!int; // make int, remove need to conv comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; - the_blurb_section ~= comp_obj_heading_; + the_blurb_section ~= comp_obj_heading_; } else { _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur); - comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "blurb"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "blurb"; - comp_obj_para.text = line.to!string.strip; - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.indent_hang = indent["hang_position"]; - comp_obj_para.indent_base = indent["base_position"]; - comp_obj_para.bullet = bullet; - the_blurb_section ~= comp_obj_para; + comp_obj_para = comp_obj_para.init; + comp_obj_para.of_part = "backmatter"; + comp_obj_para.of_section = "blurb"; + comp_obj_para.is_of = "para"; + comp_obj_para.is_a = "blurb"; + comp_obj_para.text = line.to!string.strip; + comp_obj_para.ocn = 0; + comp_obj_para.obj_cite_number = ""; + comp_obj_para.obj_cite_number_off = ""; + comp_obj_para.obj_cite_number_type = 0; + comp_obj_para.indent_hang = indent["hang_position"]; + comp_obj_para.indent_base = indent["base_position"]; + comp_obj_para.bullet = bullet; + the_blurb_section ~= comp_obj_para; } obj_type_status["ocn_status"] = OCNstatus.on; } @@ -687,7 +687,7 @@ template SiSUdocAbstraction() { debug(comment) { writeln(line); } - an_object[an_object_key] ~= line ~= "\n"; + an_object[an_object_key] ~= line ~= "\n"; comp_obj_comment = comp_obj_comment.init; comp_obj_comment.of_part = "comment"; // breaks flow comp_obj_comment.of_section = "comment"; // breaks flow @@ -1377,7 +1377,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1403,7 +1403,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1428,7 +1428,7 @@ template SiSUdocAbstraction() { || (opt_action["html-scroll"]) || (opt_action["html-seg"]) || (opt_action["epub"])) { - obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1460,7 +1460,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1501,7 +1501,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1535,7 +1535,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1573,7 +1573,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1616,7 +1616,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1654,7 +1654,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1693,7 +1693,7 @@ template SiSUdocAbstraction() { || (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_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); @@ -1727,10 +1727,10 @@ template SiSUdocAbstraction() { comp_obj_heading_.parent_lev_markup = 0; comp_obj_heading_.dom_markedup = dom_markedup.dup; comp_obj_heading_.dom_collapsed = dom_collapsed.dup; - comp_obj_heading_ = obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0); + comp_obj_heading_ = obj_dom_structure_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_; + // the_dom_tail_section ~= comp_obj_heading_; // remove tail for now, decide on later auto document_the = [ "head": the_document_head_section, "toc_seg": the_table_of_contents_section["seg"], @@ -2260,7 +2260,7 @@ template SiSUdocAbstraction() { processing.remove("verse"); ++cntr; } - obj_cite_number_poem["end"] = obj_cite_digits.on.to!string; + obj_cite_number_poem["end"] = obj_cite_digits.on.to!string; obj_type_status["blocks"] = TriState.closing; obj_type_status["poem"] = TriState.closing; obj_type_status["curly_poem"] = TriState.off; @@ -4106,53 +4106,53 @@ template SiSUdocAbstraction() { _anchor_tag, ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.bullet = false; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc = comp_obj_toc.init; + comp_obj_toc.of_part = "frontmatter"; + comp_obj_toc.of_section = "toc"; + comp_obj_toc.is_of = "para"; + comp_obj_toc.is_a = "toc"; + comp_obj_toc.ocn = 0; + comp_obj_toc.obj_cite_number = ""; + comp_obj_toc.obj_cite_number_off = ""; + comp_obj_toc.obj_cite_number_type = 0; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.bullet = false; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } else { indent=[ "hang_position" : 0, "base_position" : 0, ]; - comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.bullet = false; - comp_obj_toc.text = "Table of Contents"; - comp_obj_toc.inline_links = true; + comp_obj_toc = comp_obj_toc.init; + comp_obj_toc.of_part = "frontmatter"; + comp_obj_toc.of_section = "toc"; + comp_obj_toc.is_of = "para"; + comp_obj_toc.is_a = "toc"; + comp_obj_toc.ocn = 0; + comp_obj_toc.obj_cite_number = ""; + comp_obj_toc.obj_cite_number_off = ""; + comp_obj_toc.obj_cite_number_type = 0; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.bullet = false; + comp_obj_toc.text = "Table of Contents"; + comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } - comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.bullet = false; - comp_obj_toc.inline_links = true; + comp_obj_toc = comp_obj_toc.init; + comp_obj_toc.of_part = "frontmatter"; + comp_obj_toc.of_section = "toc"; + comp_obj_toc.is_of = "para"; + comp_obj_toc.is_a = "toc"; + comp_obj_toc.ocn = 0; + comp_obj_toc.obj_cite_number = ""; + comp_obj_toc.obj_cite_number_off = ""; + comp_obj_toc.obj_cite_number_type = 0; + comp_obj_toc.bullet = false; + comp_obj_toc.inline_links = true; switch (obj_["lev_markup_number"].to!int) { case 0: indent=[ @@ -4161,11 +4161,11 @@ template SiSUdocAbstraction() { ]; toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "toc.fnSuffix"; toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 1: .. case 3: indent=[ @@ -4177,11 +4177,11 @@ template SiSUdocAbstraction() { heading_toc_, ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 4: toc_txt_ = format( @@ -4197,11 +4197,11 @@ template SiSUdocAbstraction() { "hang_position" : obj_["lev_markup_number"].to!int, "base_position" : obj_["lev_markup_number"].to!int, ]; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 5: .. case 7: toc_txt_ = format( @@ -4226,11 +4226,11 @@ template SiSUdocAbstraction() { "hang_position" : obj_["lev_markup_number"].to!int, "base_position" : obj_["lev_markup_number"].to!int, ]; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; - the_table_of_contents_section["seg"] ~= comp_obj_toc; + comp_obj_toc.indent_hang = indent["hang_position"]; + comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.text = toc_txt_.to!string.strip; + comp_obj_toc.inline_links = true; + the_table_of_contents_section["seg"] ~= comp_obj_toc; break; default: break; -- cgit v1.2.3