aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta/metadoc_from_src.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc_reform/meta/metadoc_from_src.d')
-rw-r--r--src/doc_reform/meta/metadoc_from_src.d72
1 files changed, 50 insertions, 22 deletions
diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d
index 99de32c..9178fae 100644
--- a/src/doc_reform/meta/metadoc_from_src.d
+++ b/src/doc_reform/meta/metadoc_from_src.d
@@ -1294,8 +1294,7 @@ template docAbstraction() {
}
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),
@@ -1386,10 +1385,13 @@ template docAbstraction() {
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;
@@ -1397,10 +1399,13 @@ template docAbstraction() {
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;
@@ -1408,10 +1413,13 @@ template docAbstraction() {
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;
@@ -1419,10 +1427,13 @@ template docAbstraction() {
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;
@@ -1430,10 +1441,13 @@ template docAbstraction() {
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;
@@ -4042,10 +4056,18 @@ template docAbstraction() {
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;
}
@@ -4659,10 +4681,13 @@ template docAbstraction() {
"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;
@@ -4701,10 +4726,13 @@ template docAbstraction() {
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"]