aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-04-11 21:12:24 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit629af1457bf724ba9f0213a9b0e2ca1757f92705 (patch)
tree46332cc0cf67ed7186082036f0fd1ed4b221bb1f /src
parentremove .toml extension (diff)
various minordoc-reform_v0.0.25
Diffstat (limited to 'src')
-rw-r--r--src/sdp/meta/read_config_files.d8
-rw-r--r--src/sdp/meta/read_source_files.d4
-rw-r--r--src/sdp/output/sqlite_discrete.d73
3 files changed, 48 insertions, 37 deletions
diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d
index 74c5a12..56a2bf8 100644
--- a/src/sdp/meta/read_config_files.d
+++ b/src/sdp/meta/read_config_files.d
@@ -20,7 +20,7 @@ static template configReadInSiteTOML() {
writeln("WARNING (io debug) in config possible path locations: ", possible_config_path_locations);
}
foreach(pth; possible_config_path_locations) {
- auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_toml)).array;
+ auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_toml)).array;
if (config_file_str.length > 0) {
break;
}
@@ -57,7 +57,7 @@ static template configReadInDocTOML() {
writeln("WARNING (io debug) in config possible path locations: ", possible_config_path_locations);
}
foreach(pth; possible_config_path_locations) {
- auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_toml)).array;
+ auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_toml)).array;
if (config_file_str.length > 0) {
break;
}
@@ -110,7 +110,7 @@ static template readConfigSite() {
auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.config_local_site;
foreach(conf_fn; [_conf_file_details.config_filename_site_toml]) {
foreach(pth; possible_config_path_locations) {
- auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_fn)).array;
+ auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array;
conf_filename = conf_fn;
if (config_file_str.length > 0) {
// conf_filename = conf_fn;
@@ -160,7 +160,7 @@ static template readConfigDoc() {
auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.sisu_document_make;
foreach(conf_fn; [_conf_file_details.config_filename_document_toml]) {
foreach(pth; possible_config_path_locations) {
- auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_fn)).array;
+ auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array;
conf_filename = conf_fn;
if (config_file_str.length > 0) {
// conf_filename = conf_fn;
diff --git a/src/sdp/meta/read_source_files.d b/src/sdp/meta/read_source_files.d
index 5c7d83b..135d8e8 100644
--- a/src/sdp/meta/read_source_files.d
+++ b/src/sdp/meta/read_source_files.d
@@ -289,7 +289,7 @@ static template SiSUrawMarkupContent() {
auto insert_sub_pth = m.captures[1];
auto fn_src_insert
= chainPath(markup_src_file_path, insert_sub_pth ~ insert_fn).array;
- insert_file_list ~= to!string(fn_src_insert);
+ insert_file_list ~= fn_src_insert.to!string;
auto raw = MarkupRawUnit();
/+ TODO +/
auto markup_sourcefile_insert_content
@@ -306,7 +306,7 @@ static template SiSUrawMarkupContent() {
auto contents_insert_tu = ins.scan_subdoc_source(
_opt_action,
markup_sourcefile_insert_content,
- to!string(fn_src_insert)
+ fn_src_insert.to!string
);
contents ~= contents_insert_tu[0]; // images to extract for image list?
if (_opt_action.source || _opt_action.sisupod) {
diff --git a/src/sdp/output/sqlite_discrete.d b/src/sdp/output/sqlite_discrete.d
index b256389..541c4d8 100644
--- a/src/sdp/output/sqlite_discrete.d
+++ b/src/sdp/output/sqlite_discrete.d
@@ -56,7 +56,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
auto return ref const O obj,
) {
string _html_special_characters(string _txt){
- _txt = (_txt)
+ _txt = _txt
.replaceAll(rgx.xhtml_ampersand, "&#38;")
.replaceAll(rgx.xhtml_quotation, "&#34;")
.replaceAll(rgx.xhtml_less_than, "&#60;")
@@ -66,17 +66,17 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
return _txt;
}
string _html_font_face(string _txt){
- _txt = (_txt)
- .replaceAll(rgx.inline_emphasis, ("<em>$1</em>"))
- .replaceAll(rgx.inline_bold, ("<b>$1</b>"))
- .replaceAll(rgx.inline_underscore, ("<u>$1</u>"))
- .replaceAll(rgx.inline_italics, ("<i>$1</i>"))
- .replaceAll(rgx.inline_superscript, ("<sup>$1</sup>"))
- .replaceAll(rgx.inline_subscript, ("<sub>$1</sub>"))
- .replaceAll(rgx.inline_strike, ("<del>$1</del>"))
- .replaceAll(rgx.inline_insert, ("<ins>$1</ins>"))
- .replaceAll(rgx.inline_mono, ("<tt>$1</tt>"))
- .replaceAll(rgx.inline_cite, ("<cite>$1</cite>"));
+ _txt = _txt
+ .replaceAll(rgx.inline_emphasis, "<em>$1</em>")
+ .replaceAll(rgx.inline_bold, "<b>$1</b>")
+ .replaceAll(rgx.inline_underscore, "<u>$1</u>")
+ .replaceAll(rgx.inline_italics, "<i>$1</i>")
+ .replaceAll(rgx.inline_superscript, "<sup>$1</sup>")
+ .replaceAll(rgx.inline_subscript, "<sub>$1</sub>")
+ .replaceAll(rgx.inline_strike, "<del>$1</del>")
+ .replaceAll(rgx.inline_insert, "<ins>$1</ins>")
+ .replaceAll(rgx.inline_mono, "<tt>$1</tt>")
+ .replaceAll(rgx.inline_cite, "<cite>$1</cite>");
return _txt;
}
string _notes;
@@ -122,16 +122,16 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
}
string html_font_face(string _txt){
_txt = (_txt)
- .replaceAll(rgx.inline_emphasis, ("<em>$1</em>"))
- .replaceAll(rgx.inline_bold, ("<b>$1</b>"))
- .replaceAll(rgx.inline_underscore, ("<u>$1</u>"))
- .replaceAll(rgx.inline_italics, ("<i>$1</i>"))
- .replaceAll(rgx.inline_superscript, ("<sup>$1</sup>"))
- .replaceAll(rgx.inline_subscript, ("<sub>$1</sub>"))
- .replaceAll(rgx.inline_strike, ("<del>$1</del>"))
- .replaceAll(rgx.inline_insert, ("<ins>$1</ins>"))
- .replaceAll(rgx.inline_mono, ("<tt>$1</tt>"))
- .replaceAll(rgx.inline_cite, ("<cite>$1</cite>"));
+ .replaceAll(rgx.inline_emphasis, "<em>$1</em>")
+ .replaceAll(rgx.inline_bold, "<b>$1</b>")
+ .replaceAll(rgx.inline_underscore, "<u>$1</u>")
+ .replaceAll(rgx.inline_italics, "<i>$1</i>")
+ .replaceAll(rgx.inline_superscript, "<sup>$1</sup>")
+ .replaceAll(rgx.inline_subscript, "<sub>$1</sub>")
+ .replaceAll(rgx.inline_strike, "<del>$1</del>")
+ .replaceAll(rgx.inline_insert, "<ins>$1</ins>")
+ .replaceAll(rgx.inline_mono, "<tt>$1</tt>")
+ .replaceAll(rgx.inline_cite, "<cite>$1</cite>");
return _txt;
}
auto html_heading(O)(
@@ -223,7 +223,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
auto return ref const O obj,
string _txt,
) {
- string[] _table_rows = (_txt).split(rgx.table_delimiter_row);
+ string[] _table_rows = _txt.split(rgx.table_delimiter_row);
string[] _table_cols;
string _table;
string _tablenote;
@@ -239,9 +239,17 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
string _align = ("style=\"text-align:"
~ ((obj.table_column_aligns[col_idx] == "l")
? "left\"" : "right\""));
- _table ~= "<" ~ _col_is ~ " width=\"" ~ obj.table_column_widths[col_idx].to!string ~ "%\" " ~ _align ~ ">";
+ _table ~= "<"
+ ~ _col_is
+ ~ " width=\""
+ ~ obj.table_column_widths[col_idx].to!string
+ ~ "%\" "
+ ~ _align
+ ~ ">";
_table ~= cell;
- _table ~= "</" ~ _col_is ~ ">";
+ _table ~= "</"
+ ~ _col_is
+ ~ ">";
}
}
_table ~= "</tr>";
@@ -461,9 +469,10 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
auto db = Database(pth_sqlite.sqlite_file(doc_matters.src.filename));
// auto db = Database(":memory:"); // open database in memory
db.run("
- DROP TABLE IF EXISTS metadata_and_text;
- DROP TABLE IF EXISTS doc_objects;
- DROP TABLE IF EXISTS urls;
+ DROP TABLE IF EXISTS metadata_and_text;
+ DROP TABLE IF EXISTS doc_objects;
+ DROP TABLE IF EXISTS urls;
+ BEGIN;
CREATE TABLE metadata_and_text (
tid BIGINT PRIMARY KEY,
title VARCHAR(800) NOT NULL,
@@ -579,7 +588,8 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
digest_clean CHAR(256),
digest_all CHAR(256),
types CHAR(1) NULL
- )
+ );
+ COMMIT
");
Statement insert_metadata = db.prepare("
INSERT INTO metadata_and_text (
@@ -820,7 +830,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
}
assert(db.totalChanges == 1);
//
- Statement insert_doc_objects = db.prepare("
+ Statement _insert_doc_objects = db.prepare("
INSERT INTO doc_objects (
lid,
metadata_tid,
@@ -890,7 +900,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
:types
)
");
- return insert_doc_objects;
+ return _insert_doc_objects;
}
}
template SQLiteObjectsLoop() {
@@ -1074,6 +1084,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
insert_doc_objects.execute(); insert_doc_objects.reset();
}
}
+ insert_doc_objects.finalize();
}
}
SQLiteObjectsLoop!()(doc_matters.xml.keys_seq.sql);