aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-01-14 10:08:53 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit099d54647f0ff4bf7effb7c554e987eeff11fb85 (patch)
treec5529ce0c6eabaca66ab6164ff954db64d9eb149 /src
parentinsert file list: gather & make available a list of insert files (if any) (diff)
identify internal links for downstream munging
Diffstat (limited to 'src')
-rw-r--r--src/sdp/ao_abstract_doc_source.d41
-rw-r--r--src/sdp/ao_defaults.d1
-rw-r--r--src/sdp/ao_rgx.d10
3 files changed, 33 insertions, 19 deletions
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d
index ec1536e..e813260 100644
--- a/src/sdp/ao_abstract_doc_source.d
+++ b/src/sdp/ao_abstract_doc_source.d
@@ -42,7 +42,7 @@ template SiSUdocAbstraction() {
h_text_5, // extra level, drop
content_non_header
} // header section A-D; header text 1-4
- enum DocStructCollapsedHeading { lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7 } // not yet used
+ enum DocStructCollapsedHeading { lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7 }
/+ biblio variables +/
string biblio_tag_name, biblio_tag_entry, st;
string[] biblio_arr_json;
@@ -77,7 +77,7 @@ template SiSUdocAbstraction() {
switch (obj.heading_lev_markup) {
case 0:
lv_ancestors[0] = to!string(obj.text);
- foreach(k; 1..8) { // 1 .. 7 ?
+ foreach(k; 1..8) {
lv_ancestors[k] = "";
}
goto default;
@@ -1030,8 +1030,9 @@ template SiSUdocAbstraction() {
comp_obj_toc.bullet = false;
if (the_endnotes_section.length > 1) {
toc_txt_ = format(
- "{ %s }../%s.fnSuffix",
+ "{ %s }%s../%s.fnSuffix",
"Endnotes",
+ mkup.mark_internal_site_lnk,
"endnotes", // segment_anchor_tag_that_object_belongs_to
);
toc_txt_= munge.url_links(toc_txt_);
@@ -1040,8 +1041,9 @@ template SiSUdocAbstraction() {
}
if (the_glossary_section.length > 1) {
toc_txt_ = format(
- "{ %s }../%s.fnSuffixs",
+ "{ %s }%s../%s.fnSuffixs",
"Glossary",
+ mkup.mark_internal_site_lnk,
"glossary", // segment_anchor_tag_that_object_belongs_to
);
toc_txt_= munge.url_links(toc_txt_);
@@ -1058,8 +1060,9 @@ template SiSUdocAbstraction() {
}
if (the_bibliography_section.length > 1){
toc_txt_ = format(
- "{ %s }../%s.fnSuffix",
+ "{ %s }%s../%s.fnSuffix",
"Bibliography",
+ mkup.mark_internal_site_lnk,
"bibliography", // segment_anchor_tag_that_object_belongs_to
);
toc_txt_= munge.url_links(toc_txt_);
@@ -1077,8 +1080,9 @@ template SiSUdocAbstraction() {
}
if (the_bookindex_section["seg"].length > 1) {
toc_txt_ = format(
- "{ %s }../%s.fnSuffix",
+ "{ %s }%s../%s.fnSuffix",
"Book Index",
+ mkup.mark_internal_site_lnk,
"bookindex", // segment_anchor_tag_that_object_belongs_to
);
toc_txt_= munge.url_links(toc_txt_);
@@ -1097,8 +1101,9 @@ template SiSUdocAbstraction() {
}
if (the_blurb_section.length > 1) {
toc_txt_ = format(
- "{ %s }../%s.fnSuffix",
+ "{ %s }%s../%s.fnSuffix",
"Blurb",
+ mkup.mark_internal_site_lnk,
"blurb", // segment_anchor_tag_that_object_belongs_to
);
toc_txt_= munge.url_links(toc_txt_);
@@ -3135,6 +3140,8 @@ template SiSUdocAbstraction() {
in { }
body {
ObjGenericComposite comp_obj_toc;
+ mixin InternalMarkup;
+ auto mkup = InlineMarkup();
char[] heading_toc_ = to!(char[])(obj_["body_nugget"].dup.strip);
heading_toc_ = _clean_heading_toc_(heading_toc_);
auto attrib="";
@@ -3192,7 +3199,7 @@ template SiSUdocAbstraction() {
"hang_position" : 0,
"base_position" : 0,
];
- toc_txt_ = "{ Table of Contents }../toc.fnSuffix";
+ toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "../toc.fnSuffix";
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.indent_hang = indent["hang_position"];
comp_obj_toc.indent_base = indent["base_position"];
@@ -3216,8 +3223,9 @@ template SiSUdocAbstraction() {
break;
case 4:
toc_txt_ = format(
- "{ %s }../%s.fnSuffix",
+ "{ %s }%s../%s.fnSuffix",
heading_toc_,
+ mkup.mark_internal_site_lnk,
segment_anchor_tag_that_object_belongs_to,
);
lev4_subtoc[segment_anchor_tag_that_object_belongs_to] = [];
@@ -3233,8 +3241,9 @@ template SiSUdocAbstraction() {
break;
case 5: .. case 7:
toc_txt_ = format(
- "{ %s }../%s.fnSuffix#%s",
+ "{ %s }%s../%s.fnSuffix#%s",
heading_toc_,
+ mkup.mark_internal_site_lnk,
segment_anchor_tag_that_object_belongs_to,
_anchor_tag,
);
@@ -3789,6 +3798,8 @@ template SiSUdocAbstraction() {
bool[string] opt_action_bool,
) {
mixin SiSUnode;
+ mixin InternalMarkup;
+ auto mkup = InlineMarkup();
string type_is;
string lev;
int heading_lev_markup, heading_lev_collapsed;
@@ -3852,7 +3863,7 @@ template SiSUdocAbstraction() {
bi_tmp_scroll ~= munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ");
bi_tmp_seg ~= (segment_anchor_tag_that_object_belongs_to.empty)
? munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ")
- : munge.url_links(" {" ~ ref_ ~ "}../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", ");
+ : munge.url_links(" {" ~ ref_ ~ "}" ~ mkup.mark_internal_site_lnk ~ "../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", ");
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -3869,7 +3880,7 @@ template SiSUdocAbstraction() {
bi_tmp_scroll ~= munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ");
bi_tmp_seg ~= (segment_anchor_tag_that_object_belongs_to.empty)
? munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ")
- : munge.url_links(" {" ~ ref_ ~ "}../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", ");
+ : munge.url_links(" {" ~ ref_ ~ "}" ~ mkup.mark_internal_site_lnk ~ "../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", ");
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -3937,6 +3948,8 @@ template SiSUdocAbstraction() {
);
}
body {
+ mixin InternalMarkup;
+ auto mkup = InlineMarkup();
auto munge = ObjInlineMarkupMunge();
foreach(
m;
@@ -3947,7 +3960,7 @@ template SiSUdocAbstraction() {
) {
debug(endnotes_build) {
writeln(
- "{^{", m.captures[1], ".}^}../", segment_anchor_tag_that_object_belongs_to, ".fnSuffix#noteref_\n ", m.captures[1], " ",
+ "{^{", m.captures[1], ".}^}" ~ mkup.mark_internal_site_lnk ~ "../", segment_anchor_tag_that_object_belongs_to, ".fnSuffix#noteref_\n ", m.captures[1], " ",
m.captures[2]); // sometimes need segment name (segmented html & epub)
}
// TODO NEXT you need anchor for segments at this point ->
@@ -3958,7 +3971,7 @@ template SiSUdocAbstraction() {
m.captures[1]) ~ " " ~ m.captures[2] ~ "』"
)
: (munge.url_links(
- "{^{" ~ m.captures[1] ~ ".}^}../" ~
+ "{^{" ~ m.captures[1] ~ ".}^}" ~ mkup.mark_internal_site_lnk ~ "../" ~
segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#noteref_" ~
m.captures[1]) ~ " " ~ m.captures[2] ~ "』"
);
diff --git a/src/sdp/ao_defaults.d b/src/sdp/ao_defaults.d
index c80933c..1e88e3b 100644
--- a/src/sdp/ao_defaults.d
+++ b/src/sdp/ao_defaults.d
@@ -619,6 +619,7 @@ template InternalMarkup() {
auto en_b_o = "〖"; auto en_b_c = "〗"; // endnote en_b_o: '~['; en_b_c: ']~';
auto lnk_o = "┥"; auto lnk_c = "┝";
auto url_o = "┤"; auto url_c = "├";
+ auto mark_internal_site_lnk = "¤";
auto nbsp = "░";
auto br_line = "┘";
auto br_nl = "┙";
diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d
index 6641d6a..f800a12 100644
--- a/src/sdp/ao_rgx.d
+++ b/src/sdp/ao_rgx.d
@@ -149,11 +149,11 @@ template RgxInit() {
static inline_al_delimiter_open_plus = ctRegex!(`【\+`, "m");
static inline_text_and_note_al = ctRegex!(`(?P<text>.+?)【(?:[*+ ]*)(?P<note>.+?)】`, "mg");
static inline_text_and_note_al_ = ctRegex!(`(.+?(?:【[*+]*\s+.+?】|$))`, "mg");
- static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|\.\.\/|\.\/|#)\S+)`, "mg");
- static inline_link_naked_url = ctRegex!(`(^|[ ])((?:(?:https?|git):\/\/|\.\.\/|\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
- static inline_link_markup_regular = ctRegex!(`(^|[ ])\{\s*(.+?)\s*\}((?:(?:https?|git):\/\/|\.\.\/|\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
- static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|\.\.\/|\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
- static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|\.\.\/|\.\/|#)\S+)`, "mg");
+ static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+)`, "mg");
+ static inline_link_naked_url = ctRegex!(`(^|[ ])((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
+ static inline_link_markup_regular = ctRegex!(`(^|[ ])\{\s*(.+?)\s*\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
+ static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
+ static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+)`, "mg");
static inline_a_url = ctRegex!(`(┤)(\S+?)(├)`, "mg");
/+ inline markup book index +/
static book_index = ctRegex!(`^=\{\s*(.+?)\}$`, "m");