aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/source_sisupod.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-02-10 16:51:55 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitc98283e3919f39c093e1eb51f80e6f259a7fd103 (patch)
tree77cfd266466f8cab3ecf54f81716a9d2a85f87f8 /src/sdp/source_sisupod.d
parent0.13.0 batch processing, reset values for each document (footnotes, bookindex... (diff)
output, sisupod & a few switches
Diffstat (limited to 'src/sdp/source_sisupod.d')
-rw-r--r--src/sdp/source_sisupod.d69
1 files changed, 30 insertions, 39 deletions
diff --git a/src/sdp/source_sisupod.d b/src/sdp/source_sisupod.d
index 9ed2c97..8a24d55 100644
--- a/src/sdp/source_sisupod.d
+++ b/src/sdp/source_sisupod.d
@@ -21,9 +21,9 @@ template SiSUpod() {
import
ao_rgx,
output_xhtmls;
-
void SiSUpod(T)(T doc_matters) {
debug(asserts){
+ // static assert(is(typeof(doc_matters) == tuple));
}
mixin SiSUrgxInit;
mixin SiSUpaths;
@@ -31,23 +31,6 @@ template SiSUpod() {
mixin SiSUlanguageCodes;
auto lang = Lang();
auto rgx = Rgx();
- /+
- dir structure
- /tmp/_sisu_processing_/ralph/sisupod
- ├── conf
- ├── css (unless should be within conf?)
- ├── doc
- │ ├── en
- │ ├── es
- │ ├── fr
- │   └── zh
- └── image
-
- - tasks
- - create directory structure
- - map other language directories
- - check for corresponding files within
- +/
assert (match(doc_matters.source_filename, rgx.src_fn));
try {
/+ create directory structure +/
@@ -63,51 +46,61 @@ template SiSUpod() {
if (!exists(pth_sisupod.image(doc_matters.source_filename))) {
mkdirRecurse(pth_sisupod.image(doc_matters.source_filename));
}
- /+ copy relevant files +/
+ if (!exists(pth_sisupod.doc_lng(doc_matters.source_filename, doc_matters.language))) {
+ mkdirRecurse(pth_sisupod.doc_lng(doc_matters.source_filename, doc_matters.language));
+ }
debug(sisupod) {
writeln(__LINE__, ": ",
// doc_matters.environment["pwd"], "/",
doc_matters.source_filename, " -> ",
// doc_matters.environment["pwd"], "/",
- pth_sisupod.fn_doc(doc_matters.source_filename, "en")
- );
- }
- // need to extract language code directories (from directory structure or filenames & have a default)
- if (!exists(pth_sisupod.doc_lng(doc_matters.source_filename, "en"))) {
- mkdirRecurse(pth_sisupod.doc_lng(doc_matters.source_filename, "en"));
+ pth_sisupod.fn_doc(
+ doc_matters.source_filename,
+ doc_matters.language
+ ));
}
if (exists(doc_matters.source_filename)) {
- copy(doc_matters.source_filename,
- pth_sisupod.fn_doc(doc_matters.source_filename, "en"));
+ copy(
+ doc_matters.source_filename,
+ pth_sisupod.fn_doc(
+ doc_matters.source_filename,
+ doc_matters.language
+ ));
}
if (doc_matters.file_insert_list.length > 0) {
foreach (insert_file; doc_matters.file_insert_list) {
debug(sisupod) {
writeln(
- // doc_matters.environment["pwd"], "/",
insert_file, " -> ",
- // doc_matters.environment["pwd"], "/",
- pth_sisupod.fn_doc(doc_matters.source_filename, "en")
- );
+ pth_sisupod.fn_doc_insert(
+ doc_matters.source_filename,
+ insert_file,
+ doc_matters.language
+ ));
}
if (exists(insert_file)) {
- copy(insert_file,
- pth_sisupod.fn_doc(doc_matters.source_filename, "en"));
+ copy(
+ insert_file,
+ pth_sisupod.fn_doc_insert(
+ doc_matters.source_filename,
+ insert_file,
+ doc_matters.language
+ ));
}
}
}
foreach (image; doc_matters.image_list) {
debug(sisupod) {
writeln(
- // doc_matters.environment["pwd"], "/",
"_sisu/image/", image, " -> ",
- // doc_matters.environment["pwd"], "/",
pth_sisupod.image(doc_matters.source_filename), "/", image
);
}
if (exists("_sisu/image/"~ image)) {
- copy(("_sisu/image/"~ image),
- (pth_sisupod.image(doc_matters.source_filename) ~ "/" ~ image));
+ copy(
+ ("_sisu/image/"~ image),
+ (pth_sisupod.image(doc_matters.source_filename) ~ "/" ~ image)
+ );
}
}
}
@@ -115,6 +108,4 @@ template SiSUpod() {
// Handle error
}
}
-
-
}