aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/output.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-03-07 09:11:09 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit5a4df097b2976c24c449c56cf035995edfb1261e (patch)
tree9112c6f32f1b9a8d7cdc7849754d6b8f602de0c5 /org/output.org
parentorg files minor touches (diff)
0.13.6 dlang function calls, syntax (ufcs related), logic should be retained
Diffstat (limited to 'org/output.org')
-rw-r--r--org/output.org51
1 files changed, 24 insertions, 27 deletions
diff --git a/org/output.org b/org/output.org
index e8ed16e..657b32f 100644
--- a/org/output.org
+++ b/org/output.org
@@ -171,26 +171,26 @@ auto pth_sisupod = SiSUpodPaths();
mixin SiSUlanguageCodes;
auto lang = Lang();
auto rgx = Rgx();
-assert (match(doc_matters.source_filename, rgx.src_fn));
+assert (doc_matters.source_filename.match(rgx.src_fn));
#+END_SRC
#+name: source_sisupod_mkdirs
#+BEGIN_SRC d
/+ create directory structure +/
if (!exists(pth_sisupod.doc(doc_matters.source_filename))) {
- mkdirRecurse(pth_sisupod.doc(doc_matters.source_filename));
+ pth_sisupod.doc(doc_matters.source_filename).mkdirRecurse;
}
if (!exists(pth_sisupod.conf(doc_matters.source_filename))) {
- mkdirRecurse(pth_sisupod.conf(doc_matters.source_filename));
+ pth_sisupod.conf(doc_matters.source_filename).mkdirRecurse;
}
if (!exists(pth_sisupod.css(doc_matters.source_filename))) {
- mkdirRecurse(pth_sisupod.css(doc_matters.source_filename));
+ pth_sisupod.css(doc_matters.source_filename).mkdirRecurse;
}
if (!exists(pth_sisupod.image(doc_matters.source_filename))) {
- mkdirRecurse(pth_sisupod.image(doc_matters.source_filename));
+ pth_sisupod.image(doc_matters.source_filename).mkdirRecurse;
}
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));
+ pth_sisupod.doc_lng(doc_matters.source_filename, doc_matters.language).mkdirRecurse;
}
#+END_SRC
@@ -228,8 +228,7 @@ if (doc_matters.file_insert_list.length > 0) {
));
}
if (exists(insert_file)) {
- copy(
- insert_file,
+ insert_file.copy(
pth_sisupod.fn_doc_insert(
doc_matters.source_filename,
insert_file,
@@ -246,8 +245,7 @@ foreach (image; doc_matters.image_list) {
);
}
if (exists("_sisu/image/"~ image)) {
- copy(
- ("_sisu/image/"~ image),
+ ("_sisu/image/"~ image).copy(
(pth_sisupod.image(doc_matters.source_filename) ~ "/" ~ image)
);
}
@@ -442,7 +440,7 @@ auto inline_links(O)(
) {
if (obj.inline_links) {
if ((seg_scroll == "scroll")
- && match(_txt, rgx.mark_internal_site_lnk)) {
+ && _txt.match(rgx.mark_internal_site_lnk)) {
_txt = (_txt).replaceAll(
rgx.inline_seg_link,
"$1");
@@ -459,7 +457,7 @@ auto inline_links(O)(
);
}
debug(markup_links) {
- if ( match(_txt, rgx.inline_link)) {
+ if (_txt.match(rgx.inline_link)) {
writeln(__LINE__,
" (missed) markup link identified (",
obj.inline_links,
@@ -469,7 +467,7 @@ auto inline_links(O)(
}
}
debug(markup) {
- if ( match(_txt, rgx.inline_link)) {
+ if (_txt.match(rgx.inline_link)) {
writeln(__LINE__,
" (missed) markup link identified (",
obj.inline_links,
@@ -497,12 +495,12 @@ auto inline_notes_scroll(O)(
);
}
debug(markup_endnotes) {
- if (match(_txt, rgx.inline_notes_delimiter_al_regular_number_note)) {
+ if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) {
writeln(__LINE__, " (missed) markup endnote: ", obj.is_a, ": ", obj.text);
}
}
debug(markup) {
- if (match(_txt, rgx.inline_notes_delimiter_al_regular_number_note)) {
+ if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) {
writeln(__LINE__, " (missed) markup endnote: ", obj.is_a, ": ", obj.text);
}
}
@@ -528,7 +526,7 @@ auto inline_notes_seg(O)(
string[] _endnotes;
if (obj.inline_notes_reg) {
/+ need markup for text, and separated footnote +/
- foreach(m; matchAll(_txt, rgx.inline_notes_delimiter_al_regular_number_note)) {
+ foreach(m; _txt.matchAll(rgx.inline_notes_delimiter_al_regular_number_note)) {
_endnotes ~= format(
"%s%s%s%s\n %s%s%s%s%s\n %s\n%s",
"<p class=\"endnote\">",
@@ -548,7 +546,7 @@ auto inline_notes_seg(O)(
rgx.inline_notes_delimiter_al_regular_number_note,
("<a href=\"#note_$1\"><note id=\"noteref_$1\">&nbsp;<sup>$1</sup>&nbsp;</note></a>")
);
- } else if (match(_txt, rgx.inline_notes_delimiter_al_regular_number_note)) {
+ } else if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) {
debug(markup) {
writeln(__LINE__, " endnote: ", obj.is_a, ": ", obj.text);
}
@@ -1050,7 +1048,7 @@ void scroll_write_output(Fn,C)(
auto pth_html = HtmlPaths();
try {
if (!exists(pth_html.base)) {
- mkdirRecurse(pth_html.base);
+ pth_html.base.mkdirRecurse;
}
auto f = File(pth_html.fn_scroll(fn_src), "w");
foreach (o; doc) {
@@ -1291,10 +1289,10 @@ void seg_write_output(M,D,E)(
mixin SiSUpaths;
auto pth_html = HtmlPaths();
auto xhtml_format = outputXHTMLs();
- auto m = matchFirst(doc_matters.source_filename, rgx.src_fn);
+ auto m = doc_matters.source_filename.matchFirst(rgx.src_fn);
try {
if (!exists(pth_html.seg(doc_matters.source_filename))) {
- mkdirRecurse(pth_html.seg(doc_matters.source_filename));
+ pth_html.seg(doc_matters.source_filename).mkdirRecurse;
}
foreach (seg_filename; doc_matters.segnames) {
auto f = File(pth_html.fn_seg(doc_matters.source_filename, seg_filename), "w");
@@ -2155,7 +2153,7 @@ auto css_write() {
auto pth_css_fn= pth_css ~ "/html.css";
try {
if (!exists(pth_css)) {
- mkdirRecurse(pth_css);
+ pth_css.mkdirRecurse;
}
auto f = File(pth_css_fn, "w");
f.writeln(html_css);
@@ -2357,7 +2355,6 @@ void outputEPub(D,I)(
mixin SiSUoutputRgxInit;
auto xhtml_format = outputXHTMLs();
auto rgx = Rgx();
- // string[] toc;
string[][string] doc_epub;
string[][string] doc_epub_endnotes;
string[] doc;
@@ -2593,13 +2590,13 @@ void epub_write_output_files(M,D,E,Mt,Mic,Ot,Oc)(
auto xhtml_format = outputXHTMLs();
try {
if (!exists(pth_epub.doc_meta_inf(doc_matters.source_filename))) {
- mkdirRecurse(pth_epub.doc_meta_inf(doc_matters.source_filename));
+ pth_epub.doc_meta_inf(doc_matters.source_filename).mkdirRecurse;
}
if (!exists(pth_epub.doc_oebps_css(doc_matters.source_filename))) {
- mkdirRecurse(pth_epub.doc_oebps_css(doc_matters.source_filename));
+ pth_epub.doc_oebps_css(doc_matters.source_filename).mkdirRecurse;
}
if (!exists(pth_epub.doc_oebps_image(doc_matters.source_filename))) {
- mkdirRecurse(pth_epub.doc_oebps_image(doc_matters.source_filename));
+ pth_epub.doc_oebps_image(doc_matters.source_filename).mkdirRecurse;
}
/+ OEBPS/[segments].xhtml +/
foreach (seg_filename; doc_matters.segnames) {
@@ -2627,8 +2624,8 @@ void epub_write_output_files(M,D,E,Mt,Mic,Ot,Oc)(
f.writeln(oebps_content_opf);
foreach (image; doc_matters.image_list) {
if (exists("_sisu/image/"~ image)) {
- copy(("_sisu/image/"~ image),
- ((pth_epub.doc_oebps_image(doc_matters.source_filename)) ~ "/" ~ image));
+ ("_sisu/image/"~ image)
+ .copy((pth_epub.doc_oebps_image(doc_matters.source_filename)) ~ "/" ~ image);
}
}
}