From f7a56d241065cac08e6fba20cb9b658a8f073ad5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 15 Nov 2018 18:57:53 -0500 Subject: 0.4.0 sqlite related --- org/default_paths.org | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'org/default_paths.org') diff --git a/org/default_paths.org b/org/default_paths.org index 07f1176..6d38825 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -915,6 +915,7 @@ import std.array, std.stdio; import doc_reform.meta.rgx; <> +<> <> <> <> @@ -1012,6 +1013,47 @@ template DocReformOutPathsFnPd() { } #+END_SRC +** _url_ :url: + +#+name: template_paths_url +#+BEGIN_SRC d +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(); + } +} +#+END_SRC + ** _html_ :html: #+name: template_paths_html -- cgit v1.2.3