summaryrefslogtreecommitdiffhomepage
path: root/org/config_d_cfte.org
blob: 1f287179464ee91ec2813315effe653ebf8b5942 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
-*- mode: org -*-
#+TITLE:       configuration d cfte
#+DESCRIPTION: documents - structuring, various output representations & search
#+FILETAGS:    :spine:hub:
#+AUTHOR:      Ralph Amissah
#+EMAIL:       [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
#+COPYRIGHT:   Copyright (C) 2015 - 2024 Ralph Amissah
#+LANGUAGE:    en
#+STARTUP:     content hideblocks hidestars noindent entitiespretty
#+PROPERTY:    header-args  :exports code
#+PROPERTY:    header-args+ :noweb yes
#+PROPERTY:    header-args+ :results no
#+PROPERTY:    header-args+ :cache no
#+PROPERTY:    header-args+ :padline no
#+PROPERTY:    header-args+ :mkdirp yes
#+OPTIONS:     H:3 num:nil toc:t \n:t ::t |:t ^:nil -:t f:t *:t

- [[./doc-reform.org][doc-reform.org]]  [[../org/][org/]]

* cfte views version.txt configuration.txt (set version & configuration) SET

** program version: version.txt

*** spine project VERSION (major, minor, patch) :version:set:project:

- comma separated numbers: major, minor, patch

#+NAME: spine_version_mmp
#+HEADER: :noweb yes
#+BEGIN_SRC emacs-lisp
<<./spine_version_info_and_doc_header_including_copyright_and_license.org:spine_project_version_major_minor_patch()>>
#+END_SRC

*** set program version tangle :version:

#+HEADER: :tangle "../views/version.txt"
#+HEADER: :noweb yes
#+BEGIN_SRC txt
/+ obt - org-mode generated file +/
struct Version {
  int major;
  int minor;
  int patch;
}
enum _ver = Version(<<spine_version_mmp>>);
<<spine_compiler_restrictions>>
#+END_SRC

*** compilation restrictions (supported compilers)
- set compilation restrictions

https://dlang.org/spec/version.html#predefined-versions

#+NAME: spine_compiler_restrictions
#+HEADER: :noweb yes
#+BEGIN_SRC d
version (Posix) {
  version (DigitalMars) {
  } else version (LDC) {
  } else version (GNU) {
  } else {
    static assert (0, "Unsupported D compiler");
  }
} else {
  static assert (0, "Unsupported D compiler");
}
#+END_SRC

** set configuration SET :configuration:

SEE NOTES on configuration hierarchy in spine.org

*** spine: configuration.txt SET
**** example

#+HEADER: :tangle "../views/configuration_example.txt"
#+HEADER: :noweb yes
#+BEGIN_SRC d
/+ obt - org-mode generated file +/
struct Cfg {
  string http_request_type     = "http";
  string http_host             = "localhost";
  string www_url_doc_subroot   = "/spine";
  string cgi_filename          = "spine_search";
  string cgi_search_form_title = "≅ SiSU Spine search";
  string db_sqlite_path        = "/var/www/sqlite";
  string db_sqlite_filename    = "spine.search.db";
}
enum _cfg = Cfg();
#+END_SRC

#+BEGIN_SRC d
/+ obt - org-mode generated file +/
struct Cfg {
  string http_request_type        = "<<http_request_type>>";
  string http_host                = "<<http_host>>";
  string www_url_doc_root         = "<<www_url_doc_root>>";
  string www_url_doc_subroot      = "<<www_url_doc_subroot>>";
  string processing_path_doc_root = "<<processing_path_doc_root>>";
  string cgi_bin_root             = "<<cgi_bin_root>>";
  string cgi_bin_subpath          = "<<cgi_bin_subpath>>";
  string cgi_filename             = "<<cgi_filename>>";
  string cgi_url_root             = "<<http_request_type>>://<<http_host>><<cgi_bin_subpath>>";
  string cgi_port                 = "";
  string cgi_user                 = "";
  string cgi_url_action           = "<<http_request_type>>://<<http_host>><<cgi_bin_subpath>>/<<cgi_filename>>";
  string cgi_search_form_title    = "<<cgi_search_form_title>>";
  string db_sqlite_path           = "<<db_sqlite_path>>";
  string db_sqlite_filename       = "<<db_sqlite_filename>>";
  string default_language         = "en";
  string default_papersize        = "a4,letter.portrait";
  string default_text_wrap        = "80";
  string default_hash_digest      = "sha256";
}
enum _cfg = Cfg();
#+END_SRC

**** configure

#+HEADER: :tangle ../views/configuration.txt_
#+HEADER: :noweb yes
#+BEGIN_SRC d
<<config_localhost>>
#+END_SRC

**** configure remote host (sisudoc.org)

#+NAME: config_remotehost
#+HEADER: :tangle ../views/configuration.txt_remotehost_
#+BEGIN_SRC d
struct Cfg {
  string http_request_type     = "https";
  string http_host             = "sisudoc.org";
  string www_url_doc_subroot   = "/spine";
  string cgi_filename          = "spine_search";
  string cgi_search_form_title = "≅ SiSU Spine search ፨";
  string db_sqlite_path        = "/var/www/sqlite";
  string db_sqlite_filename    = "spine.search.db";
}
enum _cfg = Cfg();
#+END_SRC

