From 0ce4e986fcd5af430d9f7bfdd625da7a58a1527e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 4 Feb 2020 17:10:57 -0500 Subject: imports related, mostly cosmetic --- org/default_paths.org | 6 +++-- org/metaverse.org | 2 +- org/out_latex.org | 2 +- org/out_metadata.org | 5 +++-- org/out_sqlite.org | 8 +++---- org/out_xmls.org | 28 ++++++++++++++++++----- org/out_zip.org | 9 ++++---- org/output_hub.org | 2 +- org/spine.org | 40 ++++++++++++++++++++++++--------- src/doc_reform/io_in/paths_source.d | 3 ++- src/doc_reform/io_out/create_zip_file.d | 9 ++++---- src/doc_reform/io_out/epub3.d | 3 +-- src/doc_reform/io_out/html.d | 4 +--- src/doc_reform/io_out/hub.d | 2 +- src/doc_reform/io_out/latex.d | 2 +- src/doc_reform/io_out/metadata.d | 5 +++-- src/doc_reform/io_out/paths_output.d | 3 ++- src/doc_reform/io_out/sqlite.d | 6 ++--- src/doc_reform/io_out/xmls.d | 4 +--- src/doc_reform/meta/metadoc.d | 10 +-------- src/doc_reform/meta/metadoc_from_src.d | 2 +- src/doc_reform/spine.d | 19 ++++++++-------- 22 files changed, 101 insertions(+), 73 deletions(-) diff --git a/org/default_paths.org b/org/default_paths.org index acfdebf..bb7ca79 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -25,7 +25,8 @@ meta_config_files.d +/ module doc_reform.io_in.paths_source; -import std.array, +import + std.array, std.file, std.path, std.regex, @@ -965,7 +966,8 @@ template spinePathsPods() { default settings +/ module doc_reform.io_out.paths_output; -import std.array, +import + std.array, std.path, std.regex, std.stdio; diff --git a/org/metaverse.org b/org/metaverse.org index d6a21bd..956b215 100644 --- a/org/metaverse.org +++ b/org/metaverse.org @@ -143,7 +143,6 @@ template docAbstraction() { #+NAME: abs_top_imports #+BEGIN_SRC d -import doc_reform.meta; import std.algorithm, std.container, @@ -151,6 +150,7 @@ import std.json, std.path; import + doc_reform.meta, doc_reform.meta.defaults, doc_reform.meta.metadoc_object_setter, doc_reform.meta.rgx; diff --git a/org/out_latex.org b/org/out_latex.org index 38defe1..f679ecd 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -114,13 +114,13 @@ void outputLaTeX(D,M)( #+NAME: output_latex_imports #+BEGIN_SRC d -import doc_reform.io_out; import std.digest.sha, std.file, std.outbuffer, std.uri, std.conv : to; +import doc_reform.io_out; #+END_SRC ** shared diff --git a/org/out_metadata.org b/org/out_metadata.org index f7a428f..4ed857b 100644 --- a/org/out_metadata.org +++ b/org/out_metadata.org @@ -38,8 +38,9 @@ template outputMetadata() { #+NAME: output_imports #+BEGIN_SRC d -import std.file; -import std.format; +import + std.file, + std.format; import doc_reform.io_out; mixin InternalMarkup; string[] metadata_; diff --git a/org/out_sqlite.org b/org/out_sqlite.org index 3bd18e5..32daf8e 100644 --- a/org/out_sqlite.org +++ b/org/out_sqlite.org @@ -25,8 +25,6 @@ #+BEGIN_SRC d :tangle "../src/doc_reform/io_out/sqlite.d" module doc_reform.io_out.sqlite; <> -import d2sqlite3; -import std.typecons : Nullable; mixin spineRgxOut; mixin InternalMarkup; static auto rgx = RgxO(); @@ -328,8 +326,10 @@ template SQLiteDbDrop() { import doc_reform.io_out; import std.file, - std.uri, - std.conv : to; + std.uri; +import std.conv : to; +import std.typecons : Nullable; +import d2sqlite3; #+END_SRC ** 3. format and load template diff --git a/org/out_xmls.org b/org/out_xmls.org index 9f51e84..c76d6ab 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -24,7 +24,7 @@ #+BEGIN_SRC d :tangle "../src/doc_reform/io_out/xmls.d" module doc_reform.io_out.xmls; template outputXHTMLs() { - <> + <> mixin spineRgxOut; struct outputXHTMLs { static auto rgx = RgxO(); @@ -35,18 +35,34 @@ template outputXHTMLs() { #+END_SRC *** output imports +**** xml html -#+NAME: output_imports +#+NAME: output_imports_xml +#+BEGIN_SRC d +import + std.file, + std.outbuffer, + std.uri, + std.conv : to; +import + doc_reform.io_out, + doc_reform.io_out.create_zip_file, + doc_reform.io_out.xmls, + doc_reform.io_out.xmls_css; +#+END_SRC + +**** epub3 + +#+NAME: output_imports_epub #+BEGIN_SRC d -import doc_reform.io_out; import - std.digest.sha, std.file, std.outbuffer, std.uri, std.zip, std.conv : to; import + doc_reform.io_out, doc_reform.io_out.create_zip_file, doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; @@ -1508,7 +1524,7 @@ align="left|right|center" #+BEGIN_SRC d :tangle "../src/doc_reform/io_out/html.d" module doc_reform.io_out.html; template outputHTML() { - <> + <> mixin outputXHTMLs; <> <> @@ -2170,7 +2186,7 @@ template outputHTML() { #+BEGIN_SRC d :tangle "../src/doc_reform/io_out/epub3.d" module doc_reform.io_out.epub3; template outputEPub3() { - <> + <> mixin InternalMarkup; mixin outputXHTMLs; <> diff --git a/org/out_zip.org b/org/out_zip.org index 9f4b7f2..d9f89a1 100644 --- a/org/out_zip.org +++ b/org/out_zip.org @@ -22,10 +22,11 @@ #+BEGIN_SRC d :tangle "../src/doc_reform/io_out/create_zip_file.d" module doc_reform.io_out.create_zip_file; template createZipFile() { - import std.file; - import std.outbuffer; - import std.string; - import std.zip; + import + std.file, + std.outbuffer, + std.string, + std.zip; @safe void createZipFile( string zip_file_name, void[] compressed_zip_data, diff --git a/org/output_hub.org b/org/output_hub.org index c683742..e6b429c 100644 --- a/org/output_hub.org +++ b/org/output_hub.org @@ -27,7 +27,6 @@ module doc_reform.io_out.hub; template outputHub() { <> - import std.parallelism; @system void outputHub(D,I)( const D doc_abstraction, I doc_matters @@ -49,6 +48,7 @@ template outputHub() { Scheduled!()(schedule, doc_abstraction, doc_matters); } } else { + import std.parallelism; foreach(schedule; parallel(doc_matters.opt.action.output_task_scheduler)) { Scheduled!()(schedule, doc_abstraction, doc_matters); } diff --git a/org/spine.org b/org/spine.org index 72d3b1d..4b66711 100644 --- a/org/spine.org +++ b/org/spine.org @@ -84,21 +84,16 @@ version (Posix) { #+BEGIN_SRC d :tangle "../src/doc_reform/spine.d" :shebang "#!/usr/bin/env rdmd" <> module doc_reform.sisu_document_parser; -import - doc_reform.conf.compile_time_info, - doc_reform.meta.metadoc; -<> -import std.algorithm; -import std.parallelism; -<> -<> -string project_name = "spine"; -string program_name = "spine"; /++ name "spine" description "A SiSU inspired document parser writen in D." homepage "http://sisudoc.org" +/ +<> +<> +<> +string project_name = "spine"; +string program_name = "spine"; @system void main(string[] args) { <> <> @@ -107,6 +102,7 @@ homepage "http://sisudoc.org" if (_manifests.length > 1 // _manifests[0] initialized dummy element && _opt_action.abstraction) { if (_opt_action.parallelise) { // see else + import std.parallelism; foreach(manifest; parallel(_manifests[1..$])) { if (!empty(manifest.src.filename)) { <> @@ -219,13 +215,16 @@ homepage "http://sisudoc.org" #+NAME: imports_spine #+BEGIN_SRC d import + std.algorithm, std.datetime, std.getopt, std.file, std.path, std.process; import + doc_reform.conf.compile_time_info, doc_reform.meta, + doc_reform.meta.metadoc, doc_reform.meta.metadoc_harvest, doc_reform.meta.metadoc_harvests_authors, doc_reform.meta.metadoc_harvests_topics, @@ -241,6 +240,25 @@ import doc_reform.io_out.hub; #+END_SRC +***** spine__metadoc :spine: + +#+NAME: imports_spine_metadoc +#+BEGIN_SRC d +import + std.datetime; +import + doc_reform.meta, + doc_reform.meta.metadoc_from_src, + doc_reform.meta.conf_make_meta_structs, + doc_reform.meta.conf_make_meta_json, + doc_reform.meta.defaults, + doc_reform.meta.rgx, + doc_reform.io_in.paths_source, + doc_reform.io_in.read_config_files, + doc_reform.io_in.read_source_files, + doc_reform.io_out.hub; +#+END_SRC + ****** notes ├── src │   ├── doc_reform.d @@ -1176,7 +1194,7 @@ break; // terminate, stop #+BEGIN_SRC d :tangle "../src/doc_reform/meta/metadoc.d" module doc_reform.meta.metadoc; template spineAbstraction() { - <> + <> <> enum headBody { header, body_content, insert_file_list, image_list } enum makeMeta { make, meta } diff --git a/src/doc_reform/io_in/paths_source.d b/src/doc_reform/io_in/paths_source.d index 85738d1..0cf0478 100644 --- a/src/doc_reform/io_in/paths_source.d +++ b/src/doc_reform/io_in/paths_source.d @@ -4,7 +4,8 @@ meta_config_files.d +/ module doc_reform.io_in.paths_source; -import std.array, +import + std.array, std.file, std.path, std.regex, diff --git a/src/doc_reform/io_out/create_zip_file.d b/src/doc_reform/io_out/create_zip_file.d index 0ad8ada..ea7e5f6 100644 --- a/src/doc_reform/io_out/create_zip_file.d +++ b/src/doc_reform/io_out/create_zip_file.d @@ -1,9 +1,10 @@ module doc_reform.io_out.create_zip_file; template createZipFile() { - import std.file; - import std.outbuffer; - import std.string; - import std.zip; + import + std.file, + std.outbuffer, + std.string, + std.zip; @safe void createZipFile( string zip_file_name, void[] compressed_zip_data, diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index 9d29968..14c328b 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -1,14 +1,13 @@ module doc_reform.io_out.epub3; template outputEPub3() { - import doc_reform.io_out; import - std.digest.sha, std.file, std.outbuffer, std.uri, std.zip, std.conv : to; import + doc_reform.io_out, doc_reform.io_out.create_zip_file, doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index ee530ca..6a15614 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -1,14 +1,12 @@ module doc_reform.io_out.html; template outputHTML() { - import doc_reform.io_out; import - std.digest.sha, std.file, std.outbuffer, std.uri, - std.zip, std.conv : to; import + doc_reform.io_out, doc_reform.io_out.create_zip_file, doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; diff --git a/src/doc_reform/io_out/hub.d b/src/doc_reform/io_out/hub.d index e275348..548cceb 100644 --- a/src/doc_reform/io_out/hub.d +++ b/src/doc_reform/io_out/hub.d @@ -10,7 +10,6 @@ template outputHub() { doc_reform.io_out.odt, doc_reform.io_out.create_zip_file, doc_reform.io_out.paths_output; - import std.parallelism; @system void outputHub(D,I)( const D doc_abstraction, I doc_matters @@ -93,6 +92,7 @@ template outputHub() { Scheduled!()(schedule, doc_abstraction, doc_matters); } } else { + import std.parallelism; foreach(schedule; parallel(doc_matters.opt.action.output_task_scheduler)) { Scheduled!()(schedule, doc_abstraction, doc_matters); } diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index ff5b0df..8ec144b 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -1,12 +1,12 @@ module doc_reform.io_out.latex; template outputLaTeX() { - import doc_reform.io_out; import std.digest.sha, std.file, std.outbuffer, std.uri, std.conv : to; + import doc_reform.io_out; mixin InternalMarkup; // watch mixin spineRgxOut; static auto rgx = RgxO(); diff --git a/src/doc_reform/io_out/metadata.d b/src/doc_reform/io_out/metadata.d index 5dfdfe2..65f40b2 100644 --- a/src/doc_reform/io_out/metadata.d +++ b/src/doc_reform/io_out/metadata.d @@ -1,8 +1,9 @@ module doc_reform.io_out.metadata; template outputMetadata() { @safe void outputMetadata(T)( T doc_matters) { - import std.file; - import std.format; + import + std.file, + std.format; import doc_reform.io_out; mixin InternalMarkup; string[] metadata_; diff --git a/src/doc_reform/io_out/paths_output.d b/src/doc_reform/io_out/paths_output.d index f01f88b..83c9728 100644 --- a/src/doc_reform/io_out/paths_output.d +++ b/src/doc_reform/io_out/paths_output.d @@ -2,7 +2,8 @@ default settings +/ module doc_reform.io_out.paths_output; -import std.array, +import + std.array, std.path, std.regex, std.stdio; diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index d24fc00..1a30204 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -2,10 +2,10 @@ module doc_reform.io_out.sqlite; import doc_reform.io_out; import std.file, - std.uri, - std.conv : to; -import d2sqlite3; + std.uri; +import std.conv : to; import std.typecons : Nullable; +import d2sqlite3; mixin spineRgxOut; mixin InternalMarkup; static auto rgx = RgxO(); diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index b640d81..89180eb 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -1,14 +1,12 @@ module doc_reform.io_out.xmls; template outputXHTMLs() { - import doc_reform.io_out; import - std.digest.sha, std.file, std.outbuffer, std.uri, - std.zip, std.conv : to; import + doc_reform.io_out, doc_reform.io_out.create_zip_file, doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index 90fec4a..b0b4fdc 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -1,21 +1,13 @@ module doc_reform.meta.metadoc; template spineAbstraction() { import - std.datetime, - std.getopt, - std.file, - std.path, - std.process; + std.datetime; import doc_reform.meta, - doc_reform.meta.metadoc_harvest, - doc_reform.meta.metadoc_harvests_authors, - doc_reform.meta.metadoc_harvests_topics, doc_reform.meta.metadoc_from_src, doc_reform.meta.conf_make_meta_structs, doc_reform.meta.conf_make_meta_json, doc_reform.meta.defaults, - doc_reform.meta.doc_debugs, doc_reform.meta.rgx, doc_reform.io_in.paths_source, doc_reform.io_in.read_config_files, diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 3ce25b5..b6438a0 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -6,7 +6,6 @@ module doc_reform.meta.metadoc_from_src; template docAbstraction() { /+ ↓ abstraction imports +/ - import doc_reform.meta; import std.algorithm, std.container, @@ -14,6 +13,7 @@ template docAbstraction() { std.json, std.path; import + doc_reform.meta, doc_reform.meta.defaults, doc_reform.meta.metadoc_object_setter, doc_reform.meta.rgx; diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index 67ee838..53161c7 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -51,17 +51,22 @@ +/ module doc_reform.sisu_document_parser; +/++ +name "spine" +description "A SiSU inspired document parser writen in D." +homepage "http://sisudoc.org" ++/ import - doc_reform.conf.compile_time_info, - doc_reform.meta.metadoc; -import + std.algorithm, std.datetime, std.getopt, std.file, std.path, std.process; import + doc_reform.conf.compile_time_info, doc_reform.meta, + doc_reform.meta.metadoc, doc_reform.meta.metadoc_harvest, doc_reform.meta.metadoc_harvests_authors, doc_reform.meta.metadoc_harvests_topics, @@ -75,17 +80,10 @@ import doc_reform.io_in.read_config_files, doc_reform.io_in.read_source_files, doc_reform.io_out.hub; -import std.algorithm; -import std.parallelism; mixin(import("version.txt")); mixin CompileTimeInfo; string project_name = "spine"; string program_name = "spine"; -/++ -name "spine" -description "A SiSU inspired document parser writen in D." -homepage "http://sisudoc.org" -+/ @system void main(string[] args) { mixin spineRgxIn; mixin contentJSONtoSpineStruct; @@ -724,6 +722,7 @@ homepage "http://sisudoc.org" if (_manifests.length > 1 // _manifests[0] initialized dummy element && _opt_action.abstraction) { if (_opt_action.parallelise) { // see else + import std.parallelism; foreach(manifest; parallel(_manifests[1..$])) { if (!empty(manifest.src.filename)) { scope(success) { -- cgit v1.2.3