aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2020-02-04 17:10:57 -0500
committerRalph Amissah <ralph@amissah.com>2020-02-26 09:59:18 -0500
commit0ce4e986fcd5af430d9f7bfdd625da7a58a1527e (patch)
treefdc5efbe568b60af7dd8e8ac4f828b4705ad3765
parentcode ctRegex calls, tidying (diff)
imports related, mostly cosmetic
-rw-r--r--org/default_paths.org6
-rw-r--r--org/metaverse.org2
-rw-r--r--org/out_latex.org2
-rw-r--r--org/out_metadata.org5
-rw-r--r--org/out_sqlite.org8
-rw-r--r--org/out_xmls.org28
-rw-r--r--org/out_zip.org9
-rw-r--r--org/output_hub.org2
-rw-r--r--org/spine.org40
-rw-r--r--src/doc_reform/io_in/paths_source.d3
-rw-r--r--src/doc_reform/io_out/create_zip_file.d9
-rw-r--r--src/doc_reform/io_out/epub3.d3
-rw-r--r--src/doc_reform/io_out/html.d4
-rw-r--r--src/doc_reform/io_out/hub.d2
-rw-r--r--src/doc_reform/io_out/latex.d2
-rw-r--r--src/doc_reform/io_out/metadata.d5
-rw-r--r--src/doc_reform/io_out/paths_output.d3
-rw-r--r--src/doc_reform/io_out/sqlite.d6
-rw-r--r--src/doc_reform/io_out/xmls.d4
-rw-r--r--src/doc_reform/meta/metadoc.d10
-rw-r--r--src/doc_reform/meta/metadoc_from_src.d2
-rwxr-xr-xsrc/doc_reform/spine.d19
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;
<<output_imports>>
-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() {
- <<output_imports>>
+ <<output_imports_xml>>
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() {
- <<output_imports>>
+ <<output_imports_xml>>
mixin outputXHTMLs;
<<output_html_scroll>>
<<output_html_seg>>
@@ -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() {
- <<output_imports>>
+ <<output_imports_epub>>
mixin InternalMarkup;
mixin outputXHTMLs;
<<output_epub3_fixed>>
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() {
<<output_imports>>
- 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"
<<doc_header_including_copyright_and_license>>
module doc_reform.sisu_document_parser;
-import
- doc_reform.conf.compile_time_info,
- doc_reform.meta.metadoc;
-<<imports_spine>>
-import std.algorithm;
-import std.parallelism;
-<<mixin_spine_version>>
-<<mixin_pre_main>>
-string project_name = "spine";
-string program_name = "spine";
/++
name "spine"
description "A SiSU inspired document parser writen in D."
homepage "http://sisudoc.org"
+/
+<<imports_spine>>
+<<mixin_spine_version>>
+<<mixin_pre_main>>
+string project_name = "spine";
+string program_name = "spine";
@system void main(string[] args) {
<<spine_mixin>>
<<spine_init>>
@@ -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)) {
<<spine_each_file_do_scope>>
@@ -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() {
- <<imports_spine>>
+ <<imports_spine_metadoc>>
<<spine_mixin>>
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) {