From ac868b590106763c2b3223a1af5cf9f49cce6ca5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 30 Dec 2018 20:55:09 -0500 Subject: cosmetic --- org/meta_abstraction.org | 90 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 66 insertions(+), 24 deletions(-) (limited to 'org/meta_abstraction.org') diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index 8b8fe79..51b089c 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -613,7 +613,7 @@ scope(failure) { line, ); } -line = (line).replaceAll(rgx.true_dollar, "$$$$"); +line = line.replaceAll(rgx.true_dollar, "$$$$"); /+ dollar represented as $$ needed to stop submatching on $ (substitutions using ${identifiers} must take into account (i.e. happen earlier)) +/ @@ -950,7 +950,7 @@ if there is a blurb section you need to: /+ within block object: group +/ line = _doc_header_and_make_substitutions_(line, conf_make_meta); line = _doc_header_and_make_substitutions_fontface_(line, conf_make_meta); - line = (line) + line = line .replaceAll(rgx.para_delimiter, mkup.br_paragraph ~ "$1"); _group_block_(line, an_object, obj_type_status); continue; @@ -965,11 +965,11 @@ if there is a blurb section you need to: line = _doc_header_and_make_substitutions_(line, conf_make_meta); line = _doc_header_and_make_substitutions_fontface_(line, conf_make_meta); if (auto m = line.match(rgx.spaces_line_start)) { - line = (line) + line = line .replaceAll(rgx.spaces_line_start, (m.captures[1]).translate([ ' ' : mkup.nbsp ])); } if (auto m = line.match(rgx.spaces_multiple)) { - line = (line) + line = line .replaceAll(rgx.spaces_multiple, (m.captures[1]).translate([ ' ' : mkup.nbsp ])); } _block_block_(line, an_object, obj_type_status); @@ -3517,7 +3517,7 @@ void _biblio_block_( tmp ~= au.str; } } - tmp = (tmp).replace(rgx.trailing_comma, ""); + tmp = tmp.replace(rgx.trailing_comma, ""); j["author"].str = tmp; goto default; case "editor_raw": // editor_arr editor (fn sn) @@ -3532,7 +3532,7 @@ void _biblio_block_( tmp ~= ed.str; } } - tmp = (tmp).replace(rgx.trailing_comma, ""); + tmp = tmp.replace(rgx.trailing_comma, ""); j["editor"].str = tmp; goto default; case "fulltitle": // title & subtitle @@ -4927,7 +4927,7 @@ auto font_faces_line(T)( ) { static auto rgx = Rgx(); if (textline.match(rgx.inline_faces_line)) { - textline = (textline) + textline = textline .replaceFirst(rgx.inline_emphasis_line, ("*{$1}*$2")) .replaceFirst(rgx.inline_bold_line, ("!{$1}!$2")) .replaceFirst(rgx.inline_underscore_line, ("_{$1}_$2")) @@ -5269,7 +5269,7 @@ static struct ObjInlineMarkupMunge { if (obj_txt_in.match(rgx.smid_inline_url_generic)) { /+ link: naked url: http://url +/ if (obj_txt_in.match(rgx.smid_inline_link_naked_url)) { - obj_txt_in = (obj_txt_in).replaceAll( + obj_txt_in = obj_txt_in.replaceAll( rgx.smid_inline_link_naked_url, ("$1" ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c @@ -5283,7 +5283,7 @@ static struct ObjInlineMarkupMunge { { link which includes url as footnote }http://url~{ { http://url }http://url }~ +/ if (obj_txt_in.match(rgx.smid_inline_link_endnote_url_helper)) { - obj_txt_in = (obj_txt_in) + obj_txt_in = obj_txt_in .replaceAll( rgx.smid_inline_link_endnote_url_helper_punctuated, (mkup.lnk_o ~ "$1" ~ mkup.lnk_c @@ -5305,7 +5305,7 @@ static struct ObjInlineMarkupMunge { { linked text or image }http://url +/ if (obj_txt_in.match(rgx.smid_inline_link_markup_regular)) { - obj_txt_in = (obj_txt_in).replaceAll( + obj_txt_in = obj_txt_in.replaceAll( rgx.smid_inline_link_markup_regular, ("$1" ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c @@ -5334,7 +5334,7 @@ static struct ObjInlineMarkupMunge { writeln("Image: ", obj_txt_in); } if (obj_txt_in.match(rgx.smid_image_with_dimensions)) { - obj_txt_in = (obj_txt_in).replaceAll( + obj_txt_in = obj_txt_in.replaceAll( rgx.smid_image_with_dimensions, ("$1" ~ mkup.img ~ "$2,w$3h$4 " @@ -5344,7 +5344,7 @@ static struct ObjInlineMarkupMunge { writeln("IMAGE with size: ", obj_txt_in); // decide on representation } } else if (obj_txt_in.match(rgx.smid_image)) { - obj_txt_in = (obj_txt_in).replaceAll( + obj_txt_in = obj_txt_in.replaceAll( rgx.smid_image, ("$1" ~ mkup.img ~ "$2,w0h0 " @@ -5372,7 +5372,7 @@ static struct ObjInlineMarkupMunge { bool flg_notes_reg = false; bool flg_notes_star = false; bool flg_notes_plus = false; - obj_txt_in = (obj_txt_in).replaceAll( + obj_txt_in = obj_txt_in.replaceAll( rgx.inline_notes_curly, (mkup.en_a_o ~ " $1" ~ mkup.en_a_c) ); @@ -5471,7 +5471,7 @@ static struct ObjInlineMarkupMunge { obj_txt_in = url_links(obj_txt_in); } if (auto m = obj_txt_in.match(rgx.para_inline_link_anchor)) { - obj_txt_in = (obj_txt_in) + obj_txt_in = obj_txt_in .replaceAll(rgx.para_inline_link_anchor, "┋$1┋"); } auto ftn = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in, reset_note_numbers); @@ -5520,7 +5520,7 @@ static struct ObjInlineMarkupMunge { } } body { - obj_txt["munge"]=(obj_txt_in) + obj_txt["munge"] = obj_txt_in .replaceFirst(rgx.heading, "") .replaceFirst(rgx.object_number_off_all, "") .strip; @@ -5677,7 +5677,7 @@ static struct ObjInlineMarkupMunge { } } body { - obj_txt_in = (obj_txt_in).replaceAll(rgx.space, mkup.nbsp); + obj_txt_in = obj_txt_in.replaceAll(rgx.space, mkup.nbsp); obj_txt["munge"] = obj_txt_in; return obj_txt["munge"]; } @@ -6081,7 +6081,7 @@ private: } if ((!empty(heading_number_auto_composite)) && (obj_["lev_markup_number"].to!uint >= conf_make_meta.make.auto_num_top_lv)) { - munge_=(munge_) + munge_ = munge_ .replaceFirst(rgx.heading, "$1~$2 " ~ heading_number_auto_composite ~ ". ") .replaceFirst(rgx.heading_marker_missing_tag, @@ -6109,16 +6109,16 @@ private: if (!(munge_.match(rgx.heading_anchor_tag))) { if (munge_.match(rgx.heading_identify_anchor_tag)) { if (auto m = munge_.match(rgx.heading_extract_named_anchor_tag)) { - munge_=(munge_).replaceFirst( + munge_ = munge_.replaceFirst( rgx.heading_marker_missing_tag, "$1~" ~ m.captures[1].toLower ~ "_" ~ m.captures[2] ~ " "); if (auto n = munge_.match(rgx.heading_anchor_tag_plus_colon)) { auto tag_remunge_ = n.captures[2] .replaceAll(rgx.heading_marker_tag_has_colon, ".."); - munge_=(munge_).replaceFirst(rgx.heading_anchor_tag_plus_colon, n.captures[1] ~ tag_remunge_ ~ " "); + munge_=munge_.replaceFirst(rgx.heading_anchor_tag_plus_colon, n.captures[1] ~ tag_remunge_ ~ " "); } } else if (auto m = munge_.match(rgx.heading_extract_unnamed_anchor_tag)) { - munge_=(munge_).replaceFirst( + munge_ = munge_.replaceFirst( rgx.heading_marker_missing_tag, "$1~" ~ "s" ~ m.captures[1] ~ " "); } @@ -6127,7 +6127,7 @@ private: heading_num_lev1 = 0; } heading_num_lev1 ++; - munge_=(munge_).replaceFirst( + munge_ = munge_.replaceFirst( rgx.heading_marker_missing_tag, "$1~" ~ "x" ~ heading_num_lev1.to!string ~ " "); } @@ -6689,7 +6689,7 @@ struct BookIndexReportSection { foreach (mainkey; mainkeys) { write("_0_1 !{", mainkey, "}! "); foreach (ref_; bookindex_unordered_hashes[mainkey]["_a"]) { - auto go = (ref_).replaceAll(rgx.book_index_go, "$1"); + auto go = ref_.replaceAll(rgx.book_index_go, "$1"); write(" {", ref_, "}#", go, ", "); } writeln(" \\\\"); @@ -6699,7 +6699,7 @@ struct BookIndexReportSection { foreach (subkey; subkeys) { write(" ", subkey, ", "); foreach (ref_; bookindex_unordered_hashes[mainkey][subkey]) { - auto go = (ref_).replaceAll(rgx.book_index_go, "$1"); + auto go = ref_.replaceAll(rgx.book_index_go, "$1"); write(" {", ref_, "}#", go, ", "); } writeln(" \\\\"); @@ -6823,7 +6823,7 @@ struct BookIndexReportSection { bi_tmp ~= " \\\\\n "; ++skn; } - bi_tmp = (bi_tmp).replaceFirst(rgx.trailing_linebreak, ""); + bi_tmp = bi_tmp.replaceFirst(rgx.trailing_linebreak, ""); comp_obj_para = comp_obj_para.init; comp_obj_para.metainfo.is_of_part = "backmatter"; comp_obj_para.metainfo.is_of_section = "bookindex"; @@ -7863,18 +7863,36 @@ struct DocObj_MetaInfo_ { int parent_ocn = 0; int last_decendant_ocn = 0; } +#+END_SRC + +**** object text attributes + +#+name: meta_structs_init +#+BEGIN_SRC d struct DocObj_TxtAttrib_ { int indent_base = 0; int indent_hang = 0; bool bullet = false; string language = ""; // not implemented, consider } +#+END_SRC + +**** object has within it + +#+name: meta_structs_init +#+BEGIN_SRC d struct DocObj_Has_ { // has bool inline_links = false; bool inline_notes_reg = false; bool inline_notes_star = false; bool contains_image_without_dimensions = false; } +#+END_SRC + +**** table attributes + +#+name: meta_structs_init +#+BEGIN_SRC d struct DocObj_Table_ { int number_of_columns = 0; double[] column_widths = []; @@ -7882,14 +7900,32 @@ struct DocObj_Table_ { bool heading = false; bool walls = false; // not implemented } +#+END_SRC + +**** code attributes + +#+name: meta_structs_init +#+BEGIN_SRC d struct DocObj_CodeBlock_ { string syntax = ""; } +#+END_SRC + +**** pointers + +#+name: meta_structs_init +#+BEGIN_SRC d struct DocObj_Pointer_ { int doc_object = 0; int html_segnames = 0; int heading = 0; } +#+END_SRC + +**** tags + +#+name: meta_structs_init +#+BEGIN_SRC d struct DocObj_Tags_ { string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ]; // TODO redundant? see markedup and collapsed ancestors DONE string anchor_tag_html = ""; @@ -7903,6 +7939,12 @@ struct DocObj_Tags_ { string[] lev4_subtoc = []; string[] anchor_tags = []; } +#+END_SRC + +**** composite object the parts + +#+name: meta_structs_init +#+BEGIN_SRC d struct ObjGenericComposite { string text = ""; DocObj_MetaInfo_ metainfo; -- cgit v1.2.3