aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/output
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-10-02 15:17:02 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-10-17 19:07:20 -0400
commit5e23b12e0cdc531554e21ca464d2d0a2f8205645 (patch)
tree010335171b2331269d21cbcda3f169c36a09c4db /src/doc_reform/output
parentdocument headers & config: yaml introduced (diff)
path related, mostly cosmetic code
Diffstat (limited to 'src/doc_reform/output')
-rw-r--r--src/doc_reform/output/paths_output.d136
-rw-r--r--src/doc_reform/output/rgx.d4
2 files changed, 70 insertions, 70 deletions
diff --git a/src/doc_reform/output/paths_output.d b/src/doc_reform/output/paths_output.d
index ba72bfb..048f9e9 100644
--- a/src/doc_reform/output/paths_output.d
+++ b/src/doc_reform/output/paths_output.d
@@ -18,7 +18,7 @@ template DocReformOutPaths() {
? output_pth_root : "";
}
string output_base() {
- return asNormalizedPath(output_root.chainPath(lng)).array;
+ return ((output_root.chainPath(lng)).asNormalizedPath).array;
}
}
return _PathsStruct();
@@ -34,7 +34,7 @@ template DocReformOutPathSQLite() {
? output_pth_root : "";
}
string output_base() {
- return asNormalizedPath(output_root).array;
+ return ((output_root).asNormalizedPath).array;
}
}
return _PathsStruct();
@@ -90,37 +90,37 @@ template DocReformDocRootTreeHTML() {
return fn_src.baseName.stripExtension;
}
string base_filename_scroll(string fn_src) {
- return base_filename(fn_src) ~ "." ~ lng;
+ return base_filename(fn_src);
}
string base_filename_seg(string fn_src) {
- return base_filename(fn_src) ~ "." ~ lng;
+ return base_filename(fn_src);
}
string doc_root() {
- return asNormalizedPath(lng_pth.output_root).array;
+ return ((lng_pth.output_root).asNormalizedPath).array;
}
string base() {
- return asNormalizedPath((lng).chainPath(base_dir)).array;
+ return (((lng).chainPath(base_dir)).asNormalizedPath).array;
}
string image() {
- return asNormalizedPath("image").array;
+ return (("image").asNormalizedPath).array;
}
string css() {
- return asNormalizedPath("css").array;
+ return (("css").asNormalizedPath).array;
}
string fn_seg_css() {
- return asNormalizedPath(css.chainPath("html_seg.css")).array;
+ return ((css.chainPath("html_seg.css")).asNormalizedPath).array;
}
string fn_scroll_css() {
- return asNormalizedPath(css.chainPath("html_scroll.css")).array;
+ return ((css.chainPath("html_scroll.css")).asNormalizedPath).array;
}
string seg(string fn_src) {
- return asNormalizedPath(base.chainPath(base_filename_seg(fn_src))).array;
+ return ((base.chainPath(base_filename_seg(fn_src))).asNormalizedPath).array;
}
string fn_scroll(string fn_src) {
- return asNormalizedPath(base.chainPath(base_filename_scroll(fn_src) ~ suffix)).array;
+ return ((base.chainPath(base_filename_scroll(fn_src) ~ suffix)).asNormalizedPath).array;
}
string fn_seg(string fn_src, string seg_filename) {
- return asNormalizedPath(seg(fn_src).chainPath(seg_filename ~ suffix)).array;
+ return ((seg(fn_src).chainPath(seg_filename ~ suffix)).asNormalizedPath).array;
}
string tail_seg(string fn_src) {
return lng ~ "/html/" ~ base_filename_seg(fn_src);
@@ -147,34 +147,34 @@ template DocReformPathsHTML() {
string suffix = ".html";
struct _PathsStruct {
string doc_root() {
- return asNormalizedPath(root_pth.chainPath(doc_tree.doc_root)).array;
+ return ((root_pth.chainPath(doc_tree.doc_root)).asNormalizedPath).array;
}
string harvest(string fn_harvest) {
return doc_root ~ "/" ~ fn_harvest;
}
string base() {
- return asNormalizedPath(root_pth.chainPath(doc_tree.base)).array;
+ return ((root_pth.chainPath(doc_tree.base)).asNormalizedPath).array;
}
string image() {
- return asNormalizedPath(root_pth.chainPath(doc_tree.image)).array;
+ return ((root_pth.chainPath(doc_tree.image)).asNormalizedPath).array;
}
string css() {
- return asNormalizedPath(root_pth.chainPath(doc_tree.css)).array;
+ return ((root_pth.chainPath(doc_tree.css)).asNormalizedPath).array;
}
string fn_seg_css() {
- return asNormalizedPath(root_pth.chainPath(doc_tree.fn_seg_css)).array;
+ return ((root_pth.chainPath(doc_tree.fn_seg_css)).asNormalizedPath).array;
}
string fn_scroll_css() {
- return asNormalizedPath(root_pth.chainPath(doc_tree.fn_scroll_css)).array;
+ return ((root_pth.chainPath(doc_tree.fn_scroll_css)).asNormalizedPath).array;
}
string seg(string fn_src) {
- return asNormalizedPath(root_pth.chainPath(doc_tree.seg(fn_src))).array;
+ return ((root_pth.chainPath(doc_tree.seg(fn_src))).asNormalizedPath).array;
}
string fn_scroll(string fn_src) {
- return asNormalizedPath(root_pth.chainPath(doc_tree.fn_scroll(fn_src))).array;
+ return ((root_pth.chainPath(doc_tree.fn_scroll(fn_src))).asNormalizedPath).array;
}
string fn_seg(string fn_src, string seg_filename) {
- return asNormalizedPath(root_pth.chainPath(doc_tree.fn_seg(fn_src, seg_filename))).array;
+ return ((root_pth.chainPath(doc_tree.fn_seg(fn_src, seg_filename))).asNormalizedPath).array;
}
string tail_seg(string fn_src) {
return doc_tree.tail_seg(fn_src);
@@ -202,7 +202,7 @@ template DocReformUrlsHTML() {
string suffix = ".html";
struct _PathsStruct {
string doc_root() {
- return url_doc_root ~ asNormalizedPath(doc_tree.doc_root).array;
+ return url_doc_root ~ ((doc_tree.doc_root).asNormalizedPath).array;
}
string harvest(string fn_harvest) {
return format(q"┃%s/%s┃",
@@ -213,62 +213,62 @@ template DocReformUrlsHTML() {
string base() {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.base).array,
+ ((doc_tree.base).asNormalizedPath).array,
);
}
string image() {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.image).array,
+ ((doc_tree.image).asNormalizedPath).array,
);
}
string css() {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.css).array,
+ ((doc_tree.css).asNormalizedPath).array,
);
}
string fn_seg_css() {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.fn_seg_css).array,
+ ((doc_tree.fn_seg_css).asNormalizedPath).array,
);
}
string fn_scroll_css() {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.fn_scroll_css).array,
+ ((doc_tree.fn_scroll_css).asNormalizedPath).array,
);
}
string seg(string fn_src) {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.seg(fn_src)).array,
+ ((doc_tree.seg(fn_src)).asNormalizedPath).array,
);
}
string fn_scroll(string fn_src) {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.fn_scroll(fn_src)).array,
+ ((doc_tree.fn_scroll(fn_src)).asNormalizedPath).array,
);
}
string fn_seg(string fn_src, string seg_filename) {
return format(q"┃%s/%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.fn_seg(fn_src, seg_filename)).array,
+ ((doc_tree.fn_seg(fn_src, seg_filename)).asNormalizedPath).array,
);
}
string fn_scroll_obj_num(string fn_src, string obj_num) {
return format(q"┃%s/%s#%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.fn_scroll(fn_src)).array,
+ ((doc_tree.fn_scroll(fn_src)).asNormalizedPath).array,
obj_num,
);
}
string fn_seg_obj_num(string fn_src, string seg_filename, string obj_num) {
return format(q"┃%s/%s#%s┃",
url_doc_root,
- asNormalizedPath(doc_tree.fn_seg(fn_src, seg_filename)).array,
+ ((doc_tree.fn_seg(fn_src, seg_filename)).asNormalizedPath).array,
obj_num,
);
}
@@ -296,7 +296,7 @@ template DocReformPathsEPUB() {
string base_dir = "epub";
struct _PathsStruct {
string base() {
- return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;
+ return (((out_pth.output_base).chainPath(base_dir)).asNormalizedPath).array;
}
string base_filename(string fn_src) {
return fn_src.baseName.stripExtension;
@@ -305,43 +305,43 @@ template DocReformPathsEPUB() {
return base_filename(fn_src) ~ "." ~ lng;
}
string doc_meta_inf() {
- return asNormalizedPath("META-INF").array;
+ return (("META-INF").asNormalizedPath).array;
}
string doc_oebps() {
- return asNormalizedPath("OEBPS").array;
+ return (("OEBPS").asNormalizedPath).array;
}
string doc_oebps_css() {
- return asNormalizedPath(doc_oebps.chainPath("css")).array;
+ return ((doc_oebps.chainPath("css")).asNormalizedPath).array;
}
string doc_oebps_image() {
- return asNormalizedPath(doc_oebps.chainPath("image")).array;
+ return ((doc_oebps.chainPath("image")).asNormalizedPath).array;
}
string epub_file(string fn_src) {
- return asNormalizedPath(base.chainPath(base_filename_epub(fn_src) ~ ".epub")).array;
+ return ((base.chainPath(base_filename_epub(fn_src) ~ ".epub")).asNormalizedPath).array;
}
string dirtop() {
return "".chainPath("").array;
}
string fn_mimetypes() {
- return asNormalizedPath(dirtop.chainPath("mimetypes")).array;
+ return ((dirtop.chainPath("mimetypes")).asNormalizedPath).array;
}
string fn_dmi_container_xml() {
- return asNormalizedPath(doc_meta_inf.chainPath("container.xml")).array;
+ return ((doc_meta_inf.chainPath("container.xml")).asNormalizedPath).array;
}
string fn_oebps_toc_nav_xhtml() {
- return asNormalizedPath(doc_oebps.chainPath("toc_nav.xhtml")).array;
+ return ((doc_oebps.chainPath("toc_nav.xhtml")).asNormalizedPath).array;
}
string fn_oebps_toc_ncx() {
- return asNormalizedPath(doc_oebps.chainPath("toc.ncx")).array;
+ return ((doc_oebps.chainPath("toc.ncx")).asNormalizedPath).array;
}
string fn_oebps_content_opf() {
- return asNormalizedPath(doc_oebps.chainPath("content.opf")).array;
+ return ((doc_oebps.chainPath("content.opf")).asNormalizedPath).array;
}
string fn_oebps_content_xhtml(string seg_filename) {
- return asNormalizedPath(doc_oebps.chainPath(seg_filename ~ ".xhtml")).array;
+ return ((doc_oebps.chainPath(seg_filename ~ ".xhtml")).asNormalizedPath).array;
}
string fn_oebps_css() {
- return asNormalizedPath(doc_oebps_css.chainPath("epub.css")).array;
+ return ((doc_oebps_css.chainPath("epub.css")).asNormalizedPath).array;
}
/+ debug +/
string dbg_docdir(string fn_src) {
@@ -397,55 +397,55 @@ template DocReformPathsODT() {
string base_dir = "odf";
struct _PathsStruct {
string base_pth() { // dir will contain odt document file (also debug file tree)
- return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;
+ return (((out_pth.output_base).chainPath(base_dir)).asNormalizedPath).array;
}
string odt_file() {
- return asNormalizedPath(base_pth.chainPath(doc_matters.src.doc_uid_out ~ ".odt")).array;
+ return ((base_pth.chainPath(doc_matters.src.doc_uid_out ~ ".odt")).asNormalizedPath).array;
}
string dirtop(string type) {
return (type == "zip")
? "".chainPath("").array
- : asNormalizedPath(base_pth.chainPath(doc_matters.src.doc_uid_out)).array;
+ : ((base_pth.chainPath(doc_matters.src.doc_uid_out)).asNormalizedPath).array;
}
string mimetype(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("mimetype")).array;
+ return ((dirtop(type).chainPath("mimetype")).asNormalizedPath).array;
}
string manifest_rdf(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("manifest.rdf")).array;
+ return ((dirtop(type).chainPath("manifest.rdf")).asNormalizedPath).array;
}
string settings_xml(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("settings.xml")).array;
+ return ((dirtop(type).chainPath("settings.xml")).asNormalizedPath).array;
}
string styles_xml(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("styles.xml")).array;
+ return ((dirtop(type).chainPath("styles.xml")).asNormalizedPath).array;
}
string image_dir(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("Pictures")).array;
+ return ((dirtop(type).chainPath("Pictures")).asNormalizedPath).array;
}
string image(string image_fn_src, string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(image_dir(type).chainPath(image_fn_src)).array;
+ return ((image_dir(type).chainPath(image_fn_src)).asNormalizedPath).array;
}
string content_xml(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("content.xml")).array;
+ return ((dirtop(type).chainPath("content.xml")).asNormalizedPath).array;
}
string meta_inf_dir(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("META-INF")).array;
+ return ((dirtop(type).chainPath("META-INF")).asNormalizedPath).array;
}
string manifest_xml(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(meta_inf_dir(type).chainPath("manifest.xml")).array;
+ return ((meta_inf_dir(type).chainPath("manifest.xml")).asNormalizedPath).array;
}
string meta_xml(string type="fs") {
assert(type == "zip" || "fs");
- return asNormalizedPath(dirtop(type).chainPath("meta.xml")).array;
+ return ((dirtop(type).chainPath("meta.xml")).asNormalizedPath).array;
}
}
return _PathsStruct();
@@ -464,17 +464,17 @@ template DocReformPathsLaTeX() {
string base() {
auto out_pth = DocReformOutPaths!()(doc_matters.output_path, doc_matters.src.language);
string base_dir = "latex";
- return asNormalizedPath((out_pth.output_root).chainPath(base_dir)).array;
+ return (((out_pth.output_root).chainPath(base_dir)).asNormalizedPath).array;
}
string latex_path_stuff() {
- return asNormalizedPath(base.chainPath(base_filename(doc_matters.src.filename))).array;
+ return ((base.chainPath(base_filename(doc_matters.src.filename))).asNormalizedPath).array;
}
string latex_file_with_path() {
- return asNormalizedPath(base.chainPath(base_filename(doc_matters.src.filename) ~ "." ~ doc_matters.src.language ~ ".tex")).array;
+ return ((base.chainPath(base_filename(doc_matters.src.filename) ~ "." ~ doc_matters.src.language ~ ".tex")).asNormalizedPath).array;
}
string images() {
string image_dir = "image";
- return asNormalizedPath((base).chainPath(image_dir)).array;
+ return (((base).chainPath(image_dir)).asNormalizedPath).array;
}
}
return _PathsStruct();
@@ -494,13 +494,13 @@ template DocReformPathsSQLiteDiscrete() {
string base() {
auto out_pth = DocReformOutPaths!()(output_pth_root, lng);
string base_dir = "sqlite";
- return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;
+ return (((out_pth.output_base).chainPath(base_dir)).asNormalizedPath).array;
}
string seg(string fn_src) {
- return asNormalizedPath(base.chainPath(base_filename(fn_src))).array;
+ return ((base.chainPath(base_filename(fn_src))).asNormalizedPath).array;
}
string sqlite_file(string fn_src) {
- return asNormalizedPath(base.chainPath(base_filename(fn_src) ~ ".sql.db")).array;
+ return ((base.chainPath(base_filename(fn_src) ~ ".sql.db")).asNormalizedPath).array;
}
}
return _PathsStruct();
@@ -520,10 +520,10 @@ template DocReformPathsSQLite() {
string base() {
auto out_pth = DocReformOutPathSQLite!()(output_pth_root); // decide whether to have separate files for each language
string base_dir = "sqlite";
- return asNormalizedPath((out_pth.output_root).chainPath(base_dir)).array;
+ return (((out_pth.output_root).chainPath(base_dir)).asNormalizedPath).array;
}
string sqlite_file() {
- return asNormalizedPath(base.chainPath(base_filename(db_name) ~ ".sql.db")).array;
+ return ((base.chainPath(base_filename(db_name) ~ ".sql.db")).asNormalizedPath).array;
}
}
return _PathsStruct();
diff --git a/src/doc_reform/output/rgx.d b/src/doc_reform/output/rgx.d
index c7896ac..89d5858 100644
--- a/src/doc_reform/output/rgx.d
+++ b/src/doc_reform/output/rgx.d
@@ -18,8 +18,8 @@ static template DocReformOutputRgxInit() {
static nbsp_char_and_space = ctRegex!(`░[ ]`, "mg");
static special_markup_chars = ctRegex!(`[【】〖〗┥┝┤├¤░┘┙┚┼┿╂┊┏┚┆■]`, "mg");
static src_pth_sst_or_ssm = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.](?P<extension>ss[tm]))$`);
- static src_pth_pod_sst_or_ssm = ctRegex!(`^(?P<podpath>[/]?(?:[a-zA-Z0-9._-]+/)*)media/text/[a-z]{2}/(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])$`);
- static src_pth_contents = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+)/pod[.]manifest$`);
+ static src_pth_pod_sst_or_ssm = ctRegex!(`^(?P<podpath>[/]?(?:[a-zA-Z0-9._-]+/)*)media/text/[a-z]{2}/(?P<filename>[a-zA-Z0-9][a-zA-Z0-9._-]*?[.]ss[tm])$`);
+ static src_pth_contents = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9][a-zA-Z0-9._-]*)/pod[.]manifest$`);
static src_pth_zip = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.]zip)$`);
static src_pth_unzip_pod = ctRegex!(`^(?P<path>media/text/[a-z]{2}/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`);
static src_pth_types =