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 +++++++++++++++++++++++++++++----------- 9 files changed, 70 insertions(+), 32 deletions(-) (limited to 'org') 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 } -- cgit v1.2.3