aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-08-09 00:02:54 -0400
committerRalph Amissah <ralph@amissah.com>2011-08-09 00:02:54 -0400
commit04d3390914026934c2a00cf64f8e750b115e42f0 (patch)
treeb5ebaa307c6a05c3010d6d9632565c7bcae84567 /lib
parentv3: texpdf, possibility to translate "Contents" for table of contents (diff)
v3: constants, re-arranged
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/constants.rb290
1 files changed, 169 insertions, 121 deletions
diff --git a/lib/sisu/v3/constants.rb b/lib/sisu/v3/constants.rb
index 918a581f..3357996b 100644
--- a/lib/sisu/v3/constants.rb
+++ b/lib/sisu/v3/constants.rb
@@ -57,130 +57,178 @@
** Description: system environment, resource control and configuration details
=end
+#Ax,Xx,Mx,Rx,Hx,Dx,Px,Ep,Db,Gt,Tex=Array.new(11){{}}
Sfx={ txt: '.txt', html: '.html', xhtml: '.xhtml', xml: '.xml', epub: '.epub', epub_xhtml: '.xhtml', odt: '.odt', pdf: '.pdf'}
-Ax,Xx,Mx,Rx,Hx,Dx,Px,Db,Gt,Tex=Array.new(10){{}}
-Ax[:tab]="\t"
-Xx[:protect]='☞'
-Xx[:segment]='Ф'
-Xx[:html_relative2]='※※' #'※' '☼'
-Xx[:html_relative1]='※' #'※' '☼'
-Mx[:meta_o],Mx[:meta_c]='〔@','〕'
-Mx[:lv_o_1],Mx[:lv_o_2],Mx[:lv_o_3],Mx[:lv_o_4],Mx[:lv_o_5],Mx[:lv_o_6],Mx[:lv_o_7],Mx[:lv_o_8],Mx[:lv_o_9]=1,2,3,4,5,6,7,8,9;
-Mx[:lv_o],Mx[:lv_c]='〔','〕'
-Mx[:en_a_o]='【'; Mx[:en_a_c]='】' #endnote Mx[:en_a_o]='~{'; Mx[:en_a_c]='}~'
-Mx[:en_b_o]='〖'; Mx[:en_b_c]='〗' #endnote Mx[:en_b_o]='~['; Mx[:en_b_c]=']~'
-Mx[:bl_o]='〔'; Mx[:bl_c]='〕' #block text mark
-Mx[:gr_o]='〔'; Mx[:gr_c]='〕' #group text mark #REPLACE & RETIRE
-Mx[:id_o]='〔'; Mx[:id_c]='〕' #object id mark
-Mx[:tc_o]='『'; Mx[:tc_c]="』" #table row mark #Mx[:tc_c]="』\n"
-Mx[:tc_p]='┆' #table col/misc mark
-Mx[:pa_o]='〔'; Mx[:pa_c]='〕' #affects paragraph mark
-Mx[:mk_o]='〔'; Mx[:mk_c]='〕' #generic mark
-Mx[:gl_o]='〔'; Mx[:gl_c]='〕' #glyph
-Mx[:fa_o]='〔'; Mx[:fa_o_c]='¤'; Mx[:fa_c_o]='¤'; Mx[:fa_c]='〕'
-Mx[:fa_bold_o]= "#{Mx[:fa_o]}b#{Mx[:fa_o_c]}"; Mx[:fa_bold_c]= "#{Mx[:fa_c_o]}b#{Mx[:fa_c]}"
-Mx[:fa_italics_o]= "#{Mx[:fa_o]}i#{Mx[:fa_o_c]}"; Mx[:fa_italics_c]= "#{Mx[:fa_c_o]}i#{Mx[:fa_c]}"
-Mx[:fa_underscore_o]= "#{Mx[:fa_o]}u#{Mx[:fa_o_c]}"; Mx[:fa_underscore_c]= "#{Mx[:fa_c_o]}u#{Mx[:fa_c]}"
-Mx[:fa_cite_o]= "#{Mx[:fa_o]}cite#{Mx[:fa_o_c]}"; Mx[:fa_cite_c]= "#{Mx[:fa_c_o]}cite#{Mx[:fa_c]}"
-Mx[:fa_insert_o]= "#{Mx[:fa_o]}ins#{Mx[:fa_o_c]}"; Mx[:fa_insert_c]= "#{Mx[:fa_c_o]}ins#{Mx[:fa_c]}"
-Mx[:fa_strike_o]= "#{Mx[:fa_o]}del#{Mx[:fa_o_c]}"; Mx[:fa_strike_c]= "#{Mx[:fa_c_o]}del#{Mx[:fa_c]}"
-Mx[:fa_superscript_o]="#{Mx[:fa_o]}sup#{Mx[:fa_o_c]}"; Mx[:fa_superscript_c]="#{Mx[:fa_c_o]}sup#{Mx[:fa_c]}"
-Mx[:fa_subscript_o]= "#{Mx[:fa_o]}sub#{Mx[:fa_o_c]}"; Mx[:fa_subscript_c]= "#{Mx[:fa_c_o]}sub#{Mx[:fa_c]}"
-Mx[:fa_hilite_o]= "#{Mx[:fa_o]}hi#{Mx[:fa_o_c]}"; Mx[:fa_hilite_c]= "#{Mx[:fa_c_o]}hi#{Mx[:fa_c]}"
-Mx[:fa_monospace_o]= "#{Mx[:fa_o]}mono#{Mx[:fa_o_c]}"; Mx[:fa_monospace_c]= "#{Mx[:fa_c_o]}mono#{Mx[:fa_c]}"
-Mx[:gl_bullet]= "#{Mx[:gl_o]}●#{Mx[:gl_c]}"
- 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)
- Mx[:pa_non_object_no_heading]="#{Mx[:pa_o]}~##{Mx[:pa_c]}" #unnumbered paragraph (place marker at end of paragraph)
-Mx[:idx_o]='▢ '; Mx[:idx_c]='▢ ' #
-Mx[:nbsp]= '░' #'▭ '
-Mx[:br_line]= '╱' #lB ▌ 9612 ┘ ¶
-Mx[:br_nl]= '╲' #lB ▌ 』 ┘
-Mx[:br_paragraph]= '█' #FB █ 9608 # PP ∥ 8741 #▐ #'┘' #'¶' #FB █ 9608 lB ▌ 9612 RB ▐ 9616
-Mx[:br_obj]= 'break_obj'; Hx[:br_obj]= { obj: Mx[:br_obj] } # line sep
-Mx[:br_page]= 'break_page'; Hx[:br_page]= { obj: Mx[:br_page] } # newpage
-Mx[:br_page_new]= 'break_page_new'; Hx[:br_page_new]= { obj: Mx[:br_page_new] } # clearpage
-Mx[:br_endnotes]= "#{Mx[:mk_o]}ENDNOTES#{Mx[:mk_c]}"
-Mx[:br_eof]= "#{Mx[:mk_o]}EOF#{Mx[:mk_c]}"
-Mx[:lnk_o]='⌠'; Mx[:lnk_c]='⌡' #'⌈' '⌋' '⌠' '⌡' #Mx[:lnk_o]='◁'; Mx[:lnk_c]='▷' #‹ ›
-Mx[:url_o]='「'; Mx[:url_c]='」'
-Mx[:rel_o]='⌈'; Mx[:rel_c]='⌋'
-Mx[:tag_o]='⌊'; Mx[:tag_c]='⌉'
-Mx[:sm_set_o]='《'; Mx[:sm_set_c]='》'
-Mx[:sm_subset_o]='《 '; Mx[:sm_subset_c]='》'
-Mx[:vline]='┆' # ¦ |
+Ax={
+ tab: "\t",
+}
+Xx={
+ protect: '☞',
+ segment: 'Ф',
+ html_relative2: '※※', #'※' '☼'
+ html_relative1: '※', #'※' '☼'
+}
+Mx={
+ meta_o: '〔@', meta_c: '〕',
+ lv_o_1: 1,
+ lv_o_2: 2,
+ lv_o_3: 3,
+ lv_o_4: 4,
+ lv_o_5: 5,
+ lv_o_6: 6,
+ lv_o_7: 7,
+ lv_o_8: 8,
+ lv_o_9: 9,
+ lv_o: '〔', lv_c: '〕',
+ en_a_o: '【', en_a_c: '】', #endnote Mx[:en_a_o]='~{'; Mx[:en_a_c]='}~'
+ en_b_o: '〖', en_b_c: '〗', #endnote Mx[:en_b_o]='~['; Mx[:en_b_c]=']~'
+ bl_o: '〔', bl_c: '〕', #block text mark
+ gr_o: '〔', gr_c: '〕', #group text mark #REPLACE & RETIRE
+ id_o: '〔', id_c: '〕', #object id mark
+ tc_o: '『', tc_c: "』", #table row mark #Mx[:tc_c]="』\n"
+ tc_p: '┆', #table col/misc mark
+ pa_o: '〔', pa_c: '〕', #affects paragraph mark
+ mk_o: '〔', mk_c: '〕', #generic mark
+ gl_o: '〔', gl_c: '〕', #glyph
+ fa_o: '〔', fa_o_c: '¤', fa_c_o: '¤', fa_c: '〕',
+ idx_o: '▢ ', idx_c: '▢ ',
+ nbsp: '░', #'▭ '
+ br_line: '╱', #lB ▌ 9612 ┘ ¶
+ br_nl: '╲', #lB ▌ 』 ┘
+ br_paragraph: '█', #FB █ 9608 # PP ∥ 8741 #▐ #'┘' #'¶' #FB █ 9608 lB ▌ 9612 RB ▐ 9616
+ br_obj: 'break_obj',
+ br_page: 'break_page',
+ br_page_new: 'break_page_new',
+ lnk_o: '⌠', lnk_c: '⌡', #'⌈' '⌋' '⌠' '⌡' #Mx[:lnk_o: '◁'; Mx[:lnk_c: '▷' #‹ ›
+ url_o: '「', url_c: '」',
+ rel_o: '⌈', rel_c: '⌋',
+ tag_o: '⌊', tag_c: '⌉',
+ sm_set_o: '《', sm_set_c: '》',
+ sm_subset_o: '《 ', sm_subset_c: '》',
+ vline: '┆', # ¦ |
+}
+Mx[:fa_bold_o]= "#{Mx[:fa_o]}b#{Mx[:fa_o_c]}"
+Mx[:fa_bold_c]= "#{Mx[:fa_c_o]}b#{Mx[:fa_c]}"
+Mx[:fa_italics_o]= "#{Mx[:fa_o]}i#{Mx[:fa_o_c]}"
+Mx[:fa_italics_c]= "#{Mx[:fa_c_o]}i#{Mx[:fa_c]}"
+Mx[:fa_underscore_o]= "#{Mx[:fa_o]}u#{Mx[:fa_o_c]}"
+Mx[:fa_underscore_c]= "#{Mx[:fa_c_o]}u#{Mx[:fa_c]}"
+Mx[:fa_cite_o]= "#{Mx[:fa_o]}cite#{Mx[:fa_o_c]}"
+Mx[:fa_cite_c]= "#{Mx[:fa_c_o]}cite#{Mx[:fa_c]}"
+Mx[:fa_insert_o]= "#{Mx[:fa_o]}ins#{Mx[:fa_o_c]}"
+Mx[:fa_insert_c]= "#{Mx[:fa_c_o]}ins#{Mx[:fa_c]}"
+Mx[:fa_strike_o]= "#{Mx[:fa_o]}del#{Mx[:fa_o_c]}"
+Mx[:fa_strike_c]= "#{Mx[:fa_c_o]}del#{Mx[:fa_c]}"
+Mx[:fa_superscript_o]= "#{Mx[:fa_o]}sup#{Mx[:fa_o_c]}"
+Mx[:fa_superscript_c]= "#{Mx[:fa_c_o]}sup#{Mx[:fa_c]}"
+Mx[:fa_subscript_o]= "#{Mx[:fa_o]}sub#{Mx[:fa_o_c]}"
+Mx[:fa_subscript_c]= "#{Mx[:fa_c_o]}sub#{Mx[:fa_c]}"
+Mx[:fa_hilite_o]= "#{Mx[:fa_o]}hi#{Mx[:fa_o_c]}"
+Mx[:fa_hilite_c]= "#{Mx[:fa_c_o]}hi#{Mx[:fa_c]}"
+Mx[:fa_monospace_o]= "#{Mx[:fa_o]}mono#{Mx[:fa_o_c]}"
+Mx[:fa_monospace_c]= "#{Mx[:fa_c_o]}mono#{Mx[:fa_c]}"
+Mx[:gl_bullet]= "#{Mx[:gl_o]}●#{Mx[:gl_c]}"
+Mx[:br_endnotes]= "#{Mx[:mk_o]}ENDNOTES#{Mx[:mk_c]}"
+Mx[:br_eof]= "#{Mx[:mk_o]}EOF#{Mx[:mk_c]}"
+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)
+Mx[:pa_non_object_no_heading]="#{Mx[:pa_o]}~##{Mx[:pa_c]}" #unnumbered paragraph (place marker at end of paragraph)
+Hx={
+ br_obj: { obj: Mx[:br_obj] }, # line sep
+ br_page: { obj: Mx[:br_page] }, # newpage
+ br_page_new: { obj: Mx[:br_page_new] }, # clearpage
+}
#Mx[:sm_set_o]='∈ '; Mx[:sm_set_c]='∋ '
#Mx[:sm_subset_o]='∈ '; Mx[:sm_subset_c]='∋ '
-Rx[:mx_fa_clean]= /#{Mx[:fa_o]}.+?#{Mx[:fa_c]}|#{Mx[:pa_o]}.+?#{Mx[:pa_c]}|#{Mx[:mk_o]}.+?#{Mx[:mk_c]}/
-Rx[:lv],Rx[:lv_1],Rx[:lv_2],Rx[:lv_3],Rx[:lv_4],Rx[:lv_5],Rx[:lv_6],Rx[:lv_7],Rx[:lv_8],Rx[:lv_9]=
- /〔([1-9]):(\S*?)〕/,/#{Mx[:lv_o_1]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_2]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_3]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_4]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_5]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_6]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_7]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_8]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_9]}(\S*?)#{Mx[:lv_c]}/
-Rx[:meta]=/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}/
-Dx[:url_o]='‹'; Dx[:url_c]='›'
-Dx[:url_o_xml]='&lt;'; Dx[:url_c_xml]='&gt;'
-Dx[:rel_o]='‹'; Dx[:rel_c]='›' # Dx[:rel_o]='「'; Dx[:rel_c]='」'
-Dx[:lt_xml]='&lt;'; Dx[:gt_xml]='&gt;'
-Tex[:backslash]="\\\\"
-Tex[:backslash]="\\\\"
-Tex[:tilde]='\\\\\\~'
-#Px[:emphasis_o]= '*'; Px[:emphasis_c]= '*'
-#Px[:bold_o]= '!'; Px[:bold_c]= '!'
-Px[:bold_o]= '*'; Px[:bold_c]= '*'
-Px[:italics_o]= '/'; Px[:italics_c]= '/'
-Px[:underscore_o]= '_'; Px[:underscore_c]= '_'
-Px[:cite_o]= '"'; Px[:cite_c]= '"'
-Px[:insert_o]= '+'; Px[:insert_c]= '+'
-Px[:strike_o]= '-'; Px[:strike_c]= '-'
-Px[:superscript_o]= '^'; Px[:superscript_c]= '^'
-Px[:subscript_o]= '['; Px[:subscript_c]= ']'
-Px[:hilite_o]= '*'; Px[:hilite_c]= '*'
-Px[:monospace_o]= ''; Px[:monospace_c]= ''
-Px[:po_bold_o]= '!{'; Px[:po_bold_c]= '}!'
-Px[:po_italics_o]= '/{'; Px[:po_italics_c]= '}/'
-Px[:po_underscore_o]= '_{'; Px[:po_underscore_c]= '}_'
-Px[:po_cite_o]= '"{'; Px[:po_cite_c]= '}"'
-Px[:po_insert_o]= '+{'; Px[:po_insert_c]= '}+'
-Px[:po_strike_o]= '-{'; Px[:po_strike_c]= '}-'
-Px[:po_superscript_o]='^{'; Px[:po_superscript_c]='}^'
-Px[:po_subscript_o]= ',{'; Px[:po_subscript_c]= '},'
-Px[:po_hilite_o]= '*{'; Px[:po_hilite_c]= '}*'
-Px[:po_monospace_o]= '#{'; Px[:po_monospace_c]= '}#'
-Px[:lng_lst]=%w[am bg bn br ca cs cy da de el en eo es et eu fi fr ga gl he hi hr hy ia is it la lo lt lv ml mr nl nn no oc pl pt pt_BR ro ru sa se sk sl sq sr sv ta te th tk tr uk ur us vi]
-#Px[:lng_lst]=%w[sq am hy eu bn pt_BR br bg ca hr cs da nl en eo et gl de el he hi is ia ga it fi fr lo la lv lt ml mr no nn oc pl pt ro ru se sa sr sk sl es sv ta te th tr tk uk ur vi cy us]
-Px[:lv1]= '*'
-Px[:lv2]= '='
-Px[:lv3]= '='
-Px[:lv4]= '-'
-Px[:lv5]= '.'
-Px[:lv6]= '.'
-Db[:name_prefix]="SiSU#{SiSU_version_dir}e_"
-Db[:name_prefix_db]="sisu_#{SiSU_version_dir}e_"
-Db[:col_title]=800
-Db[:col_title_part]=400
-Db[:col_title_edition]=10
-Db[:col_name]=600
-Db[:col_creator_misc_short]=100
-Db[:col_language]=100
-Db[:col_language_char]=6
-Db[:col_date_text]=10
-Db[:col_classify_txt_long]=600
-Db[:col_classify_txt_short]=600
-Db[:col_classify_short]=200
-Db[:col_classify_identify]=256
-Db[:col_classify_library]=30
-Db[:col_classify_small]=16
-Db[:col_filename]=256
-Db[:col_digest]=64
-Db[:col_filesize]=10
-Db[:col_info_note]=2500
-Gt[:grotto]='sisu:'
-Gt[:src]='src'
-Gt[:pod]='pod'
-Gt[:po]='po4a/po'
-Gt[:pot]='po4a/pot'
-Gt[:image]='mm/image'
-Gt[:audio]='mm/audio'
-Gt[:video]='mm/video'
-Gt[:conf]='conf'
-Gt[:skin]='conf/skin' #Gt[:skin]='conf/skin/doc'
+Rx={
+ mx_fa_clean: /#{Mx[:fa_o]}.+?#{Mx[:fa_c]}|#{Mx[:pa_o]}.+?#{Mx[:pa_c]}|#{Mx[:mk_o]}.+?#{Mx[:mk_c]}/,
+ lv: /〔([1-9]):(\S*?)〕/,
+ lv_1: /#{Mx[:lv_o_1]}(\S*?)#{Mx[:lv_c]}/,
+ lv_2: /#{Mx[:lv_o_2]}(\S*?)#{Mx[:lv_c]}/,
+ lv_3: /#{Mx[:lv_o_3]}(\S*?)#{Mx[:lv_c]}/,
+ lv_4: /#{Mx[:lv_o_4]}(\S*?)#{Mx[:lv_c]}/,
+ lv_5: /#{Mx[:lv_o_5]}(\S*?)#{Mx[:lv_c]}/,
+ lv_6: /#{Mx[:lv_o_6]}(\S*?)#{Mx[:lv_c]}/,
+ lv_7: /#{Mx[:lv_o_7]}(\S*?)#{Mx[:lv_c]}/,
+ lv_8: /#{Mx[:lv_o_8]}(\S*?)#{Mx[:lv_c]}/,
+ lv_9: /#{Mx[:lv_o_9]}(\S*?)#{Mx[:lv_c]}/,
+ meta: /#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}/,
+}
+Dx={
+ url_o: '‹', url_c: '›',
+ url_o_xml: '&lt;', url_c_xml: '&gt;',
+ rel_o: '‹', rel_c: '›',
+ lt_xml: '&lt;', gt_xml: '&gt;',
+}
+Tex={
+ backslash: "\\\\",
+ backslash: "\\\\",
+ tilde: '\\\\\\~',
+}
+Px={
+ bold_o: '*', bold_c: '*',
+ italics_o: '/', italics_c: '/',
+ underscore_o: '_', underscore_c: '_',
+ #emphasis_o: '*', emphasis_c: '*',
+ #bold_o: '!', bold_c: '!',
+ cite_o: '"', cite_c: '"',
+ insert_o: '+', insert_c: '+',
+ strike_o: '-', strike_c: '-',
+ superscript_o: '^', superscript_c: '^',
+ subscript_o: '[', subscript_c: ']',
+ hilite_o: '*', hilite_c: '*',
+ monospace_o: '', monospace_c: '',
+ po_bold_o: '!{', po_bold_c: '}!',
+ po_italics_o: '/{', po_italics_c: '}/',
+ po_underscore_o: '_{', po_underscore_c: '}_',
+ po_cite_o: '"{', po_cite_c: '}"',
+ po_insert_o: '+{', po_insert_c: '}+',
+ po_strike_o: '-{', po_strike_c: '}-',
+ po_superscript_o: '^{', po_superscript_c: '}^',
+ po_subscript_o: ',{', po_subscript_c: '},',
+ po_hilite_o: '*{', po_hilite_c: '}*',
+ po_monospace_o: '#{', po_monospace_c: '}#',
+ lng_lst: %w[am bg bn br ca cs cy da de el en eo es et eu fi fr ga gl he hi hr hy ia is it la lo lt lv ml mr nl nn no oc pl pt pt_BR ro ru sa se sk sl sq sr sv ta te th tk tr uk ur us vi],
+ lv1: '*',
+ lv2: '=',
+ lv3: '=',
+ lv4: '-',
+ lv5: '.',
+ lv6: '.',
+}
+Db={
+ name_prefix: "SiSU#{SiSU_version_dir}e_",
+ name_prefix_db: "sisu_#{SiSU_version_dir}e_",
+ col_title: 800,
+ col_title_part: 400,
+ col_title_edition: 10,
+ col_name: 600,
+ col_creator_misc_short: 100,
+ col_language: 100,
+ col_language_char: 6,
+ col_date_text: 10,
+ col_classify_txt_long: 600,
+ col_classify_txt_short: 600,
+ col_classify_short: 200,
+ col_classify_identify: 256,
+ col_classify_library: 30,
+ col_classify_small: 16,
+ col_filename: 256,
+ col_digest: 64,
+ col_filesize: 10,
+ col_info_note: 2500,
+}
+Gt={
+ grotto: 'sisu:',
+ src: 'src',
+ pod: 'pod',
+ po: 'po4a/po',
+ pot: 'po4a/pot',
+ image: 'mm/image',
+ audio: 'mm/audio',
+ video: 'mm/video',
+ conf: 'conf',
+ skin: 'conf/skin', #Gt[:skin: 'conf/skin/doc'
+}
__END__
consider:
〔comment〕