v3dv, add dev branch (use to make some changes to module & class names & test)
authorRalph Amissah <ralph@amissah.com>
Wed, 11 Jan 2012 03:37:26 +0000 (22:37 -0500)
committerRalph Amissah <ralph@amissah.com>
Wed, 11 Jan 2012 03:42:20 +0000 (22:42 -0500)
* (intended as) short term branch, merge back into v3 once tested
* sisu --dev (to invoke)

163 files changed:
bin/sisu
bin/sisu2
bin/sisu3
bin/sisu_termsheet
bin/sisu_webrick
conf/sisu/v3dv/sisurc.yml [new file with mode: 0644]
data/doc/sisu/CHANGELOG_v3
data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi [new file with mode: 0644]
data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi [new file with mode: 0644]
data/sisu/v3dv/conf/completion/README [new file with mode: 0644]
data/sisu/v3dv/conf/completion/_sisu [new file with mode: 0644]
data/sisu/v3dv/conf/convert/kdissert_to_sisu [new file with mode: 0644]
data/sisu/v3dv/conf/convert/modify.rb [moved from lib/sisu/v3/modify.rb with 99% similarity]
data/sisu/v3dv/conf/convert/sisu_convert [new file with mode: 0644]
data/sisu/v3dv/conf/convert/wvHtml.xml [new file with mode: 0644]
data/sisu/v3dv/conf/convert/wvSiSU.xml [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/README [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/diakonos/diakonos.conf [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/emacs/README [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/emacs/sisu-mode.el [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/gedit/sisu.lang [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/kate/sisu.xml [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/nano/nanorc [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/nedit/sisu_nedit.pats [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/8.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-ruby.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/slate.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-ruby.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-sisu.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/filetype.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/ftplugin/sisu.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/syntax/sisu.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/syntax/sisu_next.vim [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/templates/ssi.tpl [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/templates/ssm.tpl [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/templates/sst.tpl [new file with mode: 0644]
data/sisu/v3dv/conf/editor-syntax-etc/vim/vim-sisu.yaml [new file with mode: 0644]
data/sisu/v3dv/conf/lighttpd/lighttpd.cfg.sisu [new file with mode: 0644]
data/sisu/v3dv/conf/lighttpd/lighttpd.cfg.sisu_www [new file with mode: 0644]
data/sisu/v3dv/conf/ruby/irbrc [new file with mode: 0644]
data/sisu/v3dv/v/version.yml [new file with mode: 0644]
lib/sisu/v3dv/air.rb [new file with mode: 0644]
lib/sisu/v3dv/author_format.rb [new file with mode: 0644]
lib/sisu/v3dv/cgi.rb [new file with mode: 0644]
lib/sisu/v3dv/cgi_pgsql.rb [new file with mode: 0644]
lib/sisu/v3dv/cgi_sql_common.rb [new file with mode: 0644]
lib/sisu/v3dv/cgi_sqlite.rb [new file with mode: 0644]
lib/sisu/v3dv/character_encoding.rb [new file with mode: 0644]
lib/sisu/v3dv/composite.rb [new file with mode: 0644]
lib/sisu/v3dv/concordance.rb [new file with mode: 0644]
lib/sisu/v3dv/conf.rb [new file with mode: 0644]
lib/sisu/v3dv/constants.rb [new file with mode: 0644]
lib/sisu/v3dv/css.rb [new file with mode: 0644]
lib/sisu/v3dv/dal.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_character_check.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_doc_objects.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_doc_str.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_endnotes.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_expand_insertions.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_hash_digest.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_idx.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_images.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_metadata.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_numbering.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_substitutions_and_insertions.rb [new file with mode: 0644]
lib/sisu/v3dv/dal_syntax.rb [new file with mode: 0644]
lib/sisu/v3dv/db_columns.rb [new file with mode: 0644]
lib/sisu/v3dv/db_create.rb [new file with mode: 0644]
lib/sisu/v3dv/db_dbi.rb [new file with mode: 0644]
lib/sisu/v3dv/db_drop.rb [new file with mode: 0644]
lib/sisu/v3dv/db_import.rb [new file with mode: 0644]
lib/sisu/v3dv/db_indexes.rb [new file with mode: 0644]
lib/sisu/v3dv/db_load_tuple.rb [new file with mode: 0644]
lib/sisu/v3dv/db_remove.rb [new file with mode: 0644]
lib/sisu/v3dv/db_select.rb [new file with mode: 0644]
lib/sisu/v3dv/db_sqltxt.rb [new file with mode: 0644]
lib/sisu/v3dv/db_tests.rb [new file with mode: 0644]
lib/sisu/v3dv/dbi.rb [new file with mode: 0644]
lib/sisu/v3dv/defaults.rb [new file with mode: 0644]
lib/sisu/v3dv/digests.rb [new file with mode: 0644]
lib/sisu/v3dv/embedded.rb [new file with mode: 0644]
lib/sisu/v3dv/epub.rb [new file with mode: 0644]
lib/sisu/v3dv/epub_concordance.rb [new file with mode: 0644]
lib/sisu/v3dv/epub_format.rb [new file with mode: 0644]
lib/sisu/v3dv/epub_segments.rb [new file with mode: 0644]
lib/sisu/v3dv/epub_tune.rb [new file with mode: 0644]
lib/sisu/v3dv/errors.rb [new file with mode: 0644]
lib/sisu/v3dv/git.rb [new file with mode: 0644]
lib/sisu/v3dv/harvest.rb [new file with mode: 0644]
lib/sisu/v3dv/harvest_authors.rb [new file with mode: 0644]
lib/sisu/v3dv/harvest_topics.rb [new file with mode: 0644]
lib/sisu/v3dv/help.rb [new file with mode: 0644]
lib/sisu/v3dv/html.rb [new file with mode: 0644]
lib/sisu/v3dv/html_format.rb [new file with mode: 0644]
lib/sisu/v3dv/html_minitoc.rb [new file with mode: 0644]
lib/sisu/v3dv/html_promo.rb [new file with mode: 0644]
lib/sisu/v3dv/html_scroll.rb [new file with mode: 0644]
lib/sisu/v3dv/html_segments.rb [new file with mode: 0644]
lib/sisu/v3dv/html_table.rb [new file with mode: 0644]
lib/sisu/v3dv/html_tune.rb [new file with mode: 0644]
lib/sisu/v3dv/hub.rb [new file with mode: 0644]
lib/sisu/v3dv/i18n.rb [new file with mode: 0644]
lib/sisu/v3dv/manifest.rb [new file with mode: 0644]
lib/sisu/v3dv/manpage.rb [new file with mode: 0644]
lib/sisu/v3dv/manpage_format.rb [new file with mode: 0644]
lib/sisu/v3dv/modify.rb [new file with mode: 0644]
lib/sisu/v3dv/odf.rb [new file with mode: 0644]
lib/sisu/v3dv/odf_format.rb [new file with mode: 0644]
lib/sisu/v3dv/options.rb [new file with mode: 0644]
lib/sisu/v3dv/param.rb [new file with mode: 0644]
lib/sisu/v3dv/param_identify_markup.rb [new file with mode: 0644]
lib/sisu/v3dv/particulars.rb [new file with mode: 0644]
lib/sisu/v3dv/plaintext.rb [new file with mode: 0644]
lib/sisu/v3dv/plaintext_format.rb [new file with mode: 0644]
lib/sisu/v3dv/po4a.rb [new file with mode: 0644]
lib/sisu/v3dv/po4a_set.rb [new file with mode: 0644]
lib/sisu/v3dv/prog_text_translation.rb [new file with mode: 0644]
lib/sisu/v3dv/qrcode.rb [new file with mode: 0644]
lib/sisu/v3dv/relaxng.rb [new file with mode: 0644]
lib/sisu/v3dv/remote.rb [new file with mode: 0644]
lib/sisu/v3dv/response.rb [new file with mode: 0644]
lib/sisu/v3dv/rexml.rb [new file with mode: 0644]
lib/sisu/v3dv/screen_text_color.rb [new file with mode: 0644]
lib/sisu/v3dv/share_src.rb [new file with mode: 0644]
lib/sisu/v3dv/share_src_kdissert.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_html.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_html_lite.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_markup_alt.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_metadata.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_sem.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_txt.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_xhtml.rb [new file with mode: 0644]
lib/sisu/v3dv/shared_xml.rb [new file with mode: 0644]
lib/sisu/v3dv/sisupod_make.rb [new file with mode: 0644]
lib/sisu/v3dv/sitemaps.rb [new file with mode: 0644]
lib/sisu/v3dv/spell.rb [new file with mode: 0644]
lib/sisu/v3dv/sst_convert_markup.rb [new file with mode: 0644]
lib/sisu/v3dv/sst_do_inline_footnotes.rb [new file with mode: 0644]
lib/sisu/v3dv/sst_from_xml.rb [new file with mode: 0644]
lib/sisu/v3dv/sst_identify_markup.rb [new file with mode: 0644]
lib/sisu/v3dv/sst_to_s_xml_sax.rb [new file with mode: 0644]
lib/sisu/v3dv/sysenv.rb [new file with mode: 0644]
lib/sisu/v3dv/termsheet.rb [new file with mode: 0644]
lib/sisu/v3dv/texinfo.rb [new file with mode: 0644]
lib/sisu/v3dv/texinfo_format.rb [new file with mode: 0644]
lib/sisu/v3dv/texpdf.rb [new file with mode: 0644]
lib/sisu/v3dv/texpdf_format.rb [new file with mode: 0644]
lib/sisu/v3dv/update.rb [new file with mode: 0644]
lib/sisu/v3dv/urls.rb [new file with mode: 0644]
lib/sisu/v3dv/webrick.rb [new file with mode: 0644]
lib/sisu/v3dv/wikispeak.rb [new file with mode: 0644]
lib/sisu/v3dv/xhtml.rb [new file with mode: 0644]
lib/sisu/v3dv/xhtml_table.rb [new file with mode: 0644]
lib/sisu/v3dv/xml.rb [new file with mode: 0644]
lib/sisu/v3dv/xml_dom.rb [new file with mode: 0644]
lib/sisu/v3dv/xml_fictionbook.rb [new file with mode: 0644]
lib/sisu/v3dv/xml_format.rb [new file with mode: 0644]
lib/sisu/v3dv/xml_md_oai_pmh_dc.rb [new file with mode: 0644]
lib/sisu/v3dv/xml_scaffold.rb [new file with mode: 0644]
lib/sisu/v3dv/xml_tables.rb [new file with mode: 0644]
lib/sisu/v3dv/zap.rb [new file with mode: 0644]

index 4c949760e03ede57ce70fbe26c8ff4f1f7475a2a..a7440f9fc070276eda2a664a4c76e3562e3846d2 100644 (file)
--- a/bin/sisu
+++ b/bin/sisu
@@ -53,7 +53,7 @@ WOK
     'v3'
   when /--dev/
     check_sisu_dev_ruby_version?
-    'v3'
+    'v3dv'
   else
     check_sisu_stable_ruby_version?
     'v3'
index 1b64d2a9ec212bd04d24b7d7aa2ece23977cfb30..95c3c8180b9a8ea1fcb884d6c0d32d63a4abfcd2 100644 (file)
--- a/bin/sisu2
+++ b/bin/sisu2
@@ -53,7 +53,7 @@ WOK
     'v3'
   when /--dev/
     check_sisu_dev_ruby_version?
-    'v3'
+    'v3dv'
   else
     check_sisu_legacy_ruby_version?
     'v2'
index 4c949760e03ede57ce70fbe26c8ff4f1f7475a2a..a7440f9fc070276eda2a664a4c76e3562e3846d2 100644 (file)
--- a/bin/sisu3
+++ b/bin/sisu3
@@ -53,7 +53,7 @@ WOK
     'v3'
   when /--dev/
     check_sisu_dev_ruby_version?
-    'v3'
+    'v3dv'
   else
     check_sisu_stable_ruby_version?
     'v3'
index e896dd9314f54405fc847fc5a8ef544c19affdb7..11e042efb88bd56a3a364df5a3c7731bbee8eec8 100644 (file)
@@ -52,7 +52,7 @@ WOK
     'v3'
   when /--dev/
     check_sisu_dev_ruby_version?
-    'v3'
+    'v3dv'
   else
     check_sisu_stable_ruby_version?
     'v3'
index df7895e5f32a9e7b9a745dd55aae55ca414d9b75..65b6a061cc632b655fe0cbd3381e2ccf1acc25d3 100644 (file)
@@ -52,7 +52,7 @@ WOK
     'v3'
   when /--dev/
     check_sisu_dev_ruby_version?
-    'v3'
+    'v3dv'
   else
     check_sisu_stable_ruby_version?
     'v3'
diff --git a/conf/sisu/v3dv/sisurc.yml b/conf/sisu/v3dv/sisurc.yml
new file mode 100644 (file)
index 0000000..0d95d4c
--- /dev/null
@@ -0,0 +1,146 @@
+# Name: SiSU - Simple information Structuring Universe
+# Author: Ralph@Amissah.com
+# Description: Site wide envionment defaults set here
+# system environment info / resource configuration file, for sisu
+# License: GPL v3 or later
+#   site environment configuration file
+#   this file should be configured and live in
+#      /etc/sisu     #per environment settings, overridden by:
+#      ~/.sisu       #per user settings, overridden by:
+#     ./_sisu        #per local markup directory settings
+#% #image source directory, main path and subdirectories
+#image:
+#  path:         'sisu_working'
+#  public:       '_sisu/image'
+#  #all:           'image'
+#% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name)
+#webserv:
+#  url_root:     'http://www.your.url' #without dir stub
+#  path:         '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home
+#  images:       '_sisu/image'
+#  man:          'man'
+#  cgi:          '/usr/lib/cgi-bin'
+#  feed:         'feed'
+#  sqlite:       'sisu/sqlite'
+#  webrick_url:  true
+#show_output_on: 'filesystem' #for -v and -u url information, alternatives: 'filesystem','webserver','remote_webserver','local:8111','localhost','localhost:8080','webrick','path'
+#show_output_on: 'local:8111'
+#webserv_cgi:
+#  host:         localhost
+#  base_path:    ~
+#  port:         '8081'
+#  user:         ~
+
+show_output_on: 'filesystem_url'
+#texinfo display output
+#texinfo:
+#  stub:         'texinfo'
+
+##% processing directories, main path and subdirectories (appended to $HOME), using defaults set in sysenv
+#processing:
+#  path:         '~'
+#  dir:         '.sisu_processing~'
+#  metaverse:    'metaverse'
+#  tune:         'tune'
+#  latex:        'tex'
+#  texinfo:      'texinfo'
+#  concord_max:  400000
+
+#% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default)
+flag:
+  color:        true                        # making colour default -c is toggle, and will now toggle colour off
+  default:      '-NhewpotbxXyYv'            # -m run by default; includes verbose
+  i:            '-Nhewpoty'                 # -m run by default
+  ii:           '-NhewpotbxX'               # -m run by default
+  iii:          '-NhewpotbxXY'              # -m run by default
+  iv:           '-NhewpotbxXiIY'            # -m run by default
+  v:            '-NhewpotbxXYDv --update'   # -m run by default; includes verbose
+
+#% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal
+default:
+  papersize:    'A4,letter'
+  #language:      'en'
+  #texpdf_font:       'Liberation Sans' # 'Liberation Sans' 'Liberation Serif'
+  #texpdf_font_mono:  'Liberation Mono' #'Inconsolata'
+  #text_wrap:    78
+  #emphasis:     'bold' #make *{emphasis}* 'bold', 'italics' or 'underscore', default if not configured is 'bold'
+  #digest:       'sha' #sha is sha256, default is md5
+  #multilingual:  false
+  #language_file: 2
+#% markup, make *{emphasis}* 'bold' or 'italics', default if not configured is 'bold'
+
+#% settings used by ssh scp
+#remote:
+#  -
+#    user:         '[usrname]'
+#    host:         '[remote.hostname]'
+#    path:         '.' #no trailing slash eg 'sisu/www'
+#  -
+#    user:         '[usrname]'
+#    host:         '[remote.hostname]'
+#    path:         '.' #no trailing slash eg 'sisu/www'
+
+#% webrick information
+#webrick:
+#  port:         '8081'
+
+#% sql database info, postgresql and sqlite
+#db:
+#  share_source: false # boolean, default is false
+#  postgresql:
+#    port:       # '[port (default is 5432)]'
+#    host:       # '[if not localhost, provide host tcp/ip address or domain name]''
+#    user:       # '[(if different from user) provide username]'
+#    password:   # '[password if required]'
+#  sqlite:
+#    path:       ~ # './sisu_sqlite.db'
+#    port:       "**"
+
+#html:
+#  quick_ref:         true #default false
+#  seg_title_banner:  true #default false
+#odt:
+#  ocn:               true
+#plaintext:
+#  ocn:               true
+
+#% output_dir_structure_by: language (language_and_filetype); filetype; or filename (original v1 & v2)
+#output_dir_structure_by: filename
+#output_dir_structure_by: filetype
+output_dir_structure_by: language
+
+permission_set:
+  zap:          false
+  css_modify:   false
+#  remote_base_site:  true
+
+program_set:
+  rmagick:       false
+#  wc:           true
+#  editor:       true
+#  postgresql:   true
+#  sqlite:       true
+#  tidy:         true
+#  rexml:        true
+#  pdflatex:     true
+
+#program_select:
+#  editor:              'vim'
+#  pdf_viewer:          'evince'
+#  web_browser:         'iceweasel'
+#  console_web_browser: 'links2' #'elinks' #'w3m' #'lynx' #'links'
+#  odf_viewer:          'lowriter' #'oowriter' #'abiword'
+#  xml_viewer:          'xml-viewer'
+#  epub_viewer:         'ebook-viewer' #'calibre' #'fbreader' #'okular'
+#  info_viewer:         'pinfo -f'
+#  man:                 'man' #'groff -man -Tascii' # 'nroff -man'
+
+#search:
+#  sisu:
+#    flag:            true
+##    action:          http://localhost:8081/cgi-bin/sisu_pgsql.cgi
+#    action:          http://search.sisudoc.org
+#    db:              sisu
+#    title:           sample search form
+
+#promo:               sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby
index f5e61f2819a950a8980e669d57d62d604e93eedb..467b00284bde3a7005ea736b08cf702ba558c2e0 100644 (file)
@@ -23,6 +23,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.11.orig.tar.xz
 
   * date, year 2012, update
 
+  * v3dv, add dev branch, make some changes to module & class names & test
+    * short term branch, merge back into v3 once tested
+    * sisu --dev (to invoke)
+
   * modify.rb, prep script for year update, & changing module & class names
 
 %% 3.1.10.orig.tar.xz (2011-12-31:52/6)
diff --git a/data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi b/data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi
new file mode 100644 (file)
index 0000000..c196c75
--- /dev/null
@@ -0,0 +1,904 @@
+#!/usr/bin/env ruby
+=begin
+ * Name: SiSU information Structuring Universe
+ * Author: Ralph Amissah
+   * http://www.jus.uio.no/sisu
+   * http://www.jus.uio.no/sisu/SiSU/download
+
+ * Description: generates naive cgi search form for search of sisu database (pgsql)
+ * Name: SiSU generated sample cgi search form
+
+ * Description: generated sample cgi search form for SiSU
+   (SiSU is a framework for document structuring, publishing and search)
+
+ * Author: Ralph Amissah
+
+ * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+   2007 Ralph Amissah All Rights Reserved.
+
+ * License: GPL 3 or later:
+
+   SiSU, a framework for document structuring, publishing and search
+
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+   2007 Ralph Amissah
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the Free
+   Software Foundation, either version 3 of the License, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+   more details.
+
+   You should have received a copy of the GNU General Public License along with
+   this program. If not, see <http://www.gnu.org/licenses/>.
+
+   If you have Internet connection, the latest version of the GPL should be
+   available at these locations:
+   <http://www.fsf.org/licenses/gpl.html>
+   <http://www.gnu.org/copyleft/gpl.html>
+   <http://www.jus.uio.no/sisu/gpl.fsf>
+
+ * SiSU uses:
+   * Standard SiSU markup syntax,
+   * Standard SiSU meta-markup syntax, and the
+   * Standard SiSU object citation numbering and system
+
+ * Hompages:
+   <http://www.jus.uio.no/sisu>
+   <http://www.sisudoc.org>
+
+ * Download:
+   <http://www.jus.uio.no/sisu/SiSU/download.html>
+
+ * Ralph Amissah
+   <ralph@amissah.com>
+   <ralph.amissah@gmail.com>
+
+=end
+      require 'cgi'
+      require 'fcgi'
+      require 'dbi'
+      @version='sisu_search_pgsql'
+      @image_src="http://localhost/sisu/_sisu/image"
+      @hosturl_db="http://localhost"
+      @hosturl_files="http://www.jus.uio.no"
+      @port="5432"
+      user=''
+      @@limit,@@offset=1000,0
+      @base="#@hosturl_db/cgi-bin/#@version.cgi"
+      @@canned_search_url=@base
+      @color_heading='#DDFFAA'
+      @color_match='#ffff48'
+      class Form
+        def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can='')
+          search_note='' if checked_searched !~/\S/
+          the_can='' if checked_url !~/\S/
+          search_field='' if checked_echo !~/\S/
+          @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can
+          @tip=if checked_tip =~/\S/
+            '<font size="2" color="#666666">text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;</font><br />'
+          else ''
+          end
+        end
+        def submission_form
+            search_form=<<-WOK
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+    <html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+    <title>
+    SiSU search form (sample): SiSU information Structuring Universe
+    </title>
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+    <meta name="sourcefile" content="SiSU._sst" />
+    <link rel="generator" href="http://www.jus.uio.no/sisu" />
+    <link rel="shortcut icon" href="http://localhost/sisu/_sisu/image/rb7.ico" />
+    <link rel="stylesheet" href="../_sisu/css/html.css" type="text/css" />
+    </head>
+    <body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">
+    <table summary="band" border="0" cellpadding="3" cellspacing="0">
+    <tr><td align="left" bgcolor="#ffffff"><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="http://localhost/sisu/_sisu/image/sisu.png" alt="SiSU --&gt;" /></a></td><td>
+<!--    <p class="tiny"><a href="http://www.jus.uio.no/sisu/SiSU/">&nbsp;http://www.jus.uio.no/sisu/SiSU/</a></p> -->
+      <label for="find"><b>sample search form</b></label>
+    </td></tr>
+    </table>
+    <form action="#@base" id="Test Form" method="post">
+      <table cellpadding="2">
+      <tr><td valign=\"top\">
+          <textarea id="find" name="find" type="text" rows="6" cols="40" maxlength="256">#@search_field</textarea>
+      </td>
+      <td valign=\"top\">
+        #@tip
+        #@search_note
+        #@the_can
+      </td></tr></table>
+      <td valign=\"top\"><tr><td>
+        <!input type="text" id="find" name="find" value="#@search_field" />
+        <!input type="text" id="find" name="find" value="" />
+        <font size="2" color="#222222">
+        <b>to search:</b> select which database to search (drop-down menu below); enter your search query (in the form above); and <b>click on the search button</b> (below)
+        <br />
+        <select name="db" size="1">
+          #@selected_db
+              <option value="SiSU_pace">pace</option>
+              <option value="SiSU_sisu">sisu</option>
+        </select>
+        <input type="submit" value="SiSU search" />
+        <input type="radio" name="view" value="index" #@checked_index> index
+        <input type="radio" name="view" value="text" #@checked_text> text / grep
+            <input type="checkbox" name="casesense" #@checked_case> case sensitive
+        <br />
+          <input type="checkbox" name="echo" #@checked_echo> echo query
+          <input type="checkbox" name="stats" #@checked_stats> result stats
+          <input type="checkbox" name="url" #@checked_url> search url
+          <input type="checkbox" name="searched" #@checked_searched> searched
+          <input type="checkbox" name="tip" #@checked_tip> available fields
+          <input type="checkbox" name="sql" #@checked_sql> sql statement
+        <br />
+          checks:
+          <input type="radio" name="checks" value="check_default" #@checked_default> default
+          <input type="radio" name="checks" value="check_selected" #@checked_selected> selected
+          <input type="radio" name="checks" value="check_all" #@checked_all> all
+          <input type="radio" name="checks" value="check_none" #@checked_none> none
+          </font>
+      </td></tr>
+      </table>
+    </form>
+      WOK
+        end
+      end
+      class Search_request                                                       #% search_for
+        attr_accessor :text1,:keywords,:title,:author,:subject,:description,:publisher,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename
+        def initialize(search_field='',q='')
+          @search_field,@q=search_field,q
+          @text1=@keywords=@title=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename=''
+          if @search_field=~/\S/
+            @text1=text_to_match('text:')
+            @keywords=text_to_match('key(?:words?)?:')
+            @title=text_to_match('title:')                  # DublinCore 1  - title
+            @author=text_to_match('(?:author|creator)s?:')  # DublinCore 2  - creator/author
+            @subject=text_to_match('subj(?:ect)?:')         # DublinCore 3  - subject
+            @description=text_to_match('description:')      # DublinCore 4  - description
+            @publisher=text_to_match('pub(?:lisher)?:')     # DublinCore 5  - publisher
+            @contributor=text_to_match('contributor:')      # DublinCore 6  - contributor
+            @date=text_to_match('date:')                    # DublinCore 7  - date dd-mm-yy
+            @type=text_to_match('type:')                    # DublinCore 8  - type
+            @format=text_to_match('format:')                # DublinCore 9  - format
+            @identifier=text_to_match('identifier:')        # DublinCore 10 - identifier
+            @source=text_to_match('source:')                # DublinCore 11 - source
+            @language=text_to_match('language:')            # DublinCore 12 - language
+            @relation=text_to_match('relation:')            # DublinCore 13 - relation
+            @coverage=text_to_match('coverage:')            # DublinCore 14 - coverage
+            @rights=text_to_match('rights:')                # DublinCore 15 - rights
+            @comment=text_to_match('comment:')
+            @abstract=text_to_match('abs(?:tract)?:')
+            @owner=text_to_match('owner:')
+            @date_created=text_to_match('date_created:')
+            @date_issued=text_to_match('date_issued:')
+            @date_modified=text_to_match('date_modified:')
+            @date_available=text_to_match('date_available:')
+            @date_valid=text_to_match('date_valid:')
+            @filename=text_to_match('filename:')
+            @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date or @filename
+          else
+            @text1=q['s1'] if q['s1']=~/\S/
+            @keywords=q['key'] if q['key']=~/\S/
+            @title=q['ti'] if q['ti']=~/\S/
+            @author=q['au'] if q['au']=~/\S/
+            @subject=q['sj'] if q['sj']=~/\S/
+            @description=q['dsc'] if q['dsc']=~/\S/
+            @publisher=q['pb'] if q['pb']=~/\S/
+            @contributor=q['cntr'] if q['cntr']=~/\S/
+            @date=q['dt'] if q['dt']=~/\S/
+            @type=q['ty'] if q['ty']=~/\S/
+            @identifier=q['id'] if q['id']=~/\S/
+            @source=q['src'] if q['src']=~/\S/
+            @language=q['lang'] if q['lang']=~/\S/
+            @relation=q['rel'] if q['rel']=~/\S/
+            @coverage=q['cov'] if q['cov']=~/\S/
+            @rights=q['cr'] if q['cr']=~/\S/
+            @comment=q['co'] if q['co']=~/\S/
+            @abstract=q['ab'] if q['ab']=~/\S/
+            @date_created=q['dtc'] if q['dtc']=~/\S/
+            @date_issued=q['dti'] if q['dti']=~/\S/
+            @date_modified=q['dtm'] if q['dtm']=~/\S/
+            @date_available=q['dta'] if q['dta']=~/\S/
+            @date_valid=q['dtv'] if q['dtv']=~/\S/
+            @filename=q['fns'] if q['fns']=~/\S/
+            @@limit=q['ltd'] if q['ltd']=~/\d+/  # 1000
+            @@offset=q['off'] if q['off']=~/\d+/ # 0
+          end
+        end
+        def text_to_match(identifier='')
+          m={
+            :string => /#{identifier}\s*(.+?)/,
+            :string => /#{identifier}\s*(.+?)(?:;|\n|\r|$)/,
+            :word => /#{identifier}[\s(]*(\S+)/
+          }
+          search_string=if @search_field =~m[:word]
+            search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1]
+            elsif @search_field =~m[:string];            m[:string].match(@search_field)[1]
+            else
+              str=m[:word].match(@search_field)[1]
+              str.gsub!(/[()]/,'')
+              str
+            end
+            search_string.strip!
+            search_string.gsub!(/\s+/,'+')
+            search_string
+          #else
+          #  "__"
+          end
+        end
+      end
+      class Dbi_search_string
+        def initialize(l,t,q,cse=false)
+          @l,@t,@q,@c=l,t,q,cse
+        end
+        def string
+          search={ :search => [],:flag => false }
+          if @t =~/\S+/ or @q =~/\S+/
+            if @t =~/\S+/;     unescaped_search=CGI.unescape(@t)
+            elsif @q =~/\S+/;  unescaped_search=CGI.unescape(@q)
+            end
+            search_construct=[]
+            if @c
+              unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~\( '")
+              unescaped_search.gsub!(/(.+)/,"#@l~\( '\\1' \)")
+            else
+              unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~*\( '")
+              unescaped_search.gsub!(/(.+)/,"#@l~*\( '\\1' \)")
+            end
+            search_construct << unescaped_search
+            search_construct=search_construct.join(' ')
+            search[:search]                    << search_construct
+            search[:flag]=true
+            search
+          end
+          search
+        end
+      end
+      class Dbi_search_statement
+        attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit
+        def initialize(conn,search_for,q,c)
+          @conn=conn
+          @text_search_flag=false
+          @sql_statement={ :body=>'',:endnotes=>'',:range=>'' }
+          #@offset||=@@offset
+          #@offset+=@@limit
+          search={ :text => [],:endnotes => [] }
+          cse=if c =~/\S/; true
+          else false
+          end
+          st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string
+          se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string
+          @text_search_flag=st[:flag]
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << se[:search]
+          end
+          st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          @@limit=q['ltd'] if q['ltd']=~/\d+/  # 1000
+          @@offset=q['off'] if q['off']=~/\d+/ # 0
+          @search_text,@search_endnotes=[],[]
+                                                                                 #%
+          search[:text].each{|x| @search_text << "#{x} AND " }
+          @search_text=@search_text.to_s.gsub!(/AND\s+$/,'')
+          @search_text.gsub!(/(documents\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)')
+          search[:endnotes].each{|x| @search_endnotes << "#{x} AND " }
+          @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'')
+          @search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)')
+        end
+        def sql_offset
+          @@offset
+        end
+        def sql_limit
+          @@limit
+        end
+        def sql_canned_search
+          @offset_next=sql_offset.to_i + sql_limit.to_i
+          @offset_previous=sql_offset.to_i - sql_limit.to_i
+          def current
+            @@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + sql_offset.to_s
+          end
+          def next
+            @@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_next.to_s
+          end
+          def previous
+            @offset_previous >= 0 ? (@@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : ''
+          end
+          def start
+            @@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + 0.to_s
+          end
+          self
+        end
+        def sql_canned_search_url(ok)
+          if ok
+            can=sql_canned_search
+            page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i
+            case page.to_s
+            when /^1$/
+              %{<hr /><br /><center>
+              pg. #{page.to_s}
+              <a href="#{can.next}">&nbsp;&nbsp;&gt;</a>
+              </center>}
+            when /^2$/
+              %{<hr /><br /><center>
+              <a href="#{can.previous}">&lt;&nbsp;&nbsp;</a>
+              pg. #{page.to_s}
+              <a href="#{can.next}">&nbsp;&nbsp;&gt;</a>
+              </center>}
+            else
+              %{<hr /><br /><center>
+              <a href="#{can.start}">|&lt;&nbsp;&nbsp;</a>
+              <a href="#{can.previous}">&lt;&nbsp;&nbsp;</a>
+              pg. #{page.to_s}
+              <a href="#{can.next}">&nbsp;&nbsp;&gt;</a>
+              </center>}
+            end
+          else ''
+          end
+        end
+        def sql_select_body
+          limit ||=@@limit
+          offset ||=@@offset
+          @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn}
+          @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
+          select=@sql_statement[:body] + ' ' + @sql_statement[:range]
+          select
+        end
+        def sql_select_endnotes
+          limit ||=@@limit
+          offset ||=@@offset
+          @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr}
+          @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
+          select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range]
+          select
+        end
+        def sql_select_body_format
+          %{<font color="#666666" size="2">#{sql_select_body}</font>}
+        end
+        def sql_select_endnotes_format
+          %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}
+        end
+        def contents
+          @conn.select_all(sql_select_body)
+        end
+        def endnotes
+          @conn.select_all(sql_select_endnotes)
+        end
+      end
+      def tail
+        <<-'WOK'
+    <br /><hr /><br />
+<table summary="SiSU summary" bgcolor="#ffffff" cellpadding="2" border="0">
+  <!-- widget sisu -->
+<tr><td valign="top" width="10%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    <a href="http://www.jus.uio.no/sisu" >
+      <img border="0" src="http://localhost/sisu/_sisu/image/sisu.png" alt="SiSU" width="120" height="39" />
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+<!-- SiSU Rights -->
+  <p class="tiny_left"><font color="#666666" size="2">
+    Generated by
+    <a href="http://www.jus.uio.no/sisu" >
+      SiSU</a> 0.55.3 2007-07-10 (2007w28/2)
+    <br />
+    <a href="http://www.jus.uio.no/sisu" >
+    <b>SiSU</b></a> <sup>&copy;</sup> Ralph Amissah
+    1993, current 2007.
+    All Rights Reserved.
+    <br />
+    <a href="http://www.jus.uio.no/sisu" >
+      SiSU</a>
+    is software for document structuring, publishing and search,
+    <br />
+    <a href="http://www.jus.uio.no/sisu" >
+      www.jus.uio.no/sisu
+    </a>
+    and
+    <a href="http://www.sisudoc.org" >
+      www.sisudoc.org
+    </a>
+  <br />
+    <i>w3 since October 3 1993</i>
+    <a href="mailto://ralph@amissah.com" >
+      ralph@amissah.com
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    SiSU using:
+    <br />Standard SiSU markup syntax,
+    <br />Standard SiSU meta-markup syntax, and the
+    <br />Standard SiSU <u>object citation numbering</u> and system, (object/text positioning system)
+  <br />
+    <sup>&copy;</sup> Ralph Amissah 1997, current 2007.
+    All Rights Reserved.
+  </font></p>
+</td></tr>
+  <!-- widget way better -->
+<tr><td valign="top" width="10%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    <a href="http://www.gnu.org/licenses/gpl.html">
+      <img border="0" src="http://localhost/sisu/_sisu/image/gplv3_free_software.png" alt="GPLv3" width="127" height="51" />
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    SiSU is released under
+    <a href="http://www.gnu.org/licenses/gpl.html">GPL&nbsp;v3</a>
+    or later,
+    <a href="http://www.gnu.org/licenses/gpl.html">
+      http://www.gnu.org/licenses/gpl.html
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    SiSU, developed using
+    <a href="http://www.ruby-lang.org/en/">
+      Ruby
+    </a>
+    on
+    <a href="http://www.debian.org/">
+      Debian/Gnu/Linux
+    </a>
+    software infrastructure,
+    with the usual GPL (or OSS) suspects.
+  <br />
+    Better - "performance, reliability, scalability, security &amp; total cost of ownership"
+    [not to mention flexibility &amp; choice]
+  <br />
+    Get With the Future
+    <a href="http://www.jus.uio.no/sisu/">
+      Way Better!
+    </a>
+  </font></p>
+</td></tr>
+</table>
+    <a name="bottom" id="bottom"></a><a name="down" id="down"></a><a name="end" id="end"></a><a name="finish" id="finish"></a><a name="stop" id="stop"></a><a name="credits" id="credits"></a>
+    </body></html>
+    WOK
+      end
+      @tail=tail
+      @counter_txt_doc,@counter_txt_ocn,@counter_endn_doc,@counter_endn_ocn=0,0,0,0
+      @counters_txt,@counters_endn,@sql_select_body,@sql_select_endnotes='','','',''
+      FCGI.each_cgi do |cgi|
+        begin # all code goes in begin section
+          @search={ :text => [],:endnotes => [] }
+          q=CGI.new
+          @db=if cgi['db'] =~/\S+/;
+            @stub=/SiSU_(\S+)/.match(cgi['db'])[1]
+            cgi['db']
+          else
+            @stub='sisu'
+            'SiSU_sisu'
+          end
+          checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','',''
+          if cgi['view']=~/text/; checked_index,checked_text='','checked'
+          else                    checked_index,checked_text='checked',''
+          end
+          checked_echo='checked' if cgi['echo'] =~/\S/
+          checked_stats='checked' if cgi['stats'] =~/\S/
+          checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
+          checked_searched='checked' if cgi['searched'] =~/\S/
+          checked_tip='checked' if cgi['tip'] =~/\S/
+          checked_case='checked' if cgi['casesense'] =~/\S/
+          checked_sql='checked' if cgi['sql'] =~/\S/
+          if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1
+            checked_all='checked'
+            checked_echo=checked_stats=checked_url=checked_searched=checked_tip=checked_sql='checked'
+            checked_none=''
+          elsif cgi['checks'] =~/check_none/
+            checked_none='checked'
+            checked_all=checked_url=checked_stats=checked_searched=checked_tip=checked_echo=checked_sql=''
+          elsif cgi['checks'] =~/check_selected/
+            checked_selected='checked'
+          elsif cgi['checks'] =~/check_default/
+            checked_default='checked'
+            checked_echo=checked_stats=checked_url='checked'
+            checked_searched=checked_tip=checked_case=checked_sql=''
+          else
+            checked_selected='checked'
+            checked_echo=checked_stats=checked_url='checked'
+            checked_searched=checked_tip=checked_case=checked_sql=''
+          end
+          selected_db=case cgi['db']
+          when /SiSU_pace/;        '<option value="SiSU_pace">pace</option>'
+          when /SiSU_sisu/;        '<option value="SiSU_sisu">sisu</option>'
+          end
+          dbi="dbi:Pg:database=#{@db};port=#{@port}"
+          @conn=DBI.connect(dbi,user)
+          search_field=cgi['find'] if cgi['find'] # =~/\S+/
+          @search_for=Search_request.new(search_field,q) #.analyze               #% search_for
+                                                                                 #% searches
+          #Canned_search.new(@base,@search_for.text1,cgi)
+          if @search_for.text1=~/\S+/ or @search_for.author=~/\S+/ #and search_field =~/\S/
+            s1='s1=' + CGI.escape(@search_for.text1) if @search_for.text1=~/\S/
+            key='key=' + CGI.escape(@search_for.keywords) if @search_for.keywords=~/\S/
+            ti='&ti=' + CGI.escape(@search_for.title) if @search_for.title=~/\S/
+            au='&au=' + CGI.escape(@search_for.author) if @search_for.author=~/\S/
+            sj='&sj=' + CGI.escape(@search_for.subject) if @search_for.subject=~/\S/
+            dsc='&dsc=' + CGI.escape(@search_for.description) if @search_for.description=~/\S/
+            pb='&pb=' + CGI.escape(@search_for.publisher) if @search_for.publisher=~/\S/
+            cntr='&cntr=' + CGI.escape(@search_for.contributor) if @search_for.contributor=~/\S/
+            dt='&dt=' + CGI.escape(@search_for.date) if @search_for.date=~/\S/
+            ty='&ty=' + CGI.escape(@search_for.type) if @search_for.type=~/\S/
+            id='&id=' + CGI.escape(@search_for.identifier) if @search_for.identifier=~/\S/
+            src='&src=' + CGI.escape(@search_for.source) if @search_for.source=~/\S/
+            lang='&lang=' + CGI.escape(@search_for.language) if @search_for.language=~/\S/
+            rel='&rel=' + CGI.escape(@search_for.relation) if @search_for.relation=~/\S/
+            cov='&cov=' + CGI.escape(@search_for.coverage) if @search_for.coverage=~/\S/
+            cr='&cr=' + CGI.escape(@search_for.rights) if @search_for.rights=~/\S/
+            co='&co=' + CGI.escape(@search_for.comment) if @search_for.comment=~/\S/
+            ab='&ab=' + CGI.escape(@search_for.abstract) if @search_for.abstract=~/\S/
+            dtc='&dtc=' + CGI.escape(@search_for.date_created) if @search_for.date_created=~/\S/
+            dti='&dti=' + CGI.escape(@search_for.date_issued) if @search_for.date_issued=~/\S/
+            dtm='&dtm=' + CGI.escape(@search_for.date_modified) if @search_for.date_modified=~/\S/
+            dta='&dta=' + CGI.escape(@search_for.date_available) if @search_for.date_available=~/\S/
+            dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/
+            fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/
+            @@canned_search_url=if checked_all =~/checked/
+              "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1"
+            else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}"
+            end
+            @canned_base_url="#@base?#{s1}&db=#{cgi['db']}"
+            if checked_case=~/\S/
+              @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
+              @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
+            else
+              @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1
+              @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1
+            end
+            canned_note='search url:'
+          else
+            @@canned_search_url="#@base?s1=United+Nations&db=documents&view=index"
+            canned_note='search url example:'
+          end
+          if search_field =~/\S+/
+            analyze_format=search_field.gsub(/\s*\n/,'; ')
+          elsif checked_all =~/checked/ or checked_url =~/checked/
+            canned_search=@@canned_search_url.scan(/(?:s1|au|ti|fns)=[^&]+/)
+            af=canned_search.join('; ')
+            af.gsub!(/s1=/,'text: ')
+            af.gsub!(/au=/,'author: ')
+            af.gsub!(/ti=/,'title: ')
+            af.gsub!(/fns=/,'filename: ')
+            af.gsub!(/%2B/,' ')
+            analyze_format=af
+            st=af.split(/\s*;\s*/)
+            search_field=st.join("\n")
+          end
+          green=%{<font size="2" color="#004000">}
+          canned_search_url_txt=CGI.escapeHTML(@@canned_search_url)
+          the_can=%{<font size="2" color="#666666">#{canned_note} <a href="#{@@canned_search_url}">#{canned_search_url_txt}</a></font><br />}
+          p_text=p_keywords=p_title=p_author=p_subject=p_description=p_publisher=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_subject=p_filename=''
+          p_text=%{text: #{green}#{@search_for.text1}</font><br />} if @search_for.text1 =~/\S+/
+          p_keywords=%{keywords: #{green}#{@search_for.keywords}</font><br />} if @search_for.keywords =~/\S+/
+          p_title=%{title: #{green}#{@search_for.title}</font><br />} if @search_for.title =~/\S+/
+          p_author=%{author: #{green}#{@search_for.author}</font><br />} if @search_for.author =~/\S+/
+          p_subject=%{subject: #{green}#{@search_for.subject}</font><br />} if @search_for.subject =~/\S+/
+          p_description=%{description: #{green}#{@search_for.description}</font><br />} if @search_for.description =~/\S+/
+          p_publisher=%{publisher: #{green}#{@search_for.publisher}</font><br />} if @search_for.publisher =~/\S+/
+          p_contributor=%{contributor: #{green}#{@search_for.contributor}</font><br />} if @search_for.contributor =~/\S+/
+          p_date=%{date: #{green}#{@search_for.date}</font><br />} if @search_for.date =~/\S+/
+          p_type=%{type: #{green}#{@search_for.type}</font><br />} if @search_for.type =~/\S+/
+          p_format=%{format: #{green}#{@search_for.format}</font><br />} if @search_for.format =~/\S+/
+          p_identifier=%{identifier: #{green}#{@search_for.identifier}</font><br />} if @search_for.identifier =~/\S+/
+          p_source=%{source: #{green}#{@search_for.source}</font><br />} if @search_for.source =~/\S+/
+          p_language=%{language: #{green}#{@search_for.language}</font><br />} if @search_for.language =~/\S+/
+          p_relation=%{relation: #{green}#{@search_for.relation}</font><br />} if @search_for.relation =~/\S+/
+          p_coverage=%{coverage: #{green}#{@search_for.coverage}</font><br />} if @search_for.coverage =~/\S+/
+          p_rights=%{rights: #{green}#{@search_for.rights}</font><br />} if @search_for.rights =~/\S+/
+          p_comment=%{comment: #{green}#{@search_for.comment}</font><br />} if @search_for.comment =~/\S+/
+          p_abstract=%{abstract: #{green}#{@search_for.abstract}</font><br />} if @search_for.abstract =~/\S+/
+          p_filename=%{filename: #{green}#{@search_for.filename}</font><br />} if @search_for.filename =~/\S+/
+          search_note=<<-WOK
+      <font size="2" color="#666666">
+      <b>database:</b> #{green}#@db</font>; <b>selected view:</b> #{green}#{cgi['view']}</font>
+      <b>search string:</b> "#{green}#{analyze_format}</font>"<br />
+      #{p_text} #{p_keywords} #{p_title} #{p_author} #{p_subject} #{p_description} #{p_publisher} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename}
+      </font>
+      WOK
+          #eg = %{canned search e.g.:<br /> <a href="#{url}">#{url}</a><br />find: #{analyze}<br />database: #{database}}
+          #dbi_canning
+          @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form
+          unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
+            print "Content-type: text/html\n\n"
+            puts (@header+@tail)
+          else #% searches
+            s1=if @search_for.text1 =~/\S/
+              @search_for.text1
+            else 'Unavailable'
+            end
+            if checked_case=~/\S/
+              @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
+              @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
+            else
+              @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'}
+              @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'}
+            end
+          #dbi_request
+            dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case)
+            @text_search_flag=false
+            @text_search_flag=dbi_statement.text_search_flag
+            s_contents=dbi_statement.contents
+            s_endnotes=dbi_statement.endnotes
+            @body_main,@endnotes=[],[]
+            @search_regx=nil
+            oldtid=0
+            if @text_search_flag
+              if checked_sql =~/\S/
+                sql_select_body=dbi_statement.sql_select_body_format
+                sql_select_endnotes=dbi_statement.sql_select_endnotes_format
+              else sql_select_body,sql_select_endnotes='',''
+              end
+              @body_main << '<p><hr><br /><b>Main Text:</b><br />' << sql_select_body
+              @endnotes  << '<p><hr><br /><b>Endnotes:</b><br />'  << sql_select_endnotes
+            else
+            end
+            #text_objects_body
+            s_contents.each do |c|                                               #% text body
+              location=c['filename'][/(.+?)\.(?:_?sst|ssm)$/,1]
+              file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1]
+              lang=if location =~ /\S+?~(\S\S\S?)$/
+                l=location[/\S+?~(\S\S\S?)$/,1]
+                location.gsub!(/(\S+?)~\S\S\S?/,'\1')
+                l=".#{l}"
+              else ''
+              end
+            #metadata_found_body
+              if c['tid'].to_i != oldtid.to_i
+                ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}"
+                else c['title']
+                end
+                can_txt_srch=if cgi['view']=~/index/; %{<a href="#{@canned_base_url}&fns=#{c['filename']}&view=text"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                else %{<a href="#{@canned_base_url}&fns=#{c['filename']}&view=index"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                end
+                title=%{<span style="background-color: #@color_heading"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> by #{c['creator']} #{can_txt_srch}<a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html"></a> <a href="#@hosturl_files/#@stub/#{location}/portrait#{lang}.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a> <a href="#@hosturl_files/#@stub/#{location}/landscape#{lang}.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/opendocument#{lang}.odt"><img border="0" width="15" height="15" src="#@image_src/b_odf.png" alt="odf"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="15" height="15" src="#@image_src/b_info.png" alt="manifest"></a><br />}  if file_suffix=~/s/ #hmm watch file_suffix
+                if @text_search_flag; title='<br /><hr>'+title
+                else                  title='<br />'+title
+                end
+                @counter_txt_doc+=1
+                oldtid=c['tid'].to_i
+              else                    title=''
+              end
+              if @text_search_flag
+                if cgi['view']=~/text/                                         #% txt body
+                  text=if c['suffix'] !~/1/ #seg
+                    if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/                         #% only this branch is working !!
+                      unescaped_search=if @search_for.text1 =~/\S+/; CGI.unescape(@search_for.text1)
+                      elsif q['s1'] =~/\S+/;                         CGI.unescape(q['s1'])
+                      else nil
+                      end
+                      @search_regx=if unescaped_search                                     #check
+                        search_regex=[]
+                        build=unescaped_search.scan(/\S+/).each do |g|
+                           if g.to_s =~/(AND|OR)/
+                             search_regex << '|'
+                           else search_regex << %{#{g.to_s}}
+                           end
+                        end
+                        search_regex=search_regex.join(' ')
+                        search_regex=search_regex.gsub(/\s*\|\s*/,'|')
+                        Regexp.new(search_regex, Regexp::IGNORECASE)
+                      else nil
+                      end
+                    else nil
+                    end
+                    matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/)
+                      matched=c['body'].gsub(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{<span style="background-color: #@color_match">\\1</span>})
+                    else c['body']
+                    end
+                    %{<hr><p><font size="2">ocn <b><a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a></b>:</font></p>#{matched_para}}
+                  elsif c['suffix'] =~/1/ #doc
+                    %{#{title}<hr><p><font size="2">ocn #{c['ocn']}:#{c['body']}}
+                  end
+                  @counter_txt_ocn+=1
+                  output=if c['seg'] =~/\S+/; title+text
+                  else                        text
+                  end
+                elsif cgi['view']=~/index/                                     #% idx body
+                  if c['suffix'] !~/1/ #seg
+                    index=%{<a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag
+                  elsif c['suffix'] =~/1/ #doc
+                    index=%{<a href="#@hosturl_files/#@stub/#{location}/doc#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, }
+                  end
+                  if c['seg'] =~/\S+/
+                    if @text_search_flag
+                      @counter_txt_ocn+=1
+                      output=title+index
+                    end
+                  else
+                    @counter_txt_ocn+=1
+                    output=unless c['suffix'] =~/1/; title+index
+                    else %{#{title}#{c['ocn'].sort}, }
+                    end
+                  end
+                end
+              else output=title
+              end
+              @counters_txt=if @counter_txt_doc > 0
+                if checked_stats =~/\S/
+                  @@lt_t=if @counter_txt_ocn == dbi_statement.sql_limit.to_i
+                    over='over'
+                    true
+                  else
+                    over=''
+                    false
+                  end
+                  %{<hr /><font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.</font><br />}
+                else ''
+                end
+              else ''
+              end
+              @body_main << output #+ details
+            end
+            #text_objects_endnote
+            oldtid = 0
+            s_endnotes.each do |e|                                               #% endnotes
+              location=e['filename'][/(.+?)\.(?:_?sst|ssm)$/,1]
+              file_suffix=e['filename'][/.+?\.(_?sst|ssm)$/,1]
+              lang=if location =~ /\S+?~(\S\S\S?)$/
+                l=location[/\S+?~(\S\S\S?)$/,1]
+                location.gsub!(/(\S+?)~\S\S\S?/,'\1')
+                l=".#{l}"
+              else ''
+              end
+            #metadata_found_endnotes
+              if @text_search_flag
+                if e['metadata_tid'].to_i != oldtid.to_i
+                  ti=if e['subtitle'] =~/\S+/; "#{e['title']} - #{e['subtitle']}"
+                  else e['title']
+                  end
+                  can_txt_srch=if cgi['view']=~/index/; %{<a href="#{@canned_base_url}&fns=#{e['filename']}&view=text"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                  else %{<a href="#{@canned_base_url}&fns=#{e['filename']}&view=index"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                  end
+                  title=%{<br /><hr><span style="background-color: #@color_heading"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> by #{e['creator']} #{can_txt_srch}<a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html"></a> <a href="#@hosturl_files/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl_files/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/opendocument#{lang}.odt"><img border="0" width="15" height="15" src="#@image_src/b_odf.png" alt="odf"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="15" height="15" src="#@image_src/b_info.png" alt="manifest"></a><br />}  if file_suffix=~/s/
+                  @counter_endn_doc+=1
+                  oldtid=e['metadata_tid'].to_i
+                else title = ''
+                end
+                if cgi['view']=~/text/                                           #% txt endnotes
+                  @counter_endn_ocn+=1
+                  matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/)
+                    matched=e['body'].gsub(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{<span style="background-color: #@color_match">\\1</span>})
+                  else e['body']
+                  end
+                  output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}}
+                elsif cgi['view']=~/index/                                       #% idx endnotes
+                  @counter_endn_ocn+=1
+                  output=%{#{title}<a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a> [&sect; <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>], }
+                end
+                @counters_endn=if @counter_endn_doc > 0
+                  if checked_stats =~/\S/
+                  @@lt_e=if @counter_endn_ocn == dbi_statement.sql_limit.to_i
+                    over='over'
+                    true
+                  else
+                    over=''
+                    false
+                  end
+                    %{<font size="2" color="#666666">Found in the endnotes of #@counter_endn_doc documents, and at #{over} #@counter_endn_ocn locations within.</font><br />}
+                  else ''
+                  end
+                end
+                @endnotes << output #+ details
+              else @endnotes=[] #does not take out yet
+              end
+            end
+            offset=dbi_statement.sql_offset.to_s
+            limit=dbi_statement.sql_limit.to_s
+            @@lt_t ||=false; @@lt_e ||=false
+            canned=if (@@lt_t or @@lt_e)
+              dbi_statement.sql_canned_search_url(true).to_s
+            else
+              dbi_statement.sql_canned_search_url(false).to_s
+            end
+            limit=dbi_statement.sql_limit.to_s
+            cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes
+          end
+        rescue Exception => e
+          s='<pre>' + CGI::escapeHTML(e.backtrace.reverse.join("\n"))
+          s << CGI::escapeHTML(e.message) + '</pre>'
+          cgi.out{s}
+          next
+        ensure # eg. disconnect from server
+          @conn.disconnect if @conn
+        end
+      end
diff --git a/data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi b/data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi
new file mode 100644 (file)
index 0000000..34bb374
--- /dev/null
@@ -0,0 +1,901 @@
+#!/usr/bin/env ruby
+=begin
+ * Name: SiSU information Structuring Universe
+ * Author: Ralph Amissah
+   * http://www.jus.uio.no/sisu
+   * http://www.jus.uio.no/sisu/SiSU/download
+
+ * Description: generates naive cgi search form for search of sisu database (sqlite)
+ * Name: SiSU generated sample cgi search form
+
+ * Description: generated sample cgi search form for SiSU
+   (SiSU is a framework for document structuring, publishing and search)
+
+ * Author: Ralph Amissah
+
+ * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+   2007 Ralph Amissah All Rights Reserved.
+
+ * License: GPL 3 or later:
+
+   SiSU, a framework for document structuring, publishing and search
+
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+   2007 Ralph Amissah
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the Free
+   Software Foundation, either version 3 of the License, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+   more details.
+
+   You should have received a copy of the GNU General Public License along with
+   this program. If not, see <http://www.gnu.org/licenses/>.
+
+   If you have Internet connection, the latest version of the GPL should be
+   available at these locations:
+   <http://www.fsf.org/licenses/gpl.html>
+   <http://www.gnu.org/copyleft/gpl.html>
+   <http://www.jus.uio.no/sisu/gpl.fsf>
+
+ * SiSU uses:
+   * Standard SiSU markup syntax,
+   * Standard SiSU meta-markup syntax, and the
+   * Standard SiSU object citation numbering and system
+
+ * Hompages:
+   <http://www.jus.uio.no/sisu>
+   <http://www.sisudoc.org>
+
+ * Download:
+   <http://www.jus.uio.no/sisu/SiSU/download.html>
+
+ * Ralph Amissah
+   <ralph@amissah.com>
+   <ralph.amissah@gmail.com>
+
+=end
+      require 'cgi'
+      require 'fcgi'
+      require 'dbi'
+      @version='sisu_search_sqlite'
+      @image_src="http://localhost/sisu/_sisu/image"
+      @hosturl_db="http://localhost"
+      @hosturl_files="http://www.jus.uio.no"
+      @@limit,@@offset=1000,0
+      @base="#@hosturl_db/cgi-bin/#@version.cgi"
+      @@canned_search_url=@base
+      @color_heading='#DDFFAA'
+      @color_match='#ffff48'
+      class Form
+        def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can='')
+          search_note='' if checked_searched !~/\S/
+          the_can='' if checked_url !~/\S/
+          search_field='' if checked_echo !~/\S/
+          @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can
+          @tip=if checked_tip =~/\S/
+            '<font size="2" color="#666666">text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;</font><br />'
+          else ''
+          end
+        end
+        def submission_form
+            search_form=<<-WOK
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+    <html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+    <title>
+    SiSU search form (sample): SiSU information Structuring Universe
+    </title>
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+    <meta name="sourcefile" content="SiSU._sst" />
+    <link rel="generator" href="http://www.jus.uio.no/sisu" />
+    <link rel="shortcut icon" href="http://localhost/sisu/_sisu/image/rb7.ico" />
+    <link rel="stylesheet" href="../_sisu/css/html.css" type="text/css" />
+    </head>
+    <body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">
+    <table summary="band" border="0" cellpadding="3" cellspacing="0">
+    <tr><td align="left" bgcolor="#ffffff"><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="http://localhost/sisu/_sisu/image/sisu.png" alt="SiSU --&gt;" /></a></td><td>
+<!--    <p class="tiny"><a href="http://www.jus.uio.no/sisu/SiSU/">&nbsp;http://www.jus.uio.no/sisu/SiSU/</a></p> -->
+      <label for="find"><b>sample search form</b></label>
+    </td></tr>
+    </table>
+    <form action="#@base" id="Test Form" method="post">
+      <table cellpadding="2">
+      <tr><td valign=\"top\">
+          <textarea id="find" name="find" type="text" rows="6" cols="40" maxlength="256">#@search_field</textarea>
+      </td>
+      <td valign=\"top\">
+        #@tip
+        #@search_note
+        #@the_can
+      </td></tr></table>
+      <td valign=\"top\"><tr><td>
+        <!input type="text" id="find" name="find" value="#@search_field" />
+        <!input type="text" id="find" name="find" value="" />
+        <font size="2" color="#222222">
+        <b>to search:</b> select which database to search (drop-down menu below); enter your search query (in the form above); and <b>click on the search button</b> (below)
+        <br />
+        <select name="db" size="1">
+          #@selected_db
+              <option value="SiSU_pace">pace</option>
+              <option value="SiSU_sisu">sisu</option>
+        </select>
+        <input type="submit" value="SiSU search" />
+        <input type="radio" name="view" value="index" #@checked_index> index
+        <input type="radio" name="view" value="text" #@checked_text> text / grep
+        <br />
+          <input type="checkbox" name="echo" #@checked_echo> echo query
+          <input type="checkbox" name="stats" #@checked_stats> result stats
+          <input type="checkbox" name="url" #@checked_url> search url
+          <input type="checkbox" name="searched" #@checked_searched> searched
+          <input type="checkbox" name="tip" #@checked_tip> available fields
+          <input type="checkbox" name="sql" #@checked_sql> sql statement
+        <br />
+          checks:
+          <input type="radio" name="checks" value="check_default" #@checked_default> default
+          <input type="radio" name="checks" value="check_selected" #@checked_selected> selected
+          <input type="radio" name="checks" value="check_all" #@checked_all> all
+          <input type="radio" name="checks" value="check_none" #@checked_none> none
+          </font>
+      </td></tr>
+      </table>
+    </form>
+      WOK
+        end
+      end
+      class Search_request                                                       #% search_for
+        attr_accessor :text1,:keywords,:title,:author,:subject,:description,:publisher,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename
+        def initialize(search_field='',q='')
+          @search_field,@q=search_field,q
+          @text1=@keywords=@title=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename=''
+          if @search_field=~/\S/
+            @text1=text_to_match('text:')
+            @keywords=text_to_match('key(?:words?)?:')
+            @title=text_to_match('title:')                  # DublinCore 1  - title
+            @author=text_to_match('(?:author|creator)s?:')  # DublinCore 2  - creator/author
+            @subject=text_to_match('subj(?:ect)?:')         # DublinCore 3  - subject
+            @description=text_to_match('description:')      # DublinCore 4  - description
+            @publisher=text_to_match('pub(?:lisher)?:')     # DublinCore 5  - publisher
+            @contributor=text_to_match('contributor:')      # DublinCore 6  - contributor
+            @date=text_to_match('date:')                    # DublinCore 7  - date dd-mm-yy
+            @type=text_to_match('type:')                    # DublinCore 8  - type
+            @format=text_to_match('format:')                # DublinCore 9  - format
+            @identifier=text_to_match('identifier:')        # DublinCore 10 - identifier
+            @source=text_to_match('source:')                # DublinCore 11 - source
+            @language=text_to_match('language:')            # DublinCore 12 - language
+            @relation=text_to_match('relation:')            # DublinCore 13 - relation
+            @coverage=text_to_match('coverage:')            # DublinCore 14 - coverage
+            @rights=text_to_match('rights:')                # DublinCore 15 - rights
+            @comment=text_to_match('comment:')
+            @abstract=text_to_match('abs(?:tract)?:')
+            @owner=text_to_match('owner:')
+            @date_created=text_to_match('date_created:')
+            @date_issued=text_to_match('date_issued:')
+            @date_modified=text_to_match('date_modified:')
+            @date_available=text_to_match('date_available:')
+            @date_valid=text_to_match('date_valid:')
+            @filename=text_to_match('filename:')
+            @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date or @filename
+          else
+            @text1=q['s1'] if q['s1']=~/\S/
+            @keywords=q['key'] if q['key']=~/\S/
+            @title=q['ti'] if q['ti']=~/\S/
+            @author=q['au'] if q['au']=~/\S/
+            @subject=q['sj'] if q['sj']=~/\S/
+            @description=q['dsc'] if q['dsc']=~/\S/
+            @publisher=q['pb'] if q['pb']=~/\S/
+            @contributor=q['cntr'] if q['cntr']=~/\S/
+            @date=q['dt'] if q['dt']=~/\S/
+            @type=q['ty'] if q['ty']=~/\S/
+            @identifier=q['id'] if q['id']=~/\S/
+            @source=q['src'] if q['src']=~/\S/
+            @language=q['lang'] if q['lang']=~/\S/
+            @relation=q['rel'] if q['rel']=~/\S/
+            @coverage=q['cov'] if q['cov']=~/\S/
+            @rights=q['cr'] if q['cr']=~/\S/
+            @comment=q['co'] if q['co']=~/\S/
+            @abstract=q['ab'] if q['ab']=~/\S/
+            @date_created=q['dtc'] if q['dtc']=~/\S/
+            @date_issued=q['dti'] if q['dti']=~/\S/
+            @date_modified=q['dtm'] if q['dtm']=~/\S/
+            @date_available=q['dta'] if q['dta']=~/\S/
+            @date_valid=q['dtv'] if q['dtv']=~/\S/
+            @filename=q['fns'] if q['fns']=~/\S/
+            @@limit=q['ltd'] if q['ltd']=~/\d+/  # 1000
+            @@offset=q['off'] if q['off']=~/\d+/ # 0
+          end
+        end
+        def text_to_match(identifier='')
+          m={
+            :string => /#{identifier}\s*(.+?)/,
+            :string => /#{identifier}\s*(.+?)(?:;|\n|\r|$)/,
+            :word => /#{identifier}[\s(]*(\S+)/
+          }
+          search_string=if @search_field =~m[:word]
+            search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1]
+            elsif @search_field =~m[:string];            m[:string].match(@search_field)[1]
+            else
+              str=m[:word].match(@search_field)[1]
+              str.gsub!(/[()]/,'')
+              str
+            end
+            search_string.strip!
+            search_string.gsub!(/\s+/,'+')
+            search_string
+          #else
+          #  "__"
+          end
+        end
+      end
+      class Dbi_search_string
+        def initialize(l,t,q,cse=false)
+          @l,@t,@q=l,t,q
+        end
+        def string
+          search={ :search => [],:flag => false }
+          if @t =~/\S+/ or @q =~/\S+/
+            if @t =~/\S+/;     unescaped_search=CGI.unescape(@t)
+            elsif @q =~/\S+/;  unescaped_search=CGI.unescape(@q)
+            end
+            search_construct=[]
+            unescaped_search.gsub!(/\s*(AND|OR)\s*/,"%' \) \\1 #@l LIKE \( '%")
+            unescaped_search.gsub!(/(.+)/,"#@l LIKE \( '%\\1%' \)")
+            search_construct << unescaped_search
+            search_construct=search_construct.join(' ')
+            search[:search]                    << search_construct
+            search[:flag]=true
+            search
+          end
+          search
+        end
+      end
+      class Dbi_search_statement
+        attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit
+        def initialize(conn,search_for,q,c)
+          @conn=conn
+          @text_search_flag=false
+          @sql_statement={ :body=>'',:endnotes=>'',:range=>'' }
+          #@offset||=@@offset
+          #@offset+=@@limit
+          search={ :text => [],:endnotes => [] }
+          cse=if c =~/\S/; true
+          else false
+          end
+          st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string
+          se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string
+          @text_search_flag=st[:flag]
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << se[:search]
+          end
+          st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string
+          if st[:flag]
+            search[:text]                    << st[:search]
+            search[:endnotes]                << st[:search]
+          end
+          @@limit=q['ltd'] if q['ltd']=~/\d+/  # 1000
+          @@offset=q['off'] if q['off']=~/\d+/ # 0
+          @search_text,@search_endnotes=[],[]
+                                                                                 #%
+          search[:text].each{|x| @search_text << "#{x} AND " }
+          @search_text=@search_text.to_s.gsub!(/AND\s+$/,'')
+          @search_text.gsub!(/(documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)')
+          search[:endnotes].each{|x| @search_endnotes << "#{x} AND " }
+          @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'')
+          @search_text.gsub!(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)')
+        end
+        def sql_offset
+          @@offset
+        end
+        def sql_limit
+          @@limit
+        end
+        def sql_canned_search
+          @offset_next=sql_offset.to_i + sql_limit.to_i
+          @offset_previous=sql_offset.to_i - sql_limit.to_i
+          def current
+            @@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + sql_offset.to_s
+          end
+          def next
+            @@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_next.to_s
+          end
+          def previous
+            @offset_previous >= 0 ? (@@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : ''
+          end
+          def start
+            @@canned_search_url.to_s + '&ltd=' + sql_limit.to_s + '&off=' + 0.to_s
+          end
+          self
+        end
+        def sql_canned_search_url(ok)
+          if ok
+            can=sql_canned_search
+            page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i
+            case page.to_s
+            when /^1$/
+              %{<hr /><br /><center>
+              pg. #{page.to_s}
+              <a href="#{can.next}">&nbsp;&nbsp;&gt;</a>
+              </center>}
+            when /^2$/
+              %{<hr /><br /><center>
+              <a href="#{can.previous}">&lt;&nbsp;&nbsp;</a>
+              pg. #{page.to_s}
+              <a href="#{can.next}">&nbsp;&nbsp;&gt;</a>
+              </center>}
+            else
+              %{<hr /><br /><center>
+              <a href="#{can.start}">|&lt;&nbsp;&nbsp;</a>
+              <a href="#{can.previous}">&lt;&nbsp;&nbsp;</a>
+              pg. #{page.to_s}
+              <a href="#{can.next}">&nbsp;&nbsp;&gt;</a>
+              </center>}
+            end
+          else ''
+          end
+        end
+        def sql_select_body
+          limit ||=@@limit
+          offset ||=@@offset
+          @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE #{@search_text} AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn}
+          @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
+          select=@sql_statement[:body] + ' ' + @sql_statement[:range]
+          select
+        end
+        def sql_select_endnotes
+          limit ||=@@limit
+          offset ||=@@offset
+          @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr}
+          @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
+          select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range]
+          select
+        end
+        def sql_select_body_format
+          %{<font color="#666666" size="2">#{sql_select_body}</font>}
+        end
+        def sql_select_endnotes_format
+          %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}
+        end
+        def contents
+          @conn.select_all(sql_select_body)
+        end
+        def endnotes
+          @conn.select_all(sql_select_endnotes)
+        end
+      end
+      def tail
+        <<-'WOK'
+    <br /><hr /><br />
+<table summary="SiSU summary" bgcolor="#ffffff" cellpadding="2" border="0">
+  <!-- widget sisu -->
+<tr><td valign="top" width="10%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    <a href="http://www.jus.uio.no/sisu" >
+      <img border="0" src="http://localhost/sisu/_sisu/image/sisu.png" alt="SiSU" width="120" height="39" />
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+<!-- SiSU Rights -->
+  <p class="tiny_left"><font color="#666666" size="2">
+    Generated by
+    <a href="http://www.jus.uio.no/sisu" >
+      SiSU</a> 0.55.3 2007-07-10 (2007w28/2)
+    <br />
+    <a href="http://www.jus.uio.no/sisu" >
+    <b>SiSU</b></a> <sup>&copy;</sup> Ralph Amissah
+    1993, current 2007.
+    All Rights Reserved.
+    <br />
+    <a href="http://www.jus.uio.no/sisu" >
+      SiSU</a>
+    is software for document structuring, publishing and search,
+    <br />
+    <a href="http://www.jus.uio.no/sisu" >
+      www.jus.uio.no/sisu
+    </a>
+    and
+    <a href="http://www.sisudoc.org" >
+      www.sisudoc.org
+    </a>
+  <br />
+    <i>w3 since October 3 1993</i>
+    <a href="mailto://ralph@amissah.com" >
+      ralph@amissah.com
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    SiSU using:
+    <br />Standard SiSU markup syntax,
+    <br />Standard SiSU meta-markup syntax, and the
+    <br />Standard SiSU <u>object citation numbering</u> and system, (object/text positioning system)
+  <br />
+    <sup>&copy;</sup> Ralph Amissah 1997, current 2007.
+    All Rights Reserved.
+  </font></p>
+</td></tr>
+  <!-- widget way better -->
+<tr><td valign="top" width="10%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    <a href="http://www.gnu.org/licenses/gpl.html">
+      <img border="0" src="http://localhost/sisu/_sisu/image/gplv3_free_software.png" alt="GPLv3" width="127" height="51" />
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    SiSU is released under
+    <a href="http://www.gnu.org/licenses/gpl.html">GPL&nbsp;v3</a>
+    or later,
+    <a href="http://www.gnu.org/licenses/gpl.html">
+      http://www.gnu.org/licenses/gpl.html
+    </a>
+  </font></p>
+</td><td valign="top" width="45%">
+  <p class="tiny_left"><font color="#666666" size="2">
+    SiSU, developed using
+    <a href="http://www.ruby-lang.org/en/">
+      Ruby
+    </a>
+    on
+    <a href="http://www.debian.org/">
+      Debian/Gnu/Linux
+    </a>
+    software infrastructure,
+    with the usual GPL (or OSS) suspects.
+  <br />
+    Better - "performance, reliability, scalability, security &amp; total cost of ownership"
+    [not to mention flexibility &amp; choice]
+  <br />
+    Get With the Future
+    <a href="http://www.jus.uio.no/sisu/">
+      Way Better!
+    </a>
+  </font></p>
+</td></tr>
+</table>
+    <a name="bottom" id="bottom"></a><a name="down" id="down"></a><a name="end" id="end"></a><a name="finish" id="finish"></a><a name="stop" id="stop"></a><a name="credits" id="credits"></a>
+    </body></html>
+    WOK
+      end
+      @tail=tail
+      @counter_txt_doc,@counter_txt_ocn,@counter_endn_doc,@counter_endn_ocn=0,0,0,0
+      @counters_txt,@counters_endn,@sql_select_body,@sql_select_endnotes='','','',''
+      FCGI.each_cgi do |cgi|
+        begin # all code goes in begin section
+          @search={ :text => [],:endnotes => [] }
+          q=CGI.new
+          @db=if cgi['db'] =~/\S+/;
+            @stub=/SiSU_(\S+)/.match(cgi['db'])[1]
+            cgi['db']
+          else
+            @stub='sisu'
+            'SiSU_sisu'
+          end
+          checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','',''
+          if cgi['view']=~/text/; checked_index,checked_text='','checked'
+          else                    checked_index,checked_text='checked',''
+          end
+          checked_echo='checked' if cgi['echo'] =~/\S/
+          checked_stats='checked' if cgi['stats'] =~/\S/
+          checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
+          checked_searched='checked' if cgi['searched'] =~/\S/
+          checked_tip='checked' if cgi['tip'] =~/\S/
+          checked_case='checked' if cgi['casesense'] =~/\S/
+          checked_sql='checked' if cgi['sql'] =~/\S/
+          if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1
+            checked_all='checked'
+            checked_echo=checked_stats=checked_url=checked_searched=checked_tip=checked_sql='checked'
+            checked_none=''
+          elsif cgi['checks'] =~/check_none/
+            checked_none='checked'
+            checked_all=checked_url=checked_stats=checked_searched=checked_tip=checked_echo=checked_sql=''
+          elsif cgi['checks'] =~/check_selected/
+            checked_selected='checked'
+          elsif cgi['checks'] =~/check_default/
+            checked_default='checked'
+            checked_echo=checked_stats=checked_url='checked'
+            checked_searched=checked_tip=checked_case=checked_sql=''
+          else
+            checked_selected='checked'
+            checked_echo=checked_stats=checked_url='checked'
+            checked_searched=checked_tip=checked_case=checked_sql=''
+          end
+          selected_db=case cgi['db']
+           when /SiSU_pace/; '<option value="SiSU_pace">pace</option>'
+           when /SiSU_sisu/; '<option value="SiSU_sisu">sisu</option>'
+          end
+          db_name='sisu_sqlite.db'
+          db_sqlite=case cgi['db']
+          when /SiSU_pace/;                      "/home/ralph/sisu_www/pace/sisu_sqlite.db"
+          when /SiSU_sisu/;                      "/home/ralph/sisu_www/sisu/sisu_sqlite.db"
+          end
+          @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ?
+          @conn=DBI.connect(@dbi)
+          search_field=cgi['find'] if cgi['find'] # =~/\S+/
+          @search_for=Search_request.new(search_field,q) #.analyze               #% search_for
+                                                                                 #% searches
+          #Canned_search.new(@base,@search_for.text1,cgi)
+          if @search_for.text1=~/\S+/ or @search_for.author=~/\S+/ #and search_field =~/\S/
+            s1='s1=' + CGI.escape(@search_for.text1) if @search_for.text1=~/\S/
+            key='key=' + CGI.escape(@search_for.keywords) if @search_for.keywords=~/\S/
+            ti='&ti=' + CGI.escape(@search_for.title) if @search_for.title=~/\S/
+            au='&au=' + CGI.escape(@search_for.author) if @search_for.author=~/\S/
+            sj='&sj=' + CGI.escape(@search_for.subject) if @search_for.subject=~/\S/
+            dsc='&dsc=' + CGI.escape(@search_for.description) if @search_for.description=~/\S/
+            pb='&pb=' + CGI.escape(@search_for.publisher) if @search_for.publisher=~/\S/
+            cntr='&cntr=' + CGI.escape(@search_for.contributor) if @search_for.contributor=~/\S/
+            dt='&dt=' + CGI.escape(@search_for.date) if @search_for.date=~/\S/
+            ty='&ty=' + CGI.escape(@search_for.type) if @search_for.type=~/\S/
+            id='&id=' + CGI.escape(@search_for.identifier) if @search_for.identifier=~/\S/
+            src='&src=' + CGI.escape(@search_for.source) if @search_for.source=~/\S/
+            lang='&lang=' + CGI.escape(@search_for.language) if @search_for.language=~/\S/
+            rel='&rel=' + CGI.escape(@search_for.relation) if @search_for.relation=~/\S/
+            cov='&cov=' + CGI.escape(@search_for.coverage) if @search_for.coverage=~/\S/
+            cr='&cr=' + CGI.escape(@search_for.rights) if @search_for.rights=~/\S/
+            co='&co=' + CGI.escape(@search_for.comment) if @search_for.comment=~/\S/
+            ab='&ab=' + CGI.escape(@search_for.abstract) if @search_for.abstract=~/\S/
+            dtc='&dtc=' + CGI.escape(@search_for.date_created) if @search_for.date_created=~/\S/
+            dti='&dti=' + CGI.escape(@search_for.date_issued) if @search_for.date_issued=~/\S/
+            dtm='&dtm=' + CGI.escape(@search_for.date_modified) if @search_for.date_modified=~/\S/
+            dta='&dta=' + CGI.escape(@search_for.date_available) if @search_for.date_available=~/\S/
+            dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/
+            fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/
+            @@canned_search_url=if checked_all =~/checked/
+              "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1"
+            else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}"
+            end
+            @canned_base_url="#@base?#{s1}&db=#{cgi['db']}"
+            if checked_case=~/\S/
+              @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
+              @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
+            else
+              @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1
+              @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1
+            end
+            canned_note='search url:'
+          else
+            @@canned_search_url="#@base?s1=United+Nations&db=documents&view=index"
+            canned_note='search url example:'
+          end
+          if search_field =~/\S+/
+            analyze_format=search_field.gsub(/\s*\n/,'; ')
+          elsif checked_all =~/checked/ or checked_url =~/checked/
+            canned_search=@@canned_search_url.scan(/(?:s1|au|ti|fns)=[^&]+/)
+            af=canned_search.join('; ')
+            af.gsub!(/s1=/,'text: ')
+            af.gsub!(/au=/,'author: ')
+            af.gsub!(/ti=/,'title: ')
+            af.gsub!(/fns=/,'filename: ')
+            af.gsub!(/%2B/,' ')
+            analyze_format=af
+            st=af.split(/\s*;\s*/)
+            search_field=st.join("\n")
+          end
+          green=%{<font size="2" color="#004000">}
+          canned_search_url_txt=CGI.escapeHTML(@@canned_search_url)
+          the_can=%{<font size="2" color="#666666">#{canned_note} <a href="#{@@canned_search_url}">#{canned_search_url_txt}</a></font><br />}
+          p_text=p_keywords=p_title=p_author=p_subject=p_description=p_publisher=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_subject=p_filename=''
+          p_text=%{text: #{green}#{@search_for.text1}</font><br />} if @search_for.text1 =~/\S+/
+          p_keywords=%{keywords: #{green}#{@search_for.keywords}</font><br />} if @search_for.keywords =~/\S+/
+          p_title=%{title: #{green}#{@search_for.title}</font><br />} if @search_for.title =~/\S+/
+          p_author=%{author: #{green}#{@search_for.author}</font><br />} if @search_for.author =~/\S+/
+          p_subject=%{subject: #{green}#{@search_for.subject}</font><br />} if @search_for.subject =~/\S+/
+          p_description=%{description: #{green}#{@search_for.description}</font><br />} if @search_for.description =~/\S+/
+          p_publisher=%{publisher: #{green}#{@search_for.publisher}</font><br />} if @search_for.publisher =~/\S+/
+          p_contributor=%{contributor: #{green}#{@search_for.contributor}</font><br />} if @search_for.contributor =~/\S+/
+          p_date=%{date: #{green}#{@search_for.date}</font><br />} if @search_for.date =~/\S+/
+          p_type=%{type: #{green}#{@search_for.type}</font><br />} if @search_for.type =~/\S+/
+          p_format=%{format: #{green}#{@search_for.format}</font><br />} if @search_for.format =~/\S+/
+          p_identifier=%{identifier: #{green}#{@search_for.identifier}</font><br />} if @search_for.identifier =~/\S+/
+          p_source=%{source: #{green}#{@search_for.source}</font><br />} if @search_for.source =~/\S+/
+          p_language=%{language: #{green}#{@search_for.language}</font><br />} if @search_for.language =~/\S+/
+          p_relation=%{relation: #{green}#{@search_for.relation}</font><br />} if @search_for.relation =~/\S+/
+          p_coverage=%{coverage: #{green}#{@search_for.coverage}</font><br />} if @search_for.coverage =~/\S+/
+          p_rights=%{rights: #{green}#{@search_for.rights}</font><br />} if @search_for.rights =~/\S+/
+          p_comment=%{comment: #{green}#{@search_for.comment}</font><br />} if @search_for.comment =~/\S+/
+          p_abstract=%{abstract: #{green}#{@search_for.abstract}</font><br />} if @search_for.abstract =~/\S+/
+          p_filename=%{filename: #{green}#{@search_for.filename}</font><br />} if @search_for.filename =~/\S+/
+          search_note=<<-WOK
+      <font size="2" color="#666666">
+      <b>database:</b> #{green}#@db</font>; <b>selected view:</b> #{green}#{cgi['view']}</font>
+      <b>search string:</b> "#{green}#{analyze_format}</font>"<br />
+      #{p_text} #{p_keywords} #{p_title} #{p_author} #{p_subject} #{p_description} #{p_publisher} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename}
+      </font>
+      WOK
+          #eg = %{canned search e.g.:<br /> <a href="#{url}">#{url}</a><br />find: #{analyze}<br />database: #{database}}
+          #dbi_canning
+          @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form
+          unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
+            print "Content-type: text/html\n\n"
+            puts (@header+@tail)
+          else #% searches
+            s1=if @search_for.text1 =~/\S/
+              @search_for.text1
+            else 'Unavailable'
+            end
+            if checked_case=~/\S/
+              @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
+              @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
+            else
+              @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'}
+              @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'}
+            end
+          #dbi_request
+            dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case)
+            @text_search_flag=false
+            @text_search_flag=dbi_statement.text_search_flag
+            s_contents=dbi_statement.contents
+            s_endnotes=dbi_statement.endnotes
+            @body_main,@endnotes=[],[]
+            @search_regx=nil
+            oldtid=0
+            if @text_search_flag
+              if checked_sql =~/\S/
+                sql_select_body=dbi_statement.sql_select_body_format
+                sql_select_endnotes=dbi_statement.sql_select_endnotes_format
+              else sql_select_body,sql_select_endnotes='',''
+              end
+              @body_main << '<p><hr><br /><b>Main Text:</b><br />' << sql_select_body
+              @endnotes  << '<p><hr><br /><b>Endnotes:</b><br />'  << sql_select_endnotes
+            else
+            end
+            #text_objects_body
+            s_contents.each do |c|                                               #% text body
+              location=c['filename'][/(.+?)\.(?:_?sst|ssm)$/,1]
+              file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1]
+              lang=if location =~ /\S+?~(\S\S\S?)$/
+                l=location[/\S+?~(\S\S\S?)$/,1]
+                location.gsub!(/(\S+?)~\S\S\S?/,'\1')
+                l=".#{l}"
+              else ''
+              end
+            #metadata_found_body
+              if c['tid'].to_i != oldtid.to_i
+                ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}"
+                else c['title']
+                end
+                can_txt_srch=if cgi['view']=~/index/; %{<a href="#{@canned_base_url}&fns=#{c['filename']}&view=text"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                else %{<a href="#{@canned_base_url}&fns=#{c['filename']}&view=index"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                end
+                title=%{<span style="background-color: #@color_heading"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> by #{c['creator']} #{can_txt_srch}<a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html"></a> <a href="#@hosturl_files/#@stub/#{location}/portrait#{lang}.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a> <a href="#@hosturl_files/#@stub/#{location}/landscape#{lang}.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/opendocument#{lang}.odt"><img border="0" width="15" height="15" src="#@image_src/b_odf.png" alt="odf"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="15" height="15" src="#@image_src/b_info.png" alt="manifest"></a><br />}  if file_suffix=~/s/ #hmm watch file_suffix
+                if @text_search_flag; title='<br /><hr>'+title
+                else                  title='<br />'+title
+                end
+                @counter_txt_doc+=1
+                oldtid=c['tid'].to_i
+              else                    title=''
+              end
+              if @text_search_flag
+                if cgi['view']=~/text/                                         #% txt body
+                  text=if c['suffix'] !~/1/ #seg
+                    if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/                         #% only this branch is working !!
+                      unescaped_search=if @search_for.text1 =~/\S+/; CGI.unescape(@search_for.text1)
+                      elsif q['s1'] =~/\S+/;                         CGI.unescape(q['s1'])
+                      else nil
+                      end
+                      @search_regx=if unescaped_search                                     #check
+                        search_regex=[]
+                        build=unescaped_search.scan(/\S+/).each do |g|
+                           if g.to_s =~/(AND|OR)/
+                             search_regex << '|'
+                           else search_regex << %{#{g.to_s}}
+                           end
+                        end
+                        search_regex=search_regex.join(' ')
+                        search_regex=search_regex.gsub(/\s*\|\s*/,'|')
+                        Regexp.new(search_regex, Regexp::IGNORECASE)
+                      else nil
+                      end
+                    else nil
+                    end
+                    matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/)
+                      matched=c['body'].gsub(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{<span style="background-color: #@color_match">\\1</span>})
+                    else c['body']
+                    end
+                    %{<hr><p><font size="2">ocn <b><a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a></b>:</font></p>#{matched_para}}
+                  elsif c['suffix'] =~/1/ #doc
+                    %{#{title}<hr><p><font size="2">ocn #{c['ocn']}:#{c['body']}}
+                  end
+                  @counter_txt_ocn+=1
+                  output=if c['seg'] =~/\S+/; title+text
+                  else                        text
+                  end
+                elsif cgi['view']=~/index/                                     #% idx body
+                  if c['suffix'] !~/1/ #seg
+                    index=%{<a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag
+                  elsif c['suffix'] =~/1/ #doc
+                    index=%{<a href="#@hosturl_files/#@stub/#{location}/doc#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, }
+                  end
+                  if c['seg'] =~/\S+/
+                    if @text_search_flag
+                      @counter_txt_ocn+=1
+                      output=title+index
+                    end
+                  else
+                    @counter_txt_ocn+=1
+                    output=unless c['suffix'] =~/1/; title+index
+                    else %{#{title}#{c['ocn'].sort}, }
+                    end
+                  end
+                end
+              else output=title
+              end
+              @counters_txt=if @counter_txt_doc > 0
+                if checked_stats =~/\S/
+                  @@lt_t=if @counter_txt_ocn == dbi_statement.sql_limit.to_i
+                    over='over'
+                    true
+                  else
+                    over=''
+                    false
+                  end
+                  %{<hr /><font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.</font><br />}
+                else ''
+                end
+              else ''
+              end
+              @body_main << output #+ details
+            end
+            #text_objects_endnote
+            oldtid = 0
+            s_endnotes.each do |e|                                               #% endnotes
+              location=e['filename'][/(.+?)\.(?:_?sst|ssm)$/,1]
+              file_suffix=e['filename'][/.+?\.(_?sst|ssm)$/,1]
+              lang=if location =~ /\S+?~(\S\S\S?)$/
+                l=location[/\S+?~(\S\S\S?)$/,1]
+                location.gsub!(/(\S+?)~\S\S\S?/,'\1')
+                l=".#{l}"
+              else ''
+              end
+            #metadata_found_endnotes
+              if @text_search_flag
+                if e['metadata_tid'].to_i != oldtid.to_i
+                  ti=if e['subtitle'] =~/\S+/; "#{e['title']} - #{e['subtitle']}"
+                  else e['title']
+                  end
+                  can_txt_srch=if cgi['view']=~/index/; %{<a href="#{@canned_base_url}&fns=#{e['filename']}&view=text"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                  else %{<a href="#{@canned_base_url}&fns=#{e['filename']}&view=index"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="red bullet"></a> }
+                  end
+                  title=%{<br /><hr><span style="background-color: #@color_heading"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html">&nbsp;#{ti}</a></span> by #{e['creator']} #{can_txt_srch}<a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html"><img border="0" width="15" height="18" src="#@image_src/b_toc.png" alt="toc html"></a> <a href="#@hosturl_files/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl_files/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/opendocument#{lang}.odt"><img border="0" width="15" height="15" src="#@image_src/b_odf.png" alt="odf"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="15" height="15" src="#@image_src/b_info.png" alt="manifest"></a><br />}  if file_suffix=~/s/
+                  @counter_endn_doc+=1
+                  oldtid=e['metadata_tid'].to_i
+                else title = ''
+                end
+                if cgi['view']=~/text/                                           #% txt endnotes
+                  @counter_endn_ocn+=1
+                  matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/)
+                    matched=e['body'].gsub(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{<span style="background-color: #@color_match">\\1</span>})
+                  else e['body']
+                  end
+                  output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}}
+                elsif cgi['view']=~/index/                                       #% idx endnotes
+                  @counter_endn_ocn+=1
+                  output=%{#{title}<a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a> [&sect; <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>], }
+                end
+                @counters_endn=if @counter_endn_doc > 0
+                  if checked_stats =~/\S/
+                  @@lt_e=if @counter_endn_ocn == dbi_statement.sql_limit.to_i
+                    over='over'
+                    true
+                  else
+                    over=''
+                    false
+                  end
+                    %{<font size="2" color="#666666">Found in the endnotes of #@counter_endn_doc documents, and at #{over} #@counter_endn_ocn locations within.</font><br />}
+                  else ''
+                  end
+                end
+                @endnotes << output #+ details
+              else @endnotes=[] #does not take out yet
+              end
+            end
+            offset=dbi_statement.sql_offset.to_s
+            limit=dbi_statement.sql_limit.to_s
+            @@lt_t ||=false; @@lt_e ||=false
+            canned=if (@@lt_t or @@lt_e)
+              dbi_statement.sql_canned_search_url(true).to_s
+            else
+              dbi_statement.sql_canned_search_url(false).to_s
+            end
+            limit=dbi_statement.sql_limit.to_s
+            cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes
+          end
+        rescue Exception => e
+          s='<pre>' + CGI::escapeHTML(e.backtrace.reverse.join("\n"))
+          s << CGI::escapeHTML(e.message) + '</pre>'
+          cgi.out{s}
+          next
+        ensure # eg. disconnect from server
+          @conn.disconnect if @conn
+        end
+      end
diff --git a/data/sisu/v3dv/conf/completion/README b/data/sisu/v3dv/conf/completion/README
new file mode 100644 (file)
index 0000000..d723a14
--- /dev/null
@@ -0,0 +1,7 @@
+_sisu (naive zsh completion for SiSU)
+  on Debian file is located at /usr/share/sisu/conf/completion
+  installation: works if copied somewhere within your $fpath
+    do it yourself on Debian copy to ~/.zfunc or
+    /usr/local/share/zsh/site-functions and run compinit
+
+  note zsh is not installed by default on a Debian system
diff --git a/data/sisu/v3dv/conf/completion/_sisu b/data/sisu/v3dv/conf/completion/_sisu
new file mode 100644 (file)
index 0000000..076795c
--- /dev/null
@@ -0,0 +1,64 @@
+#compdef sisu
+# Copyright (C) 2006 Ralph Amissah
+# sisu, version 0.46.1
+# same license as Zsh or SiSU
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+_arguments -s -C -M 'r:|[_-]=* r:|=*' \
+  '(--convert --to -C)-U[prints to screen url output map of available output possibilities]' \
+  '(--convert --to -C)-u[url mapping of output files for requested processing flags]' \
+  '(--convert --to -C)-V[more verbose than -v]' \
+  '(--convert --to -C)-v[verbose]' \
+  '--no-ocn[-\[hHp\]switches off object citation numbering]' \
+  '--no-annotate[-\[mhHpoxXabN\] strips output text of additional editors endnotes]' \
+  '(--convert --to -C)-A[plaintext with dos line-feeds, footnotes follow paragraphs in which they occur]' \
+  '(--convert --to -C)-a[plaintext with Unix line-feeds, footnotes follow paragraphs in which they occur]' \
+  '(--convert --to -C)-b[XHTML output]' \
+  '(- *)-C[initialise site]' \
+  '(--convert --to -C)-c[toggle screen color on or off depending on set default]' \
+  '(--convert --to -C)-E[plaintext with dos line-feeds, endnotes following main text]' \
+  '(--convert --to -C)-e[plaintext with Unix line-feeds, endnotes following main text]' \
+  '(--convert --to -C)-F[generate sample cgi web search form \[--webserv=webrick for sisu webrick url\]]' \
+  '(--convert --to -C -h)-H[HTML output, without link suffixes]' \
+  '(--convert --to -C -H)-h[HTML output]' \
+  '(--convert --to -C)-I[texinfo output, not maintained]' \
+  '(--convert --to -C)-L[print license info]' \
+  '(--convert --to -C)-M[maintenance mode, retain intermediate processing files]' \
+  '(--convert --to -C)-m[create intermediate markup file, metaverse, assumed for most output instuctions]' \
+  '(--convert --to -C)-N[document content certificate, output document digests]' \
+  '(--convert --to -C)-n[skip intermediate markup, skip -m]' \
+  '(--convert --to -C)-o[Open Document text format output]' \
+  '(--convert --to -C)-p[LaTeX pdf output]' \
+  '(--convert --to -C)-q[quiet mode]' \
+  '(--convert --to -C)-R[post output to remote host using rsync, requires pre-configuration]' \
+  '(--convert --to -C)-r[post output to remote host using scp, requires pre-configuration]' \
+  '(--convert --to -C)-S[produces and shares tarred gzipped markup source document with associated images etc.]' \
+  '(--convert --to -C)-s[shares markup source]' \
+  '(--convert --to -C)-t[termsheet, preprocessing]' \
+  '(- *)-W[starts ruby webrick server]' \
+  '(--convert --to -C)-w[concordance file]' \
+  '(--convert --to -C)-X[XML dom style]' \
+  '(--convert --to -C)-x[XML sax style]' \
+  '(--convert --to -C)-y[output summary page, manifest of existing generated output]' \
+  '(--convert --to -C)-Z[Zap delete/destroy output]' \
+  '--import[-\[Dd\] imports document to database]' \
+  '--update[-\[Dd\] updates document in database]' \
+  '--remove[-\[Dd\] removes document from database]' \
+  '--dropall[-\[Dd\] drops database, tables, indexes, all!]' \
+  '--create[-\[Dd\] creates new database - tables, indexes, etc.]' \
+  '--recreate[-\[Dd\] drops database, killing data and creates new empty database - tables, indexes, etc.]' \
+  '(--convert --to -C)-D[postgresql database instruction]' \
+  '(--convert --to -C)-d[sqlite database instruction]' \
+  '(- *)--help[display help information]' \
+  '(--convert --to -C -2 -3 -4 -5)-1[shortcut, initial default -mNHwpy]' \
+  '(--convert --to -C -1 -3 -4 -5)-2[shortcut, initial default -mNHwpaoy]' \
+  '(--convert --to -C -1 -2 -4 -5)-3[shortcut, initial default -mNHwpaobxXy]' \
+  '(--convert --to -C -1 -2 -3 -5)-4[shortcut, initial default -mNHwpaobxXDy --import]' \
+  '(--convert --to -C -1 -2 -3 -4)-5[shortcut, initial default -mNHwpaobxXDy --update]' \
+  '--to=node[XML node based input representation, experimental]' \
+  '--to=sax[XML sax based input representation, experimental]' \
+  '--to=dom[XML dom based input representation, experimental]' \
+  '--convert=footnotes[embedded footnotes]' \
+  '--to=current[current markup]' \
+  '--to=xml2sst[from sisu xml to sst]' \
+  '*:SiSU files:_files -g "*.(sst|ssm)(.)"'
diff --git a/data/sisu/v3dv/conf/convert/kdissert_to_sisu b/data/sisu/v3dv/conf/convert/kdissert_to_sisu
new file mode 100644 (file)
index 0000000..35921c3
--- /dev/null
@@ -0,0 +1,161 @@
+#!/usr/bin/env ruby
+=begin
+ * Name: modify.rb
+ * Author: Ralph Amissah
+   * http://www.jus.uio.no/sisu
+   * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Conversion script from kdissert .kdi to sisu markup .sst
+ * Copyright (C) 2004, 2006 Ralph Amissah
+ * Packaged with: SiSU information Structuring Universe -
+     Structured information, Serialized Units
+ * SiSU Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah
+
+ * License: GPL 3 or later
+
+  Summary of GPL 3
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the Free
+  Software Foundation; either version 3 of the License, or (at your option)
+  any later version.
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+  more details.
+
+  You should have received a copy of the GNU General Public License along
+  with this program; if not, write to the Free Software Foundation, Inc.,
+  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+  If you have Internet connection, the latest version of the GPL should be
+  available at these locations:
+    http://www.fsf.org/licenses/gpl.html
+    http://www.gnu.org/copyleft/gpl.html
+    http://www.jus.uio.no/sisu/gpl3.fsf
+
+  © Ralph Amissah 1997, current 2006.
+  All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+                  ralph.amissah@gmail.com
+=end
+require 'rexml/document'
+include REXML
+argv=$*
+@sisu,@sisu_base=Array.new,Array.new
+unless argv.empty?
+  argv.each do |kdi|
+    if kdi =~/\.kdi$/
+      system("cp #{kdi} #{kdi}.tar.gz && tar xzvf #{kdi}.tar.gz && rm #{kdi}.tar.gz")
+      file=File.new("maindoc.xml")
+      #system("cp #{kdi} /tmp/. && cd /tmp && tar xzvf /tmp/#{kdi} && cd -")
+      #file=File.new("/tmp/maindoc.xml")
+      @output=File.new("#{kdi}.sst",'w')
+      doc=Document.new(file)
+      root=doc.root
+      @el=Array.new
+      root.each do |x|
+      end
+      root.each_with_index do |content,idx|
+        if root.elements["item[#{idx}]/summary"]
+          id,ma,ch=nil,nil,Array.new
+          if root.elements["item[#{idx}]/id"]
+            id=root.elements["item[#{idx}]/id"].text.to_i
+          end
+          if root.elements["item[#{idx}]/parent"]
+            ma=root.elements["item[#{idx}]/parent"].text.to_s
+          end
+          if root.elements["item[#{idx}]/child"] #problem only get one child, even where several
+            root.get_elements("item[#{idx}]/child").each do |x|
+              ch << x.text
+            end
+          end
+          if root.elements["item[#{idx}]/summary"]
+            sum=root.elements["item[#{idx}]/summary"].text.to_s.strip
+          end
+          if root.elements["item[#{idx}]/text"]
+            txt=root.elements["item[#{idx}]/text"].text.to_s.strip
+          end
+          @el[id]=Hash.new
+          @el[id][:id]=id
+          @el[id][:ma]=ma
+          @el[id][:ch]=ch
+          @el[id][:sum]=sum
+          @el[id][:txt]=txt
+          if ma == '-1'
+            @el[id][:lev]=':A'
+            @top=id
+          end
+        end
+      end
+      @doc=Array.new
+      @title=@el[@top][:sum]
+      p @el[@top][:sum]
+      @doc << ':A~ ' + @el[@top][:sum]
+      @el[@top][:ch].each do |x|
+        @el[x.to_i][:lev]='1'
+        @doc << '1~ ' + @el[x.to_i][:sum]
+        @doc << @el[x.to_i][:txt]
+        @el[x.to_i][:ch].each do |y|
+          @el[y.to_i][:lev]='2'
+          @doc << '2~ ' + @el[y.to_i][:sum]
+          @doc << @el[y.to_i][:txt]
+          @el[y.to_i][:ch].each do |z|
+            @el[z.to_i][:lev]='3'
+            @doc << '3~ ' + @el[z.to_i][:sum]
+            @doc << @el[z.to_i][:txt]
+            @el[z.to_i][:ch].each do |za|  #unsupported... consder
+              @el[za.to_i][:lev]='4'
+              @doc << '!_ ' + @el[za.to_i][:sum]
+              @doc << @el[za.to_i][:txt]
+            end
+          end
+        end
+      end
+      #@el.each_with_index do |x,i|
+      #  if x: puts "#{i}: lev: #{x[:lev]}, id: #{x[:id]}, ma: #{x[:ma]}, ch: #{x[:ch].join(',')}"
+      #  end
+      #end
+# regexs strip most kdissert markup, and provide minimal info for sisu markup -->
+      @doc.each do |c,idx|
+        c.gsub!(/<\/summary>/,'')
+        c.gsub!(/<html>.+?\n|<\/body>|<\/html>|<p>/m,'')
+        c.gsub!(/<\/p>/,"\n")
+        c.gsub!(/<span style="font-weight:600">(.+?)<\/span>/," *{ \\1 }* ")
+        c.gsub!(/<span style="text-decoration:underline">(.+?)<\/span>/," _{ \\1 }_ ")
+        c.gsub!(/<span style="font-style:italic">(.+?)<\/span>/," /{ \\1 }/ ")
+        c.gsub!(/<ul type="disc">/,'_* ')
+        c.gsub!(/<\S+?>/,'')
+        c.gsub!(/&lt;(:p[bn])&gt;/,"<\\1>")
+        c.gsub!(/&lt;&lt;(|.?|@|.?|)/,"<<\\1")
+        c.gsub!(/&quot;/,'"')
+        c.gsub!(/ \s+/,' ')
+        @sisu_base << c.strip + "\n\n"
+      end
+    else puts ".kdi extension expected, filename not recognised: << #{kdi} >>"
+    end
+  end
+else puts '.kdi file for conversion to sisu expected'
+end
+sisu_head=<<WOK
+% converted from Kdissert to SiSU
+
+@title: #@title
+
+@prefix: Kdissert mind/topic mapping auto conversion to SiSU markup
+
+@links: {Kdissert}http://freehackers.org/~tnagy/kdissert/
+
+@base_program: kdissert
+
+% @date:
+
+@rcs: $Id$
+
+@level: num_top=1
+
+WOK
+#puts @sisu_base
+@output << sisu_head << @sisu_base
+__END__
similarity index 99%
rename from lib/sisu/v3/modify.rb
rename to data/sisu/v3dv/conf/convert/modify.rb
index 7a1c0441c0281369e5e809c4d0f8046f09179b09..fab7832da1ec53ed498f5331a5c614eda77965ea 100644 (file)
@@ -87,7 +87,7 @@ module SiSU_Modify
        #Extracted.new.modify.modules_and_classes,
        #Extracted.new.modify.modules,
        #Extracted.new.modify.classes,
-        modify.dates,
+       #modify.dates,
        #modify.modules,
        #modify.classes,
        #modify.misc,
diff --git a/data/sisu/v3dv/conf/convert/sisu_convert b/data/sisu/v3dv/conf/convert/sisu_convert
new file mode 100644 (file)
index 0000000..a3a1218
--- /dev/null
@@ -0,0 +1,519 @@
+#!/usr/bin/env ruby
+# = sisu - SiSU information Structuring Universe
+#
+# Copyright (c) Ralph Amissah 1997,2004
+#
+# Ralph Amissah mailto:ralph@amissah.com
+#
+# * Name: SiSU information Structuring Universe
+# * Author: Ralph@Amissah.com
+# * Description: document conversion tool, to sisu from other formats
+# *  License: GPL 3 or later
+# * Notes: word conversion uses wvWare and wvSiSU.xml (a modified/stripped wvHtml.xml)
+#   * http://wvware.sourceforge.net/
+#   * http://sourceforge.net/projects/wvware
+# * <url:sisu.lnk>|sisu.lnk|@|^|
+# * <url:sisu>
+module CONVERT
+  class MyOutput
+    def initialize(data, filename, instruct)
+      @data=data.compact
+      @filename=filename
+      @instruct=instruct
+    end
+    def headerBasic
+      <<WOK
+% SiSU 2.0
+
+@title:
+ :subtitle:
+
+@creator:
+ :author:
+
+@classify:
+ :topic_register:
+
+@date:
+ :published:
+
+@rights:
+ :copyright:
+ :license:
+
+WOK
+    end
+    def headerDefault
+      <<WOK
+% SiSU 2.0
+
+@title:
+ :subtitle:
+
+@creator:
+ :author:
+
+@classify:
+ :topic_register:
+
+@date:
+ :published:
+
+@rights:
+ :copyright:
+ :license:
+
+WOK
+    end
+    def hardOutput
+      pre = Array.new
+      case @instruct
+      when /default/
+        pre << headerDefault
+      else
+        pre << headerBasic
+      end
+      @filename_wv=File.new(%{,,#{@filename}.sst},'w+')
+      @filename_wv << pre
+      @data.each do |x|
+        y = x.split("\n")
+        y.each do |z| # cleaner output this way
+          z.strip!
+          @filename_wv.puts "#{z}\n\n" unless z =~/^$/
+        end
+      end
+    end
+  end
+  class WareWord97
+    def initialize(data, filename, instruct)
+      @data=data
+      @filename=filename
+      @instruct=instruct
+    end
+    def songsheet
+      data=@data
+      print "Convert to SiSU file from Word97 << gvim ,,#{@filename}.sst >\n" #: <<#{@@html_title}>>
+      data=WareWord97.new(data.collect,@filename,@instruct).strip
+      data=WareWord97.new(data.collect,@filename,@instruct).strip
+      data=WareWord97.new(data.collect,@filename,@instruct).markup_rules
+      data=MyOutput.new(data.collect,@filename,@instruct).hardOutput
+    end
+    def strip
+      data=@data
+      tuned_file=Array.new
+      endnote_no=1
+      data.each do |para|
+        para.strip!
+        para.gsub!(/<u>\s*<\/u>/,'')
+        para.gsub!(/<\/u>\s*<u>/,'')
+        para.gsub!(/<b>\s*<\/b>/,'')
+        para.gsub!(/<\/b>\s*<b>/,'')
+        para.gsub!(/<i>\s*<\/i>/,'')
+        para.gsub!(/<\/i>\s*<i>/,'')
+        tuned_file << para unless para == nil
+      end
+      tuned_file
+    end
+    def markup_rules
+      data=@data
+      tuned_file=Array.new
+      endnote_no=1
+      data.each do |para|
+      para.strip!
+        para.gsub!(/\s+/,' ')
+        para.gsub!(/^<b>(Chapter|Article)(.+?)<\/b>/i,'1~ \1 \2') #watch case insensitivity
+        para.gsub!(/^<b>(Part|Section|Book)(.+?)<\/b>/i,':C~ \1 \2') #watch case insensitivity
+        para.gsub!(/^<b>(\d+\.\d+\.\d+\.?)(.+?)<\/b>/i,'3~ \1 \2') #numeric, decide what to do, can be different
+        para.gsub!(/^<b>(\d+\.\d+\.?)(.+?)<\/b>/i,'2~ \1 \2') #numeric, decide what to do, can be different
+        para.gsub!(/^<b>(\d.+?)<\/b>/i,'4~ \1 \2') #numeric, decide what to do, can be different
+        #para.gsub!(/^<b>([\d.]+?)<\/b>/i,'4~ \1 \2') #numeric, decide what to do, can be different
+        para.gsub!(/<u>(.+?)<\/u>/,'_{\1}_')
+        para.gsub!(/<b>(.+?)<\/b>/,'!{\1}!')
+        para.gsub!(/<i>(.+?)<\/i>/,'/{\1}/')
+        tuned_file << para unless para == nil
+      end
+      tuned_file
+    end
+  end
+  class Html
+    def initialize(data, filename, instruct)
+      @data=data
+      @filename=filename
+      @instruct=instruct
+    end
+    def songsheet
+      data=@data
+      print "Convert to SiSU file from #{@filename}.html << gvim ,,#{@filename}.sst >\n" #: <<#{@@html_title}>>
+      #data=Html.new(data.collect, @filename, @instruct).space_paragraphs
+      #data=Html.new(data.split(''), @filename, @instruct).space_paragraphs
+      data=Html.new(data.join.split(/\n\n+/), @filename, @instruct).space_paragraphs
+      #data=Html.new(data.split("\n"), @filename, @instruct).space_paragraphs
+      #data=Html.new(data.collect.join.split("\n"), @filename, @instruct).space_paragraphs
+      data=Html.new(data.collect, @filename, @instruct).multiline
+      data=Html.new(data.collect.join.split("\n\n"), @filename, @instruct).markup_rules
+      data=MyOutput.new(data.collect, @filename, @instruct).hardOutput
+    end
+    def space_paragraphs
+      #data=@data.join.split(/\n/)
+      data=@data
+      #p data.length
+      tuned_file=Array.new
+      data.each do |para|
+      para.strip!
+        para.gsub!(/\r/,'')
+        #para.gsub!(/\n/, ' ') #PROBLEM, serious time issues on a few files also for \n (or multiline matches which is less surprising), edit out if necessary
+        para.gsub!(/<\/?p>/i,'zZz')
+        para.gsub!(/<\/?\s*p(?:\s+ALIGN=.+?)?>/i,'zZz') #all manner of <p> para.gsub!(/<\/?p>/i, "\n\n")
+        para.gsub!(/<p\s+(class|align).+?>/i,'zZz') #
+        para.gsub!(/<\/p>/i,'zZz') # repeat actually
+        para.gsub!(/<(?:dir|tr|br)>/i,'zZz') #
+        #para.gsub!(/<(?:\/\s*)?(?:dir|tr|br)>/i, "zZz") #
+        para.gsub!(/(<\/center>)/i,'\1zZz')
+        para.gsub!(/(<\/h[1-6]>)/i,'\1zZz')
+        para.gsub!(/ \s+/i,' ')
+        para.gsub!(/(?:\s*zZz\s*)+/i,'zZz') #
+        tuned_file << para unless para == nil
+      end
+      tuned_file
+    end
+    def blockquotes(sub='') # SERIOUS PROBLEM INTRODUCED, some blockquotes go missing !, quite unacceptable, debug, for now not used
+      res=Array.new
+      sub.each do |x|
+        if x=~/(<\/blockquote>)/i
+          m = $1
+          res << x[/(.+?)#{m}/mi,1].gsub!(/zZz/,'zZz_1 ') if x =~/.+?#{m}/mi
+          res << x[/#{m}(.+)/mi,1]
+        else
+          res << x #[/(.+)/mi,1]
+        end
+      end
+      res.join
+    end
+    def multiline
+      data=@data
+      tuned_file=Array.new
+      data.each do |para|
+        para.gsub!(/\n/,' ')
+        para.gsub!(/ \s+/mi,' ')
+       #ALL HERE could be very time EXPENSIVE but tamed? compromise ... /mi
+        para.gsub!(/<([biu]|h[1-6])>(?:zZz)?([^<]+)?zZz(.+?)<\/\1>/i,'zZz<\1>\2 \3</\1>')
+        para.gsub!(/<([biu]|h[1-6])>(?:<center>|zZz)+(.+?)(?:<\/center>)?zZz(.+?)?<\/\1>/i,'zZz<\1>\2 \3</\1>')
+        #para.gsub!(/<([biu]|h[1-6])>(?:<center>|zZz)+(.+?)<\/center>zZz(.+?)?<\/\1>/i,'zZz<\1>\2 \3</\1>')
+        para.gsub!(/<([biu]|h[1-6])>(?:<center>|zZz)+(.+?)<\/\1>/i,'zZz<\1>\2</\1>')
+        para.gsub!(/<(h[1-6])>(.+?)(?:<center>|zZz)+<\/\1>/i,'zZz<\1>\2</\1>zZz') #does catch some h1, h2 etc, too expensive to have biu
+        #para.gsub!(/<([biu]|h[1-6])>(.+?)(?:<center>|zZz)+<\/\1>/i,'zZz<\1>\2 \3</\1>') #may go too far? useful for h1 h2 etc, remove biu?
+        #para.gsub!(/<([biu]|h[1-6])>([^<]+)?zZz(.+?)<\/\1>/i,'zZz<\1>\2 \3</\1>')
+        #para.gsub!(/<([biu]|h[1-6])>([^<]+)?zZz(.+?)<\/\1>/i,'zZz<\1>\2 \3</\1>')
+       ### SERIOUS PROBLEM INTRODUCED
+       # sub = para.split(/<blockquote>/i)
+       # para = blockquotes(sub) if sub.length > 0 #check was on >1 could have serious repercussions 2004w29
+        para.gsub!(/zZz(\s*zZz)*/,"\n\n")
+        tuned_file << para << "\n\n" unless para == nil
+      end
+      tuned_file
+    end
+    def markup_rules
+      @@flag_blockquote=false
+      data=@data
+      tuned_file=Array.new
+      data.each do |para|
+        if para=~/<a href="(http:\/\/.+?)">/i
+          #p para.grep(/<a href="(http:\/\/.+?)">/i)
+          #m=$1
+          #para.gsub!(/(?:&lt;\s*)?<a href="#{m}">#{m}<\/a>(?:\s*&gt;)?\.?/i, "#{m}")
+          para.gsub!(/(?:&lt;\s*)?<a href="(http:\/\/.+?)">http:\/\/.+?<\/a>(?:\s*&gt;)?\.?/i,'\1') #risk that url & url are not to match
+          #para.gsub!(/(?:&lt;\s*)?<a href="(\w+\.html)">(http:\/\/.+?\/\1)<\/a>(?:\s*&gt;)?\.?/i, "\\2") #does not match
+        end
+        if para=~/<BLOCKQUOTE>/i
+          @@flag_blockquote=true
+        end
+        if @@flag_blockquote
+          para.gsub!(/^/,'_1 ') unless para.empty? or para =~/^\s*<\/?blockquote?>\s*$/i
+        end
+        if para=~/<\/BLOCKQUOTE>/i
+          @@flag_blockquote=false
+        end
+        para.gsub!(/<\/?blockquote?>/i,'')
+        ### clean
+        para.gsub!(/^\s+/i,'')
+        para.gsub!(/<([bui]|em|su[pb])>\s*<\/\1>/i,'')
+        para.gsub!(/<\/?center>/i,'')
+        para.gsub!(/\s*<\/dir>/i,'')
+        para.gsub!(/<hr>/i,'')
+        para.gsub!(/\s*<a href=".+?\.html#(?:[a-z_]+)?(?:[a-z0-9_-]|\*)+">\[(\*+)\]<\/a>/i,'^{[\1]}^ ') #other endnote marker
+        para.gsub!(/<a href=".+?\.html#(?:[a-z_$]+)?[0-9_-]+"(?:\s+name=".+?")?>\[[a-z]?\d+\](?:<\/[bi]>)?<\/a>/i,'~^ ') #endnote marker
+        para.gsub!(/<a name=".+?"\s+href=".+?\.html#(?:[a-z_$]+)?[0-9_-]+"?>\[[a-z]?\d+\](?:<\/[bi]>)?<\/a>/i,'~^ ') #endnote marker
+        para.gsub!(/<a name="(?:[a-z$]+)?[0-9_-]+">\s*(<\/a>)?\s*\d+\.?\s*(<\/a>)?\s*/i,'^~ ') #endnote
+        #para.gsub!(/<h([1-6])>\s*(.+?)\s*<\/h\1>\s*/i,'\1~ \2') #
+        para.gsub!(/<h([1-6])(?: align=.+?)?>\s*(.+?)\s*<\/h\1>\s*/i,'\1~ \2') #
+        para.gsub!(/^<b>(Chapter|Article)(.+?)<\/b>/i,'4~ \1 \2') #watch case insensitivity
+        para.gsub!(/^<b>(Part|Section|Book)(.+?)<\/b>/i,'3~ \1 \2') #watch case insensitivity
+        para.gsub!(/^<b>(\d+\.\d+\.\d+\.?)(.+?)<\/b>/i,'6~ \1 \2') #numeric, decide what to do, can be different
+        para.gsub!(/^<b>(\d+\.\d+\.?)(.+?)<\/b>/i,'5~ \1 \2') #numeric, decide what to do, can be different
+        para.gsub!(/^<b>(\d+\.?)(.+?)<\/b>/i,'4~ \1 \2') #numeric, decide what to do, can be different
+        #<a name="ii"></a><B>
+        para.gsub!(/^(<a name=".+?">)(?:<small>)?<(?:b|strong)>\s*(.+?)\s*<\/(?:b|strong)>/i,'5~ \2 \1') #watch
+        para.gsub!(/^(<(a name|A NAME)=".+?">)(\s*|<\/[aA]>)?([A-Z][A-Z])+/,'5~ \2 \1') #watch
+        para.gsub!(/^(\s+|<p>)?(<a name=".+?">)(\s*|<\/a>)?<b>/i,'5~ \2 \1') #watch
+        para.gsub!(/<h([1-6])>\s*(.+?)\s*<\/h\1>\s*/i,'\1~ \2') #
+        para.gsub!(/^<b>\s*(.+?)<\/b>\s*(<\/i>\s*)?$/i,'4~ \1\2') # wish it all were less messy
+        para.gsub!(/^<i>\s*([^"(].+?)<\/i>\s*(<\/b>\s*)?$/i,'5~ \1\2') # wish it all were less messy
+        para.gsub!(/<\/?[biu]>/i,'') if para =~/[1-6]\{/
+        para.gsub!(/<u>\s*(.+?)\s*<\/u>/i,'_{\1}_')
+        para.gsub!(/<(b|strong)>\s*(.+?)\s*<\/\1>/i,'*{\2}*')
+        para.gsub!(/<(i|em)>\s*(.+?)\s*<\/\1>/i,'/{\2}/')
+        para.gsub!(/<sup>\s*(.+?)\s*<\/sup>/i,'^{\1}^')
+        para.gsub!(/(([\/\*!_])\{.+?\}\2)\s\s+/i,'\1 ')
+        para.gsub!(/(([\/\*!_])\{.+?\}\2)\s+([.,;?\)])\s+/i,'\1\3 ')
+        para.gsub!(/(([\/\*!_])\{.+?\}\2)(["'])\s+/i,'\1\3 ')
+        para.gsub!(/(([\/\*!_])\{.+?\}\2)\s*([a-z0-9])/i,'\1 \3')
+        para.gsub!(/(([\/\*_])\{.+?\}\2)\s*([a-z0-9])/i,'\1 \3')
+        para.gsub!(/([a-z0-9])(([\/\*_])\{.+?\}\3)/i,' \1 \2') #eg this/{problem}/
+        para.gsub!(/([\/\*_])\{([,.;; ]+)\}\1/i,'\2') #eg /{,}/ or *{ }* etc.
+        para.gsub!(/ \s+/i,' ')
+        #para.gsub!(/\/\{\*\{/i, '*{/{')
+        #para.gsub!(/\}\*\}\//i, '}/}*')
+        para.gsub!(/&quot;/i,'"')
+        para.gsub!(/&amp;/i,'and')
+        para.gsub!(/<!doctype html public .+/i,'')
+        para.gsub!(/<\/?(?:html|head|body|font|small)>/i,'')
+        para.gsub!(/<\/(?:title)>/i,'')
+        para.gsub!(/<title>/i,'#{~title? ')
+        para.gsub!(/<blockquote>(.+?)<\/blockquote>/mi,"\n\n_1 \\1\n\n")
+        para.gsub!(/<div align=.+?>|<\/div>|<font size=.+?>|<\/a><\/em><\/strong>/i,'')
+        para.gsub!(/~^\s+\.\s*/i,'.~^ ') #check vim equiv # %s/\~e\s\+\.\s*/.\~e /c
+        para.gsub!(/\s+~^\s+/i,'~^ ')
+        para.gsub!(/ \s+/i,' ')
+        para.gsub!(/\s+$/i,'')
+        para.gsub!(/^(?:<\/[bi]>)+$/i,'')
+        para.gsub!(/^(?:(?:<i>)+<b>|(?:<b>)+<i>)\s*([^"(].+?)/i,'5~ \1\2') # wish it all were less messy
+        para.gsub!(/^(?:<\/?(?:[ib]|em)>\s*)+$/i,'') # cleaning up left over <i> etc.
+        para.gsub!(/<(?:i|em)>\s*(.+)/i,'/{\1}/') # using up left over <i>
+        para.gsub!(/<b>\s*(.+)/i,'*{\1}*') # using up left over <b>
+        para.gsub!(/<dd>([\d.]+)/i,'5~ \1')
+        para.gsub!(/<dd>(?:&nbsp;)+([\d.]+)/i,'6~ \1')
+        para.gsub!(/<dd>(\([a-z]\))/i,'7~ \1')
+        para.gsub!(/^([1-9]~)( .+?)<a name="(\S+?)">(.+?)(<\/a>)/i,'\1\3\2\4')
+        para.gsub!(/^([1-9]~)( .+?)<a name="(\S+?)">/i,'\1\3\2')
+        para.gsub!(/http\/\/(\S+)/i,'http:\/\/\1')
+        para.gsub!(/\s*<a href="\S+?">(http:\/\/\S+?)<\/a>\s*/i,' \1 ')
+        para.gsub!(/([a-zA-Z.,!?;:])([*\/_-]\{)/,'\1 \2')
+        para.gsub!(/^\s*(&nbsp;){10,12}/i,'_2 ')
+        para.gsub!(/^\s*(&nbsp;){4,5}/i,'_1 ')
+        para.gsub!(/&#9;/,' ') #check
+        ## glyphs & tildes
+        para.gsub!(/&iexcl;/,  '¡') #'Inverted exclamation
+        para.gsub!(/&cent;/,   '¢') #'Cent sign               ¢
+        para.gsub!(/&pound;/,  '£') #'Pound sign              £
+        para.gsub!(/&curren;/, '¤') #'General currency sign
+        para.gsub!(/&yen;/,    '¥') #'Yen sign                ¥
+        para.gsub!(/&brvbar;/, '¦') #'Broken vertical bar
+        para.gsub!(/&sect;/,   '§') #'Section sign            §
+        para.gsub!(/&uml;/,    '¨') #'Umlaut
+        para.gsub!(/&copy;/,   '©') #'Copyright               ©
+        para.gsub!(/&ordf;/,   'ª') #'Feminine ordinal        ª
+        para.gsub!(/&laquo;/,  '«') #'Left angle quote        «
+        para.gsub!(/&not;/,    '¬') #'Not sign
+        para.gsub!(/&shy;/,    '­') #'Soft hyphen
+        para.gsub!(/&reg;/,    '®') #'Registered trademark    ®
+        para.gsub!(/&macr;/,   '¯') #'Macron accent
+        para.gsub!(/&deg;/,    '°') #'Degree sign             °
+        para.gsub!(/&plusmin;/,'±') #'Plus or minus           ±
+        para.gsub!(/&sup2;/,   '²') #'Superscript 2           ²
+        para.gsub!(/&sup3;/,   '³') #'Superscript 3           ³
+        para.gsub!(/&acute;/,  '') #'Acute accent
+        para.gsub!(/&micro;/,  'µ') #'Micro sign (Greek mu)   µ
+        para.gsub!(/&para;/,   '¶') #'Paragraph sign          ¶
+        para.gsub!(/&middot;/, '·') #'Middle dot
+        para.gsub!(/&cedil;/,  '¸') #'Cedilla
+        para.gsub!(/&sup1;/,   '¹') #'Superscript 1           ¹
+        para.gsub!(/&ordm;/,   'º') #'Masculine ordinal       º
+        para.gsub!(/&raquo;/,  '»') #'Right angle quote
+        para.gsub!(/&frac14;/, '¼') #'Fraction one quarter    ¼
+        para.gsub!(/&frac12;/, '½') #'Fraction on half        ½
+        para.gsub!(/&frac34;/, '¾') #'Fraction three quarters ¾
+        para.gsub!(/&iquest;/, '¿') #'Inverted question mark  ¿
+        para.gsub!(/&Agrave;/, 'À') #'Capital A, grave accent À
+        para.gsub!(/&Aacute;/, 'Á') #'Capital A, acute accent Á
+        para.gsub!(/&Acirc;/,  'Â') #'Capital A, circumflex accent Â
+        para.gsub!(/&Atilde;/, 'Ã') #'Capital A, tilde        Ã
+        para.gsub!(/&Auml;/,   'Ä') #'Capital A, umlaut       Ä
+        para.gsub!(/&Aring;/,  'Å') #'Capital A, ring         Å
+        para.gsub!(/&AElig;/,  'Æ') #'Capital AE ligature     Æ
+        para.gsub!(/&Ccedil;/, 'Ç') #'Capital C, cedilla      Ç
+        para.gsub!(/&Egrave;/, 'È') #'Capital E, grave accent È
+        para.gsub!(/&Eacute;/, 'É') #'Capital E, acute accent É
+        para.gsub!(/&Ecirc;/,  'Ê') #'Capital E, circumflex accent Ê
+        para.gsub!(/&Euml;/,   'Ë') #'Capital E, umlaut       Ë
+        para.gsub!(/&Igrave;/, 'Ì') #'Capital I, grave accent Ì
+        para.gsub!(/&Iacute;/, 'Í') #'Capital I, acute accent Í
+        para.gsub!(/&Icirc;/,  'Î') #'Capital I, circumflex accent Î
+        para.gsub!(/&Iuml;/,   'Ï') #'Capital I, umlaut       Ï
+        para.gsub!(/&ETH;/,    'Ð') #'Capital eth, Icelandic
+        para.gsub!(/&Ntilde;/, 'Ñ') #'Capital N, tilde        Ñ
+        para.gsub!(/&Ograve;/, 'Ò') #'Capital O, grave accent Ò
+        para.gsub!(/&Oacute;/, 'Ó') #'Capital O, acute accent Ó
+        para.gsub!(/&Ocirc;/,  'Ô') #'Capital O, circumflex accent Ô
+        para.gsub!(/&Otilde;/, 'Õ') #'Capital O, tilde        Õ
+        para.gsub!(/&Ouml;/,   'Ö') #'Capital O, umlaut       Ö
+        para.gsub!(/&times;/,  '×') #'Multiply sign           ×
+        para.gsub!(/&Oslash;/, 'Ø') #'Capital O, slash        Ø
+        para.gsub!(/&Ugrave;/, 'Ù') #'Capital U, grave accent Ù
+        para.gsub!(/&Uacute;/, 'Ú') #'Capital U, acute accent Ú
+        para.gsub!(/&Ucirc;/,  'Û') #'Capital U, circumflex accent Û
+        para.gsub!(/&Uuml;/,   'Ü') #'Capital U, umlaut       Ü
+        para.gsub!(/&Yacute;/, 'Ý') #'Capital Y, acute accent Ý
+        para.gsub!(/&THORN;/,  'Þ') #'Capital thorn, Icelandic     Þ
+        para.gsub!(/&szlig;/,  'ß') #'Small sz ligature, German    ß
+        para.gsub!(/&agrave;/, 'à') #'Small a, grave accent   à
+        para.gsub!(/&aacute;/, 'á') #'Small a, acute accent   á
+        para.gsub!(/&acirc;/,  'â') #'Small a, circumflex accent   â
+        para.gsub!(/&atilde;/, 'ã') #'Small a, tilde          ã
+        para.gsub!(/&auml;/,   'ä') #'Small a, umlaut         ä
+        para.gsub!(/&aring;/,  'å') #'Small a, ring           å
+        para.gsub!(/&aelig;/,  'æ') #'Small ae ligature       æ
+        para.gsub!(/&ccedil;/, 'ç') #'Small c, cedilla        ç
+        para.gsub!(/&egrave;/, 'è') #'Small e, grave accent   è
+        para.gsub!(/&eacute;/, 'é') #'Small e, acute accent   é
+        para.gsub!(/&ecirc;/,  'ê') #'Small e, circumflex accent   ê
+        para.gsub!(/&euml;/,   'ë') #'Small e, umlaut         ë
+        para.gsub!(/&igrave;/, 'ì') #'Small i, grave accent   ì
+        para.gsub!(/&iacute;/, 'í') #'Small i, acute accent   í
+        para.gsub!(/&icirc;/,  'î') #'Small i, circumflex accent   î
+        para.gsub!(/&iuml;/,   'ï') #'Small i, umlaut         ï
+        para.gsub!(/&eth;/,    'ð') #'Small eth, Icelandic    ð
+        para.gsub!(/&ntilde;/, 'ñ') #'Small n, tilde          ñ
+        para.gsub!(/&ograve;/, 'ò') #'Small o, grave accent   ò
+        para.gsub!(/&oacute;/, 'ó') #'Small o, acute accent   ó
+        para.gsub!(/&ocirc;/,  'ô') #'Small o, circumflex accent   ô
+        para.gsub!(/&otilde;/, 'õ') #'Small o, tilde          õ
+        para.gsub!(/&ouml;/,   'ö') #'Small o, umlaut         ö
+        para.gsub!(/&divide;/, '÷') #'Divide sign             ÷
+        para.gsub!(/&oslash;/, 'ø') #'Small o, slash          ø
+        para.gsub!(/&ugrave;/, 'ù') #'Small u, grave accent   ù
+        para.gsub!(/&uacute;/, 'ú') #'Small u, acute accent   ú
+        para.gsub!(/&ucirc;/,  'û') #'Small u, circumflex accent   û
+        para.gsub!(/&uuml;/,   'ü') #'Small u, umlaut         ü
+        para.gsub!(/&yacute;/, 'ý') #'Small y, acute accent   ý
+        para.gsub!(/&thorn;/,  'þ') #'Small thorn, Icelandic  þ
+        para.gsub!(/&yuml;/,   'ÿ') #'Smally y, umlaut        ÿ
+        ##
+        para.gsub!(/\s\s+/,' ')
+        para.gsub!(/\t+/,' ')
+        #para.gsub!(/  +/,' ')
+        #para.gsub!(/^(?:<(?:\/)?[bi]>)+$/i, '')
+        tuned_file << para unless para == nil
+      end
+      tuned_file
+    end
+  end
+  class Default < Html
+    def initialize(data, filename, instruct)
+      @data=data
+      @filename=filename
+      @instruct=instruct
+    end
+    def songsheet
+      data=@data
+      print "Convert to SiSU file from #{@filename}.html << gvim ,,#{@filename}.sst >\n" #: <<#{@@html_title}>>
+      data=Default.new(data.collect, @filename, @instruct).space_paragraphs
+      data=Default.new(data.collect, @filename, @instruct).multiline
+      data=Default.new(data.collect.join.split("\n\n"), @filename, @instruct).markup_rules
+      data=Default.new(data.collect, @filename, @instruct).markup_default
+      data=MyOutput.new(data.collect, @filename, @instruct).hardOutput
+    end
+    def markup_default
+      data=@data
+      tuned_file=Array.new
+      data.each do |para|
+        para.gsub!(/<i>(Id\.?)(\s|$)/i,'/\{\1\}\2/')
+        para.gsub!(/^(~\{\{ .+?)(<\/LI>\s*|<\/OL>\s*)+$/i,'\1')
+        para.gsub!(/\/\{Id\.\s*<\/LI>\s*\}\//i,'/{Id.}/')
+        tuned_file << para unless para == nil
+      end
+      tuned_file
+    end
+  end
+end
+def help
+      puts <<WOK
+conversion program
+initial SiSU markup from other file formats
+
+  zxy_convert --word    does initial conversion from word97 to sisu markup, expects [filename].doc (can also use --doc)
+  zxy_convert --html    does initial conversion from html to sisu markup, expects [filename].html
+  zxy_convert --default does initial conversion from defalt html to sisu markup, expects [filename].html
+
+WOK
+end
+def do_word(argv, instruct)
+  argv.each do  |f|
+    if f =~/.+?\.doc$/
+      @argv << f[/(.+?)\.doc$/, 1]
+    else
+      print "not .doc? << #{f} >> "
+    end
+  end
+  @argv.each do |filename|
+    system(%{wvWare -x #{@dir.path.home}/.sisu/convert/wvSiSU.xml #{filename}.doc > #{filename}.wv})
+    file_array=IO.readlines("#{filename}.wv", "")
+    CONVERT::WareWord97.new(file_array, filename, instruct).songsheet # metaverse created here
+  end
+end
+def do_html(argv, instruct)
+  argv.each do  |f|
+    if f =~/.+?\.html?$/
+      @argv << f[/(.+?)\.html?$/, 1]
+    else
+      print "not .html? << #{f} >> "
+    end
+  end
+  @argv.each do |filename|
+    file_end=if FileTest.file?("#{filename}.html")
+      'html'
+    elsif  FileTest.file?("#{filename}.htm")
+      'htm'
+    end
+    file_array=IO.readlines("#{filename}.#{file_end}","\n\r")
+    CONVERT::Html.new(file_array,filename,instruct).songsheet # metaverse created here
+  end
+end
+def do_default(argv, instruct)
+  argv.each do  |f|
+    if f =~/.+?\.html$/
+      @argv << f[/(.+?)\.html$/, 1]
+    else
+      print "not .html? << #{f} >> "
+    end
+  end
+  @argv.each do |filename|
+    file_array=IO.readlines("#{filename}.html", "\n\r")
+    CONVERT::Default.new(file_array, filename, instruct).songsheet # metaverse created here
+  end
+end
+def cases(argv, instruct)
+  case instruct
+  when/^--(word(97)?|doc)$/i #creates minimal sisu_small.gz package to send
+      do_word(argv, instruct)
+  when/^--(html)$/i #creates sisu.gz package to send
+      do_html(argv, instruct)
+  when/^--(default)$/i #creates sisu.gz package to send
+      do_default(argv, instruct)
+  else
+      help
+  end
+end
+$KCODE='u'
+branch='v2'
+@argv=Array.new
+argv=$*
+SiSU_version_dir=(argv.inspect=~/--v1/) ? 'v1' : 'v2'
+SiSU_lib="sisu/#{SiSU_version_dir}"
+require "#{SiSU_lib}/sysenv"
+include SiSU_Env
+@dir=SiSU_Env::Info_env.new
+instruct = "#{argv[0].to_s}"
+argv.shift
+instruct.chomp!
+instruct = "help" if instruct.nil? or instruct == "";
+cases(argv, instruct)
diff --git a/data/sisu/v3dv/conf/convert/wvHtml.xml b/data/sisu/v3dv/conf/convert/wvHtml.xml
new file mode 100644 (file)
index 0000000..3cc9dd2
--- /dev/null
@@ -0,0 +1,388 @@
+<main>
+<charentity>
+<begin>HTML</begin>
+</charentity>
+
+<document>
+<begin>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/REC-html40/loose.dtd&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html; charset=<charset/>&quot;&gt;
+&lt;META NAME=&quot;GENERATOR&quot; CONTENT=&quot;wvWare/<version/>&quot;&gt;
+&lt;title&gt;
+<title/>
+&lt;/title&gt;
+&lt;/head&gt;
+&lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; link=&quot;#0000ee&quot; vlink=&quot;#551a8b&quot;&gt;
+</begin>
+<end>
+&lt;!--
+&lt;hr&gt;
+&lt;address&gt;
+&lt;a href=&quot;http://wvware.sourceforge.net/&quot;&gt;&lt;img
+src=&quot;wvSmall.gif&quot; height=31 width=47
+align=left border=0 alt=&quot;wvWare&quot;&gt;&lt;/a&gt;
+&lt;a href=&quot;http://validator.w3.org/check/referer&quot;&gt;&lt;img
+src=&quot;vh40.gif&quot; height=31 width=88
+align=right border=0 alt=&quot;Valid HTML 4.0!&quot;&gt;&lt;/a&gt;
+Document created with &lt;a href=&quot;http://wvware.sourceforge.net/&quot;&gt;wvWare/<version/>&lt;/a&gt;&lt;br&gt;
+&lt;/address&gt;
+--&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</end>
+</document>
+
+<section>
+<begin>
+&lt;!--Section Begins--&gt;&lt;br&gt;
+</begin>
+<end>
+&lt;!--Section Ends--&gt;
+</end>
+</section>
+
+<justification>
+<left>left</left>
+<right>right</right>
+<center>center</center>
+<block>left</block>
+<asian>&lt;!--Could Someone who sees this tag tell me what was is this type of justification, asian languages only i thing--&gt;</asian>
+</justification>
+
+<numbering>
+<Arabic>type=&quot;1&quot;</Arabic>
+<UpperRoman>type=&quot;I&quot;</UpperRoman>
+<LowerRoman>type=&quot;i&quot;</LowerRoman>
+<UpperCaseN>type=&quot;A&quot;</UpperCaseN>
+<LowerCaseN>type=&quot;a&quot;</LowerCaseN>
+</numbering>
+
+<border>
+<noned>none</noned>
+<singled>solid</singled>
+<thickd>solid</thickd>
+<doubled>double</doubled>
+<number4d>double</number4d>
+<hairlined>solid</hairlined>
+<dotd>dotted</dotd>
+<dashlargegapd>dashed</dashlargegapd>
+<dotdashd>dotted</dotdashd>
+<dotdotdashd>dotted</dotdotdashd>
+<tripled>double</tripled>
+<thin-thicksmallgapd>dashed</thin-thicksmallgapd>
+<thick-thinsmallgapd>dashed</thick-thinsmallgapd>
+<thin-thick-thinsmallgapd>dashed</thin-thick-thinsmallgapd>
+<thin-thickmediumgapd>dashed</thin-thickmediumgapd>
+<thick-thinmediumgapd>dashed</thick-thinmediumgapd>
+<thin-thick-thinmediumgapd>dashed</thin-thick-thinmediumgapd>
+<thin-thicklargegapd>dashed</thin-thicklargegapd>
+<thick-thinlargegapd>dashed</thick-thinlargegapd>
+<thin-thick-thinlargegapd>dashed</thin-thick-thinlargegapd>
+<waved>solid</waved>
+<doublewaved>double</doublewaved>
+<dashsmallgapd>sashed</dashsmallgapd>
+<dashdotstrokedd>dashed</dashdotstrokedd>
+<emboss3Dd>ridge</emboss3Dd>
+<engrave3Dd>groove</engrave3Dd>
+<defaultd>ridge</defaultd>
+</border>
+
+<!-- <begin>&lt;ol <nfc/> start=&quot;<start/>&quot;&gt; -->
+<olist>
+<begin>&lt;ol <nfc/>&gt;
+</begin>
+<end>&lt;/ol&gt;</end>
+</olist>
+
+<ulist>
+<begin>&lt;ul&gt;
+</begin>
+<end>&lt;/ul&gt;</end>
+</ulist>
+
+<!-- <begin>&lt;li&gt;</begin> -->
+<entry>
+<begin>&lt;li value=&quot;<start/>&quot;&gt;</begin>
+<end>&lt;/li&gt;</end>
+</entry>
+
+
+<!--
+this tableoverride option can be used to turn off handling of
+these tags in tables, which I find is necessary for at least netscape
+-->
+<tableoverrides>
+<ParaBefore>0</ParaBefore>
+<ParaRight>0</ParaRight>
+<ParaAfter>0</ParaAfter>
+<ParaLeft>0</ParaLeft>
+<ParaLeft1>0</ParaLeft1>
+<VertMergedCells>0</VertMergedCells>
+</tableoverrides>
+
+<table>
+<begin>&lt;table width=&quot;<tablerelwidth/>%&quot; border=&quot;1&quot; cols=&quot;<no_cols/>&quot; rows=&quot;<no_rows/>&quot;&gt;</begin>
+<end>&lt;/table&gt;</end>
+</table>
+
+<row>
+<begin>&lt;tr&gt;</begin>
+<end>&lt;/tr&gt;</end>
+</row>
+
+<cell>
+<begin>&lt;td bgcolor=&quot;<cellbgcolor/>&quot; width=&quot;<cellrelwidth/>%&quot; rowspan=&quot;<rowspan/>&quot; colspan=&quot;<colspan/>&quot;&gt;</begin>
+<end>&lt;/td&gt;</end>
+</cell>
+
+<paragraph>
+<begin>
+<table.end/>
+<table.begin/>
+<row.begin/><cell.begin/><olist.end/><olist.begin/><ulist.end/><ulist.begin/><entry.begin/><text.begin/>
+</begin>
+<end>
+<text.end/><entry.end/><olist.end/><ulist.end/><cell.end/><row.end/>
+</end>
+</paragraph>
+
+<!-- these are all the character properties that can show up in word -->
+<bold><begin>&lt;b&gt;</begin><end>&lt;/b&gt;</end></bold>
+<italic><begin>&lt;i&gt;</begin><end>&lt;/i&gt;</end></italic>
+
+<!--
+text that has been deleted and will be displayed with strikethrough when
+revision marked text is to be displayed
+
+use either this line...
+-->
+<RMarkDel><begin>&lt;s&gt;</begin><end>&lt;/s&gt;&lt;a href=&quot;#author<ibstRMarkDel/>&quot;&gt;[Author ID<ibstRMarkDel/>: at <dttmRMarkDel/> ]&lt;/a&gt;</end></RMarkDel>
+
+<!--
+or uncomment below to make deleted text dissappear (well, become commented out)
+-->
+<!--
+<RMarkDel><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></RMarkDel>
+-->
+
+<!-- Overwriting char props. like CaPs->CAPS SmallCaps->smallcaps -->
+<outline><begin></begin><end></end></outline>
+<smallcaps><begin>&lt;span style=&quot;text-transform:lowercase&quot;&gt;</begin><end>&lt;/span&gt;</end></smallcaps>
+<caps><begin>&lt;span style=&quot;text-transform:uppercase&quot;&gt;</begin><end>&lt;/span&gt;</end></caps>
+<vanish><begin></begin><end></end></vanish>
+
+<!--If you uncomment this then the annotation text links will become commented out by html tags-->
+<!--
+<vanish><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></vanish>
+-->
+
+<!--
+text that has been newly typed since the last time revision marks have been accepted
+and will be displayed with underline when revision marked text is to be displayed
+
+use either this line...
+-->
+<RMark><begin>&lt;u&gt;</begin><end>&lt;/u&gt;&lt;a href=&quot;#author<ibstRMark/>&quot;&gt;[Author ID<ibstRMark/>: at <dttmRMark/>]&lt;/a&gt;</end></RMark>
+
+<!--
+or uncomment below to make the underline dissappear
+-->
+<!--
+<RMark><begin></begin><end></end></RMark>
+-->
+
+
+<strike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></strike>
+<shadow><begin></begin><end></end></shadow>
+<lowercase><begin></begin><end></end></lowercase>
+<emboss><begin></begin><end></end></emboss>
+<imprint><begin></begin><end></end></imprint>
+<!--double strike-->
+<dstrike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></dstrike>
+
+<!--
+ftc's
+&
+hps
+
+keep them for font face and do that later.
+-->
+
+<super><begin>&lt;sup&gt;</begin><end>&lt;/sup&gt;</end></super>
+<sub><begin>&lt;sub&gt;</begin><end>&lt;/sub&gt;</end></sub>
+
+<singleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></singleu>
+<wordu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></wordu>
+<doubleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></doubleu>
+<dottedu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dottedu>
+<hiddenu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></hiddenu>
+<thicku><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></thicku>
+<dashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dashu>
+<dotu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotu>
+<dotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdashu>
+<dotdotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdotdashu>
+<waveu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></waveu>
+
+<!--
+text whose properties have been changed since the last time revision marks have been accepted
+and will be displayed with a note showing the change points.
+
+use either this line (which admit it a bit scary looking, but harmless)...
+-->
+<PropRMark><begin>&lt;a href=&quot;#author<ibstPropRMark/>&quot;&gt;-&#45;&amp;gt;&lt;/a&gt;</begin><end>&lt;a href=&quot;#author<ibstPropRMark/>&quot;&gt;[Author ID<ibstPropRMark/>: at <dttmPropRMark/>]&lt;/a&gt;</end></PropRMark>
+
+<!--
+or uncomment below to make the notes dissappear
+-->
+<!--
+<PropRMark><begin></begin><end></end></PropRMark>
+-->
+
+<!--
+<color>
+-->
+<Black><begin>Black</begin><end></end></Black>
+<Blue><begin>Blue</begin><end></end></Blue>
+<Cyan><begin>Cyan</begin><end></end></Cyan>
+<Green><begin>Green</begin><end></end></Green>
+<Magenta><begin>Magenta</begin><end></end></Magenta>
+<Red><begin>Red</begin><end></end></Red>
+<Yellow><begin>Yellow</begin><end></end></Yellow>
+<White><begin>White</begin><end></end></White>
+<DkBlue><begin>DarkBlue</begin><end></end></DkBlue>
+<DkCyan><begin>DarkCyan</begin><end></end></DkCyan>
+<DkGreen><begin>DarkGreen</begin><end></end></DkGreen>
+<DkMagenta><begin>DarkMagenta</begin><end></end></DkMagenta>
+<DkRed><begin>DarkRed</begin><end></end></DkRed>
+<DkYellow><begin>#8b8b00</begin><end></end></DkYellow>
+<DkGray><begin>DarkGray</begin><end></end></DkGray>
+<LtGray><begin>LightGrey</begin><end></end></LtGray>
+<!--
+</color>
+-->
+
+<!--
+<animation>
+-->
+<LasVegas><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></LasVegas>
+<BackgroundBlink><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></BackgroundBlink>
+<SparkleText><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></SparkleText>
+<MarchingAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingAnts>
+<MarchingRedAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingRedAnts>
+<Shimmer><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></Shimmer>
+<!--
+</animation>
+-->
+
+<!--
+I dont understand what this one is, and ive never come across it
+
+use this sample line (which admit it a bit scary looking, but harmless)...
+-->
+<DispFldRMark><begin>&lt;a href=&quot;#author<ibstDispFldRMark/>&quot;&gt;--&amp;gt;&lt;/a&gt;</begin><end>&lt;a href=&quot;#author<ibstDispFldRMark/>&quot;&gt;[Author ID<ibstDispFldRMark/>: at <dttmDispFldRMark/> (<xstDispFldRMark/>)]&lt;/a&gt;</end></DispFldRMark>
+
+<!--
+or uncomment below to ignore it, the previous might even crash wv ?
+-->
+<!--
+<DispFldRMark><begin></begin><end></end></DispFldRMark>
+-->
+
+<animation>
+<begin><LasVegas.begin/><BackgroundBlink.begin/><SparkleText.begin/><MarchingAnts.begin/><MarchingRedAnts.begin/><Shimmer.begin/></begin>
+<end><Shimmer.end/><MarchingRedAnts.end/><MarchingAnts.end/><SparkleText.end/><BackgroundBlink.end/><LasVegas.end/></end>
+</animation>
+
+<fontstr>
+<begin>&lt;font color=&quot;<black.begin/><blue.begin/><cyan.begin/><green.begin/><magenta.begin/><red.begin/><yellow.begin/><white.begin/><dkblue.begin/><dkcyan.begin/><dkgreen.begin/><dkmagenta.begin/><dkred.begin/><dkyellow.begin/><dkgray.begin/><ltgray.begin/>&quot;&gt;</begin>
+<end><ltgray.end/><dkgray.end/><dkyellow.end/><dkred.end/><dkmagenta.end/><dkgreen.end/><dkcyan.end/><dkblue.end/><white.end/><yellow.end/><red.end/><magenta.end/><green.end/><cyan.end/><blue.end/><black.end/>&lt;/font&gt;</end>
+</fontstr>
+
+<comment>
+<begin>
+&lt;a href=&quot;#comment<ibstAnno/> &quot;&gt;-&#45;&amp;gt;&lt;/a&gt;
+</begin>
+<end>&lt;a href=&quot;#comment<ibstAnno/> &quot;&gt;[Author:<xstUsrInitl/>]&lt;/a&gt;
+</end>
+</comment>
+
+<style name="Normal">
+<character>
+<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
+<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
+</character>
+
+<!-- Netscape does handle this correctly yet, here is how each different side of the border should work.
+border-top: thin <bordertopstyle/> <bordertopcolor/>;
+border-left: thin <borderleftstyle/> <borderleftcolor/>;
+border-right: thin <borderrightstyle/> <borderrightcolor/>;
+border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
+-->
+
+
+<pmargin>
+<begin>margin: <mmParaBefore/> <mmParaRight/> <mmParaAfter/> <mmParaLeft/>;</begin>
+</pmargin>
+
+<pborder>
+<begin>
+border: thin <borderleftstyle/> <borderleftcolor/>;
+<!--
+border-top: thin <bordertopstyle/> <bordertopcolor/>;
+border-left: thin <borderleftstyle/> <borderleftcolor/>;
+border-right: thin <borderrightstyle/> <borderrightcolor/>;
+border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
+-->
+</begin>
+</pborder>
+
+<text>
+<begin>&lt;p&gt;&lt;div name=&quot;<stylename/>&quot; align=&quot;<just/>&quot; style=&quot;<paramargin/> <paraborder/> padding: <mmPadTop/> <mmPadRight/> <mmPadBottom/> <mmPadLeft/>; &quot;&gt;
+
+&lt;p style=&quot;text-indent: <mmParaLeft1/>; text-align: <just/>; line-height: <mmLineHeight/>; color: <parafgcolor/>; background-color: <parabgcolor/>; &quot;&gt;</begin>
+
+<end>&lt;/p&gt;&lt;/div&gt;</end>
+</text>
+
+<picture>
+<begin>
+&lt;img <htmlAlignGuess/> width=&quot;<pixPicWidth/>&quot; height=&quot;<pixPicHeight/>&quot; alt=&quot;0x01 graphic&quot; src=&quot;placeholder.png&quot;&gt;<htmlNextLineGuess/>
+</begin>
+</picture>
+
+</style>
+
+<!--we need to be override the character properties-->
+<!--
+<style name="Normal">
+<character>
+<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
+<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
+</character>
+
+<text>
+<begin>&lt;div name=&quot;<stylename/>&quot;  align=&quot;<just/>&quot;&gt;&lt;p&gt;</begin>
+<end>&lt;/p&gt;&lt;/div&gt;</end>
+</text>
+
+</style>
+
+<style name="Heading 1">
+
+<character>
+<begin></begin>
+<end></end>
+</character>
+
+<text>
+<begin>&lt;div name=&quot;<stylename/>&quot;  align=&quot;<just/>&quot;&gt;&lt;H1&gt;</begin>
+<end>&lt;/H1&gt;&lt;/div&gt;</end>
+</text>
+
+
+
+</style>
+-->
+
+</main>
diff --git a/data/sisu/v3dv/conf/convert/wvSiSU.xml b/data/sisu/v3dv/conf/convert/wvSiSU.xml
new file mode 100644 (file)
index 0000000..271b00f
--- /dev/null
@@ -0,0 +1,360 @@
+<main>
+<charentity>
+<begin>HTML</begin>
+</charentity>
+<!--  wvWare -x wvSiSU.xml [inputfile.doc] [outputfile.html] -->
+
+<document>
+<begin>
+</begin>
+<end>
+</end>
+</document>
+
+<section>
+<begin>
+</begin>
+<end>
+</end>
+</section>
+
+<justification>
+<left>left</left>
+<right>right</right>
+<center>center</center>
+<block>left</block>
+<asian>&lt;!--Could Someone who sees this tag tell me what was is this type of justification, asian languages only i thing--&gt;</asian>
+</justification>
+
+<numbering>
+<Arabic>type=&quot;1&quot;</Arabic>
+<UpperRoman>type=&quot;I&quot;</UpperRoman>
+<LowerRoman>type=&quot;i&quot;</LowerRoman>
+<UpperCaseN>type=&quot;A&quot;</UpperCaseN>
+<LowerCaseN>type=&quot;a&quot;</LowerCaseN>
+</numbering>
+
+<border>
+<noned>none</noned>
+<singled>solid</singled>
+<thickd>solid</thickd>
+<doubled>double</doubled>
+<number4d>double</number4d>
+<hairlined>solid</hairlined>
+<dotd>dotted</dotd>
+<dashlargegapd>dashed</dashlargegapd>
+<dotdashd>dotted</dotdashd>
+<dotdotdashd>dotted</dotdotdashd>
+<tripled>double</tripled>
+<thin-thicksmallgapd>dashed</thin-thicksmallgapd>
+<thick-thinsmallgapd>dashed</thick-thinsmallgapd>
+<thin-thick-thinsmallgapd>dashed</thin-thick-thinsmallgapd>
+<thin-thickmediumgapd>dashed</thin-thickmediumgapd>
+<thick-thinmediumgapd>dashed</thick-thinmediumgapd>
+<thin-thick-thinmediumgapd>dashed</thin-thick-thinmediumgapd>
+<thin-thicklargegapd>dashed</thin-thicklargegapd>
+<thick-thinlargegapd>dashed</thick-thinlargegapd>
+<thin-thick-thinlargegapd>dashed</thin-thick-thinlargegapd>
+<waved>solid</waved>
+<doublewaved>double</doublewaved>
+<dashsmallgapd>sashed</dashsmallgapd>
+<dashdotstrokedd>dashed</dashdotstrokedd>
+<emboss3Dd>ridge</emboss3Dd>
+<engrave3Dd>groove</engrave3Dd>
+<defaultd>ridge</defaultd>
+</border>
+
+<!-- <begin>&lt;ol <nfc/> start=&quot;<start/>&quot;&gt; -->
+<olist>
+<begin>
+</begin>
+<end></end>
+</olist>
+
+<ulist>
+<begin>
+</begin>
+<end></end>
+</ulist>
+
+<!-- <begin>&lt;li&gt;</begin> -->
+<entry>
+<begin></begin>
+<end></end>
+</entry>
+
+
+<!--
+this tableoverride option can be used to turn off handling of
+these tags in tables, which I find is necessary for at least netscape
+-->
+<tableoverrides>
+<ParaBefore>0</ParaBefore>
+<ParaRight>0</ParaRight>
+<ParaAfter>0</ParaAfter>
+<ParaLeft>0</ParaLeft>
+<ParaLeft1>0</ParaLeft1>
+<VertMergedCells>0</VertMergedCells>
+</tableoverrides>
+
+<table>
+<begin></begin>
+<end></end>
+</table>
+
+<row>
+<begin>&lt;tr&gt;</begin>
+<end>&lt;/tr&gt;</end>
+</row>
+
+<cell>
+<begin></begin>
+<end></end>
+</cell>
+
+<!-- EDITING OUT DID MUCH OF TRICK -->
+<paragraph>
+<begin>
+</begin>
+<end>
+</end>
+</paragraph>
+
+<!-- these are all the character properties that can show up in word -->
+<bold><begin>&lt;b&gt;</begin><end>&lt;/b&gt;</end></bold>
+<italic><begin>&lt;i&gt;</begin><end>&lt;/i&gt;</end></italic>
+
+<!--
+text that has been deleted and will be displayed with strikethrough when
+revision marked text is to be displayed
+
+use either this line...
+-->
+<RMarkDel><begin>&lt;s&gt;</begin><end>&lt;/s&gt;&lt;a href=&quot;#author<ibstRMarkDel/>&quot;&gt;[Author ID<ibstRMarkDel/>: at <dttmRMarkDel/> ]&lt;/a&gt;</end></RMarkDel>
+
+<!--
+or uncomment below to make deleted text dissappear (well, become commented out)
+-->
+<!--
+<RMarkDel><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></RMarkDel>
+-->
+
+<!-- Overwriting char props. like CaPs->CAPS SmallCaps->smallcaps -->
+<outline><begin></begin><end></end></outline>
+<smallcaps><begin></begin><end></end></smallcaps>
+<caps><begin></begin><end></end></caps>
+<vanish><begin></begin><end></end></vanish>
+
+<!--If you uncomment this then the annotation text links will become commented out by html tags-->
+<!--
+<vanish><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></vanish>
+-->
+
+<!--
+text that has been newly typed since the last time revision marks have been accepted
+and will be displayed with underline when revision marked text is to be displayed
+
+use either this line...
+-->
+<RMark><begin></begin><end></end></RMark>
+
+<!--
+or uncomment below to make the underline dissappear
+-->
+<!--
+<RMark><begin></begin><end></end></RMark>
+-->
+
+
+<strike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></strike>
+<shadow><begin></begin><end></end></shadow>
+<lowercase><begin></begin><end></end></lowercase>
+<emboss><begin></begin><end></end></emboss>
+<imprint><begin></begin><end></end></imprint>
+<!--double strike-->
+<dstrike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></dstrike>
+
+<!--
+ftc's
+&
+hps
+
+keep them for font face and do that later.
+-->
+
+<super><begin>&lt;sup&gt;</begin><end>&lt;/sup&gt;</end></super>
+<sub><begin>&lt;sub&gt;</begin><end>&lt;/sub&gt;</end></sub>
+
+<singleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></singleu>
+<wordu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></wordu>
+<doubleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></doubleu>
+<dottedu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dottedu>
+<hiddenu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></hiddenu>
+<thicku><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></thicku>
+<dashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dashu>
+<dotu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotu>
+<dotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdashu>
+<dotdotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdotdashu>
+<waveu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></waveu>
+
+<!--
+text whose properties have been changed since the last time revision marks have been accepted
+and will be displayed with a note showing the change points.
+
+use either this line (which admit it a bit scary looking, but harmless)...
+-->
+<PropRMark><begin></begin><end></end></PropRMark>
+
+<!--
+or uncomment below to make the notes dissappear
+-->
+<!--
+<PropRMark><begin></begin><end></end></PropRMark>
+-->
+
+<!--
+<color>
+-->
+<Black><begin>Black</begin><end></end></Black>
+<Blue><begin>Blue</begin><end></end></Blue>
+<Cyan><begin>Cyan</begin><end></end></Cyan>
+<Green><begin>Green</begin><end></end></Green>
+<Magenta><begin>Magenta</begin><end></end></Magenta>
+<Red><begin>Red</begin><end></end></Red>
+<Yellow><begin>Yellow</begin><end></end></Yellow>
+<White><begin>White</begin><end></end></White>
+<DkBlue><begin>DarkBlue</begin><end></end></DkBlue>
+<DkCyan><begin>DarkCyan</begin><end></end></DkCyan>
+<DkGreen><begin>DarkGreen</begin><end></end></DkGreen>
+<DkMagenta><begin>DarkMagenta</begin><end></end></DkMagenta>
+<DkRed><begin>DarkRed</begin><end></end></DkRed>
+<DkYellow><begin>#8b8b00</begin><end></end></DkYellow>
+<DkGray><begin>DarkGray</begin><end></end></DkGray>
+<LtGray><begin>LightGrey</begin><end></end></LtGray>
+<!--
+</color>
+-->
+
+<!--
+<animation>
+-->
+<LasVegas><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></LasVegas>
+<BackgroundBlink><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></BackgroundBlink>
+<SparkleText><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></SparkleText>
+<MarchingAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingAnts>
+<MarchingRedAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingRedAnts>
+<Shimmer><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></Shimmer>
+<!--
+</animation>
+-->
+
+<!--
+I dont understand what this one is, and ive never come across it
+
+use this sample line (which admit it a bit scary looking, but harmless)...
+-->
+<DispFldRMark><begin></begin><end></end></DispFldRMark>
+
+<!--
+or uncomment below to ignore it, the previous might even crash wv ?
+-->
+<!--
+<DispFldRMark><begin></begin><end></end></DispFldRMark>
+-->
+
+<animation>
+<begin></begin>
+<end></end>
+</animation>
+
+<fontstr>
+<begin></begin>
+<end></end>
+</fontstr>
+
+<comment>
+<begin>
+</begin>
+<end>
+</end>
+</comment>
+
+<style name="Normal">
+<character>
+<begin><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
+<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/></end>
+</character>
+
+<!-- KEEP
+<style name="Normal">
+<character>
+<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
+<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
+</character>
+-->
+
+<!-- Netscape does handle this correctly yet, here is how each different side of the border should work.
+border-top: thin <bordertopstyle/> <bordertopcolor/>;
+border-left: thin <borderleftstyle/> <borderleftcolor/>;
+border-right: thin <borderrightstyle/> <borderrightcolor/>;
+border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
+-->
+
+
+<pmargin>
+<begin></begin>
+</pmargin>
+
+<pborder>
+<begin>
+</begin>
+</pborder>
+
+<text>
+<begin>
+
+<mmParaLeft1/></begin>
+
+<end></end>
+</text>
+
+<picture>
+<begin>
+</begin>
+</picture>
+
+</style>
+
+<!--we need to be override the character properties-->
+<!--
+<style name="Normal">
+<character>
+<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
+<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
+</character>
+
+<text>
+<begin>&lt;div name=&quot;<stylename/>&quot;  align=&quot;<just/>&quot;&gt;&lt;p&gt;</begin>
+<end>&lt;/p&gt;&lt;/div&gt;</end>
+</text>
+
+</style>
+
+<style name="Heading 1">
+
+<character>
+<begin></begin>
+<end></end>
+</character>
+
+<text>
+<begin>&lt;div name=&quot;<stylename/>&quot;  align=&quot;<just/>&quot;&gt;&lt;H1&gt;</begin>
+<end>&lt;/H1&gt;&lt;/div&gt;</end>
+</text>
+
+
+
+</style>
+-->
+
+</main>
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/README b/data/sisu/v3dv/conf/editor-syntax-etc/README
new file mode 100644 (file)
index 0000000..c03f356
--- /dev/null
@@ -0,0 +1,90 @@
+This directory
+  ./data/sisu/conf/editor-syntax-etc/
+  /usr/share/sisu/conf/editor-syntax-etc/
+contains rudimentary sisu syntax highlighting files for:
+
+* (g)vim <http://www.vim.org>
+  * package: sisu-vim
+  * status: largely done
+    there is a vim syntax highlighting and folds component
+
+* gedit <http://www.gnome.org/projects/gedit>
+* gobby <http://gobby.0x539.de/>
+  file: sisu.lang
+  place in:
+    /usr/share/gtksourceview-1.0/language-specs
+  or
+    ~/.gnome2/gtksourceview-1.0/language-specs
+  * status: very basic syntax highlighting
+  * comments: this editor features display line wrap and is used by Goby!
+
+* nano <http://www.nano-editor.org>
+  file: nanorc
+  save as:
+    ~/.nanorc
+  includes:
+  * status: basic syntax highlighting
+  * comments: assumes dark background
+    no display line-wrap
+    does line breaks
+
+* diakonos (an editor written in ruby) <http://purepistos.net/diakonos>
+  file: diakonos.conf
+  save as:
+    ~/.diakonos/diakonos.conf
+  includes:
+  * status: basic syntax highlighting
+  * comments: assumes dark background
+    no display line-wrap
+
+* kate & kwrite http://kate.kde.org
+  file: sisu.xml
+  place in:
+    /usr/share/apps/katepart/syntax
+  or
+    ~/.kde/share/apps/katepart/syntax
+  [settings::configure kate::{highlighting,filetypes}]
+  [tools::highlighting::{markup,scripts}::SiSU]
+
+* nedit <http://www.nedit.org>
+  file: sisu_nedit.pats
+  nedit -import sisu_nedit.pats
+  * status: a very clumsy first attempt
+  [not really done]
+  * comments: this editor features display line wrap
+
+* emacs <http://www.gnu.org/software/emacs/emacs.html>
+  files: sisu-mode.el
+  to file ~/.emacs add the following 2 lines:
+    (add-to-list 'load-path "/usr/share/sisu-examples/config/syntax_hi")
+    (require 'sisu-mode.el)
+  [not done / not yet included]
+
+* vim & gvim <http://www.vim.org>
+  files: sisu-vim <http://www.jus.uio.no/sisu/SiSU/download>
+  package is the most comprehensive sisu syntax highlighting and editor
+  environment provided to date (is for vim/ gvim, and is separate from the
+  contents of this directory)
+  on debian:
+    aptitude install sisu-vim
+  * status: this includes:
+    syntax highlighting
+    vim folds
+    some error checking
+  * comments: this editor features display line wrap
+
+NOTE:
+
+[SiSU parses files with long lines or line breaks,
+but, display linewrap (without line-breaks) is a
+convenient editor feature to have for sisu markup]
+
+kde-config --prefix
+KDEDIR/share/apps/katepart/syntax/
+KDEHOME/share/apps/katepart/syntax
+[In the configure dialog in kate, go to the "Editor->highlighting" page and
+>select a highlight to change the mimetype/pattern associations for it.]
+/etc/mime.types
+/usr/share/mime/text
+#
+# * aeditor (an editor written in ruby)
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/diakonos/diakonos.conf b/data/sisu/v3dv/conf/editor-syntax-etc/diakonos/diakonos.conf
new file mode 100644 (file)
index 0000000..a3c3afe
--- /dev/null
@@ -0,0 +1,1159 @@
+logfile ~/.diakonos/diakonos.log
+
+# When the cursor is view.margin.y lines or less from the top or
+# bottom line, repeatedly scroll the screen view.jump.y lines until
+# the cursor is more than view.margin.y lines from the top and
+# bottom line.
+# Similarly for view.margin.x and view.jump.x, with respect to the
+# left-most and right-most screen columns.
+view.margin.x 10
+view.margin.y 5
+view.jump.x 10
+view.jump.y 5
+view.scroll_amount 1
+view.lookback 200
+view.nonfilelines.visible false
+view.nonfilelines.character ~
+view.wrap.visual true
+
+# bol_behaviour: This specifies where the cursor should go when the
+# beginning-of-line key (the default is the Home key) is pressed.
+#    zero: Always move to the left-most column of the line
+#    first-char: Always move to the left-most non-whitespace character
+#    alternating-zero: As with 'zero', unless the cursor is
+#        already there, in which case, as with 'first-char'.
+#    alternating-first-char: As with 'first-char', unless the cursor is
+#        already there, in which case, as with 'zero'.
+# bol_behavior is a synonym for bol_behaviour.
+bol_behaviour alternating-first-char
+
+# eol_behaviour: This specifies where the cursor should go when the
+# end-of-line key (the default is the End key) is pressed.
+#    end: Always move to the right-most column of the line
+#    last-char: Always move to the right-most non-whitespace character
+#    alternating-end: As with 'end', unless the cursor is
+#        already there, in which case, as with 'last-char'.
+#    alternating-last-char: As with 'last-char', unless the cursor is
+#        already there, in which case, as with 'end'.
+# eol_behavior is a synonym for eol_behaviour.
+eol_behaviour alternating-end
+
+# Ensures saved files end with a newline character by adding it if necessary.
+eof_newline false
+
+delete_newline_on_delete_to_eol false
+
+# Specifies whether the cursor should be at the end (false) of found text, or the
+# beginning (true).
+found_cursor_start false
+
+max_clips 30
+
+# The maximum number of undo lines held in memory per file
+# Smaller files will be able to have more undo levels.
+max_undo_lines 16384
+
+convert_tabs false
+
+diff_command diff -U 5
+
+# Whether or not to use /usr/bin/file to determine whether files are readable
+# before opening them.
+use_magic_file false
+
+# ---------------------------------------------------------------------
+# Status Line
+
+# Use "% syntax" as placeholders
+# e.g. %d for decimal integers, %s for strings
+status.left -- %s %s%s%s -- (%s) --%s
+status.right - Buf %d of %d --- L%3d/%3d C%2d --
+# The string to use to fill in the space between the left and right sides
+# of the status line.
+status.filler -
+status.modified_str (modified)
+status.selecting_str (selecting)
+status.unnamed_str (unnamed file)
+status.read_only_str (read-only)
+# status.vars: any subset of:
+# line row num_lines col filename modified type buffer_number num_buffers selecting read_only
+status.vars filename modified read_only selecting type @git_branch buffer_number num_buffers row num_lines col
+status.format inverse
+
+# ---------------------------------------------------------------------
+# Context Line
+
+# The context line shows the wrapping context of the cursor, with respect to
+# indentation.  This shows the current code block(s) that the cursor is in.
+
+context.visible false
+context.combined false
+context.max_levels 4
+context.format inverse
+context.separator |
+context.separator.format red inverse
+#context.max_segment_width 10
+
+# ---------------------------------------------------------------------
+# Interaction Line
+
+# Duration of "alert" blink (in seconds) when user has made an invalid choice
+interaction.blink_duration 0.05
+interaction.blink_string ***********************************************************
+# Time to wait (in seconds) before accepting user keystrokes when prompting for
+# a choice which has no default
+interaction.choice_delay 3
+
+# ---------------------------------------------------------------------
+# Key Configuration
+# key <keystroke> [<keystroke>...];<function> [<arg>[,<arg>...]]
+# If no function is specified, it unmaps any previous mapping.
+# i.e. key <keystroke> [<keystroke>...];
+# <keystroke> can be "keycode##" to specify specific keycodes.
+# e.g. key keycode8;delete
+# Note the lack of space after the word keycode.
+
+# To obtain the string to use for any keychain, use the printKeychain command
+# (default alt+k).
+
+# The shell, execute and pasteShellResult commands can take variables:
+
+# $f  current buffer's filepath
+# $F  all current buffer filepaths, space-separated
+# $i  get a string from user input
+# $c  temp file containing current clipboard text
+# $k  temp file containing current klipper (KDE clipboard) text
+# $s  temp file containing currently selected text
+
+key left;cursorLeft
+key esc [ D;cursorLeft
+key right;cursorRight
+key esc [ C;cursorRight
+key up;cursorUp
+key esc [ A;cursorUp
+key down;cursorDown
+key esc [ B;cursorDown
+key home;cursorBOL
+key esc O H;cursorBOL
+key esc [ H;cursorBOL
+key esc [ 1 ~   cursorBOL
+key esc [ 7 ~   cursorBOL
+key end;cursorEOL
+key esc O F;cursorEOL
+key esc [ F;cursorEOL
+key esc [ 4 ~;cursorEOL
+key esc [ 8 ~;cursorEOL
+key pageup;pageUp
+key pagedown;pageDown
+#key ctrl+a;cursorBOL
+key ctrl+e;cursorEOL
+key alt+<;cursorBOF
+key esc [ 1 ; 5 H   cursorBOF
+key alt+>;cursorEOF
+key esc [ 1 ; 5 F   cursorEOF
+key alt+,;cursorTOV
+key alt+.;cursorBOV
+key ctrl+j;cursorReturn
+key ctrl+l;cursorReturn "forward"
+key alt+n;scrollDown
+key alt+p;scrollUp
+key esc up;scrollUp
+key esc [ 1 ; 3 A    scrollUp
+key esc [ 1 ; 5 A    scrollUp
+key keycode520       scrollUp
+key keycode521       scrollUp
+key esc down;scrollDown
+key esc [ 1 ; 3 B    scrollDown
+key esc [ 1 ; 5 B    scrollDown
+key keycode513       scrollDown
+key keycode514       scrollDown
+key esc right;seek /(?:^|\W)(\w)|\w(\W|$)/
+key esc [ 1 ; 3 C    seek /\w(\W|$)|(?:^|\W)(\w)/
+key esc [ 1 ; 5 C    seek /\w(\W|$)|(?:^|\W)(\w)/
+key keycode517       seek /\w(\W|$)|(?:^|\W)(\w)/
+key keycode518       seek /\w(\W|$)|(?:^|\W)(\w)/
+key esc left;seek /\w(\W|$)|(?:^|\W)(\w)/, "up"
+key esc [ 1 ; 3 D    seek /\w(\W|$)|(?:^|\W)(\w)/, "up"
+key esc [ 1 ; 5 D    seek /\w(\W|$)|(?:^|\W)(\w)/, "up"
+key keycode515       seek /\w(\W|$)|(?:^|\W)(\w)/, "up"
+key keycode516       seek /\w(\W|$)|(?:^|\W)(\w)/, "up"
+
+key ctrl+g;goToLineAsk
+key alt+b alt+b;toggleBookmark
+key alt+b alt+n;goToNextBookmark
+key alt+b alt+p;goToPreviousBookmark
+key alt+b alt+a;addNamedBookmark
+key alt+b alt+r;removeNamedBookmark
+key alt+b alt+g;goToNamedBookmark
+key alt+b alt+!;addNamedBookmark 1
+key alt+b alt+@;addNamedBookmark 2
+key alt+b alt+#;addNamedBookmark 3
+key alt+b alt+$;addNamedBookmark 4
+key alt+b alt+%;addNamedBookmark 5
+key alt+b alt+1;goToNamedBookmark 1
+key alt+b alt+2;goToNamedBookmark 2
+key alt+b alt+3;goToNamedBookmark 3
+key alt+b alt+4;goToNamedBookmark 4
+key alt+b alt+5;goToNamedBookmark 5
+key alt+t;goToTag
+key alt+);goToTagUnderCursor
+key alt+(;popTag
+
+key backspace;backspace
+key ctrl+h;backspace
+key del;delete
+#key ctrl+k;deleteLine
+key ctrl+k;deleteAndStoreLine
+key ctrl+alt+k;deleteToEOL
+key esc del;collapseWhitespace
+key esc [ 3 ; 3 ~    collapseWhitespace
+key alt+w            wrap_paragraph
+key alt+a            columnize
+key enter;carriageReturn
+key tab;parsedIndent
+#key tab;indent
+#key ctrl+alt+l;unindent
+key alt+i;indent
+key esc i;indent
+key esc I;unindent
+key esc [ Z       unindent
+key keycode353    unindent
+#key tab;insertSpaces 4
+#key tab;insertTab
+key ctrl+t;insertTab
+key alt+j    joinLines
+
+key f1            help
+key esc O P       help
+key esc [ 1 1 ~   help
+key esc [ [ A     help
+key f11;loadConfiguration
+key esc [ 2 3 ~;loadConfiguration
+key f12;openFile "~/.diakonos/diakonos.conf"
+key esc [ 2 4 ~;openFile "~/.diakonos/diakonos.conf"
+
+key ctrl+alt+r;redraw
+key esc C;toggleSessionSetting 'context.visible', DO_REDRAW
+key ctrl+alt+d;toggleSessionSetting 'display'
+key esc W;toggleSessionSetting 'view.wrap.visual', DO_REDRAW
+
+key ctrl+n;newFile
+key ctrl+o;openFileAsk
+key ctrl+s;saveFile
+key alt+s;saveFileAs
+key ctrl+w;closeFile
+key ctrl+alt+o;revert
+key alt+!;setReadOnly
+key ctrl+q;quit
+key esc T;setBufferType
+
+key alt+1;switchToBufferNumber 1
+key alt+2;switchToBufferNumber 2
+key alt+3;switchToBufferNumber 3
+key alt+4;switchToBufferNumber 4
+key alt+5;switchToBufferNumber 5
+key alt+6;switchToBufferNumber 6
+key alt+7;switchToBufferNumber 7
+key alt+8;switchToBufferNumber 8
+key alt+9;switchToBufferNumber 9
+key alt+0;switchToBufferNumber 10
+key alt+-;switchToPreviousBuffer
+key alt+=;switchToNextBuffer
+key ctrl+alt+b    list_buffers
+
+key ctrl+space;anchorSelection
+#key ctrl+space;toggleSelection
+key ctrl+c;copySelection
+key ctrl+x;cutSelection
+key alt+u;removeSelection
+key ctrl+a    select_all
+
+# If you are using KDE, you can uncomment these lines to synchronize
+# the Diakonos clipboard with the KDE clipboard
+#key ctrl+c      copy_selection_to_klipper
+#key ctrl+x      cut_selection_to_klipper
+#key ctrl+v      paste_from_klipper
+#key ctrl+k      delete_and_store_line_to_klipper
+#key ctrl+alt+k  delete_to_eol_to_klipper
+
+key ctrl+b         select_block
+# Select file diff in a patch
+key ctrl+alt+d f   select_block /^Index: /, /^(Index: |$)/, false
+# Select a diff hunk in a patch
+key ctrl+alt+d h   select_block /^@@ /, /^(@@ |$)/, false
+key esc #          comment_out
+key esc @          uncomment
+
+key ctrl+alt+v;showClips
+key ctrl+v;paste
+key ctrl+y;unundo
+key ctrl+z;undo
+#key ctrl+z;suspend
+key suspend;undo
+#key suspend;suspend
+
+key ctrl+f;find
+#key ctrl+f;find "down", CASE_SENSITIVE
+key alt+f;find "down", CASE_SENSITIVE
+#key alt+f;findExact
+key ctrl+alt+f;find "up"
+#key ctrl+alt+f;find "up", CASE_SENSITIVE
+key f3;findAgain "down"
+key esc [ [ C        findAgain "down"
+key esc O R;findAgain "down"
+key esc [ 1 3 ~;findAgain "down"
+key f15;findAgain "up"
+key esc [ 2 8 ~   findAgain "up"
+key esc O 2 R;findAgain "up"
+key ctrl+r   searchAndReplace
+key alt+r    searchAndReplace CASE_SENSITIVE
+key ctrl+alt+u;clearMatches
+key alt+c;close_code
+
+key f2            shell
+key esc O Q       shell
+key esc [ 1 2 ~   shell
+key esc [ [ B     shell
+key f8;execute
+key esc F;execute "glark '$i' $F | less"
+key esc d         shell "diff -U 5 -w -b $c $s", "clipboard.diff"
+#key esc F;shell "grep -n '$i' $F"
+#key esc F;execute "grep -n '$i' $F | less"
+#key esc l         execute "aspell check $f"
+key f14           evaluate
+key esc O 2 Q     evaluate
+key esc [ 2 6 ~   evaluate
+key ctrl+alt+c    shell "ruby -c $f"
+
+# To use the following:
+# 1) Copy to the clipboard some Ruby code which operates on stdin text and outputs to stdout.
+# 2) Select (highlight) some text to operate on.
+# 3) Activate this pasteShellResult command.
+# 4) The selected text should now be replaced with the script's results.
+key ctrl+alt+p;pasteShellResult "cat $s | ruby $c"
+#key ctrl+alt+p;pasteShellResult "cat $s | perl $c"
+#key ctrl+alt+p;pasteShellResult "cat $s | python $c"
+#key ctrl+alt+p;pasteShellResult "cat $s | sed -f $c"
+#key ctrl+alt+p;pasteShellResult "cat $s | awk -f $c"
+
+key alt+k        printKeychain
+key esc K        print_mapped_function
+key alt+m;toggleMacroRecording
+key f4            playMacro
+key esc O S       playMacro
+key esc [ 1 4 ~   playMacro
+key esc [ [ D     playMacro
+key f5            loadScript
+key esc [ 1 5 ~   loadScript
+key esc [ [ E     loadScript
+key f6;repeatLast
+key esc [ 1 7 ~;repeatLast
+key f7;operateOnEachLine
+key f19;operateOnString
+key esc [ 1 8 ; 2 ~    operateOnString
+key esc f7             operateOnLines
+key esc [ 1 8 ; 3 ~    operateOnLines
+key keycode319         operateOnLines
+
+# Emacs-like keychains
+
+#key ctrl+s;find
+#key ctrl+x ctrl+c;quit
+#key ctrl+x ctrl+f;openFileAsk
+#key ctrl+x ctrl+s;saveFile
+
+# ---------------------------------------------------------------------
+# Colour Definitions
+#
+# colour <integer greater than 7> <foreground colour> <background colour>
+#
+# For a list of colour names, see the list of format codes in the
+# Language Definitions section, below.
+#
+# With this colour command you can set a different background colour than the
+# terminal default.
+#
+# color is a synonym for colour.
+colour 8 white blue
+colour 9 white red
+colour 10 white magenta
+colour 11 yellow blue
+colour 12 white green
+colour 13 white brown
+colour 14 black cyan
+colour 15 yellow red
+
+# ---------------------------------------------------------------------
+# Language Definitions
+# For syntax highlighting and indentation.
+
+# lang.<language>.tokens.<any name>[.case_insensitive] <regexp with one pair of parentheses identifying the token>
+# lang.<language>.tokens.<any name>.format <format codes>
+# <format codes> can be any subset of:
+#     normal black red green brown blue magenta cyan white standout underline inverse blink dim bold
+# The numbers of colour pairs (as defined by the configuration command "colour")
+# can also be used as format codes.
+#
+# indent.roundup: If a line's indentation is not evenly divisible by the
+# indent.size, and indent.roundup is true, then the non-integer indentation
+# level will be rounded up.  If indent.roundup is false, then it will be
+# rounded down.
+# e.g. given an indent.size of 4, and a line with 6 spaces, indent.roundup
+# true will make Diakonos consider the line indented 2 levels.  With
+# indent.roundup false, it will be considered indented 1 level.
+#
+# The filemask can also be used to specify specific filenames which
+# don't conform to the standard extensions for a language.
+
+# Text (default)
+
+lang.text.format.default white
+lang.text.format.selection inverse
+lang.text.format.found yellow inverse
+lang.text.indent.size 2
+lang.text.indent.auto true
+lang.text.indent.roundup false
+#lang.text.indent.using_tabs true
+lang.text.tabsize 8
+lang.text.wrap_margin 80
+
+# Diakonos help files
+
+lang.dhf.filemask \.dhf
+lang.dhf.format.default white
+lang.dhf.format.selection inverse
+lang.dhf.format.found yellow inverse
+lang.dhf.tokens.tags (^Tags: .+)
+lang.dhf.tokens.tags.format blue
+lang.dhf.tokens.title (^# .*)
+lang.dhf.tokens.title.format 8 bold
+lang.dhf.tokens.subtitle (^## .*)
+lang.dhf.tokens.subtitle.format cyan bold
+lang.dhf.tokens.subsubtitle (^### .*)
+lang.dhf.tokens.subsubtitle.format cyan
+lang.dhf.tokens.keys <(.+?)>
+lang.dhf.tokens.keys.format white bold
+lang.dhf.indent.size 2
+lang.dhf.indent.auto true
+lang.dhf.indent.roundup true
+lang.dhf.wrap_margin 80
+
+# XML
+
+lang.xml.filemask \.(xml|xsl|rdl|aiml|xhtml)$
+lang.xml.format.default white
+lang.xml.format.selection inverse
+lang.xml.format.found yellow inverse
+lang.xml.tabsize 8
+lang.xml.indent.size 2
+lang.xml.indent.auto true
+lang.xml.indent.roundup true
+#lang.xml.indent.using_tabs true
+lang.xml.tokens.entities &\S+?;
+lang.xml.tokens.entities.format magenta bold
+lang.xml.tokens.code.open (<)(?:[^%]|$)
+lang.xml.tokens.code.close (?:[^%]|^)(>)
+lang.xml.tokens.code.format white bold
+lang.xml.tokens.code.change_to xml_tag
+lang.xml.tokens.comments.open (<!--)
+lang.xml.tokens.comments.close (-->)
+lang.xml.tokens.comments.format 8
+lang.xml.tokens.comments.change_to xml_comment
+lang.xml.comment_string <!--
+lang.xml.comment_close_string " -->"
+lang.xml.tokens.template.open \[@--
+lang.xml.tokens.template.close --@\]
+lang.xml.tokens.template.format brown
+lang.xml.tokens.template.change_to perl
+lang.xml.closers.tag.regexp <([^/> ]*)
+lang.xml.closers.tag.closer { |m| "</" + m[ 1 ] + ">" }
+lang.xml_tag.format.default white bold
+lang.xml_tag.format.selection inverse
+lang.xml_tag.format.found yellow inverse
+lang.xml_tag.tabsize 8
+lang.xml_tag.indent.size 2
+lang.xml_tag.indent.auto true
+lang.xml_tag.indent.roundup true
+#lang.xml_tag.indent.using_tabs true
+lang.xml_tag.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.xml_tag.tokens.doublequoted_strings.format green bold
+lang.xml_tag.tokens.singlequoted_strings ('.*?[^\\]')
+lang.xml_tag.tokens.singlequoted_strings.format green bold
+lang.xml_tag.tokens.non_alphanum ([@!#$%^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.xml_tag.tokens.non_alphanum.format white
+lang.xml_tag.tokens.namespaces ([a-zA-Z_-]+):
+lang.xml_tag.tokens.namespaces.format yellow bold
+lang.xml_comment.format.default 8
+lang.xml_comment.format.selection inverse
+lang.xml_comment.format.found yellow inverse
+lang.xml_comment.tabsize 8
+lang.xml_comment.indent.size 2
+lang.xml_comment.indent.auto true
+lang.xml_comment.indent.roundup true
+#lang.xml_comment.indent.using_tabs true
+
+lang.html.filemask \.([rx]?html?|php|asp)$
+lang.html.format.default white
+lang.html.format.selection inverse
+lang.html.format.found yellow inverse
+lang.html.tabsize 8
+lang.html.indent.size 2
+lang.html.indent.auto true
+lang.html.indent.roundup true
+#lang.html.indent.using_tabs true
+lang.html.tokens.code.open (<)(?:[^%]|$)
+lang.html.tokens.code.close (?:[^%]|^)(>)
+lang.html.tokens.code.format white bold
+lang.html.tokens.code.change_to html_tag
+lang.html.tokens.entities &\S+?;
+lang.html.tokens.entities.format magenta bold
+lang.html.tokens.eruby.open <%
+lang.html.tokens.eruby.close %>
+lang.html.tokens.eruby.format 9 bold
+lang.html.tokens.eruby.change_to ruby
+lang.html.tokens.ezamar.open <\?r
+lang.html.tokens.ezamar.close \?>
+lang.html.tokens.ezamar.format 9 bold
+lang.html.tokens.ezamar.change_to ruby
+lang.html.tokens.ezamar-value.open \#\{
+lang.html.tokens.ezamar-value.close \}
+lang.html.tokens.ezamar-value.format 9 bold
+lang.html.tokens.ezamar-value.change_to ruby
+lang.html.tokens.php.open <\?(?:php)?
+lang.html.tokens.php.close \?>
+lang.html.tokens.php.format 10 bold
+lang.html.tokens.php.change_to php
+lang.html.tokens.comments.open (<!--)
+lang.html.tokens.comments.close (-->)
+lang.html.tokens.comments.format 8
+lang.html.tokens.comments.change_to html_comment
+lang.html.comment_string <!--
+lang.html.comment_close_string " -->"
+lang.html.closers.tag.regexp <([^/> ]*)
+lang.html.closers.tag.closer { |m| "</" + m[ 1 ] + ">" }
+lang.html_tag.format.default white bold
+lang.html_tag.format.selection inverse
+lang.html_tag.format.found yellow inverse
+lang.html_tag.tabsize 8
+lang.html_tag.indent.size 4
+lang.html_tag.indent.auto true
+lang.html_tag.indent.roundup true
+#lang.html_tag.indent.using_tabs true
+lang.html_tag.tokens.attribute (href)
+lang.html_tag.tokens.attribute.format green bold
+lang.html_tag.tokens.elements.case_insensitive \b(A|ABBR|ACRONYM|ADDRES|APPLET|AREA|B|BASE|BASEFONT|BDO|BIG|BLOCKQUOTE|BODY|BR|BUTTON|CAPTION|CENTER|CITE|CODE|COL|COLGROUP|DD|DEL|DFN|DIR|DIV|DL|DT|EM|FIELDSET|FONT|FORM|FRAME|FRAMESET|H1|H2|H3|H4|H5|H6|HEAD|HR|HTML|I|IFRAME|IMG|INPUT|INS|ISINDEX|KBD|LABEL|LEGEND|LI|LINK|MAP|MENU|META|NOFRAMES|NOSCRIPT|OBJECT|OL|OPTGROUP|OPTION|P|PARAM|PRE|Q|S|SAMP|SCRIPT|SELECT|SMALL|SPAN|STRIKE|STRONG|STYLE|SUB|SUP|TABLE|TBODY|TD|TEXTAREA|TFOOT|TH|THEAD|TITLE|TR|TT|U|UL|VA)\b
+lang.html_tag.tokens.elements.format cyan
+lang.html_tag.tokens.attributes.case_insensitive \b(abbr|accept-charset|accept|accesskey|action|align|alink|alt|archive|axis|background|bgcolor|border|cellpadding|cellspacing|char|charoff|charset|checked|cite|class|classid|clear|code|codebase|codetype|color|cols|colspan|compact|content|coords|data|datetime|declare|defer|dir|disabled|enctype|face|for|frame|frameborder|headers|height|href|href|hreflang|hspace|http-equiv|id|ismap|label|lang|language|link|longdesc|marginheight|marginwidth|maxlength|media|method|multiple|name|nohref|noresize|noshade|nowrap|object|onblur|onchange|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onselect|onsubmit|onunload|profile|prompt|readonly|rel|rev|rows|rowspan|rules|scheme|scope|scrolling|selected|shape|size|span|src|standby|start|style|summary|tabindex|target|text|title|type|usemap|valign|value|valuetype|version|vlink|vspace|width)\b
+lang.html_tag.tokens.attributes.format white
+lang.html_tag.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.html_tag.tokens.doublequoted_strings.format green bold
+lang.html_tag.tokens.singlequoted_strings ('.*?[^\\]')
+lang.html_tag.tokens.singlequoted_strings.format green bold
+lang.html_tag.tokens.non_alphanum ([@!#$%^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.html_tag.tokens.non_alphanum.format white
+lang.html_comment.format.default 8
+lang.html_comment.format.selection inverse
+lang.html_comment.format.found yellow inverse
+lang.html_comment.tabsize 8
+lang.html_comment.indent.size 4
+lang.html_comment.indent.auto true
+lang.html_comment.indent.roundup true
+#lang.html_comment.indent.using_tabs true
+
+# CSS
+
+lang.css.filemask \.css$
+lang.css.format.default white
+lang.css.format.selection inverse
+lang.css.format.found yellow inverse
+lang.css.tabsize 8
+lang.css.indent.size 4
+lang.css.indent.auto true
+lang.css.indent.roundup true
+#lang.css.indent.using_tabs true
+lang.css.indent.indenters (\{)
+lang.css.indent.unindenters (\})
+lang.css.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
+lang.css.tokens.properties \b(azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-collapse|border-color|border-spacing|border-style|border-top|border-bottom|border-right|border-left|border-top-color|border-top-style|border-top-width|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-right|margin-top|margin-left|margin-bottom|margin|max-height|max-width|min-height|min-width|orphans|outline-color|outline-style|outline-width|outline|overflow|padding-top|padding-left|padding-right|padding-bottom|padding|page-break-after|page-break-before|page-break-inside|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|table-layout|text-align|text-decoration|text-indent|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index)\s*:
+lang.css.tokens.properties.format white bold
+lang.css.tokens.colours #[A-Fa-f0-9]{6}|\b(?:aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\b
+lang.css.tokens.colours.format yellow bold
+lang.css.tokens.long_comments.open \/\*
+lang.css.tokens.long_comments.close \*\/
+lang.css.tokens.long_comments.format 8 bold
+lang.css.comment_string /*
+lang.css.comment_close_string " */"
+lang.css.tokens.numbers \b([0-9]+\.[0-9]+|[0-9]+)
+lang.css.tokens.numbers.format blue bold
+lang.css.tokens.units [^A-Za-z](em|pt|px)\b
+lang.css.tokens.units.format cyan
+lang.css.tokens.html_elements.case_insensitive \b(A|ABBR|ACRONYM|ADDRES|APPLET|AREA|B|BASE|BASEFONT|BDO|BIG|BLOCKQUOTE|BODY|BR|BUTTON|CAPTION|CENTER|CITE|CODE|COL|COLGROUP|DD|DEL|DFN|DIR|DIV|DL|DT|FIELDSET|FORM|FRAME|FRAMESET|H1|H2|H3|H4|H5|H6|HEAD|HR|HTML|I|IFRAME|IMG|INPUT|INS|ISINDEX|KBD|LABEL|LEGEND|LI|LINK|MAP|MENU|META|NOFRAMES|NOSCRIPT|OBJECT|OL|OPTGROUP|OPTION|P|PARAM|PRE|Q|S|SAMP|SCRIPT|SELECT|SMALL|SPAN|STRIKE|STRONG|STYLE|SUB|SUP|TABLE|TBODY|TD|TEXTAREA|TFOOT|TH|THEAD|TITLE|TR|TT|U|UL|VA)\b
+lang.css.tokens.html_elements.format green
+lang.css.tokens.values \b(auto|block|inherit|inline|larger|none|smaller|solid)\b
+lang.css.tokens.values.format blue bold
+lang.css.column_delimiters :|,
+
+# Ruby
+
+lang.ruby.filemask (?:[Rr]akefile)|(?:\.(?:rb|gem(?:spec)?)$)
+lang.ruby.bangmask ruby
+lang.ruby.format.default white bold
+lang.ruby.format.selection inverse
+lang.ruby.format.found yellow inverse
+lang.ruby.tokens.reserved_words \b(__FILE__|and|def|end|in|or|self|unless|__LINE__|begin|defined\?|ensure|module|redo|super|until|BEGIN|break|do|false|next|rescue|then|when|END|case|else|for|nil|retry|true|while|alias|class|elsif|if|not|return|undef|yield)\b
+lang.ruby.tokens.reserved_words.format white
+lang.ruby.tokens.constants \b([A-Z_]+|[A-Z_][A-Z0-9_]+)\b
+lang.ruby.tokens.constants.format yellow bold
+lang.ruby.tokens.symbols [^:](:[a-zA-Z_][a-zA-Z_0-9]*)
+lang.ruby.tokens.symbols.format white bold
+lang.ruby.tokens.non_alphanum [@!#$%^&*()\[\]{}/?=+\-\\|,<.>;~]
+lang.ruby.tokens.non_alphanum.format white
+lang.ruby.tokens.instance_variables (@[A-Za-z_][A-Za-z_0-9]*)
+lang.ruby.tokens.instance_variables.format white bold
+lang.ruby.tokens.comments (#.*)
+lang.ruby.tokens.comments.format 8 bold
+lang.ruby.comment_string #
+lang.ruby.tokens.regular_expressions (\/.+?[^\\]\/)
+lang.ruby.tokens.regular_expressions.format red bold
+lang.ruby.tokens.regular_expressions2 (%r\{.+?[^\}]\})
+lang.ruby.tokens.regular_expressions2.format red bold
+lang.ruby.tokens.doublequoted_strings (\".*?[^\\]\"|\"\")
+lang.ruby.tokens.doublequoted_strings.format green bold
+lang.ruby.tokens.interpolated_string.open (%Q?\{)
+lang.ruby.tokens.interpolated_string.close (\})
+lang.ruby.tokens.interpolated_string.format green bold
+lang.ruby.tokens.interpolated_string.change_to interpolated_ruby
+lang.interpolated_ruby.format.default green bold
+lang.interpolated_ruby.tokens.interpolation.open (#\{)
+lang.interpolated_ruby.tokens.interpolation.close (\})
+lang.interpolated_ruby.tokens.interpolation.format 12 bold
+lang.interpolated_ruby.tokens.interpolation.change_to ruby
+lang.ruby.tokens.singlequoted_strings ('.*?[^\\]'|'')
+lang.ruby.tokens.singlequoted_strings.format green bold
+lang.ruby.tokens.backquoted_strings (`.*?[^\\]`|``)
+lang.ruby.tokens.backquoted_strings.format red bold
+lang.ruby.tokens.interpolated_exec_string.open (%x\{)
+lang.ruby.tokens.interpolated_exec_string.close (\})
+lang.ruby.tokens.interpolated_exec_string.format red bold
+lang.ruby.tokens.interpolated_exec_string.change_to interpolated_exec_ruby
+lang.interpolated_exec_ruby.format.default red bold
+lang.interpolated_exec_ruby.tokens.interpolation.open (#\{)
+lang.interpolated_exec_ruby.tokens.interpolation.close (\})
+lang.interpolated_exec_ruby.tokens.interpolation.format 9 bold
+lang.interpolated_exec_ruby.tokens.interpolation.change_to ruby
+lang.ruby.tokens.character_codes \W(\?\S)
+lang.ruby.tokens.character_codes.format magenta bold
+lang.ruby.tokens.long_comments.open ^=begin
+lang.ruby.tokens.long_comments.close ^=end
+lang.ruby.tokens.long_comments.format 8 bold
+lang.ruby.tokens.sql_string.open (<<-EOSQL)
+lang.ruby.tokens.sql_string.close (EOSQL)
+lang.ruby.tokens.sql_string.format 1
+lang.ruby.tokens.sql_string.change_to sql
+lang.ruby.indent.size 2
+lang.ruby.indent.auto true
+lang.ruby.indent.roundup true
+#lang.ruby.indent.using_tabs true
+lang.ruby.tabsize 2
+lang.ruby.indent.indenters ^\s*(case|def|begin|ensure|when|else|ensure|for|while|until|elsif|if|class|module|rescue)\b|([{\[(]$|\{\s*\|[\w\s,]*\|\s*$)|\b(do)\b
+lang.ruby.indent.unindenters ^\s*(end|else|elsif|ensure|when|rescue)\b|(^\s+[\]})])
+lang.ruby.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(`.+?[^\\]`)|(\/.+?[^\\]\/)|(^\s*#.*)|\S\s+if
+lang.ruby.indent.ignore ^\s*$
+lang.ruby.context.ignore ^=(begin|end)$
+lang.ruby.column_delimiters =>?|:|,
+
+# PHP
+
+lang.php.filemask \.php\d?$
+lang.php.bangmask php
+lang.php.format.default white bold
+lang.php.format.selection inverse
+lang.php.format.found yellow inverse
+lang.php.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.php.tokens.doublequoted_strings.format green bold
+lang.php.tokens.singlequoted_strings ('.*?[^\\]')
+lang.php.tokens.singlequoted_strings.format green bold
+lang.php.tokens.reserved_words \b(NULL|E_ALL|__wakeup|not|endwhile|__sleep|new|endswitch|__LINE__|list|endif|__FILE__|global|endforeach|while|include_once|endfor|virtual|include|enddeclare|xor|if|empty|var|elseif|TRUE|true|else|this|echo|stdClass|die|switch|do|static|default|return|function|declare|require_once|foreach|continue|require|for|class|print|FALSE|false|cfunction|PHP_VERSION|extends|case|exit|break|PHP_OS|eval|argc|parent|E_WARNING|as|or|E_ERROR|argv|old_function|E_PARSE|and)\b
+lang.php.tokens.reserved_words.format white
+lang.php.tokens.constants \b([A-Z_]+|[A-Z_][A-Z0-9_]+)\b
+lang.php.tokens.constants.format yellow bold
+lang.php.tokens.comments (\/\/.*)
+lang.php.tokens.comments.format 8 bold
+lang.php.comment_string //
+lang.php.tokens.preprocessor (^\s*#.*)
+lang.php.tokens.preprocessor.format yellow bold
+lang.php.tokens.non_alphanum ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.php.tokens.non_alphanum.format white
+lang.php.tokens.long_comments.open \/\*
+lang.php.tokens.long_comments.close \*\/
+lang.php.tokens.long_comments.format 8 bold
+lang.php.tokens.sql_string.open (<<<EOS)
+lang.php.tokens.sql_string.close (EOS)
+lang.php.tokens.sql_string.format 1
+lang.php.tokens.sql_string.change_to sql
+lang.php.tokens.js.open (<<<EOJS)
+lang.php.tokens.js.close (EOJS)
+lang.php.tokens.js.format 12 bold
+lang.php.tokens.js.change_to java
+lang.php.indent.size 4
+lang.php.indent.auto true
+lang.php.indent.roundup false
+#lang.php.indent.using_tabs true
+lang.php.indent.indenters ([{\[(]$)
+lang.php.indent.unindenters (^\s+[\]})])
+lang.php.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
+lang.php.indent.ignore ^(.+:|\s*?)$
+lang.php.context.ignore ^(.+:|\s*\{?)$
+
+# Perl
+
+lang.perl.filemask \.(?:pl|pm)$
+lang.perl.bangmask perl
+lang.perl.format.default white bold
+lang.perl.format.selection inverse
+lang.perl.format.found yellow inverse
+lang.perl.tokens.comments (#.*)
+lang.perl.tokens.comments.format 8 bold
+lang.perl.comment_string #
+lang.perl.tokens.constants \b([A-Z_]+|[A-Z_][A-Z0-9_]+)\b
+lang.perl.tokens.constants.format yellow bold
+lang.perl.tokens.non_alphanum [!#^&*()\[\]{}/?=+\-\\|,<.>;:~]
+lang.perl.tokens.non_alphanum.format white
+lang.perl.tokens.regular_expressions (\/.+?[^\\]\/)
+lang.perl.tokens.regular_expressions.format red bold
+lang.perl.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.perl.tokens.doublequoted_strings.format green bold
+lang.perl.tokens.singlequoted_strings ('.*?[^\\]')
+lang.perl.tokens.singlequoted_strings.format green bold
+lang.perl.tokens.backquoted_strings (`.*?[^\\]`)
+lang.perl.tokens.backquoted_strings.format red bold
+lang.perl.tokens.reserved_words \b(unless|until|else|for|while|foreach|if|return|do|next|elsif|last|redo|continue|sub|goto)\b
+lang.perl.tokens.reserved_words.format white
+lang.perl.tokens.builtins \b(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|connect|continue|cos|crypt|dbmclose|dbmopen|defined|delete|die|do|dump|each|endgrent|endhostent|endnetent|endprotoent|endpwent|endservent|eof|eval|exec|exists|exit|exp|fcntl|fileno|flock|fork|format|formline|getc|getgrent|getgrgid|getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|getppid|getpriority|getprotobyname|getprotobynumber|getprotoent|getpwent|getpwnam|getpwuid|getservbyname|getservbyport|getservent|getsockname|getsockopt|glob|gmtime|goto|grep|hex|import|index|int|ioctl|join|keys|kill|last|lc|lcfirst|length|link|listen|local|localtime|lock|log|lstat|m|map|mkdir|msgctl|msgget|msgrcv|msgsnd|my|next|no|oct|open|opendir|ord|our|pack|package|pipe|pop|pos|print|printf|prototype|push|q|qq|qr|quotemeta|qw|qx|rand|read|readdir|readline|readlink|readpipe|recv|redo|ref|rename|require|reset|return|reverse|rewinddir|rindex|rmdir|s|scalar|seek|seekdir|select|semctl|semget|semop|send|setgrent|sethostent|setnetent|setpgrp|setpriority|setprotoent|setpwent|setservent|setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|srand|stat|study|sub|substr|symlink|syscall|sysopen|sysread|sysseek|system|syswrite|tell|telldir|tie|tied|time|times|tr|truncate|uc|ucfirst|umask|undef|unlink|unpack|unshift|untie|use|utime|values|vec|wait|waitpid|wantarray|warn|write|y)\b
+lang.perl.tokens.builtins.format cyan bold
+lang.perl.tokens.array_variables \s(@[A-Za-z_][A-Za-z_0-9]*)\b
+lang.perl.tokens.array_variables.format red bold
+lang.perl.tokens.hash_variables \s(%[A-Za-z_][A-Za-z_0-9]*)\b
+lang.perl.tokens.hash_variables.format magenta bold
+lang.perl.indent.size 4
+lang.perl.indent.auto true
+lang.perl.indent.roundup true
+#lang.perl.indent.using_tabs true
+lang.perl.indent.indenters (case|[{\[(]$)
+lang.perl.indent.unindenters (case|^\s+[\]})])
+#lang.perl.indent.indenters \b(unless|else|for|while|foreach|if|do|elsif|sub)\b
+#lang.perl.indent.unindenters \b(else)\b
+lang.perl.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(`.+?[^\\]`)|(\/.+?[^\\]\/)|(^\s*#.*)
+lang.perl.indent.ignore ^\s*$
+lang.perl.context.ignore ^(.+:|\s*\{?)$
+lang.perl.column_delimiters =>?|:|,
+
+# Python
+
+lang.python.filemask \.py$
+lang.python.bangmask python
+lang.python.format.default white bold
+lang.python.format.selection inverse
+lang.python.format.found yellow inverse
+lang.python.tokens.constants \b([A-Z_]+|[A-Z_][A-Z0-9_]+)\b
+lang.python.tokens.constants.format yellow bold
+lang.python.tokens.non_alphanum [@!#$%^&*()\[\]{}/?=+\-\\|,<.>;:~]
+lang.python.tokens.non_alphanum.format white
+lang.python.tokens.comments (#.*)
+lang.python.tokens.comments.format 8 bold
+lang.python.comment_string #
+lang.python.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.python.tokens.doublequoted_strings.format green bold
+lang.python.tokens.singlequoted_strings ('.*?[^\\]')
+lang.python.tokens.singlequoted_strings.format green bold
+lang.python.tokens.backquoted_strings (`.*?[^\\]`)
+lang.python.tokens.backquoted_strings.format red bold
+lang.python.tokens.reserved_words \b(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|yield)\b
+lang.python.tokens.reserved_words.format white
+lang.python.indent.size 4
+lang.python.indent.auto true
+lang.python.indent.roundup true
+#lang.python.indent.using_tabs true
+lang.python.indent.indenters \b(class|def|elif|else|except|finally|for|if|try|while)\b
+#lang.python.indent.indenters :
+lang.python.indent.unindenters \b(else|elif|except)\b
+lang.python.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(`.+?[^\\]`)|(^\s*#.*)
+lang.python.indent.ignore ^\s*$
+
+# Java
+
+lang.java.filemask \.(?:java|js)$
+lang.java.format.default white bold
+lang.java.format.selection inverse
+lang.java.format.found yellow inverse
+lang.java.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.java.tokens.doublequoted_strings.format green bold
+lang.java.tokens.singlequoted_strings ('.*?[^\\]')
+lang.java.tokens.singlequoted_strings.format green bold
+lang.java.tokens.reserved_words \b(abstract|do|if|package|synchronized|boolean|double|implements|private|this|break|else|import|protected|throw|byte|extends|instanceof|public|throws|case|false|int|return|transient|catch|final|interface|short|true|char|finally|long|static|try|class|float|native|strictfp|void|const|for|new|super|volatile|continue|goto|null|switch|while|default|assert)\b
+lang.java.tokens.reserved_words.format white
+lang.java.tokens.constants \b([A-Z_]+|[A-Z_][A-Z0-9_]+)\b
+lang.java.tokens.constants.format yellow bold
+lang.java.tokens.comments (\/\/.*)
+lang.java.tokens.comments.format 8 bold
+lang.java.comment_string //
+lang.java.tokens.non_alphanum ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.java.tokens.non_alphanum.format white
+lang.java.tokens.long_comments.open \/\*
+lang.java.tokens.long_comments.close \*\/
+lang.java.tokens.long_comments.format 8 bold
+lang.java.tokens.regular_expressions (\/.+?[^\\]\/)
+lang.java.tokens.regular_expressions.format red bold
+lang.java.indent.size 4
+lang.java.indent.auto true
+lang.java.indent.roundup false
+#lang.java.indent.using_tabs true
+lang.java.indent.indenters (\{)
+lang.java.indent.unindenters (\})
+lang.java.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
+lang.java.indent.ignore ^(.+:|\s*?)$
+lang.java.context.ignore ^(.+:|\s*\{?)$
+lang.java.closers.for.regexp for$
+lang.java.closers.for.closer { |m| "( $i = 0; $i < limit; $i++ ) {\n%_\n}" }
+lang.java.column_delimiters =|:|,
+
+# C
+
+lang.c.filemask \.(c(pp|xx)?|h)$
+lang.c.format.default white bold
+lang.c.format.selection inverse
+lang.c.format.found yellow inverse
+lang.c.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.c.tokens.doublequoted_strings.format green bold
+lang.c.tokens.singlequoted_strings ('.*?[^\\]')
+lang.c.tokens.singlequoted_strings.format green bold
+lang.c.tokens.reserved_words \b(if|double|break|else|byte|case|int|return|short|char|long|static|void|for|super|continue|goto|switch|while)\b
+lang.c.tokens.reserved_words.format white
+lang.c.tokens.constants \b([A-Z_]+|[A-Z_][A-Z0-9_]+)\b
+lang.c.tokens.constants.format yellow bold
+lang.c.tokens.comments (\/\/.*)
+lang.c.tokens.comments.format 8 bold
+lang.c.comment_string //
+lang.c.tokens.preprocessor (^\s*#.*)
+lang.c.tokens.preprocessor.format yellow bold
+lang.c.tokens.non_alphanum ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.c.tokens.non_alphanum.format white
+lang.c.tokens.long_comments.open \/\*
+lang.c.tokens.long_comments.close \*\/
+lang.c.tokens.long_comments.format 8 bold
+lang.c.indent.size 4
+lang.c.indent.auto true
+lang.c.indent.roundup false
+#lang.c.indent.using_tabs true
+lang.c.indent.indenters (case|[{\[(]$)
+lang.c.indent.unindenters (case|^\s+[\]})])
+lang.c.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
+lang.c.indent.ignore ^(.+:|\s*?)$
+lang.c.context.ignore ^(.+:|\s*\{?)$
+
+# Configuration files
+
+lang.conf.filemask (?:\.conf(?:ig)?|\.cfg|\.cnf|user_prefs|XF86Config)$
+lang.conf.format.default white
+lang.conf.format.selection inverse
+lang.conf.format.found yellow inverse
+lang.conf.tokens.commands ^\s*([^\s=]+)
+lang.conf.tokens.commands.format cyan bold
+lang.conf.tokens.comments (^\s*#.*)
+lang.conf.tokens.comments.format yellow bold
+lang.conf.comment_string #
+lang.conf.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.conf.tokens.doublequoted_strings.format green bold
+lang.conf.tokens.singlequoted_strings ('.*?[^\\]')
+lang.conf.tokens.singlequoted_strings.format green bold
+lang.conf.indent.size 4
+lang.conf.indent.auto true
+lang.conf.indent.roundup true
+#lang.conf.indent.using_tabs true
+
+# crontab
+
+lang.crontab.filemask (?:^|\/)crontab$
+lang.crontab.format.default white
+lang.crontab.format.selection inverse
+lang.crontab.format.found yellow inverse
+lang.crontab.tokens.comments (^\s*#.*)
+lang.crontab.tokens.comments.format yellow bold
+lang.crontab.comment_string #
+lang.crontab.tokens.schedule ^((?:[0-9\/*,-]+\s+){5})
+lang.crontab.tokens.schedule.format cyan bold
+lang.crontab.tokens.commands ^(\S+=.+)
+lang.crontab.tokens.commands.format cyan
+lang.crontab.indent.size 4
+lang.crontab.indent.auto true
+lang.crontab.indent.roundup true
+#lang.crontab.indent.using_tabs true
+
+lang.fstab.filemask ^fstab$
+lang.fstab.format.default white
+lang.fstab.format.selection inverse
+lang.fstab.format.found yellow inverse
+lang.fstab.tokens.comments (^\s*#.*)
+lang.fstab.tokens.comments.format yellow bold
+lang.fstab.comment_string #
+lang.fstab.indent.size 4
+lang.fstab.indent.auto true
+lang.fstab.indent.roundup true
+#lang.fstab.indent.using_tabs true
+
+# SQL
+
+lang.sql.filemask \.sql$
+lang.sql.format.default white bold
+lang.sql.format.selection inverse
+lang.sql.format.found yellow inverse
+lang.sql.indent.size 4
+lang.sql.indent.auto true
+lang.sql.indent.roundup true
+#lang.sql.indent.using_tabs true
+#lang.sql.tokens.reserved_words.case_insensitive \b(ABSOLUTE|ACCESS|ACTION|ADD|ADMIN|AFTER|ALIAS|ALL|ALLOCATE|AND|ANY|ARE|AS|ASC|ASSERTION|AT|AUDIT|AUTHORIZATION|AVG|BEFORE|BEGIN|BETWEEN|BIT_LENGTH|BOTH|BREADTH|BY|CASCADE|CASCADED|CASE|CAST|CATALOG|CHAR_LENGTH|CHARACTER_LENGTH|CHECK|CLASS|CLOSE|CLUSTER|COALESCE|COBOL|COLLATE|COLLATION|COLUMN|COMPLETION|COMPRESS|COMPUTED|CONCAT|CONNECT|CONNECTION|CONSTRAINT|CONSTRAINTS|CONSTRUCTOR|CONTINUE|CONVERT|CORRESPONDING|COUNT|CROSS|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURRENT|CURSOR|CYCLE|DATA|DAY|DBHIGH|DBKEY|DBLOW|DBMAC|DEALLOCATE|DECLARE|DECODE|DEFAULT|DEFERRABLE|DEFERRED|DEPTH|DEREF|DESC|DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DIAGNOSTICS|DICTIONARY|DISCONNECT|DISTINCT|DO|DOMAIN|EACH|ELEMENT|ELSE|ELSEIF|END-EXEC|END|EQUALS|ESCAPE|EXCEPT|EXCEPTION|EXCEPTIONS|EXCLUSIVE|EXISTS|EXTERNAL|EXTERNALLY|EXTRACT|FALSE|FILE|FIRST|FOR|FOREIGN|FORTRAN|FOUND|FROM|FULL|FUNCTION|GENERAL|GET|GLOBAL|GO|GOTO|GROUP|HAVING|HOUR|IDENTIFIED|IDENTITY|IF|IGNORE|IMMEDIATE|IN|INCREMENT|INDEX|INDICATOR|INITIAL|INITIALLY|INNER|INOUT|INPUT|INSENSITIVE|INSTEAD|INTERSECT|INTERVAL|INTO|IS|ISOLATION|JOIN|KEY|LABEL|LANGUAGE|LAST|LEADING|LEAVE|LEFT|LESS|LEVEL|LIKE|LIMIT|LOCAL|LOCK|LOOP|LOWER|MATCH|MAX|MAXEXTENTS|MIN|MINUS|MINUTE|MLSLABEL|MLS_LABEL_FORMAT|MODE|MODIFY|MODULE|MONTH|MOVE|MULTISET|NAMES|NATIONAL|NATURAL|NEW_TABLE|NEXT|NO|NOAUDIT|NOCOMPRESS|NONE|NOT|NOWAIT|NULL|NULLIF|NUMBER|NVL|OCTET_LENGTH|OF|OFF|OFFLINE|OID|OLD|OLD_TABLE|ON|ONLINE|ONLY|OPEN|OPERATION|OPERATORS|OPTION|OR|ORDER|OTHERS|OUT|OUTER|OUTPUT|OVERLAPS|PAD|PARAMETER|PARTIAL|PASCAL|PCTFREE|PENDANT|PLI|POSITION|PRECISION|PREORDER|PRESERVE|PRIMARY|PRIOR|PRIVATE|PRIVILEGES|PROCEDURE|PROTECTED|PUBLIC|RAW|READ|READUP|REAL|RECORD|RECURSIVE|REF|REFERENCES|REFERENCING|RELATIVE|RENAME|REPLACE|REPRESENTATION|RESIGNAL|RESOURCE|RESTRICT|RETURN|RETURNS|RIGHT|ROLE|ROUTINE|ROW|ROWID|ROWNUM|ROWS|SAVEPOINT|SCHEMA|SCROLL|SEARCH|SECOND|SECTION|SENSITIVE|SEQUENCE|SESSION|SESSION_USER|SET|SHARE|SIGNAL|SIMILAR|SIZE|SOME|SPACE|SPECIFIC|SQL|SQLCODE|SQLERROR|SQLEXCEPTION|SQLSTATE|SQLWARNING|START|STRUCTURE|SUBSTRING|SUCCESSFUL|SUM|SYNONYM|SYSDATE|SYSTEM_USER|TABLE|TEMPLATE|TEMPORARY|TEST|THAN|THEN|THERE|SQ92|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TRAILING|TRANSACTION|TRANSLATE|TRANSLATION|TRIGGER|TRIM|TRUE|TUPLE|TYPE|UID|UNDER|UNION|UNIQUE|UNKNOWN|UPPER|USAGE|USER|USING|VALIDATE|VALUE|VALUES|VARIABLE|VARIANT|VIRTUAL|VARYING|VIEW|VISIBLE|VOID|WAIT|WHEN|WHENEVER|WHERE|WHILE|WITH|WITHOUT|WORK|WRITE|WRITEDOWN|WRITEUP|YEAR|ZONE)\b
+lang.sql.tokens.reserved_words.case_insensitive \b(ALL|AND|ANY|AS|ASC|BEGIN|BY|CASCADE|CASE|CAST|CHECK|COALESCE|COLUMN|CONSTRAINT|COUNT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURSOR|DECLARE|DEFAULT|DESC|DISTINCT|DO|ELSE|ELSEIF|END|EXCEPT|EXISTS|FALSE|FIRST|FOR|FOREIGN|FOUND|FROM|FULL|FUNCTION|GROUP|HAVING|HOUR|IF|IN|INCREMENT|INDEX|INNER|INPUT|INSTEAD|INTERSECT|INTERVAL|INTO|IS|JOIN|KEY|LANGUAGE|LAST|LEFT|LIKE|LIMIT|LOOP|MAX|MIN|NATURAL|NEXT|NO|NONE|NOT|NULL|NUMBER|OF|OFF|OLD|ON|ONLY|OR|ORDER|OUT|OUTER|PARTIAL|PRECISION|PRIMARY|REAL|RECORD|REF|REFERENCES|REPLACE|RESTRICT|RETURN|RETURNS|RIGHT|SCHEMA|SEQUENCE|SET|SUM|TABLE|TEMPORARY|THAN|THEN|TO|TRANSACTION|TRIGGER|TRUE|TYPE|UNION|UNIQUE|UPPER|USING|VALUE|VALUES|VARYING|VIEW|WHEN|WHERE|WHILE|WITH|WITHOUT|WORK)\b
+lang.sql.tokens.reserved_words.format white
+lang.sql.tokens.commands.case_insensitive \b(ALTER|COMMENT|COMMIT|CREATE|DELETE|DROP|EXEC|EXECUTE|FETCH|GRANT|INSERT|PERFORM|PREPARE|REVOKE|ROLLBACK|SELECT|UPDATE)\b
+lang.sql.tokens.commands.format cyan
+lang.sql.tokens.data_types.case_insensitive \b(BIT|BOOLEAN|CHAR|CHARACTER|DATE|DEC|DECIMAL|DOUBLE|FLOAT|INT|INTEGER|INTERVAL|LONG|NCHAR|NUMBER|NUMERIC|REAL|RECORD|ROW|SMALLINT|STRUCTURE|TIME|TIMESTAMP|TUPLE|VARCHAR|VARCHAR2)\b
+lang.sql.tokens.data_types.format brown
+lang.sql.tokens.comments (--.*)
+lang.sql.tokens.comments.format 8 bold
+lang.sql.comment_string --
+lang.sql.tokens.singlequoted_strings ('.*?[^\\]')
+lang.sql.tokens.singlequoted_strings.format green bold
+lang.sql.tokens.non_alphanum ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.sql.tokens.non_alphanum.format white
+lang.sql.tokens.typos (==)
+lang.sql.tokens.typos.format 15 bold
+lang.sql.indent.indenters ((?:\(|BEGIN|DECLARE|FROM|LOOP|ORDER BY|SELECT|SET|WHERE)$)
+lang.sql.indent.unindenters (^\s+(?:\)|;|BEGIN|DECLARE|END))
+lang.sql.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')
+lang.sql.context.ignore ^(\W+)$
+
+# Bash
+
+lang.bash.filemask (?:\.(?:ebuild|bash_profile|bashrc))$
+lang.bash.bangmask (?:ba)?sh\b
+lang.bash.format.default white bold
+lang.bash.format.selection inverse
+lang.bash.format.found yellow inverse
+lang.bash.indent.size 4
+lang.bash.indent.auto true
+lang.bash.indent.roundup true
+#lang.bash.indent.using_tabs true
+lang.bash.tabsize 4
+lang.bash.tokens.comments (^\s*#.*)
+lang.bash.tokens.comments.format 8 bold
+lang.bash.comment_string #
+lang.bash.tokens.singlequoted_strings ('.*?[^\\]')
+lang.bash.tokens.singlequoted_strings.format green bold
+lang.bash.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.bash.tokens.doublequoted_strings.format green bold
+lang.bash.tokens.backquoted_strings (`.*?[^\\]`)
+lang.bash.tokens.backquoted_strings.format red bold
+lang.bash.indent.indenters (\{)
+lang.bash.indent.unindenters (\})
+lang.bash.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
+lang.bash.indent.ignore ^(.+:|\s*?)$
+
+# Tcl
+
+lang.tcl.filemask \.tcl$
+lang.tcl.bangmask tcl
+lang.tcl.format.default white bold
+lang.tcl.format.selection inverse
+lang.tcl.format.found yellow inverse
+lang.tcl.indent.size 4
+lang.tcl.indent.auto true
+lang.tcl.indent.roundup true
+#lang.tcl.indent.using_tabs true
+lang.tcl.tabsize 4
+lang.tcl.tokens.comments (^\s*#.*)
+lang.tcl.tokens.comments.format 8 bold
+lang.tcl.comment_string #
+lang.tcl.tokens.reserved_words \b(encoding|incr|pid|tcl_endOfWord|Tcl|eof|info|tcl_findLibrary|after|error|interp|pkg_mkIndex|tcl_startOfNextWord|append|eval|join|proc|tcl_startOfPreviousWord|array|exec|lappend|puts|tcl_wordBreakAfter|auto_execok|exit|lassign|pwd|tcl_wordBreakBefore|auto_import|expr|lindex|re_syntax|tcltest|auto_load|fblocked|linsert|read|tclvars|auto_mkindex|fconfigure|list|regexp|tell|auto_mkindex_old|fcopy|llength|registry|time|auto_qualify|file|load|regsub|trace|auto_reset|fileevent|lrange|rename|unknown|bgerror|filename|lrepeat|resource|unload|binary|flush|lreplace|return|unset|break|for|lsearch|scan|update|catch|foreach|lset|seek|uplevel|cd|format|lsort|set|upvar|clock|gets|memory|socket|variable|close|glob|msgcat|source|vwait|concat|global|namespace|split|while|continue|history|open|string|dde|http|package|subst|dict|if|parray|switch)\b
+lang.tcl.tokens.reserved_words.format white
+lang.tcl.tokens.non_alphanum ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.tcl.tokens.non_alphanum.format white
+lang.tcl.tokens.variables (\$[A-Za-z_][A-Za-z_0-9]*)\b
+lang.tcl.tokens.variables.format yellow bold
+lang.tcl.tokens.doublequoted_strings (\".*?[^\\]\")
+lang.tcl.tokens.doublequoted_strings.format green bold
+lang.tcl.indent.indenters (\{)
+lang.tcl.indent.unindenters (\})
+lang.tcl.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
+
+lang.diff.filemask (?:\.(?:diff|patch)|COMMIT_EDITMSG)$
+lang.diff.format.default white
+lang.diff.format.selection inverse
+lang.diff.format.found yellow inverse
+lang.diff.indent.size 4
+lang.diff.indent.auto false
+#lang.diff.indent.using_tabs true
+lang.diff.tabsize 4
+lang.diff.tokens.oldfile (^--- .+$)
+lang.diff.tokens.oldfile.format red bold
+lang.diff.tokens.newfile (^\+\+\+ .+$)
+lang.diff.tokens.newfile.format green bold
+lang.diff.tokens.oldline (^-.+$)
+lang.diff.tokens.oldline.format red bold
+lang.diff.tokens.newline (^\+.+$)
+lang.diff.tokens.newline.format green bold
+lang.diff.tokens.location (^@@.+$)
+lang.diff.tokens.location.format green
+lang.diff.tokens.filediff (^Only in .+$)
+lang.diff.tokens.filediff.format magenta bold
+lang.diff.tokens.diff_command (^diff .+$)
+lang.diff.tokens.diff_command.format 13 bold
+
+lang.yaml.filemask (?:\.ya?ml)$
+lang.yaml.bangmask ^---
+lang.yaml.format.default white bold
+lang.yaml.format.selection inverse
+lang.yaml.format.found yellow inverse
+lang.yaml.indent.size 4
+lang.yaml.indent.auto false
+lang.yaml.indent.roundup false
+lang.yaml.tabsize 8
+lang.yaml.tokens.value_indicator (:)(?: |$)
+lang.yaml.tokens.value_indicator.format white
+lang.yaml.tokens.key_indicator (\? )
+lang.yaml.tokens.key_indicator.format white
+lang.yaml.tokens.nested_series (?:^|[^-])(- )
+lang.yaml.tokens.nested_series.format magenta bold
+lang.yaml.tokens.series_separator (,)
+lang.yaml.tokens.series_separator.format white
+lang.yaml.tokens.inline_series ([\[\]])
+lang.yaml.tokens.inline_series.format white
+lang.yaml.tokens.inline_keyed ([{}])
+lang.yaml.tokens.inline_keyed.format white
+lang.yaml.tokens.doublequoted_strings (\".*?[^\\]\"|\"\")
+lang.yaml.tokens.doublequoted_strings.format green bold
+lang.yaml.tokens.singlequoted_strings ('.*?[^\\]'|'')
+lang.yaml.tokens.singlequoted_strings.format green bold
+lang.yaml.tokens.block_scalar (\|[0-9+-]*)$
+lang.yaml.tokens.block_scalar.format blue bold
+lang.yaml.tokens.folded_scalar (>[0-9+-]*)$
+lang.yaml.tokens.folded_scalar.format blue bold
+lang.yaml.tokens.document_header ^(---.*)$
+lang.yaml.tokens.document_header.format 10 bold
+lang.yaml.tokens.document_terminator ^(\.\.\.)
+lang.yaml.tokens.document_terminator.format 10
+lang.yaml.tokens.directive_indicator ^(%.*)
+lang.yaml.tokens.directive_indicator.format 10
+lang.yaml.tokens.comment_indicator (#.+)
+lang.yaml.tokens.comment_indicator.format 8 bold
+lang.yaml.comment_string #
+lang.yaml.tokens.anchor_indicator (&\w+)
+lang.yaml.tokens.anchor_indicator.format red bold
+lang.yaml.tokens.alias_indicator (\*\w+)
+lang.yaml.tokens.alias_indicator.format yellow
+lang.yaml.tokens.tag (!\w*)
+lang.yaml.tokens.tag.format yellow bold
+lang.yaml.tokens.null (~|null)
+lang.yaml.tokens.null.format red
+lang.yaml.indent.size 4
+lang.yaml.indent.auto true
+lang.yaml.indent.roundup true
+lang.yaml.indent.indenters :$
+lang.yaml.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(`.+?[^\\]`)|(^\s*#.*)
+lang.yaml.indent.ignore ^\s*$
+
+lang.haml.filemask \.haml$
+lang.haml.format.default white bold
+lang.haml.format.selection inverse
+lang.haml.format.found yellow inverse
+lang.haml.tabsize 8
+lang.haml.indent.size 2
+lang.haml.indent.auto true
+lang.haml.indent.roundup true
+lang.haml.indent.using_tabs false
+lang.haml.tokens.code.open [=~-]
+lang.haml.tokens.code.close $
+lang.haml.tokens.code.format 9 bold
+lang.haml.tokens.code.change_to ruby
+lang.haml.tokens.tags (%\w+\b)
+lang.haml.tokens.tags.format white
+lang.haml.tokens.hash.open [{\[]
+lang.haml.tokens.hash.close [}\]]
+lang.haml.tokens.hash.format blue bold
+lang.haml.tokens.hash.change_to ruby
+lang.haml.tokens.class \.\w+
+lang.haml.tokens.class.format cyan bold
+lang.haml.tokens.id #\w+
+lang.haml.tokens.id.format cyan
+lang.haml.tokens.xml !!!
+lang.haml.tokens.xml.format magenta bold
+lang.haml.tokens.html_comment ^ *(\/.*)
+lang.haml.tokens.html_comment.format 8 bold
+lang.haml.tokens.line_joiner \|$
+lang.haml.tokens.line_joiner.format 12 bold
+
+#% SiSU
+lang.sisu.filemask \.(?:sst|ssm|ssi|[_-]sst)$
+lang.sisu.format.default white
+lang.sisu.tokens.comment ^%+\s+.*
+lang.sisu.tokens.comment.format 8
+#langsisu.tokens.comments.format 8 bold
+lang.sisu.tokens.header ^(@\S+?:|0~\S+)\s+.*
+lang.sisu.tokens.header.format cyan
+lang.sisu.tokens.heading ^:?[A-C1-9]~(?:\S+)?\s+.*
+lang.sisu.tokens.heading.format yellow bold
+#lang.sisu.tokens.heading.format white inverse
+lang.sisu.tokens.headings.case_insensitive ^(?:Chapter|Part|Section|Book|Article|Preamble|Appendix)\s.*
+lang.sisu.tokens.headings.format white bold
+lang.sisu.tokens.bullet ^_[1-9]?\*\s+
+lang.sisu.tokens.bullet.format yellow
+lang.sisu.tokens.indent ^_[1-9]\s+
+lang.sisu.tokens.indent.format yellow
+lang.sisu.tokens.link \{.+?\}(?:https?://\S+|\.\./\S+|image)
+lang.sisu.tokens.link.format cyan
+lang.sisu.tokens.url http://\S+
+lang.sisu.tokens.url.format blue bold
+lang.sisu.tokens.url ^\<\<\s+\S+?\.ss[it]$
+lang.sisu.tokens.line_bold ^!_\s+.*
+lang.sisu.tokens.line_bold.format white bold
+lang.sisu.tokens.font_bold (([!*])\{.+?\}\2)
+lang.sisu.tokens.font_bold.format white bold
+lang.sisu.tokens.font_modify (([/_^,+-])\{.+?\}\2)
+lang.sisu.tokens.font_modify.format brown
+lang.sisu.tokens.page_break <:(?:pb|np)>
+lang.sisu.tokens.page_break.format white bold inverse
+lang.sisu.tokens.br <:?br>
+lang.sisu.tokens.br.format white bold inverse
+lang.sisu.tokens.endnote_mark ~\^(?:\s|$)
+lang.sisu.tokens.endnote_mark.format green
+lang.sisu.tokens.endnote_content ^\^~\s.+
+lang.sisu.tokens.endnote_content.format green
+#lang.sisu.tokens.endnote.open ~\{
+#lang.sisu.tokens.endnote.close \}~
+lang.sisu.tokens.endnotes ~\{.+?\}~
+lang.sisu.tokens.endnotes.format green
+lang.sisu.tokens.group.open ^group\{
+lang.sisu.tokens.group.close ^\}group
+lang.sisu.tokens.group.format green
+lang.sisu.tokens.poem.open ^poem\{
+lang.sisu.tokens.poem.close ^\}poem
+lang.sisu.tokens.poem.format green
+lang.sisu.tokens.code.open ^code\{
+lang.sisu.tokens.code.close ^\}code
+lang.sisu.tokens.code.format green
+lang.sisu.tokens.sem (([a-z]+):\{.+?\}:\2)
+lang.sisu.tokens.sem (([a-z]+);\{.+?\};\2)
+lang.sisu.tokens.sem (([a-z]+):\[.+?\]:\2)
+lang.sisu.tokens.sem (([a-z]+);\[.+?\];\2)
+lang.sisu.tokens.sem.format green
+lang.sisu.tokens.error \s+$|<\S{2}\S+?>|[a-zA-Z0-9,.::?!&><]+http://\S+|http://\S+<
+#lang.sisu.tokens.error \s+$|<\S+?>|[a-zA-Z0-9,.::?!&><]+http://\S+|http://\S+<
+lang.sisu.tokens.error.format magenta reverse
+
+# Custom configuration files can be included.
+# If a setting is specified again, it overrides the previous setting given
+# higher up in the configuration file(s).
+
+include ~/.diakonos/pistos.conf
+
+# Uncomment this line if your terminal supports 256 colours.
+#include ~/.diakonos/diakonos-256-colour.conf
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/emacs/README b/data/sisu/v3dv/conf/editor-syntax-etc/emacs/README
new file mode 100644 (file)
index 0000000..24816c1
--- /dev/null
@@ -0,0 +1,5 @@
+put this into your .emacs file, then use the mode file:
+
+(load-file "~/emacs/el/sisu-mode.el")
+(add-to-list 'auto-mode-alist '("\\.sst$" . sisu-mode))
+
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/emacs/sisu-mode.el b/data/sisu/v3dv/conf/editor-syntax-etc/emacs/sisu-mode.el
new file mode 100644 (file)
index 0000000..84e7cbe
--- /dev/null
@@ -0,0 +1,368 @@
+;;; sisu-mode.el --- a major-mode for highlighting a hierarchy structured text.
+;; @Author: Ambrose Kofi Laing & Ralph Amissah
+;; @Keywords: text, syntax, processes, tools
+;; @Version: 3.0.7 2011-04-20 (2008-12-14)
+;; @URL: <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/emacs/sisu-mode.el;hb=HEAD>
+;; @Copyright: Assigned to FSF 2011-04-08 (GNU EMACS)
+;; @License: GPLv3
+;; @Home URL: SiSU:   http://www.jus.uio.no/sisu
+;; originally looked at (based on) doc-mode, with kind permission of the author
+;;   Author: SUN, Tong <suntong001@users.sf.net>, (c)2001-6, all right reserved
+;;   Version: $Date: 2006/01/19 03:13:41 $ $Revision: 1.14 $
+;;   Home URL: http://xpt.sourceforge.net/
+;;
+;;   Distribute freely, but please include the author's info & copyright,
+;;   the file's version & url with the distribution.
+;;
+;  Viva Software Libre!
+;; Support the free software movement!
+;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;{{{ Commentary:
+
+;;
+;; To enter sisu-mode automatically, add (autoload 'sisu-mode "sisu-mode")
+;; to your .emacs file and change the first line of your sisu file to:
+;; # -*- Sisu -*-
+;; if it doesn't have a .sisu extension.
+;;
+;; To handle .sisu files, e.g., 'filename.sisu', add something like
+;; (add-to-list 'auto-mode-alist '("\\.sisu$" . sisu-mode))
+;; to your .emacs file
+
+;;
+;; The documentation for the "Structure Of The Hierarchy Text" can be found in
+;; the sisustring for the sisu-mode function.
+;;
+
+;;}}}
+
+;;{{{ Variables:
+
+(defgroup sisu-faces nil
+  "AsciiSisu highlighting"
+  :group 'sisus)
+
+;; == Colors
+; color n is more prominent than color n+1
+
+(defface sisu-title-1-face
+  `((((class color)
+      (background dark))
+     (:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch))
+    (((class color)
+      (background light))
+     (:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch))
+    (t (:weight bold :inherit variable-pitch)))
+  "Face for AsciiSisu titles at level 1."
+  :group 'sisu-faces)
+
+(defface sisu-title-2-face
+  `((((class color)
+      (background dark))
+     (:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch))
+    (((class color)
+      (background light))
+     (:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch))
+    (t (:weight bold :inherit variable-pitch)))
+  "Face for AsciiSisu titles at level 2."
+  :group 'sisu-faces)
+
+(defface sisu-title-3-face
+  `((((class color)
+      (background dark))
+     (:foreground "sienna3" :bold t))
+    (((class color)
+      (background light))
+     (:foreground "sienna3" :bold t))
+    (t (:weight bold)))
+  "Face for AsciiSisu titles at level 3."
+  :group 'sisu-faces)
+
+(defface sisu-title-4-face
+  `((((class color)
+      (background dark))
+     (:foreground "burlywood3"))
+    (((class color)
+      (background light))
+     (:foreground "burlywood3"))
+    (t ()))
+  "Face for AsciiSisu titles at level 4."
+  :group 'sisu-faces)
+
+(defface info-node
+  '((((class color) (background light)) (:foreground "brown" :bold t :italic t))
+    (((class color) (background dark)) (:foreground "white" :bold t :italic t))
+    (t (:bold t :italic t)))
+  "Face for Info node names."
+  :group 'sisu-faces)
+
+(defvar sisu-title-1 'sisu-title-1-face)
+(defvar sisu-title-2 'sisu-title-2-face)
+(defvar sisu-title-3 'sisu-title-3-face)
+(defvar sisu-title-4 'sisu-title-4-face)
+
+(defvar general-font-lock-red1 font-lock-warning-face)
+(defvar general-font-lock-red2 font-lock-comment-face)
+(defvar general-font-lock-red3 font-lock-string-face)
+
+(defvar general-font-lock-green1 font-lock-type-face)
+(defvar general-font-lock-green2 font-lock-constant-face)
+
+(defvar general-font-lock-blue1 font-lock-keyword-face)
+(defvar general-font-lock-blue2 font-lock-function-name-face)
+(defvar general-font-lock-blue3 font-lock-builtin-face)
+
+(defvar general-font-lock-yellow1 font-lock-variable-name-face)
+(defvar general-font-lock-yellow2 font-lock-comment-face)
+
+;; == sisu-mode settings
+
+(defvar sisu-mode-hook nil
+  "Normal hook run when entering Sisu Text mode.")
+
+(defvar sisu-mode-abbrev-table nil
+  "Abbrev table in use in Sisu-mode buffers.")
+(define-abbrev-table 'sisu-mode-abbrev-table ())
+
+(defconst sisu-font-lock-keywords
+  (eval-when-compile
+    (list
+
+     ;;grouped text
+     (cons "^group\{\\|^\}group"       'general-font-lock-red2)
+     (cons "^block\{\\|^\}block"       'general-font-lock-red2)
+     (cons "^code\{\\|^\}code"         'general-font-lock-red2)
+     (cons "^poem\{\\|^\}poem"         'general-font-lock-red2)
+     (cons "^alt\{\\|^\}alt"           'general-font-lock-red2)
+     (cons "^table\{.+\\|^\}table"     'general-font-lock-red2)
+     (cons "^\{table[^}]+\}"           'general-font-lock-red2)
+
+     ;; footnote/endnote
+       ;(cons "\~\{.+?\}\~"  'general-font-lock-green1)
+     (cons "\~\{\\*\\*\\|\~\{\\*\\|\~\{\\|\}\~"   'general-font-lock-red2)
+     (cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~"  'general-font-lock-red2)
+
+     (cons "\~\\^ \\|^\\^\~ " 'general-font-lock-red2)
+
+     (list (concat
+      "\\(\*\~\\)"
+      "\\([^ \r\t\n]+\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-blue2 t))
+
+     ;; emphasis (can be program configured to be bold italics or underscore)
+     (list (concat
+      "\\([*]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[*]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+     '(3 general-font-lock-red1 t))
+
+     ;; bold
+     (list (concat
+      "\\([!]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[!]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+     '(3 general-font-lock-red1 t))
+     (cons "\\*[^ ]+\\*"               'general-font-lock-red1)
+     (cons "^!_ .+"                    'general-font-lock-red1)
+
+     ;;; italics
+     (list (concat
+      "\\([/]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[/]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-blue1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;; underscore
+     (list (concat
+      "\\([_]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[_]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;; monospace
+     (list (concat
+      "\\([#]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[#]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;; citation
+     (list (concat
+      "\\([\"]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[\"]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;; inserted text
+     (list (concat
+      "\\([\+]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[\+]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;; strike through
+     (list (concat
+      "\\(\\-\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}\\-\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;; superscript
+     (list (concat
+      "\\(\\^\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}\\^\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;; subscript
+     (list (concat
+      "\\([,]\{\\)"
+      "\\([^\}]+\\)"
+      "\\(\}[,]\\)")
+     '(1 general-font-lock-red1 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-red1 t))
+
+     ;;numbered list
+     (cons "^# \\|^_# "                'general-font-lock-red1)
+
+     ;;bullet text
+     (cons "^_\\*[1-9] \\|^_\\* "      'general-font-lock-red1)
+
+     ;;indented text
+     (cons "^_[1-9] "                  'general-font-lock-red1)
+     (cons "^_[1-9]! "                 'general-font-lock-red1)
+
+     ;hanging indented text [proposed enable when implemented]
+      (cons "^__[1-9] "                'general-font-lock-red1)
+      (cons "^_[0-9]_[0-9] "           'general-font-lock-red1)
+      (cons "^__[1-9]! "               'general-font-lock-red1)
+      (cons "^_[0-9]_[0-9]! "          'general-font-lock-red1)
+
+     ;;url
+     (cons "\\(^\\|[ ]\\)http:[/][/][^ \t\n\r<]+" 'general-font-lock-blue2)
+
+     ;; Comment Lines
+     (cons "^% .*"                     'general-font-lock-blue1)
+
+     ;; line break
+     (cons " \\\\\\\\ "                    'general-font-lock-red1)
+     ;; line break (depreciated)
+     (cons "<br>"                      'general-font-lock-red1)
+
+     ;; Section titles
+     (list "^\\(\\([1-8]\\|:?[A-C]\\)\\~\\)\\(.*\\)"
+     '(1 sisu-title-1 t)
+     '(3 sisu-title-2 t))
+
+     ;; hyper-links
+     (list (concat
+      "\\(\{~^\\|\{\\)"
+      "\\([^\}\{]+\\)"
+      "\\(\}http:[/][/][^ \r\n\t<]+\\)")
+     '(1 general-font-lock-blue2 t)
+     '(2 general-font-lock-red1 t)
+     '(3 general-font-lock-blue2 t))
+
+     ;; book index
+     (cons "^\=\{.+\}"                 'general-font-lock-green1)
+
+     ;; numbers
+     (cons "\\<[.0-9]+\\>"             'general-font-lock-green2)
+
+     ;; bullets sisu_normal (nearly copied regexp)
+     (cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'general-font-lock-blue2)
+
+     ;; image links
+     (list (concat
+      "\\(\{\\)"
+      "\\([^\}\{]+\\)"
+      "\\(\}image\\)")
+     '(1 general-font-lock-blue2 t)
+     '(2 general-font-lock-red1 t)
+           '(3 general-font-lock-blue2 t))
+
+     ;; insert file links
+     (list (concat
+      "\\(<< \\)"
+      "\\([^ \r\t\n]+\\.ss\\)"
+      "\\(i\\|t\\)")
+     '(1 general-font-lock-blue2 t)
+     '(2 general-font-lock-blue2 t)
+           '(3 general-font-lock-blue2 t))
+
+     ;; raw keywords
+     (list (concat
+      "^\\(\\@\\("
+      "title\\|"
+      "creator\\|"
+      "date\\|"
+      "publisher\\|"
+      "rights\\|"
+      "classify\\|"
+      "original\\|"
+      "notes\\|"
+      "links\\|"
+      "make\\|"
+      "\\):\\)\\(.*\\)")
+     '(1 sisu-title-2 keep)
+     '(3 sisu-title-3 keep))
+
+     ))
+ "Default expressions to highlight in AsciiSisu mode.")
+
+;;}}}
+
+;;{{{ Sisu & Autoload:
+
+;;###autoload
+(define-derived-mode sisu-mode text-mode "SiSU"
+  "Major mode for editing SiSU files."
+  (interactive)
+  (modify-syntax-entry ?\'  ".")
+  ;(flyspell-mode nil)
+
+  (make-local-variable 'paragraph-start)
+  (setq paragraph-start (concat "$\\|>" page-delimiter))
+  (make-local-variable 'paragraph-separate)
+  (setq paragraph-separate paragraph-start)
+  (make-local-variable 'paragraph-ignore-fill-prefix)
+  (setq paragraph-ignore-fill-prefix t)
+
+  (make-local-variable 'require-final-newline)
+  (setq require-final-newline t)
+
+  (make-local-variable 'font-lock-defaults)
+  (setq font-lock-defaults
+  '(sisu-font-lock-keywords
+    nil        ; KEYWORDS-ONLY: no
+    nil        ; CASE-FOLD: no
+    ((?_ . "w"))      ; SYNTAX-ALIST
+    ))
+  (run-hooks 'sisu-mode-hook))
+
+(provide 'sisu-mode)
+
+;;}}}
+
+;;; sisu-mode.el ends here
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/gedit/sisu.lang b/data/sisu/v3dv/conf/editor-syntax-etc/gedit/sisu.lang
new file mode 100644 (file)
index 0000000..b82d5f8
--- /dev/null
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language _name="SiSU" version="1.0" _section="Markup" mimetypes="text/x-ruby">
+<!-- SiSU syntax highligting for gedit, place in:
+  /usr/share/gtksourceview-1.0/language-specs
+or:
+  ~/gtksourceview-1.0/language-specs
+-->
+
+  <syntax-item _name="Header" style="Data Type">
+    <start-regex>^0~\S|^\@\S+:\s</start-regex>
+    <end-regex>\n\n</end-regex>
+  </syntax-item>
+
+  <pattern-item _name="Bold" style="Keyword" end-at-line-end = "TRUE">
+    <regex>^(:[A-C]|[1-6])~[a-zA-Z0-9.?_-]*\s+.+</regex>
+  </pattern-item>
+
+  <pattern-item _name="Operators" style="Function">
+    <regex>^(!_|_[1-9]|_[1-9]?\*)\s</regex>
+  </pattern-item>
+
+  <syntax-item _name="Note Function" style="Function">
+    <start-regex>~\{</start-regex>
+    <end-regex>\}~</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Bold Function" style="Function">
+    <start-regex>[*]\{</start-regex>
+    <end-regex>\}[*]</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Exclaim Function" style="Function">
+    <start-regex>!\{</start-regex>
+    <end-regex>\}!</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Italics Function" style="Function">
+    <start-regex>/\{</start-regex>
+    <end-regex>\}/</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Underscore Function" style="Function">
+    <start-regex>_\{</start-regex>
+    <end-regex>\}_</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Supercript Function" style="Function">
+    <start-regex>\^{</start-regex>
+    <end-regex>\}\^</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Subscript Function" style="Function">
+    <start-regex>,{</start-regex>
+    <end-regex>\},</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Added Function" style="Function">
+    <start-regex>[+]\{</start-regex>
+    <end-regex>\}[+]</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Strikethrough Function" style="Function">
+    <start-regex>[-]\{</start-regex>
+    <end-regex>\}[-]</end-regex>
+  </syntax-item>
+
+  <pattern-item _name="Bold Single" style="String">
+    <regex>[*]\S+[*]</regex>
+  </pattern-item>
+
+  <pattern-item _name="Link" style="String">
+    <regex>\{[^}]+\}(https?:\/\/\S+|image)\s</regex>
+  </pattern-item>
+
+  <pattern-item _name="Link Internal" style="String">
+    <regex>\s\*~\S+</regex>
+  </pattern-item>
+
+  <pattern-item _name="Url" style="String">
+    <regex>http[s]*:\/\/\S+</regex>
+  </pattern-item>
+
+  <pattern-item _name="Url" style="String">
+    <regex>^&lt;&lt;\s+\S+\.ss[ti]</regex>
+  </pattern-item>
+
+  <line-comment _name="Line Comment" style="Comment">
+    <start-regex>^%+\s.</start-regex>
+  </line-comment>
+
+  <syntax-item _name="Multiline Code" style="Others">
+    <start-regex>^code\{\s*$</start-regex>
+    <end-regex>^\}code\s*$</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Multiline Poem" style="Others">
+    <start-regex>^poem\{\s*$</start-regex>
+    <end-regex>^\}poem\s*$</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Multiline Group" style="Others">
+    <start-regex>^group\{\s*$</start-regex>
+    <end-regex>^\}group\s*$</end-regex>
+  </syntax-item>
+
+  <syntax-item _name="Multiline Alt" style="Others">
+    <start-regex>^alt\{\s*$</start-regex>
+    <end-regex>^\}alt\s*$</end-regex>
+  </syntax-item>
+
+  <pattern-item _name="Page Break" style="Others 2" end-at-line-end = "TRUE">
+    <regex>&lt;:(pb|np)&gt;</regex>
+  </pattern-item>
+
+  <pattern-item _name="Line Break" style="Others 2" end-at-line-end = "TRUE">
+    <regex>&lt;:?br&gt;</regex>
+  </pattern-item>
+
+  <pattern-item _name="Footnote Reference" style="Others" end-at-line-end = "TRUE">
+    <regex>~\^(\s|$)</regex>
+  </pattern-item>
+
+  <pattern-item _name="Footnote Content" style="Others" end-at-line-end = "TRUE">
+    <regex>^\^~\s.+</regex>
+  </pattern-item>
+
+</language>
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/kate/sisu.xml b/data/sisu/v3dv/conf/editor-syntax-etc/kate/sisu.xml
new file mode 100644 (file)
index 0000000..a8054f2
--- /dev/null
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="SiSU" version="1.00" section="Markup" kateversion="2.4" extensions="*.sst; *.ssm; *.ssi; *._sst; *.-sst;" author="Ralph Amissah (ralph.amissah@gmail.com)" license="LGPL" >
+  <highlighting>
+    <list name="somename">
+      <item> class </item>
+      <item> const </item>
+    </list>
+    <contexts>
+    <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text" >
+      <StringDetect String="&lt;br&gt;" attribute="Break" context="#pop" />
+      <RegExpr String="\s+$" attribute="Warn" context="#pop" />
+      <RegExpr String="&lt;\S+&gt;" attribute="Warn" context="#pop"  />
+      <RegExpr String="&lt;a href=\S+&gt;" attribute="Warn" context="#pop"  />
+      <RegExpr String="&lt;a href=" attribute="Warn" context="#pop"  />
+      <RegExpr String="&lt;/a&gt;" attribute="Warn" context="#pop" />
+      <RegExpr String="&lt;https?:\/\/\S+&gt;" attribute="Warn" context="#pop"/>
+      <RegExpr String="&gt;https?:\/\/\S+" attribute="Warn" context="#pop"/>
+      <RegExpr String="^&lt;&lt;\s+[a-zA-Z._]+\.ss[it]" attribute="Link" context="#pop"/>
+      <RegExpr String="^&lt;&lt;\{\s*[a-zA-Z._]+\.ss[it]\s*\}" attribute="Link" context="#pop"/>
+      <RegExpr String="&lt;&lt;\s+&#124;" attribute="Link" context="#pop"/>
+      <RegExpr String="https?:\/\/\S+&lt;" attribute="Warn" context="#pop"/>
+      <keyword attribute="Keyword" context="#stay" String="somename" />
+      <DetectChar attribute="String" context="string" char="&quot;" />
+      <RegExpr String="^(0~\S+|@\S+)\s.+$" attribute="Header" context="#pop" />
+      <RegExpr String="^:?[A-C1-9]~.+$" attribute="Heading" context="#pop" />
+      <StringDetect String="~{" attribute="Endnote" context="footnote"/>
+      <StringDetect String="^~" attribute="Endnote" context="endnote"/>
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+      <RegExpr String="\{[\s\S]+\}https?:\/\/\S+(\s|$)" attribute="Link" context="#pop" minimal="true" />
+      <RegExpr String="\{[\s\S]+\}\.\.\/\S+(\s|$)" attribute="Link" context="#stay" minimal="true" />
+      <RegExpr String="\{[\s\S]+\}image(\s|$)" attribute="Link" context="#stay" minimal="true" />
+      <RegExpr String="\s_?https?:\/\/\S+" attribute="Link" context="#stay"/>
+      <RegExpr String="^_?https?:\/\/\S+" attribute="Link" context="#stay"/>
+      <RegExpr String="^!_ .+" attribute="Bold" context="boldline"/>
+      <RegExpr String="^(_[1-9]|_\*|_[1-9]\*)\s" attribute="Indent" context="#stay"/>
+      <RegExpr String="~\^" attribute="Endnote" context="#stay"/>
+      <RegExpr String="^%+\s.+$" attribute="Comment" context="#stay" endRegion="regionMarker" firstNonSpace="true" />
+    </context>
+    <context attribute="String" lineEndContext="#stay" name="string" >
+      <DetectChar attribute="String" context="#pop" char="&quot;" />
+    </context>
+    <context attribute="Endnote" lineEndContext="#stay" name="footnote" >
+      <StringDetect attribute="Endnote" context="#pop" String="}~" />
+      <RegExpr String="\{[\s\S]+\}https?:\/\/\S+(\s|$)" attribute="Link" context="#pop" minimal="true" />
+      <RegExpr String="\{[\s\S]+\}\.\.\/\S+(\s|$)" attribute="Link" context="#stay" minimal="true" />
+      <RegExpr String="\{[\s\S]+\}image(\s|$)" attribute="Link" context="#stay" minimal="true" />
+      <RegExpr String="\s_?https?:\/\/\S+" attribute="Link" context="#stay"/>
+      <RegExpr String="^_?https?:\/\/\S+" attribute="Link" context="#stay"/>
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Bold" lineEndContext="#stay" name="bold" >
+      <StringDetect attribute="Bold" context="#pop" String="}*" />
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Bold" lineEndContext="#stay" name="emphasis" >
+      <StringDetect attribute="Bold" context="#pop" String="}!" />
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Italic" lineEndContext="#stay" name="italic" >
+      <StringDetect attribute="Italic" context="#pop" String="}/" />
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Underscore" lineEndContext="#stay" name="underscore" >
+      <StringDetect attribute="Underscore" context="#pop" String="}_" />
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Superscript" lineEndContext="#stay" name="superscript" >
+      <StringDetect attribute="Superscript" context="#pop" String="}^" />
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Subscript" lineEndContext="#stay" name="subscript" >
+      <StringDetect attribute="Subscript" context="#pop" String="}," />
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+      <StringDetect String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Strike" lineEndContext="#stay" name="strike" >
+      <StringDetect attribute="Strike" context="#pop" String="}-" />
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect  String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect  String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect  String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect  String="+{" attribute="Insert" context="insert"/>
+    </context>
+    <context attribute="Insert" lineEndContext="#stay" name="insert" >
+      <StringDetect attribute="Insert" context="#pop" String="}+" />
+      <StringDetect String="!{" attribute="Bold" context="emphasis"/>
+      <StringDetect String="*{" attribute="Bold" context="bold"/>
+      <StringDetect String="/{" attribute="Italic" context="italic"/>
+      <StringDetect String="_{" attribute="Underscore" context="underscore"/>
+      <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+      <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+      <StringDetect String="-{" attribute="Strike" context="strike"/>
+    </context>
+    <context attribute="Endnote" lineEndContext="#pop" name="endnote" />
+    <context attribute="Bold" lineEndContext="#pop" name="boldline" />
+    <context attribute="Indent" lineEndContext="#pop" name="indent" />
+    <context attribute="Warn" lineEndContext="#pop"  name="warn" />
+    </contexts>
+    <itemDatas>
+      <itemData name="Normal Text" defStyleNum="dsNormal" />
+      <itemData name="Header" defStyleNum="dsNormal" color="#1c869b" selColor="#60FFFF" bold="0" italic="0"/>
+      <itemData name="Heading" defStyleNum="dsNormal" color="#ff0000" selColor="#60FFFF" bold="1" italic="0"/>
+      <itemData name="Bold" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="1" italic="0"/>
+      <itemData name="Italic" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="0" italic="1"/>
+      <itemData name="Underscore" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+      <itemData name="Superscript" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+      <itemData name="Subscript" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+      <itemData name="Strike" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+      <itemData name="Insert" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+      <itemData name="Keyword" defStyleNum="dsKeyword" />
+      <itemData name="Endnote" defStyleNum="dsNormal" color="#0AAA00" selColor="#60FFFF" bold="0" italic="0"/>
+      <itemData name="Link" defStyleNum="dsNormal" color="#0000FF" selColor="#60FFFF" bold="0" italic="0"/>
+      <itemData name="String" defStyleNum="dsString" />
+      <itemData name="Comment" defStyleNum="dsComment"/>
+      <itemData name="Group" defStyleNum="dsRegionMarker"/>
+      <itemData name="Break" defStyleNum="dsNormal" color="#FF0000" selColor="#60FFFF" bold="0" italic="0"/>
+      <itemData name="Indent" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+      <itemData name="Structure" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+      <itemData name="Warn" defStyleNum="dsError" color="#FF00FF" selColor="#000000" bold="1" italic="0"/>
+    </itemDatas>
+  </highlighting>
+  <general>
+    <keywords weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
+    <comments>
+      <comment name="singleLine" start="%" />
+    </comments>
+  </general>
+</language>
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/nano/nanorc b/data/sisu/v3dv/conf/editor-syntax-etc/nano/nanorc
new file mode 100644 (file)
index 0000000..30ba439
--- /dev/null
@@ -0,0 +1,221 @@
+## Sample initialization file for GNU nano
+## Please note that you must have configured nano with --enable-nanorc
+## for this file to be read!  Also note that characters specially
+## interpreted by the shell should not be escaped here.
+##
+## To make sure a value is not enabled, use "unset <option>"
+##
+## For the options that take parameters, the default value is given.
+## Other options are unset by default.
+
+## Use auto-indentation.
+# set autoindent
+
+## Backup files to filename~.
+# set backup
+
+## The directory to put unique backup files in.
+# set backupdir ""
+
+## Do backwards searches by default.
+# set backwards
+
+## The characters treated as closing brackets.  They cannot contain
+## blank characters.  Only closing punctuation, optionally followed by
+## closing brackets, can end sentences.
+##
+# set brackets "'")}]>"
+
+## Do case sensitive searches by default.
+# set casesensitive
+
+## Constantly display the cursor position in the statusbar.  Note that
+## this cancels out "quickblank".
+# set const
+
+## Use cut to end of line by default.
+# set cut
+
+## Set the line length for wrapping text and justifying paragraphs.
+## If fill is 0 or less, the line length will be the screen width less
+## this number.
+##
+# set fill -8
+
+## Enable ~/.nano_history for saving and reading search/replace strings.
+# set historylog
+
+## Use the blank line below the titlebar as extra editing space.
+# set morespace
+
+## Enable mouse support, so that mouse clicks can be used to set the
+## mark and run shortcuts.
+# set mouse
+
+## Allow multiple file buffers (inserting a file will put it into a
+## separate buffer).  You must have configured with --enable-multibuffer
+## for this to work.
+##
+# set multibuffer
+
+## Don't convert files from DOS/Mac format.
+# set noconvert
+
+## Don't follow symlinks when writing files.
+# set nofollow
+
+## Don't display the helpful shortcut lists at the bottom of the screen.
+# set nohelp
+
+## Don't wrap text at all.
+# set nowrap
+
+## Set operating directory.  nano will not read or write files outside
+## this directory and its subdirectories.  Also, the current directory
+## is changed to here, so files are inserted from this dir.  A blank
+## string means the operating directory feature is turned off.
+##
+# set operatingdir ""
+
+## Preserve the XON and XOFF keys (^Q and ^S).
+# set preserve
+
+## The characters treated as closing punctuation.  They cannot contain
+## blank characters.  Only closing punctuation, optionally followed by
+## closing brackets, can end sentences.
+##
+# set punct ".?!"
+
+## Do quick statusbar blanking.  Statusbar messages will disappear after
+## 1 keystroke instead of 25.  Note that "const" cancels this out.
+##
+# set quickblank
+
+## The email-quote string, used to justify email-quoted paragraphs.
+## This is an extended regular expression if your system supports them,
+## otherwise a literal string.  Default:
+# set quotestr "^([    ]*[\|>:}#])+"
+## if you have regexps, otherwise:
+# set quotestr "> "
+## You can get old nano quoted-justify behavior via:
+# set quotestr "(> )+"
+
+## Fix Backspace/Delete confusion problem.
+# set rebinddelete
+
+## Do extended regular expression searches by default.
+# set regexp
+
+## Make the Home key smarter.  When Home is pressed anywhere but at the
+## very beginning of non-whitespace characters on a line, the cursor
+## will jump to that beginning (either forwards or backwards).  If the
+## cursor is already at that position, it will jump to the true
+## beginning of the line.
+# set smarthome
+
+## Use smooth scrolling as the default.
+# set smooth
+
+## Use this spelling checker instead of the internal one.  This option
+## does not properly have a default value.
+##
+# set speller "aspell -x -c"
+
+## Allow nano to be suspended.
+# set suspend
+
+## Use this tab size instead of the default; it must be greater than 0.
+# set tabsize 8
+
+## Convert typed tabs to spaces.
+# set tabstospaces
+
+## Save automatically on exit, don't prompt.
+# set tempfile
+
+## Disallow file modification; why would you want this in an rcfile? ;)
+# set view
+
+## The two single-column characters used to display the first characters
+## of tabs and spaces.  187 decimal (00BB hexadecimal) and 183 decimal
+## (00B7 hexadecimal) seem to be good values for these.
+# set whitespace "  "
+
+## Color setup
+##
+## Format:
+##
+## syntax "short description" ["filename regex" ...]
+##
+## color foreground,background "regex" ["regex"...]
+## or
+## icolor foreground,background "regex" ["regex"...]
+##
+## "color" will do case sensitive matches, while "icolor" will do case
+## insensitive matches.
+##
+## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
+## You may use the prefix "bright" to mean a stronger color highlight
+## for the foreground.
+##
+## To use multi-line regexes, use the start="regex" end="regex" format.
+##
+## If your system supports transparency, not specifying a background
+## color will use a transparent color.  If you don't want this, be sure
+## to set the background color to black or white.
+##
+# syntax "c-file" "\.(c|C|cc|cpp|cxx|h|H|hh|hpp|hxx)$"
+# color red "\<[A-Z_]{2,}\>"
+# color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|signed|unsigned|inline)\>"
+# color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
+# color brightyellow "\<(for|if|while|do|else|case|default|switch|goto|continue|break|return)\>"
+# color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
+# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
+# color brightmagenta "'([^\]|(\\['abfnrtv\\]))'" "'\\(([0-7][0-7]?)|([0-3][0-7][0-7]))'" "'\\x[0-9A-Fa-f][0-9A-Fa-f]?'"
+## color foreground,background "regex" ["regex"...]
+##
+#% sisu
+syntax "sisu" "\.ss[tmi]$"
+#color white,black ".*"
+color cyan start="^0~" end="^$"
+color cyan start="^@\S+:" end="^$"
+#color cyan "^0~.*"
+color brightyellow "^[1-6]~.*"
+color brightyellow "^:?[A-C]~.*"
+icolor brightwhite "^(Chapter|Part|Section|Book|Article|Preamble|Appendix)\s.*"
+color brightyellow "^!_\s.*"
+color brightyellow "[!*]\{.+?\}[!*]"
+color yellow "[/_+-^,]\{.+?\}[/_+-^,]"
+color green "~\{.+?\}~"
+color green "~\^(\s|$)"
+color green "^\^~\s.+"
+#color green start="~\{" end="\}~"
+color yellow "\{.+?\}http:\/\/\S+"
+color brightblue "http:\/\/\S+"
+color brightblue "^<<\s\S+?\.ss[it]"
+color yellow "^(_[12]?\*|_[12])"
+color magenta "^%+\s+.*"
+color green start="^poem\{$" end="^\}poem$"
+color green start="^code\{$" end="^\}code$"
+color green start="^group\{$" end="^\}group$"
+color green start="^alt\{$" end="^\}alt$"
+color magenta "<:(pb|np)>"
+color magenta "<(\/\s*)?br>"
+color magenta "[a-zA-Z0-9,.::?!&]+http:\/\/\S+"
+
+# .nanorc
+#
+ syntax "nanorc" "(\.|/|)nanorc$"
+# highlight possible errors and parameters
+ icolor brightwhite "^[[:space:]]*(set|unset|syntax|i?color).*$"
+# set, unset and syntax
+ icolor cyan "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quickblank|quotestr|rebinddelete)\>" "^[[:space:]]*(set|unset)[[:space:]]+(regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace)\>"
+ icolor green "^[[:space:]]*(set|unset|syntax)\>"
+# colors
+ icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
+ icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
+# strings
+ icolor white "\"(\\.|[^\"])*\""
+# comments
+ icolor blue "^[[:space:]]*#.*$"
+
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/nedit/sisu_nedit.pats b/data/sisu/v3dv/conf/editor-syntax-etc/nedit/sisu_nedit.pats
new file mode 100644 (file)
index 0000000..ef01b2b
--- /dev/null
@@ -0,0 +1,79 @@
+! Nedit Syntax highlighting patterns and commenting for SiSU
+! Version 0.1
+!
+! INSTALLATION
+!
+! Load this pattern by starting nedit with:
+!
+!       nedit -import <name of this file>
+!
+! Then, check that the patterns were loaded correctly, and choose Save Defaults
+! from the Preferences menu.  The new patterns will now be incorporated into
+! your own .nedit file, so the next time you start NEdit, you will no longer
+! need to use -import.
+!
+! These comments will not appear in your ~/.nedit
+!
+nedit.macroCommands: \
+  SiSU Comments>Comment Out Lines@SiSU:::R: {\n\
+                    replace_in_selection("^.*$", "%+ &", "regex")\n\
+            }\n\
+  SiSU Comments>Uncomment Lines@SiSU:::R: {\n\
+                    replace_in_selection("(^[ \\\\t]*# ?)(.*)$", "\\\\2", "regex")\n\
+            }\n\
+  SiSU Comments>Comment Out Sel.@SiSU:::R: {\n\
+                    beginning-of-selection()\n\
+                    mark("1")\n\
+                    deselect-all()\n\
+                    insert-string("=begin\\n")\n\
+                    goto-mark("1")\n\
+                    beginning-of-selection()\n\
+                    backward-character("extend")\n\
+                    backward-character("extend")\n\
+                    backward-character("extend")\n\
+                    backward-character("extend")\n\
+                    backward-character("extend")\n\
+                    backward-character("extend")\n\
+                    backward-character("extend")\n\
+                    mark("1")\n\
+                    end-of-selection()\n\
+                    deselect-all()\n\
+                    insert-string("\\n=end")\n\
+                    goto-mark("1")\n\
+            }\n\
+  SiSU Comments>Uncomment Sel.@SiSU:::R: {\n\
+                    beginning-of-selection()\n\
+                    mark("1")\n\
+                    deselect-all()\n\
+                    replace("=begin\\n","")\n\
+                    goto-mark("1")\n\
+                    deselect-all()\n\
+                    replace("\\n=end","","backward")\n\
+                    goto-mark("1")\n\
+            }\n
+nedit.highlightPatterns: SiSU:1:0{\n\
+    comment:"^%+ ":"$"::Comment::\n\
+    endnote1:"~\\^(\s|$)":::Keyword::D\n\
+    endnote2:"^\\^~ ":"$"::Comment::\n\
+    header:"^0~|@\S+:\s":"$"::Keyword::\n\
+    bold_line:"^!_ ":"$"::Keyword::\n\
+    heading:"^[1-9]~":"$"::Keyword::\n\
+    code_block:"^code\\{":"^\\}code"::Comment::\n\
+    poem_block:"^poem\\{":"^\\}poem"::Comment::\n\
+    group_block:"^group\\{":"^\\}group"::Comment::\n\
+    alt_block:"^alt\\{":"^\\}alt"::Comment::\n\
+    endnote:"~\\{":"\\}~":"\\n":String::\n\
+    string2:"'":"'":"\\n":String1::\n\
+    string escape chars:"\\\\(.|\\n)":::String1:endnote:\n\
+    character constant:"'":"'":"[^\\\\][^']":Character Const::\n\
+    numeric constant:"<((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?>":::Plain::D\n\
+    storage keyword:"<(class)>":::Storage Type::D\n\
+    line:"^(_[1-9]|_\\*|_[1-9]\\*)":::Keyword::D\n\
+    link:"[{}](http://[a-zA-Z0-9?.!+\\-_/&=#]+)?":::Keyword::D\n\
+    url:"http://[a-zA-Z0-9?.!+\\-_/&=#]+":::Keyword::D\n\
+  }
+!    endnote:"~\\{":"\\}~"::Keyword::\n\
+!    link:"\\{":"\\}http://\S+"::Keyword::D\n\
+nedit.languageModes: SiSU:.sst::::::".,/\\`'!|@#%^&*()-=+{}[]"":;<>?~"
+! nedit.languageModes: SiSU:.sst::::::".,/\\`'!|@#%^&*()-=+{}[]"":;<>?~"
+! nedit.languageModes: SiSU:.ss[tmi]::::::
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/8.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/8.vim
new file mode 100644 (file)
index 0000000..46d618f
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Name:            8
+" Maintainer:      Ralph Amissah <ralph@amissah.com>
+" Last Change:     2011-06-26
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/colors/8.vim;hb=HEAD>
+" Note:            8 color cterm, related colorschemes frugal & sparse
+:set background=dark
+:hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+:let colors_name = "8"
+" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
+:hi Normal                                                           ctermbg=0          ctermfg=7
+:hi Cursor         term=reverse             cterm=reverse
+:hi lCursor        term=reverse             cterm=reverse
+:hi StatusLine     term=bold,reverse        cterm=bold,reverse
+:hi StatusLineNC   term=reverse             cterm=reverse
+:hi Search         term=reverse             cterm=none                ctermbg=2          ctermfg=0
+:hi IncSearch      term=reverse             cterm=bold                ctermbg=2          ctermfg=7
+:hi SpecialKey     term=bold                                                             ctermfg=4
+:hi Visual         term=reverse             cterm=reverse
+:hi VisualNOS      term=bold,underline      cterm=bold,underline
+:hi MoreMsg        term=bold                                                             ctermfg=2
+:hi ModeMsg        term=bold                cterm=bold
+:hi Question       term=standout                                                         ctermfg=2
+:hi Title          term=bold                                                             ctermfg=1
+:hi NonText        term=bold                cterm=bold                                   ctermfg=4
+:hi LineNr         term=underline           cterm=none               ctermbg=7           ctermfg=0
+:hi Directory      term=bold                                                             ctermfg=4
+:hi WildMenu       term=standout                                     ctermbg=3           ctermfg=0
+:hi VertSplit      term=reverse             cterm=reverse
+:hi Folded         term=standout            cterm=none               ctermbg=0           ctermfg=7
+:hi FoldColumn     term=standout                                     ctermbg=7           ctermfg=4
+:hi DiffChange                              cterm=none               ctermbg=7           ctermfg=0
+:hi DiffText                                cterm=none               ctermbg=6           ctermfg=0
+:hi DiffAdd                                 cterm=none               ctermbg=2           ctermfg=0
+:hi DiffDelete                              cterm=none               ctermbg=7           ctermfg=0
+:hi String                                  cterm=none                                   ctermfg=3
+:hi Comment                                 cterm=none               ctermbg=0           ctermfg=4
+:hi Constant       term=underline                                                        ctermfg=1
+:hi Special        term=bold                                                             ctermfg=3
+:hi Identifier     term=underline           cterm=none                                   ctermfg=6
+:hi Statement      term=bold                cterm=none                                   ctermfg=2
+":hi Operator       term=bold                                                             ctermfg=1
+:hi PreProc        term=underline                                                        ctermfg=1
+:hi Type           term=underline           cterm=bold                                   ctermfg=3
+:hi Delimiter                               cterm=none                                   ctermfg=2
+:hi Ignore                                  cterm=bold                                   ctermfg=7
+:hi Todo           term=standout                                     ctermbg=3           ctermfg=0
+:hi Underlined     term=underline           cterm=underline
+":hi Include                                                                              ctermfg=1
+":hi Define                                                                               ctermfg=3
+":hi Function                                                                             ctermfg=6
+":hi Structure                                                                            ctermfg=2
+:hi MatchParen                              cterm=bold               ctermbg=4           ctermfg=7
+:hi CursorLine                              cterm=bold,underline
+:hi CursorColumn                            cterm=bold,underline
+:hi SpellBad       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellCap       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellLocal     term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellRare      term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi WarningMsg     term=standout                                                         ctermfg=1
+:hi ErrorMsg       term=standout            cterm=bold               ctermbg=1           ctermfg=7
+:hi Error          term=reverse             cterm=bold               ctermbg=1           ctermfg=7
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-ruby.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-ruby.vim
new file mode 100644 (file)
index 0000000..aad6de0
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Name:            frugal-cterm-ruby
+" Maintainer:      Ralph Amissah <ralph@amissah.com>
+" Last Change:     2011-06-26
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/colors/frugal-cterm-ruby.vim;hb=HEAD>
+" Note:            8 color cterm, related colorschemes 8 & sparse
+:set background=dark
+:hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+:let colors_name = "frugal-cterm-ruby"
+" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
+:hi Normal                                                           ctermbg=0           ctermfg=7
+:hi Cursor         term=reverse             cterm=reverse
+:hi lCursor        term=reverse             cterm=reverse
+:hi StatusLine     term=reverse             cterm=reverse
+:hi StatusLineNC   term=reverse             cterm=reverse
+:hi Search         term=reverse             cterm=none                ctermbg=2          ctermfg=0
+:hi IncSearch      term=reverse             cterm=bold                ctermbg=2          ctermfg=7
+:hi SpecialKey     term=bold                                                             ctermfg=4
+:hi Visual         term=reverse             cterm=reverse
+:hi VisualNOS      term=bold,underline      cterm=bold,underline
+:hi MoreMsg        term=bold                                                             ctermfg=2
+:hi ModeMsg        term=bold                cterm=bold
+:hi Question       term=standout                                                         ctermfg=2
+:hi Title          term=bold                                                             ctermfg=1
+:hi NonText        term=bold                cterm=bold                                   ctermfg=4
+:hi LineNr         term=underline           cterm=bold               ctermbg=0           ctermfg=0*
+:hi Directory      term=bold                                                             ctermfg=4
+:hi WildMenu       term=standout                                     ctermbg=3           ctermfg=0
+:hi VertSplit      term=reverse             cterm=reverse
+:hi Folded         term=standout            cterm=none               ctermbg=0           ctermfg=7
+:hi FoldColumn     term=standout                                     ctermbg=7           ctermfg=4
+:hi DiffChange                              cterm=none               ctermbg=7           ctermfg=0
+:hi DiffText                                cterm=none               ctermbg=6           ctermfg=0
+:hi DiffAdd                                 cterm=none               ctermbg=2           ctermfg=0
+:hi DiffDelete                              cterm=none               ctermbg=7           ctermfg=0
+:hi String                                  cterm=none                                   ctermfg=3
+:hi Comment                                 cterm=bold               ctermbg=0           ctermfg=4
+:hi Constant       term=underline                                                        ctermfg=1
+:hi Special        term=bold                                                             ctermfg=6
+:hi Identifier     term=underline           cterm=none                                   ctermfg=6
+:hi Statement      term=bold                cterm=none                                   ctermfg=2
+":hi Operator       term=bold                                                             ctermfg=1
+:hi PreProc        term=underline                                                        ctermfg=1
+:hi Type           term=underline           cterm=bold                                   ctermfg=3
+:hi Delimiter                               cterm=none                                   ctermfg=2
+:hi Ignore                                  cterm=bold                                   ctermfg=7
+:hi Todo           term=standout                                     ctermbg=3           ctermfg=0
+:hi Underlined     term=underline           cterm=underline
+":hi Include                                                                              ctermfg=1
+":hi Define                                                                               ctermfg=3
+":hi Function                                                                             ctermfg=6
+":hi Structure                                                                            ctermfg=2
+:hi MatchParen                              cterm=bold               ctermbg=4           ctermfg=7
+:hi CursorLine                              cterm=bold,underline
+:hi CursorColumn                            cterm=bold,underline
+:hi SpellBad       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellCap       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellLocal     term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellRare      term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi WarningMsg     term=standout                                                         ctermfg=1
+:hi ErrorMsg       term=standout            cterm=bold               ctermbg=1           ctermfg=7
+:hi Error          term=reverse             cterm=bold               ctermbg=1           ctermfg=7
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim
new file mode 100644 (file)
index 0000000..03f192d
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Name:            frugal-cterm-sisu
+" Maintainer:      Ralph Amissah <ralph@amissah.com>
+" Last Change:     2011-06-26
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim;hb=HEAD>
+" Note:            8 color cterm, related colorschemes 8 & sparse
+:set background=dark
+:hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+:let colors_name = "frugal-cterm-sisu"
+" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
+:hi Normal                                                           ctermbg=0           ctermfg=7
+:hi Cursor         term=reverse             cterm=reverse
+:hi lCursor        term=reverse             cterm=reverse
+:hi StatusLine     term=reverse             cterm=bold,reverse
+:hi StatusLineNC   term=reverse             cterm=reverse
+:hi Search         term=reverse             cterm=none                ctermbg=2          ctermfg=0
+:hi IncSearch      term=reverse             cterm=bold                ctermbg=2          ctermfg=7
+:hi SpecialKey     term=bold                                                             ctermfg=4
+:hi Visual         term=reverse             cterm=reverse
+:hi VisualNOS      term=bold,underline      cterm=bold,underline
+:hi MoreMsg        term=bold                                                             ctermfg=2
+:hi ModeMsg        term=bold                cterm=bold
+:hi Question       term=standout                                                         ctermfg=2
+:hi Title          term=bold                cterm=bold                                   ctermfg=3
+:hi NonText        term=bold                cterm=bold                                   ctermfg=4
+:hi LineNr         term=underline           cterm=bold               ctermbg=0           ctermfg=0*
+:hi Directory      term=bold                                                             ctermfg=4
+:hi WildMenu       term=standout                                     ctermbg=3           ctermfg=0
+:hi VertSplit      term=reverse             cterm=reverse
+:hi Folded         term=standout            cterm=none               ctermbg=0           ctermfg=7
+:hi FoldColumn     term=standout                                     ctermbg=7           ctermfg=4
+:hi DiffChange                              cterm=none               ctermbg=7           ctermfg=0
+:hi DiffText                                cterm=none               ctermbg=6           ctermfg=0
+:hi DiffAdd                                 cterm=none               ctermbg=2           ctermfg=0
+:hi DiffDelete                              cterm=none               ctermbg=7           ctermfg=0
+:hi String                                  cterm=none                                   ctermfg=3
+:hi Comment        term=bold                cterm=none               ctermbg=0           ctermfg=7
+:hi Constant       term=underline                                                        ctermfg=1
+:hi Special        term=bold                                                             ctermfg=6
+:hi Identifier     term=underline                                                        ctermfg=6
+:hi Statement      term=bold                                                             ctermfg=6
+:hi Operator       term=bold                                                             ctermfg=1
+:hi PreProc        term=underline                                    ctermbg=7           ctermfg=1
+:hi Type           term=underline                                                        ctermfg=2
+:hi Delimiter      term=none                cterm=none                                   ctermfg=1
+:hi Ignore                                  cterm=bold                                   ctermfg=7
+:hi Todo           term=standout                                     ctermbg=3           ctermfg=0
+:hi Underlined     term=underline           cterm=underline
+:hi Include                                                                              ctermfg=1
+:hi Define                                                                               ctermfg=3
+:hi Function                                                                             ctermfg=6
+:hi Structure                                                                            ctermfg=2
+:hi MatchParen                              cterm=bold               ctermbg=4           ctermfg=7
+:hi CursorLine                              cterm=bold,underline
+:hi CursorColumn                            cterm=bold,underline
+:hi SpellBad       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellCap       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellLocal     term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellRare      term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi WarningMsg     term=standout                                                         ctermfg=1
+:hi ErrorMsg       term=standout            cterm=bold               ctermbg=1           ctermfg=7
+:hi Error          term=reverse             cterm=bold               ctermbg=1           ctermfg=7
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal.vim
new file mode 100644 (file)
index 0000000..1ff26a5
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Name:            frugal
+" Maintainer:      Ralph Amissah <ralph@amissah.com>
+" Last Change:     2011-06-26
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/colors/frugal.vim;hb=HEAD>
+" Note:            8 color cterm, related colorschemes 8 & sparse
+:set background=dark
+:hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+:let colors_name = "frugal"
+" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
+:hi Normal                                                           ctermbg=0          ctermfg=7                      guibg=black         guifg=white
+:hi Cursor         term=reverse             cterm=reverse                                               gui=bold       guibg=white         guifg=black
+:hi lCursor        term=reverse             cterm=reverse                                               gui=bold       guibg=white         guifg=black
+:hi StatusLine     term=bold,reverse        cterm=bold,reverse                                          gui=bold,reverse
+:hi StatusLineNC   term=reverse             cterm=reverse                                               gui=reverse
+:hi Search         term=reverse                                      ctermbg=2                                                             guifg=green
+:hi IncSearch      term=reverse             cterm=reverse                                               gui=reverse
+:hi SpecialKey     term=bold                                                             ctermfg=4                                         guifg=blue
+:hi Visual         term=reverse             cterm=reverse                                               gui=reverse
+:hi VisualNOS      term=bold,underline      cterm=bold,underline                                        gui=bold,underline
+:hi MoreMsg        term=bold                                                             ctermfg=2                                         guifg=green
+:hi ModeMsg        term=bold                cterm=bold
+:hi Question       term=standout                                                         ctermfg=2                                         guifg=green
+:hi Title          term=bold                                                             ctermfg=1                                         guifg=red
+:hi NonText        term=bold                cterm=bold                                   ctermfg=4                                         guifg=blue
+:hi LineNr         term=underline           cterm=bold               ctermbg=0           ctermfg=0*     gui=bold       guibg=black         guifg=grey
+:hi Directory      term=bold                                                             ctermfg=4                                         guifg=blue
+:hi WildMenu       term=standout                                     ctermbg=3           ctermfg=0                     guibg=yellow        guifg=black
+:hi VertSplit      term=reverse             cterm=reverse                                               gui=reverse
+:hi Folded         term=standout            cterm=none               ctermbg=0           ctermfg=7      gui=none       guibg=black         guifg=white
+:hi FoldColumn     term=standout                                     ctermbg=7           ctermfg=4
+:hi DiffChange                              cterm=none               ctermbg=7           ctermfg=0      gui=none       guibg=white         guifg=black
+:hi DiffText                                cterm=none               ctermbg=6           ctermfg=0      gui=none       guibg=magenta       guifg=black
+:hi DiffAdd                                 cterm=none               ctermbg=2           ctermfg=0      gui=none       guibg=green         guifg=black
+:hi DiffDelete                              cterm=none               ctermbg=7           ctermfg=0      gui=none       guibg=white         guifg=black
+:hi String                                  cterm=none                                   ctermfg=3      gui=none                           guifg=yellow
+:hi Comment                                 cterm=none               ctermbg=0           ctermfg=4      gui=bold       guibg=black         guifg=grey
+:hi Constant       term=underline                                                        ctermfg=1                                         guifg=red
+:hi Special        term=bold                                                             ctermfg=3                                         guifg=yellow
+:hi Identifier     term=underline           cterm=none                                   ctermfg=6      gui=none                           guifg=magenta
+:hi Statement      term=bold                cterm=none                                   ctermfg=2      gui=none                           guifg=green
+":hi Operator       term=bold                                                             ctermfg=1                                         guifg=red
+:hi PreProc        term=underline                                                        ctermfg=1                                         guifg=red
+:hi Type           term=underline           cterm=bold                                   ctermfg=3      gui=bold                           guifg=yellow
+:hi Delimiter                               cterm=none                                   ctermfg=2      gui=none                           guifg=green
+:hi Ignore                                  cterm=bold                                   ctermfg=7      gui=bold                           guifg=white
+:hi Todo           term=standout                                     ctermbg=3           ctermfg=0                     guibg=yellow        guifg=black
+:hi Underlined     term=underline           cterm=underline                                             gui=underline
+":hi Include                                                                              ctermfg=1                                         guifg=red
+":hi Define                                                                               ctermfg=3                                         guifg=yellow
+":hi Function                                                                             ctermfg=6                                         guifg=magenta
+":hi Structure                                                                            ctermfg=2                                         guifg=green
+:hi MatchParen                              cterm=bold               ctermbg=4           ctermfg=7
+:hi CursorLine                              cterm=bold,underline
+:hi CursorColumn                            cterm=bold,underline
+:hi SpellBad       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0                     guibg=white         guifg=black
+:hi SpellCap       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0                     guibg=white         guifg=black
+:hi SpellLocal     term=underline,standout  cterm=none               ctermbg=7           ctermfg=0                     guibg=white         guifg=black
+:hi SpellRare      term=underline,standout  cterm=none               ctermbg=7           ctermfg=0                     guibg=white         guifg=black
+:hi WarningMsg     term=standout                                                         ctermfg=1                                         guifg=red
+:hi ErrorMsg       term=standout            cterm=bold               ctermbg=1           ctermfg=7      gui=bold       guibg=red           guifg=white
+:hi Error          term=reverse             cterm=bold               ctermbg=1           ctermfg=7      gui=bold       guibg=red           guifg=white
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/slate.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/slate.vim
new file mode 100644 (file)
index 0000000..238b27d
--- /dev/null
@@ -0,0 +1,75 @@
+"%% SiSU Vim color file
+" Name:            Slate
+" Maintainer:      Ralph Amissah <ralph@amissah.com>
+" Last Change:     2011-06-26
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/colors/slate.vim;hb=HEAD>
+" Notes:          cterm now uses frugal-sisu 8 colors for term
+"                 (for gui originally looked at desert Hans Fugal <hans@fugal.net>
+"                  <http://hans.fugal.net/vim/colors/desert.vim> (April/May 2003))
+:set background=dark
+:hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+:let colors_name = "slate"
+" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
+:hi Normal                                                           ctermbg=0           ctermfg=7                     guibg=grey15        guifg=white
+:hi Cursor         term=reverse             cterm=reverse                                                              guibg=khaki         guifg=slategrey
+:hi lCursor        term=reverse             cterm=reverse
+:hi StatusLine     term=reverse             cterm=bold,reverse                                               gui=none  guibg=#c2bfa5       guifg=black
+:hi StatusLineNC   term=reverse             cterm=reverse                                                    gui=none  guibg=#c2bfa5       guifg=grey40
+:hi Search         term=reverse             cterm=none               ctermbg=2           ctermfg=0                     guibg=peru          guifg=wheat
+:hi IncSearch      term=reverse             cterm=bold               ctermbg=2           ctermfg=7                     guibg=black         guifg=green
+:hi SpecialKey     term=bold                                                             ctermfg=4                                         guifg=yellowgreen
+:hi Visual         term=reverse             cterm=reverse                                                    gui=none  guibg=olivedrab     guifg=khaki
+:hi VisualNOS      term=bold,underline      cterm=bold,underline
+:hi MoreMsg        term=bold                                                             ctermfg=2                                         guifg=SeaGreen
+:hi ModeMsg        term=bold                cterm=bold                                                                                     guifg=goldenrod
+:hi Question       term=standout                                                         ctermfg=2                                         guifg=springgreen
+:hi Title          term=bold                cterm=bold                                   ctermfg=3           gui=bold                      guifg=gold
+:hi NonText        term=bold                cterm=bold                                   ctermfg=4                     guibg=grey15        guifg=RoyalBlue
+:hi LineNr         term=underline           cterm=bold               ctermbg=0           ctermfg=0*                                        guifg=grey50
+:hi Directory      term=bold                                                             ctermfg=4
+:hi WildMenu       term=standout                                     ctermbg=3           ctermfg=0                     guibg=darkyellow    guifg=black
+:hi VertSplit      term=reverse             cterm=reverse                                                    gui=none  guibg=#c2bfa5       guifg=grey40
+:hi Folded         term=standout            cterm=none               ctermbg=0           ctermfg=7                     guibg=black         guifg=grey40
+:hi FoldColumn     term=standout                                     ctermbg=7           ctermfg=4                     guibg=black         guifg=grey20
+:hi DiffChange                              cterm=none               ctermbg=7           ctermfg=0                     guibg=darkgrey      guifg=white
+:hi DiffText                                cterm=none               ctermbg=6           ctermfg=0                     guibg=darkcyan      guifg=white
+:hi DiffAdd                                 cterm=none               ctermbg=2           ctermfg=0                     guibg=darkgreen     guifg=white
+:hi DiffDelete                              cterm=none               ctermbg=7           ctermfg=0                     guibg=darkgrey      guifg=black
+:hi String                                  cterm=none                                   ctermfg=3                                         guifg=SkyBlue
+:hi Comment        term=bold                cterm=none               ctermbg=0           ctermfg=7                                         guifg=grey40
+:hi Constant       term=underline                                                        ctermfg=1                                         guifg=#ffa0a0
+:hi Special        term=bold                                                             ctermfg=6                                         guifg=darkkhaki
+:hi Identifier     term=underline                                                        ctermfg=6                                         guifg=salmon
+:hi Statement      term=bold                                                             ctermfg=6                                         guifg=CornflowerBlue
+:hi Operator       term=bold                                                             ctermfg=1                                         guifg=red
+:hi PreProc        term=underline                                    ctermbg=7           ctermfg=1                     guibg=white         guifg=red
+:hi Type           term=underline                                                        ctermfg=2                                         guifg=CornflowerBlue
+:hi Delimiter      term=none                cterm=none                                   ctermfg=1
+:hi Ignore                                  cterm=bold                                   ctermfg=7                                         guifg=grey40
+:hi Todo           term=standout                                     ctermbg=3           ctermfg=0                     guibg=yellow2       guifg=orangered
+:hi Underlined     term=underline           cterm=underline
+:hi Include                                                                              ctermfg=1                                         guifg=red
+:hi Define                                                                               ctermfg=3           gui=bold                      guifg=gold
+:hi Function                                                                             ctermfg=6                                         guifg=navajowhite
+:hi Structure                                                                            ctermfg=2                                         guifg=green
+:hi MatchParen                              cterm=bold               ctermbg=4           ctermfg=7
+:hi CursorLine                              cterm=bold,underline                                                       guibg=black
+:hi CursorColumn                            cterm=bold,underline                                                       guibg=black
+:hi SpellBad       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0                     guibg=darkmagenta   guifg=white
+:hi SpellCap       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellLocal     term=underline,standout  cterm=none               ctermbg=7           ctermfg=0                     guibg=darkmagenta   guifg=white
+:hi SpellRare      term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi WarningMsg     term=standout                                                         ctermfg=1                     guibg=darkmagenta   guifg=salmon
+:hi ErrorMsg       term=standout            cterm=bold               ctermbg=1           ctermfg=7                     guibg=darkmagenta   guifg=white
+:hi Error          term=reverse             cterm=bold               ctermbg=1           ctermfg=7                     guibg=darkmagenta   guifg=white
+:hi Black                                                            ctermbg=grey        ctermfg=black                 guibg=grey          guifg=black
+:hi Red                                                              ctermbg=black       ctermfg=red                   guibg=black         guifg=red
+:hi Magenta                                                          ctermbg=black       ctermfg=magenta               guibg=black         guifg=magenta
+:hi Blue                                                             ctermbg=black       ctermfg=blue                  guibg=black         guifg=blue
+:hi Cyan                                                             ctermbg=black       ctermfg=cyan                  guibg=black         guifg=cyan
+:hi Green                                                            ctermbg=black       ctermfg=green                 guibg=black         guifg=green
+:hi Yellow                                                           ctermbg=black       ctermfg=yellow                guibg=black         guifg=yellow
+:hi White                                                            ctermbg=black       ctermfg=white                 guibg=black         guifg=white
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-ruby.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-ruby.vim
new file mode 100644 (file)
index 0000000..3d8f92e
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Name:            sparse-cterm-ruby
+" Maintainer:      Ralph Amissah <ralph@amissah.com>
+" Last Change:     2011-06-26
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/colors/sparse-cterm-ruby.vim;hb=HEAD>
+" Note:            8 color cterm, related colorschemes 8 & frugal
+:set background=dark
+:hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+:let colors_name = "frugal-cterm-ruby"
+" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
+:hi Normal                                                           ctermbg=0           ctermfg=7
+:hi Cursor         term=reverse             cterm=reverse
+:hi lCursor        term=reverse             cterm=reverse
+:hi StatusLine     term=reverse             cterm=reverse
+:hi StatusLineNC   term=reverse             cterm=reverse
+:hi Search         term=reverse             cterm=none                ctermbg=2          ctermfg=0
+:hi IncSearch      term=reverse             cterm=bold                ctermbg=2          ctermfg=7
+:hi SpecialKey     term=bold                                                             ctermfg=4
+:hi Visual         term=reverse             cterm=reverse
+:hi VisualNOS      term=bold,underline      cterm=bold,underline
+:hi MoreMsg        term=bold                                                             ctermfg=2
+:hi ModeMsg        term=bold                cterm=bold
+:hi Question       term=standout                                                         ctermfg=2
+:hi Title          term=bold                                                             ctermfg=1
+:hi NonText        term=bold                cterm=bold                                   ctermfg=4
+:hi LineNr         term=underline           cterm=bold               ctermbg=0           ctermfg=0*
+:hi Directory      term=bold                                                             ctermfg=4
+:hi WildMenu       term=standout                                     ctermbg=3           ctermfg=0
+:hi VertSplit      term=reverse             cterm=reverse
+:hi Folded         term=standout            cterm=bold               ctermbg=0           ctermfg=0*
+:hi FoldColumn     term=standout                                     ctermbg=7           ctermfg=4
+:hi DiffChange                              cterm=none               ctermbg=7           ctermfg=0
+:hi DiffText                                cterm=none               ctermbg=6           ctermfg=0
+:hi DiffAdd                                 cterm=none               ctermbg=2           ctermfg=0
+:hi DiffDelete                              cterm=bold               ctermbg=0           ctermfg=0*
+:hi String                                  cterm=none                                   ctermfg=3
+:hi Comment                                 cterm=bold               ctermbg=0           ctermfg=0*
+:hi Constant       term=underline                                                        ctermfg=1
+:hi Special        term=bold                                                             ctermfg=6
+:hi Identifier     term=underline           cterm=none                                   ctermfg=6
+:hi Statement      term=bold                cterm=none                                   ctermfg=2
+":hi Operator       term=bold                                                             ctermfg=1
+:hi PreProc        term=underline                                                        ctermfg=1
+:hi Type           term=underline           cterm=bold                                   ctermfg=3
+:hi Delimiter                               cterm=none                                   ctermfg=2
+:hi Ignore                                  cterm=bold                                   ctermfg=7
+:hi Todo           term=standout                                     ctermbg=3           ctermfg=0
+:hi Underlined     term=underline           cterm=underline
+":hi Include                                                                              ctermfg=1
+":hi Define                                                                               ctermfg=3
+":hi Function                                                                             ctermfg=6
+":hi Structure                                                                            ctermfg=2
+:hi MatchParen                              cterm=bold               ctermbg=4           ctermfg=7
+:hi CursorLine                              cterm=bold,underline
+:hi CursorColumn                            cterm=bold,underline
+:hi SpellBad       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellCap       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellLocal     term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellRare      term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi WarningMsg     term=standout                                                         ctermfg=1
+:hi ErrorMsg       term=standout            cterm=bold               ctermbg=1           ctermfg=7
+:hi Error          term=reverse             cterm=bold               ctermbg=1           ctermfg=7
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-sisu.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-sisu.vim
new file mode 100644 (file)
index 0000000..9704dbd
--- /dev/null
@@ -0,0 +1,65 @@
+" Vim color file
+" Name:            sparse-cterm-sisu
+" Maintainer:      Ralph Amissah <ralph@amissah.com>
+" Last Change:     2011-06-26
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/colors/sparse-cterm-sisu.vim;hb=HEAD>
+" Note:            8 color cterm, related colorschemes 8 & frugal
+:set background=dark
+:hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+:let colors_name = "sparse-cterm-sisu"
+" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white
+:hi Normal                                                           ctermbg=0           ctermfg=7
+:hi Cursor         term=reverse             cterm=reverse
+:hi lCursor        term=reverse             cterm=reverse
+:hi StatusLine     term=reverse             cterm=bold,reverse
+:hi StatusLineNC   term=reverse             cterm=reverse
+:hi Search         term=reverse             cterm=none                ctermbg=2          ctermfg=0
+:hi IncSearch      term=reverse             cterm=bold                ctermbg=2          ctermfg=7
+:hi SpecialKey     term=bold                                                             ctermfg=4
+:hi Visual         term=reverse             cterm=reverse
+:hi VisualNOS      term=bold,underline      cterm=bold,underline
+:hi MoreMsg        term=bold                                                             ctermfg=2
+:hi ModeMsg        term=bold                cterm=bold
+:hi Question       term=standout                                                         ctermfg=2
+:hi Title          term=bold                cterm=bold                                   ctermfg=3
+:hi NonText        term=bold                cterm=bold                                   ctermfg=4
+:hi LineNr         term=underline           cterm=bold               ctermbg=0           ctermfg=0*
+:hi Directory      term=bold                                                             ctermfg=4
+:hi WildMenu       term=standout                                     ctermbg=3           ctermfg=0
+:hi VertSplit      term=reverse             cterm=reverse
+:hi Folded         term=standout            cterm=bold               ctermbg=0           ctermfg=0*
+:hi FoldColumn     term=standout                                     ctermbg=7           ctermfg=4
+:hi DiffChange                              cterm=none               ctermbg=7           ctermfg=0
+:hi DiffText                                cterm=none               ctermbg=6           ctermfg=0
+:hi DiffAdd                                 cterm=none               ctermbg=2           ctermfg=0
+:hi DiffDelete                              cterm=bold               ctermbg=0           ctermfg=0*
+:hi String                                  cterm=none                                   ctermfg=3
+:hi Comment                                 cterm=bold               ctermbg=0           ctermfg=0*
+:hi Constant       term=underline                                                        ctermfg=1
+:hi Special        term=bold                                                             ctermfg=6
+:hi Identifier     term=underline                                                        ctermfg=6
+:hi Statement      term=bold                                                             ctermfg=6
+:hi Operator       term=bold                                                             ctermfg=1
+:hi PreProc        term=underline                                    ctermbg=7           ctermfg=1
+:hi Type           term=underline                                                        ctermfg=2
+:hi Delimiter      term=none                cterm=none                                   ctermfg=1
+:hi Ignore                                  cterm=bold                                   ctermfg=7
+:hi Todo           term=standout                                     ctermbg=3           ctermfg=0
+:hi Underlined     term=underline           cterm=underline
+:hi Include                                                                              ctermfg=1
+:hi Define                                                                               ctermfg=3
+:hi Function                                                                             ctermfg=6
+:hi Structure                                                                            ctermfg=2
+:hi MatchParen                              cterm=bold               ctermbg=4           ctermfg=7
+:hi CursorLine                              cterm=bold,underline
+:hi CursorColumn                            cterm=bold,underline
+:hi SpellBad       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellCap       term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellLocal     term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi SpellRare      term=underline,standout  cterm=none               ctermbg=7           ctermfg=0
+:hi WarningMsg     term=standout                                                         ctermfg=1
+:hi ErrorMsg       term=standout            cterm=bold               ctermbg=1           ctermfg=7
+:hi Error          term=reverse             cterm=bold               ctermbg=1           ctermfg=7
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/filetype.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/filetype.vim
new file mode 100644 (file)
index 0000000..917c3e0
--- /dev/null
@@ -0,0 +1,8 @@
+" SiSU filetype file
+if exists("did_load_filetypes")
+  finish
+endif
+augroup filetypedetect
+  au! BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst setf sisu
+  au! BufNewFile,BufRead *._sst,*.sst.meta,*.-sst.meta,*._sst.meta setf sisu
+augroup END
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/ftplugin/sisu.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/ftplugin/sisu.vim
new file mode 100644 (file)
index 0000000..160444f
--- /dev/null
@@ -0,0 +1,182 @@
+"%% SiSU Vim ftplugin
+" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
+" SiSU Markup:     SiSU (sisu-2.0) 2010-06-05
+" an ftplugin setting defaults for editing sisu markup files
+:syntax on
+:filetype on
+:filetype indent on
+:autocmd FileType sisu :set nonumber
+:set encoding=utf-8 fileencodings=
+:set ff=unix
+:set autowrite          " Automatically save before commands like :next and :make
+:set nocompatible
+:set tabstop=2
+:set expandtab
+:set shiftwidth=2
+:set autoindent
+:set showcmd            " Show (partial) command in status line.
+:set showmatch          " Show matching brackets.
+:set ignorecase         " Do case insensitive matching
+:set smartcase
+:set incsearch
+:set hlsearch
+:set gdefault
+:set guioptions=agr     " add 'm' for menu
+:map <silent> <C-m> :if &guioptions =~# 'm' <Bar>
+    \set guioptions-=m <Bar>
+    \set guioptions-=T <Bar>
+  \else <Bar>
+    \set guioptions+=m <Bar>
+    \set guioptions-=T <Bar>
+  \endif<CR>
+:set paste
+:set statusline=%f%m%r%h%w\ [type=%Y]\ [format=%{&ff}]\ [%v:%l/%L\ %p%%]
+:set laststatus=2       " status line always on
+"% textwrap
+:set whichwrap=<,>,h,l,[,]
+:set nolinebreak        " only affects display not buffer
+:set wrap
+:set wrapmargin=0
+"% map
+":let mapleader = ","    " consider
+:map <leader>paste :set invpaste<cr>
+"% wrap/formatting paragraph according to the current 'textwidth' with ^J (control-j):
+:imap <C-J> <C-O>gqap
+:nmap <C-J>      gqap
+:vmap <C-J>      gq
+"% save file, go to next file in buffer
+:map <leader>nf :w <enter> :n <enter>
+"% vimdiff q exits
+:if &diff
+:  cmap q qa
+:endif
+"% directory files, placed in vertical split window
+:map <leader>ls :vs<cr> :Explore<cr>
+:map <leader>dir :vs<cr> :Explore<cr>
+:if &diff
+:  cmap q qa
+:endif
+"% remapping lines make cursor jump a line at a time within wrapped text
+:nnoremap j gj
+:nnoremap k gk
+:vnoremap j gj
+:vnoremap k gk
+:nnoremap <Down> gj
+:nnoremap <Up> gk
+:vnoremap <Down> gj
+:vnoremap <Up> gk
+:inoremap <Down> <C-o>gj
+:inoremap  <Up> <C-o>gk
+"% colorscheme slate
+:map <C-C> :syntax on <cr> :colorscheme slate<cr>
+"% search and replace
+:map <leader>rd :.,$s///c "search and replace down
+:map <leader>rg :%s///c "search and replace whole file
+:map <leader>rr :rubyd gsub!(//,"")
+"% pwd t64 working directory set to that of the file you're editing
+"changes pwd to directory of file in current buffer
+:function! CHANGE_CURR_DIR()
+:  let _dir = expand("%:p:h")
+:    exec "cd " . _dir
+:    unlet _dir
+:endfunction
+"% Change to the directory the file in your current buffer is in
+:if has("autocmd")
+   autocmd BufEnter * :lcd %:p:h
+:endif
+"% autocompletefilenames To search for files in the current directory
+:set path=,,
+"auto-completion for file to edit in current dir, used in normal mode
+:map <leader>e :e <c-r>=expand("%:p:h") . "/" <cr>
+:map <leader>pwd :exe 'cd ' . expand ("%:p:h")<cr>
+"% searchhighlight t93: Toggle search highlight <C-n>
+:function! ToggleHLSearched()
+:  if &hls
+:    set nohls
+:  else
+:    set hls
+:  endif
+:endfun
+:nmap <silent> <C-n> :silent call ToggleHLSearched()<cr>
+"%% SiSU vim folds
+"% foldsearchx FoldSearch (opens result of search all else closed) t77
+:map fs :set foldmethod=expr foldcolumn=2 foldlevel=0 <cr>
+:map <leader>ff :F<cr>
+:map <leader>fe :F<cr> zE
+"% foldtoggle Fold Toggle mapped to <space>
+:fun! ToggleFold()
+:  if foldlevel('.') == 0
+:    normal! l
+:  else
+:    if foldclosed('.') < 0
+:      foldclose
+:    else
+:      foldopen
+:    endif
+:  endif
+"  Clear status line
+:  echo
+:endfun
+" Map this function to Space key.
+:noremap <space> :call ToggleFold()<cr>
+"% foldtype Fold? set foldtext
+:set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\=','','g',)
+:set foldexpr=getline(v:lnum-1)!~@/&&getline(v:lnum)!~@/&&getline(v:lnum+1)!~@/
+"% foldsearch t77: Fold on search result
+:function! FoldMake(search)
+:  set fdm=manual
+:  normal zE
+:  normal G$
+:  let folded = 0     "flag to set when a fold is found
+:  let flags = "w"    "allow wrapping in the search
+:  let line1 =  0     "set marker for beginning of fold
+:  while search(a:search, flags) > 0
+:    let  line2 = line(".")
+:      if (line2 -1 > line1)
+:        "echo line1 . ":" . (line2-1)
+:        "echo "a fold goes here."
+:        execute ":" . line1 . "," . (line2-1) . "fold"
+:        let folded = 1       "at least one fold has been found
+:     endif
+:     let line1 = line2     "update marker
+:     let flags = "W"       "turn off wrapping
+:  endwhile
+"  create the last fold which goes to the end of the file.
+:  normal $G
+:  let  line2 = line(".")
+:  if (line2  > line1 && folded == 1)
+:    execute ":". line1 . "," . line2 . "fold"
+:  endif
+:  normal 1G
+:endfunction
+"% folds Fold Patterns
+:command! -nargs=+ -complete=command FMake call FoldMake(<q-args>)
+:  if ( &filetype == "ruby" )
+:    command! F FMake ^# ==\?\|^\s*\(\(def\|class\|module\)\s\|\(public\|protected\|private\|__END__\)\s*$\)\|\(^\s*\|\s\+\)#%\s
+:    command! Fa FMake \(^# ==\?\|^\s*\(\(\(def\|class\|module\)\s\)\|\(\(public\|protected\|private\|__END__\)\(\s*$\)\)\)\)\|^[0-9]\~\|\([#%]\|^["]\)\{1,4\}\s*%\|{\({\|!!\)
+:    command! FD FMake \(^# ==\?\|^\s*\(\(def\|class\|module\)\s\)\)\|^\s*\([#%"0-9]\{0,4\}\~\(%\+\s\|!!\)\|#\s\+=\+\s\+\)
+:  else
+"% folds :F Fold Patterns SiSU Markup :F
+:    command! F FMake  ^\([1-8]\|:\?[A-C]\)\~\|\(^%\|\(^\|\s\+\)[#"]\)%\{1,2\}\(\s\|$\)\|^<<\s*|
+:    command! Fa FMake ^\([1-8]\|:\?[A-C]\)\~\|\(^%\|\(^\|\s\+\)[#"]\)%\{1,2\}\(\s\|$\)\|^<<\s*|\|^\(Book\|Part\|Chapter\|Section\|Article\|BOOK\|PART\|CHAPTER\|SECTION\|ARTICLE\)\s
+:    command! F0 FMake ^\(\s*0\~\|@\S\+:[+-]\?\s\+\)
+:    command! FA FMake ^:\?A\~
+:    command! FB FMake ^:\?[AB]\~
+:    command! FC FMake ^:\?[A-C]\~
+:    command! F1 FMake ^\(:\?[A-C]\|1\)\~
+:    command! F2 FMake ^\(:\?[A-C]\|[12]\)\~
+:    command! F3 FMake ^\(:\?[A-C]\|[1-3]\)\~
+:    command! F4 FMake ^[1-4]\~
+:    command! F5 FMake ^[4-5]\~
+:    command! F6 FMake ^[4-6]\~
+:    command! Fc FMake ^[%]\+\s\+
+:  endif
+"% folds Fold Patterns misc
+":command! Fp FMake ^\s*[A-Za-z0-9#]
+:command! Fp FMake ^\s*\S
+:command! Fo FMake ^[%\"]\s*[{>]
+"% cursorline
+:highlight CursorLine guibg=black ctermbg=black
+:highlight CursorColumn guibg=black ctermbg=black
+:map <leader>cu- :set nocursorline nocursorcolumn<cr>
+:map <leader>cu+ :set cursorline cursorcolumn<cr>
diff --git a/data/sisu/v3dv/conf/editor-syntax-etc/vim/syntax/sisu.vim b/data/sisu/v3dv/conf/editor-syntax-etc/vim/syntax/sisu.vim
new file mode 100644 (file)
index 0000000..bfcfc3e
--- /dev/null
@@ -0,0 +1,262 @@
+" SiSU Vim syntax file
+" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
+" SiSU Markup:     SiSU (sisu-3.1.0)
+" Last Change:     2011-10-03
+" URL:             <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
+"(originally looked at Ruby Vim by Mirko Nasato)
+
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+else
+endif
+
+"% "Errors:
+syn match sisu_error contains=sisu_link,sisu_error_wspace "<![^ei]\S\+!>"
+
+"% "Markers Identifiers:
+if !exists("sisu_no_identifiers")
+  syn match   sisu_mark_endnote                                           "\~^"
+  syn match   sisu_break               contains=@NoSpell                  " \\\\\( \|$\)"
+  syn match   sisu_break               contains=@NoSpell                  "<br>\|<br />"
+  syn match   sisu_control             contains=@NoSpell                  "^<:p[bn]>\s*$"
+ "syn match   sisu_control             contains=@NoSpell                  "^<\(br\)\?:\(pg\|pgn\|pn\)>\s*$"
+ "syn match   sisu_control             contains=@NoSpell                  "^\[\(br\)\?:\(pg\|pgn\|pn\)\]\s*$"
+  syn match   sisu_control             contains=@NoSpell                  "^<:\(bo\|---\)>\s*$"
+ "syn match   sisu_control             contains=@NoSpell                  "^<\(br\)\?:\(pr\|o\)>\s*$"
+ "syn match   sisu_control             contains=@NoSpell                  "^\[\(br\)\?:\(pr\|o\)\]\s*$"
+  syn match   sisu_marktail                                               "[~-]#"
+  syn match   sisu_control                                                "\""
+  syn match   sisu_underline                                              "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)"
+  syn match   sisu_number              contains=@NoSpell                  "[0-9a-f]\{32\}\|[0-9a-f]\{64\}"
+  syn match   sisu_link                contains=@NoSpell                  "\(_\?https\?://\|\.\.\/\)\S\+"
+  syn match   sisu_link                                                   " \*\~\S\+"
+  syn match   sisu_action                                                 "^<:insert\d\+>"
+  syn match   sisu_require             contains=@NoSpell                  "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$"
+  syn match   sisu_require             contains=@NoSpell                  "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$"
+  syn match   sisu_structure                                              "^:A\~$"
+
+"% "Document Sub Headers:
+  syn match   sisu_sub_header_title                                       "^\s\+:\(subtitle\|short\|edition\|language\|lang_char\|note\):\s" "group=sisu_header_content
+  syn match   sisu_sub_header_creator                                     "^\s\+:\(author\|editor\|contributor\|illustrator\|photographer\|translator\|digitized_by\|prepared_by\|audio\|video\):\s"                   &n