#+BEGIN_SRC d
struct Cfg {
  string http_request_type        = "https";
  string http_host                = "sisudoc.org";
  string www_url_doc_root         = "https://sisudoc.org";
  string www_url_doc_subroot      = "/spine";
  string processing_path_doc_root = "/srv/www/spine";
  string cgi_bin_root             = "/var/www/cgi/cgi-bin";
  string cgi_bin_subpath          = "";
  string cgi_filename             = "spine_search";
  string cgi_url_root             = "https://sisudoc.org";
  string cgi_port                 = "";
  string cgi_user                 = "";
  string cgi_url_action           = "https://sisudoc.org/spine_search";
  string cgi_search_form_title    = "≅ SiSU Spine search ፨";
  string db_sqlite_path           = "/var/www/sqlite";
  string db_sqlite_filename       = "spine.search.db";
  string default_language         = "en";
  string default_papersize        = "a4";
  string default_text_wrap        = "80";
  string default_hash_digest      = "sha256";
}
enum _cfg = Cfg();
#+END_SRC

**** configure localhost

#+NAME: config_localhost
#+HEADER: :tangle ../views/configuration.txt_localhost_
#+BEGIN_SRC d
struct Cfg {
  string http_request_type     = "http";
  string http_host             = "localhost";
  string www_url_doc_subroot   = "/spine";
  string cgi_filename          = "spine_search";
  string cgi_search_form_title = "≅ SiSU Spine search ፨";
  string db_sqlite_path        = "/var/www/sqlite";
  string db_sqlite_filename    = "spine.search.db";
}
enum _cfg = Cfg();
#+END_SRC

#+BEGIN_SRC d
struct Cfg {
  string http_request_type        = "http";
  string http_host                = "localhost";
  string www_url_doc_root         = "http://localhost";
  string www_url_doc_subroot      = "/spine";
  string processing_path_doc_root = "/srv/www/spine";
  string cgi_bin_root             = "/var/www/cgi/cgi-bin";
  string cgi_bin_subpath          = "/cgi-bin";
  string cgi_filename             = "spine_search";
  string cgi_url_root             = "http://localhost/cgi-bin";
  string cgi_port                 = "";
  string cgi_user                 = "";
  string cgi_url_action           = "http://localhost/cgi-bin/spine_search";
  string cgi_search_form_title    = "≅ SiSU Spine search ፨";
  string db_sqlite_path           = "/var/www/sqlite";
  string db_sqlite_filename       = "spine.search.db";
  string default_language         = "en";
  string default_papersize        = "a4,letter.portrait";
  string default_text_wrap        = "80";
  string default_hash_digest      = "sha256";
}
enum _cfg = Cfg();
#+END_SRC

*** spine_search: configuration.txt SET

#+HEADER: :tangle "../doc-reform-code-software-search-cgi/views/configuration_example.txt"
#+HEADER: :noweb yes
#+BEGIN_SRC d
/+ obt - org-mode generated file +/
struct Cfg {
  string http_request_type     = "<<http_request_type>>";
  string http_host             = "<<http_host>>";
  string www_url_doc_subroot   = "<<www_doc_subroot>>";
  string cgi_filename          = "<<cgi_filename>>";
  string cgi_search_form_title = "<<cgi_search_form_title>>";
  string db_sqlite_path        = "<<db_sqlite_path>>";
  string db_sqlite_filename    = "<<db_sqlite_filename>>";
}
enum _cfg = Cfg();
#+END_SRC

#+BEGIN_SRC d
struct Cfg {
  string http_request_type     = "https";
  string http_host             = "sisudoc.org";
  string www_url_doc_subroot   = "/spine";
  string cgi_filename          = "spine_search";
  string cgi_search_form_title = "≅ SiSU Spine search ፨";
  string db_sqlite_path        = "/var/www/sqlite";
  string db_sqlite_filename    = "spine.search.db";
}
enum _cfg = Cfg();
#+END_SRC

*** shared settings SET defaults

#+NAME: http_request_type
#+BEGIN_SRC sh
http
#+END_SRC

#+NAME: http_host
#+BEGIN_SRC sh
localhost
#+END_SRC

#+NAME: www_url_doc_root
#+BEGIN_SRC sh
http://localhost
#+END_SRC

#+NAME: www_url_doc_subroot
#+BEGIN_SRC sh
/spine
#+END_SRC

#+NAME: processing_path_doc_root
#+BEGIN_SRC sh
/srv/www/spine
#+END_SRC

#+NAME: www_doc_subroot
#+BEGIN_SRC sh
/spine
#+END_SRC

#+NAME: cgi_bin_root
#+BEGIN_SRC sh
/var/www/cgi/cgi-bin
#+END_SRC

#+NAME: db_sqlite_path
#+BEGIN_SRC sh
/var/www/sqlite
#+END_SRC

#+NAME: cgi_filename
#+BEGIN_SRC sh
spine_search
#+END_SRC

#+NAME: cgi_bin_subpath
#+BEGIN_SRC sh
/cgi-bin
#+END_SRC

#+NAME: cgi_search_form_title
#+BEGIN_SRC sh
≅ SiSU Spine search ፨
#+END_SRC

#+NAME: db_sqlite_filename
#+BEGIN_SRC sh
spine.search.db
#+END_SRC