aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/output/paths_output.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2018-11-15 18:57:53 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2019-05-17 16:59:38 -0400
commitf7a56d241065cac08e6fba20cb9b658a8f073ad5 (patch)
tree3056f3246833590fb19b22dde5a338bb371195f4 /src/doc_reform/output/paths_output.d
parentcosmetic (diff)
0.4.0 sqlite related
Diffstat (limited to 'src/doc_reform/output/paths_output.d')
-rw-r--r--src/doc_reform/output/paths_output.d35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/doc_reform/output/paths_output.d b/src/doc_reform/output/paths_output.d
index f4dc083..f6e8f1b 100644
--- a/src/doc_reform/output/paths_output.d
+++ b/src/doc_reform/output/paths_output.d
@@ -79,6 +79,41 @@ template DocReformOutPathsFnPd() {
return _PathsStruct();
}
}
+template DocReformPathsUrl() {
+ import std.format;
+ mixin DocReformRgxInit;
+ static auto rgx = Rgx();
+ auto DocReformPathsUrl(M)(M doc_matters) {
+ struct _UrlPathsStruct {
+ string doc_root() {
+ string _doc_root = (doc_matters.conf_make_meta.conf.webserv_url_doc_path.length > 0)
+ ? doc_matters.conf_make_meta.conf.webserv_url_doc_root
+ : "file://" ~ doc_matters.output_path;
+ return _doc_root;
+ }
+ string html_seg(string html_segname, string obj_id) { // TODO bespoke for sqlite
+ string _url = format(q"¶%s/%s/html/%s/%s.html#%s¶",
+ doc_root,
+ doc_matters.src.language,
+ doc_matters.src.filename_base,
+ html_segname,
+ obj_id
+ );
+ if (html_segname.empty || obj_id.empty) {
+ if (
+ doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose
+ ) {
+ writeln("sqlite object missing segname or object id: ", _url);
+ }
+ _url = "";
+ }
+ return _url;
+ }
+ }
+ return _UrlPathsStruct();
+ }
+}
template DocReformPathsHTML() {
mixin DocReformRgxInit;
static auto rgx = Rgx();