aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/output/xmls.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2018-10-30 11:46:44 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-04-10 15:14:15 -0400
commitc37eb0768635a42686ea986343ff95ae03f08c1d (patch)
treeb05d4c4030758aa245f9bb483c7aaa36f5759ada /src/doc_reform/output/xmls.d
parent0.2.1 segnames, anchor tags (diff)
0.3.0 internal links, anchor tags & segment associationsdoc-reform_v0.3.0
Diffstat (limited to 'src/doc_reform/output/xmls.d')
-rw-r--r--src/doc_reform/output/xmls.d23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d
index bc93271..6154010 100644
--- a/src/doc_reform/output/xmls.d
+++ b/src/doc_reform/output/xmls.d
@@ -25,16 +25,10 @@ template outputXHTMLs() {
case "head":
delimit_ ~= "\n<div class=\"doc_title\">\n" ;
break;
- case "toc_seg":
+ case "toc":
delimit_ ~= "\n<div class=\"doc_toc\">\n" ;
break;
- case "toc_scroll":
- delimit_ ~= "\n<div class=\"doc_toc\">\n" ;
- break;
- case "bookindex_seg":
- delimit_ ~= "\n<div class=\"doc_bookindex\">\n" ;
- break;
- case "bookindex_scroll":
+ case "bookindex":
delimit_ ~= "\n<div class=\"doc_bookindex\">\n" ;
break;
default:
@@ -343,6 +337,7 @@ template outputXHTMLs() {
string _suffix = ".html",
string _xml_type = "seg",
) {
+ string seg_lvs;
if (obj.has.inline_links) {
if ((_txt.match(rgx.mark_internal_site_lnk))
&& (_xml_type == "scroll")) { // conditions reversed to avoid: gdc compiled program run segfault
@@ -351,9 +346,13 @@ template outputXHTMLs() {
"$1");
}
if (_xml_type == "seg" || _xml_type == "epub") {
+ seg_lvs = (_xml_type == "epub") ? "seg_lv1_to_4" : "seg_lv4";
foreach (m; _txt.match(rgx.inline_link_hash)) {
if (m.captures[3] in doc_matters.xml.tag_associations) {
- if (m.captures[3] == doc_matters.xml.tag_associations[(m.captures[3])][0]) {
+ if (
+ m.captures[3]
+ == doc_matters.xml.tag_associations[(m.captures[3])][seg_lvs]
+ ) {
_txt = _txt.replaceFirst(
rgx.inline_link_hash,
"┥$1┝┤$3" ~ _suffix ~ "├"
@@ -362,7 +361,7 @@ template outputXHTMLs() {
_txt = _txt.replaceFirst(
rgx.inline_link_hash,
"┥$1┝┤"
- ~ doc_matters.xml.tag_associations[(m.captures[3])][0]
+ ~ doc_matters.xml.tag_associations[(m.captures[3])][seg_lvs]
~ _suffix
~ "#" ~ "$3"
~ "├"
@@ -370,7 +369,9 @@ template outputXHTMLs() {
}
} else {
writeln(
- "WARNING on internal document links, anchor to link not found in document, "
+ "WARNING on internal document links, anchor to link <<"
+ ~ m.captures[3]
+ ~ ">> not found in document, "
~ "anchor: " ~ m.captures[3]
~ " document: " ~ doc_matters.src.filename
);