d: po4a, continue reorganization (translation request dev stopped)
[software/sisu] / lib / sisu / develop / constants.rb
1 # encoding: utf-8
2 =begin
3
4 * Name: SiSU
5
6 ** Description: documents, structuring, processing, publishing, search
7 *** constants, system environment, resource control and configuration details
8
9 ** Author: Ralph Amissah
10 <ralph@amissah.com>
11 <ralph.amissah@gmail.com>
12
13 ** Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
14 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Ralph Amissah,
15 All Rights Reserved.
16
17 ** License: GPL 3 or later:
18
19 SiSU, a framework for document structuring, publishing and search
20
21 Copyright (C) Ralph Amissah
22
23 This program is free software: you can redistribute it and/or modify it
24 under the terms of the GNU General Public License as published by the Free
25 Software Foundation, either version 3 of the License, or (at your option)
26 any later version.
27
28 This program is distributed in the hope that it will be useful, but WITHOUT
29 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
30 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
31 more details.
32
33 You should have received a copy of the GNU General Public License along with
34 this program. If not, see <http://www.gnu.org/licenses/>.
35
36 If you have Internet connection, the latest version of the GPL should be
37 available at these locations:
38 <http://www.fsf.org/licensing/licenses/gpl.html>
39 <http://www.gnu.org/licenses/gpl.html>
40
41 <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html>
42
43 ** SiSU uses:
44 * Standard SiSU markup syntax,
45 * Standard SiSU meta-markup syntax, and the
46 * Standard SiSU object citation numbering and system
47
48 ** Hompages:
49 <http://www.jus.uio.no/sisu>
50 <http://www.sisudoc.org>
51
52 ** Git
53 <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
54 <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/develop/constants.rb;hb=HEAD>
55
56 =end
57 #Ax,Xx,Mx,Rx,Hx,Dx,Px,Ep,Db,Gt,Tex=Array.new(11){{}}
58 YEAR='2014'
59 Sfx={
60 txt: '.txt',
61 txt_textile: '.textile',
62 txt_asciidoc: '.ad',
63 txt_markdown: '.md',
64 txt_rst: '.rst',
65 txt_orgmode: '.org',
66 html: '.html',
67 xhtml: '.xhtml',
68 xml: '.xml',
69 xml_sax: '.sax.xml',
70 xml_dom: '.dom.xml',
71 xml_scaffold: '.scaffold.xml',
72 xml_scaffold_structure_sisu: '.scaffold.sisu.xml',
73 xml_scaffold_structure_collapse: '.scaffold.collapse.xml',
74 xml_docbook: '.docbook.xml',
75 xml_docbook_article: '.article.docbook.xml',
76 xml_docbook_book: '.book.docbook.xml',
77 xml_fictionbook: '.fb2',
78 epub: '.epub',
79 epub_xhtml: '.xhtml',
80 odt: '.odt',
81 pdf: '.pdf',
82 manpage: '.1',
83 info: '.info',
84 texinfo: '.texinfo',
85 sql: '.sql.db',
86 }
87 Ax={
88 tab: "\t",
89 comment: '%',
90 spaces: ' ',
91 }
92 Xx={
93 protect: '☞',
94 split: '✠',
95 segment: 'Ф',
96 relative_path: '☼',
97 html_relative2: '※※',
98 html_relative1: '※',
99 }
100 Mx={
101 segname_prefix_auto_num_extract: 'c',
102 segname_prefix_auto_num_provide: 's',
103 segname_prefix_auto_num_other: 'x',
104 ocn_id_char: '', #'o', now as before; remove for html5
105 note: 'note_',
106 note_ref: 'noteref_',
107 note_astx: 'note_astx_',
108 note_ref_astx: 'noteref_astx_',
109 note_plus: 'note_plus_',
110 note_ref_plus: 'noteref_plus_',
111 meta_o: '〔@', meta_c: '〕',
112 lv_o_0: 0,
113 lv_o_1: 1,
114 lv_o_2: 2,
115 lv_o_3: 3,
116 lv_o_4: 4,
117 lv_o_5: 5,
118 lv_o_6: 6,
119 lv_o_7: 7,
120 lv_o_8: 8,
121 lv_o_9: 9,
122 lv_o: '〔', lv_c: '〕',
123 en_a_o: '【', en_a_c: '】', #endnote Mx[:en_a_o]='~{'; Mx[:en_a_c]='}~'
124 en_b_o: '〖', en_b_c: '〗', #endnote Mx[:en_b_o]='~['; Mx[:en_b_c]=']~'
125 bl_o: '〔', bl_c: '〕', #block text mark
126 gr_o: '〔', gr_c: '〕', #group text mark #REPLACE & RETIRE
127 id_o: '〔', id_c: '〕', #object id mark
128 tc_o: '『', tc_c: "』", #table row mark #Mx[:tc_c]="』\n"
129 tc_p: '┆', #table col/misc mark
130 pa_o: '〔', pa_c: '〕', #affects paragraph mark
131 mk_o: '〔', mk_c: '〕', #generic mark
132 gl_o: '〔', gl_c: '〕', #glyph
133 fa_o: '〔', fa_o_c: '¤', fa_c_o: '¤', fa_c: '〕',
134 idx_o: '▩', idx_c: '▩',
135 nbsp: '░', #'▭ '
136 br_line: '╱', #lB ▌ 9612 ┘ ¶
137 br_nl: '╲', #lB ▌ 』 ┘
138 br_paragraph: '█', #FB █ 9608 # PP ∥ 8741 #▐ #'┘' #'¶' #FB █ 9608 lB ▌ 9612 RB ▐ 9616
139 br_obj: 'break_obj',
140 br_page_line: '▭',
141 br_page: '┼',
142 br_page_new: '╋',
143 lnk_o: '⌠', lnk_c: '⌡', #'⌈' '⌋' '⌠' '⌡' #Mx[:lnk_o: '◁'; Mx[:lnk_c: '▷' #‹ ›
144 url_o: '◘', url_c: '◙',
145 rel_o: '⌈', rel_c: '⌋',
146 tag_o: '⌊', tag_c: '⌉',
147 sm_set_o: '◢', sm_set_c: '◣',
148 sm_subset_o: '◢', sm_subset_c: '◣',
149 vline: '┆', # ¦ |
150 src_bold_o: '!{', src_bold_c: '}!',
151 src_italics_o: '/{', src_italics_c: '}/',
152 src_underscore_o: '_{', src_underscore_c: '}_',
153 src_cite_o: '"{', src_cite_c: '}"',
154 src_insert_o: '+{', src_insert_c: '}+',
155 src_strike_o: '-{', src_strike_c: '}-',
156 src_superscript_o: '^{', src_superscript_c: '}^',
157 src_subscript_o: ',{', src_subscript_c: '}',
158 src_hilite_o: '*{', src_hilite_c: '}*',
159 src_monospace_o: '#{', src_monospace_c: '}#',
160 srcrgx_bold_o: '\!\{', srcrgx_bold_c: '\}\!',
161 srcrgx_italics_o: '\/\{', srcrgx_italics_c: '\}\/',
162 srcrgx_underscore_o: '_\{', srcrgx_underscore_c: '\}_',
163 srcrgx_cite_o: '"\{', srcrgx_cite_c: '\}"',
164 srcrgx_insert_o: '\+\{', srcrgx_insert_c: '\}\+',
165 srcrgx_strike_o: '\-\{', srcrgx_strike_c: '\}\-',
166 srcrgx_superscript_o: '\^\{', srcrgx_superscript_c: '\}\^',
167 srcrgx_subscript_o: ',\{', srcrgx_subscript_c: '\},',
168 srcrgx_hilite_o: '\*\{', srcrgx_hilite_c: '\}\*',
169 srcrgx_monospace_o: '\#\{', srcrgx_monospace_c: '\}\#',
170 }
171 Mx[:fa_bold_o]= "#{Mx[:fa_o]}b#{Mx[:fa_o_c]}"
172 Mx[:fa_bold_c]= "#{Mx[:fa_c_o]}b#{Mx[:fa_c]}"
173 Mx[:fa_italics_o]= "#{Mx[:fa_o]}i#{Mx[:fa_o_c]}"
174 Mx[:fa_italics_c]= "#{Mx[:fa_c_o]}i#{Mx[:fa_c]}"
175 Mx[:fa_underscore_o]= "#{Mx[:fa_o]}u#{Mx[:fa_o_c]}"
176 Mx[:fa_underscore_c]= "#{Mx[:fa_c_o]}u#{Mx[:fa_c]}"
177 Mx[:fa_cite_o]= "#{Mx[:fa_o]}cite#{Mx[:fa_o_c]}"
178 Mx[:fa_cite_c]= "#{Mx[:fa_c_o]}cite#{Mx[:fa_c]}"
179 Mx[:fa_insert_o]= "#{Mx[:fa_o]}ins#{Mx[:fa_o_c]}"
180 Mx[:fa_insert_c]= "#{Mx[:fa_c_o]}ins#{Mx[:fa_c]}"
181 Mx[:fa_strike_o]= "#{Mx[:fa_o]}del#{Mx[:fa_o_c]}"
182 Mx[:fa_strike_c]= "#{Mx[:fa_c_o]}del#{Mx[:fa_c]}"
183 Mx[:fa_superscript_o]= "#{Mx[:fa_o]}sup#{Mx[:fa_o_c]}"
184 Mx[:fa_superscript_c]= "#{Mx[:fa_c_o]}sup#{Mx[:fa_c]}"
185 Mx[:fa_subscript_o]= "#{Mx[:fa_o]}sub#{Mx[:fa_o_c]}"
186 Mx[:fa_subscript_c]= "#{Mx[:fa_c_o]}sub#{Mx[:fa_c]}"
187 Mx[:fa_hilite_o]= "#{Mx[:fa_o]}hi#{Mx[:fa_o_c]}"
188 Mx[:fa_hilite_c]= "#{Mx[:fa_c_o]}hi#{Mx[:fa_c]}"
189 Mx[:fa_monospace_o]= "#{Mx[:fa_o]}mono#{Mx[:fa_o_c]}"
190 Mx[:fa_monospace_c]= "#{Mx[:fa_c_o]}mono#{Mx[:fa_c]}"
191 Mx[:gl_bullet]= "#{Mx[:gl_o]}#{Mx[:gl_c]}"
192 Mx[:br_endnotes]= "#{Mx[:mk_o]}ENDNOTES#{Mx[:mk_c]}"
193 Mx[:br_eof]= "#{Mx[:mk_o]}EOF#{Mx[:mk_c]}"
194 Mx[:pa_non_object_dummy_heading]="#{Mx[:pa_o]}-##{Mx[:pa_c]}" #unnumbered paragraph, delete when not required [used in dummy headings, eg. for segmented html] (place marker at end of paragraph)
195 Mx[:pa_non_object_no_heading]="#{Mx[:pa_o]}~##{Mx[:pa_c]}" #unnumbered paragraph (place marker at end of paragraph)
196 Hx={
197 br_obj: { obj: Mx[:br_obj] }, # line sep
198 br_page_line: { obj: Mx[:br_page_line] }, # line across page
199 br_page: { obj: Mx[:br_page] }, # newpage
200 br_page_new: { obj: Mx[:br_page_new] }, # clearpage
201 }
202 #Mx[:sm_set_o]='∈ '; Mx[:sm_set_c]='∋ '
203 #Mx[:sm_subset_o]='∈ '; Mx[:sm_subset_c]='∋ '
204 Rx={
205 mx_fa_clean: /#{Mx[:fa_o]}.+?#{Mx[:fa_c]}|#{Mx[:pa_o]}.+?#{Mx[:pa_c]}|#{Mx[:mk_o]}.+?#{Mx[:mk_c]}/,
206 lv: /〔([0-9]):(\S*?)〕/,
207 lv_0: /#{Mx[:lv_o_0]}(\S*?)#{Mx[:lv_c]}/,
208 lv_1: /#{Mx[:lv_o_1]}(\S*?)#{Mx[:lv_c]}/,
209 lv_2: /#{Mx[:lv_o_2]}(\S*?)#{Mx[:lv_c]}/,
210 lv_3: /#{Mx[:lv_o_3]}(\S*?)#{Mx[:lv_c]}/,
211 lv_4: /#{Mx[:lv_o_4]}(\S*?)#{Mx[:lv_c]}/,
212 lv_5: /#{Mx[:lv_o_5]}(\S*?)#{Mx[:lv_c]}/,
213 lv_6: /#{Mx[:lv_o_6]}(\S*?)#{Mx[:lv_c]}/,
214 lv_7: /#{Mx[:lv_o_7]}(\S*?)#{Mx[:lv_c]}/,
215 lv_8: /#{Mx[:lv_o_8]}(\S*?)#{Mx[:lv_c]}/,
216 lv_9: /#{Mx[:lv_o_9]}(\S*?)#{Mx[:lv_c]}/,
217 meta: /#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}/,
218 }
219 Dx={
220 ocn_o: '「', ocn_c: '」',
221 url_o: '‹', url_c: '›',
222 url_o_xml: '&lt;', url_c_xml: '&gt;',
223 rel_o: '‹', rel_c: '›',
224 lt_xml: '&lt;', gt_xml: '&gt;',
225 }
226 Tex={
227 backslash: "\\\\",
228 backslash: "\\\\",
229 tilde: '\\\\\\~',
230 }
231 Px={
232 bold_o: '*', bold_c: '*',
233 italics_o: '/', italics_c: '/',
234 underscore_o: '_', underscore_c: '_',
235 #emphasis_o: '*', emphasis_c: '*',
236 #bold_o: '!', bold_c: '!',
237 cite_o: '"', cite_c: '"',
238 insert_o: '+', insert_c: '+',
239 strike_o: '-', strike_c: '-',
240 superscript_o: '^', superscript_c: '^',
241 subscript_o: '[', subscript_c: ']',
242 hilite_o: '*', hilite_c: '*',
243 monospace_o: '', monospace_c: '',
244 lng_lst: SiSU_is[:language_list],
245 lng_lst_rgx: SiSU_is[:language_list_regex],
246 lv1: '*',
247 lv2: '=',
248 lv3: '=',
249 lv4: '-',
250 lv5: '.',
251 lv6: '.',
252 }
253 Px[:lng_lst_rgx]=Px[:lng_lst].join('|')
254 Ep={
255 alt: :on,
256 d_oebps: 'OEBPS',
257 d_image: 'OEBPS/image',
258 d_css: 'OEBPS/css',
259 f_ncx: 'toc.ncx',
260 f_opf: 'content.opf',
261 }
262 $ep=if Ep[:alt]==:on
263 {
264 o: 'opf:',
265 hsp: ' ',
266 }
267 else
268 {
269 o: '',
270 hsp: '&nbsp;',
271 }
272 end
273 Db={
274 name_prefix: "SiSU#{SiSU_is[:branch_version]}c_",
275 name_prefix_db: "sisu_#{SiSU_is[:branch_version]}c_",
276 col_title: 800,
277 col_title_part: 400,
278 col_title_edition: 10,
279 col_name: 600,
280 col_creator_misc_short: 100,
281 col_language: 100,
282 col_language_char: 6,
283 col_date_text: 10,
284 col_txt_long: 600,
285 col_txt_short: 200,
286 col_identify_hash: 256,
287 col_library: 30,
288 col_small: 16,
289 col_filename: 256,
290 col_digest: 128,
291 col_filesize: 10,
292 col_info_note: 2500,
293 }
294 Gt={
295 grotto: 'sisu_src',
296 git: 'sisu:',
297 src: 'src',
298 pods: 'pods',
299 sisupod: 'sisupod',
300 pod: 'pod',
301 files: 'files',
302 doc: 'doc',
303 po: 'po4a/po',
304 pot: 'po4a/pot',
305 image: 'image',
306 audio: 'audio',
307 video: 'video',
308 conf: 'doc/_sisu',
309 }
310 S_CONF={
311 header_make: 'sisu_document_make',
312 rc_yml: 'sisurc.yml',
313 }
314 ANSI_C={
315 red: "\033[#{31}m",
316 green: "\033[#{32}m",
317 yellow: "\033[#{33}m",
318 blue: "\033[#{34}m",
319 fuchsia: "\033[#{35}m",
320 cyan: "\033[#{36}m",
321 inv_red: "\033[#{41}m",
322 inv_green: "\033[#{42}m",
323 inv_yellow: "\033[#{43}m",
324 inv_blue: "\033[#{44}m",
325 inv_fuchsia: "\033[#{45}m",
326 inv_cyan: "\033[#{46}m",
327 b_red: "\033[#{91}m",
328 b_green: "\033[#{92}m",
329 b_yellow: "\033[#{93}m",
330 b_blue: "\033[#{94}m",
331 b_fuchsia: "\033[#{95}m",
332 b_cyan: "\033[#{96}m",
333 off: "\033[m"
334 }
335 DISABLE={
336 epub: {
337 internal_navigation: true,
338 per_section_title: true,
339 ncx_navpoint_unique_id: true,
340 },
341 }
342 DEVELOPER={
343 maintenance: :false,
344 under_construction: '_CONSTRUCTION_ZONE',
345 }
346 __END__
347 utils.rb
348 consider:
349 〔comment〕
350 〔links?????〕
351 import document?
352 check:
353 bold line
354
355 ┆┆⋮┇┊┋
356 『』
357 「」
358 〔〕
359 【】
360
361 ·
362 ¤
363 #˝ " λ Ω β α π Ѫ Ж Я Ѳ ѳ Ф ✠ ㈣
364 Ѳ ѳ Ф
365 ♩ ♭  ✠  ▭ ▬ ▪
366 【】〖〗◢ ◣ ◀ ▶ ◘ ◙ « ▲ »
367 《》「」
368 ‹ › ∗  ∴ ∷
369 '〔lv1〕','〔lv2〕','〔lv3〕','〔lv4〕','〔lv5〕','〔lv6〕','〔lv7〕','〔lv8〕','〔lv9〕'
370 '〔 Ѳ1','〔 Ѳ2','〔 Ѳ3','〔 Ѳ4','〔 Ѳ5','〔Ѳ6','〔Ѳ7','〔Ѳ8','〔Ѳ9'
371 ◁▷
372 ◀this is text or an image▶ http://
373 p __FILE__ +':'+ __LINE__.to_s
374 p __FILE__ + ' ' + __LINE__.to_s + ' ' + html
375 puts "#{__FILE__} #{__LINE__} #{o.inspect}"
376 puts __FILE__ + ' ' + __LINE__.to_s + '--> ' + o.inspect
377 puts %{-\t#{__FILE__}::#{__LINE__}::#{caller}:\n"#{name}"}
378 p "\t" + txt.obj + " << #{__FILE__} #{__LINE__} >>"
379 p (__FILE__ + ' ' + __LINE__.to_s + '--> ' + dob.inspect) if dob.is==:heading
380 data.each {|o| p (__FILE__ + ' ' + __LINE__.to_s + '--> ' + o.inspect) if o.is==:heading}
381 puts "#{__FILE__} #{__LINE__} #{para}" if @opt.act[:maintenance][:set]==:on
382 puts "#{__FILE__} #{__LINE__} #{t_o}" if @opt.act[:maintenance][:set]==:on
383 dr ┌ 9484 dR ┍ 9485 Dr ┎ 9486 DR ┏ 9487 dl ┐ 9488 dL ┑ 9489 Dl ┒ 9490 LD ┓ 9491 ur └ 9492 uR ┕ 9493 Ur ┖ 9494 UR ┗ 9495 ul ┘ 9496 uL ┙ 9497 Ul ┚ 9498 UL ┛ 9499 vr ├
384 dr ┌ 9484 dR ┍ 9485 Dr ┎ 9486 DR ┏ 9487 dl ┐ 9488 dL ┑ 9489 Dl ┒ 9490 LD ┓ 9491 ur └ 9492 uR ┕ 9493 Ur ┖ 9494 UR ┗ 9495 ul ┘ 9496 uL ┙ 9497 Ul ┚ 9498 UL ┛ 9499 vr ├
385 └ ┘
386 Iu ⌠ 8992 Il ⌡ <78968 >78969 7<8970 7>8971
387 <" 『 12302 >"12303
388 <' 「 12300 >'12301