aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_paths.org
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 /org/default_paths.org
parentcosmetic (diff)
0.4.0 sqlite related
Diffstat (limited to 'org/default_paths.org')
-rw-r--r--org/default_paths.org42
1 files changed, 42 insertions, 0 deletions
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;
<<template_paths_out>>
+<<template_paths_url>>
<<template_paths_html>>
<<template_paths_epub>>
<<template_paths_sqlite>>
@@ -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