diff options
Diffstat (limited to 'src/doc_reform/output/paths_output.d')
-rw-r--r-- | src/doc_reform/output/paths_output.d | 35 |
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(); |