aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/output_sqlite_discrete.org
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 /org/output_sqlite_discrete.org
parentremove .toml extension (diff)
various minordoc-reform_v0.0.25
Diffstat (limited to 'org/output_sqlite_discrete.org')
-rw-r--r--org/output_sqlite_discrete.org79
1 files changed, 45 insertions, 34 deletions
diff --git a/org/output_sqlite_discrete.org b/org/output_sqlite_discrete.org
index ecf8033..c659441 100644
--- a/org/output_sqlite_discrete.org
+++ b/org/output_sqlite_discrete.org
@@ -36,7 +36,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
mixin SiSUoutputRgxInit;
struct sqlite_format_and_load_objects {
<<sanitize_text_for_search>>
- <<sanitize_and_mmunge_inline_html>>
+ <<sanitize_and_munge_inline_html>>
<<html_objects>>
<<sqlite_load_object>>
<<hub_format_and_sqlite_load_objects>>
@@ -49,7 +49,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
auto ref I doc_matters,
) {
<<sqlite_db_initialize>>
- <<sqlite_table_initialize>>
+ <<sqlite_table_initialize>>
<<sqlite_create_table_metadata_and_src_txt>>
/* */<<sqlite_create_table_urls>>
<<sqlite_create_table_objects>>
@@ -152,13 +152,13 @@ light html objects
***** munge
****** general munge (special characters, inline markup, move notes)
-#+name: sanitize_and_mmunge_inline_html
+#+name: sanitize_and_munge_inline_html
#+BEGIN_SRC d
auto munge_html(O)(
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;")
@@ -168,17 +168,17 @@ auto munge_html(O)(
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;
@@ -207,7 +207,7 @@ auto munge_html(O)(
****** special characters
-#+name: sanitize_and_mmunge_inline_html
+#+name: sanitize_and_munge_inline_html
#+BEGIN_SRC d
string html_special_characters(string _txt){
_txt = (_txt)
@@ -223,7 +223,7 @@ string html_special_characters(string _txt){
****** special characters for code
-#+name: sanitize_and_mmunge_inline_html
+#+name: sanitize_and_munge_inline_html
#+BEGIN_SRC d
string html_special_characters_code(string _txt){
_txt = (_txt)
@@ -238,20 +238,20 @@ string html_special_characters_code(string _txt){
****** font_face
-#+name: sanitize_and_mmunge_inline_html
+#+name: sanitize_and_munge_inline_html
#+BEGIN_SRC d
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;
}
#+END_SRC
@@ -413,7 +413,7 @@ auto html_table(O)(
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;
@@ -429,9 +429,17 @@ auto html_table(O)(
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>";
@@ -480,6 +488,7 @@ db.run("
DROP TABLE IF EXISTS metadata_and_text;
DROP TABLE IF EXISTS doc_objects;
DROP TABLE IF EXISTS urls;
+BEGIN;
#+END_SRC
******* 1. create tables
@@ -607,13 +616,14 @@ CREATE TABLE doc_objects (
digest_clean CHAR(256),
digest_all CHAR(256),
types CHAR(1) NULL
-)
+);
#+END_SRC
****** d }
#+name: sqlite_close_initialize
#+BEGIN_SRC d
+ COMMIT
");
#+END_SRC
@@ -915,7 +925,7 @@ insert_metadata.inject(
#+name: sqlite_insert_doc_objects
#+BEGIN_SRC d
-Statement insert_doc_objects = db.prepare("
+Statement _insert_doc_objects = db.prepare("
#+END_SRC
********* sql insert into
@@ -1010,7 +1020,7 @@ either:
#+name: sqlite_insert_doc_objects
#+BEGIN_SRC d
");
-return insert_doc_objects;
+return _insert_doc_objects;
#+END_SRC
******* TODO (within loop not here - insert doc objects
@@ -1440,6 +1450,7 @@ foreach (part; doc_parts) {
insert_doc_objects.execute(); insert_doc_objects.reset();
}
}
+insert_doc_objects.finalize();
#+END_SRC
* __END__