aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_shared.org
blob: 7071eda18ca95ada20d0c229ed3161409b709d3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#+TITLE:       doc_reform shared
#+DESCRIPTION: documents - structuring, publishing in multiple formats & search
#+FILETAGS:    :doc_reform:default:shared:
#+AUTHOR:      Ralph Amissah
#+EMAIL:       [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
#+COPYRIGHT:   Copyright (C) 2015 - 2019 Ralph Amissah
#+LANGUAGE:    en
#+STARTUP:     indent content hideblocks hidestars
#+OPTIONS:     H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t
#+OPTIONS:     TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+OPTIONS:     author:nil email:nil creator:nil timestamp:nil
#+PROPERTY:    header-args :padline no :exports code :cache no :noweb yes
#+EXPORT_SELECT_TAGS:  export
#+EXPORT_EXCLUDE_TAGS: noexport
#+TAGS: assert(a) class(c) debug(d) mixin(m) doc_reform(s) tangle(T) template(t) WEB(W) noexport(n)

[[./doc_reform.org][doc_reform]]  [[./][org/]]
* 0. shared
** 0. module template                                        :module:shared:

#+BEGIN_SRC d :tangle "../src/doc_reform/share/defaults.d"
/++
  shared default settings
+/
module doc_reform.share.defaults;
<<shared_messages>>
#+END_SRC

** template: messages                                             :messages:
#+name: shared_messages
#+BEGIN_SRC d
template Msg() {
  import std.stdio;
  auto Msg(I)(I doc_matters) {
    struct Msg_ {
      void v()(string message) {
        if (!(doc_matters.opt.action.quiet) && doc_matters.opt.action.verbose) {
          writeln(message);
        }
      }
      void vv()(string message) {
        if (!(doc_matters.opt.action.quiet) && doc_matters.opt.action.very_verbose) {
          writeln(message);
        }
      }
    }
    return Msg_();
  }
}
#+END_SRC