From 9c42b4567f35aceacce1298a6d4789d6789e5bfe Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 17 Dec 2019 13:22:51 -0500 Subject: specify Tuple content for read in files, remove traits.std --- src/doc_reform/io_out/latex.d | 32 ++++++++++---------- src/doc_reform/io_out/odt.d | 18 +++++------ src/doc_reform/io_out/package.d | 1 - src/doc_reform/io_out/sqlite.d | 10 +++---- src/doc_reform/io_out/xmls.d | 66 ++++++++++++++++++++--------------------- 5 files changed, 62 insertions(+), 65 deletions(-) (limited to 'src/doc_reform/io_out') diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index a97a697..ceab202 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -569,24 +569,24 @@ auto tablarize(O)( string _tablenote; foreach(row_idx, row; _table_rows) { _table_cols = row.split(rgx.table_delimiter_col); - _table ~= ""; - foreach(col_idx, cell; _table_cols) { - if ((_table_cols.length == 1) - && (_table_rows.length <= row_idx+2)) { // check row_idx+2 (rather than == ++row_idx) - _tablenote ~= cell; - } else { - // // _table ~= "\\bfseries "; - // _table ~= cell; - // _table ~= (_table_cols.length > (col_idx + 1)) ? "&" : ""; - _table ~= format(q"┃%s%s┃", - cell, - (_table_cols.length > (col_idx + 1)) ? "&" : "" - ); - } + _table ~= ""; + foreach(col_idx, cell; _table_cols) { + if ((_table_cols.length == 1) + && (_table_rows.length <= row_idx+2)) { // check row_idx+2 (rather than == ++row_idx) + _tablenote ~= cell; + } else { + // // _table ~= "\\bfseries "; + // _table ~= cell; + // _table ~= (_table_cols.length > (col_idx + 1)) ? "&" : ""; + _table ~= format(q"┃%s%s┃", + cell, + (_table_cols.length > (col_idx + 1)) ? "&" : "" + ); } - _table ~= "\\\\"; } - auto t = tuple( + _table ~= "\\\\"; + } + Tuple!(string, string) t = tuple( _table, _tablenote, ); diff --git a/src/doc_reform/io_out/odt.d b/src/doc_reform/io_out/odt.d index 6e792a5..1a553d1 100644 --- a/src/doc_reform/io_out/odt.d +++ b/src/doc_reform/io_out/odt.d @@ -243,13 +243,13 @@ template formatODT() { .replaceAll(rgx.inline_strike, "$1") .replaceAll(rgx.inline_insert, "$1") .replaceAll(rgx.inline_cite, "$1") - .replaceAll(rgx.inline_emphasis, format(q"┃%s┃","$1")) - .replaceAll(rgx.inline_bold, format(q"┃%s┃","$1")) - .replaceAll(rgx.inline_italics, format(q"┃%s┃","$1")) - .replaceAll(rgx.inline_underscore, format(q"┃%s┃","$1")) + .replaceAll(rgx.inline_emphasis, format(q"┃%s┃", "$1")) + .replaceAll(rgx.inline_bold, format(q"┃%s┃", "$1")) + .replaceAll(rgx.inline_italics, format(q"┃%s┃", "$1")) + .replaceAll(rgx.inline_underscore, format(q"┃%s┃", "$1")) .replaceAll(rgx.inline_superscript, format(q"┃%s┃","$1")) - .replaceAll(rgx.inline_subscript, format(q"┃%s┃","$1")) - .replaceAll(rgx.inline_mono, format(q"┃%s┃","$1")); + .replaceAll(rgx.inline_subscript, format(q"┃%s┃", "$1")) + .replaceAll(rgx.inline_mono, format(q"┃%s┃", "$1")); return _txt; } auto _obj_num(O)(O obj) @safe { // NOT USED YET @@ -519,7 +519,7 @@ template formatODT() { _o_txt_odt = _block; return _o_txt_odt; } - auto tablarize(O)( + Tuple!(string, string) tablarize(O)( const O obj, string _txt, ) @safe { @@ -547,7 +547,7 @@ template formatODT() { } _table ~= ""; } - auto t = tuple( + Tuple!(string, string) t = tuple( _table, _tablenote, ); @@ -563,7 +563,7 @@ template formatODT() { assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "table"); string _o_txt_odt = markup(obj); - auto t = tablarize(obj, _o_txt_odt); + Tuple!(string, string) t = tablarize(obj, _o_txt_odt); string _note = t[1]; _o_txt_odt = format(q"┃ diff --git a/src/doc_reform/io_out/package.d b/src/doc_reform/io_out/package.d index 1f11046..6bc66ea 100644 --- a/src/doc_reform/io_out/package.d +++ b/src/doc_reform/io_out/package.d @@ -10,7 +10,6 @@ public import std.regex, std.stdio, std.string, - std.traits, std.typecons, // std.uni, std.utf; diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index 0995fe1..c779e00 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -406,7 +406,7 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - auto inline_notes_seg(M,O)( + Tuple!(string, string) inline_notes_seg(M,O)( M doc_matters, const O obj, string _txt, @@ -439,7 +439,7 @@ template SQLiteFormatAndLoadObject() { writeln(__LINE__, " endnote: ", obj.metainfo.is_a, ": ", obj.text); } } - auto t = tuple( + Tuple!(string, string) t = tuple( _txt, _endnotes, ); @@ -582,7 +582,7 @@ template SQLiteFormatAndLoadObject() { assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "table"); - auto _tablarize(O)( + Tuple!(string, string) _tablarize(O)( const O obj, string _txt, ) { @@ -617,14 +617,14 @@ template SQLiteFormatAndLoadObject() { } _table ~= ""; } - auto t = tuple( + Tuple!(string, string) t = tuple( _table, _tablenote, ); return t; } string _txt = munge_html(doc_matters, obj); - auto t = _tablarize(obj, _txt); + Tuple!(string, string) t = _tablarize(obj, _txt); _txt = t[0]; string _note = t[1]; string o = format(q"┃

diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index 4cb7507..739c379 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -176,9 +176,7 @@ template outputXHTMLs() { _db, ); } else { - _form = format(q"┃%s┃", - "", - ); + _form = format(q"┃%s┃", ""); } o = format(q"┃

%s
┃", @@ -467,7 +465,7 @@ template outputXHTMLs() { } return _txt; } - auto inline_notes_seg(O,M)( + Tuple!(string, string[]) inline_notes_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -525,7 +523,7 @@ template outputXHTMLs() { writeln(__LINE__, " endnote: ", obj.metainfo.is_a, ": ", obj.text); } } - auto t = tuple( + Tuple!(string, string[]) t = tuple( _txt, _endnotes, ); @@ -754,7 +752,7 @@ template outputXHTMLs() { string o = heading(_txt, obj, doc_matters); return o; } - auto heading_seg(O,M)( + Tuple!(string, string[]) heading_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -765,7 +763,7 @@ template outputXHTMLs() { _txt = t[0]; string[] _endnotes = t[1]; string o = heading(_txt, obj, doc_matters, _xml_type); - auto u = tuple( + Tuple!(string, string[]) u = tuple( o, _endnotes, ); @@ -830,7 +828,7 @@ template outputXHTMLs() { string o = para(_txt, obj, doc_matters); return o; } - auto para_seg(O,M)( + Tuple!(string, string[]) para_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -841,7 +839,7 @@ template outputXHTMLs() { _txt = t[0].to!string; string[] _endnotes = t[1]; string o = para(_txt, obj, doc_matters); - auto u = tuple( + Tuple!(string, string[]) u = tuple( o, _endnotes, ); @@ -893,7 +891,7 @@ template outputXHTMLs() { string o = quote(_txt, obj, doc_matters); return o; } - auto quote_seg(O,M)( + Tuple!(string, string[]) quote_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -904,7 +902,7 @@ template outputXHTMLs() { _txt = t[0].to!string; string[] _endnotes = t[1]; string o = quote(_txt, obj, doc_matters); - auto u = tuple( + Tuple!(string, string[]) u = tuple( o, _endnotes, ); @@ -957,7 +955,7 @@ template outputXHTMLs() { string o = group(_txt, obj, doc_matters); return o; } - auto group_seg(O,M)( + Tuple!(string, string[]) group_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -968,7 +966,7 @@ template outputXHTMLs() { _txt = t[0].to!string; string[] _endnotes = t[1]; string o = group(_txt, obj, doc_matters); - auto u = tuple( + Tuple!(string, string[]) u = tuple( o, _endnotes, ); @@ -1017,7 +1015,7 @@ template outputXHTMLs() { string o = block(_txt, obj, doc_matters); return o; } - auto block_seg(O,M)( + Tuple!(string, string[]) block_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1028,7 +1026,7 @@ template outputXHTMLs() { _txt = t[0].to!string; string[] _endnotes = t[1]; string o = block(_txt, obj, doc_matters); - auto u = tuple( + Tuple!(string, string[]) u = tuple( o, _endnotes, ); @@ -1077,7 +1075,7 @@ template outputXHTMLs() { string o = verse(_txt, obj, doc_matters); return o; } - auto verse_seg(O,M)( + Tuple!(string, string[]) verse_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1088,13 +1086,13 @@ template outputXHTMLs() { _txt = t[0].to!string; string[] _endnotes = t[1]; string o = verse(_txt, obj, doc_matters); - auto u = tuple( + Tuple!(string, string[]) u = tuple( o, _endnotes, ); return u; } - auto tablarize(O)( + Tuple!(string, string) tablarize(O)( string _txt, const O obj, ) @safe { @@ -1104,24 +1102,24 @@ template outputXHTMLs() { string _tablenote; foreach(row_idx, row; _table_rows) { _table_cols = row.split(rgx.table_delimiter_col); - _table ~= ""; - foreach(col_idx, cell; _table_cols) { - if ((_table_cols.length == 1) - && (_table_rows.length <= row_idx+2)) { - _tablenote ~= cell; - } else { - string _col_is = (row_idx == 0 && obj.table.heading) ? "th" : "td"; - 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 ~= cell; - _table ~= ""; - } + _table ~= ""; + foreach(col_idx, cell; _table_cols) { + if ((_table_cols.length == 1) + && (_table_rows.length <= row_idx+2)) { + _tablenote ~= cell; + } else { + string _col_is = (row_idx == 0 && obj.table.heading) ? "th" : "td"; + 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 ~= cell; + _table ~= ""; } - _table ~= ""; } - auto t = tuple( + _table ~= ""; + } + Tuple!(string, string) t = tuple( _table, _tablenote, ); -- cgit v1.2.3