aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta/metadoc_from_src.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-02-11 16:34:54 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2019-05-17 16:59:38 -0400
commit54c662aed1b2b004aeffe3d250a9dbd705897bb4 (patch)
tree0d02c0ddb99741bb2ec8ad473bfb83b3d5965ac0 /src/doc_reform/meta/metadoc_from_src.d
parentinline fontface markup, internal representation, reorganise code (diff)
metaverse single line munging tuningdoc-reform_v0.4.3
Diffstat (limited to 'src/doc_reform/meta/metadoc_from_src.d')
-rw-r--r--src/doc_reform/meta/metadoc_from_src.d46
1 files changed, 19 insertions, 27 deletions
diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d
index d82c60a..470d579 100644
--- a/src/doc_reform/meta/metadoc_from_src.d
+++ b/src/doc_reform/meta/metadoc_from_src.d
@@ -1086,6 +1086,7 @@ template DocReformDocAbstraction() {
obj_type_status["glossary_section"] = State.off;
obj_type_status["blurb_section"] = State.off;
}
+ the_document_body_section[$-1].text = (the_document_body_section[$-1].text).inline_markup_faces;
if (the_document_body_section[$-1].metainfo.is_a == "verse") {
/+ scan for endnotes for whole poem (each verse in poem) +/
foreach (i; previous_length .. the_document_body_section.length) {
@@ -1316,7 +1317,7 @@ template DocReformDocAbstraction() {
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,
+ mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
"Endnotes",
"endnotes",
);
@@ -1327,7 +1328,7 @@ template DocReformDocAbstraction() {
}
if (the_glossary_section.length > 1) {
toc_txt_ = format(
- mkup.lnk_o ~ " %s " ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
+ mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
"Glossary",
"glossary",
);
@@ -1338,7 +1339,7 @@ template DocReformDocAbstraction() {
}
if (the_bibliography_section.length > 1){
toc_txt_ = format(
- mkup.lnk_o ~ " %s " ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
+ mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
"Bibliography",
"bibliography",
);
@@ -1349,7 +1350,7 @@ template DocReformDocAbstraction() {
}
if (the_bookindex_section.length > 1) {
toc_txt_ = format(
- mkup.lnk_o ~ " %s " ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
+ mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
"Book Index",
"bookindex",
);
@@ -1360,7 +1361,7 @@ template DocReformDocAbstraction() {
}
if (the_blurb_section.length > 1) {
toc_txt_ = format(
- mkup.lnk_o ~ " %s " ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
+ mkup.lnk_o ~ "%s" ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
"Blurb",
"blurb",
);
@@ -1830,9 +1831,6 @@ template DocReformDocAbstraction() {
tag_assoc[(obj.metainfo.identifier)]["seg_lv1_to_4"]
= obj.tags.epub_segment_anchor_tag_is;
}
- if (obj.metainfo.is_a != "code") {
- obj.text = obj.text.inline_markup_faces;
- }
if (obj.metainfo.is_a == "heading") {
debug(dom) {
writeln(obj.text);
@@ -1875,7 +1873,6 @@ template DocReformDocAbstraction() {
dom_structure_markedup_tags_status = dom_structure_markedup_tags_status_buffer.dup;
dom_structure_collapsed_tags_status = dom_structure_collapsed_tags_status_buffer.dup;
foreach (ref obj; the_endnotes_section) {
- obj.text = obj.text.inline_markup_faces;
if (obj.metainfo.is_a == "heading") {
debug(dom) {
writeln(obj.text);
@@ -2045,9 +2042,6 @@ template DocReformDocAbstraction() {
/+ optional only one 1~ level +/
if (the_blurb_section.length > 1) {
foreach (ref obj; the_blurb_section) {
- if (obj.metainfo.is_a != "code") {
- obj.text = obj.text.inline_markup_faces;
- }
if (obj.metainfo.is_a == "heading") {
debug(dom) {
writeln(obj.text);
@@ -4338,22 +4332,20 @@ template DocReformDocAbstraction() {
writeln("Image: ", obj_txt_in);
}
if (obj_txt_in.match(rgx.smid_image_with_dimensions)) {
- obj_txt_in = obj_txt_in.replaceAll(
- rgx.smid_image_with_dimensions,
- ("$1"
- ~ mkup.img ~ "$2,w$3h$4 "
- ~ "$5") // ("$1{ $2 }$2$3")
- );
+ obj_txt_in = obj_txt_in
+ .replaceAll(rgx.smid_image_with_dimensions, ("$1" ~ mkup.img ~ "$2,w$3h$4 " ~ "$5"))
+ .replaceAll(rgx.smid_image_delimit, ("$1"
+ ~ mkup.lnk_o ~ "$2".strip ~ mkup.lnk_c
+ ~ mkup.url_o ~ mkup.url_c));
debug(images) {
- writeln("IMAGE with size: ", obj_txt_in); // decide on representation
+ writeln("IMAGE with size: ", obj_txt_in);
}
} else if (obj_txt_in.match(rgx.smid_image)) {
- obj_txt_in = obj_txt_in.replaceAll(
- rgx.smid_image,
- ("$1"
- ~ mkup.img ~ "$2,w0h0 "
- ~ "$3") // ("$1{ $2 }$2$3")
- );
+ obj_txt_in = obj_txt_in
+ .replaceAll(rgx.smid_image, ("$1" ~ mkup.img ~ "$2,w0h0 " ~ "$3"))
+ .replaceAll(rgx.smid_image_delimit, ("$1"
+ ~ mkup.lnk_o ~ "$2".strip ~ mkup.lnk_c
+ ~ mkup.url_o ~ mkup.url_c));
debug(images) {
writeln("IMAGE: ", obj_txt_in); // decide on representation
}
@@ -4762,7 +4754,7 @@ template DocReformDocAbstraction() {
"base_position" : obj_["lev_markup_number"].to!int,
];
toc_txt_ = format(
- mkup.lnk_o ~ " %s " ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
+ mkup.lnk_o ~ "%s".strip ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
heading_toc_,
_anchor_tag,
);
@@ -4822,7 +4814,7 @@ template DocReformDocAbstraction() {
break;
case 5: .. case 7:
subtoc_txt_ = format(
- mkup.lnk_o ~ " %s " ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
+ mkup.lnk_o ~ "%s".strip ~ mkup.lnk_c ~ mkup.url_o ~ "#%s"~ mkup.url_c,
heading_toc_,
_anchor_tag,
);