From 3e3a1a76ce4d0abe75277afb2937539fc0e9a4e6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 27 May 2019 23:35:01 -0400 Subject: remove ./data for now, else relatively minor --- src/doc_reform/doc_reform.d | 2 +- src/doc_reform/meta/conf_make_meta_json.d | 14 +- src/doc_reform/meta/conf_make_meta_structs.d | 168 ++++----- src/doc_reform/meta/defaults.d | 1 + src/doc_reform/meta/metadoc_from_src.d | 516 ++++++++++++++------------- src/doc_reform/output/defaults.d | 1 + src/doc_reform/source/paths_source.d | 29 +- 7 files changed, 377 insertions(+), 354 deletions(-) (limited to 'src') diff --git a/src/doc_reform/doc_reform.d b/src/doc_reform/doc_reform.d index 2c63dcb..be475b4 100755 --- a/src/doc_reform/doc_reform.d +++ b/src/doc_reform/doc_reform.d @@ -178,7 +178,7 @@ void main(string[] args) { "ocn", "--ocn object cite numbers (default)", &opts["ocn"], "parallel", "--parallel parallelisation", &opts["parallel"], "parallel-subprocesses", "--parallel-subprocesses nested parallelisation", &opts["parallel-subprocesses"], - "quiet", "--quiet output to terminal", &opts["quiet"], + "quiet|q", "--quiet output to terminal", &opts["quiet"], "pod", "--pod doc reform pod source content bundled", &opts["pod"], "serial", "--serial serial processing", &opts["serial"], "source", "--source markup source text content", &opts["source"], diff --git a/src/doc_reform/meta/conf_make_meta_json.d b/src/doc_reform/meta/conf_make_meta_json.d index d7ab551..fcd52c1 100644 --- a/src/doc_reform/meta/conf_make_meta_json.d +++ b/src/doc_reform/meta/conf_make_meta_json.d @@ -20,7 +20,7 @@ static template contentJSONtoDocReformStruct() { ConfCompositePlus _struct_composite; auto contentJSONtoDocReformStruct(C,J)(C _struct_composite, J _json, string _identifier) { mixin DocReformRgxInit; - static auto _rgx = Rgx(); + static auto rgx = Rgx(); debug (json) { writeln(">> --------------------------- >>"); foreach (tag0; _json.object.byKeyValue) { @@ -67,7 +67,7 @@ static template contentJSONtoDocReformStruct() { if (_json.object["make"]["footer"].type().to!string == "string") { char[][] __match_footer_array = (cast(char[]) _json.object["make"]["footer"].str) - .split(_rgx.make_heading_delimiter); + .split(rgx.make_heading_delimiter); _struct_composite.make_str.footer = __match_footer_array.to!(string[]); } else if (_json.object["make"]["footer"].type().to!string == "array") { string[] _match_footer_array; @@ -81,7 +81,7 @@ static template contentJSONtoDocReformStruct() { if (_json.object["make"]["headings"].type().to!string == "string") { char[][] __match_headings_array = (cast(char[]) _json.object["make"]["headings"].str) - .split(_rgx.make_heading_delimiter); + .split(rgx.make_heading_delimiter); _struct_composite.make_str.headings = __match_headings_array.to!(string[]); } else if (_json.object["make"]["headings"].type().to!string == "array") { string[] _match_headings_array; @@ -95,7 +95,7 @@ static template contentJSONtoDocReformStruct() { if (_json.object["make"]["home_button_image"].type().to!string == "string") { char[][] __match_home_button_image_array = (cast(char[]) _json.object["make"]["home_button_image"].str) - .split(_rgx.make_heading_delimiter); + .split(rgx.make_heading_delimiter); _struct_composite.make_str.home_button_image = __match_home_button_image_array.to!(string[]); } else if (_json.object["make"]["home_button_image"].type().to!string == "array") { string[] _match_home_button_image_array; @@ -201,7 +201,7 @@ static template contentJSONtoDocReformStruct() { && (_json.object["webserv"]["url_root"].type().to!string == "string") ) { _struct_composite.conf.webserv_url_doc_root = _json.object["webserv"]["url_root"].str; - if (auto m = _struct_composite.conf.webserv_url_doc_root.match(_rgx.webserv_url_doc_root)) { + if (auto m = _struct_composite.conf.webserv_url_doc_root.match(rgx.webserv_url_doc_root)) { _struct_composite.conf.webserv_url_domain = m.captures[2].to!string; _struct_composite.conf.webserv_url_doc_path = m.captures[3].to!string; } @@ -533,9 +533,9 @@ static template contentJSONtoDocReformStruct() { } string[] authors_arr; string[] authors_raw_arr - = _struct_composite.meta.creator_author.split(_rgx.arr_delimiter); + = _struct_composite.meta.creator_author.split(rgx.arr_delimiter); foreach (author_raw; authors_raw_arr) { - authors_arr ~= author_raw.replace(_rgx.raw_author_munge, "$2 $1"); + authors_arr ~= author_raw.replace(rgx.raw_author_munge, "$2 $1"); } _struct_composite.meta.creator_author = join(authors_arr, ", ").chomp.chomp; } diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d index e214565..874e509 100644 --- a/src/doc_reform/meta/conf_make_meta_structs.d +++ b/src/doc_reform/meta/conf_make_meta_structs.d @@ -13,49 +13,49 @@ import doc_reform.meta.defaults, doc_reform.meta.rgx; mixin DocReformRgxInit; -static auto _rgx = Rgx(); +static auto rgx = Rgx(); mixin InternalMarkup; -auto _mkup = InlineMarkup(); +auto mkup = InlineMarkup(); string url_markup(string line) { string line_ = line .replaceAll( - _rgx.smid_inline_link_markup_regular, + rgx.smid_inline_link_markup_regular, ("$1" - ~ _mkup.lnk_o ~ "$2" ~ _mkup.lnk_c - ~ _mkup.url_o ~ "$3" ~ _mkup.url_c + ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c + ~ mkup.url_o ~ "$3" ~ mkup.url_c ) // ("$1{ $2 }$3$4") ) .replaceAll( - _rgx.smid_inline_link_naked_url, + rgx.smid_inline_link_naked_url, ("$1" - ~ _mkup.lnk_o ~ "$2" ~ _mkup.lnk_c - ~ _mkup.url_o ~ "$2" ~ _mkup.url_c + ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c + ~ mkup.url_o ~ "$2" ~ mkup.url_c ) // ("$1{ $2 }$2$3") ) .replaceAll( - _rgx.arr_delimiter, - _mkup.br_line + rgx.arr_delimiter, + mkup.br_line ); return line_; } struct ConfCompositeMakeStr { - string bold; - string breaks; - string cover_image; - string css; - string emphasis; - string[] footer; - string[] headings; - string[] home_button_image; - string home_button_text = "{Doc Reform}http://www.doc-reform.org;" + string bold; + string breaks; + string cover_image; + string css; + string emphasis; + string[] footer; + string[] headings; + string[] home_button_image; + string home_button_text = "{Doc Reform}http://www.doc-reform.org;" ~ " {www.doc-reform.org}http://www.doc-reform.org;" ~ " {sources / git}https://git.doc-reform.org/software/doc-reform"; - string italics; - string auto_num_top_at_level; - int auto_num_top_lv = 9; - int auto_num_depth = 2; + string italics; + string auto_num_top_at_level; + int auto_num_top_lv = 9; + int auto_num_depth = 2; string[][] substitute; - string texpdf_font; + string texpdf_font; } struct confCompositeMakeBuild { string[] bold(string _mk) { @@ -122,23 +122,23 @@ struct confCompositeMakeBuild { } } struct ConfCompositeMakeInit { - string[] bold; - string breaks; - string cover_image; - string css; - string[] emphasis; - string[] footer; - string[] headings; - string[] home_button_image; - string home_button_text = "{Doc Reform}http://www.doc-reform.org;" + string[] bold; + string breaks; + string cover_image; + string css; + string[] emphasis; + string[] footer; + string[] headings; + string[] home_button_image; + string home_button_text = "{Doc Reform}http://www.doc-reform.org;" ~ " {www.doc-reform.org}http://www.doc-reform.org;" ~ " {sources / git}https://git.doc-reform.org/software/doc-reform"; string[] italics; - string auto_num_top_at_level; - int auto_num_top_lv = 9; - int auto_num_depth = 2; + string auto_num_top_at_level; + int auto_num_top_lv = 9; + int auto_num_depth = 2; string[][] substitute; - string texpdf_font; + string texpdf_font; } struct ConfCompositeSiteLocal { string webserv_url_doc_root; @@ -176,53 +176,53 @@ struct ConfCompositeSiteLocal { string search_title; } struct MetaComposite { - string classify_dewey; - string classify_keywords; - string classify_loc; - string classify_subject; - string classify_topic_register; - string creator_author; - string creator_author_email; - string creator_illustrator; - string creator_translator; - string date_added_to_site; - string date_available; - string date_created; - string date_issued; - string date_modified; - string date_published; - string date_valid; - string identifier_isbn; - string identifier_oclc; - string identifier_pg; - string language_document; - string language_document_char; - string links; - string notes_abstract; - string notes_description; - string original_language; - string original_language_char; - string original_publisher; - string original_source; - string original_title; - string publisher; - string rights_copyright; - string rights_copyright_audio; - string rights_copyright_cover; - string rights_copyright_illustrations; - string rights_copyright_photographs; - string rights_copyright_text; - string rights_copyright_translation; - string rights_copyright_video; - string rights_license; - string title_edition; - string title_full; - string title_language; - string title_main; - string title_note; - string title_short; - string title_sub; - string title_subtitle; + string classify_dewey; + string classify_keywords; + string classify_loc; + string classify_subject; + string classify_topic_register; + string creator_author; + string creator_author_email; + string creator_illustrator; + string creator_translator; + string date_added_to_site; + string date_available; + string date_created; + string date_issued; + string date_modified; + string date_published; + string date_valid; + string identifier_isbn; + string identifier_oclc; + string identifier_pg; + string language_document; + string language_document_char; + string links; + string notes_abstract; + string notes_description; + string original_language; + string original_language_char; + string original_publisher; + string original_source; + string original_title; + string publisher; + string rights_copyright; + string rights_copyright_audio; + string rights_copyright_cover; + string rights_copyright_illustrations; + string rights_copyright_photographs; + string rights_copyright_text; + string rights_copyright_translation; + string rights_copyright_video; + string rights_license; + string title_edition; + string title_full; + string title_language; + string title_main; + string title_note; + string title_short; + string title_sub; + string title_subtitle; } struct ConfComposite { MetaComposite meta; diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index 3df8816..fc5e5d1 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -155,6 +155,7 @@ template InternalMarkup() { string tc_c = "┚"; string tc_p = "┆"; string img = "☼"; + string sep = "␣"; string on_o = "「"; auto on_c = "」"; string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 6b6714d..ac2f80a 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -557,53 +557,57 @@ template DocReformDocAbstraction() { line_occur["para"] = State.off; an_object_key="glossary_nugget"; // if (line.matchFirst(rgx.heading_glossary)) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "glossary"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Glossary"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = false; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_glossary"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = "glossary"; - comp_obj_heading_.metainfo.heading_lev_markup = 1; - comp_obj_heading_.metainfo.heading_lev_collapsed = 1; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; - comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; - the_glossary_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "glossary"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Glossary"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = true; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "glossary"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; - comp_obj_heading_.metainfo.heading_lev_markup = 4; - comp_obj_heading_.metainfo.heading_lev_collapsed = 2; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 1, 0, 0, 0]; - comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; - comp_obj_heading_.tags.anchor_tags = ["glossary"]; - the_glossary_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "glossary"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Glossary"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = false; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_glossary"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = "glossary"; + comp_obj_heading_.metainfo.heading_lev_markup = 1; + comp_obj_heading_.metainfo.heading_lev_collapsed = 1; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; + the_glossary_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + } + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "glossary"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Glossary"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = true; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "glossary"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; + comp_obj_heading_.metainfo.heading_lev_markup = 4; + comp_obj_heading_.metainfo.heading_lev_collapsed = 2; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; + comp_obj_heading_.tags.anchor_tags = ["glossary"]; + the_glossary_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + } } else { an_object = line.flow_para_match_(an_object, an_object_key, indent, bullet, obj_type_status, line_occur); comp_obj_para = comp_obj_para.init; @@ -682,53 +686,57 @@ template DocReformDocAbstraction() { line_occur["para"] = State.off; an_object_key="blurb_nugget"; if (line.matchFirst(rgx.heading_blurb)) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "blurb"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Blurb"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = false; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_blurb"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = "blurb"; - comp_obj_heading_.metainfo.heading_lev_markup = 1; - comp_obj_heading_.metainfo.heading_lev_collapsed = 1; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; - comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; - the_blurb_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "blurb"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Blurb"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = true; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "blurb"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; - comp_obj_heading_.metainfo.heading_lev_markup = 4; - comp_obj_heading_.metainfo.heading_lev_collapsed = 2; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading_.tags.anchor_tags = ["blurb"]; - comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 1, 0, 0, 0]; - comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; - the_blurb_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "blurb"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Blurb"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = false; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_blurb"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = "blurb"; + comp_obj_heading_.metainfo.heading_lev_markup = 1; + comp_obj_heading_.metainfo.heading_lev_collapsed = 1; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; + the_blurb_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + } + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "blurb"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Blurb"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = true; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "blurb"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; + comp_obj_heading_.metainfo.heading_lev_markup = 4; + comp_obj_heading_.metainfo.heading_lev_collapsed = 2; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading_.tags.anchor_tags = ["blurb"]; + comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; + the_blurb_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + } } else if (line.matchFirst(rgx.heading) && (opt_action.backmatter && opt_action.section_blurb)) { comp_obj_heading_ = comp_obj_heading_.init; @@ -1217,49 +1225,53 @@ template DocReformDocAbstraction() { auto biblio_ordered = biblio.flow_bibliography_(biblio_unsorted_incomplete, bib_arr_json); if (biblio_ordered.length > 0) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "bibliography"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Bibliography"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = true; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_bibliography"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = "bibliography"; - comp_obj_heading_.metainfo.heading_lev_markup = 1; - comp_obj_heading_.metainfo.heading_lev_collapsed = 1; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - the_bibliography_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "bibliography"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Bibliography"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = true; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "bibliography"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; - comp_obj_heading_.metainfo.heading_lev_markup = 4; - comp_obj_heading_.metainfo.heading_lev_collapsed = 2; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading_.tags.anchor_tags = ["bibliography"]; - the_bibliography_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "bibliography"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Bibliography"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = true; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_bibliography"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = "bibliography"; + comp_obj_heading_.metainfo.heading_lev_markup = 1; + comp_obj_heading_.metainfo.heading_lev_collapsed = 1; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + the_bibliography_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + } + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "bibliography"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Bibliography"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = true; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "bibliography"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; + comp_obj_heading_.metainfo.heading_lev_markup = 4; + comp_obj_heading_.metainfo.heading_lev_collapsed = 2; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading_.tags.anchor_tags = ["bibliography"]; + the_bibliography_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + } } else { comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.metainfo.is_of_part = "empty"; @@ -3165,20 +3177,20 @@ template DocReformDocAbstraction() { } final string biblio_tag_map()(string abr) { auto btm = [ - "au" : "author_raw", - "ed" : "editor_raw", - "ti" : "fulltitle", - "lng" : "language", - "jo" : "journal", - "vol" : "volume", - "edn" : "edition", - "yr" : "year", - "pl" : "place", - "pb" : "publisher", - "pub" : "publisher", - "pg" : "pages", - "pgs" : "pages", - "sn" : "short_name" + "au" : "author_raw", + "ed" : "editor_raw", + "ti" : "fulltitle", + "lng" : "language", + "jo" : "journal", + "vol" : "volume", + "edn" : "edition", + "yr" : "year", + "pl" : "place", + "pb" : "publisher", + "pub" : "publisher", + "pg" : "pages", + "pgs" : "pages", + "sn" : "short_name" ]; return btm[abr]; } @@ -5167,8 +5179,7 @@ template DocReformDocAbstraction() { string main_term, sub_term, sub_term_bits; int object_number_offset, object_number_endpoint; string[] object_numbers; - string[][string][string] bi; - string[][string][string] hash_nugget; + string[][string][string] bi_hash_nugget; string[] bi_main_terms_split_arr; string[][string][string] bookindex_nugget_hash(N,S)( string bookindex_section, @@ -5210,7 +5221,7 @@ template DocReformDocAbstraction() { main_term = bi_main_term_and_rest[0].strip; object_numbers ~= obj_cite_digits.object_number.to!string; } - bi[main_term]["_a"] ~= object_numbers; + bi_hash_nugget[main_term]["_a"] ~= object_numbers; object_numbers = null; if (bi_main_term_and_rest.length > 1) { auto bi_sub_terms_split_arr @@ -5229,15 +5240,14 @@ template DocReformDocAbstraction() { object_numbers ~= obj_cite_digits.object_number.to!string; } if (!empty(sub_term)) { - bi[main_term][sub_term] ~= object_numbers; + bi_hash_nugget[main_term][sub_term] ~= object_numbers; } object_numbers=null; } } } } - hash_nugget = bi; - return hash_nugget; + return bi_hash_nugget; } invariant() { } @@ -5329,53 +5339,57 @@ template DocReformDocAbstraction() { && opt_action.section_bookindex)) { string bi_tmp; string[] bi_tmp_tags; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "bookindex"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Book Index"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = false; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_book_index"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = "bookindex"; - comp_obj_heading_.metainfo.heading_lev_markup = 1; - comp_obj_heading_.metainfo.heading_lev_collapsed = 1; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading.has.inline_links = true; - bookindex_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; - ++mkn; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "bookindex"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Index"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = true; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "bookindex"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; - comp_obj_heading_.metainfo.heading_lev_markup = 4; - comp_obj_heading_.metainfo.heading_lev_collapsed = 2; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading.has.inline_links = false; - comp_obj_heading_.tags.anchor_tags = ["bookindex"]; - bookindex_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; - ++mkn; + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "bookindex"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Book Index"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = false; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_book_index"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = "bookindex"; + comp_obj_heading_.metainfo.heading_lev_markup = 1; + comp_obj_heading_.metainfo.heading_lev_collapsed = 1; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading.has.inline_links = true; + bookindex_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + ++mkn; + } + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "bookindex"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Index"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = true; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "bookindex"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; + comp_obj_heading_.metainfo.heading_lev_markup = 4; + comp_obj_heading_.metainfo.heading_lev_collapsed = 2; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading.has.inline_links = false; + comp_obj_heading_.tags.anchor_tags = ["bookindex"]; + bookindex_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + ++mkn; + } import std.array : appender; auto buffer = appender!(char[])(); string[dchar] transTable = [' ' : "_"]; @@ -5545,51 +5559,55 @@ template DocReformDocAbstraction() { ObjGenericComposite comp_obj_heading_; if ((endnotes_["notes"].length > 0) && (opt_action.backmatter && opt_action.section_endnotes)) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "endnotes"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Endnotes"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = false; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_endnotes"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = "endnotes"; - comp_obj_heading_.metainfo.heading_lev_markup = 1; - comp_obj_heading_.metainfo.heading_lev_collapsed = 1; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - the_endnotes_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; - ++mkn; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.metainfo.is_of_part = "backmatter"; - comp_obj_heading_.metainfo.is_of_section = "endnotes"; - comp_obj_heading_.metainfo.is_of_type = "para"; - comp_obj_heading_.metainfo.is_a = "heading"; - comp_obj_heading_.text = "Endnotes"; - comp_obj_heading_.metainfo.ocn = 0; - comp_obj_heading_.metainfo.identifier = ""; - comp_obj_heading_.metainfo.dummy_heading = true; - comp_obj_heading_.metainfo.object_number_off = true; - comp_obj_heading_.metainfo.object_number_type = 0; - comp_obj_heading_.tags.segment_anchor_tag_epub = "endnotes"; - comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; - comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; - comp_obj_heading_.metainfo.heading_lev_markup = 4; - comp_obj_heading_.metainfo.heading_lev_collapsed = 2; - comp_obj_heading_.metainfo.parent_ocn = 1; - comp_obj_heading_.metainfo.parent_lev_markup = 0; - comp_obj_heading_.tags.anchor_tags = ["endnotes"]; - the_endnotes_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; - ++mkn; + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "endnotes"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Endnotes"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = false; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "_part_endnotes"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = "endnotes"; + comp_obj_heading_.metainfo.heading_lev_markup = 1; + comp_obj_heading_.metainfo.heading_lev_collapsed = 1; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + the_endnotes_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + ++mkn; + } + { + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.metainfo.is_of_part = "backmatter"; + comp_obj_heading_.metainfo.is_of_section = "endnotes"; + comp_obj_heading_.metainfo.is_of_type = "para"; + comp_obj_heading_.metainfo.is_a = "heading"; + comp_obj_heading_.text = "Endnotes"; + comp_obj_heading_.metainfo.ocn = 0; + comp_obj_heading_.metainfo.identifier = ""; + comp_obj_heading_.metainfo.dummy_heading = true; + comp_obj_heading_.metainfo.object_number_off = true; + comp_obj_heading_.metainfo.object_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag_epub = "endnotes"; + comp_obj_heading_.tags.anchor_tag_html = comp_obj_heading_.tags.segment_anchor_tag_epub; + comp_obj_heading_.tags.in_segment_html = comp_obj_heading_.tags.anchor_tag_html; + comp_obj_heading_.metainfo.heading_lev_markup = 4; + comp_obj_heading_.metainfo.heading_lev_collapsed = 2; + comp_obj_heading_.metainfo.parent_ocn = 1; + comp_obj_heading_.metainfo.parent_lev_markup = 0; + comp_obj_heading_.tags.anchor_tags = ["endnotes"]; + the_endnotes_section ~= comp_obj_heading_; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + ++mkn; + } } else { comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.metainfo.is_of_part = "empty"; diff --git a/src/doc_reform/output/defaults.d b/src/doc_reform/output/defaults.d index ef0083a..1db06e0 100644 --- a/src/doc_reform/output/defaults.d +++ b/src/doc_reform/output/defaults.d @@ -34,6 +34,7 @@ template InternalMarkup() { string tc_c = "┚"; string tc_p = "┆"; string img = "☼"; + string sep = "␣"; string on_o = "「"; auto on_c = "」"; string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { diff --git a/src/doc_reform/source/paths_source.d b/src/doc_reform/source/paths_source.d index 4b4abf7..6efca00 100644 --- a/src/doc_reform/source/paths_source.d +++ b/src/doc_reform/source/paths_source.d @@ -10,7 +10,9 @@ import std.array, std.regex, std.stdio, std.conv : to; -import doc_reform.meta.rgx; +import + doc_reform.meta.defaults, + doc_reform.meta.rgx; template PodManifest() { mixin DocReformRgxInit; static auto rgx = Rgx(); @@ -60,7 +62,9 @@ template PodManifest() { } template PathMatters() { mixin DocReformRgxInit; - static auto rgx = Rgx(); + mixin InternalMarkup; + static auto rgx = Rgx(); + static auto mkup = InlineMarkup(); auto PathMatters(O,E)( O _opt_actions, E _env, @@ -153,7 +157,6 @@ template PathMatters() { string _fns = _fns; // required here by dmd & not by ldc (for D:2078) auto _opt_actions = _opt_actions; auto _env = _env; - string _sep = "␣"; struct SRC_ { bool is_pod() { return (_manifest.pod_manifest_path.length > 0) ? true : false; @@ -187,12 +190,12 @@ template PathMatters() { string _uid; if (is_pod && !(pod_name_with_path.empty)) { if (pod_name_with_path.baseName == filename_base) { - _uid = filename_base ~ "." ~ filename_extension ~ _sep ~ lng; + _uid = filename_base ~ "." ~ filename_extension ~ mkup.sep ~ lng; } else { - _uid = pod_name_with_path.baseName ~ _sep ~ filename_base ~ "." ~ filename_extension ~ _sep ~ lng; + _uid = pod_name_with_path.baseName ~ mkup.sep ~ filename_base ~ "." ~ filename_extension ~ mkup.sep ~ lng; } } else { - _uid = _sep ~ filename_base ~ "." ~ filename_extension ~ _sep ~ lng; + _uid = mkup.sep ~ filename_base ~ "." ~ filename_extension ~ mkup.sep ~ lng; } return _uid; } @@ -206,18 +209,18 @@ template PathMatters() { +/ string _fn; if (pod_name_with_path.baseName == filename_base) { - _fn = filename_base ~ _sep ~ filename_extension ~ _sep ~ lng; + _fn = filename_base ~ mkup.sep ~ filename_extension ~ mkup.sep ~ lng; } else if (!(pod_name_with_path.empty)) { - _fn = pod_name_with_path.baseName ~ _sep ~ filename_base ~ _sep ~ filename_extension ~ _sep ~ lng; + _fn = pod_name_with_path.baseName ~ mkup.sep ~ filename_base ~ mkup.sep ~ filename_extension ~ mkup.sep ~ lng; } else { - _fn = "_" ~ _sep ~ filename_base ~ _sep ~ filename_extension ~ _sep ~ lng; + _fn = "_" ~ mkup.sep ~ filename_base ~ mkup.sep ~ filename_extension ~ mkup.sep ~ lng; } return _fn; } string docname_composite_unique_per_src_pod() { /+ z pod name if any + src filename (without lng code) - filename ~ _sep ~ lng + filename ~ mkup.sep ~ lng * unique per src pod used by - pod (multilingual collection) @@ -225,11 +228,11 @@ template PathMatters() { +/ string _fn; if (pod_name_with_path.baseName == filename_base) { - _fn = filename_base ~ _sep ~ filename_extension; + _fn = filename_base ~ mkup.sep ~ filename_extension; } else if (!(pod_name_with_path.empty)) { - _fn = pod_name_with_path.baseName ~ _sep ~ filename_base ~ _sep ~ filename_extension; + _fn = pod_name_with_path.baseName ~ mkup.sep ~ filename_base ~ mkup.sep ~ filename_extension; } else { - _fn = "_" ~ _sep ~ filename_base ~ _sep ~ filename_extension; + _fn = "_" ~ mkup.sep ~ filename_base ~ mkup.sep ~ filename_extension; } return _fn; } -- cgit v1.2.3