aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/out_sqlite.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2020-04-03 15:13:31 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2020-05-20 11:27:25 -0400
commit6b3555e2ae0a7a93f7ab7be1b908a4c15350d460 (patch)
tree6c1b0f2cba9a688db19e4e9574e64ab0c593efb4 /org/out_sqlite.org
parentcgi search form, highlight matched text (diff)
sql, sqlite internal site links
Diffstat (limited to 'org/out_sqlite.org')
-rw-r--r--org/out_sqlite.org38
1 files changed, 20 insertions, 18 deletions
diff --git a/org/out_sqlite.org b/org/out_sqlite.org
index 944ed18..e886fbd 100644
--- a/org/out_sqlite.org
+++ b/org/out_sqlite.org
@@ -106,7 +106,7 @@ template SQLiteHubDiscreteBuildTablesAndPopulate() {
const D doc_abstraction,
M doc_matters,
) {
- auto url_html = spineUrlsHTML!()(doc_matters.conf_make_meta.conf.w_srv_data_root_url, doc_matters.src.language);
+ auto url_html = spineUrlsHTML!()(doc_matters.conf_make_meta.conf.w_srv_data_root_url_html, doc_matters.src.language);
auto pth_sqlite = spinePathsSQLiteDiscrete!()(doc_matters.output_path, doc_matters.src.language);
pth_sqlite.base.mkdirRecurse;
auto db = Database(pth_sqlite.sqlite_file(doc_matters.src.filename));
@@ -257,7 +257,7 @@ template SQLiteInsertDocObjectsLoop() {
M doc_matters,
) {
string _uid = SQLinsertDelimiter!()(doc_matters.src.doc_uid);
- auto url_html = spineUrlsHTML!()(doc_matters.conf_make_meta.conf.w_srv_data_root_url, doc_matters.src.language);
+ auto url_html = spineUrlsHTML!()(doc_matters.conf_make_meta.conf.w_srv_data_root_url_html, doc_matters.src.language);
string insertDocObjectsRow(O)(O obj) {
<<sqlite_formatted_insertions_doc_objects>>
return _insert_doc_objects_row;
@@ -594,7 +594,7 @@ string inline_links(M,O)(
if (obj.has.inline_links) {
if (obj.metainfo.is_a != "code") {
_txt = replaceAll!(m =>
- m[1] ~ "┤" ~ to!string((obj.stow.link[m[2].to!ulong])).encode ~ "├"
+ m["linked_text"] ~ "┤" ~ to!string((obj.stow.link[m["num"].to!ulong])).encode ~ "├"
)(_txt, rgx.inline_link_number_only);
}
if ((_txt.match(rgx.mark_internal_site_lnk))
@@ -605,24 +605,26 @@ string inline_links(M,O)(
}
auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language);
if (_xml_type == "seg") {
- foreach (m; _txt.match(rgx.inline_link_hash)) {
- if (m.captures[3] in doc_matters.has.tag_associations) {
- if (m.captures[3] == doc_matters.has.tag_associations[(m.captures[3])]["seg_lv4"]) {
+ foreach (m; _txt.match(rgx.inline_link_seg_and_hash)) {
+ if (m.captures["segname"] in doc_matters.has.tag_associations) {
+ if (m.captures["segname"] == doc_matters.has.tag_associations[(m.captures["segname"])]["seg_lv4"]) {
_txt = _txt.replaceFirst(
- rgx.inline_link_hash,
+ rgx.inline_link_seg_and_hash,
"┥$1┝┤"
- ~ doc_matters.conf_make_meta.conf.w_srv_data_root_url
+ ~ doc_matters.conf_make_meta.conf.w_srv_data_root_url_html
~ "/"
- ~ pth_html.tail_fn_seg(doc_matters.src.filename, "$3.html")
+ ~ pth_html.tail_fn_seg(doc_matters.src.filename, "$2.html")
~ "├"
);
} else {
_txt = _txt.replaceFirst(
- rgx.inline_link_hash,
+ rgx.inline_link_seg_and_hash,
"┥$1┝┤"
- ~ doc_matters.conf_make_meta.conf.w_srv_data_root_url
+ ~ doc_matters.conf_make_meta.conf.w_srv_data_root_url_html
~ "/"
- ~ doc_matters.has.tag_associations[(m.captures[3])]["seg_lv4"]
+ ~ doc_matters.src.filename_base
+ ~ "/"
+ ~ doc_matters.has.tag_associations[(m.captures["segname"])]["seg_lv4"]
~ ".html"
~ "#" ~ "$3"
~ "├"
@@ -632,20 +634,20 @@ string inline_links(M,O)(
if (!(doc_matters.opt.action.quiet)) {
writeln(
"WARNING on internal document links, anchor to link <<"
- ~ m.captures[3]
+ ~ m.captures["segname"]
~ ">> not found in document, "
- ~ "anchor: " ~ m.captures[3]
+ ~ "anchor: " ~ m.captures["segname"]
~ " document: " ~ doc_matters.src.filename
);
}
}
}
} else {
- if (auto m = _txt.match(rgx.inline_link_hash)) {
+ if (auto m = _txt.match(rgx.inline_link_seg_and_hash)) {
_txt = _txt.replaceFirst(
- rgx.inline_link_hash,
+ rgx.inline_link_seg_and_hash,
"┥$1┝┤"
- ~ doc_matters.conf_make_meta.conf.w_srv_data_root_url
+ ~ doc_matters.conf_make_meta.conf.w_srv_data_root_url_html
~ "/"
~ pth_html.tail_fn_scroll(doc_matters.src.filename)
~ "#" ~ "$3"
@@ -1854,7 +1856,7 @@ string _insert_metadata = format(q"┃
SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.original_language_char),
SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.original_source),
SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.publisher),
- SQLinsertDelimiter!()(doc_matters.conf_make_meta.conf.w_srv_data_root_url)
+ SQLinsertDelimiter!()(doc_matters.conf_make_meta.conf.w_srv_data_root_url_html)
);
#+END_SRC