diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-12-18 10:55:24 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2020-02-08 19:49:11 -0500 |
commit | ed17763e72b7a9508432e341cb4aca1b2186d329 (patch) | |
tree | a2f98dcd0dbc309a840d6575a49518bf5cc9b5a5 /org | |
parent | dmd releaseMode results in runtime errors (diff) |
cosmetic primarily "format"
Diffstat (limited to 'org')
-rw-r--r-- | org/default_regex.org | 2 | ||||
-rw-r--r-- | org/metaverse.org | 72 | ||||
-rw-r--r-- | org/spine.org | 11 |
3 files changed, 54 insertions, 31 deletions
diff --git a/org/default_regex.org b/org/default_regex.org index bdd7863..3dd9cd1 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -108,7 +108,7 @@ static comment = ctRegex!(`^%+ `); static variable_doc_title = ctRegex!(`@title`); static variable_doc_author = ctRegex!(`@author|@creator`); static raw_author_munge = ctRegex!(`(?P<last>\S.+?),\s+(?P<first>.+)`,"i"); -static yaml_header_meta_title = ctRegex!(`^\s*(?:title\s*:\s*(?:"?\w|$))`, "m"); +static yaml_header_meta_title = ctRegex!(`^\s*title\s*:\s*(?:"?\w|$)`, "m"); static yaml_config = ctRegex!(`^[a-z]+\s*:\s*(?:"?\w|$)`, "m"); #+END_SRC diff --git a/org/metaverse.org b/org/metaverse.org index c7f3481..77a9051 100644 --- a/org/metaverse.org +++ b/org/metaverse.org @@ -1680,8 +1680,7 @@ if (biblio_ordered.length > 0) { #+BEGIN_SRC d string out_; foreach (entry; biblio_ordered) { - out_ = format( - "%s \"%s\"%s%s%s%s%s%s%s%s%s.", + out_ = format("%s \"%s\"%s%s%s%s%s%s%s%s%s.", ((entry["author"].str.empty) ? entry["editor"].str : entry["author"].str), entry["fulltitle"].str, ((entry["journal"].str.empty) ? "" : ", " ~ mkup.italic ~ mkup.ff_o ~ entry["journal"].str ~ mkup.ff_c ~ mkup.italic), @@ -1826,10 +1825,13 @@ comp_obj_toc.attrib.indent_hang = indent["hang_position"]; comp_obj_toc.attrib.indent_base = indent["base_position"]; comp_obj_toc.attrib.bullet = false; if (the_endnotes_section.length > 1) { - toc_txt_ = format( - mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c, + toc_txt_ = format("%s%s%s%s%s#%s", + mkup.lnk_o, "Endnotes", + mkup.lnk_c, + mkup.url_o, "endnotes", + mkup.url_c, ); toc_txt_= toc_txt_.links_and_images; comp_obj_toc.text = toc_txt_.to!string.strip; @@ -1837,10 +1839,13 @@ if (the_endnotes_section.length > 1) { the_table_of_contents_section ~= comp_obj_toc; } if (the_glossary_section.length > 1) { - toc_txt_ = format( - mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c, + toc_txt_ = format("%s%s%s%s#%s%s", + mkup.lnk_o, "Glossary", + mkup.lnk_c, + mkup.url_o, "glossary", + mkup.url_c, ); toc_txt_= toc_txt_.links_and_images; comp_obj_toc.text = toc_txt_.to!string.strip; @@ -1848,10 +1853,13 @@ if (the_glossary_section.length > 1) { the_table_of_contents_section ~= comp_obj_toc; } if (the_bibliography_section.length > 1){ - toc_txt_ = format( - mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c, + toc_txt_ = format("%s%s%s%s#%s%s", + mkup.lnk_o, "Bibliography", + mkup.lnk_c, + mkup.url_o, "bibliography", + mkup.url_c, ); toc_txt_= toc_txt_.links_and_images; comp_obj_toc.text = toc_txt_.to!string.strip; @@ -1859,10 +1867,13 @@ if (the_bibliography_section.length > 1){ the_table_of_contents_section ~= comp_obj_toc; } if (the_bookindex_section.length > 1) { - toc_txt_ = format( - mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c, + toc_txt_ = format("%s%s%s%s#%s%s", + mkup.lnk_o, "Book Index", + mkup.lnk_c, + mkup.url_o, "bookindex", + mkup.url_c, ); toc_txt_= toc_txt_.links_and_images; comp_obj_toc.text = toc_txt_.to!string.strip; @@ -1870,10 +1881,13 @@ if (the_bookindex_section.length > 1) { the_table_of_contents_section ~= comp_obj_toc; } if (the_blurb_section.length > 1) { - toc_txt_ = format( - mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c, + toc_txt_ = format("%s%s%s%s#%s%s", + mkup.lnk_o, "Blurb", + mkup.lnk_c, + mkup.url_o, "blurb", + mkup.url_c, ); toc_txt_= toc_txt_.links_and_images; comp_obj_toc.has.inline_links = true; @@ -5061,10 +5075,18 @@ char[] font_faces_line()( static auto mkup = InlineMarkup(); if (textline.match(rgx.inline_faces_line)) { textline = textline - .replaceFirst(rgx.inline_emphasis_line, format(q"┃%s%s%s%s%s%s┃", mkup.emph, mkup.ff_o, "$1", mkup.ff_c, mkup.emph, "$2")) - .replaceFirst(rgx.inline_bold_line, format(q"┃%s%s%s%s%s%s┃", mkup.bold, mkup.ff_o, "$1", mkup.ff_c, mkup.bold, "$2")) - .replaceFirst(rgx.inline_underscore_line, format(q"┃%s%s%s%s%s%s┃", mkup.underscore, mkup.ff_o, "$1", mkup.ff_c, mkup.underscore, "$2")) - .replaceFirst(rgx.inline_italics_line, format(q"┃%s%s%s%s%s%s┃", mkup.italic, mkup.ff_o, "$1", mkup.ff_c, mkup.italic, "$2")); + .replaceFirst(rgx.inline_emphasis_line, + format(q"┃%s%s%s%s%s%s┃", + mkup.emph, mkup.ff_o, "$1", mkup.ff_c, mkup.emph, "$2")) + .replaceFirst(rgx.inline_bold_line, + format(q"┃%s%s%s%s%s%s┃", + mkup.bold, mkup.ff_o, "$1", mkup.ff_c, mkup.bold, "$2")) + .replaceFirst(rgx.inline_underscore_line, + format(q"┃%s%s%s%s%s%s┃", + mkup.underscore, mkup.ff_o, "$1", mkup.ff_c, mkup.underscore, "$2")) + .replaceFirst(rgx.inline_italics_line, + format(q"┃%s%s%s%s%s%s┃", + mkup.italic, mkup.ff_o, "$1", mkup.ff_c, mkup.italic, "$2")); } return textline; } @@ -5856,10 +5878,13 @@ static struct ObjInlineMarkup { "hang_position" : obj_["lev_markup_number"].to!int, "base_position" : obj_["lev_markup_number"].to!int, ]; - toc_txt_ = format( - mkup.lnk_o ~ "%s".strip ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c, - heading_toc_, + toc_txt_ = format("%s%s%s%s#%s%s", + mkup.lnk_o, + heading_toc_.strip, + mkup.lnk_c, + mkup.url_o, _anchor_tag, + mkup.url_c, ); toc_txt_= toc_txt_.links_and_images; comp_obj_toc = comp_obj_toc.init; @@ -5898,10 +5923,13 @@ static struct ObjInlineMarkup { lev4_subtoc[tag_in_seg["seg_lv4"]] = []; break; case 5: .. case 7: - subtoc_txt_ = format( - mkup.lnk_o ~ "%s".strip ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c, - heading_toc_, + subtoc_txt_ = format("%s%s%s%s#%s%s", + mkup.lnk_o, + heading_toc_.strip, + mkup.lnk_c, + mkup.url_o, _anchor_tag, + mkup.url_c, ); lev4_subtoc[tag_in_seg["seg_lv4"]] ~= links_and_images(obj_["lev_markup_number"] diff --git a/org/spine.org b/org/spine.org index 1ecf248..27dfdc1 100644 --- a/org/spine.org +++ b/org/spine.org @@ -735,19 +735,15 @@ auto program_info() { return program_name; } string ver() { - string ver_ = format( - "%s.%s.%s", + return format("%s.%s.%s", _ver.major, _ver.minor, _ver.patch, ); - return ver_; } string compiler() { - string ver_ = format( - "%s D:%s, %s %s", + return format ("%s D:%s, %s %s", __VENDOR__, __VERSION__, bits, os, ); - return ver_; } } return ProgramInfo(); @@ -1355,8 +1351,7 @@ struct DocumentMatters { return program_info.ver; } string name_and_version() @trusted { - return format( - "%s-%s", + return format("%s-%s", name, ver, ); |