aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2007-05-22 02:06:46 +0100
committerRalph Amissah <ralph.amissah@gmail.com>2007-05-22 02:06:46 +0100
commit65477054fd798728bf186aa2938727ddddbe86a5 (patch)
tree612da47b57ad4c4157f495dcf10710d32cdc6ead
Imported upstream version 0.52.7upstream/0.52.7sisu_0.52.7
-rw-r--r--CHANGELOG6426
-rw-r--r--README422
-rw-r--r--Rantfile518
-rw-r--r--bin/sisu55
-rw-r--r--bin/sisu_termsheet69
-rw-r--r--bin/sisu_webrick56
-rw-r--r--conf/sisu/sisurc.yml116
-rw-r--r--conf/sisu/skin/dir/skin_sisu.rb105
-rw-r--r--conf/sisu/skin/doc/skin_gnu.rb96
-rw-r--r--conf/sisu/skin/doc/skin_gutenberg.rb219
-rw-r--r--conf/sisu/skin/doc/skin_kdissert.rb93
-rw-r--r--conf/sisu/skin/doc/skin_sisu.rb105
-rw-r--r--conf/sisu/skin/site/skin_sisu.rb105
-rw-r--r--conf/sisu/skin/yml/skin_countries.yml482
-rw-r--r--conf/sisu/skin/yml/skin_country.yml735
-rw-r--r--conf/sisu/version.yml5
-rw-r--r--data/doc/sisu/CHANGELOG6426
-rw-r--r--data/doc/sisu/README422
-rw-r--r--data/doc/sisu/copyright67
-rw-r--r--data/doc/sisu/html/README1
-rw-r--r--data/doc/sisu/html/homepage/index.html264
-rw-r--r--data/doc/sisu/html/sisu.1.html1335
-rw-r--r--data/doc/sisu/html/sisu.8.html229
-rw-r--r--data/doc/sisu/html/sisu_complete.7.html54
-rw-r--r--data/doc/sisu/html/sisu_pdf.7.html48
-rw-r--r--data/doc/sisu/html/sisu_postgresql.7.html95
-rw-r--r--data/doc/sisu/html/sisu_sqlite.7.html91
-rw-r--r--data/doc/sisu/html/sisu_termsheet.1.html63
-rw-r--r--data/doc/sisu/html/sisu_vim.7.html60
-rw-r--r--data/doc/sisu/html/sisu_webrick.1.html69
-rw-r--r--data/doc/sisu/model/README14
-rw-r--r--data/doc/sisu/model/relaxng/sisu_object_model_dom.rnc148
-rw-r--r--data/doc/sisu/model/relaxng/sisu_object_model_input.rnc186
-rw-r--r--data/doc/sisu/model/relaxng/sisu_object_model_metaverse.rnc210
-rw-r--r--data/doc/sisu/model/relaxng/sisu_object_model_sax.rnc86
-rw-r--r--data/doc/sisu/model/relaxng/sisu_object_model_xhtml.rnc105
-rw-r--r--data/doc/sisu/model/xml/input/rnc/dom.rnc69
-rw-r--r--data/doc/sisu/model/xml/input/rnc/node.rnc67
-rw-r--r--data/doc/sisu/model/xml/input/rnc/sax.rnc47
-rw-r--r--data/doc/sisu/model/xml/input/rng/dom.rng166
-rw-r--r--data/doc/sisu/model/xml/input/rng/node.rng177
-rw-r--r--data/doc/sisu/model/xml/input/rng/sax.rng120
-rw-r--r--data/doc/sisu/model/xml/input/xsd/dom.xsd181
-rw-r--r--data/doc/sisu/model/xml/input/xsd/node.xsd159
-rw-r--r--data/doc/sisu/model/xml/input/xsd/sax.xsd108
-rw-r--r--data/doc/sisu/model/xml/output/rnc/dom.rnc144
-rw-r--r--data/doc/sisu/model/xml/output/rnc/sax.rnc164
-rw-r--r--data/doc/sisu/model/xml/output/rng/dom.rng438
-rw-r--r--data/doc/sisu/model/xml/output/rng/sax.rng374
-rw-r--r--data/doc/sisu/model/xml/output/xsd/dom.xsd327
-rw-r--r--data/doc/sisu/model/xml/output/xsd/sax.xsd332
-rw-r--r--data/doc/sisu/on_markup.txt343
-rw-r--r--data/doc/sisu/on_standards.txt17
-rw-r--r--data/doc/sisu/sisu_markup_samples/README.samples9
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/README6
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/Gnu_Debian_Linux_Ruby_Way_Better.pngbin0 -> 37629 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/b_doc.pngbin0 -> 274 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Copyleft.pngbin0 -> 668 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Euro.pngbin0 -> 514 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/debian_home.pngbin0 -> 7746 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom.pngbin0 -> 31223 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_01_rms.pngbin0 -> 81111 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_02_rms_snr_year_report.pngbin0 -> 65996 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_03_rms_st_ignucius.pngbin0 -> 34409 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_04_rms_pleasure_card.pngbin0 -> 17364 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/kdissert.pngbin0 -> 4407 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/levitating_gnu.pngbin0 -> 66279 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/philosophical_gnu.pngbin0 -> 2695 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/sisu.pngbin0 -> 3260 bytes
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb105
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb96
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb218
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb93
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb105
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb105
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/list.yml23
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/promo.yml142
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml482
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml735
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams.sst2074
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst161
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/gpl3_draft3.fsf.sst293
-rw-r--r--data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi61
-rw-r--r--data/doc/sisu/sisu_output_overview.sst61
-rw-r--r--data/sisu/README8
-rw-r--r--data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi923
-rw-r--r--data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi932
-rw-r--r--data/sisu/conf/completion/README7
-rw-r--r--data/sisu/conf/completion/_sisu64
-rw-r--r--data/sisu/conf/convert/kdissert_to_sisu161
-rw-r--r--data/sisu/conf/convert/modify.rb250
-rw-r--r--data/sisu/conf/convert/sisu_convert392
-rw-r--r--data/sisu/conf/convert/wvHtml.xml388
-rw-r--r--data/sisu/conf/convert/wvSiSU.xml360
-rw-r--r--data/sisu/conf/lighttpd/lighttpd.cfg.sisu115
-rw-r--r--data/sisu/conf/lighttpd/lighttpd.cfg.sisu_www115
-rw-r--r--data/sisu/conf/ruby/irbrc19
-rw-r--r--data/sisu/conf/syntax/README92
-rw-r--r--data/sisu/conf/syntax/diakonos.conf979
-rw-r--r--data/sisu/conf/syntax/nanorc220
-rw-r--r--data/sisu/conf/syntax/sisu-mode.el235
-rw-r--r--data/sisu/conf/syntax/sisu.lang90
-rw-r--r--data/sisu/conf/syntax/sisu.xml157
-rw-r--r--data/sisu/conf/syntax/sisu_nedit.pats79
-rw-r--r--data/sisu/conf/vim/addons/colors/slate.vim55
-rw-r--r--data/sisu/conf/vim/addons/filetype.vim8
-rw-r--r--data/sisu/conf/vim/addons/ftplugin/sisu.vim177
-rw-r--r--data/sisu/conf/vim/addons/syntax/sisu.vim171
-rw-r--r--data/sisu/image/DebTuxRubySiSU.pngbin0 -> 23032 bytes
-rw-r--r--data/sisu/image/arrow_next_blue.pngbin0 -> 1302 bytes
-rw-r--r--data/sisu/image/arrow_next_red.pngbin0 -> 1167 bytes
-rw-r--r--data/sisu/image/arrow_prev_blue.pngbin0 -> 1348 bytes
-rw-r--r--data/sisu/image/arrow_prev_red.pngbin0 -> 1182 bytes
-rw-r--r--data/sisu/image/arrow_up_blue.pngbin0 -> 1320 bytes
-rw-r--r--data/sisu/image/arrow_up_red.pngbin0 -> 1214 bytes
-rw-r--r--data/sisu/image/b_bluebell.pngbin0 -> 419 bytes
-rw-r--r--data/sisu/image/b_doc.pngbin0 -> 274 bytes
-rw-r--r--data/sisu/image/b_home.pngbin0 -> 419 bytes
-rw-r--r--data/sisu/image/b_odf.pngbin0 -> 907 bytes
-rw-r--r--data/sisu/image/b_pdf.pngbin0 -> 325 bytes
-rw-r--r--data/sisu/image/b_toc.pngbin0 -> 329 bytes
-rw-r--r--data/sisu/image/bluebell.pngbin0 -> 410 bytes
-rw-r--r--data/sisu/image/bullet_doc.pngbin0 -> 311 bytes
-rw-r--r--data/sisu/image/bullet_red.pngbin0 -> 519 bytes
-rw-r--r--data/sisu/image/c_Copyleft.pngbin0 -> 668 bytes
-rw-r--r--data/sisu/image/c_Euro.pngbin0 -> 514 bytes
-rw-r--r--data/sisu/image/dot_clear.pngbin0 -> 128 bytes
-rw-r--r--data/sisu/image/dot_white.pngbin0 -> 128 bytes
-rw-r--r--data/sisu/image/next.pngbin0 -> 722 bytes
-rw-r--r--data/sisu/image/previous.pngbin0 -> 721 bytes
-rw-r--r--data/sisu/image/rb7.icobin0 -> 3262 bytes
-rw-r--r--data/sisu/image/sisu.pngbin0 -> 3260 bytes
-rw-r--r--data/sisu/image/toctoc.pngbin0 -> 760 bytes
-rw-r--r--data/sisu/odf/odt.zipbin0 -> 5306 bytes
-rw-r--r--install3088
-rw-r--r--lib/sisu/0.52/cgi.rb76
-rw-r--r--lib/sisu/0.52/cgi_pgsql.rb214
-rw-r--r--lib/sisu/0.52/cgi_sql_common.rb809
-rw-r--r--lib/sisu/0.52/cgi_sqlite.rb207
-rw-r--r--lib/sisu/0.52/character_encoding.rb369
-rw-r--r--lib/sisu/0.52/composite.rb215
-rw-r--r--lib/sisu/0.52/concordance.rb311
-rw-r--r--lib/sisu/0.52/conf.rb245
-rw-r--r--lib/sisu/0.52/css.rb1939
-rw-r--r--lib/sisu/0.52/dal.rb1089
-rw-r--r--lib/sisu/0.52/dal_doc_str.rb220
-rw-r--r--lib/sisu/0.52/dal_doc_str_code.rb153
-rw-r--r--lib/sisu/0.52/dal_doc_str_tables.rb180
-rw-r--r--lib/sisu/0.52/dal_syntax.rb330
-rw-r--r--lib/sisu/0.52/db_columns.rb209
-rw-r--r--lib/sisu/0.52/db_create.rb530
-rw-r--r--lib/sisu/0.52/db_drop.rb124
-rw-r--r--lib/sisu/0.52/db_import.rb735
-rw-r--r--lib/sisu/0.52/db_indexes.rb95
-rw-r--r--lib/sisu/0.52/db_load_tuple.rb94
-rw-r--r--lib/sisu/0.52/db_remove.rb86
-rw-r--r--lib/sisu/0.52/db_select.rb158
-rw-r--r--lib/sisu/0.52/db_tests.rb104
-rw-r--r--lib/sisu/0.52/dbi.rb119
-rw-r--r--lib/sisu/0.52/defaults.rb2045
-rw-r--r--lib/sisu/0.52/digests.rb364
-rw-r--r--lib/sisu/0.52/docbook.rb561
-rw-r--r--lib/sisu/0.52/errors.rb72
-rw-r--r--lib/sisu/0.52/help.rb1906
-rw-r--r--lib/sisu/0.52/html.rb719
-rw-r--r--lib/sisu/0.52/html_format.rb1056
-rw-r--r--lib/sisu/0.52/html_format_css.rb473
-rw-r--r--lib/sisu/0.52/html_promo.rb382
-rw-r--r--lib/sisu/0.52/html_scroll.rb231
-rw-r--r--lib/sisu/0.52/html_segments.rb471
-rw-r--r--lib/sisu/0.52/html_table.rb141
-rw-r--r--lib/sisu/0.52/html_tune.rb376
-rw-r--r--lib/sisu/0.52/hub.rb573
-rw-r--r--lib/sisu/0.52/i18n.rb1528
-rw-r--r--lib/sisu/0.52/manifest.rb528
-rw-r--r--lib/sisu/0.52/odf.rb725
-rw-r--r--lib/sisu/0.52/odf_format.rb225
-rw-r--r--lib/sisu/0.52/options.rb168
-rw-r--r--lib/sisu/0.52/param.rb791
-rw-r--r--lib/sisu/0.52/param_identify_markup.rb87
-rw-r--r--lib/sisu/0.52/plaintext.rb473
-rw-r--r--lib/sisu/0.52/plaintext_format.rb100
-rw-r--r--lib/sisu/0.52/relaxng.rb1155
-rw-r--r--lib/sisu/0.52/remote_put.rb103
-rw-r--r--lib/sisu/0.52/response.rb61
-rw-r--r--lib/sisu/0.52/rexml.rb118
-rw-r--r--lib/sisu/0.52/screen_text_color.rb404
-rw-r--r--lib/sisu/0.52/semantics.rb388
-rw-r--r--lib/sisu/0.52/share_src.rb88
-rw-r--r--lib/sisu/0.52/share_src_kdissert.rb82
-rw-r--r--lib/sisu/0.52/shared_db.rb78
-rw-r--r--lib/sisu/0.52/shared_html.rb55
-rw-r--r--lib/sisu/0.52/shared_html_lite.rb180
-rw-r--r--lib/sisu/0.52/shared_txt.rb299
-rw-r--r--lib/sisu/0.52/shared_xml.rb580
-rw-r--r--lib/sisu/0.52/sisupod_make.rb316
-rw-r--r--lib/sisu/0.52/sitemaps.rb213
-rw-r--r--lib/sisu/0.52/spell.rb91
-rw-r--r--lib/sisu/0.52/sst_convert_markup.rb298
-rw-r--r--lib/sisu/0.52/sst_do_inline_footnotes.rb461
-rw-r--r--lib/sisu/0.52/sst_from_kdissert.rb176
-rw-r--r--lib/sisu/0.52/sst_from_xml.rb148
-rw-r--r--lib/sisu/0.52/sst_identify_markup.rb322
-rw-r--r--lib/sisu/0.52/sst_to_s_xml_dom.rb563
-rw-r--r--lib/sisu/0.52/sst_to_s_xml_node.rb636
-rw-r--r--lib/sisu/0.52/sst_to_s_xml_sax.rb434
-rw-r--r--lib/sisu/0.52/sysenv.rb2517
-rw-r--r--lib/sisu/0.52/termsheet.rb158
-rw-r--r--lib/sisu/0.52/texinfo.rb408
-rw-r--r--lib/sisu/0.52/texinfo_format.rb507
-rw-r--r--lib/sisu/0.52/texpdf.rb611
-rw-r--r--lib/sisu/0.52/texpdf_format.rb1222
-rw-r--r--lib/sisu/0.52/update.rb123
-rw-r--r--lib/sisu/0.52/urls.rb229
-rw-r--r--lib/sisu/0.52/vocab.rb113
-rw-r--r--lib/sisu/0.52/vocab_lex.rb144
-rw-r--r--lib/sisu/0.52/webrick.rb163
-rw-r--r--lib/sisu/0.52/wikispeak.rb391
-rw-r--r--lib/sisu/0.52/xhtml.rb483
-rw-r--r--lib/sisu/0.52/xml.rb505
-rw-r--r--lib/sisu/0.52/xml_dom.rb537
-rw-r--r--lib/sisu/0.52/xml_format.rb339
-rw-r--r--lib/sisu/0.52/xml_tables.rb202
-rw-r--r--lib/sisu/0.52/zap.rb73
-rw-r--r--man/man1/sisu.11497
-rw-r--r--man/man1/sisu_termsheet.160
-rw-r--r--man/man1/sisu_webrick.176
-rw-r--r--man/man7/sisu_vim.759
-rw-r--r--man/man8/sisu.8276
-rw-r--r--setup.rb1585
230 files changed, 78800 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 00000000..2c1bf32b
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,6426 @@
+* See homepage at: http://www.jus.uio.no/sisu
+* & http://www.jus.uio.no/sisu/SiSU/download
+* & http://www.jus.uio.no/sisu/SiSU/changelog
+
+Reverse Chronological:
+
+%% STABLE MANIFEST
+
+%% sisu_0.52.7.orig.tar.gz (2007-05-17::20/4)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.7.orig.tar.gz
+ sisu_0.52.7.orig.tar.gz
+ sisu_0.52.7-1.dsc
+ sisu_0.52.7-1.diff.gz
+
+ * texpdf, related to special characters
+
+%% sisu_0.52.6.orig.tar.gz (2007-05-14::20/1)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.6.orig.tar.gz
+ 3255ec945b0583a01af963dde3f76f1d 1283482 sisu_0.52.6.orig.tar.gz
+ f466b68b3093e2c95fed13e4ebf0d495 606 sisu_0.52.6-1.dsc
+ aafb3b715fe2566f88c2def746d73099 148689 sisu_0.52.6-1.diff.gz
+
+ * texpdf, a url representation fix, escape of special characters
+
+%% sisu_0.52.5.orig.tar.gz (2007-05-10::19/4)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.5.orig.tar.gz
+ e01dd9390785e8b087140a7166cc6a5e 1283393 sisu_0.52.5.orig.tar.gz
+ 1bc960b5ce02d58153579d32bfbb2bd0 606 sisu_0.52.5-1.dsc
+ d6ab36fca512d494a4ce6fe0feec217a 148667 sisu_0.52.5-1.diff.gz
+
+ * postgresql TCP/IP port setting changed, looks first at sisurc.yml else the
+ environment variable PGPORT, else fallback is to set
+ default to 5432
+
+ * debian/control postgresql dependencies updated, version agnostic (Closes:
+ #419294) [Martin Pitt thanks for report]
+ * on debian postgresql-8.2 now replaces postgresql-8.1, migrate database.
+ * you may need to set the TCP/IP port, and this can be done either by
+ setting PGPORT (e.g. "export PGPORT=5432") or setting the port in
+ sisurc.yml (check what the correct value should be [on my system the
+ default was set to 5433 for 8.2, "ls -la /var/run/postgresql/" may help])
+
+%% sisu_0.52.4.orig.tar.gz (2007-05-05::18/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.4.orig.tar.gz
+ 8712a6162633f27dce36f57bc60599a5 1282392 sisu_0.52.4.orig.tar.gz
+ fd5618da795883fbeb1d53076783f80a 606 sisu_0.52.4-1.dsc
+ 7f6b377e5f0bdc0ea805a7af5f21f2bb 148482 sisu_0.52.4-1.diff.gz
+
+ * param, markup version detection added
+
+ * some code cleaning and anchoring of some regexs to start and end of string
+
+ * [checked against ruby 1.9.0 (2006-06-08) [i486-linux] in Debian Sid]
+
+ * debian debhelper (>= 5)
+
+ * [very rough wiki text output/assist (-g), may remove, not documented]
+
+%% sisu_0.52.3.orig.tar.gz (2007-04-26::17/4)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.3.orig.tar.gz
+ d71332c68a8ed6b01f358f1e5ae45875 1279017 sisu_0.52.3.orig.tar.gz
+ 4dd90c7e7790ea75be3017577759a128 606 sisu_0.52.3-1.dsc
+ a82c2c62106475640b25fefb38e9a6a4 148442 sisu_0.52.3-1.diff.gz
+
+ * texpdf, a fix, utf-8 markup/input file now required and assumed
+ [file magic identification of sisu markup files changes, utf-8 info is not
+ currently provided, (resulting in false assumption on encoding)]
+
+ * debian/control, postgresql dependency reverted till ruby db driver
+ dependencies are updated, [reopened: #419294] [not caught in 0.52.2 because
+ both versions of postgresql were installed, 0.52.2 was not uploaded to the
+ debian repository]
+
+%% sisu_0.52.2.orig.tar.gz (2007-04-21::16/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.2.orig.tar.gz
+ 96a2d9628e14e997bd93edd817b04996 1278391 sisu_0.52.2.orig.tar.gz
+ b3ed14988e1deed59ba13e0cfaae0b35 606 sisu_0.52.2-1.dsc
+ fb9ec4798fd769320873dbbc7ff145f8 148322 sisu_0.52.2-1.diff.gz
+
+ * html, links to other output make use of the default settings as well as
+ availability of software (e.g. to generate pdf from LaTeX)
+
+ * debian/control, postgresql dependency update, [intended to close: #419294]
+ [thank you for report Martin Pitt]
+
+%% sisu_0.52.1.orig.tar.gz (2007-04-14::15/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.1.orig.tar.gz
+ 24faea8c8565af2a24fb02c4499cb287 1280993 sisu_0.52.1.orig.tar.gz
+ 46a488ef619227fd02426a7311e86927 606 sisu_0.52.1-1.dsc
+ b0286f72ebcbb9a8443ae99bb905407a 141510 sisu_0.52.1-1.diff.gz
+
+ * initial revisit of XML output (and input) models, lots as yet to be done
+
+ * cleanup of some unused code, re-introduce if needed
+
+%% sisu_0.52.0.orig.tar.gz (2007-04-07::14/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.0.orig.tar.gz
+ e8767ea85c9e4f0941a8019f184031f3 1273211 sisu_0.52.0.orig.tar.gz
+ 991acda3465d5a8a043da7f327d8d020 606 sisu_0.52.0-1.dsc
+ 731cb9af8e47d4ebcd4a93c98286ac15 1391220 sisu_0.52.0-1.diff.gz
+
+ * 0.52 introduces: file-type identifier declaration, the _{first line of SiSU
+ a markup file}_ should be the sisu file-type identifier, indicated by the
+ word SiSU optionally (and preferably) followed by the version number of the
+ markup used:
+ e.g. current markup files would start with the line:
+ 'SiSU 0.52'
+ or
+ 'sisu-0.52'
+ [most markup is unchanged since sisu-0.38 though there have been some
+ additions since see e.g. sisu-0.42... (sisu-0.16 markup remains valid
+ though depreciated) to keep backward compatibility use:]
+ commented out equivalents:
+ '% SiSU 0.38'
+ or
+ '% sisu-0.38'
+ variants include:
+ 'SiSU text 0.52' [filename].sst (equivalent to the default 'SiSU 0.52')
+ 'SiSU insert 0.52' [filename].ssi
+ 'SiSU master 0.52' [filename].ssm
+
+ sisupod (zip) files (currently) have inserted into the binary:
+ 'SiSU sisupod 0.52.0'
+ and sisupod (zip) of directory content:
+ 'SiSU sisupod 0.52.0 directory contents sisupod-sisu-2007-04-03.ssp'
+
+ * command line options:
+ * default action for 'sisu [filename]' introduced: sisu -0 [filename]
+ [flag -0 introduced and can be configured in config as 'flag' 'default']
+ * added long forms for -q (--verbose-0|--quiet) -v (--verbose-1|--verbose)
+ -V (--verbose-2|--Verbose) -M (--maintenance) and -VM (--verbose-3)
+
+ * sst_identify_markup minor adjustments
+
+ * sst_do_inline_footnotes minor adjustments
+
+ * xml input representation variants (sax, dom, node), minor adjustments in
+ conversion to and from ordinary sisu markup (.sst)
+
+ * shared_xml fix (occasionally affecting html) make sure content of
+ <meta name= tag do not contain double quote character transform to
+ single quote
+
+ * ODF and XML special character and XML escape fixes
+
+ * gpl3 draft3 included as document markup sample
+ (requires the ODF and XML escape fixes made in this release version)
+
+%% sisu_0.51.0.orig.tar.gz (2007w13/6 | 2007-03-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.51.0.orig.tar.gz
+ a5e68fd38f2e35d9d18e0fdbcb5e13cb 1260579 sisu_0.51.0.orig.tar.gz
+ 2f7a0cd2b8866c1b92cdd09ff307ed5e 606 sisu_0.51.0-1.dsc
+ bd3565eabc814d2c457302bb0d88a0c2 141851 sisu_0.51.0-1.diff.gz
+
+ * defaults and skins, refactoring (code simplification)
+ * consequential pervasive small changes throughout code
+ * existing skins need to be rewritten (necessary modifications relatively
+ straightforward) [this is the reason for the version number bump up]
+
+ [NB. (i) document syntax remains unchanged;
+ (ii) refactoring changes pass initial tests but require further testing]
+
+ * xml representations of sisu markup, small a touch
+
+%% sisu_0.50.4.orig.tar.gz (2007w12/6 | 2007-03-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.4.orig.tar.gz
+ 9582c43e6a8b888865ffa756f5b897c5 1269202 sisu_0.50.4.orig.tar.gz
+ 606947b8081fc7d7bbfb299c258e2f19 606 sisu_0.50.4-1.dsc
+ c194ae084a143b8b7e586bac152f3486 141639 sisu_0.50.4-1.diff.gz
+
+ * (rudimentary generated) sample search form
+ * fix: db paths for files;
+ * fix: highlighting of matches (not yet consistent)
+ * feature: db select range can be set from url (limit and offset)
+ * cosmetic: text adjustments
+
+%% sisu_0.50.3.orig.tar.gz (2007w11/6 | 2007-03-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.3.orig.tar.gz
+ fd6c335ea792bdec34dafd22112a28cc 1266710 sisu_0.50.3.orig.tar.gz
+ ab6e0d4e85f9bbe4ccbf73c13050a76b 606 sisu_0.50.3-1.dsc
+ ab3d87396df3cf4c4319d84ce86e30ef 141612 sisu_0.50.3-1.diff.gz
+
+ * sample search form, generated cgi fixes, including selected db path for
+ urls, and setting of webserver port
+
+ * concordance, add search widget
+
+ * html navigation band, need more space with search widget, descriptions
+ shortened
+
+%% sisu_0.50.2.orig.tar.gz (2007w11/6 | 2007-03-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.2.orig.tar.gz
+ a8775153ce7e36b900c93b2d21108592 1266482 sisu_0.50.2.orig.tar.gz
+ 0fdfc5112033dd0477757193bda1e732 606 sisu_0.50.2-1.dsc
+ a7f5598bc317e18694777cca32eeb277 141599 sisu_0.50.2-1.diff.gz
+
+ * cgi sample search form, a bit of work, needs more
+ * url logic (testing required)
+ * boolean constructs (passed to SQL engine) (requires work)
+ * cgi_pgsql system call made to psql to extract list of available databases
+
+ * search forms (embedding), incorporation into navigation bands, and promo
+ panes (can be limited to search of document in question only, and provide as
+ result matched: object number index or text)
+ * configure sisurc.yml with information on action (cgi query url) and sisu
+ database name
+ * html_promo, search forms may be constructed for sisu databases
+ (yaml samples promo.yml and list.yml provide commented out example)
+
+ * promo (html) may be set (a) per document in document header or by document
+ skin, by directory in directory skin, or directory sisurc file, or per site
+ in per site skin or sisurc file
+
+ * initialisation of directories -CC, set permissions of copied files to 644
+
+ * help, man pages minor updates, default homepage update
+
+ [many small changes, extensive testing required]
+
+ * initial tests with ruby-1.8.6 passed
+
+%% sisu_0.50.1.orig.tar.gz (2007w10/6 | 2007-03-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.1.orig.tar.gz
+ 51f2236f3612bce6fa2bbcb0cf9545ed 1263537 sisu_0.50.1.orig.tar.gz
+ 25a1a4adf387c11d66b985dc2cf47623 606 sisu_0.50.1-1.dsc
+ ae312bda6b54e9e1b8cfaece0f03e1b4 141521 sisu_0.50.1-1.diff.gz
+
+ * promo/advertise minor extension
+
+ * css default, minor changes
+
+ * postgresql indexes, not built automatically on text fields, rely on tsearch,
+ (suggest you build gin indexes)
+
+ * cgi sample search form scripts visited
+
+ * yaml sample files promo.yml and list.yml updated
+ (removed from conf (/etc/sisu) copy in document samples)
+
+%% sisu_0.50.0.orig.tar.gz (2007w10/2 | 2007-03-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.0.orig.tar.gz
+ 76844391967ef202a748fa1be9d16a23 1265163 sisu_0.50.0.orig.tar.gz
+ af406857bf7cf1d91ddf0ff1249fe174 606 sisu_0.50.0-1.dsc
+ 6b0f5e2a44d8f2dc130efb075601834c 141436 sisu_0.50.0-1.diff.gz
+
+ * CHANGELOG renamed from version_manifest.changelog
+
+ * html some play with navigation bands (usability)
+
+ * sisurc.yml used (instead of depreciated sisurc.yaml)
+
+ * version.yml used (removed version.yaml)
+
+ * dal, metaverse renamed da for document abstraction (layer), variables (and
+ sisupod structure) renamed accordingly. [dal preferred to da because it is
+ easier to find].
+
+ * i18n, (babel renamed i18n)
+
+ * texpdf pdf output make a note about sisu_manifest, alternative output
+ formats
+
+ * promo/advertise, html, permits division into a major and a minor pane
+ (left) which is available for promotional material, links etc. the content of
+ which is currently controlled header @promo: and yaml files promo.yml and
+ list/yml usual path = = = _sisu/skin/yml ~/.sisu/skin/yml /etc/sisu/skin/yml
+ added sample of promo.yml and list.yml and an edited out header for promo
+ inclusion in "Free as in Freedom" and "GPL" document samples (these are
+ called by the document (header) but stored externally from the document (in
+ yml files (promo.yml and list.yml)), (will be possible to make a directory
+ wide inclusion))
+
+ [.gh 50th anniversary commemorative edition - "Freedom and Justice"]
+
+%% sisu_0.49.2.orig.tar.gz (2007w08/6 | 2007-02-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.49.2.orig.tar.gz
+ 10795b62c129f99645dd100a2fe52ddc 1263418 sisu_0.49.2.orig.tar.gz
+ 9983da392f16660e9e580b4d92197239 606 sisu_0.49.2-1.dsc
+ 0a13214e9ac2aba566c1f7bcd030c1ec 141340 sisu_0.49.2-1.diff.gz
+
+ * sysenv, for processing of remote files, download of remote images,
+ correction to variable name
+
+ * odf documents linebreaks removed
+
+ * description, less mention of document management, more on lightweight
+ markup, text structuring, publishing and search
+
+%% sisu_0.49.1.orig.tar.gz (2007w06/6 | 2007-02-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.49.1.orig.tar.gz
+ 4c2f96d5236d389384599899ed524bdb 1261990 sisu_0.49.1.orig.tar.gz
+ e9d3028830f44afb1ddd91fa08022bfe 606 sisu_0.49.1-1.dsc
+ 4dd3d53ca4b881e62654b871c9cf0957 141247 sisu_0.49.1-1.diff.gz
+
+ * xml, minor refactoring
+
+ * segmented html, minor user interface navigation changes (for pre next and
+ toc):
+ * navigation arrow buttons and available documents information trade
+ places, navigation arrows moved right (less cursor movement used in
+ navigation, the scroll bar is usually on the right, also more consistent
+ presentation (placement as in toc))
+ * removed two sets of html segment navigation bands, from very top and
+ under title (cleaner presentation without reduction in functionality, (also
+ for console clients))
+
+ * remote placement, rsync, simplify mapping used, should be a bit more robust
+
+ * response, user response abstraction, minor
+
+ * metaverse, superscript, subscript regex adjusted, (consider adopting this
+ modification more widely)
+
+ * digests, representation of document structure updated to use @, :A-:C, 1-3
+ (instead of 0-6)
+
+ [consider object numbering rule change, re: paragraph/line consisting
+ solely of * * * or ***, should these be un-numbered?, currently are numbered]
+
+%% sisu_0.49.0.orig.tar.gz (2007w04/5 | 2007-01-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.49.0.orig.tar.gz
+ b628ed7a7b50cb6af37b7072c1ebff3a 1262979 sisu_0.49.0.orig.tar.gz
+ a4d610ca440369ee6bfec28d386f6490 606 sisu_0.49.0-1.dsc
+ 56903630d97439f290de51622941dfe1 141237 sisu_0.49.0-1.diff.gz
+
+ * substantially the same as 0.48.8-10 (minor change (sysenv mkdir))
+ 0.49 opened post freeze and decision to use iso 639-2
+
+ * [use recursive acronym]
+
+ [0.48 branch should have become 0.49 with switch to iso 639-2
+ in 0.48.8-8 = = = 0.48.12-1 (as this requires the renaming
+ of some markup files e.g. dk becomes da) [builds from now are
+ post freeze (Etch), and the development routine should be
+ more regular]]
+
+%% sisu_0.48.12.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.12.orig.tar.gz
+ 9b5798e5452624ee051b6a2e1c3cbee5 1262380 sisu_0.48.12.orig.tar.gz
+ 0984bb76407ffeb2ed320e2fe54dd370 609 sisu_0.48.12-1.dsc
+ 5781b7838cc7eb0a442e99b65713ef74 141210 sisu_0.48.12-1.diff.gz
+
+ * [NOTE substantially the same as 0.48.8-8 (Etch freeze is at 0.48.8)]
+
+ * [NOTE rebuild of the 0.48.11 of (2007w02/5 | 2007-01-12) to merge branch
+ in version control, chronological break in sequence, this build is
+ substantially the same as 0.48.8-7, subsequent versions of 48.8 are more
+ recent (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.12.orig.tar.gz (2007w03/7 | 2007-01-21)
+ 174368e60459b0a57db63bfb818f2d80 1261172 sisu_0.48.12.orig.tar.gz
+ 5c941a2810bd816c3c4285171c90e13c 609 sisu_0.48.12-1.dsc
+ 7705abb94584cbe9b4803933e8ebf765 140977 sisu_0.48.12-1.diff.gz
+
+ * use ISO 639-2 for language codes, file names etc.
+ (rename danish samples .~da (instead of dk), [took out Brazilian Portuguese
+ and U.S. American English])
+
+ * debian samples, tex pdf page breaking instruction modified/corrected, and
+ danish examples renamed ISO 639-2
+
+ * sisupod initialisation, fix, (should not fail when initiated in a new sisu
+ work directory, (however do not mix regular sisu markup files and sisupod on
+ command line))
+
+ * sysenv, generic question/check added; used as safeguard against accidental
+ making sisupod of (whole) directory.
+
+ * xml, xhtml several adjustments (including use of xlink), also related css
+ fixes
+
+ * html, toc cosmetic correction
+
+%% sisu_0.48.11.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.11.orig.tar.gz
+ 341b2cebe2efdba4ae776f2752e9ce1b 1259351 sisu_0.48.11.orig.tar.gz
+ 66f3abd74a14f671af92074e7e6ea0fd 609 sisu_0.48.11-1.dsc
+ 0d416f48777c99c2b13f2c98a330fd13 141583 sisu_0.48.11-1.diff.gz
+
+ * [NOTE rebuild of the 0.48.11 of (2007w02/5 | 2007-01-12) to merge branch
+ in version control, chronological break in sequence, this build is
+ substantially the same as 0.48.8-7, subsequent versions of 48.8 are more
+ recent (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.11.orig.tar.gz (2007w02/5 | 2007-01-12)
+ 67ac00458d75646750c67ae3c685cee4 1258340 sisu_0.48.11.orig.tar.gz
+ 79c32c1eca4a3be3f97b90ffa6f6f746 609 sisu_0.48.11-1.dsc
+ 92153fcc5bd633e45c90c4d8b32115e0 141365 sisu_0.48.11-1.diff.gz
+
+ * sisu-0.48.8-7 equivalent, which includes a fix to the sample cgi search
+ form [0.48.8-4 introduced a bug]
+
+%% sisu_0.48.10.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.10.orig.tar.gz
+ 42b50dac775cbad84ebc394ec415986d 1259007 sisu_0.48.10.orig.tar.gz
+ d23694f1466e2af8766e61109fa97fcc 609 sisu_0.48.10-1.dsc
+ 9ea670634d088c996642ad4f2ec95c4d 141560 sisu_0.48.10-1.diff.gz
+
+ * [NOTE rebuild of the 0.48.10 of (2007w02/1 | 2007-01-08) to merge branch
+ in version control, chronological break in sequence, this build is
+ substantially the same as 0.48.8-6, subsequent versions of 48.8 are more
+ recent (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.10.orig.tar.gz (2007w02/1 | 2007-01-08)
+ 57f4d4f16ec7bb210823a3fb50cfc644 1257250 sisu_0.48.10.orig.tar.gz
+ 2f61d673ded3df48e0e55b49051b652f 609 sisu_0.48.10-1.dsc
+ 6cee860bf9684dce3660f5433b9b1bf4 141126 sisu_0.48.10-1.diff.gz
+
+ * debian control, sisu-pdf now depends on texlive alone (tetex removed)
+ (and free from use of metapackages). Feedback from Frank Küster, Ralf
+ Stubner and Norbert Preining (Closes: #402807)
+ [0.48.8-6]
+
+ * rollover year 2006 to 2007
+ [0.48.8-5]
+
+ * cgi sample form related modifications (relatively minor but nice to have
+ sorted) [0.48.8-4]:
+
+ * cgi_pgsql and cgi_sqlite, dynamic path used instead (fixed path will
+ result in errors where the default path is not used).
+
+ * cgi_pgsql and cgi_sqlite, "documentation" tip for copying generated cgi
+ sample to cgi-bin directory, prevent accidental copying to a directory
+ instead of file. Dynamic path used.
+
+ * debian/control Recommends libfcgi-ruby1.8 moved to sisu-postgresql and
+ sisu-sqlite (only used in this context) (previously suggested, needed for
+ sample search form)
+
+ * documentation/help on initially creating postgresql database for use if
+ necessary
+ [0.48.8-3]
+
+ * LaTeX, bugfix - restores missing left column object/paragraph numbers
+ (missing curly (close) brace) [important, though marked as normal]
+ [bug introduced somewhere between 0.47 and 0.48] (closes: #403037)
+ [0.48.8-2]
+
+ * LaTeX use mathptmx.sty instead of "obsolete" times.sty (as suggested by
+ Frank Küster in Bug#402807)
+ [0.48.8-2]
+
+ * cgi-sample form, an arbitrary limit set for sql query results
+ (1000 better than none) (closes: 403042)
+ [0.48.8-2]
+
+ * defaults, update sisu default homepage to current, (mainly urls)
+ [0.48.8-2]
+
+ * css addition to correspond with change to homepage
+ [0.48.8-2]
+
+ * debian control, adds mention of editors other than vim for which there is
+ some kind of syntax support, kate, kwrite, gedit, diakonos
+ [0.48.8-2]
+
+ * vim syntax file, minor adjustment (related to an endnote shortcut)
+
+ * doc/sisu/html keep copy of homepage
+ [introduced in 0.48.9]
+
+%% sisu_0.48.9.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.9.orig.tar.gz
+ 1ad6d950454583d0130430664fc982ec 1258128 sisu_0.48.9.orig.tar.gz
+ f727321854bdf95cbb12e40bc247dd7f 606 sisu_0.48.9-1.dsc
+ 957f1438013ec99bc9a6c5010ca5ea1c 141430 sisu_0.48.9-1.diff.gz
+
+ * [NOTE rebuild of the 0.48.9 of (2006w52/1 | 20061225) to merge branch in
+ version control, chronological break in sequence, this build is substantially
+ the same as 0.48.8-2, subsequent versions of 48.8 are more recent
+ (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.9.orig.tar.gz (2006w52/1 | 20061225)
+ 237b2bae3e343e4b4c2f781d554f7df8 1254360 sisu_0.48.9.orig.tar.gz
+ 8dc727e95913688179b7808592e1c4e9 606 sisu_0.48.9-1.dsc
+ f53b18bbc0919121040cf4c022356e35 140080 sisu_0.48.9-1.diff.gz
+
+ * source tarball incorporates fixes added after Etch freeze in deb 0.48.8-2
+
+ * LaTeX, bugfix - restores missing left column object/paragraph numbers
+ (missing curly (close) brace) [important, though marked as normal]
+ [bug introduced somewhere between 0.47 and 0.48] (closes: #403037)
+
+ * LaTeX use mathptmx.sty instead of "obsolete" times.sty (as suggested by
+ Frank Küster in Bug#402807)
+
+ * cgi-sample form, an arbitrary limit set for sql query results
+ (1000 better than none) (closes: 403042)
+
+ * defaults, update sisu default homepage to current, (mainly urls)
+
+ * css addition to correspond with change to homepage
+
+ * debian control, adds mention of editors other than vim for which there is
+ some kind of syntax support, kate, kwrite, gedit, diakonos
+
+ * texpdf, usepackage url
+
+ * doc/sisu/html keep copy of homepage
+
+ * debian control, sisu-pdf depends for tetex | texlive, take on board
+ suggestion by Frank Küster (see #402807)
+
+%% sisu_0.48.8.orig.tar.gz (2006w48/1 | 20061127) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.8.orig.tar.gz
+ 556de4a3025156e0e7010210a0ddc32f 1248719 sisu_0.48.8.orig.tar.gz
+ e32d8183b0c1dde1020ecf3eced25dff 606 sisu_0.48.8-1.dsc
+ b054905ec4d964f73ccb0c705d593e63 139568 sisu_0.48.8-1.diff.gz
+
+ * metaverse, "visual" adjustment to allow inclusion of column width
+ information
+
+ * debian, dfsg document samples debian constitution v1.3 added
+ [english, german, danish]
+
+ * [sisu-markup-samples_1.0.4 contains "The Wealth of Networks", Yochai
+ Benkler]
+
+%% sisu_0.48.8-2 (2006w50/4 | 20061214) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 0eba8d5dd3086bd2d1fa830c6c19527c 606 sisu_0.48.8-2.dsc
+ 42662b8bf9a83321edbbab0b3b3db554 145527 sisu_0.48.8-2.diff.gz
+
+ * LaTeX, bugfix - restores missing left column object/paragraph numbers
+ (missing curly (close) brace) [important, though marked as normal]
+ [bug introduced somewhere between 0.47 and 0.48] (closes: #403037)
+
+ * LaTeX use mathptmx.sty instead of "obsolete" times.sty (as suggested by
+ Frank Küster in Bug#402807)
+
+ * cgi-sample form, an arbitrary limit set for sql query results
+ (1000 better than none) (closes: 403042)
+
+ * defaults, update sisu default homepage to current, (mainly urls)
+
+ * css addition to correspond with change to homepage
+
+ * debian control, adds mention of editors other than vim for which there is
+ some kind of syntax support, kate, kwrite, gedit, diakonos
+
+%% sisu_0.48.8-3 (2006w52/5 | 20061229) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 0f5acb28c8e9fdd21c29db7fbc7e1d3c 606 sisu_0.48.8-3.dsc
+ 669875a8ca8102e5772df258b0665ba8 147220 sisu_0.48.8-3.diff.gz
+
+ * texpdf, usepackage url (improved placement of urls)
+
+ * debian control, sisu-pdf now depends on texlive alone, (alternative tetex
+ depends removed - reason: problem keeping both working!), take on board
+ suggestion by to rely on texlive Frank Küster if tetex is problematic (this
+ addresses, but does not close #402807 without further discussion, dropping
+ alternative tetex depends simplifies sisu-pdf (tex) related depends, and
+ makes it much more reliable (also see in changelog earlier feedback on
+ sisu-pdf depends from Norbert Preining url at 0.47.7-3) depends here drop
+ reliance on metapackages, (extra checks required as to determine whether
+ texlive depends list may be shortened, playing safe))
+
+ * debian/control priority changed to extra (from optional) as depends on
+ texlive (without option for use of tetex instead)
+
+ * debian/control sisu recommends libfcgi-ruby1.8 (previously suggested,
+ needed for sample search form)
+
+ * documentation/help on initially creating postgresql database for use if
+ necessary
+
+%% sisu_0.48.8-4 (2006w52/7 | 20061231) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 20337413c61bc87b8a9b3e8a2e843b81 606 sisu_0.48.8-4.dsc
+ b440173ffabe147a851ecb25b20db6a2 148820 sisu_0.48.8-4.diff.gz
+
+ * cgi sample form related modifications (relatively minor but nice to have
+ sorted):
+
+ * cgi_pgsql and cgi_sqlite, dynamic path used instead (fixed path will
+ result in errors where the default path is not used).
+
+ * cgi_pgsql and cgi_sqlite, "documentation" tip for copying generated cgi
+ sample to cgi-bin directory, prevent accidental copying to a directory
+ instead of file. Dynamic path used.
+
+ * debian/control Recommends libfcgi-ruby1.8 moved to sisu-postgresql and
+ sisu-sqlite (only used in this context)
+
+%% sisu_0.48.8-5 (2007w01/2 | 2007-01-02) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 07964ec823ae5d96a04ff6c88f5a7f66 606 sisu_0.48.8-5.dsc
+ 90aa76b6061e10e715726c51e5b08a70 153491 sisu_0.48.8-5.diff.gz
+
+ * sisu-pdf texlive dependencies shortened and free from use of metapackages
+
+ * rollover year 2006 to 2007
+
+%% sisu_0.48.8-6 (2007w01/3 | 2007-01-03) [Etch related fixes, uploaded by Daniel Baumann (Medium), cleared/unblocked by Marc 'HE' Brockschmidt]
+ 4c95034d6d9bbe67cd2d008e561a78cc 606 sisu_0.48.8-6.dsc
+ 02bda8e1da0ef74396b1e85ac8ce9e6e 154145 sisu_0.48.8-6.diff.gz
+
+ * sisu-pdf texlive dependency in -5 adjusted on feedback from Norbert
+ Preining (Closes: #402807)
+ http://lists.debian.org/debian-tex-maint/2007/01/msg00034.html
+ http://lists.debian.org/debian-tex-maint/2007/01/msg00033.html
+
+%% sisu_0.48.8-7 (2007w02/3 | 2007-01-10) [Etch related fixes, uploaded by Daniel Baumann (Medium), cleared/unblocked by Marc 'HE' Brockschmidt]
+ fd6e2df63f7b75bc3ad7aa5c34f606fd 606 sisu_0.48.8-7.dsc
+ 2e2fc97a23a4550ed279f94f85ea7378 157623 sisu_0.48.8-7.diff.gz
+
+ * the cgi sample form modifications introduced in -4 were premature, they
+ break things, behaviour reverted to -2 [-3].
+ (Closes: #406281 and #406280) [same bug]
+
+ * removed sisu-sqlite suggests on libdbd-sqlite and
+ sisu-postgresql suggests on libdbd-pgsql which are
+ not found in testing/Etch
+ (Closes: #406282 and #406284)
+
+ * sisu html man page regenerated (from man page)
+
+%% sisu_0.48.8-8 (2007w03/7 | 2007-01-21) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 0ba3e2e6efecd2c57dccf6457200e945 606 sisu_0.48.8-8.dsc
+ 2fb929cfa2fd00366cda7b38f2dea4dd 168554 sisu_0.48.8-8.diff.gz
+
+ * use ISO 639-2 for language codes, file names etc.
+ (rename danish samples .~da (instead of dk), [took out Brazilian Portuguese
+ and U.S. American English])
+
+ * debian samples, tex pdf page breaking instruction modified/corrected, and
+ danish examples renamed ISO 639-2
+
+ * sisupod initialisation, fix, (should not fail when initiated in a new sisu
+ work directory, (however do not mix regular sisu markup files and sisupod on
+ command line))
+
+ * sysenv, generic question/check added; used as safeguard against accidental
+ making sisupod of (whole) directory.
+
+ * xml, xhtml several adjustments (including use of xlink), also related css
+ fixes
+
+ * html, toc cosmetic correction
+
+%% sisu_0.48.8-9 (2007w04/1 | 2007-01-22) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 8ba3e0a9ba6b9b0f4966e020cbcee865 606 sisu_0.48.8-9.dsc
+ 1ac6537c065807c1459e63a4122f9d79 145898 sisu_0.48.8-9.diff.gz
+
+ * removed Danish debian sample markup files to reduce the size of the
+ inter-diff against the package in testing.
+
+ * minor further adjustments to xml processing
+
+%% sisu_0.48.8-10 (2007w04/2 | 2007-01-23) [Etch related fixes]
+ ccc192b7615235f56c9e5b122089d50d 608 sisu_0.48.8-10.dsc
+ 64732549e20c98a6958a3544770343fb 146148 sisu_0.48.8-10.diff.gz
+
+ * xml and xhtml adjustment of regex match of urls for xlink
+
+%% sisu_0.48.8-11 (2007w07/5 | 2007-02-16) [Etch related fixes]
+ 0f3e22d6fd4cfab955f47f9cb5840d7a 608 sisu_0.48.8-11.dsc
+ 825404e40bfbe54999c0ae4ec90fa682 162284 sisu_0.48.8-11.diff.gz
+
+ * xml, minor refactoring
+
+ * segmented html, minor user interface navigation changes (for pre next and
+ toc):
+ * navigation arrow buttons and available documents information trade
+ places, navigation arrows moved right (less cursor movement used in
+ navigation, the scroll bar is usually on the right, also more consistent
+ presentation (placement as in toc))
+ * removed two sets of html segment navigation bands, from very top and
+ under title (cleaner presentation without reduction in functionality, (also
+ for console clients))
+
+ * remote placement, rsync, simplify mapping used, should be a bit more robust
+
+ * response, user response abstraction, minor
+
+ * metaverse, superscript, subscript regex adjusted, (consider adopting this
+ modification more widely)
+
+ * digests, representation of document structure updated to use @, :A-:C, 1-3
+ (instead of 0-6)
+
+ * sysenv, change in use of mkdir
+
+ * sysenv, for processing of remote files, download of remote images,
+ correction to variable name [post 0.49.1 fix]
+
+ [this build is based on 0.49.1 which is "stable" in its major parts]
+
+%% sisu_0.48.7.orig.tar.gz (2006w46/7 | 2006-11-19) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.7.orig.tar.gz
+ 2bbc89da7fa28de1193ea64fd98bb522 1248263 sisu_0.48.7.orig.tar.gz
+ 94adac2227718f4a6c1c2437c883e939 606 sisu_0.48.7-1.dsc
+ f53871fe2aad4fc8ddfb9b3b1817d677 100806 sisu_0.48.7-1.diff.gz
+
+ * cgi html test search form, multilingual documents, file naming convention
+ resulted in incorrect url mapping of results, fixed
+
+ * dcc, document content digest, multilingual/non-English documents, fixes
+ related to translation and metadata extraction
+
+ * defaults for html, invisible dot navigation buttons, text made cleaner for
+ console clients, using < ^ > for pre, toc, and next, (there are other
+ equivalent navigation options)
+
+ * sitemaps, very early days, stubs in place to make this work
+ (google, yahoo, ms announced their joint decision to use this week)
+
+ * remote, placement of sitemaps directory to remote server, rsync
+
+%% sisu_0.48.6.orig.tar.gz (2006w45/6 | 2006-11-11) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.6.orig.tar.gz
+ 82b8dd63a4626fcef222d039820827cc 1245728 sisu_0.48.6.orig.tar.gz
+ 25be6c97cfa020a1b2971e02bc32b715 606 sisu_0.48.6-1.dsc
+ 1c682265850177ec5eb32a3cfe1fc3cd 100704 sisu_0.48.6-1.diff.gz
+
+ * html, doc (single text, scroll version) tables, fixed
+
+ * texpdf, bugfix for (asterisk marker type) footnotes in headings, fixed
+
+ * metaverse, in "visual" table representation {table} may be used instead of
+ {t} likewise {table~h} instead of {t~h},
+ (resulting output cleaned, fix)
+
+ * vim syntax highlighting updated for {table} match
+
+%% sisu_0.48.5.orig.tar.gz (2006w45/3 | 2006-11-08) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.5.orig.tar.gz
+ 208f47dcc87802fcd14b64e9c1aa2a52 1245103 sisu_0.48.5.orig.tar.gz
+ 1664f21a14fa2311d7cb115e8d31fc88 606 sisu_0.48.5-1.dsc
+ 428fe256c0dd063d362baa751866ede8 100632 sisu_0.48.5-1.diff.gz
+
+ * sisupod (directory zip) creation, file selection tuning
+
+ * command line option papersize (texpdf), minor convention e.g.
+ --papersize-letter (in addition to --papersize=letter) available options:
+ European 'A4', book 'a5', 'b5' and U.S. 'letter', 'legal' (system defaults
+ to A4). However, these can be and are better set in the config file
+ (document headers being another though not recommended possibility),
+
+ 'sisu --help env' should list the current (default/configuration) settings
+ including papersize
+
+ * minor checks, minor editing, e.g. man pages
+
+%% sisu_0.48.4.orig.tar.gz (2006w45/1 | 2006-11-06) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.4.orig.tar.gz
+ eee656e88462c4dc2f338dadb26fc97a 1244746 sisu_0.48.4.orig.tar.gz
+ 70bd0670b8b21130856e87d32644102c 606 sisu_0.48.4-1.dsc
+ f72edba97792bc72f07b5b66223761fc 100603 sisu_0.48.4-1.diff.gz
+
+ * texpdf, default table behaviour changed to accommodate tables with a lot of
+ text, also some cleaning of tables (fixed)
+
+ * plaintext, serious performance issue when dealing with a document with
+ tables, [especially annoying as tables are omitted from this output format]
+ addressed (fixed)
+
+ * markup footnote conversion to paragraph inline footnotes, (fixed)
+
+ * minor adjustment to sisupod directory name...
+
+%% sisu_0.48.3.orig.tar.gz (2006w44/2 | 2006-10-31) [Debian Release snapshot, uploaded by Daniel Baumann (High)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.3.orig.tar.gz
+ 8c3fffc9a7da73220e15d15cfba968bf 1243334 sisu_0.48.3.orig.tar.gz
+ 6a75a4a2d5817914f274388237ddcf4d 606 sisu_0.48.3-1.dsc
+ eea089e0690c3aa6c7a4baae8c4b5f54 100547 sisu_0.48.3-1.diff.gz
+
+ * one file omitted in sisu 0.48.2 fix, see comments there.
+
+%% sisu_0.48.2.orig.tar.gz (2006w44/2 | 2006-10-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.2.orig.tar.gz
+ a9a876acb9cdf3501cd3d7bfe09db9d0 1243141 sisu_0.48.2.orig.tar.gz
+ ae29c18dfb96d898e608ff50b1d20512 606 sisu_0.48.2-1.dsc
+ e16685b9fe00f5e6096f72386d699ff7 100497 sisu_0.48.2-1.diff.gz
+
+ * debian ruby build ruby-1.8.5-3 (uploaded yesterday) detects and breaks on
+ cyclic include errors which were found at a basic level of operation,
+ rendering program effectively broken. New ruby build affects all previous
+ versions of sisu. [Further code review is necessary to ascertain that this
+ does not occur anywhere else within sisu code base]
+
+%% sisu_0.48.1.orig.tar.gz (2006w43/7 | 2006-10-29) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.1.orig.tar.gz
+ cda3082de5c359737bfdfd23474fee2b 1242845 sisu_0.48.1.orig.tar.gz
+ badc4a6d1e6bc77956ec603a5278bbea 606 sisu_0.48.1-2.dsc
+ a95c14570a0e5ebd46a588c7181151f5 101129 sisu_0.48.1-2.diff.gz
+ sisu_0.48.1-1.dsc
+ sisu_0.48.1-1.diff.gz
+
+ * metaverse, indicate image missing if a requested image is not found
+
+ * processing directories default location moved to be placed under home or /tmp
+ from pwd
+
+ * (-1) debian/control, recommends hyperestraier removed as appears to cause
+ issues (also rename and pgaccess)
+
+ * (-2) debian/control recommends hyperestraier (sisu and sisu-complete) put
+ back
+
+%% sisu_0.48.0.orig.tar.gz (2006w43/6 | 2006-10-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.0.orig.tar.gz
+ 5e7bc1752828347d0f43e7eb8403cfec 1241476 sisu_0.48.0.orig.tar.gz
+ 79cce16683c3da3f70e9cc205710feb1 606 sisu_0.48.0-1.dsc
+ 748830590639ab2e8097b8c0820b37a4 100197 sisu_0.48.0-1.diff.gz
+
+ * sisupod, creation of (zipped sisu content files, primarily a way of
+ bundling sisu content assocated with a prepared sisu file or set of files,
+ that sisu commands can be run directly against) creation:
+ 'sisu -S [filename]'
+ places a file named sisupod.zip in the output directory
+ for directory
+ 'sisu -S'
+ creates a sisupod of the pwd named:
+ sisupod-[pwd.stub]_[date].ssp
+ e.g. sisupod-sisu_2006-10-26.ssp
+ (uses system call to unix commands find and egrep)
+
+ * sisupod, sisu can be run directly against a sisupod without manual
+ unpacking, e.g.:
+ 'sisu -3 sisupod.zip'
+ [early implementation, a system call used],
+ run against the following filename/types: sisupod, sisupod.zip,
+ [filename].ssp
+ * security:
+ * sisu does not ever use a sisurc.yaml within a sisupod
+ * sisu will only use a skin within sisupod if --trust(ed) modifier is
+ added to the command line
+ * skins, note: copy dir skin to skin_sisupod.rb
+ [doc skin keeps name as called with name within document]
+
+ * remote operations possible on sisupod, e.g.
+ 'sisu -3 http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip'
+
+ * sysenv, sisu processing directory '_sisu_processing' default placement now
+ first within pwd (markup text directory) if that is not writable under home
+ ~ and if not available to /tmp (the preference of home over /tmp my be
+ reconsidered, thinking is to default towards keeping processing related
+ info within private space)
+
+ * manifest, uses documents home button/icon, if available
+ (rather than sisu default)
+
+ * sisupod alternative names sisupod, siuspod.zip [filename].ssp
+
+ * urls, tune, removed link to html 'tune' output file, no longer generated
+
+ * sysenv, url path reporting fix, (broken by renaming in 0.47.7)
+
+ * processing directories default location moved to be placed under home or /tmp
+ from pwd, likewise sisupod creation directory moved
+ [processing directory]/sisupod from ./_sisu/sisu_doc
+
+ * extra testing, numerous small fixes, (several related to method renaming in
+ sisu-0.47.7, also checks against both ruby 1.8.5 and current 1.9, $KCONV set
+ to UTF-8 rather than rely on environment and many more also as above)
+
+%% sisu_0.47.8.orig.tar.gz (2006w42/4 | 2006-10-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.8.orig.tar.gz
+ 53c131f5c569d96ff60ecfdeb1a1f3d5 1237476 sisu_0.47.8.orig.tar.gz
+ a39620a910612684a0dc31b3b5559eda 606 sisu_0.47.8-1.dsc
+ 8570a26f39ec44b3c8c539d0dcf63a99 100075 sisu_0.47.8-1.diff.gz
+
+ * metaverse, minor fix related to link created for shared source file with
+ regard to new syntax shortcut markup for listing multiple available output
+ types produced by SiSU (introduced in 0.47.6)
+
+%% sisu_0.47.7.orig.tar.gz (2006w41/6 | 2006-10-14) [Debian Release snapshot, uploaded by Daniel Baumann]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.7.orig.tar.gz
+ 6bb28ad3f783184876c455c91cf9ef22 1236983 sisu_0.47.7.orig.tar.gz
+ c8bf85fb300d6260176ad459c2f6e3a0 606 sisu_0.47.7-2.dsc
+ 8eaeebb43b6de5ca727995d681d36b1c 102531 sisu_0.47.7-2.diff.gz
+ 62c779fa5ca023af71854d989b60bfe9 609 sisu_0.47.7-1.dsc
+ 07b12f4b1af9873eee44e610511ac525 99876 sisu_0.47.7-1.diff.gz
+
+ * sysenv, minor code play, some method renaming, organisational
+ (however affects rest of code, much testing, (smallish possibility of
+ breakage remains))
+
+ * gif, reinstate support, however use not yet recommended
+ (gif no longer under patent, however, gif is not available for all pdf,
+ does not yet appear to be available in tetex)
+ [image support: png, jpg, (gif)]
+
+ * [debian/control] sisu-pdf set to work with texlive (tetex|texlive depends)
+ (sisu works out of the box with texlive installed, currently an issue with
+ the default font in texlive)
+ http://lists.debian.org/debian-tex-maint/2006/10/msg00620.html
+
+%% sisu_0.47.6.orig.tar.gz (2006w40/6 | 2006-10-07) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.6.orig.tar.gz
+ 7e319ebd2f8265f6ca7e46a4c74bd211 1236547 sisu_0.47.6.orig.tar.gz
+ bf4602222c37f9e288284e1573ebd034 609 sisu_0.47.6-1.dsc
+ 9741957517f66d825d952e309d231152 99839 sisu_0.47.6-1.diff.gz
+
+ * tex/pdf, fixed paragraph indent with hyperlink
+ (previously linking not parsed and dealt with)
+
+ * tex/pdf, fixed closing double quote (was typo)
+
+ * syntax, new shortcut markup for listing multiple available output
+ types produced by SiSU (existing syntax unaffected)
+
+ * [package structure, vim directory moved to data/sisu/conf/vim from
+ data/vim]
+
+%% sisu_0.47.5.orig.tar.gz (2006w39/7 | 2006-10-01) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.5.orig.tar.gz
+ 40d50d1db5e6f1ca4750dec82fc7aad8 1234759 sisu_0.47.5.orig.tar.gz
+ e3555bb320920eb25e62c820961105e7 609 sisu_0.47.5-1.dsc
+ a030d4f4dd052009ce36ab14dec29ed3 99796 sisu_0.47.5-1.diff.gz
+
+ * sisupod, fix creation of, change of library name caused break in 0.47.4
+
+%% sisu_0.47.4.orig.tar.gz (2006w39/5 | 2006-09-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.4.orig.tar.gz
+ 71ae6429e675fdbfb6a8ab507c3e6989 1233691 sisu_0.47.4.orig.tar.gz
+ c0968784d14ac2ff6b7754dc5de6024a 609 sisu_0.47.4-1.dsc
+ a0ccb2abcee55dd60529b2cc88c73454 99693 sisu_0.47.4-1.diff.gz
+
+ * syntax highlighting, kate, kwrite, nano minor updates, review
+
+ * debian: browser and pdf reader icons removed,
+ (Closes: #389500) fixes debian policy violation
+ removed non dfsg compliant firefox icon
+ (also removed other browser related icons)
+
+%% sisu_0.47.3.orig.tar.gz (2006w38/6 | 2006-09-23) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.3.orig.tar.gz
+ 18ac94ea4ab58060873ba22d37d03bd0 1268844 sisu_0.47.3.orig.tar.gz
+ 3c2fac012a174f930e9030863e92f065 609 sisu_0.47.3-1.dsc
+ c075392d392665de4d5054f438352f2f 99612 sisu_0.47.3-1.diff.gz
+
+ * minor code review
+ [takes care of RAM issue experienced with some forms of batch processing]
+
+%% sisu_0.47.2.orig.tar.gz (2006w38/5 | 2006-09-22) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.2.orig.tar.gz
+ 5afc268f78ab72b17c387469e2ae5caf 1268744 sisu_0.47.2.orig.tar.gz
+ 334056e0cdd87dc2887baf99a638e3d1 609 sisu_0.47.2-1.dsc
+ 8e468cc4052b0f28fb3b22ef5dfbf4c2 99580 sisu_0.47.2-1.diff.gz
+
+ * metaverse, a line of code needed changing for ruby-1.8.5
+
+%% sisu_0.47.1.orig.tar.gz (2006w38/1 | 2006-09-18) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.1.orig.tar.gz
+ 77d77e7888ee1f97a38012233d5d4d90 1268488 sisu_0.47.1.orig.tar.gz
+ c7e9cd3ee27bba16684651bda463124c 609 sisu_0.47.1-1.dsc
+ 596bb6380b8355d4b5420aa5ddb2008f 99556 sisu_0.47.1-1.diff.gz
+
+ * fixed, document content certificate, issue with batch processing (and
+ cleaning of earlier document details) sorted
+
+ * fixed, sharing document source for multilingual documents (-s), creates and
+ copies to the wrong directory
+
+ * plaintext minor adjustments, and a batch processing information sync fix
+
+%% sisu_0.47.0.orig.tar.gz (2006w37/7 | 2006-09-17) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.0.orig.tar.gz
+ c8eb3908d4b6fb6e6bc199118a0ef897 1268127 sisu_0.47.0.orig.tar.gz
+ 42836c37c783d9c7aee87085127cd87c 609 sisu_0.47.0-1.dsc
+ e02895ae383af556ebc50d7832c7d20a 99541 sisu_0.47.0-1.diff.gz
+
+ * sisupod, use zip compression and file extension .zip
+ (instead of tar gzip .tgz) interoperability, wider platform comprehension
+
+ * sisupod, master documents (.ssm) bug in batch processing sorted (todo with
+ filenames)
+
+ * html tune, unnecessary hard output removed (except in maintenance mode -M)
+
+ * (document content certificate, issue with batch processing sorted)
+
+ * reduce system calls
+
+ * odf base file, odt.zip (instead of odt.tgz), easy way to maintain directory
+ structure (issue in version control, hg drops empty directories)
+
+ * conversion, prefer --to- to --to=, keep both, man page and help updated to
+ use --to-[conversion] (also minor cleaning of screen output)
+
+ * debian/control depends zip and unzip added, used for sisupod.zip and ODF output
+
+%% sisu_0.46.5.orig.tar.gz (2006w36/6 | 2006-09-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.5.orig.tar.gz
+ bea9a0eddb1ea8746de416a7bdd22e2e 1265848 sisu_0.46.5.orig.tar.gz
+ 87e99256d31497c23509811e122b6ea2 609 sisu_0.46.5-1.dsc
+ 5b4caafec6ac1ebc5314f7fa44e8f677 99342 sisu_0.46.5-1.diff.gz
+
+ * documentation adjustments
+
+%% sisu_0.46.4.orig.tar.gz (2006w36/3 | 2006-09-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.4.orig.tar.gz
+ 506bc266f4618eea88c7c005f21c2bf4 1269441 sisu_0.46.4.orig.tar.gz
+ 6fbd0e2e7f2915725feb03e3ea0f977f 609 sisu_0.46.4-1.dsc
+ a7fcd22b852f90ab4af04c56143a8aa2 99242 sisu_0.46.4-1.diff.gz
+
+ * defaults html text/ accompanying blurb removed some Ruby / Debian / Linux /
+ Unix text
+
+%% sisu_0.46.3.orig.tar.gz (2006w36/1 | 2006-09-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.3.orig.tar.gz
+ c41d41e0771e66c236b2832c8798a1d8 1269233 sisu_0.46.3.orig.tar.gz
+ 74458da231e6e4628996c48eb915344d 609 sisu_0.46.3-1.dsc
+ f7ab7c92526bfecd71331a69ef069d44 99223 sisu_0.46.3-1.diff.gz
+
+ * Ruby version upped to 1.8.4, (probably will work with earlier versions but
+ not tested)
+
+ * db option synonyms --pgsql for -D or --sqlite for -d
+
+ * document structure, extended level, stubs in place
+
+ * syntax highlighting, directory renamed and a quick look at kate and
+ diakonos updated
+
+ * help/man pages, db related minor update
+
+ * termsheet checked
+
+ * minor code play
+
+ * debian/control moved from extra to optional - does not conflict with
+ anything, though a bit specialised perhaps
+
+ * debian/copyright, year 2006 added
+
+ * [debian/control build does not permit changing ruby version to 1.8.4]
+
+%% sisu_0.46.2.orig.tar.gz (2006w34/5 | 2006-08-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.2.orig.tar.gz
+ 852d865e66fd37e1902d3940cd460e55 1265122 sisu_0.46.2.orig.tar.gz
+ 9931d0d05ea5e37134fb063c31caa66e 609 sisu_0.46.2-1.dsc
+ 6a52a52ede5cf3158cd4bd843f737295 99124 sisu_0.46.2-1.diff.gz
+
+ * experimental conversion xml(sxs,sxn) to sst, (from xml that was converted
+ from sst) [sxd not yet in place, and several errors identified]
+
+ * header metadata extraction and sharing changed (used by xml and other
+ document types)
+
+ * conversion file libraries, some renaming
+
+ * zsh completion (see 0.46.1), simplified/corrected in response to feedback,
+ still naive
+
+ * help and man pages updated with conversion info between sst and xml and
+ back
+
+ * Ruby: ruby version restrict use to ruby-1.8.2 or later, but only tested for
+ ruby-1.8.4 (and later) [may have to restrict to more recent versions of
+ Ruby]
+
+ * Ruby: if|unless|elsif|where colon constructs are depreciated in Ruby 1.8.5.
+ (released today), so (the aesthetically more pleasing) colons switched with
+ semi-colons.
+
+%% sisu_0.46.1.orig.tar.gz (2006w33/3 | 2006-08-16) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.1.orig.tar.gz
+ 26bef582eb5da7fe39b578e9296ceb19 1263026 sisu_0.46.1.orig.tar.gz
+ 37ebebd9bf56e2e5fd57b0b1411771be 609 sisu_0.46.1-1.dsc
+ 3537949d88ec6749698fd04d21a30d96 99119 sisu_0.46.1-1.diff.gz
+
+ * zsh, naive zsh completion file _sisu in data/sisu/conf/completion (on
+ debian installed to /usr/share/sisu/conf/completion) 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)
+
+ * code, minor alterations,
+ * creation of Arrays and Hashes, not intended to be substantive
+ * in hub corrected calling of help for termsheet
+ * small adjustments to calling of conversion scripts
+
+ * debian/control, reminded that sisu-vim existed prior to vim-sisu (renamed
+ due to vim policy) both now removed and replaced by default installation,
+ control file modified accordingly for sisu-vim
+
+%% sisu_0.46.0.orig.tar.gz (2006w32/6 | 2006-08-12) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.1.orig.tar.gz
+ 84d863f4f41ff2e328530930890f7160 1259520 sisu_0.46.0.orig.tar.gz
+ 9d04df245c99431649f40f58d5022c40 609 sisu_0.46.0-1.dsc
+ 6b027cbd9d063eae67010ee072a6fc28 99068 sisu_0.46.0-1.diff.gz
+
+ * 0.44 branch reinstated (leapfrogging over 0.45 which was a reversion to
+ 0.43)
+
+ * metaverse changes for consistency, affects all downstream code (with
+ attendant risk), numerous related changes; preliminary tests passed
+
+ * see 0.44.0
+
+ [basic operation (sisu -mNhwpoabxXyv [filename]) also tested for ruby 1.9
+ with rmagick switched off (db not tested)]
+
+ * debian/rules compression mentioned twice, one removed
+
+%% sisu_0.45.0.orig.tar.gz (2006w31/7 | 2006-08-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.45.1.orig.tar.gz
+ dbdcdd947aa6357492ac50a5bb5b81af 1242290 sisu_0.45.0.orig.tar.gz
+ 9ac37f27c19ff8696631396627919806 609 sisu_0.45.0-1.dsc
+ 7426d8ba2f1e2aa709a0aeccd4596f4d 99025 sisu_0.45.0-1.diff.gz
+
+ * an emergency reversion to 0.43 code, as 0.44 breaks many LaTeX/pdfs
+ [the other components of 0.44 are fine but the LaTeX part does not play
+ properly with the new code base]
+ for the present time, ignore (jump over) the version changes in 0.44,
+ and continue from 0.43
+
+ * only the odf icon (noted in 0.44) and a cosmetic change to manifest are
+ added to this release since 0.43
+
+ * the debian related changes in 0.44 are retained
+
+ * NB. only emergency maintenance on this branch, development is on 0.44
+
+%% sisu_0.44.0.orig.tar.gz (2006w31/7 | 2006-08-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.44.1.orig.tar.gz
+ 4ce1f4946ce12180bf257d46f5ab6ff0 1256908 sisu_0.44.0.orig.tar.gz
+ f976a5e8494184696c70c45b240933ee 609 sisu_0.44.0-1.dsc
+ a8fd211fff73a01beb17433707bb1e04 98941 sisu_0.44.0-1.diff.gz
+
+ [some breakage, in particular LaTeX/pdf had issues, fixed in 0.46.0]
+
+ * some juggling of code and renaming of some files
+ (db broken into smaller chunks)
+
+ * metaverse, document level structure moved to external shared library and
+ determined therefrom
+
+ * metaverse, ocn moved to an external shared library and together with
+ "node" numbering determined therefrom
+ [raises possibility of ocn (numbering) issues, preliminary tests passed]
+
+ * db operations broken up into smaller code files
+
+ * numerous other little things
+
+ ** Note: shared sisu libraries, practice likely to become that these contain
+ pointers to libraries, rather than the libraries themselves, e.g.
+ shared_db
+
+ * odf/odt added generic odf tiny icon
+ * html, added icon and link to opendocument text
+ (assumes output is always present, as do the pdf equivalents)
+
+ * markup, experimenting with simple xml models,
+ three xml representations of sisu markup, sxs, sxd, sxn
+ export with
+ sisu --to=sxs [filename]
+ [experimental, these will change]
+ import, not done
+
+ * --to made a synonym for --convert
+
+ * debian/rules simplified
+ [utilising feedback from Daniel Baumann on "rant" package]
+
+ * debian/control sisu-pdf Depends: changed to make TeX Live optional,
+ actually part of it is now required as tetex along with tetex-extra do not
+ contain all the LaTeX packages SiSU requires (in particular manyfoot.sty is
+ missing) [used feedback from Ralf Stubner on dependency options]
+
+ * debian/lintian/sisu added lintian override for man page and non-executables
+
+%% sisu_0.43.0.orig.tar.gz (2006w29/6 | 2006-07-22) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.43.0.orig.tar.gz
+ 09127f189334eef57363875bb2fb2a4d 1241138 sisu_0.43.0.orig.tar.gz
+ 11692249f8ae03a4ead59fb1f0e00514 609 sisu_0.43.0-1.dsc
+ e3307627de717fca49c9fbec988c8cc2 99392 sisu_0.43.0-1.diff.gz
+
+ * footnotes, introduction of new editor (square bracket) series,
+ using asterisk and plus signs
+ ~[ asterisk editor note ]~ or ~[* asterisk ed. note ]~ and
+ ~[+ dagger ed. note ]~
+ outputs updated: plaintext, latex, html, xml, odf, dcc, database
+ the sample search form does not yet search the new (asterisk and plus)
+ endnote series
+ [easy to add additional symbols later, also consider it should be fairly
+ straightforward to add possibility to use of name of note maker with
+ numbered note sequences for each contributor; you may wish to think of
+ sorting into different types for some of these like plaintext, later]
+
+ * database, breaks existing database model by introducing new tables, to
+ accommodate the new endnote series, (square bracket series). (there are
+ alternative ways to add the information, e.g. add column with information
+ on the endnote symbol involved; have in fact added a table for each of the
+ symbols used)
+
+ * additional footnote annotations (asterisk, dagger) can be dropped from
+ output with command modifiers --no-asterisk, --no-dagger, --no-annotate
+
+ * --convert=footnotes (convert to embedded footnote markup, do not make
+ changes if footnote mismatch)
+ --convert=footnotes-force (make changes even if there is a footnote
+ mismatch) provide warning about changes what todo, make backup? or create
+ new file, what filename to use?
+
+ * --no-ocn switches off object citation numbering. Produce output without
+ identifying numbers in margins of html or LaTeX/pdf output. [with -h -H or
+ -p]
+
+ * vim syntax highlighter recognises footnote/annotation additions
+
+ * debian vim/addons/syntax/sisu.vim add the new syntax file
+ (submit changes to Bram)
+
+ * man page and help.rb updated on editor footnotes, square bracket series
+
+ * relaxng object models, look at, included in data/doc/sisu/models/relaxng
+ (some models quite old, and undeveloped, originally in sisu library
+ relaxng.rb)
+
+ * metaverse, and elsewhere, utf-8 is assumed: started cleaning out legacy
+ code (character converting regex) sisu generates its first Chinese document
+ in html, plaintext and sql databases (postgresql and sqlite) only, at this
+ stage... [confirmation that first Chinese document presentation is fine,
+ from author of test (law related) text; the listed text representations
+ reasonably handle the utf-8 characters involved, and document structure is
+ ok]
+
+%% sisu_0.42.4.orig.tar.gz (2006w29/1 | 2006-07-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.4.orig.tar.gz
+ dccd6a56bcd2217d3bb0f1be5211ed57 1230468 sisu_0.42.4.orig.tar.gz
+ a6814ae0311a22d1f0ca89208629e2ac 609 sisu_0.42.4-1.dsc
+ bdebad3bdcda48423bdb4a021224c04b 99255 sisu_0.42.4-1.diff.gz
+
+ * sisu_manifest, pdf description express portrait copy to be optimised/biased
+ towards print, and landscape to have screen view bias/optimisation
+ (orientation and colored links)
+
+ * debian (mostly), meta-packages man pages moved to man(7)
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377209
+ (Closes: #377209) [which was re-opened as not properly done previously,
+ myon]
+
+ * debian, closed bug 377208 after informing submitter changes had been made
+ and requesting review ('fixed' in 0.42.2)
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377208
+ (Closes: #377208) [submitted:myon]
+
+ * debian/control added a Conflicts: vim-sisu,
+ sisu-remote, to the existing Replaces: these
+ two packages have been removed
+
+ * ruby, also tested ok with ruby1.9 (Debian Version: 1.9.0+20060609-1)
+ sisu -3v [filename]
+ [database tests omitted, relevant ruby drivers not on system]
+
+%% sisu_0.42.3.orig.tar.gz (2006w28/2 | 2006-07-11) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.3.orig.tar.gz
+ d3ab92e9f20ef48de711512d10fd3fe7 1230428 sisu_0.42.3.orig.tar.gz
+ 33088e3d51a612cf73a64afe239eb8f5 609 sisu_0.42.3-1.dsc
+ 28a4652fdade40b19ddb88df4344242f 99164 sisu_0.42.3-1.diff.gz
+
+ * html, segments, cosmetic, removal of footnote marker in headings
+
+ * sysenv, fix for when sisu sql related packages are not
+ installed, should not then be loading rb dbi module
+
+%% sisu_0.42.2.orig.tar.gz (2006w27/6 | 2006-07-08) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.2.orig.tar.gz
+ cf5b6605089179140da52f5bde655ebd 1229996 sisu_0.42.2.orig.tar.gz
+ 081c37f65a4fbb5ed7d3a2ed1a02c423 609 sisu_0.42.2-1.dsc
+ 19f7878a951fa966acb5ab3c5d38f6c8 99115 sisu_0.42.2-1.diff.gz
+
+ * html, xhtml, added utf-8 specification
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ [(previously relied on correct browser setting]
+
+ * debian/control, removed sisu-remote, added recommends rsync,
+ openssh-client|lsh-client, keychain, to main sisu package instead
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377206
+ (Closes: #377206) [submitted:myon]
+
+ * debian/control, removed vim-sisu, this used to contain syntax highligter
+ and color scheme now included in Vim 7, all that remains is ftplugin, now
+ installed by main sisu package
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377207
+ (Closes: #377207) [submitted:myon] [* change to source package structure]
+
+ * debian/control, sisu Replaces: vim-sisu
+ debian/sisu.install installs ftplugin originally in vim-sisu
+
+ * debian/manpages, sisu (main package) now installs vim_sisu page in man(7)
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377209
+ (Closes: #377209) [submitted:myon]
+
+ * debian/control, package description related issues:
+ * modified sisu
+ * modified sisu-complete
+ * modified sisu-postgresql
+ * modified sisu-sqlite
+ * modified sisu-pdf
+ * removed sisu-remote, (as sisu-remote is no more)
+ * removed vim-sisu, (as vim-sisu is no more)
+ * removed sisu-remote, (as sisu-remote is no more)
+ [consider adding a note on remote placement of documents in sisu(8)
+ later]
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377208
+ (verify that descriptions are satisfactory before closing: #377208)
+ [submitted:myon]
+
+%% sisu_0.42.1.orig.tar.gz (2006w27/4 | 2006-07-06) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.1.orig.tar.gz
+ 7d6bcb9a4be5ded17e71522b37a2af5a 1227649 sisu_0.42.1.orig.tar.gz
+ 734e48c69096c912cbd60f38b8961bd0 632 sisu_0.42.1-1.dsc
+ bb107345477000cc540fb08a73df4379 99097 sisu_0.42.1-1.diff.gz
+
+ * dbi fix (--createdb)
+
+ * [ruby1.9, forward testing, general check, (tests ok db operations apart,
+ drivers not installed)]
+
+ * debian/control, removed recommends libtidy [non-existent, see current
+ libtidy-0.99-0, called in by tidy which is recommended and sets libtidy
+ dependency]
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377086
+ (Closes: #377086) [submitted:luk]
+
+%% sisu_0.42.0.orig.tar.gz (2006w27/4 | 2006-07-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.0.orig.tar.gz
+ 297702e8c44b95f0ac16c656b798812d 1227287 sisu_0.42.0.orig.tar.gz
+ 065d70ba326d517401f2b62fe5c837c4 632 sisu_0.42.0-2.dsc
+ 0ad5a4471a31f4968a7b900a17c43ac7 99754 sisu_0.42.0-2.diff.gz
+ c3be264946486f71b021227a16197162 632 sisu_0.42.0-1.dsc
+ 83577a37dbbe6915a25814a541263e54 98970 sisu_0.42.0-1.diff.gz
+
+ * texpdf fix, object citation numbering reinstated
+
+ * asterisk (and plus sign) footnote/endnote marker/tags
+ [SubTech2006::LII:TB "request": required for U.S. law articles]
+ done: html, odf, xmls, plaintext,
+ latex pdf (some cosmetic changes to come)
+ digests(dcc)
+ sql (specific issue not addressed but works sortof)
+
+ * syntax, asterisk (and plus sign) footnote/endnote marker/tags
+ introduced ~{* for an asterisk marked endnote }~ and plus sign equivalent
+ [reason for version number change, as previous
+ version won't parse]
+
+ * texpdf portrait text now all black, including toc and endnote markers
+ landscape retains color for toc (red) & linked text (blue) [online viewing]
+ [introduce configuration options?]
+
+ * help updated
+
+ * kdissert conversion to sisu markup a refinement (with less-than &
+ greater-than)
+
+ ** debian/control changed back to ruby >= 1.8.2
+ * debian/control ruby >= 1.8.4
+ (not done sufficient testing on 1.8.2, so not supported)
+
+ * debian/control sisu-pdf added Depends: texlive-latex-extra
+ (needed for manyfoot.sty, used for asterisk footnotes)
+
+ * debian vim-sisu, description
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374873
+ (Closes: #374873) [submitted: Jens Seidel]
+
+%% sisu_0.41.8.orig.tar.gz (2006w25/6 | 2006-06-24) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.8.orig.tar.gz
+ ea76d18d8c58bb444f4be71c4e9a3185 1225229 sisu_0.41.8.orig.tar.gz
+ 283d46cf2196e667e5416327a19659c5 632 sisu_0.41.8-1.dsc
+ 1fe0b2f06aed3d3f8a272340dcabef9c 98810 sisu_0.41.8-1.diff.gz
+
+ * kdissert, texpdf, accept sisu page break and new page marker, used for
+ LaTeX/pdf
+
+%% sisu_0.41.7.orig.tar.gz (2006w25/6 | 2006-06-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.7.orig.tar.gz
+ 792ed0b0e57e78cf88ec37102fd3de8a 1225007 sisu_0.41.7.orig.tar.gz
+ 77b90465be946edcdb57c31b8fc3cd10 632 sisu_0.41.7-1.dsc
+ 0f568b819dd5b18a5637d77c220beaf5 98795 sisu_0.41.7-1.diff.gz
+
+ * document samples, created subdirectory dfsg for documents that comply
+ with the Debian Free Software Guidelines and moved the "GPL2" and
+ "Free as in Freedom" texts and associated images back into the source
+ tarball and main (from sisu-markup-samples) [FaiF is published under
+ the GNU Free Documentation License]
+
+ * html segments, footnotes for segments, bugfix, [faulty regex matched more
+ than it was supposed to resulting in dropping of some footnote sections -
+ these remained available elsewhere in the endnote segment]
+
+ * relaxng, sisu object models, first pass at XML object models for sisu input
+ structure, and sisu metaverse structure, alternative data representation
+
+ * kdissert:
+ * sisu headers, added a hack to permit the inclusion of sisu headers, by
+ entering them in the top level node (for which sisu will now only process
+ properly if empty or if it contains comments or sisu headers)
+ * texpdf, tell when documents are prepared using kdissert
+ * html default skin for kdissert with icon
+ * [kept out for now: kdissert sisu sample file, and its converted sisu text
+ equivalent]
+
+ * Debian control, 'Home page:' corrected to 'Homepage:'
+ closes Bug#374873: Improved package description
+
+ * Debian rules, .ssm and .ssi files added to list of not compressed file
+ types (/usr/share/doc/sisu)
+
+%% sisu_0.41.6.orig.tar.gz (2006w25/2 | 2006-06-20) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.6.orig.tar.gz
+ ff6217bb156f2ab803bf87367fb327e4 671142 sisu_0.41.6.orig.tar.gz
+ 594e27b60ceb415bdd3504929a7adb0f 631 sisu_0.41.6-1.dsc
+ 3ba8aecfd904844b40ef2a26a6379aec 98359 sisu_0.41.6-1.diff.gz
+
+ * sisu_manifest, added possibility of sharing of kdissert source, see sample:
+ http://www.jus.uio.no/sisu/kdissert.kdi/sisu_manifest
+ and note the kdissert source file on which sisu markup and outputs are based:
+ http://www.jus.uio.no/sisu/kdissert.kdi/kdissert.kdi
+
+ * kdissert fixes to make the following true:
+
+ * sisu --convert=kdi [kdissert filename]
+ will attempt to convert a simple file produced using kdissert to sisu
+ markup, basic and experimental
+
+ * kdissert_to_sisu: some fixes, still very basic and experimental
+ [data/sisu/conf/convert or /usr/share/sisu/conf/convert]
+
+ * debian control, added recommends kdissert
+
+ * [issue spotted with rsync, new output directories, fix later]
+
+%% sisu_0.41.5.orig.tar.gz (2006w25/1 | 2006-06-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.5.orig.tar.gz
+ da50cd8f993761e8011386afcd8d2636 669069 sisu_0.41.5.orig.tar.gz
+ 33e2fc91260a5131e60588729cbf0c67 631 sisu_0.41.5-1.dsc
+ d63fd861450216b66acf0295100c754d 98313 sisu_0.41.5-1.diff.gz
+
+ * sisu --convert=kdi [kdissert filename]
+ will attempt to convert a simple file produced using kdissert to sisu
+ markup, basic and experimental
+
+ * kdissert_to_sisu: some fixes, still very basic and experimental
+ [data/sisu/conf/convert or /usr/share/sisu/conf/convert]
+
+ * param, minor fix to "prefix" metadata regex
+
+ * renamed a couple of libraries related to file conversion
+
+%% sisu_0.41.4.orig.tar.gz (2006w24/7 | 2006-06-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.4.orig.tar.gz
+ 4182ed0cd4d32beaa71e53028fdd17c5 667716 sisu_0.41.4.orig.tar.gz
+ 4d1c95b8e8734adfa72ed7ca3dca443d 631 sisu_0.41.4-1.dsc
+ 210daf7fd979a41b1a34db3918a68dbc 98286 sisu_0.41.4-1.diff.gz
+
+ * kdissert_to_sisu: a very basic trial conversion script from kdissert .kdi
+ to sisu .sst markup provided [preliminary/proof of concept, provided in
+ data/sisu/conf/convert or /usr/share/sisu/conf/convert] (Kdissert, by
+ Thomas Nagy is a topic/mind mapping tool for the preparation of documents
+ http://freehackers.org/~tnagy/kdissert/ )
+
+%% sisu_0.41.3.orig.tar.gz (2006w24/3 | 2006-06-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.3.orig.tar.gz
+ fc5f119deefab7cab8c226d8724d4f99 666605 sisu_0.41.3.orig.tar.gz
+ a64f86b41186e6edc039c960a41c2e1b 631 sisu_0.41.3-2.dsc [2006-06-15]
+ e3bab2d070567bed6e0c72762beb594b 98885 sisu_0.41.3-2.diff.gz
+ 55e612d16607e1a23dd2aa2d241a374f 631 sisu_0.41.3-1.dsc
+ 36a386fb433eb17e7cfe195b09216d8c 98249 sisu_0.41.3-1.diff.gz
+
+ * options parsing changes, possibility of letter duplication
+ removed [-CC no longer will work use -C --init=site]
+
+ * texpdf_format, old code rearranged
+
+ * sysenv, fixes in File_map where @md (param) not available
+
+ * info related to share source file and sisudoc, bug fix
+
+%% sisu_0.41.2.orig.tar.gz (2006w23/5 | 2006-06-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.2.orig.tar.gz
+ e98068cf061df4f428b40cfee984f593 666123 sisu_0.41.2.orig.tar.gz
+ 55896e6fd677475b3af56b19d20fc33a 631 sisu_0.41.2-1.dsc
+ d66cc73ca8fa3103a5de58903e99626c 98220 sisu_0.41.2-1.diff.gz
+
+ * search form, options passing, sisu -F --webserv=webrick
+
+ * html segments endnote fix for the deposit of endnotes occurring in levels
+ :A - :C
+
+ * texpdf, a4 text height re-fixed
+
+ * digest, document metadata, info re-fix
+
+ * plaintext, small fix, document metadata
+
+%% sisu_0.41.1.orig.tar.gz (2006w23/3 | 2006-06-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.1.orig.tar.gz
+ e8c3381acb10e678e167755181380091 665743 sisu_0.41.1.orig.tar.gz
+ 116ee32633631a305307f59eef4f32e9 631 sisu_0.41.1-1.dsc
+ fef43880a4b0c0ce68ca269b19108216 98204 sisu_0.41.1-1.diff.gz
+
+ * defaults, html_format, some html cleaning (including fix of html comment
+ marker that was problem for dillo in doc.html)
+
+ * html segments endnotes, fix for first segment, (endnotes were deposited in
+ first segment multiple times (or rather this happened in some segments
+ following a level :A - :C heading ))
+
+ * markup_convert, hub, changes, should now be possible to convert and
+ generate in a single changed rune, e.g.
+
+ sisu --convert=to38 -h autonomy_markup0.sst gpl2.fsf.sst
+
+%% sisu_0.41.0.orig.tar.gz (2006w22/6 | 2006-06-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.0.orig.tar.gz
+ b35ae1c9380d3ec94db8f97950e32a82 665634 sisu_0.41.0.orig.tar.gz
+ bd2e6542cd3dba16d0489155d1b4e7d5 631 sisu_0.41.0-1.dsc
+ e1d2948368753d4880c8ba9efcb2a651 98182 sisu_0.41.0-1.diff.gz
+
+ * options, (command line options) message passing (should become cleaner),
+ program piping changed, command line information added as 'opt',
+ (subsequently contained within param 'md'), creates considerable scope for
+ further tidying (cosmetic refactoring) [most code affected, preliminary
+ tests passed, (some possibility of bugs and breakage)]
+
+ * hub, param, hooks in place to permit modification of default processing
+ instructions set in config files or within document headers by way of
+ command line processing instruction starting with -- (however, only
+ implemented for latex/pdf paper size).
+
+ * hub command line now accepts individual command instructions, previously
+ was necessary to write, e.g.
+ sisu -mNhwpoabxXyv [filename/wildcard]
+ (sisu -3 [filename/wildcard] for short) now may alternatively write:
+ sisu -m -N -h -w -p -o -a -b -x -X -y -v [filename/wildcard]
+
+ * dbi command line rune now requires "--" before instruction,
+ --import, --update, --recreate, etc.
+ removed short forms for --import and --update (-i and -u)
+
+ * texp pdf, adjustments to document presentation dimensions
+ (A4, US_letter, book_b5, book_a5, US_legal)
+
+ * texpdf, command line parameter may be used to change paper size output
+ sisu -p --papersize='book' [filename]
+ preset sizes include: 'A4', U.S. 'letter' and 'legal' and 'book' sizes 'A5'
+ and 'B5' (system defaults to A4).
+
+ * texpdf, image resizing for different paper sizes
+ (useful when offering on the fly alternative document dimension processing)
+ (manually calibrated to suit default document layouts) [note however other
+ blocks such as tables are not (yet) handled similarly]
+
+ * help (interactive help) now needs to be invoked with:
+ sisu --help [help query]
+ sisu on its own will still get you into an interactive help mode
+
+ * [consider permitting multiple document size pdf outputs, (easily done, but
+ promises slower processing as each additional size selected is generated)
+ currently you select your size and get a portrait and landscape, the
+ selection of whatever size over-writes the other, as they are saved to the
+ same file-name]
+
+%% sisu_0.40.4.orig.tar.gz (2006w21/7 | 2006-05-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.4.orig.tar.gz
+ 4266b03409162c68322b054fda599134 664267 sisu_0.40.4.orig.tar.gz
+ 009e41731e25ddfde8e685998432d795 631 sisu_0.40.4-1.dsc
+ 4469b7acab1e00ac9b4fcdf5ae384edb 98011 sisu_0.40.4-1.diff.gz
+
+ * tex pdf, minor adjustments, including page-breaks restored for 0.38 markup
+
+ * package source directory renamed with underscore instead of hyphen
+
+%% sisu_0.40.3.orig.tar.gz (2006w21/3 | 2006-05-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.3.orig.tar.gz
+ f67f66e42617dd2c0cd8d28cfa95e217 663690 sisu_0.40.3.orig.tar.gz
+ 2280c18cbb60c671a06e0b2dced435af 631 sisu_0.40.3-1.dsc
+ 84cb50d042b87fc19e42b156a27480a4 97951 sisu_0.40.3-1.diff.gz
+
+ * metaverse, fix reference to dc_publisher in param (not publisher)
+
+ * rant installer checked, removed sisu-examples, and post install routine as
+ document samples are now packaged separately as sisu-markup-samples
+
+%% sisu_0.40.2.orig.tar.gz (2006w21/3 | 2006-05-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.2.orig.tar.gz
+ e792de16cb6acbe2cabe3c650eef47ce 665085 sisu_0.40.2.orig.tar.gz
+ 76c87061052e430d8d8ac0cfad4a2168 631 sisu_0.40.2-1.dsc
+ eee774779cb3a15cb164c032de5ae4cc 97904 sisu_0.40.2-1.diff.gz
+
+ * babel, more use of translation module, used in metaverse (originally used
+ for manifest) [expand]
+
+ * correction to apt sources.list information provided in this document for
+ 0.40.1, and updated in README
+
+%% sisu_0.40.1.orig.tar.gz (2006w21/1 | 2006-05-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.1.orig.tar.gz
+ 86b2c25a8bccb0ecb38f0e1fe11aa522 664295 sisu_0.40.1.orig.tar.gz
+ 3a2a198b18847ebf6ccf30278848e354 631 sisu_0.40.1-1.dsc
+ 85d6478dd001f19f7e3d126a47d85aea 97880 sisu_0.40.1-1.diff.gz
+
+ * debian archive sources.list changed, started using reprepro to produce
+ apt archive, debian "upstream" /etc/apt/sources.list changes to:
+
+ deb http://www.jus.uio.no/sisu/archive unstable main non-free
+ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free
+
+ [archive string corrected]
+
+ [previous string (obsolete for future releases) was:
+ deb http://www.jus.uio.no/sisu/pkg_priv ./deb/
+ deb-src http://www.jus.uio.no/sisu/pkg_priv ./src/
+ ]
+
+%% sisu_0.40.0.orig.tar.gz (2006w20/7 | 2006-05-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.0.orig.tar.gz
+ cfaa83c0f7a55a143b50865d72338442 663916 sisu_0.40.0.orig.tar.gz
+ 5d0801b203e3d76f46b676676226d537 631 sisu_0.40.0-1.dsc
+ 68e6d68b871920b372a20ca8ba479b55 97850 sisu_0.40.0-1.diff.gz
+
+ * translate, an internal framework for the translation of related text used
+ first for the document manifest. (it is suggested that i look at gettext)
+ some initial translation by daniel (german), nicholas (french), agi
+ (spanish), enrico (italian), hanna (finnish)
+
+ * param, metaverse fix, 0.38 markup syntax to work with processing
+ instructions related to levels and their translation from :A,:B,:C,1,2,3 to
+ internal representation 1,2,3,4,5,6
+
+ * debian package sisu-examples removed, debian packaging policy requires
+ removal of un-modifiable documents from the main archive. accordingly the
+ books provided as markup samples have been moved from the main sisu package
+ to sisu-markup-samples (which should eventually make its way to the debian
+ non-free archive). Considerable changes in packaging required, and new
+ version number appropriate.
+
+ * [mention of use of reprepro in this release was premature, see sisu-0.40.1]
+
+%% sisu_0.39.3.orig.tar.gz (2006w19/7 | 2006-05-14) [Debian Release snapshot, uploaded by Wookey (at Debconf 6, in Queue new till replaced)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.3.orig.tar.gz
+ 6eadfbf37cbaf43fbae49dc2b71209d2 3406768 sisu_0.39.3.orig.tar.gz
+ cfca428562370b9b2672fc8f7f0b7840 647 sisu_0.39.3-1.dsc
+ 8338ef32ecb203bf0328f7f4eb71857a 95295 sisu_0.39.3-1.diff.gz
+
+ * metaverse fix, changed rules on auto-naming of html segments resulted in
+ the introduction of some undesirable artifacts, (actually a change in
+ sequence, some risk of need for further modification)
+
+%% sisu_0.39.2.orig.tar.gz (2006w19/5 | 2006-05-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.2.orig.tar.gz
+ e80aae7a5733dbbee6545cb7ff0f9633 3406402 sisu_0.39.2.orig.tar.gz
+ adde80ce35b3258feb199a65ccb5be88 647 sisu_0.39.2-1.dsc
+ f8ffdfb51016cae9f150e95b7d92f177 95226 sisu_0.39.2-1.diff.gz
+ 23a45dde920e1c0cab53231eb90865c0 647 sisu_0.39.2-2.dsc
+ 18f49697c0634fc87edccdfd6f4ba9ce 95835 sisu_0.39.2-2.diff.gz
+
+ * what to do when missing required: header title; heading top;
+ heading seg. carries risk, false positives not acceptable, testing
+ required, may need to scrap
+
+ * debian policy standards version 3.7.2
+ debian vim policy changes, rename sisu_vim vim_sisu
+ vim 7 in debian includes filetypes, syntax, and color, removed
+ vim-sisu includes ftplugin
+
+%% sisu_0.39.1.orig.tar.gz (2006w19/1 | 2006-05-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.1.orig.tar.gz
+ bb72b981ace449a4803aaad879398266 3405744 sisu_0.39.1.orig.tar.gz
+ acc111aae4ebf5485e3ae4740ebeab52 647 sisu_0.39.1-1.dsc
+ 9094b6e51890fbeb2789365add613143 95128 sisu_0.39.1-1.diff.gz
+
+ * digest/dcc (document content certificate), fix: image digests reinstated
+ [note: during some simplification of code, removed the need to flag images
+ as local or remote, some regexes did not take into account this change, one
+ in metaverse also addressed, (issue likely from 0.38.8 till this fix)]
+
+%% sisu_0.39.0.orig.tar.gz (2006w19/1 | 2006-05-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.0.orig.tar.gz
+ 3c043d2f1356527686a72cd82858d7be 3405229 sisu_0.39.0.orig.tar.gz
+ e1d17b525cf81dceefbb0c81d27aca76 647 sisu_0.39.0-1.dsc
+ 3657f7538d1cbd23c8b40d3e32862afd 95097 sisu_0.39.0-1.diff.gz
+
+ * metaverse, changes to auto-naming/numbering of headings, and segment names
+ [back to the more elegant auto-naming of segments solution, however, need
+ to determined to be reliable (naming used to be done in a similar way)
+ release passes initial checks though further testing is required; changes
+ involve reducing the use of extra characters where possible in the
+ auto-naming of html segments (the tilde and underscore were added to reduce
+ the chance of name collision, and have now been removed where possible),
+ additional checks that duplication does not occur have been added. This
+ does mean any existing indexes (sql or hyperestraier) will have to be
+ regenerated and url mappings/ links made within a sisu markup file to other
+ sisu output of html segments will need to be checked and updated. Long term
+ the currently implemented naming should provide a preferable solution
+ (primarily in its being easier on the eye.)
+
+ * odf, odd regex related bug related to matching of + sign in link text and
+ corresponding urls fix not particularly satisfactory
+
+ * debian policy standards-version back 3.7.0 ... (should be 3.7.2 but
+ lintian and linda not up to date this instant)
+
+%% sisu_0.38.10.orig.tar.gz (2006w18/5 | 2006-05-05) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.10.orig.tar.gz
+3bc28f808280673e2f8b86dfe071a53a 3402660 sisu_0.38.10.orig.tar.gz
+6c930e4ea4e3b41388bb61c9b6aad7ac 650 sisu_0.38.10-2.dsc
+43717b69a0bf29cbd810a0c36066fb2e 95761 sisu_0.38.10-2.diff.gz
+
+ * rebuilt using debian standards version 3.7.2
+ (previous build used 3.7.0)
+
+%% sisu_0.38.10.orig.tar.gz (2006w18/4 | 2006-05-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.10.orig.tar.gz
+3bc28f808280673e2f8b86dfe071a53a 3402660 sisu_0.38.10.orig.tar.gz
+26c4ae2cca2e1b22e826834fcd4c135b 650 sisu_0.38.10-1.dsc
+2e17298545f1afb64d6258fb7f732be8 94904 sisu_0.38.10-1.diff.gz
+
+ * minor fixes, need resulting from default removal of ._sst temporary files
+ (master documents:processed composite documents:temporary files)
+
+ process .ssm master file instead where possible, e.g. -R (and url info),
+ (implemented in hub)
+
+ _ flag provided as hack to have ._sst files kept at the end of a run, (as
+ an alternative to use of the -M (maintenance) flag (which changes screen
+ output))
+
+ * vim ftplugin, minor irritation with vim folds sorted
+
+%% sisu_0.38.9.orig.tar.gz (2006w18/3 | 2006-05-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.9.orig.tar.gz
+f513d112435ff923e5197a5f5875c58a 3402148 sisu_0.38.9.orig.tar.gz
+317ff04be060a534cc9ddaf356ebbe79 647 sisu_0.38.9-1.dsc
+1b389daf0e1f52c6c1cc88bb48aaba0c 94879 sisu_0.38.9-1.diff.gz
+
+ * sisupod/ sisu_doc, .ssm, renamed sisupod.tgz. Master document pod now
+ contains the composite elements of the master, .ssm and .ssi files rather
+ than the "composited document" ._sst, examine for example:
+ http://www.jus.uio.no/sisu/alices_adventures_in_wonderland_and_through_the_looking_glass.lewis_carroll/sisupod.tgz
+ [consider giving the option as this may not always be preferred, is
+ necessary to find master within pod, but otherwise seems a more elegant
+ solution]
+
+ * search, debian:sisu "recommends" added hyperestraier
+ [option in addition to sisu "atomic" search with postgresql and sqlite]
+
+ some help on setting hyperestraier up (in very basic way) for sisu
+ provided: sisu help hyperestraier
+
+ documentation for hyperestraier: http://hyperestraier.sourceforge.net/
+ file:///usr/share/doc/hyperestraier/index.html man estcmd
+
+ for help on sisu search generally follow suggestions in: sisu help search
+
+ * vim filetypes fix, the temporary ._sst rather than ._ssi
+
+ * temporary files ._sst are now removed after run, unless -M (maintenance)
+ flag is used
+
+ * rexml fix necessary
+
+ * help prompt fix
+
+ * fix, 0.38 markup interpretation, evident particularly in XML Dom variant
+ -X of a few documents, more strict regex
+
+ * removed reference to 0.38 markup as experimental in help and man page
+ (conversion script makes it easy to switch between markup versions)
+
+ * debian 'Standards' version changed to 3.7.0
+
+NOTE DISCARDED BUILD -{6d2149ba45d601347d9562edc2995fe7 3401901
+sisu_0.38.9.orig.tar.gz}- -{b96ce1d8b5801c1e2ffa12eddbb1850a 647
+sisu_0.38.9-1.dsc}- -{ee7182ffdca58bd94dec3d07d4ccb9f8 94874
+sisu_0.38.9-1.diff.gz}-
+
+%% sisu_0.38.8.orig.tar.gz (2006w17/6 | 2006-04-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.8.orig.tar.gz
+9c1df6c4524fa3a047ca566b779f6600 3398443 sisu_0.38.8.orig.tar.gz
+7514ebf71f95c0d3dd99d2355ad65fc0 647 sisu_0.38.8-1.dsc
+63ae62d331f23a5f79819656e345ef8f 94794 sisu_0.38.8-1.diff.gz
+
+ * images, in particular to do with remote sisu markup source
+ e.g. sisu -3
+ http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst
+ sisu -3
+ http://www.jus.uio.no/sisu/sphinx_or_robot.leena_krohn.1996/sphinx_or_robot.leena_krohn.1996.sst
+ should once again pull down and generate documents with images (consider
+ using url base plus directory, to make unique image directories for
+ external documents images)
+
+ * vim:sisu syntax, spell
+ [Re: use of Vim, have made the transition to Vim 7]
+
+ * (html_tune, some renaming which could cause breaks)
+
+%% sisu_0.38.7.orig.tar.gz (2006w17/4 | 2006-04-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.7.orig.tar.gz
+39bf0e31035f4a97259e2b077835b7bc 3397454 sisu_0.38.7.orig.tar.gz
+b37cba6a7ef7436dc9b4f95648d12a0d 647 sisu_0.38.7-1.dsc
+75aa4afefc0bf8867de5498c6b9642fe 94763 sisu_0.38.7-1.diff.gz
+
+ * sisu, code rearrangement, relatively minor, /usr/bin contains require only
+
+ * vim:sisu ftplugin, only activate :setlocal spell spelllang
+ if version >= 700
+
+ * html, link to concordance only if < build concordance word count limit
+
+ * (html, sub_toc fix for pg texts)
+
+%% sisu_0.38.6.orig.tar.gz (2006w17/2 | 2006-04-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.6.orig.tar.gz
+d01345fe0748ea24af2e206648be1df0 3397003 sisu_0.38.6.orig.tar.gz
+a3819708b447aa1391c923847bc5f868 647 sisu_0.38.6-1.dsc
+fa4f965f92835dccbdcadfbabc29528e 94717 sisu_0.38.6-1.diff.gz
+
+ * a glance forward at ruby 1.9, some early tests passed
+ [ruby 1.9.0 (2006-04-21)]
+
+ * vim:sisu
+ syntax: Spell on vim 7, not quite right colors: slate, vim colors, toned
+ down, endnotes (green changed to "darkkhaki")
+
+ * concordance, wordmaps renamed
+
+%% sisu_0.38.5.orig.tar.gz (2006w16/7 | 2006-04-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.5.orig.tar.gz
+b9eae129c6a86c89398a3af5170a22a8 3396296 sisu_0.38.5.orig.tar.gz
+8a559bc917ef9bb082c46949cc77ac53 647 sisu_0.38.5-1.dsc
+2f4ea49bd593d5557b9043b354335181 94686 sisu_0.38.5-1.diff.gz
+
+ * primarily a new debian build as lintian 1.23.17 "published"
+ yesterday, complains about existing builds
+
+ * vim ftplugin, folds, another minor modification
+ [without which would have been built as 0.38.4-2]
+
+%% sisu_0.38.4.orig.tar.gz (2006w16/5 | 2006-04-21) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.4.orig.tar.gz
+84d5e911d17aaf6a360972acd5bb3a3f 3395161 sisu_0.38.4.orig.tar.gz
+60aa30b124edcd87a622f2a895f3c1a5 647 sisu_0.38.4-1.dsc
+7aeae2641bf9b3968a08bb8fb9eeb8e2 94665 sisu_0.38.4-1.diff.gz
+
+ * param, fix, correction to a condition for setting markup type to 'rad'
+ (0.38)
+
+ * param introduced header @clatalogue: (documented in man)
+
+ * markup_convert and param, a refinement to matching :A type headings
+
+ * vim ftplugin, folds, minor modification
+
+%% sisu_0.38.3.orig.tar.gz (2006w16/4 | 2006-04-20) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.3.orig.tar.gz
+aacb2696144a0d91da658266bff34010 3394702 sisu_0.38.3.orig.tar.gz
+85ad80241d8be30c15af31979d4ed69e 647 sisu_0.38.3-1.dsc
+8e3044976461dce97d78601f0f073c0a 94622 sisu_0.38.3-1.diff.gz
+
+ * convert, refinement in 0.37 to 0.38 and back, required.
+
+ * sample documents, header 'markup' not very descriptive, 'level' preferred,
+ but not ideal either..., changed though accordingly
+
+%% sisu_0.38.2.orig.tar.gz (2006w16/3 | 2006-04-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.2.orig.tar.gz
+b7183828d8debf7dfeb671c44fcf984d 3394425 sisu_0.38.2.orig.tar.gz
+6e4c33da7880dede7de035f53003388e 647 sisu_0.38.2-1.dsc
+1df895d8457cf0e2a90c70536c65a5c9 94598 sisu_0.38.2-1.diff.gz
+
+ * --identify ; --convert ; --query ; minor adjustments
+
+%% sisu_0.38.1.orig.tar.gz (2006w16/1 | 2006-04-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.1.orig.tar.gz
+6d6a57fb0671c0740abdd75389c8255e 3393572 sisu_0.38.1.orig.tar.gz
+db731e962a0e6553602a978addc49933 647 sisu_0.38.1-1.dsc
+7601b42bb90e739bdac0c65e4a46d753 94579 sisu_0.38.1-1.diff.gz
+
+ * sisu --convert [filename/wildcard] converts between 0.38 and 0.37 markup
+ (which is substantially the same as 0.16 markup, only the file names
+ changed)
+
+ * sisu --identify [filename/wildcard] attempts to recognises the markup
+ version
+
+ * sisu --query [version number| or history] provides a bit of information
+ on changes to markup and file naming conventions used
+
+ * urls, minor fix,
+ (screen output of generated output omitted -H, (-h was ok))
+
+ * generated cgi search form needs a writable present directory,
+ warning of failure posted if it is not (consider placing result elsewhere)
+
+ * vim syntax minor touch
+
+%% sisu_0.38.0.orig.tar.gz (2006w15/7 | 2006-04-16)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.0.orig.tar.gz
+ed0af7fd0c4b05301642422bd95647cc 3388111 sisu_0.38.0.orig.tar.gz
+e8611c3610409c083c92d76da8c8ef6d 647 sisu_0.38.0-1.dsc
+5b9872b1b278bf8697d76350038bc47b 94504 sisu_0.38.0-1.diff.gz
+
+ Summary: there is some scope for breakage. preliminary tests passed new
+ markup introduced, as alternative, existing markup is not affected - new
+ document header markup, new document structure markup, experimental, [new
+ header for tagging categories or topics, stub]
+
+ a script modify.rb is provided for easy conversion between 0.37 standard
+ and 0.38 experimental markup
+
+ * alternative header notation, for consideration, an example
+ @title: is equivalent to 0~title
+
+ * sisu structure, experimental alternative notation,
+ A,B,C,1,2,3 mapping to 1,2,3,4,5,6 switched on on encountering level A~ or
+ if document header should contains @markup: rad
+ * SiSU has in effect two sets of levels to be considered
+ 1-3 headings/levels, pre-ordinary paragraphs /pre-substantive text, and 4-6
+ headings/levels, levels which are followed by ordinary text. This may be
+ conceptualised as levels A,B,C, 1,2,3, and using such letter number
+ notation, in effect: A must exist, optional B and C may follow in sequence
+ (not strict) 1 must exist, optional 2 and 3 may follow in sequence i.e.
+ there are two independent heading level sequences A,B,C and 1,2,3 or using
+ the standard notation 1,2,3 and 4,5,6 on the positive side:
+ * the A,B,C,1,2,3 alternative makes explicit an aspect of structuring
+ documents in SiSU that is not otherwise obvious to the newcomer (though
+ it appears more complicated, is more in your face and likely to be
+ understood fairly quickly)
+ * the substantive text follows levels 1,2,3 and it is 'nice' to do
+ most work in those levels a couple of issues to consider:
+ * 1,2,3 usually precede A,B,C (and do for generated output),
+ but in the form is better suited to this context, it takes some getting
+ used to though, and may be necessary to add a marker (an optional
+ exclamation mark (!) or colon (:) perhaps) to the A,B,C to indicate
+ that they are not subsidiary values, and are 'greater' than 1,2,3.
+ :A,:B,:C,1,2,3 colon selected as aesthetically more pleasing (to me)
+ (despite exclamation mark already being in use for bold lines/headings)
+ * there ends up being more in marking up to know, (which needs to be
+ balanced against any perceived convenience) unless ultimately only one
+ markup structure style is adopted
+ * ok within code may confuse a bit, as things simple are not always what
+ you would expect, present solution is to translate rad markup values to
+ standard ones, so A,B,C,1,2,3 and references to them become 1,2,3,4,5,6
+ (where you expect to find 1 you may find a 4)
+ * a note on implementation of 0.38 experimental (rad), within the program
+ structural markup is converted back to the the standard notation, i.e.
+ levels A,B,C,1,2,3 are re-mapped to 1,2,3,4,5,6 which is used for
+ processing
+
+ * param, header, 0~tag or to use newer notation @tag: introduced,
+ a stub for topic lists, categories, classification within documents.
+ Formal only in the sense that to make work you need to be aware of previous
+ categories, a degree of organisation is necessary. Raises technical
+ questions in relation to method and notation used for SiSU structuring.
+ Mapping may be fairly simple for an independent system, however, it is a
+ bit more complex to directly map to SiSU structure as SiSU has in effect
+ two sets of levels to be considered A technically simple but inconvenient
+ solution for making SiSU pages out of tags would be to have them between 4
+ and 6 levels deep, four levels is however from a practical tagging
+ perspective (a bit arbitrary and) an inconvenient minimum depth to require
+ it also also could be inconvenient for other technical purposes
+
+ * sysenv, utf-8 assumed if file encoding cannot be determined, 'fix' results
+ from an unexpected issue with the use of alternative document header markup
+ introduced in 0.38 (@title:) the program 'file' used to check document type
+ no longer parses the markup document and recognises it as utf-8 unless the
+ document starts with a sisu comment line %2
+
+ * an auto-converter, with canned conversion from 0.37/traditional to 0.38
+ (rad) markup and back from 0.38 (rad) to 0.37/traditional is tossed in to
+ sisu-examples (permissions at 644) sisu-examples/config/convert/modify.rb
+ once enabled (permissions and path set), usage: modify.rb --convert
+ [filename/wildcard] for further options and generally a better place to
+ begin: modify.rb --help this is a fairly generic simple tool that can be
+ used to store other canned conversions
+
+ * an auto-converter with canned conversion
+ from 0.37/traditional to 0.38 (rad) markup and back from 0.38 (rad) to
+ 0.37/traditional is tossed in to sisu-examples (permissions at 644)
+ sisu-examples/config/convert/modify.rb
+
+ * refactor, minor, moved some dublin core checking, affects
+ plaintext, html, xhtml, xml, odf ...
+
+ * db, create added as synonym for createall
+
+ * sqlite, common_db, create command makes directory for output if it
+ does not already exist
+
+ * header @structure: added as a synonym for @toc: it is used to build
+ the table of contents, but probably more usefully thought of and described
+ as the document structure header
+
+ * sisu help, some additions and a fix
+ sisu help env, 'issues' reporting when machine offline
+
+ * vim syntax highlighting file (sisu-0.38),
+ ftplugin more vimrc type defaults review, and colors minor
+
+0.37 introduces NEW FILE-NAME EXTENSIONS rename 's/\.s[123]$/\.sst/' *.s{1,2,3}
+rename 's/\.r[123]$/\.ssm/' *.r{1,2,3} rename 's/\.si$/\.ssi/' *.si
+
+%% sisu_0.37.12.orig.tar.gz (2006w14/7 | 2006-04-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.12.orig.tar.gz
+cf6d1cc419522f353e8b3e1f0c01afa6 3351564 sisu_0.37.12.orig.tar.gz
+31f19920cceee8a8212c12ba5eb62ffe 650 sisu_0.37.12-1.dsc
+73693cb634ddae10ebef21ddeffb0c26 93059 sisu_0.37.12-1.diff.gz
+
+ * vim syntax highlighting file, further testing
+
+%% sisu_0.37.11.orig.tar.gz (2006w14/7 | 2006-04-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.11.orig.tar.gz
+7004d8060065f8c4f6108a7d8ba3b825 3350939 sisu_0.37.11.orig.tar.gz
+e8ff904f31207140cbc35802c710b3ee 650 sisu_0.37.11-1.dsc
+73a9275c43abfbee672d15b60262eb1c 93046 sisu_0.37.11-1.diff.gz
+
+ * vim related files, cleaning
+ (filetype.vim, syntax/sisu.vim ftplugin/sisu.vim & colors/slate.vim)
+ syntax/sisu.vim minor refinements; colors/slate.vim has become a bit of a
+ christmas tree, pretty far from what it started out as, will probably tone
+ it down again, (it works only on dark backgrounds)
+
+ * help, 'environment' information, minor addition,
+ (and sysenv remote host rescue so works when machine is offline): 'sisu
+ help env'
+
+%% sisu_0.37.10.orig.tar.gz (2006w14/4 | 2006-04-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.10.orig.tar.gz
+416094f2d0e04e1a5c38df6a321712e3 3350639 sisu_0.37.10.orig.tar.gz
+d7f836eec596a99db9bcbd8a21ebb885 650 sisu_0.37.10-1.dsc
+a70a47001d321c3429eee72b0e0e7ea6 93016 sisu_0.37.10-1.diff.gz
+
+ * vim related files, cleaning
+ (filetype.vim, syntax/sisu.vim ftplugin/sisu.vim & colors/slate.vim)
+
+%% sisu_0.37.9.orig.tar.gz (2006w13/6 | 2006-04-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.9.orig.tar.gz
+4d546c58a828821baf2463a8fa75d3d9 3350076 sisu_0.37.9.orig.tar.gz
+886fd0492b54340111fead7edb20b250 649 sisu_0.37.9-1.dsc
+d080e93446a7304e6fa699ffaec8cd80 92985 sisu_0.37.9-1.diff.gz
+
+ * vim related files, cleaning
+ (filetype.vim, syntax/sisu.vim ftplugin/sisu.vim & colors/slate.vim)
+
+ * db common, fix for table representation
+
+%% sisu_0.37.8.orig.tar.gz (2006w12/6 | 2006-03-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.8.orig.tar.gz
+60a8f59bb38a43f6de2018a0ce150a60 3353064 sisu_0.37.8.orig.tar.gz
+4782c9516557f93bf8aedea985068e14 649 sisu_0.37.8-1.dsc
+b667a88206342970a051734073f7b791 92945 sisu_0.37.8-1.diff.gz
+
+ * screen text ansi color turned off by default, (color does not suit all
+ terms/consoles)
+ * to turn color on by default, edit sisurc.yaml in (found in ./_sisu
+ * ~/.sisu
+ or /etc/sisu) set flag: color: true
+ * to toggle screen color (on/off) use the -c flag
+
+ * processing path where markup directory is not writable [and no other
+ * default
+ has been set] is now /tmp/_sisu_processing/$USER (instead of
+ /tmp/_sisu_processing) [if document markup directory is writable, it
+ remains ./_sisu_processing, unless a different processing path is set in
+ active sisurc.yaml] e.g. of a non-writable document markup directory:
+ /usr/share/sisu-examples/sample/document_samples_sisu_markup
+
+ * processing path when /tmp/_sisu_processing/$USER is used, clean of content
+ after use (as is in public area on a multi-user system) unless maintenance
+ flag (-M) is used
+
+ * sisurc.yaml, removed processing directory entry, rely on sysenv default
+ (can still change default in sisurc.yaml)
+
+ * help, added a bit of 'environment' information, [expand further as needed]
+ sisu --help env
+
+%% sisu_0.37.7.orig.tar.gz (2006w12/4 | 2006-03-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.7.orig.tar.gz
+246a94c92f19e0640f6b5cf368ec6bd1 3351292 sisu_0.37.7.orig.tar.gz
+eefac162286ca49563b20692536a6092 649 sisu_0.37.7-1.dsc
+6794d8e1f5593fae1c920e301fd59fd7 92902 sisu_0.37.7-1.diff.gz
+
+ * common_db, fix affecting pgsql for endnotes in heading levels 1-3
+ [relational db catch-up with footnote fix in 0.36.24]
+
+%% sisu_0.37.6.orig.tar.gz (2006w12/4 | 2006-03-23) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.6.orig.tar.gz
+f0623474f1635d87f0d5674e0d3ae927 3351023 sisu_0.37.6.orig.tar.gz
+c546a82203c685fe59be60ab5492fa96 649 sisu_0.37.6-1.dsc
+699b594457459248a22e2ed97e56c4f5 92886 sisu_0.37.6-1.diff.gz
+
+ * sisu control, minor cleaning
+
+ * gedit/gobby syntax highlighting, very basic start, in:
+ sisu-examples/config/syntax_hi
+
+%% sisu_0.37.5.orig.tar.gz (2006w12/3 | 2006-03-22) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.5.orig.tar.gz
+9a03bbcea82c1625bad4a92d6498e408 3351422 sisu_0.37.5.orig.tar.gz
+46dca71f33c206dbff9b798f75733484 649 sisu_0.37.5-1.dsc
+d3c5ed96ca85254870e2500d2e3957a2 92863 sisu_0.37.5-1.diff.gz
+
+ * metaverse, digest: sha256 offered as alternative to md5
+ (configure in sisurc.yaml, md5 should be sufficient for most purposes and
+ remains default)
+
+ * metaverse, auto bold markup fix
+
+ * some code shuffling and method and variable renaming
+ (including in sisu control file)
+
+ * wmap, sorting of matches (object citation numbers)
+
+ * wmap, words capitalised unless several letters uppercase or is a phrase
+ (rather than a single word)
+
+ * wmap, names/id associated to phrases, space replaced with underscore
+
+ * html, heading tag names #h dropped if heading starts with alphabet so e.g.:
+ #h1.2 but #linux [consider #h_linux]
+
+%% sisu_0.37.4.orig.tar.gz (2006w10/4 | 2006-03-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.4.orig.tar.gz
+22970c76bd545a4852076b958f288d0b 3350498 sisu_0.37.4.orig.tar.gz
+4add721933eaf0b4418e28b61937c837 647 sisu_0.37.4-1.dsc
+cd31e7f43b70bc8bbff7a53f8b96a540 92832 sisu_0.37.4-1.diff.gz
+
+ * w3c compliance in html for: default homepage, document manifest, and
+ wordmap, (and check that renders properly in lynx, elinks, links2, w3m,
+ dillo as well as the rest)
+
+%% sisu_0.37.3.orig.tar.gz (2006w10/4 | 2006-03-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.3.orig.tar.gz
+a2f28400c4e741991cbca6c1239003a1 3350055 sisu_0.37.3.orig.tar.gz
+cce7e960ead1ff0fdc2fb4903cdefcd7 647 sisu_0.37.3-1.dsc
+acbada001ba115b5ac1c2f476a5b6d97 92809 sisu_0.37.3-1.diff.gz
+
+ * default home page, make sure that html is w3c compliant, (and renders in
+ lynx, elinks, links2, w3m, dillo as well as the rest)
+
+ * editors (other than vim already done) filetypes match new filenames
+
+%% sisu_0.37.2.orig.tar.gz (2006w10/2 | 2006-03-07) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.2.orig.tar.gz
+422703f270dd8a0df5ea6de38097708b 3356778 sisu_0.37.2.orig.tar.gz
+3669c92aa335a335f0e51a4566747862 647 sisu_0.37.2-1.dsc
+db86dcd03b1ca8c3b730331ba1df62b8 92772 sisu_0.37.2-1.diff.gz
+
+ * filename extensions, reduce in number and rename processed
+ secondary/temporary files to make matching of editable files trivial *.ss?
+ (editable files .sst .ssm .ssi matched with *.ss? or more precisely
+ *.ss[tmi])
+
+ * .sst (sisu structured text). .ssf removed, reason this is processed as
+ being the same file as .sst and increases the possibility of confusion for
+ the user. .ssm (sisu structured master) .ssc removed for same reason as
+ removal of .ssf described above. .ssm files may include .sst and/or .ssi
+ files within them.
+
+ * filename extensions, processed secondary/temporary files
+ ._sst was .sss and previously .t (substantive content of composite/master
+ file) .-sst was .ssu and previously .u (sisu markup .sst downloaded as
+ url for processing) reason for choice, identifies as .sst files and are
+ processed as such, while easily ignored/excluded on the command line for
+ editing and processing. These can be ignored by the user, but should be
+ processable by sisu as .sst files.
+
+ * .ssd (sisu structured document) is retained, for use in sisudoc,
+ or sisupod, where a zipped file with image and other content necessary to
+ reproduce the original is made.
+
+ * .ssi (sisu structured insert/information) unprocessed, sisu markup text,
+ for use in master documents, is likewise unchanged
+
+ * filetypes.vim made to match (filename extensions)
+
+%% sisu_0.37.1.orig.tar.gz (2006w10/1 | 2006-03-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.1.orig.tar.gz
+50064bf4ca448ca512f0867342bda977 3355756 sisu_0.37.1.orig.tar.gz
+47cf73b44e96185a59eaf963ae832cf2 647 sisu_0.37.1-1.dsc
+89a542fc1f5eb054ad6f701e368d2829 92500 sisu_0.37.1-1.diff.gz
+
+ * cgi search forms in sisu-examples, updated to match filename extensions
+ [and to match 'sisu-F webrick' equivalent]
+
+%% sisu_0.37.0.orig.tar.gz (2006w09/7 | 2006-03-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.0.orig.tar.gz
+24760db51b627f553d57e6b8126a37b5 3355565 sisu_0.37.0.orig.tar.gz
+4cfb6fac0ac6179f1140389c38ef943b 647 sisu_0.37.0-1.dsc
+8ca3ac75f71e776aeffa9727adb6e185 92371 sisu_0.37.0-1.diff.gz
+
+ WARNING: FILE RENAMING NECESSARY as file name extensions have been changed,
+ (there is scope for program breakage as a result, though preliminary tests
+ have been passed).
+
+ Also note that, SiSU markup syntax is unchanged. Repeat: there is NO CHANGE
+ to SiSU markup syntax. Renaming of file-extensions should be all that is
+ necessary for things to work as before.
+
+ File extension name changes, note this does not affect SiSU markup in any
+ way... but the .s1 .s2 .s3 and like types are discontinued, files should be
+ renamed as explained below
+
+ NEW FILE EXTENSIONS the obvious sd and sdf appear to be taken, and there is
+ some use of .st and .sm extensions, so will use .ss extensions, which from an
+ examination of vim filetype.vim and mime.types appear to be available.
+
+ * sst (.ssf) ('sisu structured text')
+ .sst == .s3 (also .s1 and .s2) .ssf == .s3 (also .s1 and .s2)
+
+ rename 's/\.s[123]$/\.sst/' *.s{1,2,3}
+
+ * ssm & ssc
+ ('sisu structured master' and 'sisu structured composite') .ssm == .r3
+ (also .r1 and .r2) .ssc == .r3 (also .r1 and .r2) [r was for require]
+
+ rename 's/\.r[123]$/\.ssc/' *.r{1,2,3}
+
+ suggested convention: use ssm where the master contains only requests for
+ parts; use ssc where the composite document contains its own text but
+ requests inserts. they are in fact (technically) interchangeable, not
+ being recognised as distinct by sisu.
+
+ * ssi
+ ('sisu structured insert/information') (this is an unprocessed recognised
+ as being in sisu markup but only used as part of a composite document .ssm
+ or .ssc)
+
+ ssi == si
+
+ rename 's/\.si$/\.ssi/' *.si
+
+ * ssd
+ ('sisu structured document') [filename].ssd should be mapped to sisudoc.tgz
+
+ THE FOLLOWING OCCUR IN PROCESSING they should be taken care of automatically
+ on use of sisu
+
+ * sss
+ secondary file .sss == .t3 [t was for tmp]
+
+ * ssu
+ downloaded url .ssu == .u3 [u was for url]
+
+ * sst_meta
+ human readable processing file (metaverse)
+
+ .sst_meta == .s3.meta
+
+ * sst_meta.rbm
+ ruby marshal processing file (metaverse)
+
+ .sst_meta.rbm == .marshalMeta
+
+ OTHER CHANGES
+
+ * sample markup documents file type extensions changed to .sst from
+ .s3
+
+ * sisu, provide warning and advice on renaming when requests are made to
+ * process files with old filename extensions.
+
+ * xml(s) and xhtml, escape greater than and less than in "code" mode.
+
+ * cgi search form, postgresql, fix - create canned url etc., in line with
+ * what sqlite form does
+
+%% sisu_0.36.25.orig.tar.gz (2006w09/7 | 2006-03-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.25.orig.tar.gz
+c614a0f838c46065853ce8a70660df55 3355275 sisu_0.36.25.orig.tar.gz
+14bb8779affa6b1fe88bcdfeb81d2c35 650 sisu_0.36.25-1.dsc
+3091300f2045e946aff51a04beec9b77 91154 sisu_0.36.25-1.diff.gz
+
+ [A Fix is Necessary will revisit]
+
+ * metaverse, don't number headings that are numbered (or rather, start with
+ numbers), [may need an escape]
+
+ * manifest, don't assume a document will contain header (related/recommended)
+ links
+
+ * vim syntax highlighting, sisu.vim, added check that url not preceded or
+ followed by > or < without an intervening space (or <br> which is a bit
+ redundant but a fairly common error that is highlighted as such in full),
+ needed for auto-markup match
+
+%% sisu_0.36.24.orig.tar.gz (2006w09/2 | 2006-02-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.24.orig.tar.gz
+f2a727ef111585efbb84fad7d131fdb0 3354247 sisu_0.36.24.orig.tar.gz
+109b804513271cc4b0da43d27dcef8ef 650 sisu_0.36.24-1.dsc
+95838c0b653fc987b69d76c4713015cc 91128 sisu_0.36.24-1.diff.gz
+
+ * html, segmented, footnote in heading levels 1, 2, or 3, (deposit in first
+ segment 4 that follows), and clean heading of the footnote reference marker
+ after the segment in which footnote (for the heading) occurs
+
+ * html, multilingual documents, ensure html filetype suffix is used in html
+ i.e. use html file suffixes within html, even when -H (rather than -h) is
+ selected
+ [decision to hardcode protection is a bit arbitrary, suffixes required here
+ by existing server configuration. Consequences of overlooking this
+ requirement are a bit latent and fairly dire..., add configuration file
+ escape of protection]
+
+%% sisu_0.36.23.orig.tar.gz (2006w09/1 | 2006-02-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.23.orig.tar.gz
+ c0677a4ae79820261fa28dd9e21c01ee 3354053 sisu_0.36.23.orig.tar.gz
+ 65ff2fede20f8aeb10a9f6cd55089e21 650 sisu_0.36.23-1.dsc
+ 51233be83917282cc1d13647902bd0f6 90413 sisu_0.36.23-1.diff.gz
+
+ * odf, use of brackets (also square) within linked text (and linked images
+ with text), fix
+ { text to link (use of brackets odf issue fix) }http://url
+
+ * odf, issue with ? in url in linked text and images, fix
+
+ * odf, single step indent with bullet, fix
+
+ * html, rights passed through special character filter...
+ [do for other "fields"]
+
+ * metaverse, a couple more characters sanitised
+ “” converted to "
+ — converted to -
+ 'irregular' whitespace converted to space
+
+ * html, segmented, footnotes in subheadings (levels 5 & 6) a clumsy fix
+ revisit and address upstream, [also notes name tag remains unclosed]
+
+ * regex, set for utf-8, [you may wish to reconsider fixed default]
+
+ * [sisu-examples, free_culture, minor adjustments to text]
+
+%% sisu_0.36.22.orig.tar.gz (2006w08/4 | 2006-02-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.22.orig.tar.gz
+ 78d8d224b4db8985072b1806617b5ff0 3352595 sisu_0.36.22.orig.tar.gz
+ 6b8caa7cbf4893111deb30ccd05fc680 650 sisu_0.36.22-1.dsc
+ b54396f9443c7f77a9c4ef695128a0bc 90388 sisu_0.36.22-1.diff.gz
+
+ * odf, footnote fix for url matches
+
+%% sisu_0.36.21.orig.tar.gz (2006w08/3 | 2006-02-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.21.orig.tar.gz
+ a8e7a6adf347c9b20965b3d19ad872a7 3352881 sisu_0.36.21.orig.tar.gz
+ b0ff57766149bf1dd63c002d4cba3a84 650 sisu_0.36.21-1.dsc
+ 089441cf1a4f72e63772f037036a18be 90358 sisu_0.36.21-1.diff.gz
+
+ * metaverse, further fix to catch exception for auto-heading/title numbering,
+ change of 0.36.19 (non-substantive/editorial hedings)
+
+ * html cosmetic, lower navigation band in scroll (doc.html), fix
+
+%% sisu_0.36.20.orig.tar.gz (2006w08/3 | 2006-02-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.20.orig.tar.gz
+ 60c3775c4f553906118f01f5976c2d70 3352515 sisu_0.36.20.orig.tar.gz
+ 264cb03dbd7a789568f70d94d117e56f 650 sisu_0.36.20-1.dsc
+ e4d05f5a543f53bfe4acac5fb7ea3b66 90313 sisu_0.36.20-1.diff.gz
+
+ * metaverse, fix required, issue introduced by 0.36.19, affected pdf
+
+%% sisu_0.36.19.orig.tar.gz (2006w08/3 | 2006-02-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.19.orig.tar.gz
+ 3ff5116481aeb77583c4144a76f41589 3351726 sisu_0.36.19.orig.tar.gz
+ a096c23f194e748505432b4ea0ae2a2b 650 sisu_0.36.19-1.dsc
+ b6cedff150ad4a65aa85ad9e507a293b 90281 sisu_0.36.19-1.diff.gz
+
+ * metaverse, document auto-heading/title numbering, rule change
+
+ * odf anchor of heading matches to start of line, fix
+
+ * odf hyperlinked text match, escape brackets within linked text, fix
+
+%% sisu_0.36.18.orig.tar.gz (2006w08/1 | 2006-02-20) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.18.orig.tar.gz
+ 5d1e674fc8d61c703b8479c230abbe21 3351642 sisu_0.36.18.orig.tar.gz
+ 4186636de25bb42888c519cd62891101 650 sisu_0.36.18-1.dsc
+ 6f61755dc6baeb6b09aac52bba504616 90236 sisu_0.36.18-1.diff.gz
+
+ * cgi sample form, sql search improved
+ [development iterations necessary]
+
+%% sisu_0.36.17.orig.tar.gz (2006w07/7 | 2006-02-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.17.orig.tar.gz
+ 3715d971d556c5eb4de10ccb8cae4857 3352507 sisu_0.36.17.orig.tar.gz
+ 2667514040bbdb928c130b2e565aea18 650 sisu_0.36.17-1.dsc
+ f393dd1f8ba8b344aba976af2c92771e 90212 sisu_0.36.17-1.diff.gz
+
+ * cgi sample forms (sqlite), match highlighting made case insensitive
+ character 'i' added to two files in two places
+
+%% sisu_0.36.16.orig.tar.gz (2006w07/7 | 2006-02-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.16.orig.tar.gz
+ 1d4ab63bb65308f27fc057e2c4f045de 3352304 sisu_0.36.16.orig.tar.gz
+ 2215b97903545574fe57c8b413ac5ba1 650 sisu_0.36.16-1.dsc
+ 5100b3d4bfb0eabf11cc3614e389005a 90196 sisu_0.36.16-1.diff.gz
+
+ * cgi form (generator),
+ canned url populates search field
+ more cosmetic rearrangement of code, e.g. cgi_common_sql introduced
+ for common code (in pgsql & sqlite forms)
+
+ * manual cgi samples renamed and updated
+ sisu-examples/sample/cgi-bin/sisu_search_pgsql.cgi
+ sisu-examples/sample/cgi-bin/sisu_search_sqlite.cgi
+
+%% sisu_0.36.15.orig.tar.gz (2006w07/6 | 2006-02-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.15.orig.tar.gz
+ 7daadfb8ea39c30c0bc2317e24a3ce17 3358917 sisu_0.36.15.orig.tar.gz
+ 13501be6212b0fd7067f4fccd575d22e 650 sisu_0.36.15-1.dsc
+ 12d5fcca3dfedf94d0f3360b06b78ffb 90169 sisu_0.36.15-1.diff.gz
+
+ * cgi form (generator), some cosmetic rearrangement of code,
+ order by output esp. for sqlite,
+ image paths rearranged
+
+%% sisu_0.36.14.orig.tar.gz (2006w07/6 | 2006-02-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.14.orig.tar.gz
+ bb206e160026ee8a0804a86191d088fc 3355327 sisu_0.36.14.orig.tar.gz
+ c3c8df68d3c9dea339fd18afce83f258 650 sisu_0.36.14-1.dsc
+ dcbdde8b5401d7aa2ea08cf30d2a4202 90155 sisu_0.36.14-1.diff.gz
+
+ * cgi form (generator) for pgsql and sqlite split up
+
+ * cgi form (generator) match highlighting added
+ [sample search form remains very basic]
+
+ * images, minor change to sisu.png and
+ inclusion of fsf/gnu levitating gnu
+
+ * metaverse, sanitize ’ character
+
+%% sisu_0.36.13.orig.tar.gz (2006w06/7 | 2006-02-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.13.orig.tar.gz
+ 7a4aa2e929e19df900f18b96ae1d5de6 3286170 sisu_0.36.13.orig.tar.gz
+ 92cde921735e33b3a781c2632470b721 650 sisu_0.36.13-1.dsc
+ 7a4aa2e929e19df900f18b96ae1d5de6 3286170 sisu_0.36.13-1.diff.gz
+
+ * bold line shortcut tag, !_ where no bold list, a fix
+
+ * minor, cosmetic code changes of tests with equivalents (type .nil? and
+ .empty?) [done a bit quickly though]
+
+ * minor, one spelling correction in free_as_in_freedom
+
+%% sisu_0.36.12.orig.tar.gz (2006w06/4 | 2006-02-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.12.orig.tar.gz
+ 0e5ca6878d119dafc6652b4f3dd0fb24 3285735 sisu_0.36.12.orig.tar.gz
+ 01ecb4df7879f576e284339abc6b49e2 650 sisu_0.36.12-1.dsc
+ 8fe27729103af5a5cbddc26a89d7522e 90101 sisu_0.36.12-1.diff.gz
+
+ * metaverse_syntax, fix required for alternative markup endnotes
+
+ * cgi (frontend for pgsql), url link fix (.html suffix) for webrick server
+
+ * digests/dcc, added info, minor
+
+%% sisu_0.36.11.orig.tar.gz (2006w06/4 | 2006-02-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.11.orig.tar.gz
+ 31749714603f3730a5589eb736e26cab 3284870 sisu_0.36.11.orig.tar.gz
+ 49a9807d5b7cf436a303de1c8f7100d1 650 sisu_0.36.11-1.dsc
+ 79301acf6b43364639f34e2baa5697c3 90088 sisu_0.36.11-1.diff.gz
+
+ * digest/dcc, further tuning of output presentation (digest.txt)
+
+%% sisu_0.36.10.orig.tar.gz (2006w06/3 | 2006-02-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.10.orig.tar.gz
+ 672259d2176c1fa5bba0414493d74970 3284698 sisu_0.36.10.orig.tar.gz
+ da64e5f067408b6db1ffac97649e246b 650 sisu_0.36.10-1.dsc
+ 25000b7faf86e44ccdb65b9c9bc0a42d 90073 sisu_0.36.10-1.diff.gz
+
+ * digest/dcc, (document content certificate), a bit more information
+ provided, in output and on man pages, e.g. see
+ http://www.jus.uio.no/sisu/sisu_changelog/digest.txt
+ or
+ http://www.jus.uio.no/sisu/SiSU/digest.txt
+ etc.
+
+ * sisu man page, minor fixes and minor embellishments
+
+ * home page, in default and skins, minor change
+
+%% sisu_0.36.9.orig.tar.gz (2006w06/2 | 2006-02-07) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.9.orig.tar.gz
+ e76442aac4a8cdd7492ad167dca41925 3282776 sisu_0.36.9.orig.tar.gz
+ eedec4d07f05ea60143d87fe0b7a4d98 647 sisu_0.36.9-1.dsc
+ 565b0a6b88f2eda2dcd22284e5d6ff72 90040 sisu_0.36.9-1.diff.gz
+
+ * fix of filelists where param is not parsed, relevant to rsync, scp and zap
+ [problem introduced by changes made for multilingual documents which
+ assumed that param is always parsed]
+ [solution not elegant, but likely to remain a while]
+
+%% sisu_0.36.8.orig.tar.gz (2006w06/1 | 2006-02-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.8.orig.tar.gz
+ 9ed1bf836f160a2bc1b731f28603b546 3281967 sisu_0.36.8.orig.tar.gz
+ 6284e201cc9cf8c0eccf7e25ac7d3868 647 sisu_0.36.8-1.dsc
+ bc6c9675bfc3e14ef1a44b0b93d9cf6f 90003 sisu_0.36.8-1.diff.gz
+
+ * plaintext dos/Unix, check that all dos linefeeds are in place
+
+ * help (man pages, html, program), minor adjustments, and sync html
+ with man pages
+
+ * remote (rsync,scp) building of filelist for placement of output
+ improved, relevant for multilingual documents
+ [could be improved further especially for scp, where there is no
+ language code all documents are copied, which results in
+ duplication]
+
+%% sisu_0.36.7.orig.tar.gz (2006w05/7 | 2006-02-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.7.orig.tar.gz
+ b803f347a64d0419965e194f380988fe 3281398 sisu_0.36.7.orig.tar.gz
+ d07542cb5d8789af37a89db8b5ef2753 647 sisu_0.36.7-1.dsc
+ 9cda1006001769a03a22245499ebc321 89967 sisu_0.36.7-1.diff.gz
+
+ * metaverse, linefeed conversion, convert msdos line feeds \r\n to unix \n
+ for processing
+
+ * sisu(1) man page, note added on how to produce dos plaintext output file
+ (instead of linux/unix)
+
+ * plaintext, default shortcut flags changed to produce dos ascii files,
+ reason, Unix/Linux seldom has a problem dealing other ascii filetypes, MS
+ based programs are more likely to stumble, also if manifest built
+ concurrently with plaintext will use plaintext command flag to give
+ information on output type - whether Unix or dos etc. [could add a file
+ check of type where manifest is built separately, not really necessary]
+
+ * skins, minor edits, path to css corrected
+
+%% sisu_0.36.6.orig.tar.gz (2006w05/6 | 2006-02-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.6.orig.tar.gz
+ 490413665dc030ac80eafde61d816aa0 3280852 sisu_0.36.6.orig.tar.gz
+ 5823740759b6c1cd7af9f0427f5e5446 647 sisu_0.36.6-1.dsc
+ fcc375a5464c65be9a665d600b7b775a 89943 sisu_0.36.6-1.diff.gz
+
+ * html (some w3c compliance steps) [2006-01-15]:
+ * object "id" number names changed, preceded by letter o
+ * use of name tag to give objects numbers (instead of id for numeric value)
+ * footnote links changed (use of underscore (instead of tilde not permitted))
+ * image tags "closed"
+ * skin adjustment
+ * finally reinstate w3c transitional xhtml header
+
+ * html tables, changed organisation of code [2006-01-16]
+
+ * odf tables [2006-01-17]
+ [display only without tables headings]
+
+ * odf pagebreaks [2006-01-17]
+
+ * odf bullets [2006-01-17]
+
+ * odf multiple images in object [2006-01-18]
+ image handling, fix [2006-01-22]
+ image captions [2006-01-22]
+ placement within text "as char" [2006-01-23]
+
+ * overview.txt updated with things done
+
+ * url screen display, fix to urls in batch processing [2006-01-17]
+ [overlooked because of personal practice of using rant/make to run all
+ requested processes on each markup file in a batch process]
+
+ * sisu headers, document recommended links, 12 link limit removed [2006-01-20]
+
+ * tables, introduced an alternative visual representation [2006-01-20]
+
+ * odf tables, max number of columns increased to 14 from 8 [2006-01-22]
+ (12 may be useful for months plus at least one to describe content)
+
+ * sisu_test.s3 document added to serve as quick test of markup forms and a
+ rough guide however it does not at all serve as an example of a typical
+ document [2006-01-21]
+
+ * html anchor heading matches to start of line, [watch] [2006-01-22]
+
+ * odf text links [2006-01-22]
+
+ * odf bullets, as image, currently using "red pill" [2006-01-23]
+
+ * texpdf special character vertical bar / pipe, fix [2006-01-23]
+
+ * digests, document content certification, work on multiple images [2006-01-26]
+
+ * digests, document content certification, (digest info) digest for
+ document skin digest, and repeat of document digest [2006-01-27]
+
+ * sql (pgsql, sqlite), special character escape, changes [2006-01-28]
+
+ * docbook experimental introduced, another form of xml (may need to rename,
+ so far represents a quick first pass at docbook, and does not qualify as
+ docbook: docbook is released under a liberal license permitting all manner
+ of modifications, but if modified may not be called docbook) is as noted
+ experimental and undocumented, (and may as easily be quietly removed, or
+ renamed as improved upon) [2006-01-31] [will need to study a number of things
+ including embedding document parts (within parts)..., may take opportunity
+ to introduce some substantive tags to sisu that are docbook compatible]
+
+%% sisu_0.36.5.orig.tar.gz (2006w01/5 | 2006-01-06) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.5.orig.tar.gz
+ e774624280d20e8e7153a5eaf6cfeadd 3271834 sisu_0.36.5.orig.tar.gz
+ 3dc07a05827739b13aebcdb07c777aed 647 sisu_0.36.5-1.dsc
+ 1b15ff3121d71868fcc64a912dd7d5c4 89869 sisu_0.36.5-1.diff.gz
+
+ * sisu man page minor edit
+
+ * copyright file contains information on setup.rb included with tarball
+ and on Rant used to generate install,
+ both under Gnu Lesser Public License
+
+ * Debian build changed, fewer packages, hope to unify the SiSU development
+ and SiSU Debian upload builds
+
+%% sisu_0.36.4.orig.tar.gz (2006w00/7 | 2006-01-01) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.4.orig.tar.gz
+ 4fb9343d78745fe582c1d91c5874d8cf 3270301 sisu_0.36.4.orig.tar.gz
+ d89b702d13d00b1bb34f6aca2a03b77a 691 sisu_0.36.4-1.dsc
+ c0889387ad3fe063c38d04a7cdcd0695 89581 sisu_0.36.4-1.diff.gz
+
+ * plaintext, multi-language document url adjustments
+
+ * termsheet, output path and urls
+
+ * [some multi-language document markup samples added to debian build in
+ sisu-examples]
+
+%% sisu_0.36.3.orig.tar.gz (2005w52/6 | 2005-12-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.3.orig.tar.gz
+ b2ab154a1f2656edd9032500e757c03e 3261612 sisu_0.36.3.orig.tar.gz
+ 964e4279748cf63526b8963f162f1eaf 691 sisu_0.36.3-1.dsc
+ ad3b135cb8dd825e56769b0f583b5542 13969 sisu_0.36.3-1.diff.gz
+
+ * adjustments made for consequences of possibility of multi-language documents in sysenv, wmap, sql (psql/sqlite), remote put
+
+ * sql prefix column changed to TEXT (from VARCHAR)
+
+ * sysenv, change to the initialization of constants [revisit]
+
+%% sisu_0.36.2.orig.tar.gz (2005w52/5 | 2005-12-30)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.2.orig.tar.gz
+ 990dd7e60ecfee3b9dce863a0a28cc4e 3261132 sisu_0.36.2.orig.tar.gz
+ e2a3e592727eb67eacdc863a817df482 691 sisu_0.36.2-1.dsc
+ d8e12848dc94f0c0da1a2afa23312e53 13913 sisu_0.36.2-1.diff.gz
+
+ * sql (pgsql/sqlite), (a fix:) "manifest" column replaces "summary" column
+
+ * html_format_table.rb removed, last dependency removed, rely on css
+
+ * wmap use main css, and own styles
+
+%% sisu_0.36.1.orig.tar.gz (2005w52/4 | 2005-12-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.1.orig.tar.gz
+ 099b3c9735e664d164a42835e157055b 3262472 sisu_0.36.1.orig.tar.gz
+ 646d6b052d0de625badd2ae22551808b 691 sisu_0.36.1-1.dsc
+ 31fc43e92b23ceb2834c8b2fdc4caaf5 13896 sisu_0.36.1-1.diff.gz
+
+ * html batch processing fix, placement of files:
+ index.html, toc.html and doc.html
+
+%% sisu_0.36.0.orig.tar.gz (2005w52/4 | 2005-12-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.0.orig.tar.gz
+ 9f81885774e9bccf267ba1bde2d9894b 3261722 sisu_0.36.0.orig.tar.gz
+ f380ff4f31e1e92c796017bf2636f037 691 sisu_0.36.0-1.dsc
+ 44f61789decda5816cf4b106fade30b2 13864 sisu_0.36.0-1.diff.gz
+
+ * html -h -H behaviour switch, -h now produces urls with suffixes (hardlinks,
+ including .html .pdf etc.) (this being the default that just works,
+ including for reading output in a browser directly off a file-system), -H
+ omits them and requires an appropriately configured web server.
+ [change in behaviour is the reason for this version number bump]
+
+ * multilingual/(multiple language) document filenaming convention and
+ associated behaviour, made default, unless turned off in configuration file
+ default:
+ multilingual: false
+
+ * multilingual/(multiple language) document output filenaming convention set
+ at 1 in following example list:
+ (1) outputdir/es.[file].html
+ (2) outputdir/[file].es.html
+ (3) outputdir/[file].html.es (which Apache for example can be
+ the first option is convenient in that it organises versions of document by
+ language in the output directory, (i tend to use 2 though)
+
+ default:
+ language_file: 2
+
+ (the default in the absence of a setting is 1 es.index.html, rather than 2
+ index.es.html)
+
+ [contains a batch processing bug affecting some html output, fix in 0.36.1]
+
+%% sisu_0.35.0.orig.tar.gz (2005w52/3 | 2005-12-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.35.0.orig.tar.gz
+ f86673b0bf576a82aa73c80540a2303f 3260953 sisu_0.35.0.orig.tar.gz
+ 4db5b9c912b117286460a85b59fd8d8a 691 sisu_0.35.0-1.dsc
+ 362829f8d71ee03eaf47aa1f8b8f3856 13828 sisu_0.35.0-1.diff.gz
+
+ * sisupod, sisu multi-language document pod, in place
+ if config file permits, will search for multiple versions of the same
+ document in different languages, by file naming convention, and all these
+ will be placed into the same sisudoc source file, the intention will be
+ to separate the sisudoc file format for single documents and sisupod for
+ multi-lingual versions of the same.
+ (changes to sysenv and sisudoc for this purpose)
+
+ * multi-lingual versions of document naming and output conventions
+ conceptually sorted,
+ e.g. assuming config file set as appropriate
+ language version name takes the form:
+ filename~es.s3
+ output alternatives become, (depending on config file setting)
+ (1) filename/es.index.html
+ (2) filename/index.es.html
+ (3) filename/index.html.es (which Apache for example can be
+ configured to use for automatically serving the users preference)
+ it is now just to stepwise implement the rules for output...
+ some detail remains as what to do with the default language, will this
+ feature be strict so that too will have the language version code included,
+ or, is it more convenient to drop it in that instance
+
+ default:
+ language_file: 2
+ # multilingual: true
+
+ * param, config filename placement information gathering rules for
+ multi-document version output are in place, done with flexibility in mind,
+ language insertions may be made at any of three points in filename
+
+ * sub-numbering system, default behaviour change/correction, reset when any
+ major number changes [consider offering the alternative of running
+ sub-numbers, below 4~, would be set in header]
+
+ * urls (-u, -U, -v), match new multilingual file naming convention
+
+ * manifest, show multilingual version manifests, if available
+
+ [contains a batch processing bug affecting some html output, fix in 0.36.1]
+
+%% sisu_0.34.2.orig.tar.gz (2005w51/1 | 2005-12-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.34.2.orig.tar.gz
+ db01ece3bc2314c57f0aa88d6ebd2974 3254394 sisu_0.34.2.orig.tar.gz
+ 197f762e774ddb42bc35c922386d3133 691 sisu_0.34.2-1.dsc
+ 2520379d811471ff5a3ca7fab6c4c646 13798 sisu_0.34.2-1.diff.gz
+
+ * default css, fix to image links (paths),
+ necessitated by changes to directory structure
+
+ * digests, include in header url for set sisu_manifest, and time and version
+ information at the top of the document
+
+%% sisu_0.34.1.orig.tar.gz (2005w50/7 | 2005-12-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.34.1.orig.tar.gz
+ d42234876268924db8dddd33faecd3b0 3254032 sisu_0.34.1.orig.tar.gz
+ ba33053014594db6cc36489ccf49b5c1 691 sisu_0.34.1-1.dsc
+ 0d7297accec601ff4e9f93a4746f3cd5 13756 sisu_0.34.1-1.diff.gz
+
+ * html and wmap output manifest cosmetic link change and a link fix in html
+
+ * manifest, md5 if markup source is shared, show if -v
+
+%% sisu_0.34.0.orig.tar.gz (2005w50/6 | 2005-12-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.34.0.orig.tar.gz
+ b46664690687cec318848df0f2d663f7 3253826 sisu_0.34.0.orig.tar.gz
+ 2c5cdede22b60b4f71294ca1a2a1e804 691 sisu_0.34.0-1.dsc
+ 1c636c138c29931d6216349f0655a709 13695 sisu_0.34.0-1.diff.gz
+
+ * directory structure changes
+ [reason for version number jump]
+ * all sisu output server configuration
+ goes into subdirectories named _sisu,
+ one within the main server directory
+ and another within each document directory created
+ _sisu/image
+ _sisu/css
+ _sisu/dtd
+ * localised sisu markup/input configuration
+ is placed directly under _sisu in the markup directory
+ (rather than _sisu/config), the hierarchy becoming
+ ./_sisu
+ ~/sisu
+ /etc/sisu
+ NOTE: it is again necessary to run sisu -CC
+ NOTE: the following have so far been considered and discarded as
+ alternatives to _sisu: "sisu" discarded as a name sometimes used for a
+ document directory; ".sisu" discarded as hidden output directories may be
+ confusing to the user; "sisurc" remains a possible alternative which is a
+ bit descriptive, however "_sisu" is consistent with the configuration
+ directories, and chosen for now
+
+ * see notes on css and images
+ for changes to image and css output directories
+ * see notes on configuration for notes on changes within
+ _sisu in local markup directory
+
+ * manifest, renamed from summary, sisu_manifest.html instead of summary.html
+ [reason: less likely to be useful in other circumstances, summary freed as
+ a reserved filename] [contains: #output #metadata #links]
+
+ * _sisu: _sisu/conf files and subdirectories moved to _sisu
+ [reason: the deeper directory structure made sense when sisu_processing was
+ also contained with _sisu, it is no longer helpful,
+ the directory structure of ./_sisu mirrors that of ~/.sisu]
+
+ * images now placed within output directory sisu/image
+ (there is a main sisurc directory and each subdirectory (mapping to a
+ markup directory stub) contains its own sisurc directory)
+
+ * generation of remote markup/source documents url, some work, on image
+ mappings
+
+ * css: logic in place for manually created css substitution
+ * -CC copies css files to output/webserver director sisu_css
+ if they exist in ./_sisu/css, ~/.sisu/css or /etc/sisu/css
+ * -H or -h html -x -X for xml etc. will look in output/webserver
+ sisu_css directory for any requested css. If it exists, pages created
+ will link to it, otherwise, the default css files provded by sisu are used.
+ * css requests may be done on a document or directory stub basis 0~css grey
+ will look for grey_html.css and the directory stub book, will look for
+ book_html.css
+ [note: check and make pages more css friendly]
+
+ * fix, if the within a document markup directory the directory
+ _sisu_processing exists and is writable it will be used for processing
+ otherwise /tmp/_sisu_processing is used
+ [i.e. to use ./_sisu_processing for processing, create it]
+
+ * sisurc.yaml defaults set to false to prevent zap (-Z) and css changes
+
+ * Sam Williams copyright notice, included under 0~rights in Free as in
+ Freedom, not sure how this has been missed.
+
+ * minor screen display url correction, in sax.xml
+
+%% sisu_0.33.0.orig.tar.gz (2005w50/4 | 2005-12-15)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.33.0.orig.tar.gz
+ 8a0907a006a1cb7187b5006db4f5ff7c 3252270 sisu_0.33.0.orig.tar.gz
+ 42b0ac73e9c5d680c70c86d9ee3115c2 691 sisu_0.33.0-1.dsc
+ 2c1a41d51aefa57d3a7c0f4c82356ce5 13649 sisu_0.33.0-1.diff.gz
+
+ * processing directory, moved to ./_sisu_processing from ./_sisu/processing
+ [reason: makes it easier to backup _sisu [you will almost never want _sisu_processing]]
+ /tmp/_sisu_processing is default and used if the former directory is absent
+ (instead of /tmp/sisu_processing for consistency)
+ [reason for local directory processing option if /tmp is default, exists,
+ if you prefer to keep processing out of /tmp]
+ [consider for /tmp adding to path /tmp/_sisu_processing/[$USER]/[directory
+ stub] to minimise likelihood of collisions, unlikely currently as the
+ default is to regenerate "metaverse" for each request]
+
+ * css, moved to [web_output]/sisu_css from [web_output]/style
+ [reason: collision with other efforts, manual or otherwise even less likely]
+ this means it is necessary to reinitialise directories, see sisu -CC
+
+ * external document (using url to call for processing), paths for processing
+ and downloaded images adjusted (processing and output)
+
+ * install (Rantfile and rant: install), a fix required
+
+%% sisu_0.32.5.orig.tar.gz (2005w50/3 | 2005-12-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.5.orig.tar.gz
+ aaaa1f0b62a45f5631d6875b8d1c4f60 3250422 sisu_0.32.5.orig.tar.gz
+ e201e7b1429886cf9b2be3ec14a63f18 691 sisu_0.32.5-1.dsc
+ 01009df572a86b00e2ea1d3ddf7b1211 13627 sisu_0.32.5-1.diff.gz
+
+ * orig.tar.gz should now be updated together with debian package
+ orig.tar.gz has not been updated properly since 0.31.4, debian package has
+ issue with autopackage builder
+
+ * debian package improved, however: diffs started from scratch, information/history abandoned
+ Reason: undetermined problem with automated package builder.
+ automated package builder (which uses darcs and darcs-buildpackage) builds package
+ normally/properly with a pristine directory structure, but not with accumulated debian build history.
+ For now, the orig.tar.gz and debian package structure are updated, and debian history is not included.
+
+ * directory named extra removed from source tarball,
+ extra/debian/man moved to debian/man
+
+ * debian, correction of a man page
+
+%% sisu_0.32.4.orig.tar.gz (2005w50/1 | 2005-12-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.4.orig.tar.gz
+ bd699b88457a2daf06de35681cd4df47 3265783 sisu_0.32.4.orig.tar.gz
+ 2e8a85326c7e14845481affb4df00fc0 692 sisu_0.32.4-1.dsc
+ e18913a52d26cf6bd1e5952b288cc08a sisu_0.32.4-1.diff.gz
+
+ * odf (opendocument), images - an image per paragraph/object only, at present
+ (thanks Alex Hudson #odf so_solid_moo for feedback, was placing paragraphs
+ within paragraphs, last step in getting images working)
+
+ * odf (opendocument), sisu document metadata
+
+%% sisu_0.32.3.orig.tar.gz (2005w49/7 | 2005-12-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.3.orig.tar.gz
+ 83e69d4ae96e578e8d089e9ad52c53c0 3265897 sisu_0.32.3.orig.tar.gz
+ e5c79923d0f574b7c9b8c5e36b9cead8 692 sisu_0.32.3-1.dsc
+ 6b95e5e713468c957da365e05bf5b3a7 258645 sisu_0.32.3-1.diff.gz
+
+ * html endnote url re-fix
+
+%% sisu_0.32.2.orig.tar.gz (2005w49/4 | 2005-12-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.2.orig.tar.gz
+ b95ce4a61d1ad27eca528624fcc582c9 3265864 sisu_0.32.2.orig.tar.gz
+ 8d84f343edb6dc7dd5e4edbc54f5633c 692 sisu_0.32.2-1.dsc
+ a95ac72c37636ac3ba15f6a9ec6ab4d2 258346 sisu_0.32.2-1.diff.gz
+
+ * sqlite, repair
+
+%% sisu_0.32.1.orig.tar.gz (2005w48/6 | 2005-12-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.1.orig.tar.gz
+ 568917465359a1324f973929009c6993 3265886 sisu_0.32.1.orig.tar.gz
+ 6f539432cebe4abfeadf87e993416fcb 692 sisu_0.32.1-1.dsc
+ 3420efac3b35079d0ad3197a1e7fb4e0 257563 sisu_0.32.1-1.diff.gz
+
+ * minor code cleaning, mostly removal of commented out code,
+ lib html_css.rb, removed as redundant
+
+ * package: html files in data/doc/sisu moved to data/doc/sisu/html
+
+ * debian:control a missing comma added to comma delimited depends list
+
+%% sisu_0.32.0.orig.tar.gz (2005w48/4 | 2005-12-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.0.orig.tar.gz
+ d9a549c11f77809c874ab664fc24d41f 3265763 sisu_0.32.0.orig.tar.gz
+ f3605f1094fb587dbc113198054c868f 692 sisu_0.32.0-1.dsc
+ 54f1ebd40f654df574043270e8c939f4 257434 sisu_0.32.0-1.diff.gz
+
+ * -v urls, minor correction
+
+ * -q quieter
+ pdflatex quieter [/dev/null screen ouput except for -v up]
+
+ * -q -v -V -M -u screen information levels better sorted
+
+%% sisu_0.31.5.orig.tar.gz (2005w48/4 | 2005-12-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.5.orig.tar.gz
+ 9fe95a6f45eb21dabcdf227ccce1dae9 3273030 sisu_0.31.5.orig.tar.gz
+ a7faf0e8797755a628c055e29e2da34a 691 sisu_0.31.5-1.dsc
+ fa5e70331f75052e604297d900907f38 13116 sisu_0.31.5-1.diff.gz
+ [this should have been 0.32.0]
+
+ * -v -M etc. (cosmetic) url, output path information improved
+ additional possibilities in configuration, sisurc.yaml
+ setting of programs used:
+ text_editer, web_browser, pdf_viewer, odf_viewer
+ setting of viewing preference, vis path, and url
+
+ * -CC re homepages, new option setting the (manually crafted) home page,
+ copy from first found of:
+ ./_sisu/conf/home/index.html
+ ~/.sisu/home/index.html
+ /etc/sisu/home/index.html
+ otherwise, as before will look for home page in:
+ ./_sisu/conf/skin/doc/skin_sisu.rb
+ ~/.sisu/skin/doc/skin_sisu.rb
+ /etc/sisu/skin/doc/skin_sisu.rb
+ and as before if that is not found, take the sisu default
+
+ * css styles, start implementing a more flexible model for using
+ alternative stylesheets, stylesheets may be specified in document header
+ 0~css or 0~stylesheet [name], and if that existws, or if a stylesheet
+ exists that matches the markup directory stub, results in html, xhtml, xml
+ as appropriate, requesting the matching stylesheets documunts
+ [needs work and testing before it becomes really useable, for the time
+ being is switched off by default to use must be enabled in conf file]
+ [css stylesheets renamed, likely to be noticed]
+
+ * -CCr -CCRZ stubs for remote copying/building of base site,
+ images, css stylesheets, index.html and toc.html
+ (not to be confused with existing remote placement of generated output)
+
+ * Debian package adjustment
+
+%% sisu_0.31.4.orig.tar.gz (2005w48/2 | 2005-11-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.4.orig.tar.gz
+ 5f9e68079806301e4f32ddc801ffdbd0 3249616 sisu_0.31.4.orig.tar.gz
+ 9bdc2f510a981efbd811194dddb230a4 679 sisu_0.31.4-1.dsc
+ 27db1bffe6571ee571e54961a450775e 11351 sisu_0.31.4-1.diff.gz
+
+ * Debian packages broken into smaller packages, for better control over
+ dependencies, source package structure affected (control, .install,
+ .manpages)
+
+ * sisu-composite together with sisu-examples installs the whole of SiSU
+
+%% sisu_0.31.3.orig.tar.gz (2005w48/1 | 2005-11-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.3.orig.tar.gz
+ 562d89e8a4346350f749f660eb266a57 3245995 sisu_0.31.3.orig.tar.gz
+ af095b570f9aa0a7d1472747ea854e8e 10769 sisu_0.31.3-1.diff.gz
+ 68cd0ea97435cc03c893d68d7e70259a 10789 sisu_0.31.3-2.diff.gz
+ 198aef746935e6fcf673b8fb33d6e581 579 sisu_0.31.3-2.dsc
+
+ * remote url gathering of images re-fixed, e.g.
+ sisu -Hpv http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.s3
+ should produce html and pdf of Free Culture from the online marked up file, with the images
+ [sisu -CC (to copy downloaded images to the output directory)]
+ sisu -pHv http://www.jus.uio.no/sisu/sphinx_or_robot.leena_krohn.1996/sphinx_or_robot.leena_krohn.1996.s3
+ [has even more images, you will have to repeat sisu -CC]
+ [includes a workaround for an odd bug: retry needed on first attempt]
+
+ * sisu control, ensure file array unique
+ [some risk of unforeseen consequences, test]
+
+ * -v verbose output, minor, tagged on mention of sisu -W starting ruby
+ webserver on sisu output directory
+
+ * add link to sisu_faq, maintain faq
+
+ * [debian, started using pbuilder
+ (otherwise, package still built using darcs-buildpackage, and additional
+ enthusiastic use of mercurial for version control)]
+
+ * sisu_0.31.3-1 debian:control: Depends: ruby1.8 (>=1.8.3)
+
+ * sisu_0.31.3-2 debian:control: Depends: ruby (>=1.8.2)
+
+%% sisu_0.31.2.orig.tar.gz (2005w47/6 | 2005-11-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.2.orig.tar.gz
+ e928fc31ce6109f924836c79a3c19027 3245306 sisu_0.31.2.orig.tar.gz
+ 374bbe3ae0ddc53a652c5abcb421d6a7 10726 sisu_0.31.2-1.diff.gz
+
+ * debian autobuild fix [external scaffolding]
+
+%% sisu_0.31.1.orig.tar.gz (2005w47/6 | 2005-11-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.1.orig.tar.gz
+ b1734e76a39d043010e30722bbb3359c 3245133 sisu_0.31.1.orig.tar.gz
+ 20bbb1f84c34779e55abed80aae7fdf0 10679 sisu_0.31.1-1.diff.gz
+
+ * odf, minor fix url match
+
+ * [sample documents urls to amazon and barnes and noble
+ added as courtesy to authors]
+
+ * [Note: change to automated debian package build procedure]
+
+%% sisu_0.31.0.orig.tar.gz (2005w47/5 | 2005-11-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.0.orig.tar.gz
+ e6beae75cda1d00c68dc0d97c67cb540 3244304 sisu_0.31.0.orig.tar.gz
+ 8785cf622dee3fe07eed841b8cfbf8e1 10626 sisu_0.31.0-1.diff.gz
+
+ * metaverse, header, italicise and bold lists,
+ results in significant changes
+ markup change use regex directly
+ [results in odf (openoffice) repair of 0.30.9]
+
+%% sisu_0.30.10.orig.tar.gz (2005w47/5 | 2005-11-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.10.orig.tar.gz
+ ed89acbe1f406f2f55052651d12f1b78 3242816 sisu_0.30.10.orig.tar.gz
+ 6495690d1611efd7c9a8145a8b0ca73e 10589 sisu_0.30.10-1.diff.gz
+
+ * rollback to 0.30.8 header, italicise and bold lists,
+ use of semi-colon delimited list,
+ [new version number 0.31 opened for header use of regex
+ to italicise and bold]
+
+%% sisu_0.30.9.orig.tar.gz (2005w47/2 | 2005-11-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.9.orig.tar.gz
+ 70cc77083106e86b98bcf719ec35d657 3242867 sisu_0.30.9.orig.tar.gz
+ 5ab1832552e65f598304baff2e253a88 10499 sisu_0.30.9-1.diff.gz
+
+ * setup.rb 3.4.1 by Minero Aoki included with SiSU as an installer
+
+ * package directory structure modified to comply with setup.rb default
+ data/man moved to man as setup.rb, affects debian
+
+ * header, italicise and bold lists, markup change use regex directly
+ [instead of converting semi-colon delimited list]
+
+ * minor notes on installation in README
+
+%% sisu_0.30.8.orig.tar.gz (2005w47/2 | 2005-11-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.8.orig.tar.gz
+ a75adbe1198732ec577c630e4b4e94dd 3229748 sisu_0.30.8.orig.tar.gz
+ 3a4cd20539b968f37d10c1a8383bc315 10595 sisu_0.30.8-1.diff.gz
+
+ * latex pdf, the pdfetex parameters used appear to be Debian specific,
+ SiSU LaTeX is written for pdflatex... change precedence/ search order,
+ use pdflatex if present, otherwise try use pdfetex (with pdflatex parameter)
+
+ * url/document output, (largely cosmetic fix) screen information,
+ sisudoc (-S) and sisu markup source (-s) [-S was linked to sqlite]
+
+ * url (-U) print urls without -v
+
+%% sisu_0.30.7.orig.tar.gz (2005w47/1 | 2005-11-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.7.orig.tar.gz
+ 83c56fa696a75a9111295c99c2e5196e 3229287 sisu_0.30.7.orig.tar.gz
+ 2e581d080177a0aa24f7076597676438 10552 sisu_0.30.7-1.diff.gz
+
+ * rsync screen message adjustment
+
+ * skin:hp linked to sisu_changelog which has been separated from sisu_download
+
+ * composite documents, fix manual closure of file is apparently necessary !
+
+%% sisu_0.30.6.orig.tar.gz (2005w46/7 | 2005-11-20)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.6.orig.tar.gz
+ c9abcf18916ac55d67308039f01933bb 3228496 sisu_0.30.6.orig.tar.gz
+ 810751b72796f862fe5d9f4cfcbe195b 10510 sisu_0.30.6-1.diff.gz
+
+ * numeric shortcuts accept rsync extra command flag (-R)
+
+ * rsync (-R), screen output minor (what default, verbose and quiet do)
+
+%% sisu_0.30.5.orig.tar.gz (2005w46/7 | 2005-11-20)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.5.orig.tar.gz
+ e3e08897e4d7c3373c5898f31926c094 3228219 sisu_0.30.5.orig.tar.gz
+ 583723571b8df2aa7717a7872b143227 10497 sisu_0.30.5-1.diff.gz
+
+ * conf, homepage, skin path precedence, fix
+ (related to finding ./_sisu/conf/skin/doc/skin_sisu.rb)
+
+ * summary, suggested links, cosmetic: fix to static url
+
+ * sisu_doc, drop making of directory _sisu/config
+ (using _sisu/conf)
+
+%% sisu_0.30.4.orig.tar.gz (2005w46/6 | 2005-11-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.4.orig.tar.gz
+ a2a1bf159e3ccfdd7a15baf4f2603fbf 3227828 sisu_0.30.4.orig.tar.gz
+ 895212c9fb09f100674338b7694ad921 10481 sisu_0.30.4-1.diff.gz
+
+ * html segments, summary button, fix (icon and link)
+
+ * sisudoc, cosmetic: screen output, touch (remove repeat of output filename)
+
+ * summary, suggested links, cosmetic: replace relative links with static url
+
+ * conf.rb renamed from config.rb
+
+ * moved sisu_changelog out of main SiSU document [has grown large]
+
+%% sisu_0.30.3.orig.tar.gz (2005w46/6 | 2005-11-19) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.3.orig.tar.gz
+ 444a194aae38120f13fd3bf2f9ae505a 3227547 sisu_0.30.3.orig.tar.gz
+ 1d1b49a957cb118a3110574d26bb9304 10413 sisu_0.30.3-1.diff.gz
+
+ * configuration, change, use ./_sisu/conf
+ [WARNING ./_sisu/config is depreciated and will be removed]
+
+ * db:pgsql, bugfix FROM required in a select statement
+ [postgresql 8.1 complained]
+
+ * zap, delete, -Z disable by default,
+ to use must enable in sisurc.yaml
+
+ * rmagick, disable load/require by default, sisurc.yaml
+ problem with some local installs of ruby
+
+ * pdfetex, call with -fmt=pdflatex
+
+ * summary, metadata suggested links added
+
+ * xml,xhtml,html tidy only run with -V or -M
+ rexml only with -M, primary reason a considerable speedup
+ in skipping step unless specifically requested for testing
+
+ * sisu control file, changes a bit arbitrary, but a bit easier
+
+ * debian control suggests keychain (added)
+
+ * summary and place of composite document source (-s -y), though just request
+ for other documents [decide later whether to include constituent document
+ parts]
+
+ * help, update, sync with man pages
+
+%% sisu_0.30.2.orig.tar.gz (2005w46/2 | 2005-11-15) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.2.orig.tar.gz
+ d0f8f7dfe1106616e3e0790c034cf190 3228007 sisu_0.30.2.orig.tar.gz
+ f953aa19d54e99a7a8d4669aaffe87ad 10130 sisu_0.30.2-1.diff.gz
+
+ * minor cleaning
+
+%% sisu_0.30.1.orig.tar.gz (2005w46/1 | 2005-11-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.1.orig.tar.gz
+ 6367fc10883a98452d87044193338062 3227345 sisu_0.30.1.orig.tar.gz
+ 59706eabd49a51394887d4ebb218cd3c 10112 sisu_0.30.1-1.diff.gz
+
+ * summary, include plain.txt where available
+
+%% sisu_0.30.0.orig.tar.gz (2005w45/7 | 2005-11-13)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.0.orig.tar.gz
+ 2ab163fbf4a3b2ed31e14328ce69cbac 3227035 sisu_0.30.0.orig.tar.gz
+ 6b0103b794fe8c6c015043b56f7770cd 10096 sisu_0.30.0-1.diff.gz
+
+ * param, polishing...
+
+ * sql metadata, reworked ... ongoing
+
+ * sisudoc, re-named sisu_doc rather than sisu_ball
+
+ * sisudoc, only -V and -M show verbose tgz of what goes in to sisudoc (previously -v did)
+
+ * name correction: SiSU is a recursive acronym, and has other
+ alternative possible expansions, one of which i got wrong,
+ under the influenced of the other !
+ * SiSU information Structuring Universe
+ * Simple information Structuring Universe
+ * _Structured information Serialized Units_
+ [<-- i got my last name wrong consistently wrote Serialized information
+ Structured Units, which makes less sense, (i am guessing i managed to
+ overlook this because of the position of the word structured in the first
+ and second expansion) i guess this correction calls for a major version
+ number change! hope no one (else) notices ;-) ]
+
+%% sisu_0.29.5.orig.tar.gz (2005w45/5 | 2005-11-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.5.orig.tar.gz
+ 3e0ad7d2f8b02d0f3e61f113b2430269 3223938 sisu_0.29.5.orig.tar.gz
+ 90a2570933de02fabd965fe8218fa354 10060 sisu_0.29.5-1.diff.gz
+
+ * for present have gone back to using pdfatex, need to spend some time to
+ figure what needs to be done for pdfetex, LaTeX headers may need to change,
+ in any event, calling it in same manner as padflatex broke pdf output, (no
+ time et to sort out)
+
+ * minor fixes, [regex match of param metadata and copyright sign in odf]
+
+%% sisu_0.29.4.orig.tar.gz (2005w45/5 | 2005-11-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.4.orig.tar.gz
+ 0d47f551de9f140d6cabc84614e2b4d8 3223745 sisu_0.29.4.orig.tar.gz
+ 600d5725cd8835ce4cc345a10d074ca2 10035 sisu_0.29.4-1.diff.gz
+
+ * summary, make easily available from different outputs
+
+ * metaverse, autonumbering of segments from manual text markup,
+ re-checked/re-fixed [as presents some risk must be selected in heading]
+
+ * metaverse, when run remove maintenance metaverse file unless -M flag used
+
+ * param, endnotes checking, where endnote references and endotes are separate
+ check than number count matches else report error, [and place error in
+ document summary]
+
+ * opendocument, renamed file odf
+
+ * opnedocument, added matching & linking of urls and mail address
+
+ * summary, warning of document error if endnote number mismatch, note this
+ cannot occur if the preferred markup style for endnotes is used.
+
+ * sysenv, pdfetex, debian renaming, search for pdfetex, pdftex and pdflatex
+ to generate pdf from SiSU's LaTeX output
+
+%% sisu_0.29.3.orig.tar.gz (2005w45/2 | 2005-11-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.3.orig.tar.gz
+ f4b9e6b875e9d01c1c52bfa68f1e3d56 3222790 sisu_0.29.3.orig.tar.gz
+ da61f9e61a5e5b7538c47d996b24a937 9961 sisu_0.29.3-1.diff.gz
+
+ * rsync use added for remote puts -R (scp is -r)
+
+ * summary bug fix, variable scope reduced
+ (incorrectly retained information from previous files in batch runs)
+
+ * introduced -K which deletes output files prior to processing of files of
+ same type
+
+ * -s sisu markup source copied to output directory, (placed remotely with -sr)
+
+ * -S sisudoc made and copied to output directory, (placed remotely with -Sr)
+ [renamed from -Z]
+
+ * --update updates previous output, with same filetype output only, useful
+
+ * [-F renaming from -S naive cgi search form sample]
+
+ * [minor editing of program file headers]
+
+%% sisu_0.29.2.orig.tar.gz (2005w45/1 | 2005-11-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.2.orig.tar.gz
+ b8ecd141040e1ffa0820cdf9382304a7 3220476 sisu_0.29.2.orig.tar.gz
+ 3d42aeb8d9648fed4baf837c59cff7a5 9899 sisu_0.29.2-1.diff.gz
+
+ * sql table metadata created, replaces table titles
+ [breaks former table structure]
+
+ * sql urls replaces links table
+
+ * pgsql comments
+
+ * cgi scripts use table:metadata instead of table:tiles
+
+ * xml series, poem and group (and code) first pass
+
+ * opendocument renamed odt.tgz instead of o_doc.tgz
+
+ * summary, (-y) summary of document outputs generated and document metadata
+ (metaverse includes links to summary, as does html band and latex doc info)
+
+ * data/sisu (/usr/share/sisu) created for sisu shared images and odf,
+ subdirectories, separating packages sisu from sisu-examples which is
+ recommended only, and should not be needed to provide what sisu requires.
+
+ * debian/sisu.install map data/sisu to /usr/share/sisu
+
+ * [small changes: webserv var rename; cosmetic removal in html and xml of
+ less-than greater-than on copy @ \<< home \>>]
+
+%% sisu_0.29.1.orig.tar.gz (2005w44/6 | 2005-11-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.1.orig.tar.gz
+ c2a36974bf9c9d04e3c402a01500be68 3214920 sisu_0.29.1.orig.tar.gz
+ 398f1f15f798bb31679ca91cb1b400ab 9802 sisu_0.29.1-1.diff.gz
+
+ * tar gzip files changed file suffix to .tgz (instead of .gz)
+ comment added to man page and help
+
+ * html some character encoding corrections (é and a few others)
+
+ * param recognises rcs in addition to cvs and 0~rcs+ $Id$ may be used
+ [as alternative to 0~cvs equivalent, metaverse and downstream adjusted
+ accordingly]
+
+ * debian/control added suggests lv and rcs as alternative to cvs
+ [to which it is personally preferred for document control (as making
+ more sense working with favoured used development distributed source
+ control management systems, mercurial and darcs)]
+
+%% sisu_0.29.0.orig.tar.gz (2005w44/1 | 2005-10-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.0.orig.tar.gz
+ a1658902d929eee564c77f061568a677 3214113 sisu_0.29.0.orig.tar.gz
+ fc3c5c566c307636d23467476d38b5bf 9732 sisu_0.29.0-1.diff.gz
+
+ * metaverse autonumbering changed,
+ affecting default html segment naming
+ [change to metaverse affects downstream processing]
+
+%% sisu_0.28.4.orig.tar.gz (2005w44/1 | 2005-10-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.4.orig.tar.gz
+ f3f00e850a17d2fbfbffadf8a0d6ef5d 3213380 sisu_0.28.4.orig.tar.gz
+ e9e5a3f5a1ed1065b2c02b15d630a213 9718 sisu_0.28.4-1.diff.gz
+
+ * opendocument -o now defaults to produce metaverse first -mo
+ (this is behaviour for other outupts such as html, latex/pdf...)
+
+ * metaverse footnote url matches, tuning
+
+ * texpdf url matches, tuning, especially footnotes
+
+ * help update of processing flags, checked against man pages
+
+ * some changes to variable names, cf instead of rf (also used pf briefly)
+
+ * debian control file, minor edit of description of SiSU
+
+ * doc/overview.txt update on things not done in list
+
+%% sisu_0.28.3.orig.tar.gz (2005w42/7 | 2005-10-23) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.3.orig.tar.gz
+ 144e450c59d99c9baa24e1f265e19182 3212941 sisu_0.28.3.orig.tar.gz
+ bf0ecc4e8a2378acfadee2158005a500 9669 sisu_0.28.3-1.diff.gz
+
+ * metaverse, bullets accidentally removed, and put back
+
+%% sisu_0.28.2.orig.tar.gz (2005w42/6 | 2005-10-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.2.orig.tar.gz
+ ae92bc6a14600a15f4bfbe5512bf9af2 3213202 sisu_0.28.2.orig.tar.gz
+ ee23f7ac2122521fe4d802e023921a7f 9644 sisu_0.28.2-1.diff.gz
+
+ * texpdf character encoding bugfix, (removed iconv) however,
+ sisu requires utf-8 input for extended character sets
+
+ * character encoding touches, e.g. sample files saved as utf-8
+
+%% sisu_0.28.1.orig.tar.gz (2005w42/6 | 2005-10-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.1.orig.tar.gz
+ e672ccc483cf48fed084bfce99f87b8d 3212728 sisu_0.28.1.orig.tar.gz
+ dbe154e00f8421a2f05c67a11c2e7cbc 9618 sisu_0.28.1-1.diff.gz
+
+ * character encoding, moved a basic transform to metaverse,
+ hopefully more predictable characters to deal with and
+ made easier to work with postgresql, affects other modules
+ changes to html and texpdf, neither perfect, both need work
+ esp. html. two steps forward one step back
+
+ * some database operations visited, (update)
+
+%% sisu_0.28.0.orig.tar.gz (2005w42/5 | 2005-10-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.0.orig.tar.gz
+ 12064bd92864441ab8b103f094412c2f 3210000 sisu_0.28.0.orig.tar.gz
+ 22c5452ca4a060ddbb4bcb768a4bd119 9600 sisu_0.28.0-1.diff.gz
+
+ Release (and version number bump) primarily to put ruby sisu segfault
+ bug behind us, Debian ruby-1.8.3-2 released and fixes this
+ [an emergency build to work around the problem was made available as
+ 0.27.0 see note there for details]
+
+ * remote placement of open document files added (odt)
+
+ * added open document format to several default shortcuts sisu -2 etc.
+
+ * made note of opendocument format output on sisu home page
+ [feature not complete]
+
+ * synced skin_sisu.rb files, (there are a bit too many of them, most would normally be syslinks)
+
+%% sisu_0.26.4.orig.tar.gz (2005w42/2 | 2005-10-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.4.orig.tar.gz
+ 6cd9d7bcb42a48a7475d6bd724b766be 3202069 sisu_0.26.4.orig.tar.gz
+ 5f0a0dec3a5819f2e266581d912255ad 9499 sisu_0.26.4-1.diff.gz
+
+ * sisu file format flag moved to -Z (from -B)
+
+ * sisu -Z without [filename/wildcard] makes gzip of sisu directory of
+ marked up files, including sisu markup source files, local configuration
+ file, images and skins.
+
+ * sisu -Z [filename/wildcard] makes gzip of individual sisu file specified
+ including sisu markup source file and related images and skin
+
+ * opendocument format, -o, experimental, incomplete, [ignore]
+
+ done:
+ headings
+ footnotes
+ bold underscore italics strikethrough
+ superscript subscript
+ extended ascii set
+ indents
+ groups
+ tables
+ poem
+ code
+
+ todo:
+ groups
+ tables
+ images
+ bullet
+ line break?
+ page break?
+ table of contents
+ page header/footer?
+
+ * debian build (i) recommends sqlite added, overlooked previously;
+ (ii) added recommend zip, used in the making of open document;
+ (iii) removed recommended incorrect libcgi_ruby. libfcgi-ruby1.8, remains;
+ (iv) have added a basic open document file structure as a tgz file.
+
+%% sisu_0.26.3.orig.tar.gz (2005w40/5 | 2005-10-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.3.orig.tar.gz
+ 309cbdc9b2ab048a670ca9301aaeee87 3183245 sisu_0.26.3.orig.tar.gz
+ 3dc4a9587427db4819a10958c4adde5c 9342 sisu_0.26.3-1.diff.gz
+
+ * a sisu file format introduced:, -B, a gzipped file, containing:
+ sisu markup sourcefile,
+ its images
+ and its skins,
+ opens as sisu_ball directory, which once unipped sisu may be run within,
+ (sisu does not at present automatically unpack and run on these files,
+ but is a convenient way of packing the contents of a file for sending)
+ [early days]
+
+ * man1/sisu.1 upadated and html on -B sisu file format (sisu help not yet done)
+
+ * cosmetic firefox taken from list of lightweight browsers,
+ remains very much amongst the heavies
+
+ * cosmetic correction on info related to librmagick-ruby contained within
+ sample document free_culture
+
+%% sisu_0.26.2.orig.tar.gz (2005w39/5 | 2005-09-30)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.2.orig.tar.gz
+ 2b5f2c65088a6f95303c2b99d5033386 3179769 sisu_0.26.2.orig.tar.gz
+ 9d2aa597a50af0608c382e6f52f8a873 9322 sisu_0.26.2-1.diff.gz
+
+ * css, minor, caption - display: inline;
+
+ * syntax highlighting (sisu markup), editor configuration files, added, see
+ sisu-examples/config/syntax_hi/README
+ /usr/share/sisu-examples/sisu-examples/config/syntax_hi/README
+
+ for the editors:
+ * nano http://www.nano-editor.org/
+ * diakonos http://purepistos.net/diakonos/
+
+ NOT REALLY DONE, but intitial attempt included anyway:
+ * nedit http://www.nedit.org/
+ * gedit http://www.gnome.org/projects/gedit
+ * kate http://kate.kde.org
+ * emacs http://www.gnu.org/software/emacs/emacs.html
+
+ [vim-sisu still provides the most comprehensive sisu markup
+ editor environment]
+
+ * evince becomes the default pdf in maintenance urls etc. (previous was xpdf)
+
+ * document samples image dimensions manually provided, affected document
+ sample "Free Culture", Lawrence Lessig. Note this is not necessary from
+ sisu-0.20.0 onwards, if you have rubymagick installed.
+
+WARNING ruby 1.8.3 (2005-09-21) [i486-linux] segfaults SiSU
+FIXED in 1.8.3 (2005-09-29) [i486-linux] thank you TS/Guy Decoux
+the new ruby build is not as yet uploaded to Debian unstale
+
+%% sisu_0.27.0.orig.tar.gz (2005w39/1 | 2005-09-26) %% Emergency Release:
+
+NOTE: this is an emergency version of SiSU that does not segfault with
+problem versions of ruby, see note follwing. It is prepared without Syck/Yaml
+
+Problem ruby versions:
+* ruby 1.8.3 (2005-09-21) and was removed by TS:Guy in ruby 1.8.3 (2005-09-29),
+ released as Debian unstable ruby-1.8.2-1, and in
+* ruby 1.8.3 (2005-10-12) and was again removed by TS:Guy in ruby 1.8.3 (2005-10-13).
+
+ * Temporary Emergency Release
+ ruby 1.8.3 (2005-09-21) [i486-linux]] segfaults sisu
+ bug report made to ruby-core 2005-09-24
+
+ this version of sisu built without Syck/Yaml
+ and is not configurable, (uses sisu default configuration only)
+ ignoring yaml user config files
+
+ as such this emergency release:
+ * only uses sisu default configuration settings,
+ ignoring yaml user config files
+ * does not provide sisu version information
+
+%% sisu_0.26.1.orig.tar.gz (2005w37/7 | 2005-09-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.1.orig.tar.gz
+ a6e020a9932d972cc92a8abdcb704238 3156526 sisu_0.26.1.orig.tar.gz
+ 4cbe9d5240b03eea9fc6392ebb2aca46 9304 sisu_0.26.1-1.diff.gz
+
+ * pruning, removed words.rb (vocab is used)
+
+ * wmap & vocabulary, minor modifications, and runs metaverse
+
+ * minor pruning and renaming, small changes
+
+%% sisu_0.26.0.orig.tar.gz (2005w37/7 | 2005-09-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.0.orig.tar.gz
+ 4d1702c6cb8f162f4c7ece7a236148c6 3159698 sisu_0.26.0.orig.tar.gz
+ 99f922789101f388cf3a7562ec2953c5 9293 sisu_0.26.0-1.diff.gz
+
+ * sisu_webrick server no longer builds url paths with tilde prefix
+
+ * sysenv, and link urls updated accordingly
+
+ * sisu-examples, cgi sql search form, minor updates
+ sqlite sample set for webrick server defaults, port 8081, with url suffixes
+ pgsql sample set without (port is default port, and no url suffixes)
+
+ * sisu_webrick server defaults must be changed in rc files, rather than by
+ command-line parameters (reason, the rest of sisu would not see command
+ line parameter changes, and would continue to provide rc details)
+
+ * start enforcing lower case sisu markup tagging
+
+%% sisu_0.25.11.orig.tar.gz (2005w37/6 | 2005-09-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.11.orig.tar.gz
+ 5330033ca4c32a20424b212d5e15705e 3158745 sisu_0.25.11.orig.tar.gz
+ bdd533301ed392ec7c27f1e364dc8388 sisu_0.25.11-1.diff.gz
+
+ * cgi, cgi sql search form sample generator, link suffixes added
+
+ * cgi, cgi sql search form sample generator, -S takes additional parameter
+ webrick to provide port links that webrick server will use.
+
+ * sisu_webrick, -W does cgi form.
+
+ * sisu_skin & defaults, home page, adjustments
+
+ * html output (tune), fix image, no link where non provided, i.e. where the
+ { imagename.png }image notation is used
+
+ * html output (css & tune), image caption, smaller font
+
+ * configure, (-C & -CC) absence of trang is only reported
+ if -V (extra verbose) flag is used
+
+ * processing remote urls, (-C & -CC) absence of external_images is only
+ reported if -V (extra verbose), is used [re-test]
+
+ * man page, man sisu, updated to include "-S webrick"
+
+%% sisu_0.25.10.orig.tar.gz (2005w37/5 | 2005-09-15)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.10.orig.tar.gz
+ 1b7fa60d23869d33f5d918d5aa1cf424 3157417 sisu_0.25.10.orig.tar.gz
+ 9d4b75bde3f0f138d1e4d31b7964d374 9262 sisu_0.25.10-1.diff.gz
+
+ * urls, minor correction (maintenance mode output)
+
+ * man sisu(1) and sisu(8), minor edits
+
+ * minor code cleaning
+
+%% sisu_0.25.9.orig.tar.gz (2005w37/3 | 2005-09-14) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.9.orig.tar.gz
+ 48249bcd13900d9d68519585a3e825f6 3162000 sisu_0.25.9.orig.tar.gz
+ 2c74d1288dea0c604603185ae71a4421 9247 sisu_0.25.9-1.diff.gz
+
+ * latex/pdf, librmagick-ruby: will throw a warning and refuse to build
+ latex/pdf output for documents that are marked up without image dimensions,
+ that require the librmagick library. [librmagick-ruby is not "required" as
+ provided documents are marked up accordingly, it is never needed. As an
+ example first image markup form requires the library, the second does not:
+ { freeculture01.png }http://www.free-culture.cc/
+ {freeculture01.png 350x350 }http://www.free-culture.cc/
+
+ * man pages additions, mostly "man 8 sisu"
+
+%% sisu_0.25.8.orig.tar.gz (2005w37/3 | 2005-09-14) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.8.orig.tar.gz
+ bd8edf228360f3f3795812c93edfee19 3159743 sisu_0.25.8.orig.tar.gz
+ 17b662d3d2e7f1881c7eebecb6dca192 9232 sisu_0.25.8-1.diff.gz
+
+ * metaverse, default is to run metaverse wherever it may be required,
+ i.e. when any of - abDdeHhINptXxz
+
+ * plaintext, endnotes version (-e) sorted,
+ -a (footnotes following paragraphs) is ok
+ [however is currently an either or, both output plain.txt]
+
+ * texinfo, basic output working again (with pinfo).
+ [fix later, moving of & to <=and>]
+
+ * debian, recommends, added pinfo
+
+ * help, fix help on markup \ escape character (escaped)
+
+%% sisu_0.25.7.orig.tar.gz (2005w37/2 | 2005-09-13)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.7.orig.tar.gz
+ b86531a1788f6bce8e81328760801fa3 3158773 sisu_0.25.7.orig.tar.gz
+ a2824de38545b6695eb06ea35bb73fea 9207 sisu_0.25.7-1.diff.gz
+
+ * metaverse, possibility to escape backslash (\\ to produce \) [Special
+ character escape set near complete for regular text, verify situation for
+ code blocks (code{) where characters should be treated verbatim].
+
+ * metaverse, markup, test and addition of possibility to escape contextual
+ special characters, such as asterisk (*) and exclamation mark (!), which
+ are not normally a special characters that need to be escaped, but the
+ ability to do so is useful where for example used to describe their markup
+ function as in \*{bold}* \!{emphasis}! verified others used in a similar
+ way (*!/_\^,+), either already available or also added \/{italicise}/
+ \_{underscore}_ \^{superscript}\^~{ note that the caret (\^) is a special
+ character that must always be escaped, unlike the other characters
+ described here which are contextual }~ \,{subscript}, \+{inserted}+
+ \-{strikethrough}-
+
+ * man page and help, comments added on escaping special characters and
+ headers
+
+ [extensive testing escaping the full range of special characters is necessary
+ these include \\ \< \> \{ \} and the contextual * ! / _ \^ , + ]
+
+%% sisu_0.25.6.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.6.orig.tar.gz
+ c0b6aa1a71a4d139d65c43fb2d21b8b0 3156969 sisu_0.25.6.orig.tar.gz
+ 283c663e1b3e7803217d80709dcc7b73 9186 sisu_0.25.6-1.diff.gz
+
+ * metaverse, cosmetic corrections related to bold, italics and punctuation
+
+ * metaverse, and add a few language settings
+
+ * latex/pdf start looking at language settings, set language selected for
+ document \documentclass \usepackage \selectlanguage
+
+ * latex/pdf creator copymark turned off by adding minus sign to creator
+ header, as in 0~creator- [name of author]
+
+ * man pages, help files updated on language settings
+
+ * copyright SiSU system, object numbering etc. in pdfs, (reduced font size &
+ words from previous Debian release, [a bit more than in 0.25.5])
+
+%% sisu_0.25.5.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.5.orig.tar.gz
+ dadf9ffb77c629189be5f08345f451cf 3154083 sisu_0.25.5.orig.tar.gz
+ 7749d8a2a4ed73e9f0d85e5fae5d9027 9178 sisu_0.25.5-1.diff.gz
+
+ * latex/pdf cosmetic reduced size of font related to document
+ processing information.
+
+%% sisu_0.25.4.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.4.orig.tar.gz
+ b2bd5bd90ebb3af821f7b60a03cfecaa 3153879 sisu_0.25.4.orig.tar.gz
+ 894ed52890f238a8feab48e80e86aae8 9166 sisu_0.25.4-1.diff.gz
+
+ * metaverse, fix related to 0.25.3 (interaction between operation of
+ bold lines and bold words selected in header).
+
+%% sisu_0.25.3.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.3.orig.tar.gz
+ 079f2c259f8de88e48ce16a6b0eed242 3153671 sisu_0.25.3.orig.tar.gz
+ 1388f9f6183f76b49aa52ccef26bc5bc 9153 sisu_0.25.3-1.diff.gz
+
+ * metaverse, subtle correction todo with interaction between operation of
+ bold lines and bold words selected in header.
+
+ * changes to text accompanying latex/pdfs, toning down of language,
+ correction of gpl2 url to fsf.org rather than gnu.org
+
+%% sisu_0.25.2.orig.tar.gz (2005w36/6 | 2005-09-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.2.orig.tar.gz
+ de5b7c20ec8e793d131c0f7665a1447a 3153602 sisu_0.25.2.orig.tar.gz
+ e46bcf337617273e1ef715010c0a7542 9134 sisu_0.25.2-1.diff.gz
+
+ * latex/pdf fix, produce text without object numbers
+ (problem with documents including grouped text markers, poem{ etc.)
+ fix affects processing with the -0 flag (zero), e.g.
+ sisu -mHp0v [filename].s3
+
+%% sisu_0.25.1.orig.tar.gz (2005w36/6 | 2005-09-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.1.orig.tar.gz
+ a82d3a227babf3bc1a6660fafba17ecc 3153326 sisu_0.25.1.orig.tar.gz
+ 5df9ff95789c457566e0fc822449f1ef 9122 sisu_0.25.1-1.diff.gz
+
+ * cgi search for generator: fix, removal of an errant line of code
+ (removal of hardlink to version number)
+ fix affects
+ sisu -S
+
+%% sisu_0.25.0.orig.tar.gz (2005w36/6 | 2005-09-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.0.orig.tar.gz
+ 15d88f5a33da7f3cb427e5a8a0dae573 3153121 sisu_0.25.0.orig.tar.gz
+ a191b69a92500d8880b764b6c33a4957 9111 sisu_0.25.0-1.diff.gz
+
+ * db/sql: changes to database table names, cleaner
+
+ * db/sql/search: cgi search examples and cgi search sample generator modified
+ accordingly
+
+ * db/sql: recreate, creates if no existing database, instead of complaining
+ (createall complains if database exists - you may not wish to remove
+ existing)
+
+ * db/sql: replaced oid table with links table, and provide links to output files,
+ affects both pgsql and sqlite
+
+
+%% sisu_0.24.2.orig.tar.gz (2005w36/5 | 2005-09-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.2.orig.tar.gz
+ 924f791aa2ab18e3917451ff09183a3b 3152290 sisu_0.24.2.orig.tar.gz
+ cbbfdde8fd261b1bfdd47f633c895222 9093 sisu_0.24.2-1.diff.gz
+
+ * character encoding, existing table hash replaced with a KirbyBase table
+ character encoding lib is not currently used by sisu,
+ (& KirbyBase is not included with sisu), for what it is see
+ http://www.netpromi.com/kirbybase_ruby.html )
+ hoever, this is a possible way forward should such a table be needed
+
+%% sisu_0.24.1.orig.tar.gz (2005w36/4 | 2005-09-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.1.orig.tar.gz
+ 328d2c858900bca8594aaf9fdad48687 3154040 sisu_0.24.1.orig.tar.gz
+ 2a8e982a69c58ea39a82c3c1e849fcc3 9083 sisu_0.24.1-1.diff.gz
+
+ * latex/pdf fix: tilde may be printed if marked up as escaped character
+ has been a problem, (revisit, refactor what is done with tilde)
+
+ * escaping sisu special characters a bit of work done, html latex/pdf
+ done { } ~ < > _ - / # | : ! ^ examine need for others such as *
+
+ * latex/pdf, also html, bugfix, a bit of work on escaping of sisu special
+ characters, html latex/pdf, done \{ \} \~ \< \> \&. Several characters are
+ only special characters in given particular locations or combinations, these
+ should be escapable in any event. Further testing and work necessary, hash
+ is still a problem. { } ~ < > _ - / & | : ! ^ #
+
+ * metaverse_syntax, in code mode special characters should not be escaped
+
+ code{
+
+ { } ~ < > _ - / & | : ! ^ #
+ $ & @ *
+
+ }code
+
+ test more extensively, and correct over time. Note that the hash is for the
+ moment a problem (in latex/pdf)
+
+ * latex/pdf and other files make sure headers are only given special
+ treatment if at start of text, i.e. if actually headers, so can have a
+ description of a header within text like 0\~level new=1,2,3; break=4
+
+%% sisu_0.24.0.orig.tar.gz (2005w36/3 | 2005-09-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.0.orig.tar.gz
+ 2270344926ff777132f50dbba0270c11 3153987 sisu_0.24.0.orig.tar.gz
+ f0bc72f3a3f07984113d7dd21ba7afae 9071 sisu_0.24.0-1.diff.gz
+
+ * pdf page breaks, accepts header notation:
+ 0~level new=1,2,3; break=4
+
+ * html fix to links band -H added .html to home url, removed
+
+ * metaverse_syntax, adjustment to lines parsed, (result affects some endnotes)
+
+ * plaintext small fix &amp; is &
+
+ * minor touches to documentation
+
+ * tested supported encodings utf8 and iso8859
+
+ % sisu_0.23.1.orig.tar.gz (2005w36/3 | 2005-09-07)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.23.1.orig.tar.gz
+ 6182d22f7f4e00a3f224a5362717431a 3151165 sisu_0.23.1.orig.tar.gz
+ 6a52b9dd5ce21d46cf365da088d1f334 9063 sisu_0.23.1-1.diff.gz
+
+ * fix to the still very naive sqlite search cgi example for sqlite
+
+ * sisu -S will generate a copy of the naive sqlite and pgsql cgi search form
+ it then needs to be copied to the cgi-bin directory. It differs from the
+ example given in that it looks at output directories and includes them as
+ database options. It is more accurate on sqlite, checking that a database
+ exists, however both forms in their current form leave a lot to be desired.
+
+ * url to location of sqlite database
+
+ * latex/pdf cosmetic fix to front page removed angle brackets
+ << [location] >> appeared incorrectly, and looks cleaner without
+
+ % sisu_0.23.0.orig.tar.gz (2005w36/2 | 2005-09-06)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.23.0.orig.tar.gz
+ 4e8c4fd6e8d377d4e5af7145c37ac99a 3131414 sisu_0.23.0.orig.tar.gz
+ f7e8ecb953b39ae45772130d54b158b3 9020 sisu_0.23.0-1.diff.gz
+
+ * texpdf, utf8 added properly by way of ucs package (now requires latex-ucs)
+ breaks some things but in the long run is hopefully an improvement
+ currently supported encodings utf8 and iso8859.
+
+ Resulting in out of the box improved Iñtërnâtiônàlizætiøn a slightly more
+ extended character set, using utf-8, [ tested so far on LaTeX / pdf output,
+ line-breaking is not perfect ] ! # $ % & \ () * + , - . / ' 1 2 3 4 5 6 7
+ 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]
+ … † ‡ < - ~ t ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ' µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å
+ æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+
+ * character encoding, utf-8 improved basic table, not yet utilised though,
+ [and even as a small utf-8 table is on the large side]
+
+ * minor code play with output (webserve) path
+
+ * sqlite db output mapped to webserve path, current directory stub
+ [instead of being deposited in pwd]
+
+ * very naive sqlite search cgi example for sqlite
+
+ * metaverse, changes to automatic naming of levels 5 & 6
+ same methods used as has been for level 4, could possibly clash at times
+ with level 4 in doc version consider implications [easy to attach somthing
+ to level 5 & 6 names]
+
+ * document digest in document information by default
+ (previously only when cvs info also selected)
+
+ * loading of skins for inserts
+
+%% sisu_0.22.1.orig.tar.gz (2005w35/4 | 2005-09-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.22.1.orig.tar.gz
+ bd05b8766c923fefe62194ccfb851e40 3106333 sisu_0.22.1.orig.tar.gz
+ a3c3f1369d34c477db9422de98ed7306 8955 sisu_0.22.1-1.diff.gz
+
+ * metaverse, regex fix for bold line syntax (^!_)
+
+ * latex/pdf, placement of object numbers re-sorted,
+ an inelegant fix, revisit later.
+
+%% sisu_0.22.0.orig.tar.gz (2005w35/3 | 2005-08-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.22.0.orig.tar.gz
+ 7a9d78e29a2809767f5510ec8958155d 3105938 sisu_0.22.0.orig.tar.gz
+ 9b7babcf4278dc69a94ec7b9f00609e0 8936 sisu_0.22.0-1.diff.gz
+
+ * sysenv, option to check load path and only load module if available reduce
+ dependency on other packages, introduced for rmagick and now used also for
+ dbi.
+
+ * rmagick if installed can be used to calculate image dimensions, so these
+ need not be provided in markup.
+
+ * sql database operations only attempted if dbi is loaded(/available for
+ loading)
+
+ * texpdf, used parskip and removed use of smallskip from latex output
+ (& other minor edits)
+
+ * FSF address updated:
+ Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ [from: 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]
+
+%% sisu_0.21.2.orig.tar.gz (2005w34/7 | 2005-08-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.21.2.orig.tar.gz
+ b6deafd5e3627851a11b3865c7b54a36 3104604 sisu_0.21.2.orig.tar.gz
+ db780c3273a6a6dd3b488dc1ee70cf82 8882 sisu_0.21.2-1.diff.gz
+
+ * sisu-examples sisu_search.cgi sample correction
+
+%% sisu_0.21.1.orig.tar.gz (2005w34/7 | 2005-08-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.21.1.orig.tar.gz
+ df503b6de6a98cca07c010ead14c8083 3104417 sisu_0.21.1.orig.tar.gz
+ 4ce92696c4eb3c87434ea6c3984f3054 8870 sisu_0.21.1-1.diff.gz
+
+ * debian Sources.gz
+
+ * minor code edits
+
+%% sisu_0.21.0.orig.tar.gz (2005w34/7 | 2005-08-28) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.21.0.orig.tar.gz
+ 095879ae2f0784868b9506eb09012b41 3105687 sisu_0.21.0.orig.tar.gz
+ 5d0274cb2a1f0e88c22c78d03dd869da 8852 sisu_0.21.0-1.diff.gz
+
+ * changes to file structure for processing and provided images
+ now placed under the markup directory in _sisu
+ ./_sisu/processing [built by sisu] unless ./ is not writable
+ then /tmp/sisu_processing
+ ./_sisu/image [added to manually]
+ ./_sisu/config [precedence: ./_sisu/config ~/.sisu /etc/sisu]
+
+ * skin fix reading and precedence
+ [uses ./_sisu/config/skin ~/.sisu/skin /etc/sisu/skin
+ ./_sisu/processing/external_document/skin]
+
+ * external documents, provide similar logic
+ placed in ./_sisu/processing/external_document/{image,config}
+ this should mean that along external documents are downloaded
+ together with their skins and images and processed as a unit
+
+ * changed a couple of search path statements (skin,sisurc) to use blocks.
+
+ * sisu manpage updated to take account of changes (help not yet)
+
+%% sisu_0.20.9.orig.tar.gz (2005w34/5 | 2005-08-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.9.orig.tar.gz
+ 0f267a8fb912193b3714ea573ccaefea 3090429 sisu_0.20.9.orig.tar.gz
+ 8b46fe8954ebdfaa89c5ecb608771b6a 8832 sisu_0.20.9-1.diff.gz
+
+ * merged/rearranged (and renamed Postgresql and Sqlite classes).
+ Now SiSU_SQL (avoid possibility of namespace clashes).
+
+ * plaintext, xml (sax & dom), xhtml, run on a new file creates required
+ output sub-directory, it was relying on other selections for directory
+ creation [thought done previously] affects flags -a -x -X -b
+
+%% sisu_0.20.8.orig.tar.gz (2005w34/4 | 2005-08-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.8.orig.tar.gz
+ 2fee766bb3079d7f955dbeb8c7e1c9dd 3089931 sisu_0.20.8.orig.tar.gz
+ 6505b8ad8e6ccdc73676a61b25a466a2 8815 sisu_0.20.8-1.diff.gz
+
+ * minor database rationalisation,
+ postgresql & sqlite logic in same files
+ [additional testing required]
+
+%% sisu_0.20.7.orig.tar.gz (2005w34/3 | 2005-08-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.7.orig.tar.gz
+ 1fe53caf785a25d4a59ffb05e7c9c3aa 3098483 sisu_0.20.7.orig.tar.gz
+ 914f8a07adb73f761c42e4c914abd3b2 8799 sisu_0.20.7-1.diff.gz
+
+ * added metadata categories (to the Dublin Core 15) added the following metatags, which seemed appropriate/useful:
+ translator (or translated_by)
+ illustrator (or illustrated_by)
+ prepared_by
+ digitized_by
+ (added to parameters, metaverse, sql databases)
+
+ * note in man pages and help about sisu markup files being in
+ UNIX ASCII
+
+ * vim auto-conversion to UNIX ASCII for sisu markup files
+ (sisu parses unix ascii, not dos ascii ... consider further,
+ an issue for example with many(most/all?) Project Gutenberg texts)
+
+%% sisu_0.20.6.orig.tar.gz (2005w34/1 | 2005-08-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.6.orig.tar.gz
+ 8e50493f947b6c1e0ed77bb1fb4e8ede 3096291 sisu_0.20.6.orig.tar.gz
+ 0636fedf8a38e0cb62dbdf7c0ad9397f 8778 sisu_0.20.6-1.diff.gz
+
+ * (composite) fix for new header links where linbreak used
+ and imported into composite document, result in .t? suffix
+
+ * (sisu_search.cgi) sample search form, minor fixes &
+ improvements, still a mess
+
+%% sisu_0.20.5.orig.tar.gz (2005w33/5 | 2005-08-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.5.orig.tar.gz
+ 1df854fd95731c9272c89c62b06ce70a 3095741 sisu_0.20.5.orig.tar.gz
+ 31d98e13292c9ab21b77f77bd4e769df 8763 sisu_0.20.5-1.diff.gz
+
+ * fix for old style header links, (broken in 0.20.4 with
+ introduction of new)
+
+%% sisu_0.20.4.orig.tar.gz (2005w33/4 | 2005-08-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.4.orig.tar.gz
+ c65c974dbdef638014c578c8a06d4560 3095378 sisu_0.20.4.orig.tar.gz
+ bca68a13d322deee67a4e20730c55acb 8741 sisu_0.20.4-1.diff.gz
+
+ * (param) header links notation made similar to links within text
+ old markup syntax remains possible, (i.e. backward compatibility kept)
+ [should possibly force version number change to 0.21 but is minor change]
+
+ * small touch to sisu vim syntax file, remove false positive error
+ highlighting for alternative links markup
+
+ * touch to remove relevance of whitespace in image markup
+ (previously a problem in composite texts for latex/pdf output)
+
+ * (metaverse for html) touch, whitespace reintroduced where name is given to
+ an object as easy solution to interference that may otherwise arise with
+ urls
+
+ * html touch whitespace reintroduced where name is given to an object
+ as easy solution to interference that may otherwise arise with urls
+
+ * ruby-libyaml removed from debian control,
+ [a DD had informed me that he had neeeded it early in packaging days he
+ must have been working with a version of ruby older than sisu is written
+ for]
+
+%% sisu_0.20.3.orig.tar.gz (2005w32/7 | 2005-08-14) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.3.orig.tar.gz
+ 0a1b40b4c00ab6a7b4c9528b0664cba5 3094654 sisu_0.20.3.orig.tar.gz
+ aea0778abd99cd1f301d059fe83c81e4 8653 sisu_0.20.3-1.diff.gz
+
+ * fix sisu -CC removed attempt to create pg db
+ (this is done rather on -D createall request if does not exist)
+
+%% sisu_0.20.2.orig.tar.gz (2005w32/7 | 2005-08-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.2.orig.tar.gz
+ 56c7a77c9a78f12cd132e06234ded543 3094356 sisu_0.20.2.orig.tar.gz
+ 774b095fc376f4decde435fd6d32fbc2 8631 sisu_0.20.2-1.diff.gz
+
+ * sisu_vim manpage
+
+ * latex/pdf monospace font (ttfamily) where code{ }code is used
+
+ * html monospace font where code{ }code is used
+
+ * rescue and attempt to create pg db only if db of pg type requested
+
+ * a rule for stripping deleted text from clean text md5 digest introcued
+
+ * debian signing of package against ralph@amissah.com
+
+%% sisu_0.20.1.orig.tar.gz (2005w32/5 | 2005-08-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.1.orig.tar.gz
+ 1cdbe3739722c877af1095135a7a6f9e 3089912 sisu_0.20.1.orig.tar.gz
+ 90e8a6ac6a1c868d8f7138c8974b2611 8588 sisu_0.20.1-1.diff.gz
+
+ * console output XML clutter reduced,
+ REXML parsed headers now only produced for -V not -v
+
+ * debian package, started signing dsc and changes file
+ both email addresses ralph@amissah.com and ralph.amissah@gmail.com
+ on ring, singing ended up being done against latter,
+ the former being what debian knows me as, correct on next signing
+
+ Key fingerprint = F899 5A87 C648 3F38 5107 79F1 B97B 7C4D BD76 E77F
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.1 (GNU/Linux)
+
+mQGiBEL8fs4RBADNNhIsG6i13rDL4JLTgqy0fzcx8oJ9E/xDKeQo/5pqs18FvyKo
+VsHdkUrPptZgxowalPi2aWvZgdi56yUFt295pNedMNXfTnwkVF/9PSA3r4OTBFWw
+7NJYRUu2ZaSqtj3LpnBhsPpDqcl2g5Mry88mMLUeWB9OtsZE/QFVnoJqawCg4QSY
+IOtgdxZVJfibHbFA0/2iG3cD/A98l/BuRWF+kwNacj1q+D0glC/u9mvg56fnAzTL
+Osbhza/ebqvPgtFpP4PlIuvTcRZ9QsSJgmCTxNRPSKWPGqDmj7B7MDcPKUyJAPKB
+fSLm5v5BuKTCLl9jyihbOqIdTgF1hoBHxTyfYWpVVuhdFP1kahityDNGpRhSfTif
+doDLBACkB090RwyYBR589CMjF4miOo5m29ooQZO3tkR+6w5ny81H+qIHVx3TQZa9
+d2166YcxMOFLh2mXBcVNsF8gQpv8Otk+Oyu5FFKqJiGV6JkEPf/W+iXMdpvTrxtc
+rmU8cKagKxxBjue8PlI6bGusEjJXgmsTwOZB5WxCW4QQs49VoLQhUmFscGggQW1p
+c3NhaCA8cmFscGhAYW1pc3NhaC5jb20+iGQEExECACQFAkL8fs4CGwMFCQPCZwAG
+CwkIBwMCAxUCAwMWAgECHgECF4AACgkQuXt8Tb1253+R+gCg3KfzSGEmdWf01ryr
+QLm35LutXS8AoNVfXb3OB1BMph6bOSNJpIyZAOgstCdSYWxwaCBBbWlzc2FoIDxy
+YWxwaC5hbWlzc2FoQGdtYWlsLmNvbT6IZAQTEQIAJAUCQvyEaAIbAwUJA8JnAAYL
+CQgHAwIDFQIDAxYCAQIeAQIXgAAKCRC5e3xNvXbnf12SAJ44Tuntdnqv7lAGgRes
+KMFbHSt3YgCgjXkkHqY167kvDWmxrdAfupv7Ad65Ag0EQvx+2RAIAL23ShZnJJi/
+1un84eoUoQ/AaXmGAhYjVlYiJzMjTXBygS12TnpNkqibnnIqbn/6v1WFIgZNRhzS
+GzKo//MYtORdhB25UYe0YeOhZhyABLNSFKCye1ACBfDpJAFzc+kh7GjA1k2hnDsn
+zox49eJyubO1FxiXXYrKaSMOGkuhp/JaLEVHZZyY++Zq0TuS8t3bOmNkUbL5X5oZ
+n600yZzNfdQ8/5LjwIUvY9BDR+tHyypGyegDDmS5BVEjmW2d9ujDbVYRY6twA0q6
+6WSx2WqT/HzdvSirEiPp3ENwQAaTnGT0G5q2zmYtutb9Yd/V/5aQBMEkAXF/JT4H
+uw5ad3C6xNcAAwUH/jmC7wmvfA6Dqh9TfqDux9LzWbIny0NsgYTsE2Bkhg8kuHgb
+PeqpOeJRFYxQkhknzW1PZZVwtxmfFgWgvukW4fqGSPWSpWDaYL91zkx2HRMBG1Nb
+YwqNOLQnolRE9z/42b/M4oyIWhd0WTi6tZt5pMvpW5Dn7tOsnU3PlNM3AAv3Bjp9
+QBki1KRjZC7PdKnQa9KSwvr4hgvvBlT4Is9131vmAZhu41Ni8UORmoq5e/lqd5O/
+0QuySo+ZJEyLQuulfK19NPALZM+fu6/3dUHAu4D27MafYdQNqY3Xks4mquQ2p95k
+OhNer8Yu7SSyBCIO/8V71UhkgyUdG7fMl0BzqPmITwQYEQIADwUCQvx+2QIbDAUJ
+A8JnAAAKCRC5e3xNvXbnfzpwAJ0ZKPoWuWrx8K/zGSIRRj7ZRbf6KgCgji13BXoF
+tJaIUHauen7hNIoUQXo=
+=6US6
+-----END PGP PUBLIC KEY BLOCK-----
+
+%% sisu_0.20.0.orig.tar.gz (2005w32/4 | 2005-08-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.0.orig.tar.gz
+ 0c0c5ef53a3dd85fcaf5912a971c3b26 3089497 sisu_0.20.0.orig.tar.gz
+ 741731b3d842820cb2b427fdf1197e4a 8517 sisu_0.20.0-1.diff.gz
+ 0b1ea809280f45b293cb5a9ea9453b49 8551 sisu_0.20.0-2.diff.gz
+
+ * remap sisu psql database names to SiSU_[directory name stub]
+ instead of just [directory name stub] as this will make name collisions
+ (and accidents) with other databases, when using SiSU to creating, deleting
+ and recreating databases much less likely happening to other databases far
+ less likely. [renaming means databases need rebuilding for use]
+
+ * (psql) have made postgresql >=8.0 the default requirement. An issue
+ showed up with sisu & postgresql 7 series and UNICODE sequences used, as
+ sisu as released is fairly new there is little incentive to maintain it
+ [however, problem would seem to indicate a lot of bug testing is required,
+ i am currently using UTF-8 locale (en_GB.UTF-8)]
+ [corrected to postgresql >=8.0.0; but is currently named posgreql-8.0]
+
+ * cgi script example updated to match SiSU_[directory name stub] convention
+ and to default to search of sisu-examples as this is a standard/common
+ directory anyone might generate (or rather ./document_samples_sisu_markup)
+
+%% sisu_0.18.8.orig.tar.gz (2005w32/3 | 2005-08-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.8.orig.tar.gz
+ aa7e128202d4e60dfa9b328888406a3d 3087797 sisu_0.18.8.orig.tar.gz
+ 262edbc6bcd7b29cf70d8f3b0fd1a9cf 8404 sisu_0.18.8-1.diff.gz
+
+ * (webrick url) console display of output text default to webrick url
+ (can be switched off in sisurc.yaml, by setting
+ webserve,webrick_url: false)
+ however this assumes people know to start sisu_webrick
+ (it is a toss-up between advertising webrick's availability,
+ and sticking with filesystem paths as default, may have
+ to revert) have thought of tying webrick url output to
+ starting sisu_webrick automatically, would need to look at
+ log files and get logging off the console, else would disturb
+ other sisu console output
+ [a problem appears to be that in some browsers old cached pdf
+ is served when requested, so changes made in subsequent document
+ generation may not be displayed, consider implications]
+
+ * sisu_webrick port sysenv default set back to 8081
+ (instead of 8111, consider 8123)
+
+ * use createdb to attempt to create relevant pgsql database
+ (using stub of directory name; uses a system command and assumes user has
+ permission to create db, if user does not, and the database does not exist,
+ would not be able to proceed anyway)
+
+ * inelegant handling of "" image bug (no image) that appears
+ in a test document.
+
+ * a few urls shortend back to http://www.jus.uio.no/sisu
+ from http://www.jus.uio.no/sisu/SiSU in defaults
+
+ * minor touch to man page and help
+
+%% sisu_0.18.7.orig.tar.gz (2005w32/2 | 2005-08-09) [Debian Release snapshot, uploaded by Joachim Breitner]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.7.orig.tar.gz
+ ace9eb421e31f7d3f1d12ba29b00baaf 3086170 sisu_0.18.7.orig.tar.gz
+ 3530196ebba2260a60bfe885ee536731 8393 sisu_0.18.7-1.diff.gz
+
+ * some license clean up, gpl2 or later (appearing in pdf text output),
+ removed sentences referring to alternative, somehow missed in previous
+ grand cleanup sisu_0.16.24 where all document headers were cleaned, and the
+ rest i thought [apologies 0.18.7 was rebuilt to include this change, they
+ occurred in the file defaults.rb and texpdf_format.rb].
+
+ * fix -N md5 digests batch mode, garbage cleaning
+
+ * fix -N remote placement (revisit remote placement)
+
+ * sequence digests if requested follow on directly after metaverse -mN...
+
+ * html and latex/pdf so far, continue tradition of assuming that a comma (,)
+ or full stop (.) following a url is part of a sentence, i.e. if a url
+ actually is terminated by a comma or a dot are not parsed correctly, is
+ extremely convenient, consider implications though, may need to change.
+ {~^ this ends the sentence }http://www.url. (this would also {~^ end the
+ sentence. }http://www.url and as before the comma and stop attached to
+ these urls are part of the sentences punctuation http://www.url,
+ http://www.url.)
+
+%% sisu_0.18.6.orig.tar.gz (2005w32/1 | 2005-08-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.6.orig.tar.gz
+ 0687159545781ee1caeb802fd6da9ecf 3085058 sisu_0.18.6.orig.tar.gz
+ 096c5f256ecc1b38642186822c55f137 8377 sisu_0.18.6-1.diff.gz
+
+ * fixed metadata (metaverse) sourcefilename (where rc not used)
+
+ * fixed digest tree where image not found
+
+ * defaults for shortcut flags (-1v -3v etc.) set to
+ create the digest tree (-N)
+ and to include filetype suffix (-H) as this works with webrick
+ (sisu_webrick)
+
+ * jpg image support consistently added (to existing png & jpg) gif
+ consistently removed as on cursory glance does not appear to be
+ supported by tetex, trivial to add later
+
+ man page and help mention of verbose screen output of digest tree
+
+%% sisu_0.18.5.orig.tar.gz (2005w31/6 | 2005-08-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.5.orig.tar.gz
+ e41ba898a4514b8f951015df3a30e3e2 3084020 sisu_0.18.5.orig.tar.gz
+ 4120df15adf03f14bb58d7fba068c27c 8359 sisu_0.18.5-1.diff.gz
+
+ * bugfix output paths, may change again, currently the default
+ if writable is /var/www/sisu (and if no ~/sisu_www)
+ (in previous version wrote to /var/sisu/www/sisu if writable
+ too idiosyncratic a solution)
+
+ * bugfix image markup where url not used
+ {imagename.png}image working for html and pdf again
+ {imagename.png}image fix also for pdf
+
+%% sisu_0.18.4.orig.tar.gz (2005w30/2 | 2005-07-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.4.orig.tar.gz
+ 9ee3ba3a68640e060a92beb1ffd4351a 3081850 sisu_0.18.4.orig.tar.gz
+ 3fabff77f7a9db7e8c47ffa6d01c5bc0 8344 sisu_0.18.4-1.diff.gz
+
+ * detailed document md5 digest output as digest.txt generated with -N flag
+ [decide whether to:
+ keep multiple document digest versions; and
+ whether to link to html or databse
+ (at some stage add digest names to html generated)]
+
+ * added -N flag (document digests) to man pages and help
+
+ * replaced uses of include? with plain regex (some vague recollection of
+ rumours of depreciation in future ruby)... no rush, perhaps should have
+ waited
+
+ * (re)moved use of -o flag from old table based html
+
+%% sisu_0.18.3.orig.tar.gz (2005w30/2 | 2005-07-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.3.orig.tar.gz
+ 76b9a55723151f7dd08437fb9a604813 3079656 sisu_0.18.3.orig.tar.gz
+ d6ce0c7986a47436843d3a36ba000822 8322 sisu_0.18.3-1.diff.gz
+
+ * digests on clean text, rule... revisit, but body and endnotes treated "same"
+
+ * tmp fix for special image characters, (e.g. Euro and Copyleft) tmp because
+ image is taken from local directory images where ought to be taken from
+ general image set, revisit.
+
+%% sisu_0.18.2.orig.tar.gz (2005w30/1 | 2005-07-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.2.orig.tar.gz
+ cbb34fcf021158193c6e6f366ae9e645 3077824 sisu_0.18.2.orig.tar.gz
+ 35ac35ae6872d923c3704c45aae867f4 8306 sisu_0.18.2-1.diff.gz
+
+ * document meta_data, version information re-organization
+
+ * texinfo cursory look, initial 0.18 fix
+
+ * db pg/sqlite md5_all fix for level 4
+
+ * dbi_unicode unused, and removed, (common_db used)
+
+%% sisu_0.18.1.orig.tar.gz (2005w29/0 | 2005-07-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.1.orig.tar.gz
+ 030ba198b242541bd261ec5fb0776b0a 3086052 sisu_0.18.1.orig.tar.gz
+ 6cd8c2b571c485edbe77946fe7245a14 8301 sisu_0.18.1-1.diff.gz
+
+ * latex/pdf, tmp bugfix, substitute & with 'and' in toc,
+ needed e.g. for AT&T, see ffa, REVISIT
+
+ * a bit of play with texinfo module, but (still) broken
+ (in 0.18) until tested
+
+ * some writing in man pages
+
+%% sisu_0.18.0.orig.tar.gz (2005w29/5 | 2005-07-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.0.orig.tar.gz
+ ff45f2bca98b6e8fbae0714684576571 3086151 sisu_0.18.0.orig.tar.gz
+ 9f0cf2ca1b6e02aea52f9dd22e51c32d 8268 sisu_0.18.0-1.diff.gz
+
+ Development branch 0.17 (opened 2005-07-14)
+ rolled back into main as 0.18:
+
+ sisu_0.17.5.orig.tar.gz (2005w29/5 | 2005-07-22)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.5.orig.tar.gz
+ 23e3b01175d55e815933881fcfe415c5 3085611 sisu_0.17.5.orig.tar.gz
+ 41e800763be26bb37a8f1901a05bff08 8570 sisu_0.17.5-1.diff.gz
+
+ * plaintext linebreaks in endnotes <br />
+
+ * xml series, branch-fix todo with tables (common_xml)
+
+ * html endnote section branch-fix
+
+ sisu_0.17.4.orig.tar.gz (2005w29/4 | 2005-07-21)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.4.orig.tar.gz
+ 23bef7ae21ac0b65cb7b27c049f3ea15 3085478 sisu_0.17.4.orig.tar.gz
+ 6542bc3d7f65440f02834de6141e74dd 8553 sisu_0.17.4-1.diff.gz
+
+ * url maintenance mode, minor fix
+
+ * small fixes to latex pdf mostly todo with & character
+
+ sisu_0.17.3.orig.tar.gz (2005w29/3 | 2005-07-20)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.3.orig.tar.gz
+ 086b054dba3ee8837406157c74062252 3084736 sisu_0.17.3.orig.tar.gz
+ 3029bdb8375586b57cec9997578d8f98 8535 sisu_0.17.3-1.diff.gz
+
+ * md5 into postgresql and sqlite modules, (including endnotes clean md5
+ digest)
+
+ * Implemented, but need to be consistent about content of paragraphs on which
+ md5 digest is made:
+
+ 1. clean/stripped text without any markup, paragraph, headings etc. without
+ endnotes
+
+ 2. endnotes clean/stripped text digest only (there may be several endnotes
+ within a paragraph)
+
+ 3. whole object, text with markup and any endnotes, (question: with or
+ without the endnote digests??? presumption better without, [however may be
+ easier to check with?])
+
+ * some renaming in db modules
+
+ [deleted accidentally and rebuilt]
+
+ sisu_0.17.2.orig.tar.gz (2005w28/5 | 2005-07-15)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.2.orig.tar.gz
+ dab5f72a55e525e3f2bac4053db57c6a 3083022 sisu_0.17.2.orig.tar.gz
+ 4fad5f499da1d26d89070ce1cb26ad8d 8512 sisu_0.17.2-1.diff.gz
+
+ * change in metaverse representation of md5 hashes
+
+ * cleaning up of output after introduction of md5 digests
+
+ sisu_0.17.1.orig.tar.gz (2005w28/5 | 2005-07-15)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.1.orig.tar.gz
+ ed3301693f3a86535b6d7c1595c1afdf 3082665 sisu_0.17.1.orig.tar.gz
+ a3bf9b7198544ae341e0c4b397b185fd 8467 sisu_0.17.1-1.diff.gz
+
+ * arrangement of md5s
+
+ sisu_0.17.1.orig.tar.gz (2005w28/5 | 2005-07-15)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.1.orig.tar.gz
+ *** sisu_0.17.1.orig.tar.gz
+ *** sisu_0.17.1-1.diff.gz
+
+ * todo with use of dev branch and being 0.17 rather than 0.16
+
+ sisu_0.17.0.orig.tar.gz (2005w28/4 | 2005-07-14)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.0.orig.tar.gz
+ MD5(sisu_0.17.0.orig.tar.gz)= 46d56d54e6040170cbaad77f6764e2ca
+
+ * incorporated two md5 digests for each object, available for use
+ downstream as desired
+
+%% sisu_0.16.26.orig.tar.gz (2005w28/6 | 2005-07-16)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.26.orig.tar.gz
+ *** sisu_0.16.26.orig.tar.gz
+ *** sisu_0.16.26-1.diff.gz
+
+* LaTeX output remove individual /parindent placed in header
+
+%% sisu_0.16.25.orig.tar.gz (2005w28/6 | 2005-07-16) [First Debian Release, uploaded by Gunnar Wolf]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.25.orig.tar.gz
+ *** sisu_0.16.25.orig.tar.gz
+ *** sisu_0.16.25-1.diff.gz
+
+ * sisu-examples, Free as in Freedom ... minor touch,
+ previous markup broken, will check later
+
+%% sisu_0.16.24.orig.tar.gz (2005w28/2 | 2005-07-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.24.orig.tar.gz
+ 2072677c897ffa9c677b2b4760003396 3081483 sisu_0.16.24.orig.tar.gz
+ 2879560a1af4f0dc27670f519cf5bd94 8211 sisu_0.16.24-1.diff.gz
+
+ * copyright string made more clear as 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005 ... only question being whether it should not have been
+ 1996.
+
+%% sisu_0.16.23.orig.tar.gz (2005w28/2 | 2005-07-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.23.orig.tar.gz
+ db0052818b106e0d4c47d8039bdb8497 3081204 sisu_0.16.23.orig.tar.gz
+ f77bab59f3eb7db8ae249411f1685292 8114 sisu_0.16.23-1.diff.gz
+
+ * copyright headers changed within files for Debian
+
+ * some changes in use of ocn for segment naming in html output
+
+ * a couple of postgresql fileds changed to text
+
+ * using Rant 4.0 for package build and install(er)
+
+ * cosmetic rearrangement of code
+
+%% sisu_0.16.22.orig.tar.gz (2005w27/4 | 2005-07-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.22.orig.tar.gz
+ 4c290986eb68607420a602c3fae4baaf 3087090 sisu_0.16.22.orig.tar.gz
+ c925bddaee01bb7b5d5a2c241f3f75e0 8089 sisu_0.16.22-1.diff.gz
+
+ * metaverse fix for alternative endnote markup marker
+ at end of line~^
+
+ * texpdf fix for images, (where dimensions not
+ provided) not final, may need to pass through
+ imagemagick at metaverse stage
+
+ * fix to cgi sample sisu_search.cgi
+
+%% sisu_0.16.21.orig.tar.gz (2005w26/0 | 2005-07-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.21.orig.tar.gz
+ 9c4a29a357d1b988a351d2f035f8f8ea 3086501 sisu_0.16.21.orig.tar.gz
+ c80c80a6a90ea037267c127796a0fde5 7956 sisu_0.16.21-1.diff.gz
+
+ * small bugfix (param screen print)
+
+%% sisu_0.16.20.orig.tar.gz (2005w26/0 | 2005-07-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.20.orig.tar.gz
+ df663db73934d980ba484d69a2efc361 3086090 sisu_0.16.20.orig.tar.gz
+ 1aee087cb250a1fbd760ceb53fbc8c2b 7927 sisu_0.16.20-1.diff.gz
+
+ * separated out sisu vim files (syntax & folds)
+
+ * touch to syntax highlighting
+
+%% sisu_0.16.19.orig.tar.gz (2005w26/5 | 2005-07-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.19.orig.tar.gz
+ bf5a17871dfa7f1322bdaa774d24e4bb 3105899 sisu_0.16.19.orig.tar.gz
+ be224695722d529a481beaadecd695d3 7860 sisu_0.16.19-1.diff.gz
+
+ * small touches to vim syntax highlighting.
+
+%% sisu_0.16.18.orig.tar.gz (2005w26/5 | 2005-07-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.18.orig.tar.gz
+ 0d6bc75f1c631a423941bd20b8cb8ea0 3105726 sisu_0.16.18.orig.tar.gz
+ 2265f2449b63b2ba9af39e61a09198c9 7846 sisu_0.16.18-1.diff.gz
+
+ * some fixes to syntax highlighing: - changes to markup syntax introduced in
+ 0.16 release broke parts of syntax highlighter, more no doubt to follow.
+
+%% sisu_0.16.17.orig.tar.gz (2005w26/4 | 2005-06-30)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.17.orig.tar.gz
+ 410f1c01c261e2cf2bb25ff782b4c0b8 3105488 sisu_0.16.17.orig.tar.gz
+ 649cbe59bf940d93a74cdac46e59123c 7774 sisu_0.16.17-1.diff.gz
+
+ * separated color file out from ftplugin ... called dusk (or slate) by
+ me for several years i now call it sisu... perhaps i should stick
+ with slate as it is pretty appropriate... hmmm, slate
+
+%% sisu_0.16.16.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.16.orig.tar.gz
+ f5ce8002e6876feba22c276d4e49d3f5 3105731 sisu_0.16.16.orig.tar.gz
+ 251af2096015e193888a429cd69a328d 7576 sisu_0.16.16-1.diff.gz
+
+ * small touches to offer vim config files working the way i am used to
+ with Debian install... needs testing by someone with different
+ habits though.
+
+%% sisu_0.16.15.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.15.orig.tar.gz
+ 4de2570843cacd2c665fa8204eaab750 3105521 sisu_0.16.15.orig.tar.gz
+ c650a78d6b079db9c021a608236a920e 7494 sisu_0.16.15-1.diff.gz
+
+* separated vim syntax and ftplugin directory...
+ have still got color file in ftplugin/sisu.vim file
+ which is not acceptable
+
+%% sisu_0.16.14.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.14.orig.tar.gz
+ 18e0cfcac265ecb03e9af5f958aad0f7 3105239 sisu_0.16.14.orig.tar.gz
+ 493c64b453dc43ff36565aacacbc0b8c 7441 sisu_0.16.14-1.diff.gz
+
+ * sisu vim ftplugin ... for folds, syntax, colors, markup
+ auto installed in debian,
+ (but uses shared filetype in /usr/share/vim/addons
+ check how that is supposed to work)
+ else (non-debian install)
+ Rantfile places in /usr/share/sisu-examples/config/vim
+
+%% sisu_0.16.13.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.13.orig.tar.gz
+ 775c33a1e6f0140f5552cb3f2784b00a 3124785 sisu_0.16.13.orig.tar.gz
+ 04242b7e8fec91a0b4f69bd 7328 sisu_0.16.13-1.diff.gz
+
+ * debian setup of vim syntax ok... however much vim setup still to automate,
+ immediately noticeable: folds for sisu not sorted; and permitting cursor
+ movement up and down without following long lines with screen wrap; (and no
+ clever way yet to contribute colors other than through sisu-examples, but
+ they being user preference should be contributed with care).
+
+ * on_markup.txt quick check & minor update
+
+%% sisu_0.16.12.orig.tar.gz (2005w26/1 | 2005-06-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.12.orig.tar.gz
+ 5bdff14e999ea933abdb3f3bfbbc0dcb 3119368 sisu_0.16.12.orig.tar.gz
+ 5a9f5898165c74e60b6292b6e777beba 7105 sisu_0.16.12-1.diff.gz
+
+ * home page index.html creation, path precedence set:
+ ~/.sisu/skin/doc
+ /etc/sisu/skin/doc
+ defaults
+ and content is interchangeable (so future latent break
+ is less likely)
+
+ * touch to Rantfile.
+
+%% sisu_0.16.11.orig.tar.gz (2005w26/1 | 2005-06-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.11.orig.tar.gz
+ b14414943ca84f66cde1f646da7a2329 3118990 sisu_0.16.11.orig.tar.gz
+ 742089f905479231a32fb6b4fc62824f 7024 sisu_0.16.11-1.diff.gz
+
+ * bugfix a default variable, in defaults version should be @ver
+ introduced by cuts and pastes between different files,
+ with recent default home page updates; make less likely to
+ happen in future, for now quick fix, revisit:
+ currently index.html taken from
+ ~/.sisu/skin/doc if it exists else defaults,
+ /etc/sisu/skin/doc is ignored, breaking expected
+ search precedence
+
+%% sisu_0.16.10.orig.tar.gz (2005w25/0 | 2005-06-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.10.orig.tar.gz
+ 73a4f8c6ffedbee7f1a9571b5f9c25da 3118710 sisu_0.16.10.orig.tar.gz
+ d6307e6e6f42f795d31d6516f6ef48ec 6919 sisu_0.16.10-1.diff.gz
+
+ * small edits to man pages and help
+ NB have taken out reference to alternative markup possibilities
+ e.g. b{ for bold }b being available as well as
+ *{ bold text }* (as the letter the and html equivalents are
+ depreciated, having or using alternative markup styles is
+ less tidy)
+
+%% sisu_0.16.9.orig.tar.gz (2005w25/0 | 2005-06-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.9.orig.tar.gz
+ 28615d4dcdc00d8342d2d88273f2f5a1 3118488 sisu_0.16.9.orig.tar.gz
+ 00142e23bfd377bc4e1a9d7be287d108 6775 sisu_0.16.9-1.diff.gz
+
+ * cleaning up of man pages, largely for html presentation
+ generated by rman
+
+%% sisu_0.16.8.orig.tar.gz (2005w25/6 | 2005-06-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.8.orig.tar.gz
+ d050e1532def2b862843ac653010c97e 3117054 sisu_0.16.8.orig.tar.gz
+ 89fb5d9a06748d1c12da98d7b947e0c9 6696 sisu_0.16.8-1.diff.gz
+
+ * minor edits
+
+%% sisu_0.16.7.orig.tar.gz (2005w25/6 | 2005-06-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.7.orig.tar.gz
+ c0afd925e862a2d149f642af6e02f231 3116725 sisu_0.16.7.orig.tar.gz
+ 28093c9d63cb5cbdd4bbc9d5cca16020 6678 sisu_0.16.7-1.diff.gz
+
+ * added the man pages in html (converted to html using rman)
+ http://polyglotman.sourceforge.net/rman.html
+
+ * related rather cosmetic changes
+
+%% sisu_0.16.6.orig.tar.gz (2005w25/6 | 2005-06-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.6.orig.tar.gz
+ 23e4aecd915e86191c8e4622cae787bb 3100364 sisu_0.16.6.orig.tar.gz
+ cf7b0f29ecaba525d0c4f875ee8ba01f 6632 sisu_0.16.6-1.diff.gz
+
+ * vim folds for sisu markup files updated
+ command is :F (ruby folds :R)
+ assuming the file is in place and in use
+
+%% sisu_0.16.5.orig.tar.gz (2005w25/5 | 2005-06-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.5.orig.tar.gz
+ 7e7ad7b08a1e6177f6333f699a23b4bb 3099726 sisu_0.16.5.orig.tar.gz
+ 8796ef31f655d9f074af00c352492653 6599 sisu_0.16.5-1.diff.gz
+
+ * some cleaning of wordmap output, regex exclusions added, not elegant
+ (special issue pages include sha and md5 output, also excluded)
+
+ * [released 0.16.6:] vim folds for sisu markup files updated
+ command is :F (ruby folds :R)
+ assuming the file is in place and in use
+
+ * comments, url locations of samples, output, etc. added to markup syntax
+ files (in addition to SiSU home which was already there)
+
+ * removed from tarball markup samples eu contract law principles
+ can be found at http://www.jus.uio.no/sisu/sample
+
+%% sisu_0.16.4.orig.tar.gz (2005w25/4 | 2005-06-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.4.orig.tar.gz
+ 899e08a81adf3544079e61f058c76388 3125518 sisu_0.16.4.orig.tar.gz
+ 2b70dde1fa067b1b03729be4c1688e2e 6379 sisu_0.16.4-1.diff.gz
+
+ * man 8 sisu post installation instructions looked at
+
+ * an image path adjusted
+
+%% sisu_0.16.3.orig.tar.gz (2005w25/4 | 2005-06-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.3.orig.tar.gz
+ 7dc657a1299e3ff831c932eb3975293f 3124710 sisu_0.16.3.orig.tar.gz
+ 93210116080bed4f22356e8ac1bba570 6324 sisu_0.16.3-1.diff.gz
+
+ * tables fixed, much latent breakage sorted
+ html segments fixed (scroll was ok)
+ xml sax and dom sorted
+ xml css naive but done
+ latex/pdf done
+
+%% sisu_0.16.2.orig.tar.gz (2005w25/3 | 2005-06-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.2.orig.tar.gz
+ c3306db32d485d515a4464766d3b81c8 3124314 sisu_0.16.2.orig.tar.gz
+ e82cc99b1a8a62cb1d590aa3dc65a4eb 6227 sisu_0.16.2-1.diff.gz
+
+ * conditional heading reinstated /^[12]~\?\s/
+ (may be used when it is expected that a document may be
+ imported into another, and the controlling documents level
+ 1 and/or 2 headings should be used instead (take precedence))
+
+ * rant install options, force specification of root if wish to
+ proceed as root, (previously was default on ok or continue)
+
+%% sisu_0.16.1.orig.tar.gz (2005w25/3 | 2005-06-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.1.orig.tar.gz
+ ad0220d5d7097833f404f3ffa1301525 3123961 sisu_0.16.1.orig.tar.gz
+ a7f0bf6bd77746a57f6724d3922bbf2c 6039 sisu_0.16.1-1.diff.gz
+
+ * touches to documentation, markup related
+
+ * markup syntax table is out of date, reference to it removed
+ replaced by suggestion you see online markup sample directory
+ http://www.jus.uio.no/sisu/sample
+
+ * fix, one sample document was overlooked in last package
+ (autonomy_markup2)
+
+%% sisu_0.16.0.orig.tar.gz (2005w25/2 | 2005-06-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.0.orig.tar.gz
+ d6ddb880cf0958893665ca0f0609acea 3123554 sisu_0.16.0.orig.tar.gz
+ 329d30ee875d4d2be75f981a9a875457 5830 sisu_0.16.0-1.diff.gz
+
+% WARNING Syntax Changes in 0.16 break previous markup
+% WARNING Despite Move to Stable Further Testing is Required
+
+ Syntax Cleaning - reduction in characters used
+ and the removal of several uses of unclosed curly brackets
+
+% Vim Regex Substitution Summary of Markup Syntax Changes:
+ :%s/\([0-6]\){\~\?/\1\~/c
+ :%s/ #\~\(\S\+\)/\*\~\1/c
+ :%s/^#{\~\?\s*/% /c
+ :%s/^r{ /<< /c
+ :%s/\~e/\~^/c
+ :%s/[-~]{{ /^\~ /c
+
+% sisu_0.15.0.orig.tar.gz (2005w24/0 | 2005-06-19)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.0.orig.tar.gz
+ MD5(sisu_0.15.0.orig.tar.gz)= a367efb13c3dbd2757e4ba968d61a8b2
+
+ * Syntax Changes, WARNING breaks old syntax,
+ a theme is the reduction of characters,
+ and the removal of most unclosed curly braces where used previously
+
+ * to mark headers and heading levels:
+ [0-6]~ replaces [0-6]\{ and [0-6]\{~ [at the start of a line]
+ header and headings marked by digit tilde at the start of the line
+ tilde replacing unclosed curly brace occurring after digit at
+ beginning of line
+ vim:
+ :%s/\([0-6]\){\~\?/\1\~/c
+ * to provide html name tag within text:
+ *~name replaces #~name
+ vim:
+ :%s/ #\~\(\S\+\)/\*\~\1/c
+ * a comment:
+ % replacing #{ [at the start of a line]
+ ^%% fold set in vim for such comment marker
+ vim:
+ :%s/^#{ /% /c
+ * require external document fold marker
+ << replacing r{
+ vim:
+ :%s/^r{ /<< /c
+
+ header and headings change is fairly major as affects most code
+ worth the break, i think so, given goal of simplicity and minimalism
+ however, syntax higlighting becomes even more crucial
+ as becomes more difficult to spot headings otherwise
+
+% sisu_0.15.1.orig.tar.gz (2005w25/1 | 2005-06-20)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.1.orig.tar.gz
+ MD5(sisu_0.15.1.orig.tar.gz)= d00ff37b438fe38732d887d8555dddb5
+
+ * Syntax Changes, WARNING breaks old syntax,
+
+ * endnotes where not embedded within text,
+ i.e. endnote following paragraph with endnote marker
+ ~^ replaces ~e as marker within text
+ ^~ for endnote content instead of -{{ or ~{{ [at the start of a line]
+ {~^ shortcut for making link with url as endnote }http://url
+ instead of {~e previous shortcut}http://url
+ vim:
+ :%s/\~e/\~^/c
+ :%s/[-~]{{ /^\~ /c
+
+% sisu_0.15.2.orig.tar.gz (2005w25/1 | 2005-06-20)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.2.orig.tar.gz
+ MD5(sisu_0.15.2.orig.tar.gz)= c28a58664d9a5f1726ed4c5f875e8f12
+
+ * bugfix for composite documents, place newline
+ and mark end of import
+ (bug also in current stable 0.14.6)
+
+ * bugfix for [html] endnotes introduced (in param)
+ in development branch
+
+ * number paragraph in given heading sequence
+ while escaping from being a heading 5~- 6~-
+
+ * filenames for termsheet and standard_form
+ sisu -t
+
+ * fix webrick port settings sysenv
+
+ * html subtoc touch required
+
+ * help files updated on syntax changes
+
+ * document markup samples updated
+
+ * vim syntax files updated
+
+ * extensive testing required
+
+%% Syntax Changes in 0.16 break previous markup
+
+%% sisu_0.14.6.orig.tar.gz (2005w24/6 | 2005-06-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.6.orig.tar.gz
+ 6c027f44470c313eaae1569a5df8cfb7 3121245 sisu_0.14.6.orig.tar.gz
+ 069eafa4261ffc542172a4fc84d5fa44 4723 sisu_0.14.6-1.diff.gz
+
+ * texpdf removed whitespace around \\href{[url]} in a few locations
+ (latexpdf appears possibly to have problem in passing url to browser
+ including whitespaces before and after url)
+
+ * in all source code headers took out development branch reference,
+ leave it to the download page to keep other urls updated
+ author field Ralph Amissah, (instead of similar email address)
+ propagated alternative name 'Serialized Information, Structured Units'
+ (used earlier but not consistently)
+
+ * skin headers likewise looked at and modified
+
+ * touch to default index.html (in defaults and associated skin)
+
+ * (touch to sisu-examples description in debian control file)
+
+%% sisu_0.14.5.orig.tar.gz (2005w24/6 | 2005-06-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.5.orig.tar.gz
+ 1d86c68c0e44f835aeeb2d9b89502f1d 3120463 sisu_0.14.5.orig.tar.gz
+ c3589fc3343d0503e452b846d778f9d3 4412 sisu_0.14.5-1.diff.gz
+
+ * debian build sisu suggests sisu-examples
+
+ * added reference to abandoned U.S. provisional patent application
+
+%% sisu_0.14.4.orig.tar.gz (2005w24/5 | 2005-06-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.4.orig.tar.gz
+ 15ea5387b4cd88717c12c4d1a583d99d 3119833 sisu_0.14.4.orig.tar.gz
+ 10961f292abd7ad47b6c072aad6f525e 4339 sisu_0.14.4-1.diff.gz
+
+ * removed copyright mark from 0{~prefix
+ is distinct from 0{~rights which is related to copyright
+
+ * texpdf - pass author through "special character" filter
+
+ * bug fix for minor numbering using # mark, and re-calibrating
+ removed an extraneous tilde (~)
+
+%% sisu_0.14.3.orig.tar.gz (2005w24/3 | 2005-06-15)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.3.orig.tar.gz
+ 7324ba16cdf644bb560a99 3119435 sisu_0.14.3.orig.tar.gz
+ 3988a9ad582121b1972a 4190 sisu_0.14.3-1.diff.gz
+
+ * removed files cgi.rb and cgi_supplies.rb as unused.
+
+%% sisu_0.14.2.orig.tar.gz (2005w24/2 | 2005-06-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.2.orig.tar.gz
+ 90ab342311461a0c7b752df78e43d3b5 3121884 sisu_0.14.2.orig.tar.gz
+ 257f8716e88e0a29aa6853d73520821d 3414 sisu_0.14.2-1.diff.gz
+
+ * -g option taken out, unused and forgotten
+ -h and -H currently do what -g used to by default
+ (will revisit)
+
+%% sisu_0.14.1.orig.tar.gz (2005w23/2 | 2005-06-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.1.orig.tar.gz
+ 3c1ea0dfcf670316bd2ce49f0a4d65f8 3121529 sisu_0.14.1.orig.tar.gz
+ b87620429c979c9a85f3cf39911d9347 3463 sisu_0.14.1-1.diff.gz
+
+ * documentation related, but minor
+
+%% sisu_0.14.0.orig.tar.gz (2005w22/6 | 2005-06-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.0.orig.tar.gz
+ a7ba5eeedad74ba6231f13c3a39535ec 3121235 sisu_0.14.0.orig.tar.gz
+ fd74f52531699370664657064aed8578 3406 sisu_0.14.0-1.diff.gz
+
+ * Flattened directory structure for ./conf/sisu which maps to /etc/sisu
+ or equivalent i.e. removed the additional version number which is
+ not supported by debian packaging, and unnecessary anyway.
+ (this change is the reason for version the hop to 0.14.0)
+
+ * Changed name of ./conf/sisu/sisurc.yaml.sample_disabled,
+ is now ./conf/sisu/sisurc.yaml
+ and enabled with some parts commented out
+
+ * Source Document Digest (using openssl and currently set to MD5) generated
+ were cvs document details requested, (request set in document header).
+
+ * Added man page summary of sisu-examples
+ (and a README for directory which refers you to man page)
+
+%% sisu_0.12.7.tar.gz (2005w22/3 | 2005-06-01 )
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.12.7.tar.gz
+ MD5(sisu_0.12.7.tar.gz)= 080a45e3e94ed744cca9d0222aa0ae9b
+ [(self inflicted) glitch with Debian build, not released together with source tarball.]
+
+ * Make SiSU convenient to use to produce other formats (including LaTeX)
+ without the software necessary to produce pdf, i.e. pdflatex
+ http://www.tug.org/applications/pdftex/
+ all this does really is recognise when pdflatex is absent
+ and pdfs cannot be generated in html generated output
+ (i.e. no links to pdf are produced, as was previously the case
+ where pdf output was assumed)
+
+ * Removed Debian require dependency on tetex-base and tetex-extra (in which
+ pdflatex resides).
+
+%% sisu_0.12.6.orig.tar.gz (2005w21/4 | 2005-05-26 )
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.12.6.orig.tar.gz
+ 4cb96905865bead50d0a53c8b0f12e91 3118290 sisu_0.12.6.orig.tar.gz
+ b03f53624fa3030646c5f4e5ff020262 3379 sisu_0.12.6-1.diff.gz
+
+ * sisu_webrick default port set to 8081 (from 2000), [also considered 8111,
+ 8123] [0.12.5]
+
+ * short man pages on sisu_webrick and sisu_termsheet provided [0.12.5]
+
+ * sisu_termsheet (changed name from sisu_termsheet.rb) [0.12.5]
+
+ * removed sisu-[version number] executable, is not necessary, (resulted in
+ skip from 0.12.6 from 0.12.4) [0.12.6]
+
+%% sisu_0.12.5.orig.tar.gz
+skipped, synced tarball and deb in 0.12.6
+
+%% sisu_0.12.4.orig.tar.gz (2005w21/4 | 2005-05-26 ):
+ 2ba51878d3e68ac1d268b3aa0294a2ab 3123433 sisu_0.12.4.orig.tar.gz
+ 9c0309ccdce1d13946d1a74c48f07ff4 3300 sisu_0.12.4-1.diff.gz
+
+ * sisu_webrick fix, update
+
+%% sisu_0.12.3.orig.tar.gz (2005w21/3 | 2005-05-25 ):
+ ac5e82b8d2a88503d8d004bee12cd979 3123419 sisu_0.12.3.orig.tar.gz
+ db7b4401a63dea7b9f47b6ead5cf9d4a 3272 sisu_0.12.3-1.diff.gz
+
+ * updated man 8 sisu
+
+ * updated part of interactive help in line with 'man 1 sisu' and 'man 8 sisu'
+
+ * debian package added as required in current ubuntu at least: libyaml-ruby
+
+ * touch to sisu_termsheet, colour fix
+
+%% sisu_0.12.2.orig.tar.gz (2005w21/1 | 2005-05-23 ):
+ 65d8cc8021579e307f8c2cce31cc988 3119888 sisu_0.12.2.orig.tar.gz
+ 6a13bc64be600e96366ccff0fac66344 3208 sisu_0.12.2-1.diff.gz
+
+ * changes with packaging methods (rather than sisu), and redone from
+ scratch with new origional source
+
+ * switch from using the sha digest to md5
+
+%% sisu_0.12.1.orig.tar.gz (2005w21/1 | 2005-05-23 ):
+ 2c877136005c5052921e619d435f0c91 3119846 sisu_0.12.1.orig.tar.gz
+ 28e4022ff40fcfc0c5d8f6d64279ede7 3146 sisu_0.12.0-1.diff.gz
+
+ * changes with packaging methods (rather than sisu), and redone from
+ scratch with new original source
+
+ * switch from using the sha digest to md5
+
+%% sisu_0.12.0.orig.tar.gz (2005w20/4 | 2005-05-20 ):
+ SHA1(sisu_0.12.0.orig.tar.gz)= ca95d1bc6e601d74bbe17516b2d5abbe09c76c49
+ MD5(sisu_0.12.0.orig.tar.gz)= 9a2ec914f925b275045d5a0846edab79
+ 9a2ec914f925b275045d5a0846edab79 3101948 sisu_0.12.0.orig.tar.gz
+ a9faa27de0ec632513b0ed81997d44af 20 sisu_0.12.0-1.diff.gz
+
+ * changes to packaging methods (better integration of debian package
+ builds - use of rant and darcs-buildpackage)
+
+ * apt-gettable package built
+
+ * switch from using the sha digest to md5
+
+%% SiSU version 0.10.9 of 2005w20/2 (2005-05-17):
+ sisu_0.10.9.tar.gz
+ SHA1(sisu_0.10.9.tar.gz)= bdb1ea25792549e77f88e9dac56442393714cd7c
+ Debian sisu_0.10.9-1.dsc
+ 689f92bce4d1a9390d0c62726410d47b 3128684 sisu_0.10.9.orig.tar.gz
+ 2775d317627ca5902b5c430defb39421 235 sisu_0.10.9-1.diff.gz
+
+ * default generic install of sisu is to type as root
+ (in the root directory of the unpacked tarball):
+
+ ruby install
+
+ For additional options:
+
+ ruby install help
+
+ or
+
+ ruby install -T
+
+ Thanks to rant.
+
+ * rant install file (used by sisu) has been made fairly
+ generic, and mirrors the directory structure used by
+ setup.rb
+
+ sisu specific post setup instructions are included
+ in rant/plugin directory.
+
+ * removed Rakefile, I do like rake, but do find
+ rant more flexible and remove the duplication of
+ effort. The Rantfile, or rather install works without
+ the separate installation of rant.
+
+%% SiSU version 0.10.8 of 2005w20/1 (2005-05-16):
+ sisu_0.10.8.tar.gz
+ SHA1(sisu_0.10.8.tar.gz)= 09618366119ae0e7cf047083b860e71fce2cd599
+ Debian sisu_0.10.8-1.dsc: 25da3de61eb78d31abf70472022e7a32 3078004 sisu_0.10.8-1.tar.gz
+
+ * Package directory structure changed to suit setup.rb default mapping
+ and applied to Rant and debian builds (Rake not checked)
+ ./etc renamed ./conf
+ ./man moved to ./data/man
+ destination path mapping as before.
+
+ * renamed some files document text files in ./data/doc/sisu
+ such as this version_manifest
+
+ * copy of version_maifest and README placed in package root
+
+ * SiSU version information adjustment, see display e.g.:
+ sisu -v
+
+%% SiSU version 0.10.7 of 2005w19/0 (2005-05-15):
+ sisu_0.10.7.tar.gz
+ SHA1(sisu_0.10.7.tar.gz)= e18a47f07c1627f353bfc3a7c1e9d647c3265cf3
+ Debian sisu_0.10.7-1.dsc: d5978970a1e5891e5e9b0b406f503f79 3094556 sisu_0.10.7-1.tar.gz
+
+ * Rantfile for installation, (Stefan Lang's rant)
+ to install SiSU, in the root directory of the unpacked SiSU as root type:
+ ruby install
+
+ * Rakefile fix to path for sisu-examples
+
+%% SiSU version 0.10.6 of 2005w19/3 (2005-05-11):
+ sisu_0.10.6.tar.gz
+ SHA1(sisu_0.10.6.tar.gz)= 55c891acbfe9eb734f96950d4cc646022112eda8
+ Debian sisu_0.10.6-1.dsc: 1124ffebc09426d2c16854069c398483 6140896 sisu_0.10.6-1.tar.gz
+
+ * some re-calibration of ocn required.
+
+%% SiSU version 0.10.5 of 2005w18/0 (2005-05-08):
+ sisu_0.10.5.tar.gz
+ SHA1(sisu_0.10.5.tar.gz)= 274be3ca806288d7cce5607707c4fd35fe1ecc6c
+
+ * version detail [synchronising packaging]
+
+%% SiSU version 0.10.4 of 2005w18/0 (2005-05-08):
+ sisu_0.10.4.tar.gz
+ SHA1(sisu_0.10.4.tar.gz)= 3adfc0400055fa45200158c34523486fdede895a
+
+ * small fix on reporting, generated by information, metaverse
+
+%% SiSU version 0.10.3 of 2005w18/0 (2005-05-08):
+ sisu_0.10.3.tar.gz
+ SHA1(sisu_0.10.3.tar.gz)= ad95cbe339115437f1605e4aa7d7cd4519bb34cb
+
+ * cleaning in packages
+
+%% SiSU version 0.10.2 of 2005w18/0 (2005-05-08):
+ sisu_0.10.2.tar.gz
+ SHA1(sisu_0.10.2.tar.gz)= 6e02af05df9b32ed3565b2058bb15ab19482c893
+
+ * rebuilt to correct debian package paths
+ .deb installation paths should be correct
+
+ * work-nickname Sabaki dropped from naming convention, will for
+ the time being stick to just sisu
+ (previous work-names/nick-names included scribbler, and scribe)
+
+%% SiSU version 0.10.1 of 2005w18/5 (2005-05-06):
+ sisu_0.10.1.tar.gz
+ SHA1(sisu_0.10.1.tar.gz)= 210f6ba09aa8d78239a5b01ef981c1f615bce1f6
+ Contains development-branch, version 0.11.1 of 2005w18/5
+
+ 0.11.1 of 2005w18/5
+ * debian packaging,
+ all architectures,
+ use debian sub_version numbers 0.11.1-1
+
+ change darcs directory tarball directory and name to comply
+ with tarball created by debuild (remove sabaki and date stamp)
+
+ the sha provided here is for the darcs tarball,
+ will have to consider what to do when also providing debuild
+ source tarball with it's own sha, and in any event to reduce
+ duplication
+
+ * deb package provided together with debian source package
+ and ***, which contains debian package sha.
+
+ * tinkering in database lib, minor renaming edits,
+ (tuple instead of loadline)
+
+ * fix to cgi sample: sisu_search.cgi
+ related to match linking to endnotes, (#~\d instead of #\d)
+
+%% SiSU Sabaki, version 0.10.0 of 2005w18/2 (2005-05-03):
+ sisu-sabaki_0.10.0_2005w18-2.tar.gz
+ SHA1(sisu-sabaki_0.10.0_2005w18-2.tar.gz)=
+ fe59ad4f07346713e945de0d87b8b4b57b69fd62
+ Contains development-branch, version 0.11.0 of 2005w18/2
+
+ 0.11.0 of 2005w18/2 (0.9.10 - 0.11.0)
+ * debian packaging re-visited,
+ (based on help from wookey earlier in the year,
+ thanks also to geoff for testing, ...
+ more to be done, but progress.)
+
+ 0.9.9 of 2005w17/0
+ * looking at debian packaging
+ synchronise packaging (0.9.7 - 0.9.9)
+
+%% SiSU Sabaki, version 0.8.4 of 2005w17/6 (2005-04-30):
+ sisu-sabaki_0.8.4_2005w17-6.tar.gz
+ SHA1(sisu-sabaki_0.8.4_2005w17-6.tar.gz)=
+ b8385ec8b6cecd4a2cda06fd42151244a3697e5e
+ Contains development-branch, version 0.9.7 of 2005w17/6
+
+ 0.9.7 2005w17/6
+ * tex/pdf document information
+
+%% SiSU Sabaki, version 0.8.3 of 2005w17/5 (2005-04-29):
+ sisu-sabaki_0.8.3_2005w17-5.tar.gz
+ SHA1(sisu-sabaki_0.8.3_2005w17-5.tar.gz)=
+ 5603a862909c24eaec7a65b91f376e581fc76362
+ Contains development-branch, version 0.9.6 of 2005w17/5
+
+ 0.9.5 - 6 2005w17/5
+ * xml series tables
+
+%% SiSU Sabaki, version 0.8.2 of 2005w17/5 (2005-04-29):
+ sisu-sabaki_0.8.2_2005w17-5.tar.gz
+ SHA1(sisu-sabaki_0.8.2_2005w17-5.tar.gz)=
+ 6564d4babe9a04520699bdeaac0f13c0bd723fa3
+ Contains development-branch, version 0.9.4 of 2005w17/5
+
+ 0.9.4 2005w17/5
+
+ * fixes:
+ * html table of contents, use of ocn
+ * xml series, (metaverse & xml_common)
+ tables not created at present, and removed
+ revisit, (previous version inserted non-"tidy" xml markup)
+
+%% SiSU Sabaki, version 0.8.1 of 2005w17/4 (2005-04-28):
+ sisu-sabaki_0.8.1_2005w17-4.tar.gz
+ SHA1(sisu-sabaki_0.8.1_2005w17-4.tar.gz)=
+ c3508979690aad04834238354b259ae0c2588bfb
+ Contains development-branch, version 0.9.3 of 2005w17/4
+
+ 0.9.3 2005w17/4 (contains rad of 2005w17/4)
+
+ * hot on the heels of 0.8.0 some fixes, and more likely to follow.
+
+%% SiSU Sabaki, version 0.8.0 of 2005w17/4 (2005-04-28):
+ sisu-sabaki_0.8.0_2005w17-4.tar.gz
+ SHA1(sisu-sabaki_0.8.0_2005w17-4.tar.gz)=
+ 8fcfc3f8d7661a0b3110a3206491581a93e0e920
+ Contains development-branch, version 0.9.2 of 2005w17/4 (rad - 0.9.2)
+
+ Summary, an old idea reinstated, to permit alternative text
+ presentations downstream:
+
+ rad of 2005w17/3
+
+ * old idea reinstated:
+ metaverse now carries three ocn (numbering) schemes for each document
+
+ * ocn as before all substantive objects numbered sequentially
+ * ocn divided, with headings distinguished from other substantive objects
+ * ocn specific, with each object identified and numbered by type
+
+ * changes to html and latex/pdf and database libraries to accommodate ocn
+ some bugs remain
+
+ rad of 2005w17/4
+ * changes to plaintext, xml series, and wmap to take account of ocn
+ changes
+
+ 0.9.0 2005w17/4 (contains rad of 2005w17/3-4)
+
+ * fixes needed in libraries using altered ocn/metaverse
+ (more to follow)
+
+ * cgi-bin search form sample
+ 0.9/data/sisu/sample/cgi-bin/sisu_search.cgi
+ break fix (table structure had been changed)
+
+ 0.9.1 - 2 2005w17/4 (contains rad of 2005w17/3-4)
+
+ * more fixes needed in libraries using altered ocn/metaverse
+
+%% SiSU Sabaki, version 0.6.1 of 2005w16/0 (2005-04-24):
+ sisu-sabaki_0.6.1_2005w16-0.tar.gz
+ SHA1(sisu-sabaki_0.6.1_2005w16-0.tar.gz)=
+ c824120ade54278b78a82ed535318974b30d3073
+ Contains development-branch, version 0.7.5 of 2005w15/0 (5.10-7.5)
+
+ 0.5.10 of 2005w16/2
+
+ * default shortuct flags -1 to -5 (what they do) can be modified in
+ sisurc.yaml (by changing the default flags they call)
+
+ * screen output ansi colour default can be set to true or false in
+ sisu.rc with -c acting as a toggle to turn screen output colour on
+ or off as appropriate against the default set.
+
+ 0.7.0 of 2005w16/3
+
+ * Remove old markup syntax, simplifies description of SiSU markup, without
+ any loss of functionality (the newer markup style is already a superset of
+ the old). Removal of old markup syntax necessitates branch/ version change.
+ Removal of the alternative markup syntax, which dates way back. It was
+ convenient and a bit impressive to be able to use SiSU on documents marked
+ up in 1997; and maintaining the accompanying code was unproblematic, but
+ after reflection over a prolonged period of time, have decided i would
+ rather not encourage alternative markup styles, especially where one is
+ clearly preferred over the other. There are still alternative ways of
+ representing endnotes for examples as either may confer an advantage,
+ depending on circumstances (usually the pre-markup source document) but
+ only within the new markup style.
+
+ 0.7.1 of 2005w16/4
+
+ * removal of alternative markup syntax continues.
+
+ * remote file operations and file letter naming conventions, now
+ composite, requesting, requiring files have filename with extension .r
+ when processed a temporary file is created with the extension .t
+
+ when a url is provided to request the processing of a remote file, the file
+ is downloaded saved and processed with the .u extension
+
+ 0.7.2 of 2005w16/6
+
+ * Work with the downloading of images where remote documents are requested
+ either by use of a url on the command line or within a composite document
+ images if not found there are downloaded to a subdirectory of the working
+ directory sisu_images_external. Composite documents flagged with the
+ extension .r1 .r2 and .r3 are if external downloaded and scanned for
+ images, which are downloaded if not found in the directory
+ ./sisu_images_external, and the document as expanded is saved with as a
+ temporary file with the extension .t1, .t2 or .t3 accordingly, for
+ processing. Where a uri is provided on the command line referring to a sisu
+ markup document for processing, that document is downloaded and saved with
+ the extension .u1, .u2 or .u3 which is then processed. In all cases the
+ file extension is dropped with respect to output.
+
+ * Some updates to the man pages with regard to different types of remote
+ processing.
+
+ * pdftex possibility to set image centering in header, default off.
+
+ * pdftex visited sisu and latex special characters, escaping for pdfs
+
+ 0.7.3 of 2005w16/0
+
+ * Special characters in pdf, minor
+
+ 0.7.4 of 2005w16/0
+
+ * marker, problem with tables detected, make sure can rollback
+
+ 0.7.5 of 2005w16/0
+
+ * table fix...
+
+%% SiSU Sabaki, version 0.4.3 of 2005w16/1 (2005-04-18):
+ sisu-sabaki_0.4.3_2005w16-1.tar.gz
+ SHA1(sisu-sabaki_0.4.3_2005w16-1.tar.gz)=
+ ***
+ Contains development-branch, version 0.5.9 of 2005w15/0 (5-9)
+
+ 0.5.5 of 2005w15/5
+
+ * sisu control, minor, e.g. reduce number of counters
+
+ [downloaded ruby1.9, this branch uses ruby1.8 though]
+
+ 0.5.6 of 2005w15/6
+
+ * changes for ruby1.9, including metaverse, (also sysenv, html & plaintext)
+ most that needs to be done appears to be in place. worst fix ansi colour,
+ revisit all later. much testing needed.
+
+ * param header US Library of Congress cataloguing option ~class_loc also
+ ~class_dewey recall issues with dewey being proprietary? check (perhaps add
+ option and leave unused?) considered all this years ago... ~class_isbn,
+ issue here is that some material will be published under an isbn, and will
+ have page numbering etc. which sisu publication does not follow, i.e. sisu
+ publication is an independent publication, so isbn is a reference to an
+ original hard copy publication... what of asin etc. revisit, and determine
+ what else to add.
+
+ 0.5.7 of 2005w15/0
+
+ * sysenv ansi colors, revisit later
+
+ * wordmaps, revisit later... problem introduced (a loop removed,
+ double counting removed)
+
+ * rescue single line syntax rescue: ...
+
+ 0.5.8 of 2005w15/0
+
+ * introduce -c ansi color flag for screen output, (perhaps should be
+ color off instead), and
+ -q quiet mode, no screen output
+ there is some scope for breakage here, continue to examine the
+ plumbing
+
+ * man page updated
+
+ 0.5.9 of 2005w16/1
+
+ * dbi fixes from 0.5.8 changes (ansi)
+
+%% SiSU Sabaki, version 0.4.2 of 2005w15/4 (2005-04-14):
+ sisu-sabaki_0.4.2_2005w15-4.tar.gz
+ SHA1(sisu-sabaki_0.4.2_2005w15-4.tar.gz)=
+ d670058fe019a106b385049416db5c914fbf308d
+ Contains development-branch, version 0.5.4 of 2005w15/4 (4)
+
+ 0.5.4 of 2005w15/4
+
+ * sqlite default file name created to sisu_sqlite.db (was lex.db)
+
+ * plaintext some cleaning of output
+
+ * xml, minor touch, image tag, version/revision control info optional
+
+%% SiSU Sabaki, version 0.4.1 of 2005w15/3 (2005-04-13):
+ sisu-sabaki_0.4.1_2005w15-3.tar.gz
+ SHA1(sisu-sabaki_0.4.1_2005w15-3.tar.gz)=
+ 0b1c6f10832e114f55e4a7d37f6f98d7c345b55f
+ Contains development-branch, version 0.5.3 of 2005w15/3 (1-3)
+
+ 0.5.1 of 2005w15/3
+
+ * dbi sqlite re-introduced, though not tested. some things moved to
+ common_db
+
+ 0.5.2 of 2005w15/3
+
+ * common_db, dbi, pg and sqlite most logic is common and moved to
+ common_db
+
+ 0.5.3 of 2005w15/3
+
+ * dbi increased field size for text contents again,
+ (to 12,000 for now from inadequate 2712)
+ both postgresql and sqlite appear to support this
+
+%% SiSU Sabaki, version 0.4.0 of 2005w15/2 (2005-04-12):
+ sisu-sabaki_0.4.0_2005w15-2.tar.gz
+ SHA1(sisu-sabaki_0.4.0_2005w15-2.tar.gz)=
+ 832f47c37910dfbac05c401f26865b5f53dea358
+ Contains development-branch, version
+ 0.5.0 == 0.3.0 of 2005w15/2
+
+ 0.3.1 of 2005w15/2
+
+ * image representation changed dimensions now represented as
+ width x height i.e. \d+x\d+ e.g. 480x640 (as in imagemagick)
+ previously was explicit w=480 h=640
+ (this change causes breakage in sample text with images)
+
+ * sample marked-up documents updated accordingly
+
+ 0.5.0 of 2005w15/2
+
+ * sorry for the quick version number turn around, and for its being applied
+ to pretty minor changes.
+
+ The version numbering rule applied is that a second digit version number
+ change will be made when potential breakage is caused by code changes.
+
+ This has happened now with the decision to alter representation of image
+ dimensions. Backward compatibility, though easily provided is not thought
+ to be necessary (or desirable) in this instance, based on current user
+ base, and modest use of images in text. 0.4.0 is on it's way. This type of
+ event is fairly rare, though it has occurred occasionally in subtle ways.
+ For example Tainaron marked up in 1997-1998 markup style still builds.
+
+ For description of change see 0.3.1
+
+%% SiSU Sabaki, version 0.2.0 of 2005w14/0 (2005-04-10):
+ sisu-sabaki_0.2.0_2005w14-0.tar.gz
+ SHA1(sisu-sabaki_0.2.0_2005w14-0.tar.gz)=
+ 36986ffa6a17651a0d52646c9c91032af33bb32a
+ From stable 0.1.4-11
+ Contains development-branch, version
+ 0.3 == 0.1.5-58 of 2005w13/6
+
+ * version number changes:
+ stable branch is 0.2
+ development branch is 0.3
+
+ * replaced config_environment.rb file which had dropped out of stable
+ tarball. [lesson, test future setup/installs from clean slate]
+
+%% STABLE MANIFEST (@ 0.1.4 branch)
+
+%% SiSU Sabaki, version 0.1.4-11 of 2005w14/6 (2005-04-09):
+ sisu-sabaki-stable_0.1.4-10_2005w14-6.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-11_2005w14-6.tar.gz)=
+ bdb2b09d467804a6d3a4bd92abb13c015c57d897
+ Contains development-branch, version
+ 0.1.5-58 of 2005w13/6 (56-58)
+
+ 0.1.5-56 of 2005w14/3
+
+ * html endnote segment, (introduced bug fixed) linkback to
+ main text broken, url was split on more than one line,
+ resulting in error
+
+ * special characters escaping for use within text
+ looked at, (mostly there previously but not documented)
+ ~ { } < > - _ / also used : ^ ! #
+ note added to man pages
+ (more to be done)
+
+ 0.1.5-57 of 2005w14/5
+
+ * distinguish text poem from other text groupings by giving an
+ object citation number to each verse
+
+ * cosmetic html default colors for navigation band and home button
+ surround made neutral (white)
+
+ 0.1.5-58 of 2005w14/6
+
+ * distinguish text poem from other text groupings by giving an
+ object citation number to each verse
+
+ * alt and group text groupings bugfix
+
+%% SiSU Sabaki, version 0.1.4-10 of 2005w13/6 (2005-04-02):
+ sisu-sabaki-stable_0.1.4-10_2005w13-6.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-10_2005w13-6.tar.gz)=
+ bdd91b004c456251d6e7074439f6e9b571ae5316
+ Contains development-branch, version
+ 0.1.5-55 of 2005w13/6 (47-55)
+
+ 0.1.5-47 of 2005w13/3
+
+ * texpdf suggested urls at end of document problems with latex special
+ characters, not fully looked into, or passed through the appropriate
+ filter, but some ad hoc corrections made
+
+ 0.1.5-48 of 2005w13/3
+
+ * cosmetic + information in html navigation band (revisit)
+
+ * texpdf suggested urls special character fix for both url and linked text
+ done.
+
+ 0.1.5-49 of 2005w13/3
+
+ * html subtoc fix (as it failed in certain circumstances, watch)
+
+ * html endnotes, cosmetic (presentation of headings, and invisible navigation)
+
+ 0.1.5-50 of 2005w13/3
+
+ * html change to display of title and headings in segments (dc and headings)
+ display dc small, and heading normal
+
+ 0.1.5-51 of 2005w13/4
+
+ * initial xml table logic is in place (logic taken from html unit) [still using
+ html type tags but logic is in place]
+
+ 0.1.5-52 of 2005w13/6
+
+ * object character numbering of special blocks "code", "poem", "group"
+ and "alt" finally corrected, in line with "tables". (may introduce a subtle
+ variation, between poem and code, or alt and others, numbering the equivalent
+ of each verse, but need a bit of time to consider) numbering correct, some
+ cosmetic adjustments to follow, e.g. in pdfs, more work necessary in xml
+ series.
+
+ 0.1.5-53 of 2005w13/6
+
+ * dbi a bit of cleaning of search column, and touch to data
+
+ 0.1.5-54 of 2005w13/6
+
+ * texpdf adjustment to position of ocn in special text blocks
+
+ 0.1.5-55 of 2005w13/6
+
+ * texpdf blocks fix
+
+ * texpdf prefix_b issue with portrait, (not landscape) fix
+
+ * sisu info improved in latex output
+
+%% SiSU Sabaki, version 0.1.4-9 of 2005w13/2 (2005-03-29):
+ sisu-sabaki-stable_0.1.4-9_2005w13-2.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-9_2005w13-2.tar.gz)=
+ 743b912beddc235ec96456e97fe9350b2a275370
+ Contains development-branch, version
+ 0.1.5-46 of 2005w13/1 (44-46)
+
+ * small updates to man page
+
+%% SiSU Sabaki, version 0.1.4-8 of 2005w13/2 (2005-03-29):
+ sisu-sabaki-stable_0.1.4-8_2005w13-1.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-8_2005w13-1.tar.gz)=
+ f8a7760bbd583e5d8637420d153c178ffafcbf68
+ Contains development-branch, version
+ 0.1.5-43 of 2005w13/1 (34-43)
+
+ Quick summary (context sisu markup):
+
+ * allows creation of composite (sisu markup) documents, documents that
+ require other documents or bits of marked up text that are not independent
+ documents (i.e. not capable of being generated as standalone documents),
+ content may be sourced remotely (url)
+
+ * allows processing of remote (sisu markup) documents
+
+ * various small fixes
+
+ -- detail from development branch
+
+ 0.1.5-44 of 2005w13/2:
+
+ * documentation updates
+
+ 0.1.5-43 of 2005w13/1:
+
+ * composite documents and remote (url) documents, some on error code
+
+ * composite documents, screen information provided, both cosmetic and on
+ error
+
+ 0.1.5-42 of 2005w12/0:
+
+ * composite documents may link to remote urls for their constituent parts
+ using any of its (composite link) syntaxes with an html url, but advisedly
+ either of the following:
+
+ #basic sisu markup
+ r{http://www.url.org/filename.si}
+ {http://www.url.org/filename.s3}require
+ r{ {http://www.url.org/filename.si}req #for vim folds
+
+ #using thlnk
+ <url:http://www.url.org/filename.si>require
+ r{ <url:http://www.url.org/filename.s3>req #for vim folds
+
+ with thlnk is attractive if you use vim because it recognises and permits
+ the plain-text hyperlinking to the remote file, which can be called in for
+ viewing.
+
+ in this context (urls) textlink markup has little meaning as it does not
+ work for editors with url hyperlinking, while the basic sisu markup does no
+ more or less than it always does. For everyday use, as a means of
+ hyper-linking within an editor i do find textlink attractive though.
+
+ * file suffix naming convention -
+ .s[1-3] ordinary sisu marked up documents
+ .si sisu marked up snippets for incorporation into other documents
+ .r[1-3] documents using require - (like a master document)
+ .t[1-3] temporary marked up files, usually created by sisu for processing,
+ e.g. from building the master file, or on having downloaded a remote
+ sisu markup file for local processing.
+
+ while on the subject the 1 to 3 is an old naming convention for processing
+ html output, .s1 indicating that only a scroll, long single text should
+ be produced; .s2 for only segmented html, the document in parts should be
+ produced, no single/full length document (this is used for example on war
+ and peace); and .s3 requesting both the scroll and segments.
+
+ 0.1.5-41 of 2005w12/0:
+
+ * more alpha code: remote source a sisu markup file using url (http://) for
+ local processing.
+
+ For example, assuming sisu is installed, you could generate the text of the
+ GPL in plain-text, html, xhtml, XML, pdf and a wordmap of its contents using
+ the following string:
+
+ sisu -mhpabxXwv http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3
+
+ or to just do html and pdf files from one remote source to the default
+ remote destination (assuming you have one setup):
+
+ sisu -mhpr http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3
+
+ [this works for texts without embedded images, unless you already have the
+ images stored locally - it will be a relatively easy matter to get the
+ program to search relative parts on the remote server and download them for
+ processing with the document... no doubt it will happen one day, but is not
+ a priority in the near future, also; will be a small step to permit remote
+ (and local files) to be stored in zip format and unzipped prior to
+ processing if desired, to reduce bandwidth and time]
+
+ Nice from a flexibility perspective, though I expect SiSU's use to be
+ primarily on locally stored marked up document sets.
+
+ * vim updates (small touches) to sisu: syntax highlighting; folds, and;
+ recognised filetypes (included .si .[rst][0-3] already being recognised)
+
+ 0.1.5-40 of 2005w12/0:
+
+ * *{composite document}*, alpha code: introduced alternative ways of
+ specifying document require, using vim's hypertext ascii thlnk or textlink.
+ The following forms of document require are valid, to incorporate a
+ document fragment named filename.si (the require statement must be at the
+ start of a line):
+
+ #basic sisu markup
+ r{filename}
+ {filename.si}require
+ r{ {filename.si}req #for vim folds
+
+ #using textlink
+ |filename.si|@|^|require
+ r{ |filename.si|@|^|req #for vim folds
+
+ #using thlnk
+ <url:filename.si>require
+ r{ <url:filename.si>req #for vim folds
+
+ the value of the textlink and thlnk style is they are live hyperlinks to
+ the constituent parts of the document, which can be brought up at a
+ keystroke for viewing or editing.
+
+ [An interesting possibility to consider, is to permit sisu to get the
+ composite parts of a document from a remote url source via http, using
+ thlnk syntax which permits this <URL:http://www.bf-consulting.de/thlnk/vim>
+ - NOTE: implemented in 0.1.5-42]
+
+ 0.1.5-39 of 2005w12/6:
+
+ * *alpha* code: assemble source document for processing from a document
+ requesting additional parts ... i.e. a master document, or a document with
+ regular markup plus external insertions. Requesting documents currently
+ with named suffix .r[1-3] documents requested may be complete valid sisu
+ documents named with suffix .s[1-3] or valid sisu markup constituting part
+ of a document named with suffix .si (to distinguish and to prevent attempt
+ to generate the snippet). A temporary or transient document is assembled
+ for processing and na med with the suffix .t[1-3] (retaining the
+ processing instruction digit) [current intention is that the .t file will
+ be clobbered at the end of processing unless the maintenance processing
+ flag is used] parts are requested with:
+ {[name_of_file_to_load.s[i1-3]]}require
+ e.g.
+ {name_of_file_to_load.si}require
+ or
+ { name_of_file_to_load.s3 }require
+
+ 0.1.5-38 of 2005w12/6:
+
+ * xml sax and dom, pass data through...
+
+ development-branch, version 0.1.5-37 of 2005w12/6
+
+ * document generator information added as comment to head of xml & xhtml
+ output
+
+ 0.1.5-36 of 2005w12/6:
+
+ * fix, remote sending of xhtml files (-r on -b option), include [b] in
+ regex match for file to be placed correctly in remote directory
+
+ * cosmetic, (still with screen output on doing remote sending)
+
+ * [ratchet fix so yyyymmdd date info displayed correctly, was dropping
+ the 0 before month and day where less than 10]
+
+ * css and default home page modified
+
+ 0.1.5-35 of 2005w12/4:
+
+ * xml sax dom and xhtml change to header match
+
+ * xml dom changes to css
+
+ * some feedback provided on remote file placement -r
+
+ * document version guide added to toc html, (stub only unused)
+
+ 0.1.5-34 of 2005w12/4:
+
+ * xhtml filename extension now scroll.xhtml instead of doc.xhtml
+
+ * man page small update, file name extensions (xhtml and plain-text)
+
+%% SiSU Sabaki, version 0.1.4-7 of 2005w12/3 (2005-03-23):
+ sisu-sabaki-stable_0.1.4-7_2005w12-3.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-7_2005w12-3.tar.gz)=
+ 929875de0658f1adeabd837fa09aca3ae48197e0
+ Contains development-branch, version
+ 0.1.5-33 of 2005w12/3 (30-33)
+
+ 0.1.5-33 of 2005w12/3:
+
+ * largely cosmetic changes to default home page.
+
+ 0.1.5-32 of 2005w12/3:
+
+ * finally removed double bullets from ie on ms, problem with html tagging
+ <ul> and <li> both required. Small related changes to css and more to
+ follow.
+
+ 0.1.5-31 of 2005w12/3:
+
+ * sysenv: reverted to using ruby -v for ruby version info (no longer find
+ what i want within rbconfig: Config::CONFIG)
+
+ * plaintext: pass metadata through wrapper, some document rights info extends
+ beyond line wrap limit.
+
+ 0.1.5-30 of 2005w12/1:
+
+ * passed css (sisu.css) through a validator, corrections made
+
+ * expressly close segment files as produced, (else problem remote sending
+ last metadata file created as is not yet closed)
+
+%% SiSU Sabaki, version 0.1.4-6 of 2005w12/1 (2005-03-21):
+ sisu-sabaki-stable_0.1.4-6_2005w12-1.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-6_2005w12-1.tar.gz)=
+ 3f8ded60f1f43e3ba3e745d9bbc045bb0ab43ffb
+ Contains development-branch, version
+ 0.1.5-29 of 2005w11/6 (22-29)
+
+ from development-branch, version 0.1.5-26 to 0.1.5-29 of 2005w11/6
+
+ * -h0 turns off object character number display in html ouput
+ (-p0 to turn of object character number display in pdf, already
+ exists) [this is the digit 0 not upercase o]
+
+ * man page alphabetised
+
+ * renamed ascii plaintext, as use utf-8
+
+ * renamed plaintext output file plain.txt from file.txt (recently was
+ doc.txt but there were "webserver conflicts" with doc.html)
+
+ * manually constructed homepage embedded, and created on initialisation (-C),
+ will probably have to consider how and when this is done.
+
+ 0.1.5-25 of 2005w11/5:
+
+ * on table of contents page (for segmented text), new arrow navigation
+ button linked to first segment.
+
+ * -ru forces use of scp so as to build remote file structure and for input
+ files selected for processing, to copy all output files in their
+ directories (rather than only the currently selected output types).
+ [Bugcheck: There may be a bug, check that metaverse.html closes after
+ normal html processing and before copy, ... seems to end up posted empty,
+ when actually is built.]
+
+ * html for segmented table of contents, correction url markup levels 4,5 & 6
+
+ * [removal of erroneous reference to lexmercatoria]
+
+ 0.1.5-24 of 2005w11/3:
+
+ * [decided how to represent blockquotes, propagte]
+
+ * provided sisu home site urls (not a code change)
+
+ 0.1.5-23 of 2005w11/3:
+
+ * remote -r only ssh copy file types for which processing requested
+ (e.g. all pdf files for the following files to be processed - previously
+ copied all files from output directory of file for which processing was
+ requested) has a drawback though, as rely on scp -r to build the directory
+ structure, the first sending of any file must be done by calling the
+ -r flag alone, ie without other sisu instructions.
+
+ 0.1.5-22 of 2005w11/2:
+
+ * html, css more ...
+ [some problems reported with presentation of bullet lists in IE, will sort
+ later]
+
+ * use name file.txt instead of doc.txt for basic text (ascii type)
+ presentation output. Reason, some web servers are configured to give
+ precedence to .txt extension over .html i.e. when doc is requested doc.txt
+ rather than doc.html (the sisu preferred default) would be presented.
+
+%% SiSU Sabaki, version 0.1.4-5 of 2005w11/2 (2005-03-15):
+ sisu-sabaki-stable_0.1.4-5_2005w11-2.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-5_2005w11-2.tar.gz)=
+ 25e35edc2f932269d21b17c29890ad72c54510a5
+ Contains development-branch, version
+ 0.1.5-21 of 2005w11/2
+
+ * html, css, indented bullet fixed
+
+ * [see 0.1.4-4 for recent changes]
+
+%% SiSU Sabaki, version 0.1.4-4 of 2005w11/1 (2005-03-14):
+ sisu-sabaki-stable_0.1.4-4_2005w11-1.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-4_2005w11-1.tar.gz)=
+ 2ab9fa0a45275ca65a23e5199ef13851f00042f2
+ Contains development-branch, version
+ 0.1.5-16 to 0.1.5-20 of 2005w11/1
+
+ * html markup, a quick glance at & nod (anew) towards css
+ changes to ruby html code & to markup arranging & pruning (also get rid of
+ some line noise) from 0.1.5-16 to 0.1.5-20 (an ongoing longer term sort of
+ thing) quite a few changes, more to be done though
+
+ * line wrap visited
+
+ * ascii touched
+
+ * some code files moved and renamed
+
+%% SiSU Sabaki, version 0.1.4-3 of 2005w10/5 (2005-03-11):
+ sisu-sabaki-stable_0.1.4-3_2005w10-5.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-3_2005w10-5.tar.gz)=
+ 7e06a3b37e85eaebc74892244f6626ee4f2fcc8a
+ Contains development-branch, version
+ 0.1.5-15 of 2005w10/5
+
+ * remote host secure copy: adjustments, and flagged in help as EXPERIMENTAL
+ and as requiring configuration. Checks provided - no action taken if
+ username and remote hostname have not been provided and host not found.
+ Further checks necessary, first no action if network not available
+ (actually this feature should not yet have been made available in stable,
+ but so be it). [0.1.5-14 & 15 of 2005w10/4] - does not currently create
+ base directory for output on remote server - only sub-directories for each
+ document produced.
+
+%% SiSU Sabaki, version 0.1.4-2 of 2005w10/5 (2005-03-11):
+ sisu-sabaki-stable_0.1.4-2_2005w10-5.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-2_2005w10-5.tar.gz)=
+ 46ad3b254b5e9293610dccd6274e039e49c5b9a2
+ Contains development-branch, version
+ 0.1.5-12 of 2005w10/5
+
+ * forgot to update Rakefile along with rest of last stable relese (this is
+ excuse for current update)
+
+ * [A potentially useful feature, released prematurely] remote host secure
+ copy using system call, -r flag introduced, hostname and user must be
+ configured in sisurc.yaml (It is much more convenient to install SiSU on
+ remote machine, and do processing there, but that is not possible and it is
+ often convenient to have the files you are working on placed on the remote
+ host without further intervention [this serves as (an occasional?) fix],
+ (note is faster i am sure to send a compressed tarball)) [could do same for
+ ftp etc.] Note also would be more efficiently implemented as a threaded,
+ will consider later, for now the output of this implementation is
+ appreciated.
+
+ * ascii.rb minor touch, (repeated require removed)
+
+ * an email address update for author
+
+%% SiSU Sabaki, version 0.1.4-1 of 2005w10/3 (2005-03-09):
+ sisu-sabaki-stable_0.1.4-1_2005w10-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki-stable_0.1.4-0_2005w10-3.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-1_2005w10-3.tar.gz)=
+ 8ab95e942f7dd2449e1c92ec94f15a938d01edce
+ Contains development-branch, version
+ 0.1.5-1 (post 2005w06/4) - 0.1.5-11 of 2005w10/2
+
+ 0.1.5-11 of 2005w10/1:
+
+ * latex/pdf match regex improved (for work referred to in 0.1.5-10)
+
+ 0.1.5-10 of 2005w10/2 - fold back into stable:
+
+ * fix for bug in latex/pdf for certain types of multiple url/endnote tagging
+ within a paragraph, previously not properly caught (not much need had arisen
+ for multiple 'such' tags... but sorted)
+
+ 0.1.5-9 of 2005w10/1:
+
+ * cosmetic changes, html navigation
+
+ 0.1.5-8 of 2005w09/0:
+
+ * cosmetic changes, css visited turned off in html, and previous, next arrow
+ buttons changed (with image-buttons from darcs wiki)
+
+ 0.1.5-7 of 2005w09/0:
+
+ * utf8 xml
+
+ * utf8 related transforms in one file, (but should profile), so far latexpdf
+ and html, (xml to follow)
+
+ * switch over to UTF-8 from ISO-8859-1
+
+ 0.1.5-6 of 2005w09/5:
+
+ * platform architechture hooks in place
+
+ * Iñtërnâtiônàlizætiøn a few more utf-8 characters added
+ ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûü
+ ¢£¥§©ª«®°±²³µ¶¹º»¼½¾×÷
+
+ * man page, looked odd under utf8, adjustments made (post 0.1.5-5 and
+ uploaded)
+
+ * rake base, function updated to setup man along with: bin, lib, etc
+
+ 0.1.5-5 of 2005w09/3:
+
+ * papersize, LaTeX/pdf start adjusting, further refinement necessary
+
+ * documentation, small update
+
+ 0.1.5-4 of 2005w09/3:
+
+ * internationalisation, Unicode UTF-8 (preferred default (from now on)): the
+ locale common denominator between various programs used, from LaTeX and
+ Postgresql to ... vim, appears to be utf-8
+ Changed computer environment to utf8 (locale, postgresql, vim etc.), and
+ run SiSU to see what breaks...
+ * issues detected with LaTeX/pdf and sorted
+
+ * hooks for paper size used by latex/pdf in place currently only default a4 set
+ for all available types, sort out LaTeX settings later.
+
+ * text version of version manifest included start to provide 2004-02-27
+
+ * small changes to rakefile
+
+ * small changes to dates in sysenv
+
+ * termsheets wrapper included, (termsheet sisu pre-processing for merging a
+ computer legal 'termsheet' into a set of standard contract documents)
+ included wrapper. However, to be useful need to provide examples, and/or
+ detail as to how this works... this is left out for now, as having so many
+ appendages is a distraction and make sisu look more complicated than it
+ need be, or rather than it is for its' ordinary functions.
+
+ * included Debian directory, first attempt at making a deb.
+ [still only in development directory]
+
+%% SiSU Sabaki, version 0.1.4-0 of 2005w07/2 (2005-02-15):
+ sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz)=
+ 0867a884c6741751e73e664c6fe485ec7161dcdb
+
+ * substantively the same as 0.1.5-0 (development branch)
+
+ * tables get object citation numbers
+
+ * tables are currently omitted from xml output, and table notes are disabled
+ for the moment
+
+%% SiSU Sabaki, version 0.1.2-27 of 2005w05/0 (2005-02-06):
+ sisu-sabaki_0.1.2-27_2005w05-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-27_2005w05-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-27_2005w05-0.tar.gz)=
+ af17a4a3f8c192e772fb862f16f6c93bd48129b5
+
+ * adjustments to Rakefile post installation configuration and generation of
+ sample file output, post-installation options
+
+ * word map hardlinks ... (.html suffix previously handled by webserver
+ configuration)
+
+%% SiSU Sabaki, version 0.1.2-26 of 2005w05/0 (2005-02-06):
+ sisu-sabaki_0.1.2-26_2005w05-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-26_2005w05-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-26_2005w05-0.tar.gz)=
+ 3fe1d7aafacad9926ef228b48bf13af0cafa9217
+
+ * adjustments to Rakefile post installation configuration and generation of
+ sample file output
+
+%% SiSU Sabaki, version 0.1.2-25 of 2005w05/5 (2005-02-04):
+ sisu-sabaki_0.1.2-25_2005w05-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-25_2005w05-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-25_2005w05-5.tar.gz)=
+ 0f00d3bf6883a02da4270e953781aec4cfe6ebb9
+
+ * tweaking of default output and processing paths, (for testing, may have
+ broken something)
+
+ * adjustment to url pattern match for LaTeX output
+
+ * As rake has been configured to do post installation setup, it is the
+ preferred method of installation for the present time.
+
+%% SiSU Sabaki, version 0.1.2-24 of 2005w05/5 (2005-02-04):
+ sisu-sabaki_0.1.2-24_2005w05-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-24_2005w05-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-24_2005w05-5.tar.gz)=
+ d93c2b510d3784dc7b396541734bcdaf198c0c9b
+
+ * if you have ruby1.8.2, rake and sudo install and setup should be automated -
+ small adjustments to Rakefile, if sudo is used on machine, will request
+ user (name) to be used when generating test document, and attempts to do
+ additional setup required and generate the first document; if not skips
+ that final step, manual configuration, being required (basically running
+ sisu -CC in document markup directory first before generating first
+ document)
+
+ * hard test for presence of rexml which is supposed to be part of ruby1.8 I
+ thought but reports back from a number of distros that is not always there...
+ as it is so far only used in SiSU for cosmetic purposes, rexml is ignored if
+ not found. Caused hiccup if not present in previous version.
+
+ * on Debian testers had to have the following packages installed in addition to
+ having ruby1.8 and preferably rake as well:
+ tetex-base tetex-bin tetex-extra
+ libyaml-ruby
+ other programs used if available
+ librexml-ruby trang and tidy
+
+ * on Mac the following page was valuable to one who had not previously used
+ Ruby
+ http://www.rubygarden.org/ruby?RubyOnMacintosh
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.2-23 of 2005w05/4 (2005-02-03):
+ sisu-sabaki_0.1.2-23_2005w05-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-23_2005w05-4.tar.gz)=
+ 771e0a98246162c61618dc941ab9831e57551e9f
+
+ Withdrawn because more was done setting up SiSU in root than is practicable,
+ causing problems for ordinary use of sisu.
+
+ * small adjustments to Rakefile, still need to decide whether default action
+ should include an attempt to generate a test document
+
+ * sisurc.yaml sample provided disabled by default (
+ /etc/sisu/0.1.2/sisurc.yaml.sample_disabled probably best copied to ~/.sisu
+ and renamed sisurc.yaml)
+
+%% SiSU Sabaki, version 0.1.2-22 of 2005w05/3 (2005-02-02):
+ sisu-sabaki_0.1.2-22_2005w05-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-22_2005w05-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-22_2005w05-3.tar.gz)=
+ b9b51c7f9e5a95f32df91632fb43c96c1a9057a3
+
+ * SiSU's Rakefile configure automation taken a bit further. If using Rake setup
+ then after the installation of SiSU, Rake will attempt to do initial
+ configuration of the sisu document samples output directory, and to
+ generate multiple output versions of a sample text file (html, ascii, xml
+ (dom and sax versions), latex, pdf). Will consider whether to keep things
+ this way, it does provide early feedback as the status of the installation.
+
+ * Permissions on files placed by Rake, bin 755 the rest 644
+
+ * /etc added to sisurc.yaml search path, was previously a sample document.
+
+%% SiSU Sabaki, version 0.1.2-21 of 2005w05/3 (2005-02-02):
+ sisu-sabaki_0.1.2-21_2005w05-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-21_2005w05-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-21_2005w05-3.tar.gz)=
+ 6f5ae5a24ff8099aea492e47ac99c73f906d18e4
+
+ * LaTex/pdf output should now work across the platforms on which sisu has been
+ tested, Linux and Mac/OSX/BSD, but this is anticipated rather than
+ extensively tested...
+
+ * sisu -CC from within a document working directory, after install should do
+ additional things related to initialising output directory
+
+ * system calls were mostly placed in one library/module and the availability of
+ the binary tested for with whereis -b, apparently the -b flag for binary
+ only is not available across all Linux/Unix, so the whereis check has been
+ modified.
+
+ * various little things todo with setup and installation
+
+ * Thanks O-E P, and chris2 for help and feedback with Mac OSX installations.
+
+%% SiSU Sabaki, version 0.1.2-20 of 2005w05/2 (2005-02-01):
+ sisu-sabaki_0.1.2-20_2005w05-2.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-20_2005w05-2.tar.gz
+ SHA1(sisu-sabaki_0.1.2-20_2005w05-2.tar.gz)=
+ 1e28dde239c96b82acfced1a37615ca7255d102a
+
+ * Most remaining system calls moved to single location, and binaries checked
+ for before use, will be very easy to have alternative calls for different
+ platforms
+
+ * Well this is news SiSU ran on a Mac yesterday - html, ascii, xml Very much a
+ first look. There are issues to resolve, but not major ones: sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2004-12-25) [powerpc-darwin7.7.0]
+
+ * & my info, sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2005-01-10) [i386-linux]
+
+%% SiSU Sabaki, version 0.1.2-19 of 2005w05/1 (2005-01-31):
+ sisu-sabaki_0.1.2-19_2005w05-1.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-19_2005w05-1.tar.gz
+ SHA1(sisu-sabaki_0.1.2-19_2005w05-1.tar.gz)= eb7ef826f2fa69c4ef8eaf33ff297f3141c1217e
+
+ * Rakefile modified, same result ... a few more options
+
+ * touch to vim folds
+
+ * cosmetic change to code headers
+
+ * a touch related to initialisation of directories (probably more to follow),
+ checks done as to whether to -C on use of -m and -M flags
+
+ * SiSU ran on a Mac today - html, ascii, xml. There are issues to resolve, but
+ not major ones: sisu -v on a powerpc yesterday:
+
+ * Well this is news SiSU ran on a Mac yesterday - html, ascii, xml Very much a
+ first look. There are issues to resolve, but not major ones): sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2004-12-25) [powerpc-darwin7.7.0]
+
+ * my info, sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2005-01-10) [i386-linux]
+
+ * Released together with 0.1.2-18 which was held back because some remaining
+ issues with extension of feature set introduced in 0.1.2-14 and 0.1.2-15
+ were detected. These have been largely but not completely resolved. Will
+ have to study effects of changes on middle layer more closely in subsequent
+ releases. There will be some. The release is made now anyway because
+ there are a number of installations taking place this week, and it does
+ contain improvements over previous versions, in the install procedures
+ which are primarily what is to be looked at.
+
+%% SiSU Sabaki, version 0.1.2-18 of 2005w04/0 (2005-01-30):
+ sisu-sabaki_0.1.2-18_2005w04-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-18_2005w04-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-18_2005w04-0.tar.gz)=
+ 99cb98163fad28aec1111429d505e8c54cc6f353
+
+ * Rakefile modified, same result ... a few more options
+
+ * touch to vim folds
+
+ * cosmetic change to code headers
+
+ * a touch related to initialisation of directories (probably more to follow),
+ checks done as to whether to -C on use of -m and -M flags
+
+ * Held back and released at the same time as 0.1.2-19. While containing the
+ noted improvements over 0.1.2-17 was withheld as some remaining issues
+ resulting from the extension of features in 0.1.2-14 & 0.1.2-15, which
+ 0.1.2-18 goes some way to address as well.
+
+%% SiSU Sabaki, version 0.1.2-17 of 2005w04/4 (2005-01-27):
+ sisu-sabaki_0.1.2-17_2005w04-4.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-17_2005w04-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-17_2005w04-4.tar.gz)=
+ e61952bcde4b7cd936fdcd35835287d50af83814
+
+ * Test documents regenerated.
+
+ * Bugfix release, fixing bug intruduced by longtime planned nifty new feature
+ introduced in 0.1.2-14 and 0.1.2-15 ¿ in keeping with markup ergonomics,
+ emphasis, i.e. word list to be made bold and italics can be adjusted in
+ skins as well as in headers, or directly in text, see 0.1.2-14 and 0.1.2-15
+ release and notes below for general details.
+
+ * bugfix of feature introduced in 0.1.2-15
+ single fix for bug in 0.1.2-15 (markup wordlist defaults and skin
+ adjustment), 0.1.2-16 (earlier bugfix). In special circumstances the bug
+ could also affect 0.1.2-14 (markup wordlist header adjustment)
+
+ * max pdf image size optimised for landscape output. sizes changed in
+ 0.1.2-16, incidentally, really should have different maximum values for
+ landscape and portrait, planned.
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.2-16 of 2005w04/4 (2005-01-27):
+ sisu-sabaki_0.1.2-16_2005w04-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-16_2005w04-4.tar.gz)=
+ d6ab8845e160821fc41bdd79a5f6b35df0ce236a
+
+ * bugfix release which itself had to be fixed, see bugfix, 0.1.2-17 of 2005w04/4
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.2-15 of 2005w04/3 (2005-01-26):
+ sisu-sabaki_0.1.2-15_2005w04-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-15_2005w04-3.tar.gz)=
+ 5b101f13f4cef41989ace6d801b657ab559f95c5
+
+ * in keeping with markup ergonomics, emphasis, i.e. word list to be made bold
+ and italics can be adjusted in skins as well as in headers (0.1.2-14), or
+ directly in text (as before), see 0.1.2-14 release and notes below for
+ general details.
+
+ * See bugfix, 0.1.2-17 of 2005w04/4
+
+%% SiSU Sabaki, version 0.1.2-14 of 2005w04/3 (2005-01-26):
+ sisu-sabaki_0.1.2-14_2005w04-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-14_2005w04-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-14_2005w04-3.tar.gz)=
+ 55cb833cae5cd8e4e2c44ff09c9574a90877275b
+
+ * auto-detect and configure output directory (autorun sisu -C if related
+ directories are not detected)
+
+ * minor touch to Rakefile
+
+ * in keeping with markup ergonomics, word list to emphasise, ie bold and
+ italics can be added in document headers,[*] where a word is to be
+ consistently tagged in this way
+
+ * documentation updated accordingly
+
+%% SiSU Sabaki, version 0.1.2-13 of 2005w03/0 (2005-01-23):
+ sisu-sabaki_0.1.2-13_2005w03-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-13_2005w03-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-13_2005w03-0.tar.gz)=
+ dc540fe8152651dec93454401e6703064734b4bc
+
+ * Rakefile updated (rake help)
+
+%% SiSU Sabaki, version 0.1.2-12 of 2005w03/6 (2005-01-22):
+ sisu-sabaki_0.1.2-12_2005w03-6.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-12_2005w03-6.tar.gz
+ SHA1(sisu-sabaki_0.1.2-12_2005w03-6.tar.gz)=
+ 1674a9189c30726be2225b8576eae847ab9aaaee
+
+ * Rakefile added (sudo rake)
+
+%% SiSU Sabaki, version 0.1.2-11 of 2005w03/5 (2005-01-21):
+ sisu-sabaki_0.1.2-11_2005w03-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-11_2005w03-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-11_2005w03-5.tar.gz)=
+ 1eb07edd9f3e83cd4792f2c4c533fb97d70bac72
+
+ * removed install.rb which has been stripped of almost all function (and rely
+ on setup.rb)
+
+%% SiSU Sabaki, version 0.1.2-10 of 2005w03/5 (2005-01-21):
+ sisu-sabaki_0.1.2-10_2005w03-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-10_2005w03-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-10_2005w03-5.tar.gz)=
+ 375b0bf022d2c0f8a73ded67c4155821b6afa0bb
+
+ * some basic default install issues...
+
+ * Minero Aoki's setup.rb used for basic installation, but rough home brew
+ install.rb copies remaining required files to /etc. setup.rb used to
+ install sisu package (bin,lib,data) apart from the /etc directory.
+ install.rb used for /etc only. Will switch to using only setup.rb when it
+ sets up etc in addition to bin, lib, and data. When there is time,
+ (possibly as late as next month) will work towards having a release that
+ uses setup.rb for installation.
+
+%% SiSU Sabaki, version 0.1.2-9 of 2005w03/4 (2005-01-20):
+ sisu-sabaki_0.1.2-9_2005w03-4.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-9_2005w03-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-9_2005w03-4.tar.gz)=
+ c0080dc1f58f8889845ac34c38d995bc7e33badc
+
+ * only change is to man pages
+
+%% SiSU Sabaki, version 0.1.2-8 of 2005w03/3 (2005-01-19):
+ sisu-sabaki_0.1.2-8_2005w03-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-8_2005w03-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-8_2005w03-3.tar.gz)=
+ 4fa129cc49d5ecf1f4deed14129904e6bd6bf37a
+
+ * Still pre-setup.rb
+
+ * Minero Aoki's setup.rb and the rough home brew install.rb put together for
+ sisu, both included...
+
+ * setup.rb included and can be used to install sisu package (bin,lib,data)
+ apart from the /etc directory
+
+ * install.rb still used for general installation of sisu package (bin,lib,etc),
+ it does nothing with data directory
+
+ * man page updated, and can be "installed" using setup.rb
+
+%% SiSU Sabaki, version 0.1.2-7 of 2005w03/3 (2005-01-19):
+ sisu-sabaki_0.1.2-7_2005w03-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-7_2005w03-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-7_2005w03-3.tar.gz)=
+ 9953ecc0a3e3e23733e734c09210507649f3dc62
+
+ * Still pre-setup.rb
+
+ * directory structure maps that used by setup.rb
+
+%% SiSU Sabaki, version 0.1.2-6 of 2005w03/3 (2005-01-19):
+ sisu-sabaki_0.1.2-6_2005w03-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-6_2005w03-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-6_2005w03-3.tar.gz)=
+ 10dea0de4424180b8af2413a95c165286022eafe
+
+Previous bundle inclomplete, and withdrawn
+SHA1(sisu-sabaki_0.1.2-5_2005w03-2.tar.gz)=
+6c39c531356e7a954d9e49c6fac4541fe6f9ce89
+
+ * Still pre-setup.rb
+
+ * using yaml instead of pstore for version info, taken from read-only /etc
+
+ * no attempt to setup ~/.sisu resource configuration directory, make it
+ yourself as required.
+
+%% SiSU Sabaki, version 0.1.2-4 of 2005w03/1 (2005-01-17):
+ sisu-sabaki_0.1.2-4_2005w03-1.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-4_2005w03-1.tar.gz
+ SHA1(sisu-sabaki_0.1.2-4_2005w03-1.tar.gz)=
+ 80e8a4ebfac3989174a0b9be7afa5cc9dc22e935
+
+ * minor fix made to LaTeX for pdfs (package loaded twice)
+
+ * minor fix made to example cgi search form, front-end for Postgresql db, (a
+ counter contained a typo, plus cosmetic touches)
+
+%% SiSU Sabaki, version 0.1.2-3 of 2005w02/4 (2005-01-13):
+ sisu-sabaki_0.1.2-3_2005w02-4.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-3_2005w02-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-3_2005w02-4.tar.gz)=
+ b94ff6f770d11a9ef33fa989b8aeefa07aac6432
+
+ * Installation and configuration issues.
+
+ * does output check on directory permissions, and defaults to home directory if
+ web server directory does not have write permission
+
+ * can switch off external programs that are unavailable in resource
+ configuration file
+
+ * note in README on which external programs are used
+
+ * bug detected [2005-01-16] in released behaviour of object citation numbering,
+ tables should be numbered. Not yet fixed. Unlikely to touch before
+ mid-February.
+ Not certain when behaviour changed. It appears to be pre-introduction of
+ new table syntax. Each table gets an ocn, required amongst other things for
+ relational database. Check consistency of ocn elsewhere.
+
+%% SiSU Sabaki, version 0.1.2-2 of 2005w02/2 (2005-01-11):
+ sisu-sabaki_0.1.2-2_2005w02-2.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-2_2005w02-2.tar.gz
+ SHA1(sisu-sabaki_0.1.2-2_2005w02-2.tar.gz)=
+ 7ca13bb377bb7403cf2b9436984c2c8a1ac629b3
+
+ * manual location anchor/marker/tagging provided for html, (at present in html
+ only, adds nothing to other output types). Interactive help (and SiSU_MARKUP
+ textfile in tar bundle) updated accordingly.
+ Very minor code addition, has existed previously, decided is still useful
+ on some occasions. Use sparingly, the author is currently responsible for
+ non-duplication of such names. There is a remote possibility it breaks
+ something. An example of such a link:
+ http://www.jus.uio.no/sisu/SiSU/2004#ibm
+ http://www.jus.uio.no/sisu/SiSU/2004#2004-06-17
+
+ * endnotes were missing from the html full length, scroll outputs, and are now
+ back.
+
+ * skins included (now properly marked for revision control - or rather
+ accidental marking as "boring" removed for darcs).
+
+%% SiSU Sabaki, version 0.1.2-1 of 2005w02/1 (2005-01-10):
+ sisu-sabaki_0.1.2-1_2005w02-1.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-1_2005w02-1.tar.gz
+ SHA1(sisu-sabaki_0.1.2-1_2005w02-1_sha1)=
+ 6afa36b152359da215df84244cb156c2ee61d61f
+
+ * previous bundle not quite complete (skins missing) - [still missing were
+ marked incorrectly for darcs revision control exclusion]
+
+ * also previous version 0.1.2-0 despite its name worked as part of previous
+ 0.1.1 version, directories created etc.
+
+%% SiSU Sabaki, version 0.1.2-0 of 2005w01/0 (2005-01-09):
+ sisu-sabaki_0.1.2-0_2005w01-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-0_2005w01-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-0_2005w01-0_sha1)=
+ 7c500761f8aadb55faaf3aec4d20996f38462ece
+
+ * syntax tidying and small additions, old syntax remains effective, but
+ possibility to reduce some repetatition. See interactive help on markup
+ which has been updated accordingly, and within bundle SiSU_MARKUP.txt
+
+ * bugfix, pdf: corrects inconsistent behaviour in marking up urls in
+ footnotes, should be live hyperlinks and small font, introduced in 0.1.1-2
+
+ * bugfix, metaverse: tables with headings did not previously work with
+ updated table syntax, in release 0.1.1-2
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.1-3 of 2005w01/6 (2005-01-08):
+ sisu-sabaki_0.1.1-3_2005w01-6.tar.gz
+ SHA1(sisu-sabaki_0.1.1-3_2005w01-6.tar.gz)=
+ 21d9591f1c069e7111470b2bc98751a36833030d
+
+ * The default markup for: tables, grouped text, poems, code etc. has been
+ tidied/simplified. These are changes that have been planned for some time
+ and bring the style for these in line with the other markup syntax used.
+ The default syntax has been stable for a few years now, I thought this best
+ done prior to use by others. Note however: the previous syntax form is
+ still supported but depreciated. The default syntax has been stable for a
+ few years now.
+
+ * For help on markup syntax see one of the following:
+
+ interactive help - type 'sisu help tables'
+
+ marked up text samples
+
+ the SiSU_Markup.txt file provided with the program
+
+ * Quick fixes have been made to the vim syntax file which is provided.
+
+ [Will slow down updates for a while though there are still issues with the install.]
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.1-2 of 2005w01/6 (2005-01-08):
+ SHA1(sisu-sabaki_0.1.1-2_2005w01-6.tar.gz)=
+ 6acb02f98d100ff9a7f7a01ad71b88c215488009
+
+ * Few lines of code changed from 0.1.1-2, which is withdrawn.
+
+%% SiSU Sabaki, version 0.1.1-1 of 2005w01/5 (2005-01-07):
+ sisu-sabaki_0.1.1-1_2005w01-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.1-1_2005w01-5.tar.gz
+ SHA1(sisu-sabaki_0.1.1-1_2005w01-5_sha1)=
+ 541bad03cba1bcb35c2582534e4312acc0bacd70
+
+ * install touch
+
+ * version information moved
+
+ * Still things to sort out with installation
+
+ * Manually change ownership on the resource configuration directory
+
+%% SiSU Sabaki, version 0.1.1-0 of 2005w01/4 (2005-01-06):
+ sisu_0.1.1-0_2005w01-4.tgz
+ http://www.jus.uio.no/sisu/download/sisu_0.1.1-0_2005w01-4.tgz
+ SHA1(sisu_0.1.1-0_2005w01-4.tgz)=
+ ff5ca4cf45d34ca3a6491e8ba29da30474b47b2b
+
+ * Modifications to installation script, configuration paths, and help only.
+
+ * Install script a bit smarter, (also installs the configuration files that
+ come along with the sample marked up documents) and more information
+ provided on paths, both by the install script and interactive help once
+ installed. Not much effort spent on installer, however, he directory
+ structure used is fine, paths may need to be reset, and information
+ provided on what is being attempted should make it easier to figure out
+ what may need to be done should problems arise.
+
+ [preferably run old remove script prior to install... otherwise you link
+ /usr/local/bin/sisu to /usr/local/bin/sisu-0.1.1]
+
+First release of SiSU - sisu_0.1.0-9_2005w01-2.tgz
+ http://www.jus.uio.no/sisu/download/sisu_0.1.0-9_2005w01-2.tgz
+ SHA1(sisu_0.1.0-9_2005w01-2.tgz)=
+ 14b230ba5a4c8f1c7264b38cd2d9c95a97477f3a
+
+ SiSU Sabaki, version 0.1.0-9 of 2005w01/2 (2005-01-04) was released to the
+ public on January 4th 2005. It may be downloaded from:
+ http://www.jus.uio.no/sisu/download/sisu_0.1.0-9_2005w01-2.tgz
+
+%% DEVELOPMENT (Merged into STABLE) MANIFEST (@ 0.1.5 branch)
+
+SiSU Sabaki development-branch, version 0.5.8 of 2005w15-0 [==0.4.3]
+
+SiSU Sabaki development-branch, version 0.5.4 of 2005w15-4 [==0.4.2]
+
+SiSU Sabaki development-branch, version 0.5.3 of 2005w15-3 [==0.4.1]
+
+SiSU Sabaki development-branch, version 0.5.0 of 2005w15-2 [==0.4.0]
+
+SiSU Sabaki development-branch, version 0.3.0 of 2005w14-0 [==0.1.5-58]
+* substantively the same as 0.2.0 [== 0.1.4-11]
+
+SiSU Sabaki development-branch, version 0.1.5-58 of 2005w14/6
+* substantively the same as 0.1.4-11
+
+SiSU Sabaki development-branch, version 0.1.5-55 of 2005w13/6
+* substantively the same as 0.1.4-10
+
+SiSU Sabaki development-branch, version 0.1.5-46 of 2005w13/2
+* substantively the same as 0.1.4-9
+
+SiSU Sabaki development-branch, version 0.1.5-44 of 2005w13/2
+* substantively the same as 0.1.4-8
+
+SiSU Sabaki development-branch, version 0.1.5-33 of 2005w12/3
+* substantively the same as 0.1.4-7
+
+SiSU Sabaki development-branch, version 0.1.5-29 of 2005w12/1
+* substantively the same as 0.1.4-6
+
+SiSU Sabaki development-branch, version 0.1.5-21 of 2005w11/2
+* substantively the same as 0.1.4-5
+
+SiSU Sabaki development-branch, version 0.1.5-20 of 2005w11/1
+* substantively the same as 0.1.4-4
+
+SiSU Sabaki development-branch, version 0.1.5-15 of 2005w10/4
+* substantively the same as 0.1.4-3
+
+SiSU Sabaki development-branch, version 0.1.5-12 of 2005w10/4
+* substantively the same as 0.1.4-2
+
+SiSU Sabaki development-branch, version 0.1.5-11 of 2005w10/2
+* substantively the same as 0.1.4-1
+
+SiSU Sabaki development-branch, version 0.1.5-0 of 2005w06/4
+* substantively the same as 0.1.4-0
+
diff --git a/README b/README
new file mode 100644
index 00000000..a688fcb5
--- /dev/null
+++ b/README
@@ -0,0 +1,422 @@
+SiSU 0.49 2007w08/5 20070223
+homepage: http://www.jus.uio.no/sisu
+
+%% Description
+---------------
+
+ SiSU is lightweight markup based document creation and publishing framework
+ that is controlled from the command line. Prepare documents for SiSU using
+ your text editor of choice, then use SiSU to generate various output document
+ formats.
+
+ With minimal preparation of a plain-text (UTF-8) file using its native
+ markup-syntax, SiSU produces: plain-text, HTML, XHTML, XML, ODF:ODT
+ (Opendocument), LaTeX, PDF, and populates an SQL database (PostgreSQL or
+ SQLite) in paragraph sized chunks so that document searches are done at this
+ "atomic" level of granularity.
+
+ Outputs share a common citation numbering system, and any semantic meta-data
+ provided about the document.
+
+ SiSU also provides concordance files, document content certificates and
+ manifests of generated output.
+
+ SiSU takes advantage of well established open standard ways of representing
+ text, and provides a bridge to take advantage of the strengths of each,
+ while remaining simple. SiSU implements across document formats a "useful
+ common feature set" [coming from a humanities, law, and possibly social
+ sciences perspective, rather than technical or scientific writing] ...
+ focus is primarily on content and data integrity rather than appearance,
+ (though outputs in the various formats are respectable).
+
+ A vim syntax highlighting file and an ftplugin with folds for sisu markup is
+ provided. Vim 7 includes syntax highlighting for SiSU.
+
+ man pages, and interactive help are provided.
+
+ Dependencies for various features are taken care of in sisu related packages.
+ The package sisu-complete installs the whole of SiSU.
+
+ Additional document markup samples are provided in the package
+ sisu-markup-samples which is found in the non-free archive the licenses for
+ the substantive content of the marked up documents provided is that provided
+ by the author or original publisher.
+
+ Homepage: http://www.jus.uio.no/sisu
+
+-----
+
+SiSU - simple information structuring universe, is a publishing tool, document
+generation and management, (and search enabling) tool primarily for literary,
+academic and legal works.
+
+SiSU can be used for Internet, Intranet, local filesystem or cd publishing.
+
+SiSU can be used directly off the filesystem, or from a database.
+
+SiSU's scalability, is be dependent on your hardware, and filesystem (in my
+case Reiserfs), and/or database Postgresql.
+
+Amongst it's characteristics are:
+
+* simple mnemonoic markup style,
+
+* the ability to produce multiple output formats, including
+html, structured XML, LaTeX, pdf (via LaTeX), stream to a relational database
+whilst retaining document structure - Postgresql and Sqlite,
+
+* that all share a common citation system (a simple idea from which much good),
+possibly most exciting, the following: if fed into a relational database (as it
+can be automatically), the document set is searchable, with results displayed
+at a paragraph level, or the possibility of an indexed display of documents in
+which the match is found together with a hyperlinked listing for each of each
+paragraph in which the match is found. In any event citations using this system
+(with or without the relational database) are relevant for all output formats.
+
+* it is command line driven, and can be set up on a remote server
+
+* Documents are marked up in SiSU syntax in your favourite editor. SiSU syntax
+may be regarded as a type of smart ascii - which in its basic form is simpler
+than the most elementary html. There is currently a syntax highlighter, and
+folding for Vim. Syntax highlighters for other editors are welcome.
+
+Input files should be UTF-8
+
+Once set up it is simple to use.
+
+%% Online Information, places to look
+---------------
+
+http://www.jus.uio.no/sisu
+
+Download Sources:
+ http://www.jus.uio.no/sisu/SiSU/download.html#current
+ http://www.jus.uio.no/sisu/SiSU/download.html#debian
+or the same:
+ http://www.jus.uio.no/sisu/sisu_download/download.html#current
+ http://www.jus.uio.no/sisu/sisu_download/download.html#debian
+
+%% Installation
+---------------
+NB. Platform is Unix / Linux.
+
+%% Debian
+---------------
+If you use Debian use the Debian packages,
+check the information at:
+ http://www.jus.uio.no/sisu/SiSU/download.html#debian
+ http://www.jus.uio.no/sisu/sisu_download/download.html#debian
+
+(A) SiSU is available directly off the Debian archives for Sid and testing. It
+should necessary only to run as root:
+
+ aptitude update
+ aptitude install sisu-complete
+
+(B) If there are newer versions of SiSU upstream of the Debian archives, they
+will be available by adding the following to your /etc/apt/sources.list
+
+ deb http://www.jus.uio.no/sisu/archive unstable main non-free
+ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free
+
+ [the non-free line is for document markup
+ samples, for which the substantive text is
+ provided under the author or original
+ publisher's license and which in most cases will
+ not be debian free software guideline compliant]
+
+Then as root run:
+ aptitude update
+ aptitude install sisu-complete
+
+%% RPM
+---------------
+RPMs are provided though untested, they are prepared by running alien against the
+source package, and against the debs.
+
+They may be downloaded from:
+ http://www.jus.uio.no/sisu/SiSU/download.html#rpm
+
+%% Source package .tgz
+---------------
+Otherwise to install SiSU from source, check information at:
+ http://www.jus.uio.no/sisu/SiSU/download.html#current
+ http://www.jus.uio.no/sisu/sisu_download/download.html#current
+
+two alternative modes of installation from source are provided,
+setup.rb (by Minero Aoki) and a rant(by Stefan Lang) built install file,
+in either case: the first steps are the same, download and unpack the
+source file:
+
+1. Download the latest source (information available) from:
+ http://www.jus.uio.no/sisu/SiSU/download.html#current
+
+2. Unpack the source
+
+%% to use setup.rb
+---------------
+this is a three step process,
+in the root directory of the unpacked SiSU as root type:
+
+ ruby setup.rb config
+ ruby setup.rb setup
+ #[as root:]
+ ruby setup.rb install
+
+ further information:
+ http://i.loveruby.net/en/projects/setup/
+ http://i.loveruby.net/en/projects/setup/doc/usage.html
+
+%% to use install (prapared with "Rant")
+---------------
+in the root directory of the unpacked SiSU as root type:
+ ruby install
+
+or
+ ruby install base
+
+This makes use of Rant (by Stefan Lang) and the provided Rantfile. It has been
+configured to do post installation setup setup configuration and generation of
+first test file. Note however, that additional external package dependencies,
+such as tetex-extra are not taken care of for you.
+
+ further information:
+ http://make.rubyforge.org/
+ http://rubyforge.org/frs/?group_id=615
+
+For a list of alternative actions you may type:
+ ruby install help
+ ruby install -T
+
+Dependencies
+--------------
+Once installed see 'man 8 sisu' for some information on additional programs
+that sisu makes use of, and that you may need or wish to install. (this will
+depend on such factors as whether you want to generate pdf, whether you will be
+using SiSU with or without a database, ...) 'man sisu_markup-samples' may also be of
+interest if the sisu-markup-samples package has also been installed.
+
+The information in man 8 may not be most up to date, and it is possible that
+more useful information can be gleaned from the following notes taken from the
+Debian control file (end edited), gives an idea of additional packages that
+SiSU can make use of if available, (the use/requirement of some of which are
+interdependent for specific actions by SiSU):
+
+Package: sisu
+Depends: ruby (>= 1.8.4), libwebrick-ruby
+Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, librmagick-ruby, trang,
+ tidy, librexml-ruby, zip, unzip, openssl, rsync, openssh-client | lsh-client,
+ keychain, hyperestraier, kdissert
+Suggests: libfcgi-ruby1.8, rcs | cvs, lv, texinfo, pinfo, rename
+
+Package: sisu-complete
+Depends: ruby (>= 1.8.4), sisu, sisu-pdf, sisu-postgresql, sisu-sqlite
+Recommends: hyperestraier
+
+Package: sisu-pdf
+Depends: sisu, tetex-bin | texlive-base-bin, tetex-extra | texlive-latex-extra,
+ texlive-latex-extra, latex-ucs
+Suggests: evince, xpdf
+
+Package: sisu-postgresql
+Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
+Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1
+
+Package: sisu-sqlite
+Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
+Suggests: libdbd-sqlite
+
+Package: sisu-markup-samples
+Depends: sisu
+
+%% Quick start
+---------------
+Most of the installation should be taken care of by the aptitude or rant
+install. (The rant install if run in full will also test run the generation of
+the first document).
+
+After installation of sisu-complete, move to the document samples directory
+
+ cd /usr/share/doc/sisu/sisu_markup_samples/dfsg
+
+and run
+
+ sisu -3 free_as_in_freedom.rms_and_free_software.sam_williams.sst
+
+[or the same:
+ sisu -NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst
+]
+
+look at output results, see the "sisu_manifest" page created for the document
+
+or to generate an online document move to a writable directory, as the file
+will be downloaded there and e.g.
+
+sisu -3 http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst
+
+the database stuff is extra perhaps, the latex stuff could be considered extra
+perhaps but neither needs to be installed for most of sisu output to work
+
+examine source document, vim has syntax support
+
+gvim free_as_in_freedom.rms_and_free_software.sam_williams.sst
+
+additional markup samples in
+http://www.jus.uio.no/sisu/SiSU/2.html
+
+For help
+ man sisu
+
+or
+ sisu --help
+
+e.g.
+sisu --help env
+for the way sisu "sees/maps" your system
+sisu --help commands
+for list of commands and so on
+
+%% Configuration files
+---------------
+
+The default configuration/setup is contained within the program and is altered
+by configuration settings in /etc/[sisu version]/sisurc.yml
+or in ~/.sisu/sisurc.yml
+
+* configuration file - a yaml file
+ /etc/sisu/[sisu version]/sisurc.yml
+ ~/.sisu/sisurc.yml
+
+* directory structure - setting up of output and working directory.
+
+* skins - changing the appearance of a project, directory or individual
+documents within ~/.sisu/skin
+ ~/.sisu/skin/doc contains individual skins, with symbolic links from
+ ~/.sisu/skin/dir if the contents of a directory are to take a particular
+ document skin.
+
+* additional software - eg. Tex and LaTeX (tetex, tetex-base, tetex-extra on
+Debian), Postgresql, [sqlite], trang, tidy, makeinfo, ... none of which are
+required for basic html or XML processing.
+
+* if you use Vim as editor there is a syntax highlighter and fold resource
+config file for SiSU. I hope more syntax highlighters follow.
+
+There are post installation steps (which are really part of the overall
+installation)
+
+sisu -C in your marked up document directory, should do some auto-configuring
+provided you have the right permissions for the output directories. (and
+provided the output directories have already been specified if you are not
+using the defaults).
+
+%% Use General Overview
+---------------
+Documents are marked up in SiSU syntax and kept in an ordinary text editable
+file, named with the suffix .sst, or .ssm
+
+Marked up SiSU documents are usually kept in a sub-directory of your choosing
+
+use the interactive help and man pages
+ sisu --help
+ man sisu
+
+%% Help
+---------------
+
+interactive help described below, or man page:
+
+ man sisu
+
+ man 8 sisu
+ 'man sisu_markup-samples' [if the sisu-markup-samples package is also installed]
+
+Once installed an interactive help is available typing 'sisu' (without) any
+flags, and select an option:
+
+ sisu
+
+alternatively, you could type e.g.
+ sisu --help commands
+ sisu --help env
+ sisu --help headers
+ sisu --help markup
+ sisu --help headings
+ etc.
+
+for questions about mappings, output paths etc.
+ sisu --help env
+ sisu --help path
+ sisu --help directory
+
+%% Directory Structure
+---------------
+Once installed, type:
+ sisu --help env
+
+%% Configuration File
+---------------
+
+The defaults can be changed via SiSU's configure file sisurc.yml which the
+program expects to find in ./_sisu ~/.sisu or /etc/sisu
+
+%% Markup
+---------------
+
+See man pages.
+ man sisu
+
+Once installed there is some information on SiSU Markup in its help:
+ sisu --help markup
+and
+ sisu --help headers
+
+Sample marked up document are provided with the download tarball in the
+directory:
+ ./data/doc/sisu/sisu_markup_samples/dfsg
+
+These are installed on the system usually at:
+ /usr/share/doc/sisu/sisu_markup_samples/dfsg
+
+More markup samples are available in the package sisu-markup-samples
+
+Many more are available online off:
+ http://www.jus.uio.no/sisu/SiSU/2.html
+
+%% Additional Things
+---------------
+
+There is syntax support for some editors provided (together with a README file) in
+
+ ./data/sisu/conf/syntax
+
+usually installed to:
+
+ /usr/share/sisu/conf/syntax
+
+%% License
+---------------
+
+License: GPL 2 or later see the copyright file in
+
+ ./data/doc/sisu
+
+usually installed to:
+
+ /usr/share/doc/sisu
+
+%% SiSU Standard
+-----------------
+
+SiSU uses:
+
+* Standard SiSU markup syntax,
+* Standard SiSU meta-markup syntax, and the
+* Standard SiSU object citation numbering and system
+
+© Ralph Amissah 1997, current 2006.
+All Rights Reserved.
+
+* however note the License section
+
+
diff --git a/Rantfile b/Rantfile
new file mode 100644
index 00000000..ff64da3f
--- /dev/null
+++ b/Rantfile
@@ -0,0 +1,518 @@
+#!/usr/bin/env ruby
+raise 'Please, use ruby1.8.4 or later.' if RUBY_VERSION < '1.8.4'
+=begin
+ Rantfile mapping setup.rb directory structure
+
+ SiSU Simple information Structuring Universe, Serialised information, Structured Units
+ * SiSU at present is for the Linux/Unix platform
+ * See homepage at: << http://www.jus.uio.no/sisu/SiSU >>
+ * & << http://www.jus.uio.no/sisu/download >>
+
+ Rant is a Ruby 'ant' by Stefan Lang
+
+ For Setup/Installation SiSU uses either:
+ * Minero Aoki's setup.rb, provided along with SiSU, or
+ * Rant which may be downloaded and installed from:
+ http://make.rubyforge.org/
+
+ * Name: Rant install/setup file for SiSU - Simple information Structuring Universe, Serialised information Structured Units
+ *
+ * Author: Ralph@Amissah.com
+ * Description: Rant install/setup file which maps directory structure used by setup.rb
+ * arch-tag: Rant install/setup file which maps directory structure used by setup.rb
+ * $Id$
+
+ Copyright (C) 2005 Ralph Amissah (first release edition)
+ Copyright (C) 1997 Ralph Amissah (first edition)
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2005.
+ All Rights Reserved.
+
+ * Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+ * NOTE reminder to create independent setup file called install:
+ rant-import --auto install
+ then you can, as root (for default action):
+ ruby install
+ or for help on alternative actions:
+ ruby install help
+ ruby install -T
+
+=end
+#%% produce a makefile suitable for the target platform
+#require 'mkmf'
+#create_makefile("sisu")
+require 'find'
+require 'fileutils'
+require 'rbconfig.rb'
+include FileUtils
+@dir=Hash.new
+@proj=Hash.new
+ #%% project specific variables
+@proj[:name]='SiSU'
+@proj[:rant]="Rantfile for the installation/setup of #{@proj[:name]}"
+@proj[:platform_notice]="[#{@proj[:name]} is for the Linux/Unix Platforms]"
+@dir[:proj]='sisu'
+Version=` pwd | grep -o "[0-9]+\.[0-9]+\.[0-9]+$" | grep -o "^[0-9]+\.[0-9]+"` #%% NOTE placing version number permits fine grained removal of version directories if used in lib and conf / etc
+ #%% system configuration
+PKG_VERSION=Version
+@dir[:version]=Version
+@host=Config::CONFIG['host']
+@dir[:arch]=Config::CONFIG['archdir']
+@dir[:sitearch]=Config::CONFIG['sitearchdir']
+@dir[:bin]=Config::CONFIG['bindir']
+#@dir_lib=Config::CONFIG['rubylibdir']
+@dir[:lib]=Config::CONFIG['sitelibdir']
+#@dir_lib='/usr/local/lib/site_ruby/1.9' #Config::CONFIG['sitelibdir']
+@dir[:data]=Config::CONFIG['datadir']
+@dir[:share]="#{Config::CONFIG['datadir']}/sisu"
+@dir[:conf]=Config::CONFIG['sysconfdir'] #etc
+@dir[:man]=Config::CONFIG['mandir']
+@dir[:vim]="#{Config::CONFIG['datadir']}/sisu/vim"
+@dir[:out]="#{Config::CONFIG['localstatedir']}/#{@dir[:proj]}"
+@rubylib=Config::CONFIG['LIBRUBYARG_SHARED']
+@pwd=Dir.pwd
+def answer?(ask)
+ resp='redo'
+ print ask + " ['yes', 'no' or 'quit']: "
+ resp=File.new('/dev/tty').gets.strip
+ #resp=gets.strip
+ ans=if resp == 'yes': true
+ elsif resp == 'no': false
+ elsif resp =~/^quit|exit$/: exit
+ else puts "[please type: 'yes', 'no' or 'quit']"
+ answer?(ask)
+ end
+end
+def default_notice
+ ans= %{#{@proj[:rant]}
+ Information on alternative actions is available using:
+ "rant help" or "rant -T"
+ Default action selected - "install and to setup #{@proj[:name]}" proceed? }
+ resp=answer?(ans)
+ exit unless resp
+end
+def get_username
+ gets.strip
+end
+def chmod_file(place)
+ if place =~/\/bin/: File.chmod(0755,place)
+ else File.chmod(0644,place)
+ end
+end
+def chmod_util(place)
+ if place =~/\/bin/: chmod(0755,place)
+ else chmod(0644,place)
+ end
+end
+ #%% using a directory and its mapping
+def setup_find_create(dir_get,dir_put) #primary,
+ Find.find("#@pwd/#{dir_get}") do |f|
+ stub=f.scan(/#@pwd\/#{dir_get}\/(\S+)/).join
+ place="#{dir_put}/#{stub}"
+ action=case
+ when File.file?(f)
+ cp(f,place)
+ chmod_file(place)
+ "-> #{dir_put}/"
+ when File.directory?(f)
+ FileUtils.mkpath(place) unless FileTest.directory?(place)
+ "./#{dir_get}/"
+ else '?'
+ end
+ puts "#{action}#{stub}"
+ end
+end
+def setup_find_cp_r(dir_get,dir_put) #secondary, using recursive copy
+ Find.find("#@pwd/#{dir_get}") do |f|
+ stub=f.scan(/#@pwd\/#{dir_get}\/(\S+)/).join
+ place="#{dir_put}/#{stub}"
+ case
+ when File.file?(f)
+ cp_r(f,place)
+ chmod_util(place)
+ when File.directory?(f)
+ mkdir(place) unless FileTest.directory?(place)
+ end
+ end
+end
+ #%% using a single filelist
+#filelist broken in switch to rant from rake
+#filelist=Rant::FileList.new('bin/*','lib/**/*','conf/**/*','data/**/*','man/**/*')
+#filelist=Rant::FileList.new('bin/*','lib/**/*','conf/**/*','data/**/*','data/man/**/*')
+def dest(f) #filelist mapping - note currently does not get 'data/man'
+ stub=f.scan(/^\S+?\/(\S+)/).join
+ place=case f
+ when /^bin/; "#{@dir[:bin]}/#{stub}"
+ when /^lib/; "#{@dir[:lib]}/#{stub}"
+ when /^conf/; "#{@dir[:conf]}/#{stub}"
+ when /^data/; "#{@dir[:data]}/#{stub}" unless f =~/^data\/sisu/
+ when /^share/; "#{@dir[:share]}"
+ when /^man/; "#{@dir[:man]}/#{stub}"
+ when /^vim/; "#{@dir[:conf]}/#{stub}/vim"
+ else 'ERROR' #change
+ end
+end
+def setup_filelist_cp_r(filelist) #secondary, using recursive copy
+ filelist.sort.each do |f|
+ place=dest(f)
+ case
+ when File.file?(f)
+ cp_r(f,place)
+ chmod_util(place)
+ when File.directory?(f)
+ mkdir(place) unless FileTest.directory?(place)
+ end
+ end
+end
+def setup_filelist_create(filelist) #secondary
+ filelist.sort.each do |f|
+ place=dest(f)
+ action=case
+ when File.file?(f)
+ cp(f,place)
+ chmod_file(place)
+ "-> #{place}"
+ when File.directory?(f)
+ p place
+ File.mkpath(place) unless FileTest.directory?(place)
+ ".#{place}/"
+ else '?'
+ end
+ puts action
+ end
+end
+def rant_system_info
+ puts <<WOK
+ #{@proj[:platform_notice]}
+
+ Host
+ host: #@host
+ arch: #{@dir[:arch]}
+ sitearch: #{@dir[:sitearch]}
+
+ Directories for installation
+ bin: #{@dir[:bin]}
+ lib (site-ruby): #{@dir[:lib]}/#{@dir[:proj]}/#{Version}
+ conf [etc]: #{@dir[:conf]}/#{@dir[:proj]}
+ data (odf, shared images): #{@dir[:share]}
+ vim (vim syntax, highlighting, ftplugin): #{@dir[:data]}/sisu/vim
+ data (README, version_manifest): #{@dir[:data]}/doc/#{@dir[:proj]}
+ man (manual pages): #{@dir[:man]}
+ output: #{@dir[:out]}
+ processing: #{@dir[:out]}/processing
+ www: #{@dir[:out]}/www
+
+ rubylib: #@rubylib
+
+WOK
+end
+def rant_project_help
+ puts <<WOK
+
+#{@proj[:name]}
+ #{@proj[:rant]}
+ #{@proj[:platform_notice]}
+
+Commands quick start list
+
+ #{@proj[:name]} Rant Help: (This Rantfile uses the same directory structure as setup.rb)
+ rant -T # a task list, (generated by Rant) for more complete and up to date help
+ rant system # system info used
+
+ Quick start install and remove project #{@proj[:name]}
+ as root:
+ rant # install #{@proj[:name]}
+
+ rant setup # install #{@proj[:name]} (without additonal configuration and generating of test file)
+
+ rant reinstall # reinstall #{@proj[:name]}
+
+ rant remove # clobber/remove #{@proj[:name]}, current version: #{Version}
+ rant remove_package # clobber/remove #{@proj[:name]}, all versions
+
+For a more detailed and up to date list of command options use
+
+ rant -T
+
+WOK
+end
+def rant_tasks
+ sys('rant -T')
+end
+ #%% tasks
+desc "rant (as root type 'rant' for default action)"
+task :default => [:default_notice,:project]
+#task :default => [:help,:notice,:project]
+desc "Setup/Install #{@proj[:name]} and try generate a file"
+task :project=> [:setup_bin,:setup_lib,:setup_conf,:setup_share,:setup_data,:setup_man,:setup_vim,:post_install_note]
+desc "Setup/Install #{@proj[:name]}"
+task :setup=> [:setup_bin, :setup_lib,:setup_conf,:setup_share,:setup_data,:post_install] #, :help]
+desc "Setup/Install #{@proj[:name]}: bin, lib and conf (no data)"
+task :setup_base=> [:setup_bin,:setup_lib,:setup_conf,:setup_share,:setup_man,:setup_vim]
+desc "Setup/Install #{@proj[:name]} bin, lib and conf (no data and no attempt to do postinstall setup)"
+task :base=> [:setup_base]
+if File.directory?('bin') #bin
+ desc "Setup #{@proj[:name]} bin only, synonym :bin"
+ task :setup_bin => [:setup_bin]
+ task :bin => [:setup_bin]
+end
+if File.directory?('lib') #lib
+ desc "Setup #{@proj[:name]} lib only, synonym :lib"
+ task :setup_lib => [:setup_lib]
+ task :lib => [:setup_lib]
+end
+if File.directory?('conf') #conf or etc
+ desc "Setup #{@proj[:name]} conf only, synonyms :conf & :etc"
+ task :setup_conf => [:setup_conf]
+ task :conf => [:setup_conf]
+ task :setup_etc => [:setup_conf]
+ task :etc => [:setup_conf]
+end
+if File.directory?('data') #data
+ desc "Setup #{@proj[:name]} data only, synonyms :data & :examples"
+ task :setup_data => [:setup_data]
+ task :data => [:setup_data]
+ task :setup_examples => [:setup_data]
+ task :examples => [:setup_data]
+end
+if File.directory?('data/sisu') #share (odf shared-images)
+ desc "Setup #{@proj[:name]} shared data only (odf & shared images)"
+ task :setup_share => [:setup_share]
+ task :share => [:setup_share]
+end
+if File.directory?('man') #man pages
+ desc "Setup #{@proj[:name]} man pages only, synonyms :man"
+ task :setup_man => [:setup_man]
+ task :man => [:setup_man]
+end
+if File.directory?('data/vim') #man pages
+ desc "Setup #{@proj[:name]} vim config files only, synonyms :vim"
+ task :setup_vim => [:setup_vim]
+ task :vim => [:setup_vim]
+end
+desc "Setup/Install #{@proj[:name]}: bin, lib, conf and data (no attempt to do postinstall setup)"
+task :setup_only=> [:setup_bin,:setup_lib,:setup_conf,:setup_share,:setup_data,:help]
+#desc "Remove #{@proj[:name]} version: #{Version}"
+#task :remove => [:remove_version]
+desc "Remove #{@proj[:name]} (all versions)" #remove project
+task :remove_package => [:remove_bin, :remove_lib, :remove_conf]
+if File.directory?('bin') #bin
+ desc "Remove #{@proj[:name]} bin only" #remove bin
+ task :remove_bin => [:remove_bin]
+end
+if File.directory?('lib') #lib
+ desc "Remove #{@proj[:name]} lib only" #remove lib
+ task :remove_lib => [:remove_lib]
+end
+if File.directory?('conf') #conf
+ desc "Remove #{@proj[:name]} conf only" #remove conf
+ task :remove_conf => [:remove_conf]
+end
+#if File.directory?('data') #data
+# desc "Remove #{@proj[:name]} data only" #remove data
+# task :remove_data => [:remove_data]
+#end
+desc "Re-setup #{@proj[:name]}, synonym :reinstall" #resetup reinstall
+task :resetup => [:remove, :setup]
+task :reinstall => [:remove, :setup]
+desc "Re-setup #{@proj[:name]}: bin, lib, conf (ignore data), synonym :reinstall" #partial reinstall
+task :resetup_base => [:remove, :setup_base]
+task :reinstall_base => [:remove, :setup_base]
+if File.directory?('bin') #bin
+ desc "Re-setup #{@proj[:name]} bin, synonym :reinstall"
+ task :resetup_bin => [:remove_bin, :setup_bin]
+ task :reinstall_bin => [:remove_bin, :setup_bin]
+end
+if File.directory?('lib') #lib
+ desc "Re-setup #{@proj[:name]} lib, synonym :reinstall_lib"
+ task :resetup_lib => [:remove_lib, :setup_lib]
+ task :reinstall_lib => [:remove_lib, :setup_lib]
+end
+if File.directory?('conf') #conf
+ desc "Re-setup #{@proj[:name]} conf, synonyms :reinstall_conf & :resetup_etc"
+ task :resetup_conf => [:remove_conf, :setup_conf]
+ task :reinstall_conf => [:remove_conf, :setup_conf]
+ task :resetup_etc => [:remove_conf, :setup_conf]
+ task :reinstall_etc => [:remove_conf, :setup_conf]
+end
+if File.directory?('data/sisu') #share
+ desc "Re-setup #{@proj[:name]} shared data, (odf & images)"
+ task :resetup_share => [:remove_share, :setup_share]
+ task :reinstall_share => [:remove_share, :setup_share]
+end
+if File.directory?('man') #man
+ desc "Re-setup #{@proj[:name]} man, synonym :reinstall_man"
+ task :resetup_man => [:remove_man, :setup_man]
+ task :reinstall_man => [:remove_man, :setup_man]
+end
+desc "Setup Note"
+task :setup_note => [:help]
+desc "Note on post installation" #remove conf
+task :post_install_note => [:post_install_note]
+desc "System information used by #{@proj[:name]}"
+task :system => [:system_info,:project_help,:post_install_note]
+desc "show all system info available - parameters found"
+task :system_param => [:system_param]
+desc "Help"
+task :help => [:project_help,:system_info,:rant_tasks,:pi?]
+#desc "Setup/Install #{@proj[:name]} (uses filelist)"
+task :install => [:default_notice,:project]
+#:install uses filelist which was broken in switch to rant from rake, look at later
+#task :install => [:install]
+task :install_a => [:rant_default1]
+task :install_b => [:rant_default2]
+task :install_bin => [:setup_bin]
+desc "[make rant install file]"
+task :create_rant_independent_task_file => [:rant_independence]
+ #%% setup/install tasks
+
+task :rant_independence do #notice
+ resp=''
+ while resp.length < 4
+ resp='install' #default name install
+ print %{#{@proj[:rant]}
+ Create a rant dependency independent file
+ provide filename default name is "install"
+ [Warning, will overwrite file of name provided
+ provide name or "quit" to exit]: }
+ #res=File.new('/dev/tty').gets.strip
+ #resp=res if res =~/\S{4,30}/
+ exit if resp =~/^(?:n|quit|exit)$/
+ end
+ remove='y' #remove='n'
+ #remove=if FileTest.file?(resp)
+ # print "a file of the same name #{resp} exists, [y] to replace: "
+ # File.new('/dev/tty').gets.strip
+ #else 'y'
+ #end
+ if remove =~/y/; system("rant-import --force --auto #{resp}\n")
+ #puts "#{resp} updated"
+ else #puts "#{resp} not replaced"
+ end
+end
+
+task :default_notice do #notice
+ default_notice
+end
+task :rant_default1 do #secondary
+ setup_filelist_cp_r(filelist)
+end
+task :rant_default2 do #secondary
+ setup_find_cp_r('bin',@dir[:bin]) if File.directory?('bin')
+ setup_find_cp_r('lib',@dir[:lib]) if File.directory?('lib')
+ setup_find_cp_r('conf',@dir[:conf]) if File.directory?('conf')
+ setup_find_cp_r('data/sisu',"#{@dir[:share]}") if File.directory?('data/sisu') #
+ setup_find_cp_r('data',@dir[:data]) if File.directory?('data')
+ setup_find_cp_r('data/vim',"#{@dir[:data]}/vim") if File.directory?('data/vim')
+ setup_find_cp_r('man',@dir[:man]) if File.directory?('man')
+end
+task :install do #secondary
+ setup_filelist_create(filelist)
+end
+task :setup_bin do #bin
+ setup_find_create('bin',@dir[:bin]) if File.directory?('bin')
+end
+task :setup_lib do #lib
+ setup_find_create('lib',@dir[:lib]) if File.directory?('lib')
+end
+task :setup_conf do #conf
+ setup_find_create('conf',@dir[:conf]) if File.directory?('conf')
+end
+task :setup_share do #share
+ setup_find_create('data/sisu',@dir[:share]) if File.directory?('data/sisu')
+end
+task :setup_data do #data
+ setup_find_create('data',@dir[:data]) if File.directory?('data')
+end
+task :setup_man do #man
+ setup_find_create('man',@dir[:man]) if File.directory?('man') #man pages
+ setup_find_create('man.deb/man',@dir[:man]) if File.directory?('man.deb/man') #man pages
+end
+task :setup_vim do #man
+ setup_find_create('data/vim',@dir[:vim]) if File.directory?('data/vim') #man pages
+end
+ #%% post install
+ #%% clobber/remove tasks
+task :remove_bin do
+ rm_r "#{@dir[:bin]}/#{@dir[:proj]}" if FileTest.file?("#{@dir[:bin]}/#{@dir[:proj]}")
+end
+task :remove_lib do
+ rm_r "#{@dir[:lib]}/#{@dir[:proj]}" if FileTest.directory?("#{@dir[:lib]}/#{@dir[:proj]}")
+end
+task :remove_conf do
+ rm_r "#{@dir[:conf]}/#{@dir[:proj]}" if FileTest.directory?("#{@dir[:conf]}/#{@dir[:proj]}")
+end
+#task :remove_data do
+# rm_r "#{@dir[:data]}/#{@dir[:proj_eg]}" if FileTest.directory?("#{@dir[:data]}/#{@dir[:proj_eg]}")
+#end
+task :remove_man do
+ rm_r "#{@dir[:man]}/**/#{@dir[:proj]}" if FileTest.directory?("#{@dir[:man]}/man1/#{@dir[:proj]}")
+end
+task :remove_version do
+ rm_r "#{@dir[:bin]}/#{@dir[:proj]}" if FileTest.file?("#{@dir[:bin]}/#{@dir[:proj]}")
+ rm_r "#{@dir[:lib]}/#{@dir[:proj]}/#{Version}" if FileTest.directory?("#{@dir[:lib]}/#{@dir[:proj]}/#{Version}")
+ rm_r "#{@dir[:conf]}/#{@dir[:proj]} if FileTest.directory?("#{@dir[:conf]}/#{@dir[:proj]}")
+ #rm_r "#@dir_data/#{@dir[:proj]}"
+end
+task :remove_package do
+ rm_r "#{@dir[:bin]}/#{@dir[:proj]}" if FileTest.file?("#{@dir[:bin]}/#{@dir[:proj]}")
+ rm_r "#{@dir[:lib]}/#{@dir[:proj]}" if FileTest.directory?("#{@dir[:lib]}/#{@dir[:proj]}")
+ rm_r "#{@dir[:conf]}/#{@dir[:proj]}" if FileTest.directory?("#{@dir[:conf]}/#{@dir[:proj]}")
+end
+task :post_install_note do
+ puts <<WOK
+
+ sisu markup samples are now packaged separately in sisu-markup-samples
+ visit:
+ http://www.jus.uio.no/sisu
+ and:
+ http://www.jus.uio.no/sisu/SiSU/download
+
+WOK
+end
+task :system_info do #%% system info
+ rant_system_info
+end
+task :system_param do
+ Config::CONFIG.each {|c| p c }
+end
+task :project_help do #%% help
+ rant_project_help
+end
+task :rant_tasks do #%% help
+ rant_tasks
+end
diff --git a/bin/sisu b/bin/sisu
new file mode 100644
index 00000000..45873483
--- /dev/null
+++ b/bin/sisu
@@ -0,0 +1,55 @@
+#!/usr/bin/env ruby
+#SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information
+raise "Please, use Ruby 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4'
+$VERBOSE=nil
+$KCODE='u'
+Version='0.52'
+SiSU_lib='sisu/' + Version
+require SiSU_lib + '/hub'
+__END__
+* Name: SiSU information Structuring Universe - Structured information, Serialized Units
+* Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+
+* Description: SiSU information Structuring Universe, processing
+ * $Id$
+* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+* License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+* Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet
new file mode 100644
index 00000000..0ac11b6f
--- /dev/null
+++ b/bin/sisu_termsheet
@@ -0,0 +1,69 @@
+#!/usr/bin/env ruby
+#SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information
+raise "Please, use Ruby 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4'
+$VERBOSE=nil
+Version='0.52'
+SiSU_lib='sisu/' + Version
+require SiSU_lib + '/termsheet'
+__END__
+* Name: SiSU information Structuring Universe - Structured information, Serialized Units
+* Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+* Description: SiSU information Structuring Universe, specialised pre-processing wrapper
+
+* NOTE wrapper makes little sense without additional components, additional sample files must be provided - (saved till later as may confuse)
+ * $Id:$
+
+* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+* License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+* Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+sisu -t x_bank.and.*
+e.g. sisu -t x_bank.and.*.termsheet.rb
+e.g. sisu_termsheet.rb -t x_bank.and.c*.termsheet.rb
+program calls upon termsheet file with extension termsheet.rb
+termsheet.rb calls upon relevant standard form files (to be used) with extension .sForm.rb
+there is also a standard_terms.rb file - with terms/details that are constant
+the file produced is named after the termsheet.rb with that extension replaced with .er30
+from there scribbler.rb is called upon its usual metaVerse html and pdf creation
+! :-)
+to test run
+termsheet.rb -f dev.export.import.trade.facility.termsheet.rb
+the term sheet calls the standard form or template that is to be run against it.
diff --git a/bin/sisu_webrick b/bin/sisu_webrick
new file mode 100644
index 00000000..b6d64e59
--- /dev/null
+++ b/bin/sisu_webrick
@@ -0,0 +1,56 @@
+#!/usr/bin/env ruby
+#SiSU: copyright (C) 1997..2007 Ralph Amissah; License GPL, see appended program information
+raise "Please, use Ruby 1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4'
+$VERBOSE=nil
+Version='0.52'
+SiSU_lib='sisu/' + Version
+require SiSU_lib + '/webrick'
+__END__
+* Name: SiSU information Structuring Universe - Structured information, Serialized Units
+* Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+
+* Description: webrick share - note sisu by default does not link with file suffixes, see man pages for options
+ * arch-tag: webrick
+ * Date: $Date$
+ * $Id$
+
+* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+* License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+* Ralph Amissah ralph@amissah.com
+ Ralph Amissah amissah@gmail.com
diff --git a/conf/sisu/sisurc.yml b/conf/sisu/sisurc.yml
new file mode 100644
index 00000000..df2f153d
--- /dev/null
+++ b/conf/sisu/sisurc.yml
@@ -0,0 +1,116 @@
+# Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+# Author: Ralph@Amissah.com
+# Description: Site wide envionment defaults set here
+# arch-tag: system environment info / resource configuration file, for sisu
+# License: GPL 2 or later
+# this file should be configured and live in
+# /etc/sisu #per environment settings, overridden by:
+# ~/.sisu #per user settings, overridden by:
+# ./_sisu/config #per local directory settings
+# $Date$
+# $Id$
+# Notes: implemented 2004w03
+# 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: 'grotto/theatre/working'
+# 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'
+# php: 'php'
+# 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: '_sisu_processing'
+# metaverse: 'metaverse'
+# tune: 'tune'
+# latex: 'tex'
+# texinfo: 'texinfo'
+#% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default)
+flag:
+ color: false # colour now off by default (does not suit all terms/consoles) -c is color (on/f) toggle (note: set default true/false here, if -c is added to the shortuct defaults below, then another -c added to the command line won't toggle on/off)
+ default: '-mNhwpoabxXyYv' # includes verbose; -m would in any event be run by default
+ i: '-Nhwpoayv' # includes verbose; -m run by default
+ ii: '-NhwpoabxXyv' # includes verbose; -m run by default
+ iii: '-NhwpoabxXyYv' # includes verbose; -m run by default
+ iv: '-NhwpoabxXYDyv --import' # includes verbose; -m run by default
+ v: '-NhwpoabxXYDyv --update' # includes verbose; -m run by default
+
+#% papersize, (LaTeX/pdf) current values A4, US_letter, book_b5, book_a5, US_legal, easily extensible
+default:
+ papersize: 'A4'
+ #digest: 'sha' #sha is sha256, default is md5
+ #multilingual: false
+ #language_file: 2
+ #language: 'English'
+#% settings used by ssh scp
+#remote:
+# user: '[usrname]'
+# host: '[remote.hostname]'
+# path: '.' #no trailing slash eg 'sisu/www'
+#% webrick information
+#webrick:
+# port: '8081'
+#% sql database info, postgresql and sqlite
+#db:
+# postgresql:
+# user: '[username]'
+# port: '[port (default is 5432]'
+# sqlite:
+# user: '[username]'
+# path: ~ # './sisu_sqlite.db'
+# port: "**"
+#% possible values ~, true, false, or command instruction e.g. editor: 'gvim -c :R -c :S'.
+#will only ignore if value set to false, absence or nil will not remove program as should operate without rc file
+#ie in case of ~ will ignore and use hard coded defaults within program), true, false, or command instruction e.g. editor: 'gvim -c :R -c :S'
+#on value true system defaults used, to change, e.g. editor specify
+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: 'gvim -c :R -c :S'
+# pdf_viewer: 'evince'
+# web_browser: 'kazehakase' #'galeon'
+# console_www_browser: 'links2' #'elinks'
+# odf_viewer: 'oowriter'
+# xml_viewer: 'xml-viewer'
+#promo: sisu_icon, sisu, sisu_search_libre, open_society, fsf, ruby
+#search:
+# flag: true
+# action: http://localhost:8081/cgi-bin/sisu_sqlite.cgi
+## action: http://search.sisudoc.org
+# db: sisu
diff --git a/conf/sisu/skin/dir/skin_sisu.rb b/conf/sisu/skin/dir/skin_sisu.rb
new file mode 100644
index 00000000..66786cea
--- /dev/null
+++ b/conf/sisu/skin/dir/skin_sisu.rb
@@ -0,0 +1,105 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph@Amissah.com
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin for SiSU descriptive pages, ...
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require SiSU_lib + '/defaults'
+ class Skin
+ #% widget
+ def widget_search
+ true
+ end
+ def widget_promo
+#put s "#{__LINE__} #{__FILE__}"
+ #['sisu','ruby','sisu_search_libre','ruby','open_society']
+ end
+ #% path
+ def path_root
+#puts "#{__LINE__} #{__FILE__}"
+ './sisu/' # the only parameter that cannot be changed here
+ end
+ def path_rel
+#puts "#{__LINE__} #{__FILE__}"
+ '../'
+ end
+ #% url
+ def url_home
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu/'
+ end
+ def url_site # used in pdf header
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_txt # text to go with url usually stripped url
+#puts "#{__LINE__} #{__FILE__}"
+ 'www.jus.uio.no/sisu/'
+ end
+ def url_home_url
+#puts "#{__LINE__} #{__FILE__}"
+ '../index.html'
+ end
+ #def url_root_http
+ #root server path info, used in document information
+ #end
+ #% color
+ def color_band1
+ '"#ffffff"'
+ end
+ def color_band2
+ '"#ffffff"'
+ end
+ #% text
+ def text_hp
+ '&nbsp;SiSU'
+ end
+ def text_home
+ 'SiSU'
+ end
+ #% icon
+ def icon_home_button
+ 'sisu.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#ffffff"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}</td></tr></table></center>}
+ end
+ #% stamp
+ def stamp_stmp
+ "\\copyright Ralph Amissah, released under the GPL \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Ralph Amissah}"
+ end
+ def owner_chapter
+ 'Document owner details'
+ end
+ end
+end
diff --git a/conf/sisu/skin/doc/skin_gnu.rb b/conf/sisu/skin/doc/skin_gnu.rb
new file mode 100644
index 00000000..4c35120e
--- /dev/null
+++ b/conf/sisu/skin/doc/skin_gnu.rb
@@ -0,0 +1,96 @@
+=begin
+ * Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Free Software Foundation, Gnu sisu skin
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require SiSU_lib + '/defaults'
+ class Skin
+ #% widget
+ def widget_promo
+ ['sisu_icon','sisu','sisu_search_libre','open_society','fsf','ruby']
+ end
+ #% home
+ def home_index
+ end
+ def home_toc
+ end
+ #% path
+ def path_root
+ './sisu/' # the only parameter that cannot be changed here
+ end
+ def path_rel
+ '../'
+ end
+ #% url
+ def url_home
+ 'http://www.fsf.org'
+ end
+ def url_site # used in pdf header
+ 'http://www.fsf.org'
+ end
+ def url_txt # text to go with url usually stripped url
+ 'www.fsf.org'
+ end
+ def url_home_url
+ '../index.html'
+ end
+ # color
+ def color_band1
+ '"#000070"'
+ end
+ #% txt
+ def txt_hp
+ 'Free Software Foundation'
+ end
+ def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ...
+ #"www.jus.uio.no/sisu/"
+ 'Free Software Foundation'
+ end
+ #% icon
+ def icon_home_button
+ 'philosophical_gnu.png'
+ end
+ def icon_home_banner
+ icion_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table border="0" summary="home button" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#f1e8de"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}#{table_close}</center>}
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.fsf.org}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Free Software Foundation}"
+ end
+ def owner_chapter
+ "Document owner details"
+ end
+ end
+ class Stamp
+ def stmp
+ "\\copyright Ralph Amissah to be released under the GPL (or QT License equivalent as to be decided) \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+end
diff --git a/conf/sisu/skin/doc/skin_gutenberg.rb b/conf/sisu/skin/doc/skin_gutenberg.rb
new file mode 100644
index 00000000..4014d624
--- /dev/null
+++ b/conf/sisu/skin/doc/skin_gutenberg.rb
@@ -0,0 +1,219 @@
+=begin
+ * Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin sample prepared for Gutenberg Project (first used with "War and Peace")
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require "#{SiSU_lib}/defaults"
+ class Skin
+ #% path
+ def path_root # the only parameter that cannot be changed here
+ './sisu/'
+ end
+ def path_rel
+ '../'
+ end
+ end
+ #% url
+ def url_home
+ 'http://www.gutenberg.net'
+ end
+ def url_txt # text to go with url usually stripped url
+ 'www.gutenberg.net'
+ end
+ #% txt
+ def txt_hp
+ 'www.gutenberg.net'
+ end
+ def txt_home
+ 'Gutenberg Project'
+ end
+ #% icon
+ def icon_home_button
+ 'gutenberg.home.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor=#{color_yellow_dark}><a href="#{url_home}">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor=#{color_yellow_dark}><a href="#{url_home}" target="_top">#{png_home}</a></td></tr></table></td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#f1e8de"><font face="arial" size="2"><a href="toc.html" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font></td></tr></table></center></center></td><td width="20%">&nbsp;</td></tr></table>}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor=#{color_yellow_dark}><a href="#{url_home}" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<table summary="credits" align="center"bgcolor="#ffffff"><tr><td><font color="black"><center><a href="http://www.gutenberg.net/"><img border="0" align="center" src="../_sisu/image_local/gutenberg_icon.png" alt="Gutenberg Project"><br />Courtesy of The Gutenberg Project</a><br />#{widget_sisu}</center></font></td></tr></table>}
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_home}}{www.gutenberg.net}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_home}}{www.gutenberg.net}"
+ end
+ def home
+ "\\href{#{@vz.url_home}}{Gutenberg Project}"
+ end
+ def owner_chapter
+ "Document owner details"
+ end
+ def stmp
+ "\\copyright Ralph Amissah, licence GPL \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+ class DAL
+ def insert1
+<<CONTENTS
+
+3~ Project Gutenberg~#
+
+4~ Project Gutenberg Notes~#
+
+Copyright laws are changing all over the world, be sure to check the copyright laws for your country before posting these files!!~#
+
+Please take a look at the important information in this header. We encourage you to keep this file on your own disk, keeping an electronic path open for the next readers. Do not remove this.~#
+
+*{It must legally be the first thing seen when opening the book.}* In fact, our legal advisors said we can't even change margins.~#
+
+*{Welcome To The World of Free Plain Vanilla Electronic Texts}*~#
+
+*{Etexts Readable By Both Humans and By Computers, Since 1971}*~#
+
+*{These Etexts Prepared By Hundreds of Volunteers and Donations}*~#
+
+Information on contacting Project Gutenberg to get Etexts, and further information is included below. We need your donations.~#
+
+CONTENTS
+ end
+ def insert2 #note took out stop after http://promo.net/pg and created space after this url repeated in subsequent paragraph, as broke latex/pdf, think of modifying regexs for urls
+<<CONTENTS
+Project Gutenberg Etexts are usually created from multiple editions, all of which are in the Public Domain in the United States, unless a copyright notice is included. Therefore, we usually do NOT keep any of these books in compliance with any particular paper edition.~#
+
+We are now trying to release all our books one month in advance of the official release dates, leaving time for better editing.~#
+
+Please note: neither this list nor its contents are final till midnight of the last day of the month of any such announcement. The official release date of all Project Gutenberg Etexts is at Midnight, Central Time, of the last day of the stated month. A preliminary version may often be posted for suggestion, comment and editing by those who wish to do so. To be sure you have an up to date first edition [xxxxx10x.xxx] please check file sizes in the first week of the next month. Since our ftp program has a bug in it that scrambles the date [tried to fix and failed] a look at the file size will have to do, but we will try to see a new copy has at least one byte more or less.~#
+
+4~ Information about Project Gutenberg (one page)~#
+
+We produce about two million dollars for each hour we work. The time it takes us, a rather conservative estimate, is fifty hours to get any etext selected, entered, proofread, edited, copyright searched and analyzed, the copyright letters written, etc. This projected audience is one hundred million readers. If our value per text is nominally estimated at one dollar then we produce $2 million dollars per hour this year as we release thirty-six text files per month, or 432 more Etexts in 1999 for a total of 2000+ If these reach just 10% of the computerized population, then the total should reach over 200 billion Etexts given away this year.~#
+
+The Goal of Project Gutenberg is to Give Away One Trillion Etext Files by December 31, 2001. [10,000 x 100,000,000 = 1 Trillion] This is ten thousand titles each to one hundred million readers, which is only ~5% of the present number of computer users. At our revised rates of production, we will reach only one-third of that goal by the end of 2001, or about 3,333 Etexts unless we manage to get some real funding; currently our funding is mostly from Michael Hart's salary at Carnegie-Mellon University, and an assortment of sporadic gifts; this salary is only good for a few more years, so we are looking for something to replace it, as we don't want Project Gutenberg to be so dependent on one person.~#
+
+We need your donations more than ever!~#
+
+All donations should be made to "Project Gutenberg/CMU": and are tax deductible to the extent allowable by law. (CMU = Carnegie-Mellon University).~#
+
+For these and other matters, please mail to:~#
+
+Project Gutenberg~#
+
+P. O. Box 2782~#
+
+Champaign, IL 61825~#
+
+When all other email fails. . .try our Executive Director: Michael S. Hart hart@pobox.com forwards to hart@prairienet.org and archive.org if your mail bounces from archive.org, I will still see it, if it bounces from prairienet.org, better resend later on. . . .~#
+
+We would prefer to send you this information by email.~#
+
+******~#
+
+To access Project Gutenberg etexts, use any Web browser to view http://promo.net/pg This site lists Etexts by author and by title, and includes information about how to get involved with Project Gutenberg. You could also download our past Newsletters, or subscribe here. This is one of our major sites, please email hart@pobox.com, for a more complete list of our various sites.~#
+
+To go directly to the etext collections, use FTP or any Web browser to visit a Project Gutenberg mirror (mirror sites are available on 7 continents; mirrors are listed at http://promo.net/pg ).~#
+
+Mac users, do NOT point and click, typing works better.~#
+
+Example FTP session:~#
+
+ftp metalab.unc.edu~#
+
+login: anonymous~#
+
+password: your@login~#
+
+cd pub/docs/books/gutenberg~#
+
+cd etext90 through etext99 or etext00 through etext01, etc.~#
+
+dir [to see files]~#
+
+get or mget [to get files. . .set bin for zip files]~#
+
+GET GUTINDEX.?? [to get a year's listing of books, e.g., GUTINDEX.99]~#
+
+GET GUTINDEX.ALL [to get a listing of ALL books]~#
+
+***~#
+
+3~ Information prepared by the Project Gutenberg legal advisor** (three pages)~#
+
+4~ THE SMALL PRINT!**FOR PUBLIC DOMAIN ETEXTS~#
+
+Why is this "Small Print!" statement here? You know: lawyers. They tell us you might sue us if there is something wrong with your copy of this etext, even if you got it for free from someone other than us, and even if what's wrong is not our fault. So, among other things, this "Small Print!" statement disclaims most of our liability to you. It also tells you how you can distribute copies of this etext if you want to.~#
+
+5~ *BEFORE!* YOU USE OR READ THIS ETEXT~#
+
+By using or reading any part of this PROJECT GUTENBERG-tm etext, you indicate that you understand, agree to and accept this "Small Print!" statement. If you do not, you can receive a refund of the money (if any) you paid for this etext by sending a request within 30 days of receiving it to the person you got it from. If you received this etext on a physical medium (such as a disk), you must return it with your request.~#
+
+5~ ABOUT PROJECT GUTENBERG-TM ETEXTS~#
+
+This PROJECT GUTENBERG-tm etext, like most PROJECT GUTENBERG-tm etexts, is a "public domain" work distributed by Professor Michael S. Hart through the Project Gutenberg Association at Carnegie-Mellon University (the "Project"). Among other things, this means that no one owns a United States copyright on or for this work, so the Project (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth below, apply if you wish to copy and distribute this etext under the Project's "PROJECT GUTENBERG" trademark.~#
+
+To create these etexts, the Project expends considerable efforts to identify, transcribe and proofread public domain works. Despite these efforts, the Project's etexts and any medium they may be on may contain "Defects". Among other things, Defects may take the form of incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other etext medium, a computer virus, or computer codes that damage or cannot be read by your equipment.~#
+
+5~ LIMITED WARRANTY; DISCLAIMER OF DAMAGES~#
+
+But for the "Right of Replacement or Refund" described below, [1] the Project (and any other party you may receive this etext from as a PROJECT GUTENBERG-tm etext) disclaims all liability to you for damages, costs and expenses, including legal fees, and [2] YOU HAVE NO REMEDIES FOR NEGLIGENCE OR UNDER STRICT LIABILITY, OR FOR BREACH OF WARRANTY OR CONTRACT, INCLUDING BUT NOT LIMITED TO INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES, EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.~#
+
+If you discover a Defect in this etext within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending an explanatory note within that time to the person you received it from. If you received it on a physical medium, you must return it with your note, and such person may choose to alternatively give you a replacement copy. If you received it electronically, such person may choose to alternatively give you a second opportunity to receive it electronically.~#
+
+THIS ETEXT IS OTHERWISE PROVIDED TO YOU "AS-IS". NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, ARE MADE TO YOU AS TO THE ETEXT OR ANY MEDIUM IT MAY BE ON, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.~#
+
+Some states do not allow disclaimers of implied warranties or the exclusion or limitation of consequential damages, so the above disclaimers and exclusions may not apply to you, and you may have other legal rights.~#
+
+5~ INDEMNITY~#
+
+You will indemnify and hold the Project, its directors, officers, members and agents harmless from all liability, cost and expense, including legal fees, that arise directly or indirectly from any of the following that you do or cause: [1] distribution of this etext, [2] alteration, modification, or addition to the etext, or [3] any Defect.~#
+
+5~ DISTRIBUTION UNDER "PROJECT GUTENBERG-tm"~#
+
+You may distribute copies of this etext electronically, or by disk, book or any other medium if you either delete this "Small Print!" and all other references to Project Gutenberg, or:~#
+
+*{[1]}* Only give exact copies of it. Among other things, this requires that you do not remove, alter or modify the etext or this "small print!" statement. You may however, if you wish, distribute this etext in machine readable binary, compressed, mark-up, or proprietary form, including any form resulting from conversion by word pro- cessing or hypertext software, but only so long as *{EITHER}*:~#
+
+_1 *{[*]}* The etext, when displayed, is clearly readable, and does *not* contain characters other than those intended by the author of the work, although tilde (~), asterisk (*) and underline (_) characters may be used to convey punctuation intended by the author, and additional characters may be used to indicate hypertext links; OR~#
+
+_1 *{[*]}* The etext may be readily converted by the reader at no expense into plain ASCII, EBCDIC or equivalent form by the program that displays the etext (as is the case, for instance, with most word processors); OR~#
+
+_1 *{[*]}* You provide, or agree to also provide on request at no additional cost, fee or expense, a copy of the etext in its original plain ASCII form (or in EBCDIC or other equivalent proprietary form).~#
+
+*{[2]}* Honor the etext refund and replacement provisions of this "Small Print!" statement.~#
+
+*{[3]}* Pay a trademark license fee to the Project of 20% of the net profits you derive calculated using the method you already use to calculate your applicable taxes. If you don't derive profits, no royalty is due. Royalties are payable to "Project Gutenberg Association/Carnegie-Mellon University" within the 60 days following each date you prepare (or were legally required to prepare) your annual (or equivalent periodic) tax return.~#
+
+5~ WHAT IF YOU *WANT* TO SEND MONEY EVEN IF YOU DON'T HAVE TO?~#
+
+The Project gratefully accepts contributions in money, time, scanning machines, OCR software, public domain etexts, royalty free copyright licenses, and every other sort of contribution you can think of. Money should be paid to "Project Gutenberg Association / Carnegie-Mellon University".~#
+
+We are planning on making some changes in our donation structure in 2000, so you might want to email me, hart@pobox.com beforehand.~#
+
+*END THE SMALL PRINT! FOR PUBLIC DOMAIN ETEXTS*Ver.04.29.93*END*~#
+
+<!pn!>
+
+CONTENTS
+ end
+ end
+end
+
diff --git a/conf/sisu/skin/doc/skin_kdissert.rb b/conf/sisu/skin/doc/skin_kdissert.rb
new file mode 100644
index 00000000..87d371f2
--- /dev/null
+++ b/conf/sisu/skin/doc/skin_kdissert.rb
@@ -0,0 +1,93 @@
+=begin
+ * Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Kdissert
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require "#{SiSU_lib}/defaults"
+ class Skin
+ ##% path
+ #def path_root
+ # './sisu/' # the only parameter that cannot be changed here
+ #end
+ #def path_rel
+ # '../'
+ #end
+ #% url
+ def url_home
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_site # used in pdf header
+ url_home
+ end
+ def url_txt # text to go with url usually stripped url
+ 'www.jus.uio.no/sisu'
+ url_home
+ end
+ def url_hp
+ 'http://freehackers.org/~tnagy/kdissert'
+ end
+ def url_home_url
+ '../index.html'
+ end
+ #% color
+ def color_band1
+ '"#ffffff"'
+ end
+ #% txt
+ def txt_hp
+ 'Kdissert, Document Mapping'
+ end
+ def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ...
+ #"www.jus.uio.no/sisu/"
+ 'SiSU (document prepared using Kdissert)'
+ end
+ #% icon
+ def icon_home_button
+ 'kdissert.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table border="0" summary="home button" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_hp}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_hp}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#f1e8de"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_hp}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ def banner_home_guide
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}#{table_close}</center>}
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.fsf.org}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Free Software Foundation}"
+ end
+ def owner_chapter
+ "Document owner details"
+ end
+ end
+ class Stamp
+ def stmp
+ "\\copyright Ralph Amissah to be released under the GPL (or QT License equivalent as to be decided) \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+end
diff --git a/conf/sisu/skin/doc/skin_sisu.rb b/conf/sisu/skin/doc/skin_sisu.rb
new file mode 100644
index 00000000..66786cea
--- /dev/null
+++ b/conf/sisu/skin/doc/skin_sisu.rb
@@ -0,0 +1,105 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph@Amissah.com
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin for SiSU descriptive pages, ...
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require SiSU_lib + '/defaults'
+ class Skin
+ #% widget
+ def widget_search
+ true
+ end
+ def widget_promo
+#put s "#{__LINE__} #{__FILE__}"
+ #['sisu','ruby','sisu_search_libre','ruby','open_society']
+ end
+ #% path
+ def path_root
+#puts "#{__LINE__} #{__FILE__}"
+ './sisu/' # the only parameter that cannot be changed here
+ end
+ def path_rel
+#puts "#{__LINE__} #{__FILE__}"
+ '../'
+ end
+ #% url
+ def url_home
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu/'
+ end
+ def url_site # used in pdf header
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_txt # text to go with url usually stripped url
+#puts "#{__LINE__} #{__FILE__}"
+ 'www.jus.uio.no/sisu/'
+ end
+ def url_home_url
+#puts "#{__LINE__} #{__FILE__}"
+ '../index.html'
+ end
+ #def url_root_http
+ #root server path info, used in document information
+ #end
+ #% color
+ def color_band1
+ '"#ffffff"'
+ end
+ def color_band2
+ '"#ffffff"'
+ end
+ #% text
+ def text_hp
+ '&nbsp;SiSU'
+ end
+ def text_home
+ 'SiSU'
+ end
+ #% icon
+ def icon_home_button
+ 'sisu.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#ffffff"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}</td></tr></table></center>}
+ end
+ #% stamp
+ def stamp_stmp
+ "\\copyright Ralph Amissah, released under the GPL \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Ralph Amissah}"
+ end
+ def owner_chapter
+ 'Document owner details'
+ end
+ end
+end
diff --git a/conf/sisu/skin/site/skin_sisu.rb b/conf/sisu/skin/site/skin_sisu.rb
new file mode 100644
index 00000000..66786cea
--- /dev/null
+++ b/conf/sisu/skin/site/skin_sisu.rb
@@ -0,0 +1,105 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph@Amissah.com
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin for SiSU descriptive pages, ...
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require SiSU_lib + '/defaults'
+ class Skin
+ #% widget
+ def widget_search
+ true
+ end
+ def widget_promo
+#put s "#{__LINE__} #{__FILE__}"
+ #['sisu','ruby','sisu_search_libre','ruby','open_society']
+ end
+ #% path
+ def path_root
+#puts "#{__LINE__} #{__FILE__}"
+ './sisu/' # the only parameter that cannot be changed here
+ end
+ def path_rel
+#puts "#{__LINE__} #{__FILE__}"
+ '../'
+ end
+ #% url
+ def url_home
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu/'
+ end
+ def url_site # used in pdf header
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_txt # text to go with url usually stripped url
+#puts "#{__LINE__} #{__FILE__}"
+ 'www.jus.uio.no/sisu/'
+ end
+ def url_home_url
+#puts "#{__LINE__} #{__FILE__}"
+ '../index.html'
+ end
+ #def url_root_http
+ #root server path info, used in document information
+ #end
+ #% color
+ def color_band1
+ '"#ffffff"'
+ end
+ def color_band2
+ '"#ffffff"'
+ end
+ #% text
+ def text_hp
+ '&nbsp;SiSU'
+ end
+ def text_home
+ 'SiSU'
+ end
+ #% icon
+ def icon_home_button
+ 'sisu.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#ffffff"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}</td></tr></table></center>}
+ end
+ #% stamp
+ def stamp_stmp
+ "\\copyright Ralph Amissah, released under the GPL \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Ralph Amissah}"
+ end
+ def owner_chapter
+ 'Document owner details'
+ end
+ end
+end
diff --git a/conf/sisu/skin/yml/skin_countries.yml b/conf/sisu/skin/yml/skin_countries.yml
new file mode 100644
index 00000000..a68903e1
--- /dev/null
+++ b/conf/sisu/skin/yml/skin_countries.yml
@@ -0,0 +1,482 @@
+# arch-tag: yaml country list
+# Author: Ralph@Amissah.com
+# License: Same as SiSU see http://www.jus.uio.no/sisu
+id: AF
+ name: Afghanistan
+id: AL
+ name: Albania
+id: DZ
+ name: Algeria
+id: AS
+ name: American Samoa
+id: AD
+ name: Andorra
+id: AO
+ name: Angola
+id: AI
+ name: Anguilla
+id: AQ
+ name: Antarctica
+id: AG
+ name: Antigua and Barbuda
+id: AR
+ name: Argentina
+id: AM
+ name: Armenia
+id: AW
+ name: Aruba
+id: AU
+ name: Australia
+id: AT
+ name: Austria
+id: AZ
+ name: Azerbaijan
+id: BS
+ name: Bahamas
+id: BH
+ name: Bahrain
+id: BD
+ name: Bangladesh
+id: BB
+ name: Barbados
+id: BY
+ name: Belarus
+id: BE
+ name: Belgium
+id: BZ
+ name: Belize
+id: BJ
+ name: Benin
+id: BM
+ name: Bermuda
+id: BT
+ name: Bhutan
+id: BO
+ name: Bolivia
+id: BA
+ name: Bosnia and Herzegovina
+id: BW
+ name: Botswana
+id: BV
+ name: Bouvet Island
+id: BR
+ name: Brazil
+id: IO
+ name: British Indian Ocean Territory
+id: BN
+ name: Brunei Darussalam
+id: BG
+ name: Bulgaria
+id: BF
+ name: Burkina Faso
+id: BI
+ name: Burundi
+id: KH
+ name: Cambodia
+id: CM
+ name: Cameroon
+id: CA
+ name: Canada
+id: CV
+ name: Cape Verde
+id: KY
+ name: Cayman Islands
+id: CF
+ name: Central African Republic
+id: TD
+ name: Chad
+id: CL
+ name: Chile
+id: CN
+ name: China
+id: CX
+ name: Christmas Island
+id: CC
+ name: Cocos (Keeling) Islands
+id: CO
+ name: Colombia
+id: KM
+ name: Comoros
+id: CG
+ name: Congo
+id: CK
+ name: Cook Islands
+id: CR
+ name: Costa Rica
+id: HR
+ name: Croatia (Hrvatska)
+id: CU
+ name: Cuba
+id: CY
+ name: Cyprus
+id: CZ
+ name: Czech Republic
+id: CS
+ name: Czechoslovakia
+id: DK
+ name: Denmark
+id: DJ
+ name: Djibouti
+id: DM
+ name: Dominica
+id: DO
+ name: Dominican Republic
+id: TP
+ name: East Timor
+id: EC
+ name: Ecuador
+id: EG
+ name: Egypt
+id: SV
+ name: El Salvador
+id: GQ
+ name: Equatorial Guinea
+id: ER
+ name: Eritrea
+id: EE
+ name: Estonia
+id: ET
+ name: Ethiopia
+id: FK
+ name: Falkland Islands (Malvinas)
+id: FO
+ name: Faroe Islands
+id: FJ
+ name: Fiji
+id: FI
+ name: Finland
+id: FR
+ name: France
+id: FX
+ name: France, Metroplitan
+id: GF
+ name: French Guiana
+id: PF
+ name: French Polynesia
+id: TF
+ name: French Southern Territories
+id: GA
+ name: Gabon
+id: GM
+ name: Gambia
+id: GE
+ name: Georgia
+id: DE
+ name: Germany
+id: GH
+ name: Ghana
+id: GI
+ name: Gibraltar
+id: GB
+ name: Great Britain (UK)
+id: GR
+ name: Greece
+id: GL
+ name: Greenland
+id: GD
+ name: Grenada
+id: GP
+ name: Guadeloupe
+id: GU
+ name: Guam
+id: GT
+ name: Guatemala
+id: GN
+ name: Guinea
+id: GW
+ name: Guinea-Bissau
+id: GY
+ name: Guyana
+id: HT
+ name: Haiti
+id: HM
+ name: Heard and McDonald Islands
+id: HN
+ name: Honduras
+id: HK
+ name: Hong Kong
+id: HU
+ name: Hungary
+id: IS
+ name: Iceland
+id: IN
+ name: India
+id: ID
+ name: Indonesia
+id: IR
+ name: Iran
+id: IQ
+ name: Iraq
+id: IE
+ name: Ireland
+id: IL
+ name: Israel
+id: IT
+ name: Italy
+id: CI
+ name: Ivory Coast
+id: JM
+ name: Jamaica
+id: JP
+ name: Japan
+id: JO
+ name: Jordan
+id: KZ
+ name: Kazakhstan
+id: KE
+ name: Kenya
+id: KI
+ name: Kiribati
+id: KP
+ name: Korea (North)
+id: KR
+ name: Korea (South)
+id: KW
+ name: Kuwait
+id: KG
+ name: Kyrgyzstan
+id: LA
+ name: Laos
+id: LV
+ name: Latvia
+id: LB
+ name: Lebanon
+id: LS
+ name: Lesotho
+id: LR
+ name: Liberia
+id: LY
+ name: Libya
+id: LI
+ name: Liechtenstein
+id: LT
+ name: Lithuania
+id: LU
+ name: Luxembourg
+id: MO
+ name: Macau
+id: ME
+ name: Macedonia
+id: MG
+ name: Madagascar
+id: MW
+ name: Malawi
+id: MY
+ name: Malaysia
+id: MV
+ name: Maldives
+id: ML
+ name: Mali
+id: MT
+ name: Malta
+id: MB
+ name: Marshall Islands
+id: MQ
+ name: Martinique
+id: MR
+ name: Mauritania
+id: MU
+ name: Mauritius
+id: YT
+ name: Mayotte
+id: MX
+ name: Mexico
+id: FM
+ name: Micronesia
+id: MD
+ name: Moldova
+id: MC
+ name: Monaco
+id: MN
+ name: Mongolia
+id: MS
+ name: Montserrat
+id: MA
+ name: Morocco
+id: MZ
+ name: Mozambique
+id: MM
+ name: Myanmar
+id: NA
+ name: Namibia
+id: NR
+ name: Nauru
+id: NP
+ name: Nepal
+id: NL
+ name: Netherlands
+id: AN
+ name: Netherlands Antilles
+id: NT
+ name: Neutral Zone
+id: NC
+ name: New Caledonia
+id: NZ
+ name: New Zealand (Aotearoa)
+id: NI
+ name: Nicaragua
+id: NE
+ name: Niger
+id: NG
+ name: Nigeria
+id: NU
+ name: Niue
+id: NF
+ name: Norfolk Island
+id: MP
+ name: Northern Mariana Islands
+id: NO
+ name: Norway
+id: OM
+ name: Oman
+id: 00
+ name: Other
+id: PK
+ name: Pakistan
+id: PW
+ name: Palau
+id: PA
+ name: Panama
+id: PG
+ name: Papua New Guinea
+id: PY
+ name: Paraguay
+id: PE
+ name: Peru
+id: PH
+ name: Philippines
+id: PN
+ name: Pitcairn
+id: PL
+ name: Poland
+id: PT
+ name: Portugal
+id: PR
+ name: Puerto Rico
+id: QA
+ name: Qatar
+id: RE
+ name: Reunion
+id: RO
+ name: Romania
+id: RU
+ name: Russian Federation
+id: RW
+ name: Rwanda
+id: GS
+ name: S. Georgia and S. Sandwich Isls.
+id: KN
+ name: Saint Kitts and Nevis
+id: LC
+ name: Saint Lucia
+id: VC
+ name: Saint Vincent and the Grenadines
+id: WS
+ name: Samoa
+id: SM
+ name: San Marino
+id: ST
+ name: Sao Tome and Principe
+id: SA
+ name: Saudi Arabia
+id: SN
+ name: Senegal
+id: SC
+ name: Seychelles
+id: SL
+ name: Sierra Leone
+id: SG
+ name: Singapore
+id: SK
+ name: Slovak Republic
+id: SI
+ name: Slovenia
+id: SB
+ name: Solomon Islands
+id: SO
+ name: Somalia
+id: ZA
+ name: South Africa
+id: ES
+ name: Spain
+id: LK
+ name: Sri Lanka
+id: SH
+ name: St. Helena
+id: PM
+ name: St. Pierre and Miquelon
+id: SD
+ name: Sudan
+id: SR
+ name: Suriname
+id: SJ
+ name: Svalbard and Jan Mayen Islands
+id: SZ
+ name: Swaziland
+id: SE
+ name: Sweden
+id: CH
+ name: Switzerland
+id: SY
+ name: Syria
+id: TW
+ name: Taiwan
+id: TJ
+ name: Tajikistan
+id: TZ
+ name: Tanzania
+id: TH
+ name: Thailand
+id: TG
+ name: Togo
+id: TK
+ name: Tokelau
+id: TO
+ name: Tonga
+id: TT
+ name: Trinidad and Tobago
+id: TN
+ name: Tunisia
+id: TR
+ name: Turkey
+id: TM
+ name: Turkmenistan
+id: TC
+ name: Turks and Caicos Islands
+id: TV
+ name: Tuvalu
+id: UM
+ name: US Minor Outlying Islands
+id: SU
+ name: USSR (former)
+id: UG
+ name: Uganda
+id: UA
+ name: Ukraine
+id: AE
+ name: United Arab Emirates
+id: UK
+ name: United Kingdom
+id: US
+ name: United States
+id: UY
+ name: Uruguay
+id: UZ
+ name: Uzbekistan
+id: VU
+ name: Vanuatu
+id: VA
+ name: Vatican City State (Holy See)
+id: VE
+ name: Venezuela
+id: VN
+ name: Viet Nam
+id: VG
+ name: Virgin Islands (British)
+id: VI
+ name: Virgin Islands (U.S.)
+id: WF
+ name: Wallis and Futuna Islands
+id: EH
+ name: Western Sahara
+
diff --git a/conf/sisu/skin/yml/skin_country.yml b/conf/sisu/skin/yml/skin_country.yml
new file mode 100644
index 00000000..ebaf8ace
--- /dev/null
+++ b/conf/sisu/skin/yml/skin_country.yml
@@ -0,0 +1,735 @@
+# arch-tag: yaml country list array
+# Author: Ralph@Amissah.com
+# License: Same as SiSU see http://www.jus.uio.no/sisu
+-
+ - AF
+ - Afghanistan
+-
+ - AL
+ - Albania
+-
+ - DZ
+ - Algeria
+-
+ - AS
+ - American Samoa
+-
+ - AD
+ - Andorra
+-
+ - AO
+ - Angola
+-
+ - AI
+ - Anguilla
+-
+ - AQ
+ - Antarctica
+-
+ - AG
+ - Antigua and Barbuda
+-
+ - AR
+ - Argentina
+-
+ - AM
+ - Armenia
+-
+ - AW
+ - Aruba
+-
+ - AU
+ - Australia
+-
+ - AT
+ - Austria
+-
+ - AZ
+ - Azerbaijan
+-
+ - BS
+ - Bahamas
+-
+ - BH
+ - Bahrain
+-
+ - BD
+ - Bangladesh
+-
+ - BB
+ - Barbados
+-
+ - BY
+ - Belarus
+-
+ - BE
+ - Belgium
+-
+ - BZ
+ - Belize
+-
+ - BJ
+ - Benin
+-
+ - BM
+ - Bermuda
+-
+ - BT
+ - Bhutan
+-
+ - BO
+ - Bolivia
+-
+ - BA
+ - Bosnia and Herzegovina
+-
+ - BW
+ - Botswana
+-
+ - BV
+ - Bouvet Island
+-
+ - BR
+ - Brazil
+-
+ - IO
+ - British Indian Ocean Territory
+-
+ - BN
+ - Brunei Darussalam
+-
+ - BG
+ - Bulgaria
+-
+ - BF
+ - Burkina Faso
+-
+ - BI
+ - Burundi
+-
+ - KH
+ - Cambodia
+-
+ - CM
+ - Cameroon
+-
+ - CA
+ - Canada
+-
+ - CV
+ - Cape Verde
+-
+ - KY
+ - Cayman Islands
+-
+ - CF
+ - Central African Republic
+-
+ - TD
+ - Chad
+-
+ - CL
+ - Chile
+-
+ - CN
+ - China
+-
+ - CX
+ - Christmas Island
+-
+ - CC
+ - Cocos (Keeling) Islands
+-
+ - CO
+ - Colombia
+-
+ - KM
+ - Comoros
+-
+ - CG
+ - Congo
+-
+ - CK
+ - Cook Islands
+-
+ - CR
+ - Costa Rica
+-
+ - HR
+ - Croatia (Hrvatska)
+-
+ - CU
+ - Cuba
+-
+ - CY
+ - Cyprus
+-
+ - CZ
+ - Czech Republic
+-
+ - CS
+ - Czechoslovakia (former)
+-
+ - DK
+ - Denmark
+-
+ - DJ
+ - Djibouti
+-
+ - DM
+ - Dominica
+-
+ - DO
+ - Dominican Republic
+-
+ - TP
+ - East Timor
+-
+ - EC
+ - Ecuador
+-
+ - EG
+ - Egypt
+-
+ - SV
+ - El Salvador
+-
+ - GQ
+ - Equatorial Guinea
+-
+ - ER
+ - Eritrea
+-
+ - EE
+ - Estonia
+-
+ - ET
+ - Ethiopia
+-
+ - FK
+ - Falkland Islands (Malvinas)
+-
+ - FO
+ - Faroe Islands
+-
+ - FJ
+ - Fiji
+-
+ - FI
+ - Finland
+-
+ - FR
+ - France
+-
+ - FX
+ - France, Metropolitan
+-
+ - GF
+ - French Guiana
+-
+ - PF
+ - French Polynesia
+-
+ - TF
+ - French Southern Territories
+-
+ - GA
+ - Gabon
+-
+ - GM
+ - Gambia
+-
+ - GE
+ - Georgia
+-
+ - DE
+ - Germany
+-
+ - GH
+ - Ghana
+-
+ - GI
+ - Gibraltar
+-
+ - GB
+ - Great Britain (UK)
+-
+ - GR
+ - Greece
+-
+ - GL
+ - Greenland
+-
+ - GD
+ - Grenada
+-
+ - GP
+ - Guadeloupe
+-
+ - GU
+ - Guam
+-
+ - GT
+ - Guatemala
+-
+ - GN
+ - Guinea
+-
+ - GW
+ - Guinea-Bissau
+-
+ - GY
+ - Guyana
+-
+ - HT
+ - Haiti
+-
+ - HM
+ - Heard and McDonald Islands
+-
+ - HN
+ - Honduras
+-
+ - HK
+ - Hong Kong
+-
+ - HU
+ - Hungary
+-
+ - IS
+ - Iceland
+-
+ - IN
+ - India
+-
+ - ID
+ - Indonesia
+-
+ - IR
+ - Iran
+-
+ - IQ
+ - Iraq
+-
+ - IE
+ - Ireland
+-
+ - IL
+ - Israel
+-
+ - IT
+ - Italy
+-
+ - CI
+ - Ivory Coast
+-
+ - JM
+ - Jamaica
+-
+ - JP
+ - Japan
+-
+ - JO
+ - Jordan
+-
+ - KZ
+ - Kazakhstan
+-
+ - KE
+ - Kenya
+-
+ - KI
+ - Kiribati
+-
+ - KP
+ - Korea (North)
+-
+ - KR
+ - Korea (South)
+-
+ - KW
+ - Kuwait
+-
+ - KG
+ - Kyrgyzstan
+-
+ - LA
+ - Laos
+-
+ - LV
+ - Latvia
+-
+ - LB
+ - Lebanon
+-
+ - LS
+ - Lesotho
+-
+ - LR
+ - Liberia
+-
+ - LY
+ - Libya
+-
+ - LI
+ - Liechtenstein
+-
+ - LT
+ - Lithuania
+-
+ - LU
+ - Luxembourg
+-
+ - MO
+ - Macau
+-
+ - ME
+ - Macedonia
+-
+ - MG
+ - Madagascar
+-
+ - MW
+ - Malawi
+-
+ - MY
+ - Malaysia
+-
+ - MV
+ - Maldives
+-
+ - ML
+ - Mali
+-
+ - MT
+ - Malta
+-
+ - MB
+ - Marshall Islands
+-
+ - MQ
+ - Martinique
+-
+ - MR
+ - Mauritania
+-
+ - MU
+ - Mauritius
+-
+ - YT
+ - Mayotte
+-
+ - MX
+ - Mexico
+-
+ - FM
+ - Micronesia
+-
+ - MD
+ - Moldova
+-
+ - MC
+ - Monaco
+-
+ - MN
+ - Mongolia
+-
+ - MS
+ - Montserrat
+-
+ - MA
+ - Morocco
+-
+ - MZ
+ - Mozambique
+-
+ - MM
+ - Myanmar
+-
+ - NA
+ - Namibia
+-
+ - NR
+ - Nauru
+-
+ - NP
+ - Nepal
+-
+ - NL
+ - Netherlands
+-
+ - AN
+ - Netherlands Antilles
+-
+ - NT
+ - Neutral Zone
+-
+ - NC
+ - New Caledonia
+-
+ - NZ
+ - New Zealand (Aotearoa)
+-
+ - NI
+ - Nicaragua
+-
+ - NE
+ - Niger
+-
+ - NG
+ - Nigeria
+-
+ - NU
+ - Niue
+-
+ - NF
+ - Norfolk Island
+-
+ - MP
+ - Northern Mariana Islands
+-
+ - 'NO'
+ - Norway
+-
+ - OM
+ - Oman
+-
+ - '00'
+ - Other
+-
+ - PK
+ - Pakistan
+-
+ - PW
+ - Palau
+-
+ - PA
+ - Panama
+-
+ - PG
+ - Papua New Guinea
+-
+ - PY
+ - Paraguay
+-
+ - PE
+ - Peru
+-
+ - PH
+ - Philippines
+-
+ - PN
+ - Pitcairn
+-
+ - PL
+ - Poland
+-
+ - PT
+ - Portugal
+-
+ - PR
+ - Puerto Rico
+-
+ - QA
+ - Qatar
+-
+ - RE
+ - Reunion
+-
+ - RO
+ - Romania
+-
+ - RU
+ - Russian Federation
+-
+ - RW
+ - Rwanda
+-
+ - GS
+ - S. Georgia and S. Sandwich Isls.
+-
+ - KN
+ - Saint Kitts and Nevis
+-
+ - LC
+ - Saint Lucia
+-
+ - VC
+ - Saint Vincent and the Grenadines
+-
+ - WS
+ - Samoa
+-
+ - SM
+ - San Marino
+-
+ - ST
+ - Sao Tome and Principe
+-
+ - SA
+ - Saudi Arabia
+-
+ - SN
+ - Senegal
+-
+ - SC
+ - Seychelles
+-
+ - SL
+ - Sierra Leone
+-
+ - SG
+ - Singapore
+-
+ - SK
+ - Slovak Republic
+-
+ - SI
+ - Slovenia
+-
+ - SB
+ - Solomon Islands
+-
+ - SO
+ - Somalia
+-
+ - ZA
+ - South Africa
+-
+ - ES
+ - Spain
+-
+ - LK
+ - Sri Lanka
+-
+ - SH
+ - St. Helena
+-
+ - PM
+ - St. Pierre and Miquelon
+-
+ - SD
+ - Sudan
+-
+ - SR
+ - Suriname
+-
+ - SJ
+ - Svalbard and Jan Mayen Islands
+-
+ - SZ
+ - Swaziland
+-
+ - SE
+ - Sweden
+-
+ - CH
+ - Switzerland
+-
+ - SY
+ - Syria
+-
+ - TW
+ - Taiwan
+-
+ - TJ
+ - Tajikistan
+-
+ - TZ
+ - Tanzania
+-
+ - TH
+ - Thailand
+-
+ - TG
+ - Togo
+-
+ - TK
+ - Tokelau
+-
+ - TO
+ - Tonga
+-
+ - TT
+ - Trinidad and Tobago
+-
+ - TN
+ - Tunisia
+-
+ - TR
+ - Turkey
+-
+ - TM
+ - Turkmenistan
+-
+ - TC
+ - Turks and Caicos Islands
+-
+ - TV
+ - Tuvalu
+-
+ - UM
+ - US Minor Outlying Islands
+-
+ - SU
+ - USSR (former)
+-
+ - UG
+ - Uganda
+-
+ - UA
+ - Ukraine
+-
+ - AE
+ - United Arab Emirates
+-
+ - UK
+ - United Kingdom
+-
+ - US
+ - United States
+-
+ - UY
+ - Uruguay
+-
+ - UZ
+ - Uzbekistan
+-
+ - VU
+ - Vanuatu
+-
+ - VA
+ - Vatican City State (Holy See)
+-
+ - VE
+ - Venezuela
+-
+ - VN
+ - Viet Nam
+-
+ - VG
+ - Virgin Islands (British)
+-
+ - VI
+ - Virgin Islands (U.S.)
+-
+ - WF
+ - Wallis and Futuna Islands
+-
+ - EH
+ - Western Sahara
+-
+ - YE
+ - Yemen
+-
+ - YU
+ - Yugoslavia
+-
+ - ZR
+ - Zaire
+-
+ - ZM
+ - Zambia
+-
+ - ZW
+ - Zimbabwe
diff --git a/conf/sisu/version.yml b/conf/sisu/version.yml
new file mode 100644
index 00000000..8a906107
--- /dev/null
+++ b/conf/sisu/version.yml
@@ -0,0 +1,5 @@
+---
+:date_stamp: 2007w20/4
+:project: SiSU
+:date: "2007-05-17"
+:version: 0.52.7
diff --git a/data/doc/sisu/CHANGELOG b/data/doc/sisu/CHANGELOG
new file mode 100644
index 00000000..2c1bf32b
--- /dev/null
+++ b/data/doc/sisu/CHANGELOG
@@ -0,0 +1,6426 @@
+* See homepage at: http://www.jus.uio.no/sisu
+* & http://www.jus.uio.no/sisu/SiSU/download
+* & http://www.jus.uio.no/sisu/SiSU/changelog
+
+Reverse Chronological:
+
+%% STABLE MANIFEST
+
+%% sisu_0.52.7.orig.tar.gz (2007-05-17::20/4)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.7.orig.tar.gz
+ sisu_0.52.7.orig.tar.gz
+ sisu_0.52.7-1.dsc
+ sisu_0.52.7-1.diff.gz
+
+ * texpdf, related to special characters
+
+%% sisu_0.52.6.orig.tar.gz (2007-05-14::20/1)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.6.orig.tar.gz
+ 3255ec945b0583a01af963dde3f76f1d 1283482 sisu_0.52.6.orig.tar.gz
+ f466b68b3093e2c95fed13e4ebf0d495 606 sisu_0.52.6-1.dsc
+ aafb3b715fe2566f88c2def746d73099 148689 sisu_0.52.6-1.diff.gz
+
+ * texpdf, a url representation fix, escape of special characters
+
+%% sisu_0.52.5.orig.tar.gz (2007-05-10::19/4)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.5.orig.tar.gz
+ e01dd9390785e8b087140a7166cc6a5e 1283393 sisu_0.52.5.orig.tar.gz
+ 1bc960b5ce02d58153579d32bfbb2bd0 606 sisu_0.52.5-1.dsc
+ d6ab36fca512d494a4ce6fe0feec217a 148667 sisu_0.52.5-1.diff.gz
+
+ * postgresql TCP/IP port setting changed, looks first at sisurc.yml else the
+ environment variable PGPORT, else fallback is to set
+ default to 5432
+
+ * debian/control postgresql dependencies updated, version agnostic (Closes:
+ #419294) [Martin Pitt thanks for report]
+ * on debian postgresql-8.2 now replaces postgresql-8.1, migrate database.
+ * you may need to set the TCP/IP port, and this can be done either by
+ setting PGPORT (e.g. "export PGPORT=5432") or setting the port in
+ sisurc.yml (check what the correct value should be [on my system the
+ default was set to 5433 for 8.2, "ls -la /var/run/postgresql/" may help])
+
+%% sisu_0.52.4.orig.tar.gz (2007-05-05::18/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.4.orig.tar.gz
+ 8712a6162633f27dce36f57bc60599a5 1282392 sisu_0.52.4.orig.tar.gz
+ fd5618da795883fbeb1d53076783f80a 606 sisu_0.52.4-1.dsc
+ 7f6b377e5f0bdc0ea805a7af5f21f2bb 148482 sisu_0.52.4-1.diff.gz
+
+ * param, markup version detection added
+
+ * some code cleaning and anchoring of some regexs to start and end of string
+
+ * [checked against ruby 1.9.0 (2006-06-08) [i486-linux] in Debian Sid]
+
+ * debian debhelper (>= 5)
+
+ * [very rough wiki text output/assist (-g), may remove, not documented]
+
+%% sisu_0.52.3.orig.tar.gz (2007-04-26::17/4)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.3.orig.tar.gz
+ d71332c68a8ed6b01f358f1e5ae45875 1279017 sisu_0.52.3.orig.tar.gz
+ 4dd90c7e7790ea75be3017577759a128 606 sisu_0.52.3-1.dsc
+ a82c2c62106475640b25fefb38e9a6a4 148442 sisu_0.52.3-1.diff.gz
+
+ * texpdf, a fix, utf-8 markup/input file now required and assumed
+ [file magic identification of sisu markup files changes, utf-8 info is not
+ currently provided, (resulting in false assumption on encoding)]
+
+ * debian/control, postgresql dependency reverted till ruby db driver
+ dependencies are updated, [reopened: #419294] [not caught in 0.52.2 because
+ both versions of postgresql were installed, 0.52.2 was not uploaded to the
+ debian repository]
+
+%% sisu_0.52.2.orig.tar.gz (2007-04-21::16/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.2.orig.tar.gz
+ 96a2d9628e14e997bd93edd817b04996 1278391 sisu_0.52.2.orig.tar.gz
+ b3ed14988e1deed59ba13e0cfaae0b35 606 sisu_0.52.2-1.dsc
+ fb9ec4798fd769320873dbbc7ff145f8 148322 sisu_0.52.2-1.diff.gz
+
+ * html, links to other output make use of the default settings as well as
+ availability of software (e.g. to generate pdf from LaTeX)
+
+ * debian/control, postgresql dependency update, [intended to close: #419294]
+ [thank you for report Martin Pitt]
+
+%% sisu_0.52.1.orig.tar.gz (2007-04-14::15/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.1.orig.tar.gz
+ 24faea8c8565af2a24fb02c4499cb287 1280993 sisu_0.52.1.orig.tar.gz
+ 46a488ef619227fd02426a7311e86927 606 sisu_0.52.1-1.dsc
+ b0286f72ebcbb9a8443ae99bb905407a 141510 sisu_0.52.1-1.diff.gz
+
+ * initial revisit of XML output (and input) models, lots as yet to be done
+
+ * cleanup of some unused code, re-introduce if needed
+
+%% sisu_0.52.0.orig.tar.gz (2007-04-07::14/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.52.0.orig.tar.gz
+ e8767ea85c9e4f0941a8019f184031f3 1273211 sisu_0.52.0.orig.tar.gz
+ 991acda3465d5a8a043da7f327d8d020 606 sisu_0.52.0-1.dsc
+ 731cb9af8e47d4ebcd4a93c98286ac15 1391220 sisu_0.52.0-1.diff.gz
+
+ * 0.52 introduces: file-type identifier declaration, the _{first line of SiSU
+ a markup file}_ should be the sisu file-type identifier, indicated by the
+ word SiSU optionally (and preferably) followed by the version number of the
+ markup used:
+ e.g. current markup files would start with the line:
+ 'SiSU 0.52'
+ or
+ 'sisu-0.52'
+ [most markup is unchanged since sisu-0.38 though there have been some
+ additions since see e.g. sisu-0.42... (sisu-0.16 markup remains valid
+ though depreciated) to keep backward compatibility use:]
+ commented out equivalents:
+ '% SiSU 0.38'
+ or
+ '% sisu-0.38'
+ variants include:
+ 'SiSU text 0.52' [filename].sst (equivalent to the default 'SiSU 0.52')
+ 'SiSU insert 0.52' [filename].ssi
+ 'SiSU master 0.52' [filename].ssm
+
+ sisupod (zip) files (currently) have inserted into the binary:
+ 'SiSU sisupod 0.52.0'
+ and sisupod (zip) of directory content:
+ 'SiSU sisupod 0.52.0 directory contents sisupod-sisu-2007-04-03.ssp'
+
+ * command line options:
+ * default action for 'sisu [filename]' introduced: sisu -0 [filename]
+ [flag -0 introduced and can be configured in config as 'flag' 'default']
+ * added long forms for -q (--verbose-0|--quiet) -v (--verbose-1|--verbose)
+ -V (--verbose-2|--Verbose) -M (--maintenance) and -VM (--verbose-3)
+
+ * sst_identify_markup minor adjustments
+
+ * sst_do_inline_footnotes minor adjustments
+
+ * xml input representation variants (sax, dom, node), minor adjustments in
+ conversion to and from ordinary sisu markup (.sst)
+
+ * shared_xml fix (occasionally affecting html) make sure content of
+ <meta name= tag do not contain double quote character transform to
+ single quote
+
+ * ODF and XML special character and XML escape fixes
+
+ * gpl3 draft3 included as document markup sample
+ (requires the ODF and XML escape fixes made in this release version)
+
+%% sisu_0.51.0.orig.tar.gz (2007w13/6 | 2007-03-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.51.0.orig.tar.gz
+ a5e68fd38f2e35d9d18e0fdbcb5e13cb 1260579 sisu_0.51.0.orig.tar.gz
+ 2f7a0cd2b8866c1b92cdd09ff307ed5e 606 sisu_0.51.0-1.dsc
+ bd3565eabc814d2c457302bb0d88a0c2 141851 sisu_0.51.0-1.diff.gz
+
+ * defaults and skins, refactoring (code simplification)
+ * consequential pervasive small changes throughout code
+ * existing skins need to be rewritten (necessary modifications relatively
+ straightforward) [this is the reason for the version number bump up]
+
+ [NB. (i) document syntax remains unchanged;
+ (ii) refactoring changes pass initial tests but require further testing]
+
+ * xml representations of sisu markup, small a touch
+
+%% sisu_0.50.4.orig.tar.gz (2007w12/6 | 2007-03-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.4.orig.tar.gz
+ 9582c43e6a8b888865ffa756f5b897c5 1269202 sisu_0.50.4.orig.tar.gz
+ 606947b8081fc7d7bbfb299c258e2f19 606 sisu_0.50.4-1.dsc
+ c194ae084a143b8b7e586bac152f3486 141639 sisu_0.50.4-1.diff.gz
+
+ * (rudimentary generated) sample search form
+ * fix: db paths for files;
+ * fix: highlighting of matches (not yet consistent)
+ * feature: db select range can be set from url (limit and offset)
+ * cosmetic: text adjustments
+
+%% sisu_0.50.3.orig.tar.gz (2007w11/6 | 2007-03-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.3.orig.tar.gz
+ fd6c335ea792bdec34dafd22112a28cc 1266710 sisu_0.50.3.orig.tar.gz
+ ab6e0d4e85f9bbe4ccbf73c13050a76b 606 sisu_0.50.3-1.dsc
+ ab3d87396df3cf4c4319d84ce86e30ef 141612 sisu_0.50.3-1.diff.gz
+
+ * sample search form, generated cgi fixes, including selected db path for
+ urls, and setting of webserver port
+
+ * concordance, add search widget
+
+ * html navigation band, need more space with search widget, descriptions
+ shortened
+
+%% sisu_0.50.2.orig.tar.gz (2007w11/6 | 2007-03-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.2.orig.tar.gz
+ a8775153ce7e36b900c93b2d21108592 1266482 sisu_0.50.2.orig.tar.gz
+ 0fdfc5112033dd0477757193bda1e732 606 sisu_0.50.2-1.dsc
+ a7f5598bc317e18694777cca32eeb277 141599 sisu_0.50.2-1.diff.gz
+
+ * cgi sample search form, a bit of work, needs more
+ * url logic (testing required)
+ * boolean constructs (passed to SQL engine) (requires work)
+ * cgi_pgsql system call made to psql to extract list of available databases
+
+ * search forms (embedding), incorporation into navigation bands, and promo
+ panes (can be limited to search of document in question only, and provide as
+ result matched: object number index or text)
+ * configure sisurc.yml with information on action (cgi query url) and sisu
+ database name
+ * html_promo, search forms may be constructed for sisu databases
+ (yaml samples promo.yml and list.yml provide commented out example)
+
+ * promo (html) may be set (a) per document in document header or by document
+ skin, by directory in directory skin, or directory sisurc file, or per site
+ in per site skin or sisurc file
+
+ * initialisation of directories -CC, set permissions of copied files to 644
+
+ * help, man pages minor updates, default homepage update
+
+ [many small changes, extensive testing required]
+
+ * initial tests with ruby-1.8.6 passed
+
+%% sisu_0.50.1.orig.tar.gz (2007w10/6 | 2007-03-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.1.orig.tar.gz
+ 51f2236f3612bce6fa2bbcb0cf9545ed 1263537 sisu_0.50.1.orig.tar.gz
+ 25a1a4adf387c11d66b985dc2cf47623 606 sisu_0.50.1-1.dsc
+ ae312bda6b54e9e1b8cfaece0f03e1b4 141521 sisu_0.50.1-1.diff.gz
+
+ * promo/advertise minor extension
+
+ * css default, minor changes
+
+ * postgresql indexes, not built automatically on text fields, rely on tsearch,
+ (suggest you build gin indexes)
+
+ * cgi sample search form scripts visited
+
+ * yaml sample files promo.yml and list.yml updated
+ (removed from conf (/etc/sisu) copy in document samples)
+
+%% sisu_0.50.0.orig.tar.gz (2007w10/2 | 2007-03-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.50.0.orig.tar.gz
+ 76844391967ef202a748fa1be9d16a23 1265163 sisu_0.50.0.orig.tar.gz
+ af406857bf7cf1d91ddf0ff1249fe174 606 sisu_0.50.0-1.dsc
+ 6b0f5e2a44d8f2dc130efb075601834c 141436 sisu_0.50.0-1.diff.gz
+
+ * CHANGELOG renamed from version_manifest.changelog
+
+ * html some play with navigation bands (usability)
+
+ * sisurc.yml used (instead of depreciated sisurc.yaml)
+
+ * version.yml used (removed version.yaml)
+
+ * dal, metaverse renamed da for document abstraction (layer), variables (and
+ sisupod structure) renamed accordingly. [dal preferred to da because it is
+ easier to find].
+
+ * i18n, (babel renamed i18n)
+
+ * texpdf pdf output make a note about sisu_manifest, alternative output
+ formats
+
+ * promo/advertise, html, permits division into a major and a minor pane
+ (left) which is available for promotional material, links etc. the content of
+ which is currently controlled header @promo: and yaml files promo.yml and
+ list/yml usual path = = = _sisu/skin/yml ~/.sisu/skin/yml /etc/sisu/skin/yml
+ added sample of promo.yml and list.yml and an edited out header for promo
+ inclusion in "Free as in Freedom" and "GPL" document samples (these are
+ called by the document (header) but stored externally from the document (in
+ yml files (promo.yml and list.yml)), (will be possible to make a directory
+ wide inclusion))
+
+ [.gh 50th anniversary commemorative edition - "Freedom and Justice"]
+
+%% sisu_0.49.2.orig.tar.gz (2007w08/6 | 2007-02-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.49.2.orig.tar.gz
+ 10795b62c129f99645dd100a2fe52ddc 1263418 sisu_0.49.2.orig.tar.gz
+ 9983da392f16660e9e580b4d92197239 606 sisu_0.49.2-1.dsc
+ 0a13214e9ac2aba566c1f7bcd030c1ec 141340 sisu_0.49.2-1.diff.gz
+
+ * sysenv, for processing of remote files, download of remote images,
+ correction to variable name
+
+ * odf documents linebreaks removed
+
+ * description, less mention of document management, more on lightweight
+ markup, text structuring, publishing and search
+
+%% sisu_0.49.1.orig.tar.gz (2007w06/6 | 2007-02-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.49.1.orig.tar.gz
+ 4c2f96d5236d389384599899ed524bdb 1261990 sisu_0.49.1.orig.tar.gz
+ e9d3028830f44afb1ddd91fa08022bfe 606 sisu_0.49.1-1.dsc
+ 4dd3d53ca4b881e62654b871c9cf0957 141247 sisu_0.49.1-1.diff.gz
+
+ * xml, minor refactoring
+
+ * segmented html, minor user interface navigation changes (for pre next and
+ toc):
+ * navigation arrow buttons and available documents information trade
+ places, navigation arrows moved right (less cursor movement used in
+ navigation, the scroll bar is usually on the right, also more consistent
+ presentation (placement as in toc))
+ * removed two sets of html segment navigation bands, from very top and
+ under title (cleaner presentation without reduction in functionality, (also
+ for console clients))
+
+ * remote placement, rsync, simplify mapping used, should be a bit more robust
+
+ * response, user response abstraction, minor
+
+ * metaverse, superscript, subscript regex adjusted, (consider adopting this
+ modification more widely)
+
+ * digests, representation of document structure updated to use @, :A-:C, 1-3
+ (instead of 0-6)
+
+ [consider object numbering rule change, re: paragraph/line consisting
+ solely of * * * or ***, should these be un-numbered?, currently are numbered]
+
+%% sisu_0.49.0.orig.tar.gz (2007w04/5 | 2007-01-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.49.0.orig.tar.gz
+ b628ed7a7b50cb6af37b7072c1ebff3a 1262979 sisu_0.49.0.orig.tar.gz
+ a4d610ca440369ee6bfec28d386f6490 606 sisu_0.49.0-1.dsc
+ 56903630d97439f290de51622941dfe1 141237 sisu_0.49.0-1.diff.gz
+
+ * substantially the same as 0.48.8-10 (minor change (sysenv mkdir))
+ 0.49 opened post freeze and decision to use iso 639-2
+
+ * [use recursive acronym]
+
+ [0.48 branch should have become 0.49 with switch to iso 639-2
+ in 0.48.8-8 = = = 0.48.12-1 (as this requires the renaming
+ of some markup files e.g. dk becomes da) [builds from now are
+ post freeze (Etch), and the development routine should be
+ more regular]]
+
+%% sisu_0.48.12.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.12.orig.tar.gz
+ 9b5798e5452624ee051b6a2e1c3cbee5 1262380 sisu_0.48.12.orig.tar.gz
+ 0984bb76407ffeb2ed320e2fe54dd370 609 sisu_0.48.12-1.dsc
+ 5781b7838cc7eb0a442e99b65713ef74 141210 sisu_0.48.12-1.diff.gz
+
+ * [NOTE substantially the same as 0.48.8-8 (Etch freeze is at 0.48.8)]
+
+ * [NOTE rebuild of the 0.48.11 of (2007w02/5 | 2007-01-12) to merge branch
+ in version control, chronological break in sequence, this build is
+ substantially the same as 0.48.8-7, subsequent versions of 48.8 are more
+ recent (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.12.orig.tar.gz (2007w03/7 | 2007-01-21)
+ 174368e60459b0a57db63bfb818f2d80 1261172 sisu_0.48.12.orig.tar.gz
+ 5c941a2810bd816c3c4285171c90e13c 609 sisu_0.48.12-1.dsc
+ 7705abb94584cbe9b4803933e8ebf765 140977 sisu_0.48.12-1.diff.gz
+
+ * use ISO 639-2 for language codes, file names etc.
+ (rename danish samples .~da (instead of dk), [took out Brazilian Portuguese
+ and U.S. American English])
+
+ * debian samples, tex pdf page breaking instruction modified/corrected, and
+ danish examples renamed ISO 639-2
+
+ * sisupod initialisation, fix, (should not fail when initiated in a new sisu
+ work directory, (however do not mix regular sisu markup files and sisupod on
+ command line))
+
+ * sysenv, generic question/check added; used as safeguard against accidental
+ making sisupod of (whole) directory.
+
+ * xml, xhtml several adjustments (including use of xlink), also related css
+ fixes
+
+ * html, toc cosmetic correction
+
+%% sisu_0.48.11.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.11.orig.tar.gz
+ 341b2cebe2efdba4ae776f2752e9ce1b 1259351 sisu_0.48.11.orig.tar.gz
+ 66f3abd74a14f671af92074e7e6ea0fd 609 sisu_0.48.11-1.dsc
+ 0d416f48777c99c2b13f2c98a330fd13 141583 sisu_0.48.11-1.diff.gz
+
+ * [NOTE rebuild of the 0.48.11 of (2007w02/5 | 2007-01-12) to merge branch
+ in version control, chronological break in sequence, this build is
+ substantially the same as 0.48.8-7, subsequent versions of 48.8 are more
+ recent (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.11.orig.tar.gz (2007w02/5 | 2007-01-12)
+ 67ac00458d75646750c67ae3c685cee4 1258340 sisu_0.48.11.orig.tar.gz
+ 79c32c1eca4a3be3f97b90ffa6f6f746 609 sisu_0.48.11-1.dsc
+ 92153fcc5bd633e45c90c4d8b32115e0 141365 sisu_0.48.11-1.diff.gz
+
+ * sisu-0.48.8-7 equivalent, which includes a fix to the sample cgi search
+ form [0.48.8-4 introduced a bug]
+
+%% sisu_0.48.10.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.10.orig.tar.gz
+ 42b50dac775cbad84ebc394ec415986d 1259007 sisu_0.48.10.orig.tar.gz
+ d23694f1466e2af8766e61109fa97fcc 609 sisu_0.48.10-1.dsc
+ 9ea670634d088c996642ad4f2ec95c4d 141560 sisu_0.48.10-1.diff.gz
+
+ * [NOTE rebuild of the 0.48.10 of (2007w02/1 | 2007-01-08) to merge branch
+ in version control, chronological break in sequence, this build is
+ substantially the same as 0.48.8-6, subsequent versions of 48.8 are more
+ recent (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.10.orig.tar.gz (2007w02/1 | 2007-01-08)
+ 57f4d4f16ec7bb210823a3fb50cfc644 1257250 sisu_0.48.10.orig.tar.gz
+ 2f61d673ded3df48e0e55b49051b652f 609 sisu_0.48.10-1.dsc
+ 6cee860bf9684dce3660f5433b9b1bf4 141126 sisu_0.48.10-1.diff.gz
+
+ * debian control, sisu-pdf now depends on texlive alone (tetex removed)
+ (and free from use of metapackages). Feedback from Frank Küster, Ralf
+ Stubner and Norbert Preining (Closes: #402807)
+ [0.48.8-6]
+
+ * rollover year 2006 to 2007
+ [0.48.8-5]
+
+ * cgi sample form related modifications (relatively minor but nice to have
+ sorted) [0.48.8-4]:
+
+ * cgi_pgsql and cgi_sqlite, dynamic path used instead (fixed path will
+ result in errors where the default path is not used).
+
+ * cgi_pgsql and cgi_sqlite, "documentation" tip for copying generated cgi
+ sample to cgi-bin directory, prevent accidental copying to a directory
+ instead of file. Dynamic path used.
+
+ * debian/control Recommends libfcgi-ruby1.8 moved to sisu-postgresql and
+ sisu-sqlite (only used in this context) (previously suggested, needed for
+ sample search form)
+
+ * documentation/help on initially creating postgresql database for use if
+ necessary
+ [0.48.8-3]
+
+ * LaTeX, bugfix - restores missing left column object/paragraph numbers
+ (missing curly (close) brace) [important, though marked as normal]
+ [bug introduced somewhere between 0.47 and 0.48] (closes: #403037)
+ [0.48.8-2]
+
+ * LaTeX use mathptmx.sty instead of "obsolete" times.sty (as suggested by
+ Frank Küster in Bug#402807)
+ [0.48.8-2]
+
+ * cgi-sample form, an arbitrary limit set for sql query results
+ (1000 better than none) (closes: 403042)
+ [0.48.8-2]
+
+ * defaults, update sisu default homepage to current, (mainly urls)
+ [0.48.8-2]
+
+ * css addition to correspond with change to homepage
+ [0.48.8-2]
+
+ * debian control, adds mention of editors other than vim for which there is
+ some kind of syntax support, kate, kwrite, gedit, diakonos
+ [0.48.8-2]
+
+ * vim syntax file, minor adjustment (related to an endnote shortcut)
+
+ * doc/sisu/html keep copy of homepage
+ [introduced in 0.48.9]
+
+%% sisu_0.48.9.orig.tar.gz (2007w04/3 | 2007-01-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.9.orig.tar.gz
+ 1ad6d950454583d0130430664fc982ec 1258128 sisu_0.48.9.orig.tar.gz
+ f727321854bdf95cbb12e40bc247dd7f 606 sisu_0.48.9-1.dsc
+ 957f1438013ec99bc9a6c5010ca5ea1c 141430 sisu_0.48.9-1.diff.gz
+
+ * [NOTE rebuild of the 0.48.9 of (2006w52/1 | 20061225) to merge branch in
+ version control, chronological break in sequence, this build is substantially
+ the same as 0.48.8-2, subsequent versions of 48.8 are more recent
+ (Etch freeze is at 0.48.8), the latest being 0.48.8-8]
+
+ Originally released as:
+ %% sisu_0.48.9.orig.tar.gz (2006w52/1 | 20061225)
+ 237b2bae3e343e4b4c2f781d554f7df8 1254360 sisu_0.48.9.orig.tar.gz
+ 8dc727e95913688179b7808592e1c4e9 606 sisu_0.48.9-1.dsc
+ f53b18bbc0919121040cf4c022356e35 140080 sisu_0.48.9-1.diff.gz
+
+ * source tarball incorporates fixes added after Etch freeze in deb 0.48.8-2
+
+ * LaTeX, bugfix - restores missing left column object/paragraph numbers
+ (missing curly (close) brace) [important, though marked as normal]
+ [bug introduced somewhere between 0.47 and 0.48] (closes: #403037)
+
+ * LaTeX use mathptmx.sty instead of "obsolete" times.sty (as suggested by
+ Frank Küster in Bug#402807)
+
+ * cgi-sample form, an arbitrary limit set for sql query results
+ (1000 better than none) (closes: 403042)
+
+ * defaults, update sisu default homepage to current, (mainly urls)
+
+ * css addition to correspond with change to homepage
+
+ * debian control, adds mention of editors other than vim for which there is
+ some kind of syntax support, kate, kwrite, gedit, diakonos
+
+ * texpdf, usepackage url
+
+ * doc/sisu/html keep copy of homepage
+
+ * debian control, sisu-pdf depends for tetex | texlive, take on board
+ suggestion by Frank Küster (see #402807)
+
+%% sisu_0.48.8.orig.tar.gz (2006w48/1 | 20061127) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.8.orig.tar.gz
+ 556de4a3025156e0e7010210a0ddc32f 1248719 sisu_0.48.8.orig.tar.gz
+ e32d8183b0c1dde1020ecf3eced25dff 606 sisu_0.48.8-1.dsc
+ b054905ec4d964f73ccb0c705d593e63 139568 sisu_0.48.8-1.diff.gz
+
+ * metaverse, "visual" adjustment to allow inclusion of column width
+ information
+
+ * debian, dfsg document samples debian constitution v1.3 added
+ [english, german, danish]
+
+ * [sisu-markup-samples_1.0.4 contains "The Wealth of Networks", Yochai
+ Benkler]
+
+%% sisu_0.48.8-2 (2006w50/4 | 20061214) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 0eba8d5dd3086bd2d1fa830c6c19527c 606 sisu_0.48.8-2.dsc
+ 42662b8bf9a83321edbbab0b3b3db554 145527 sisu_0.48.8-2.diff.gz
+
+ * LaTeX, bugfix - restores missing left column object/paragraph numbers
+ (missing curly (close) brace) [important, though marked as normal]
+ [bug introduced somewhere between 0.47 and 0.48] (closes: #403037)
+
+ * LaTeX use mathptmx.sty instead of "obsolete" times.sty (as suggested by
+ Frank Küster in Bug#402807)
+
+ * cgi-sample form, an arbitrary limit set for sql query results
+ (1000 better than none) (closes: 403042)
+
+ * defaults, update sisu default homepage to current, (mainly urls)
+
+ * css addition to correspond with change to homepage
+
+ * debian control, adds mention of editors other than vim for which there is
+ some kind of syntax support, kate, kwrite, gedit, diakonos
+
+%% sisu_0.48.8-3 (2006w52/5 | 20061229) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 0f5acb28c8e9fdd21c29db7fbc7e1d3c 606 sisu_0.48.8-3.dsc
+ 669875a8ca8102e5772df258b0665ba8 147220 sisu_0.48.8-3.diff.gz
+
+ * texpdf, usepackage url (improved placement of urls)
+
+ * debian control, sisu-pdf now depends on texlive alone, (alternative tetex
+ depends removed - reason: problem keeping both working!), take on board
+ suggestion by to rely on texlive Frank Küster if tetex is problematic (this
+ addresses, but does not close #402807 without further discussion, dropping
+ alternative tetex depends simplifies sisu-pdf (tex) related depends, and
+ makes it much more reliable (also see in changelog earlier feedback on
+ sisu-pdf depends from Norbert Preining url at 0.47.7-3) depends here drop
+ reliance on metapackages, (extra checks required as to determine whether
+ texlive depends list may be shortened, playing safe))
+
+ * debian/control priority changed to extra (from optional) as depends on
+ texlive (without option for use of tetex instead)
+
+ * debian/control sisu recommends libfcgi-ruby1.8 (previously suggested,
+ needed for sample search form)
+
+ * documentation/help on initially creating postgresql database for use if
+ necessary
+
+%% sisu_0.48.8-4 (2006w52/7 | 20061231) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 20337413c61bc87b8a9b3e8a2e843b81 606 sisu_0.48.8-4.dsc
+ b440173ffabe147a851ecb25b20db6a2 148820 sisu_0.48.8-4.diff.gz
+
+ * cgi sample form related modifications (relatively minor but nice to have
+ sorted):
+
+ * cgi_pgsql and cgi_sqlite, dynamic path used instead (fixed path will
+ result in errors where the default path is not used).
+
+ * cgi_pgsql and cgi_sqlite, "documentation" tip for copying generated cgi
+ sample to cgi-bin directory, prevent accidental copying to a directory
+ instead of file. Dynamic path used.
+
+ * debian/control Recommends libfcgi-ruby1.8 moved to sisu-postgresql and
+ sisu-sqlite (only used in this context)
+
+%% sisu_0.48.8-5 (2007w01/2 | 2007-01-02) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 07964ec823ae5d96a04ff6c88f5a7f66 606 sisu_0.48.8-5.dsc
+ 90aa76b6061e10e715726c51e5b08a70 153491 sisu_0.48.8-5.diff.gz
+
+ * sisu-pdf texlive dependencies shortened and free from use of metapackages
+
+ * rollover year 2006 to 2007
+
+%% sisu_0.48.8-6 (2007w01/3 | 2007-01-03) [Etch related fixes, uploaded by Daniel Baumann (Medium), cleared/unblocked by Marc 'HE' Brockschmidt]
+ 4c95034d6d9bbe67cd2d008e561a78cc 606 sisu_0.48.8-6.dsc
+ 02bda8e1da0ef74396b1e85ac8ce9e6e 154145 sisu_0.48.8-6.diff.gz
+
+ * sisu-pdf texlive dependency in -5 adjusted on feedback from Norbert
+ Preining (Closes: #402807)
+ http://lists.debian.org/debian-tex-maint/2007/01/msg00034.html
+ http://lists.debian.org/debian-tex-maint/2007/01/msg00033.html
+
+%% sisu_0.48.8-7 (2007w02/3 | 2007-01-10) [Etch related fixes, uploaded by Daniel Baumann (Medium), cleared/unblocked by Marc 'HE' Brockschmidt]
+ fd6e2df63f7b75bc3ad7aa5c34f606fd 606 sisu_0.48.8-7.dsc
+ 2e2fc97a23a4550ed279f94f85ea7378 157623 sisu_0.48.8-7.diff.gz
+
+ * the cgi sample form modifications introduced in -4 were premature, they
+ break things, behaviour reverted to -2 [-3].
+ (Closes: #406281 and #406280) [same bug]
+
+ * removed sisu-sqlite suggests on libdbd-sqlite and
+ sisu-postgresql suggests on libdbd-pgsql which are
+ not found in testing/Etch
+ (Closes: #406282 and #406284)
+
+ * sisu html man page regenerated (from man page)
+
+%% sisu_0.48.8-8 (2007w03/7 | 2007-01-21) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 0ba3e2e6efecd2c57dccf6457200e945 606 sisu_0.48.8-8.dsc
+ 2fb929cfa2fd00366cda7b38f2dea4dd 168554 sisu_0.48.8-8.diff.gz
+
+ * use ISO 639-2 for language codes, file names etc.
+ (rename danish samples .~da (instead of dk), [took out Brazilian Portuguese
+ and U.S. American English])
+
+ * debian samples, tex pdf page breaking instruction modified/corrected, and
+ danish examples renamed ISO 639-2
+
+ * sisupod initialisation, fix, (should not fail when initiated in a new sisu
+ work directory, (however do not mix regular sisu markup files and sisupod on
+ command line))
+
+ * sysenv, generic question/check added; used as safeguard against accidental
+ making sisupod of (whole) directory.
+
+ * xml, xhtml several adjustments (including use of xlink), also related css
+ fixes
+
+ * html, toc cosmetic correction
+
+%% sisu_0.48.8-9 (2007w04/1 | 2007-01-22) [Etch related fixes, uploaded by Daniel Baumann (Medium)]
+ 8ba3e0a9ba6b9b0f4966e020cbcee865 606 sisu_0.48.8-9.dsc
+ 1ac6537c065807c1459e63a4122f9d79 145898 sisu_0.48.8-9.diff.gz
+
+ * removed Danish debian sample markup files to reduce the size of the
+ inter-diff against the package in testing.
+
+ * minor further adjustments to xml processing
+
+%% sisu_0.48.8-10 (2007w04/2 | 2007-01-23) [Etch related fixes]
+ ccc192b7615235f56c9e5b122089d50d 608 sisu_0.48.8-10.dsc
+ 64732549e20c98a6958a3544770343fb 146148 sisu_0.48.8-10.diff.gz
+
+ * xml and xhtml adjustment of regex match of urls for xlink
+
+%% sisu_0.48.8-11 (2007w07/5 | 2007-02-16) [Etch related fixes]
+ 0f3e22d6fd4cfab955f47f9cb5840d7a 608 sisu_0.48.8-11.dsc
+ 825404e40bfbe54999c0ae4ec90fa682 162284 sisu_0.48.8-11.diff.gz
+
+ * xml, minor refactoring
+
+ * segmented html, minor user interface navigation changes (for pre next and
+ toc):
+ * navigation arrow buttons and available documents information trade
+ places, navigation arrows moved right (less cursor movement used in
+ navigation, the scroll bar is usually on the right, also more consistent
+ presentation (placement as in toc))
+ * removed two sets of html segment navigation bands, from very top and
+ under title (cleaner presentation without reduction in functionality, (also
+ for console clients))
+
+ * remote placement, rsync, simplify mapping used, should be a bit more robust
+
+ * response, user response abstraction, minor
+
+ * metaverse, superscript, subscript regex adjusted, (consider adopting this
+ modification more widely)
+
+ * digests, representation of document structure updated to use @, :A-:C, 1-3
+ (instead of 0-6)
+
+ * sysenv, change in use of mkdir
+
+ * sysenv, for processing of remote files, download of remote images,
+ correction to variable name [post 0.49.1 fix]
+
+ [this build is based on 0.49.1 which is "stable" in its major parts]
+
+%% sisu_0.48.7.orig.tar.gz (2006w46/7 | 2006-11-19) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.7.orig.tar.gz
+ 2bbc89da7fa28de1193ea64fd98bb522 1248263 sisu_0.48.7.orig.tar.gz
+ 94adac2227718f4a6c1c2437c883e939 606 sisu_0.48.7-1.dsc
+ f53871fe2aad4fc8ddfb9b3b1817d677 100806 sisu_0.48.7-1.diff.gz
+
+ * cgi html test search form, multilingual documents, file naming convention
+ resulted in incorrect url mapping of results, fixed
+
+ * dcc, document content digest, multilingual/non-English documents, fixes
+ related to translation and metadata extraction
+
+ * defaults for html, invisible dot navigation buttons, text made cleaner for
+ console clients, using < ^ > for pre, toc, and next, (there are other
+ equivalent navigation options)
+
+ * sitemaps, very early days, stubs in place to make this work
+ (google, yahoo, ms announced their joint decision to use this week)
+
+ * remote, placement of sitemaps directory to remote server, rsync
+
+%% sisu_0.48.6.orig.tar.gz (2006w45/6 | 2006-11-11) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.6.orig.tar.gz
+ 82b8dd63a4626fcef222d039820827cc 1245728 sisu_0.48.6.orig.tar.gz
+ 25be6c97cfa020a1b2971e02bc32b715 606 sisu_0.48.6-1.dsc
+ 1c682265850177ec5eb32a3cfe1fc3cd 100704 sisu_0.48.6-1.diff.gz
+
+ * html, doc (single text, scroll version) tables, fixed
+
+ * texpdf, bugfix for (asterisk marker type) footnotes in headings, fixed
+
+ * metaverse, in "visual" table representation {table} may be used instead of
+ {t} likewise {table~h} instead of {t~h},
+ (resulting output cleaned, fix)
+
+ * vim syntax highlighting updated for {table} match
+
+%% sisu_0.48.5.orig.tar.gz (2006w45/3 | 2006-11-08) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.5.orig.tar.gz
+ 208f47dcc87802fcd14b64e9c1aa2a52 1245103 sisu_0.48.5.orig.tar.gz
+ 1664f21a14fa2311d7cb115e8d31fc88 606 sisu_0.48.5-1.dsc
+ 428fe256c0dd063d362baa751866ede8 100632 sisu_0.48.5-1.diff.gz
+
+ * sisupod (directory zip) creation, file selection tuning
+
+ * command line option papersize (texpdf), minor convention e.g.
+ --papersize-letter (in addition to --papersize=letter) available options:
+ European 'A4', book 'a5', 'b5' and U.S. 'letter', 'legal' (system defaults
+ to A4). However, these can be and are better set in the config file
+ (document headers being another though not recommended possibility),
+
+ 'sisu --help env' should list the current (default/configuration) settings
+ including papersize
+
+ * minor checks, minor editing, e.g. man pages
+
+%% sisu_0.48.4.orig.tar.gz (2006w45/1 | 2006-11-06) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.4.orig.tar.gz
+ eee656e88462c4dc2f338dadb26fc97a 1244746 sisu_0.48.4.orig.tar.gz
+ 70bd0670b8b21130856e87d32644102c 606 sisu_0.48.4-1.dsc
+ f72edba97792bc72f07b5b66223761fc 100603 sisu_0.48.4-1.diff.gz
+
+ * texpdf, default table behaviour changed to accommodate tables with a lot of
+ text, also some cleaning of tables (fixed)
+
+ * plaintext, serious performance issue when dealing with a document with
+ tables, [especially annoying as tables are omitted from this output format]
+ addressed (fixed)
+
+ * markup footnote conversion to paragraph inline footnotes, (fixed)
+
+ * minor adjustment to sisupod directory name...
+
+%% sisu_0.48.3.orig.tar.gz (2006w44/2 | 2006-10-31) [Debian Release snapshot, uploaded by Daniel Baumann (High)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.3.orig.tar.gz
+ 8c3fffc9a7da73220e15d15cfba968bf 1243334 sisu_0.48.3.orig.tar.gz
+ 6a75a4a2d5817914f274388237ddcf4d 606 sisu_0.48.3-1.dsc
+ eea089e0690c3aa6c7a4baae8c4b5f54 100547 sisu_0.48.3-1.diff.gz
+
+ * one file omitted in sisu 0.48.2 fix, see comments there.
+
+%% sisu_0.48.2.orig.tar.gz (2006w44/2 | 2006-10-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.2.orig.tar.gz
+ a9a876acb9cdf3501cd3d7bfe09db9d0 1243141 sisu_0.48.2.orig.tar.gz
+ ae29c18dfb96d898e608ff50b1d20512 606 sisu_0.48.2-1.dsc
+ e16685b9fe00f5e6096f72386d699ff7 100497 sisu_0.48.2-1.diff.gz
+
+ * debian ruby build ruby-1.8.5-3 (uploaded yesterday) detects and breaks on
+ cyclic include errors which were found at a basic level of operation,
+ rendering program effectively broken. New ruby build affects all previous
+ versions of sisu. [Further code review is necessary to ascertain that this
+ does not occur anywhere else within sisu code base]
+
+%% sisu_0.48.1.orig.tar.gz (2006w43/7 | 2006-10-29) [Debian Release snapshot, uploaded by Daniel Baumann (Medium)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.1.orig.tar.gz
+ cda3082de5c359737bfdfd23474fee2b 1242845 sisu_0.48.1.orig.tar.gz
+ badc4a6d1e6bc77956ec603a5278bbea 606 sisu_0.48.1-2.dsc
+ a95c14570a0e5ebd46a588c7181151f5 101129 sisu_0.48.1-2.diff.gz
+ sisu_0.48.1-1.dsc
+ sisu_0.48.1-1.diff.gz
+
+ * metaverse, indicate image missing if a requested image is not found
+
+ * processing directories default location moved to be placed under home or /tmp
+ from pwd
+
+ * (-1) debian/control, recommends hyperestraier removed as appears to cause
+ issues (also rename and pgaccess)
+
+ * (-2) debian/control recommends hyperestraier (sisu and sisu-complete) put
+ back
+
+%% sisu_0.48.0.orig.tar.gz (2006w43/6 | 2006-10-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.48.0.orig.tar.gz
+ 5e7bc1752828347d0f43e7eb8403cfec 1241476 sisu_0.48.0.orig.tar.gz
+ 79cce16683c3da3f70e9cc205710feb1 606 sisu_0.48.0-1.dsc
+ 748830590639ab2e8097b8c0820b37a4 100197 sisu_0.48.0-1.diff.gz
+
+ * sisupod, creation of (zipped sisu content files, primarily a way of
+ bundling sisu content assocated with a prepared sisu file or set of files,
+ that sisu commands can be run directly against) creation:
+ 'sisu -S [filename]'
+ places a file named sisupod.zip in the output directory
+ for directory
+ 'sisu -S'
+ creates a sisupod of the pwd named:
+ sisupod-[pwd.stub]_[date].ssp
+ e.g. sisupod-sisu_2006-10-26.ssp
+ (uses system call to unix commands find and egrep)
+
+ * sisupod, sisu can be run directly against a sisupod without manual
+ unpacking, e.g.:
+ 'sisu -3 sisupod.zip'
+ [early implementation, a system call used],
+ run against the following filename/types: sisupod, sisupod.zip,
+ [filename].ssp
+ * security:
+ * sisu does not ever use a sisurc.yaml within a sisupod
+ * sisu will only use a skin within sisupod if --trust(ed) modifier is
+ added to the command line
+ * skins, note: copy dir skin to skin_sisupod.rb
+ [doc skin keeps name as called with name within document]
+
+ * remote operations possible on sisupod, e.g.
+ 'sisu -3 http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip'
+
+ * sysenv, sisu processing directory '_sisu_processing' default placement now
+ first within pwd (markup text directory) if that is not writable under home
+ ~ and if not available to /tmp (the preference of home over /tmp my be
+ reconsidered, thinking is to default towards keeping processing related
+ info within private space)
+
+ * manifest, uses documents home button/icon, if available
+ (rather than sisu default)
+
+ * sisupod alternative names sisupod, siuspod.zip [filename].ssp
+
+ * urls, tune, removed link to html 'tune' output file, no longer generated
+
+ * sysenv, url path reporting fix, (broken by renaming in 0.47.7)
+
+ * processing directories default location moved to be placed under home or /tmp
+ from pwd, likewise sisupod creation directory moved
+ [processing directory]/sisupod from ./_sisu/sisu_doc
+
+ * extra testing, numerous small fixes, (several related to method renaming in
+ sisu-0.47.7, also checks against both ruby 1.8.5 and current 1.9, $KCONV set
+ to UTF-8 rather than rely on environment and many more also as above)
+
+%% sisu_0.47.8.orig.tar.gz (2006w42/4 | 2006-10-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.8.orig.tar.gz
+ 53c131f5c569d96ff60ecfdeb1a1f3d5 1237476 sisu_0.47.8.orig.tar.gz
+ a39620a910612684a0dc31b3b5559eda 606 sisu_0.47.8-1.dsc
+ 8570a26f39ec44b3c8c539d0dcf63a99 100075 sisu_0.47.8-1.diff.gz
+
+ * metaverse, minor fix related to link created for shared source file with
+ regard to new syntax shortcut markup for listing multiple available output
+ types produced by SiSU (introduced in 0.47.6)
+
+%% sisu_0.47.7.orig.tar.gz (2006w41/6 | 2006-10-14) [Debian Release snapshot, uploaded by Daniel Baumann]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.7.orig.tar.gz
+ 6bb28ad3f783184876c455c91cf9ef22 1236983 sisu_0.47.7.orig.tar.gz
+ c8bf85fb300d6260176ad459c2f6e3a0 606 sisu_0.47.7-2.dsc
+ 8eaeebb43b6de5ca727995d681d36b1c 102531 sisu_0.47.7-2.diff.gz
+ 62c779fa5ca023af71854d989b60bfe9 609 sisu_0.47.7-1.dsc
+ 07b12f4b1af9873eee44e610511ac525 99876 sisu_0.47.7-1.diff.gz
+
+ * sysenv, minor code play, some method renaming, organisational
+ (however affects rest of code, much testing, (smallish possibility of
+ breakage remains))
+
+ * gif, reinstate support, however use not yet recommended
+ (gif no longer under patent, however, gif is not available for all pdf,
+ does not yet appear to be available in tetex)
+ [image support: png, jpg, (gif)]
+
+ * [debian/control] sisu-pdf set to work with texlive (tetex|texlive depends)
+ (sisu works out of the box with texlive installed, currently an issue with
+ the default font in texlive)
+ http://lists.debian.org/debian-tex-maint/2006/10/msg00620.html
+
+%% sisu_0.47.6.orig.tar.gz (2006w40/6 | 2006-10-07) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.6.orig.tar.gz
+ 7e319ebd2f8265f6ca7e46a4c74bd211 1236547 sisu_0.47.6.orig.tar.gz
+ bf4602222c37f9e288284e1573ebd034 609 sisu_0.47.6-1.dsc
+ 9741957517f66d825d952e309d231152 99839 sisu_0.47.6-1.diff.gz
+
+ * tex/pdf, fixed paragraph indent with hyperlink
+ (previously linking not parsed and dealt with)
+
+ * tex/pdf, fixed closing double quote (was typo)
+
+ * syntax, new shortcut markup for listing multiple available output
+ types produced by SiSU (existing syntax unaffected)
+
+ * [package structure, vim directory moved to data/sisu/conf/vim from
+ data/vim]
+
+%% sisu_0.47.5.orig.tar.gz (2006w39/7 | 2006-10-01) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.5.orig.tar.gz
+ 40d50d1db5e6f1ca4750dec82fc7aad8 1234759 sisu_0.47.5.orig.tar.gz
+ e3555bb320920eb25e62c820961105e7 609 sisu_0.47.5-1.dsc
+ a030d4f4dd052009ce36ab14dec29ed3 99796 sisu_0.47.5-1.diff.gz
+
+ * sisupod, fix creation of, change of library name caused break in 0.47.4
+
+%% sisu_0.47.4.orig.tar.gz (2006w39/5 | 2006-09-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.4.orig.tar.gz
+ 71ae6429e675fdbfb6a8ab507c3e6989 1233691 sisu_0.47.4.orig.tar.gz
+ c0968784d14ac2ff6b7754dc5de6024a 609 sisu_0.47.4-1.dsc
+ a0ccb2abcee55dd60529b2cc88c73454 99693 sisu_0.47.4-1.diff.gz
+
+ * syntax highlighting, kate, kwrite, nano minor updates, review
+
+ * debian: browser and pdf reader icons removed,
+ (Closes: #389500) fixes debian policy violation
+ removed non dfsg compliant firefox icon
+ (also removed other browser related icons)
+
+%% sisu_0.47.3.orig.tar.gz (2006w38/6 | 2006-09-23) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.3.orig.tar.gz
+ 18ac94ea4ab58060873ba22d37d03bd0 1268844 sisu_0.47.3.orig.tar.gz
+ 3c2fac012a174f930e9030863e92f065 609 sisu_0.47.3-1.dsc
+ c075392d392665de4d5054f438352f2f 99612 sisu_0.47.3-1.diff.gz
+
+ * minor code review
+ [takes care of RAM issue experienced with some forms of batch processing]
+
+%% sisu_0.47.2.orig.tar.gz (2006w38/5 | 2006-09-22) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.2.orig.tar.gz
+ 5afc268f78ab72b17c387469e2ae5caf 1268744 sisu_0.47.2.orig.tar.gz
+ 334056e0cdd87dc2887baf99a638e3d1 609 sisu_0.47.2-1.dsc
+ 8e468cc4052b0f28fb3b22ef5dfbf4c2 99580 sisu_0.47.2-1.diff.gz
+
+ * metaverse, a line of code needed changing for ruby-1.8.5
+
+%% sisu_0.47.1.orig.tar.gz (2006w38/1 | 2006-09-18) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.1.orig.tar.gz
+ 77d77e7888ee1f97a38012233d5d4d90 1268488 sisu_0.47.1.orig.tar.gz
+ c7e9cd3ee27bba16684651bda463124c 609 sisu_0.47.1-1.dsc
+ 596bb6380b8355d4b5420aa5ddb2008f 99556 sisu_0.47.1-1.diff.gz
+
+ * fixed, document content certificate, issue with batch processing (and
+ cleaning of earlier document details) sorted
+
+ * fixed, sharing document source for multilingual documents (-s), creates and
+ copies to the wrong directory
+
+ * plaintext minor adjustments, and a batch processing information sync fix
+
+%% sisu_0.47.0.orig.tar.gz (2006w37/7 | 2006-09-17) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.47.0.orig.tar.gz
+ c8eb3908d4b6fb6e6bc199118a0ef897 1268127 sisu_0.47.0.orig.tar.gz
+ 42836c37c783d9c7aee87085127cd87c 609 sisu_0.47.0-1.dsc
+ e02895ae383af556ebc50d7832c7d20a 99541 sisu_0.47.0-1.diff.gz
+
+ * sisupod, use zip compression and file extension .zip
+ (instead of tar gzip .tgz) interoperability, wider platform comprehension
+
+ * sisupod, master documents (.ssm) bug in batch processing sorted (todo with
+ filenames)
+
+ * html tune, unnecessary hard output removed (except in maintenance mode -M)
+
+ * (document content certificate, issue with batch processing sorted)
+
+ * reduce system calls
+
+ * odf base file, odt.zip (instead of odt.tgz), easy way to maintain directory
+ structure (issue in version control, hg drops empty directories)
+
+ * conversion, prefer --to- to --to=, keep both, man page and help updated to
+ use --to-[conversion] (also minor cleaning of screen output)
+
+ * debian/control depends zip and unzip added, used for sisupod.zip and ODF output
+
+%% sisu_0.46.5.orig.tar.gz (2006w36/6 | 2006-09-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.5.orig.tar.gz
+ bea9a0eddb1ea8746de416a7bdd22e2e 1265848 sisu_0.46.5.orig.tar.gz
+ 87e99256d31497c23509811e122b6ea2 609 sisu_0.46.5-1.dsc
+ 5b4caafec6ac1ebc5314f7fa44e8f677 99342 sisu_0.46.5-1.diff.gz
+
+ * documentation adjustments
+
+%% sisu_0.46.4.orig.tar.gz (2006w36/3 | 2006-09-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.4.orig.tar.gz
+ 506bc266f4618eea88c7c005f21c2bf4 1269441 sisu_0.46.4.orig.tar.gz
+ 6fbd0e2e7f2915725feb03e3ea0f977f 609 sisu_0.46.4-1.dsc
+ a7fcd22b852f90ab4af04c56143a8aa2 99242 sisu_0.46.4-1.diff.gz
+
+ * defaults html text/ accompanying blurb removed some Ruby / Debian / Linux /
+ Unix text
+
+%% sisu_0.46.3.orig.tar.gz (2006w36/1 | 2006-09-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.3.orig.tar.gz
+ c41d41e0771e66c236b2832c8798a1d8 1269233 sisu_0.46.3.orig.tar.gz
+ 74458da231e6e4628996c48eb915344d 609 sisu_0.46.3-1.dsc
+ f7ab7c92526bfecd71331a69ef069d44 99223 sisu_0.46.3-1.diff.gz
+
+ * Ruby version upped to 1.8.4, (probably will work with earlier versions but
+ not tested)
+
+ * db option synonyms --pgsql for -D or --sqlite for -d
+
+ * document structure, extended level, stubs in place
+
+ * syntax highlighting, directory renamed and a quick look at kate and
+ diakonos updated
+
+ * help/man pages, db related minor update
+
+ * termsheet checked
+
+ * minor code play
+
+ * debian/control moved from extra to optional - does not conflict with
+ anything, though a bit specialised perhaps
+
+ * debian/copyright, year 2006 added
+
+ * [debian/control build does not permit changing ruby version to 1.8.4]
+
+%% sisu_0.46.2.orig.tar.gz (2006w34/5 | 2006-08-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.2.orig.tar.gz
+ 852d865e66fd37e1902d3940cd460e55 1265122 sisu_0.46.2.orig.tar.gz
+ 9931d0d05ea5e37134fb063c31caa66e 609 sisu_0.46.2-1.dsc
+ 6a52a52ede5cf3158cd4bd843f737295 99124 sisu_0.46.2-1.diff.gz
+
+ * experimental conversion xml(sxs,sxn) to sst, (from xml that was converted
+ from sst) [sxd not yet in place, and several errors identified]
+
+ * header metadata extraction and sharing changed (used by xml and other
+ document types)
+
+ * conversion file libraries, some renaming
+
+ * zsh completion (see 0.46.1), simplified/corrected in response to feedback,
+ still naive
+
+ * help and man pages updated with conversion info between sst and xml and
+ back
+
+ * Ruby: ruby version restrict use to ruby-1.8.2 or later, but only tested for
+ ruby-1.8.4 (and later) [may have to restrict to more recent versions of
+ Ruby]
+
+ * Ruby: if|unless|elsif|where colon constructs are depreciated in Ruby 1.8.5.
+ (released today), so (the aesthetically more pleasing) colons switched with
+ semi-colons.
+
+%% sisu_0.46.1.orig.tar.gz (2006w33/3 | 2006-08-16) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.1.orig.tar.gz
+ 26bef582eb5da7fe39b578e9296ceb19 1263026 sisu_0.46.1.orig.tar.gz
+ 37ebebd9bf56e2e5fd57b0b1411771be 609 sisu_0.46.1-1.dsc
+ 3537949d88ec6749698fd04d21a30d96 99119 sisu_0.46.1-1.diff.gz
+
+ * zsh, naive zsh completion file _sisu in data/sisu/conf/completion (on
+ debian installed to /usr/share/sisu/conf/completion) 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)
+
+ * code, minor alterations,
+ * creation of Arrays and Hashes, not intended to be substantive
+ * in hub corrected calling of help for termsheet
+ * small adjustments to calling of conversion scripts
+
+ * debian/control, reminded that sisu-vim existed prior to vim-sisu (renamed
+ due to vim policy) both now removed and replaced by default installation,
+ control file modified accordingly for sisu-vim
+
+%% sisu_0.46.0.orig.tar.gz (2006w32/6 | 2006-08-12) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.46.1.orig.tar.gz
+ 84d863f4f41ff2e328530930890f7160 1259520 sisu_0.46.0.orig.tar.gz
+ 9d04df245c99431649f40f58d5022c40 609 sisu_0.46.0-1.dsc
+ 6b027cbd9d063eae67010ee072a6fc28 99068 sisu_0.46.0-1.diff.gz
+
+ * 0.44 branch reinstated (leapfrogging over 0.45 which was a reversion to
+ 0.43)
+
+ * metaverse changes for consistency, affects all downstream code (with
+ attendant risk), numerous related changes; preliminary tests passed
+
+ * see 0.44.0
+
+ [basic operation (sisu -mNhwpoabxXyv [filename]) also tested for ruby 1.9
+ with rmagick switched off (db not tested)]
+
+ * debian/rules compression mentioned twice, one removed
+
+%% sisu_0.45.0.orig.tar.gz (2006w31/7 | 2006-08-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.45.1.orig.tar.gz
+ dbdcdd947aa6357492ac50a5bb5b81af 1242290 sisu_0.45.0.orig.tar.gz
+ 9ac37f27c19ff8696631396627919806 609 sisu_0.45.0-1.dsc
+ 7426d8ba2f1e2aa709a0aeccd4596f4d 99025 sisu_0.45.0-1.diff.gz
+
+ * an emergency reversion to 0.43 code, as 0.44 breaks many LaTeX/pdfs
+ [the other components of 0.44 are fine but the LaTeX part does not play
+ properly with the new code base]
+ for the present time, ignore (jump over) the version changes in 0.44,
+ and continue from 0.43
+
+ * only the odf icon (noted in 0.44) and a cosmetic change to manifest are
+ added to this release since 0.43
+
+ * the debian related changes in 0.44 are retained
+
+ * NB. only emergency maintenance on this branch, development is on 0.44
+
+%% sisu_0.44.0.orig.tar.gz (2006w31/7 | 2006-08-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.44.1.orig.tar.gz
+ 4ce1f4946ce12180bf257d46f5ab6ff0 1256908 sisu_0.44.0.orig.tar.gz
+ f976a5e8494184696c70c45b240933ee 609 sisu_0.44.0-1.dsc
+ a8fd211fff73a01beb17433707bb1e04 98941 sisu_0.44.0-1.diff.gz
+
+ [some breakage, in particular LaTeX/pdf had issues, fixed in 0.46.0]
+
+ * some juggling of code and renaming of some files
+ (db broken into smaller chunks)
+
+ * metaverse, document level structure moved to external shared library and
+ determined therefrom
+
+ * metaverse, ocn moved to an external shared library and together with
+ "node" numbering determined therefrom
+ [raises possibility of ocn (numbering) issues, preliminary tests passed]
+
+ * db operations broken up into smaller code files
+
+ * numerous other little things
+
+ ** Note: shared sisu libraries, practice likely to become that these contain
+ pointers to libraries, rather than the libraries themselves, e.g.
+ shared_db
+
+ * odf/odt added generic odf tiny icon
+ * html, added icon and link to opendocument text
+ (assumes output is always present, as do the pdf equivalents)
+
+ * markup, experimenting with simple xml models,
+ three xml representations of sisu markup, sxs, sxd, sxn
+ export with
+ sisu --to=sxs [filename]
+ [experimental, these will change]
+ import, not done
+
+ * --to made a synonym for --convert
+
+ * debian/rules simplified
+ [utilising feedback from Daniel Baumann on "rant" package]
+
+ * debian/control sisu-pdf Depends: changed to make TeX Live optional,
+ actually part of it is now required as tetex along with tetex-extra do not
+ contain all the LaTeX packages SiSU requires (in particular manyfoot.sty is
+ missing) [used feedback from Ralf Stubner on dependency options]
+
+ * debian/lintian/sisu added lintian override for man page and non-executables
+
+%% sisu_0.43.0.orig.tar.gz (2006w29/6 | 2006-07-22) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.43.0.orig.tar.gz
+ 09127f189334eef57363875bb2fb2a4d 1241138 sisu_0.43.0.orig.tar.gz
+ 11692249f8ae03a4ead59fb1f0e00514 609 sisu_0.43.0-1.dsc
+ e3307627de717fca49c9fbec988c8cc2 99392 sisu_0.43.0-1.diff.gz
+
+ * footnotes, introduction of new editor (square bracket) series,
+ using asterisk and plus signs
+ ~[ asterisk editor note ]~ or ~[* asterisk ed. note ]~ and
+ ~[+ dagger ed. note ]~
+ outputs updated: plaintext, latex, html, xml, odf, dcc, database
+ the sample search form does not yet search the new (asterisk and plus)
+ endnote series
+ [easy to add additional symbols later, also consider it should be fairly
+ straightforward to add possibility to use of name of note maker with
+ numbered note sequences for each contributor; you may wish to think of
+ sorting into different types for some of these like plaintext, later]
+
+ * database, breaks existing database model by introducing new tables, to
+ accommodate the new endnote series, (square bracket series). (there are
+ alternative ways to add the information, e.g. add column with information
+ on the endnote symbol involved; have in fact added a table for each of the
+ symbols used)
+
+ * additional footnote annotations (asterisk, dagger) can be dropped from
+ output with command modifiers --no-asterisk, --no-dagger, --no-annotate
+
+ * --convert=footnotes (convert to embedded footnote markup, do not make
+ changes if footnote mismatch)
+ --convert=footnotes-force (make changes even if there is a footnote
+ mismatch) provide warning about changes what todo, make backup? or create
+ new file, what filename to use?
+
+ * --no-ocn switches off object citation numbering. Produce output without
+ identifying numbers in margins of html or LaTeX/pdf output. [with -h -H or
+ -p]
+
+ * vim syntax highlighter recognises footnote/annotation additions
+
+ * debian vim/addons/syntax/sisu.vim add the new syntax file
+ (submit changes to Bram)
+
+ * man page and help.rb updated on editor footnotes, square bracket series
+
+ * relaxng object models, look at, included in data/doc/sisu/models/relaxng
+ (some models quite old, and undeveloped, originally in sisu library
+ relaxng.rb)
+
+ * metaverse, and elsewhere, utf-8 is assumed: started cleaning out legacy
+ code (character converting regex) sisu generates its first Chinese document
+ in html, plaintext and sql databases (postgresql and sqlite) only, at this
+ stage... [confirmation that first Chinese document presentation is fine,
+ from author of test (law related) text; the listed text representations
+ reasonably handle the utf-8 characters involved, and document structure is
+ ok]
+
+%% sisu_0.42.4.orig.tar.gz (2006w29/1 | 2006-07-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.4.orig.tar.gz
+ dccd6a56bcd2217d3bb0f1be5211ed57 1230468 sisu_0.42.4.orig.tar.gz
+ a6814ae0311a22d1f0ca89208629e2ac 609 sisu_0.42.4-1.dsc
+ bdebad3bdcda48423bdb4a021224c04b 99255 sisu_0.42.4-1.diff.gz
+
+ * sisu_manifest, pdf description express portrait copy to be optimised/biased
+ towards print, and landscape to have screen view bias/optimisation
+ (orientation and colored links)
+
+ * debian (mostly), meta-packages man pages moved to man(7)
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377209
+ (Closes: #377209) [which was re-opened as not properly done previously,
+ myon]
+
+ * debian, closed bug 377208 after informing submitter changes had been made
+ and requesting review ('fixed' in 0.42.2)
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377208
+ (Closes: #377208) [submitted:myon]
+
+ * debian/control added a Conflicts: vim-sisu,
+ sisu-remote, to the existing Replaces: these
+ two packages have been removed
+
+ * ruby, also tested ok with ruby1.9 (Debian Version: 1.9.0+20060609-1)
+ sisu -3v [filename]
+ [database tests omitted, relevant ruby drivers not on system]
+
+%% sisu_0.42.3.orig.tar.gz (2006w28/2 | 2006-07-11) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.3.orig.tar.gz
+ d3ab92e9f20ef48de711512d10fd3fe7 1230428 sisu_0.42.3.orig.tar.gz
+ 33088e3d51a612cf73a64afe239eb8f5 609 sisu_0.42.3-1.dsc
+ 28a4652fdade40b19ddb88df4344242f 99164 sisu_0.42.3-1.diff.gz
+
+ * html, segments, cosmetic, removal of footnote marker in headings
+
+ * sysenv, fix for when sisu sql related packages are not
+ installed, should not then be loading rb dbi module
+
+%% sisu_0.42.2.orig.tar.gz (2006w27/6 | 2006-07-08) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.2.orig.tar.gz
+ cf5b6605089179140da52f5bde655ebd 1229996 sisu_0.42.2.orig.tar.gz
+ 081c37f65a4fbb5ed7d3a2ed1a02c423 609 sisu_0.42.2-1.dsc
+ 19f7878a951fa966acb5ab3c5d38f6c8 99115 sisu_0.42.2-1.diff.gz
+
+ * html, xhtml, added utf-8 specification
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ [(previously relied on correct browser setting]
+
+ * debian/control, removed sisu-remote, added recommends rsync,
+ openssh-client|lsh-client, keychain, to main sisu package instead
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377206
+ (Closes: #377206) [submitted:myon]
+
+ * debian/control, removed vim-sisu, this used to contain syntax highligter
+ and color scheme now included in Vim 7, all that remains is ftplugin, now
+ installed by main sisu package
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377207
+ (Closes: #377207) [submitted:myon] [* change to source package structure]
+
+ * debian/control, sisu Replaces: vim-sisu
+ debian/sisu.install installs ftplugin originally in vim-sisu
+
+ * debian/manpages, sisu (main package) now installs vim_sisu page in man(7)
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377209
+ (Closes: #377209) [submitted:myon]
+
+ * debian/control, package description related issues:
+ * modified sisu
+ * modified sisu-complete
+ * modified sisu-postgresql
+ * modified sisu-sqlite
+ * modified sisu-pdf
+ * removed sisu-remote, (as sisu-remote is no more)
+ * removed vim-sisu, (as vim-sisu is no more)
+ * removed sisu-remote, (as sisu-remote is no more)
+ [consider adding a note on remote placement of documents in sisu(8)
+ later]
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377208
+ (verify that descriptions are satisfactory before closing: #377208)
+ [submitted:myon]
+
+%% sisu_0.42.1.orig.tar.gz (2006w27/4 | 2006-07-06) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.1.orig.tar.gz
+ 7d6bcb9a4be5ded17e71522b37a2af5a 1227649 sisu_0.42.1.orig.tar.gz
+ 734e48c69096c912cbd60f38b8961bd0 632 sisu_0.42.1-1.dsc
+ bb107345477000cc540fb08a73df4379 99097 sisu_0.42.1-1.diff.gz
+
+ * dbi fix (--createdb)
+
+ * [ruby1.9, forward testing, general check, (tests ok db operations apart,
+ drivers not installed)]
+
+ * debian/control, removed recommends libtidy [non-existent, see current
+ libtidy-0.99-0, called in by tidy which is recommended and sets libtidy
+ dependency]
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377086
+ (Closes: #377086) [submitted:luk]
+
+%% sisu_0.42.0.orig.tar.gz (2006w27/4 | 2006-07-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.42.0.orig.tar.gz
+ 297702e8c44b95f0ac16c656b798812d 1227287 sisu_0.42.0.orig.tar.gz
+ 065d70ba326d517401f2b62fe5c837c4 632 sisu_0.42.0-2.dsc
+ 0ad5a4471a31f4968a7b900a17c43ac7 99754 sisu_0.42.0-2.diff.gz
+ c3be264946486f71b021227a16197162 632 sisu_0.42.0-1.dsc
+ 83577a37dbbe6915a25814a541263e54 98970 sisu_0.42.0-1.diff.gz
+
+ * texpdf fix, object citation numbering reinstated
+
+ * asterisk (and plus sign) footnote/endnote marker/tags
+ [SubTech2006::LII:TB "request": required for U.S. law articles]
+ done: html, odf, xmls, plaintext,
+ latex pdf (some cosmetic changes to come)
+ digests(dcc)
+ sql (specific issue not addressed but works sortof)
+
+ * syntax, asterisk (and plus sign) footnote/endnote marker/tags
+ introduced ~{* for an asterisk marked endnote }~ and plus sign equivalent
+ [reason for version number change, as previous
+ version won't parse]
+
+ * texpdf portrait text now all black, including toc and endnote markers
+ landscape retains color for toc (red) & linked text (blue) [online viewing]
+ [introduce configuration options?]
+
+ * help updated
+
+ * kdissert conversion to sisu markup a refinement (with less-than &
+ greater-than)
+
+ ** debian/control changed back to ruby >= 1.8.2
+ * debian/control ruby >= 1.8.4
+ (not done sufficient testing on 1.8.2, so not supported)
+
+ * debian/control sisu-pdf added Depends: texlive-latex-extra
+ (needed for manyfoot.sty, used for asterisk footnotes)
+
+ * debian vim-sisu, description
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374873
+ (Closes: #374873) [submitted: Jens Seidel]
+
+%% sisu_0.41.8.orig.tar.gz (2006w25/6 | 2006-06-24) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.8.orig.tar.gz
+ ea76d18d8c58bb444f4be71c4e9a3185 1225229 sisu_0.41.8.orig.tar.gz
+ 283d46cf2196e667e5416327a19659c5 632 sisu_0.41.8-1.dsc
+ 1fe0b2f06aed3d3f8a272340dcabef9c 98810 sisu_0.41.8-1.diff.gz
+
+ * kdissert, texpdf, accept sisu page break and new page marker, used for
+ LaTeX/pdf
+
+%% sisu_0.41.7.orig.tar.gz (2006w25/6 | 2006-06-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.7.orig.tar.gz
+ 792ed0b0e57e78cf88ec37102fd3de8a 1225007 sisu_0.41.7.orig.tar.gz
+ 77b90465be946edcdb57c31b8fc3cd10 632 sisu_0.41.7-1.dsc
+ 0f568b819dd5b18a5637d77c220beaf5 98795 sisu_0.41.7-1.diff.gz
+
+ * document samples, created subdirectory dfsg for documents that comply
+ with the Debian Free Software Guidelines and moved the "GPL2" and
+ "Free as in Freedom" texts and associated images back into the source
+ tarball and main (from sisu-markup-samples) [FaiF is published under
+ the GNU Free Documentation License]
+
+ * html segments, footnotes for segments, bugfix, [faulty regex matched more
+ than it was supposed to resulting in dropping of some footnote sections -
+ these remained available elsewhere in the endnote segment]
+
+ * relaxng, sisu object models, first pass at XML object models for sisu input
+ structure, and sisu metaverse structure, alternative data representation
+
+ * kdissert:
+ * sisu headers, added a hack to permit the inclusion of sisu headers, by
+ entering them in the top level node (for which sisu will now only process
+ properly if empty or if it contains comments or sisu headers)
+ * texpdf, tell when documents are prepared using kdissert
+ * html default skin for kdissert with icon
+ * [kept out for now: kdissert sisu sample file, and its converted sisu text
+ equivalent]
+
+ * Debian control, 'Home page:' corrected to 'Homepage:'
+ closes Bug#374873: Improved package description
+
+ * Debian rules, .ssm and .ssi files added to list of not compressed file
+ types (/usr/share/doc/sisu)
+
+%% sisu_0.41.6.orig.tar.gz (2006w25/2 | 2006-06-20) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.6.orig.tar.gz
+ ff6217bb156f2ab803bf87367fb327e4 671142 sisu_0.41.6.orig.tar.gz
+ 594e27b60ceb415bdd3504929a7adb0f 631 sisu_0.41.6-1.dsc
+ 3ba8aecfd904844b40ef2a26a6379aec 98359 sisu_0.41.6-1.diff.gz
+
+ * sisu_manifest, added possibility of sharing of kdissert source, see sample:
+ http://www.jus.uio.no/sisu/kdissert.kdi/sisu_manifest
+ and note the kdissert source file on which sisu markup and outputs are based:
+ http://www.jus.uio.no/sisu/kdissert.kdi/kdissert.kdi
+
+ * kdissert fixes to make the following true:
+
+ * sisu --convert=kdi [kdissert filename]
+ will attempt to convert a simple file produced using kdissert to sisu
+ markup, basic and experimental
+
+ * kdissert_to_sisu: some fixes, still very basic and experimental
+ [data/sisu/conf/convert or /usr/share/sisu/conf/convert]
+
+ * debian control, added recommends kdissert
+
+ * [issue spotted with rsync, new output directories, fix later]
+
+%% sisu_0.41.5.orig.tar.gz (2006w25/1 | 2006-06-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.5.orig.tar.gz
+ da50cd8f993761e8011386afcd8d2636 669069 sisu_0.41.5.orig.tar.gz
+ 33e2fc91260a5131e60588729cbf0c67 631 sisu_0.41.5-1.dsc
+ d63fd861450216b66acf0295100c754d 98313 sisu_0.41.5-1.diff.gz
+
+ * sisu --convert=kdi [kdissert filename]
+ will attempt to convert a simple file produced using kdissert to sisu
+ markup, basic and experimental
+
+ * kdissert_to_sisu: some fixes, still very basic and experimental
+ [data/sisu/conf/convert or /usr/share/sisu/conf/convert]
+
+ * param, minor fix to "prefix" metadata regex
+
+ * renamed a couple of libraries related to file conversion
+
+%% sisu_0.41.4.orig.tar.gz (2006w24/7 | 2006-06-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.4.orig.tar.gz
+ 4182ed0cd4d32beaa71e53028fdd17c5 667716 sisu_0.41.4.orig.tar.gz
+ 4d1c95b8e8734adfa72ed7ca3dca443d 631 sisu_0.41.4-1.dsc
+ 210daf7fd979a41b1a34db3918a68dbc 98286 sisu_0.41.4-1.diff.gz
+
+ * kdissert_to_sisu: a very basic trial conversion script from kdissert .kdi
+ to sisu .sst markup provided [preliminary/proof of concept, provided in
+ data/sisu/conf/convert or /usr/share/sisu/conf/convert] (Kdissert, by
+ Thomas Nagy is a topic/mind mapping tool for the preparation of documents
+ http://freehackers.org/~tnagy/kdissert/ )
+
+%% sisu_0.41.3.orig.tar.gz (2006w24/3 | 2006-06-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.3.orig.tar.gz
+ fc5f119deefab7cab8c226d8724d4f99 666605 sisu_0.41.3.orig.tar.gz
+ a64f86b41186e6edc039c960a41c2e1b 631 sisu_0.41.3-2.dsc [2006-06-15]
+ e3bab2d070567bed6e0c72762beb594b 98885 sisu_0.41.3-2.diff.gz
+ 55e612d16607e1a23dd2aa2d241a374f 631 sisu_0.41.3-1.dsc
+ 36a386fb433eb17e7cfe195b09216d8c 98249 sisu_0.41.3-1.diff.gz
+
+ * options parsing changes, possibility of letter duplication
+ removed [-CC no longer will work use -C --init=site]
+
+ * texpdf_format, old code rearranged
+
+ * sysenv, fixes in File_map where @md (param) not available
+
+ * info related to share source file and sisudoc, bug fix
+
+%% sisu_0.41.2.orig.tar.gz (2006w23/5 | 2006-06-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.2.orig.tar.gz
+ e98068cf061df4f428b40cfee984f593 666123 sisu_0.41.2.orig.tar.gz
+ 55896e6fd677475b3af56b19d20fc33a 631 sisu_0.41.2-1.dsc
+ d66cc73ca8fa3103a5de58903e99626c 98220 sisu_0.41.2-1.diff.gz
+
+ * search form, options passing, sisu -F --webserv=webrick
+
+ * html segments endnote fix for the deposit of endnotes occurring in levels
+ :A - :C
+
+ * texpdf, a4 text height re-fixed
+
+ * digest, document metadata, info re-fix
+
+ * plaintext, small fix, document metadata
+
+%% sisu_0.41.1.orig.tar.gz (2006w23/3 | 2006-06-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.1.orig.tar.gz
+ e8c3381acb10e678e167755181380091 665743 sisu_0.41.1.orig.tar.gz
+ 116ee32633631a305307f59eef4f32e9 631 sisu_0.41.1-1.dsc
+ fef43880a4b0c0ce68ca269b19108216 98204 sisu_0.41.1-1.diff.gz
+
+ * defaults, html_format, some html cleaning (including fix of html comment
+ marker that was problem for dillo in doc.html)
+
+ * html segments endnotes, fix for first segment, (endnotes were deposited in
+ first segment multiple times (or rather this happened in some segments
+ following a level :A - :C heading ))
+
+ * markup_convert, hub, changes, should now be possible to convert and
+ generate in a single changed rune, e.g.
+
+ sisu --convert=to38 -h autonomy_markup0.sst gpl2.fsf.sst
+
+%% sisu_0.41.0.orig.tar.gz (2006w22/6 | 2006-06-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.41.0.orig.tar.gz
+ b35ae1c9380d3ec94db8f97950e32a82 665634 sisu_0.41.0.orig.tar.gz
+ bd2e6542cd3dba16d0489155d1b4e7d5 631 sisu_0.41.0-1.dsc
+ e1d2948368753d4880c8ba9efcb2a651 98182 sisu_0.41.0-1.diff.gz
+
+ * options, (command line options) message passing (should become cleaner),
+ program piping changed, command line information added as 'opt',
+ (subsequently contained within param 'md'), creates considerable scope for
+ further tidying (cosmetic refactoring) [most code affected, preliminary
+ tests passed, (some possibility of bugs and breakage)]
+
+ * hub, param, hooks in place to permit modification of default processing
+ instructions set in config files or within document headers by way of
+ command line processing instruction starting with -- (however, only
+ implemented for latex/pdf paper size).
+
+ * hub command line now accepts individual command instructions, previously
+ was necessary to write, e.g.
+ sisu -mNhwpoabxXyv [filename/wildcard]
+ (sisu -3 [filename/wildcard] for short) now may alternatively write:
+ sisu -m -N -h -w -p -o -a -b -x -X -y -v [filename/wildcard]
+
+ * dbi command line rune now requires "--" before instruction,
+ --import, --update, --recreate, etc.
+ removed short forms for --import and --update (-i and -u)
+
+ * texp pdf, adjustments to document presentation dimensions
+ (A4, US_letter, book_b5, book_a5, US_legal)
+
+ * texpdf, command line parameter may be used to change paper size output
+ sisu -p --papersize='book' [filename]
+ preset sizes include: 'A4', U.S. 'letter' and 'legal' and 'book' sizes 'A5'
+ and 'B5' (system defaults to A4).
+
+ * texpdf, image resizing for different paper sizes
+ (useful when offering on the fly alternative document dimension processing)
+ (manually calibrated to suit default document layouts) [note however other
+ blocks such as tables are not (yet) handled similarly]
+
+ * help (interactive help) now needs to be invoked with:
+ sisu --help [help query]
+ sisu on its own will still get you into an interactive help mode
+
+ * [consider permitting multiple document size pdf outputs, (easily done, but
+ promises slower processing as each additional size selected is generated)
+ currently you select your size and get a portrait and landscape, the
+ selection of whatever size over-writes the other, as they are saved to the
+ same file-name]
+
+%% sisu_0.40.4.orig.tar.gz (2006w21/7 | 2006-05-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.4.orig.tar.gz
+ 4266b03409162c68322b054fda599134 664267 sisu_0.40.4.orig.tar.gz
+ 009e41731e25ddfde8e685998432d795 631 sisu_0.40.4-1.dsc
+ 4469b7acab1e00ac9b4fcdf5ae384edb 98011 sisu_0.40.4-1.diff.gz
+
+ * tex pdf, minor adjustments, including page-breaks restored for 0.38 markup
+
+ * package source directory renamed with underscore instead of hyphen
+
+%% sisu_0.40.3.orig.tar.gz (2006w21/3 | 2006-05-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.3.orig.tar.gz
+ f67f66e42617dd2c0cd8d28cfa95e217 663690 sisu_0.40.3.orig.tar.gz
+ 2280c18cbb60c671a06e0b2dced435af 631 sisu_0.40.3-1.dsc
+ 84cb50d042b87fc19e42b156a27480a4 97951 sisu_0.40.3-1.diff.gz
+
+ * metaverse, fix reference to dc_publisher in param (not publisher)
+
+ * rant installer checked, removed sisu-examples, and post install routine as
+ document samples are now packaged separately as sisu-markup-samples
+
+%% sisu_0.40.2.orig.tar.gz (2006w21/3 | 2006-05-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.2.orig.tar.gz
+ e792de16cb6acbe2cabe3c650eef47ce 665085 sisu_0.40.2.orig.tar.gz
+ 76c87061052e430d8d8ac0cfad4a2168 631 sisu_0.40.2-1.dsc
+ eee774779cb3a15cb164c032de5ae4cc 97904 sisu_0.40.2-1.diff.gz
+
+ * babel, more use of translation module, used in metaverse (originally used
+ for manifest) [expand]
+
+ * correction to apt sources.list information provided in this document for
+ 0.40.1, and updated in README
+
+%% sisu_0.40.1.orig.tar.gz (2006w21/1 | 2006-05-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.1.orig.tar.gz
+ 86b2c25a8bccb0ecb38f0e1fe11aa522 664295 sisu_0.40.1.orig.tar.gz
+ 3a2a198b18847ebf6ccf30278848e354 631 sisu_0.40.1-1.dsc
+ 85d6478dd001f19f7e3d126a47d85aea 97880 sisu_0.40.1-1.diff.gz
+
+ * debian archive sources.list changed, started using reprepro to produce
+ apt archive, debian "upstream" /etc/apt/sources.list changes to:
+
+ deb http://www.jus.uio.no/sisu/archive unstable main non-free
+ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free
+
+ [archive string corrected]
+
+ [previous string (obsolete for future releases) was:
+ deb http://www.jus.uio.no/sisu/pkg_priv ./deb/
+ deb-src http://www.jus.uio.no/sisu/pkg_priv ./src/
+ ]
+
+%% sisu_0.40.0.orig.tar.gz (2006w20/7 | 2006-05-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.40.0.orig.tar.gz
+ cfaa83c0f7a55a143b50865d72338442 663916 sisu_0.40.0.orig.tar.gz
+ 5d0801b203e3d76f46b676676226d537 631 sisu_0.40.0-1.dsc
+ 68e6d68b871920b372a20ca8ba479b55 97850 sisu_0.40.0-1.diff.gz
+
+ * translate, an internal framework for the translation of related text used
+ first for the document manifest. (it is suggested that i look at gettext)
+ some initial translation by daniel (german), nicholas (french), agi
+ (spanish), enrico (italian), hanna (finnish)
+
+ * param, metaverse fix, 0.38 markup syntax to work with processing
+ instructions related to levels and their translation from :A,:B,:C,1,2,3 to
+ internal representation 1,2,3,4,5,6
+
+ * debian package sisu-examples removed, debian packaging policy requires
+ removal of un-modifiable documents from the main archive. accordingly the
+ books provided as markup samples have been moved from the main sisu package
+ to sisu-markup-samples (which should eventually make its way to the debian
+ non-free archive). Considerable changes in packaging required, and new
+ version number appropriate.
+
+ * [mention of use of reprepro in this release was premature, see sisu-0.40.1]
+
+%% sisu_0.39.3.orig.tar.gz (2006w19/7 | 2006-05-14) [Debian Release snapshot, uploaded by Wookey (at Debconf 6, in Queue new till replaced)]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.3.orig.tar.gz
+ 6eadfbf37cbaf43fbae49dc2b71209d2 3406768 sisu_0.39.3.orig.tar.gz
+ cfca428562370b9b2672fc8f7f0b7840 647 sisu_0.39.3-1.dsc
+ 8338ef32ecb203bf0328f7f4eb71857a 95295 sisu_0.39.3-1.diff.gz
+
+ * metaverse fix, changed rules on auto-naming of html segments resulted in
+ the introduction of some undesirable artifacts, (actually a change in
+ sequence, some risk of need for further modification)
+
+%% sisu_0.39.2.orig.tar.gz (2006w19/5 | 2006-05-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.2.orig.tar.gz
+ e80aae7a5733dbbee6545cb7ff0f9633 3406402 sisu_0.39.2.orig.tar.gz
+ adde80ce35b3258feb199a65ccb5be88 647 sisu_0.39.2-1.dsc
+ f8ffdfb51016cae9f150e95b7d92f177 95226 sisu_0.39.2-1.diff.gz
+ 23a45dde920e1c0cab53231eb90865c0 647 sisu_0.39.2-2.dsc
+ 18f49697c0634fc87edccdfd6f4ba9ce 95835 sisu_0.39.2-2.diff.gz
+
+ * what to do when missing required: header title; heading top;
+ heading seg. carries risk, false positives not acceptable, testing
+ required, may need to scrap
+
+ * debian policy standards version 3.7.2
+ debian vim policy changes, rename sisu_vim vim_sisu
+ vim 7 in debian includes filetypes, syntax, and color, removed
+ vim-sisu includes ftplugin
+
+%% sisu_0.39.1.orig.tar.gz (2006w19/1 | 2006-05-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.1.orig.tar.gz
+ bb72b981ace449a4803aaad879398266 3405744 sisu_0.39.1.orig.tar.gz
+ acc111aae4ebf5485e3ae4740ebeab52 647 sisu_0.39.1-1.dsc
+ 9094b6e51890fbeb2789365add613143 95128 sisu_0.39.1-1.diff.gz
+
+ * digest/dcc (document content certificate), fix: image digests reinstated
+ [note: during some simplification of code, removed the need to flag images
+ as local or remote, some regexes did not take into account this change, one
+ in metaverse also addressed, (issue likely from 0.38.8 till this fix)]
+
+%% sisu_0.39.0.orig.tar.gz (2006w19/1 | 2006-05-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.39.0.orig.tar.gz
+ 3c043d2f1356527686a72cd82858d7be 3405229 sisu_0.39.0.orig.tar.gz
+ e1d17b525cf81dceefbb0c81d27aca76 647 sisu_0.39.0-1.dsc
+ 3657f7538d1cbd23c8b40d3e32862afd 95097 sisu_0.39.0-1.diff.gz
+
+ * metaverse, changes to auto-naming/numbering of headings, and segment names
+ [back to the more elegant auto-naming of segments solution, however, need
+ to determined to be reliable (naming used to be done in a similar way)
+ release passes initial checks though further testing is required; changes
+ involve reducing the use of extra characters where possible in the
+ auto-naming of html segments (the tilde and underscore were added to reduce
+ the chance of name collision, and have now been removed where possible),
+ additional checks that duplication does not occur have been added. This
+ does mean any existing indexes (sql or hyperestraier) will have to be
+ regenerated and url mappings/ links made within a sisu markup file to other
+ sisu output of html segments will need to be checked and updated. Long term
+ the currently implemented naming should provide a preferable solution
+ (primarily in its being easier on the eye.)
+
+ * odf, odd regex related bug related to matching of + sign in link text and
+ corresponding urls fix not particularly satisfactory
+
+ * debian policy standards-version back 3.7.0 ... (should be 3.7.2 but
+ lintian and linda not up to date this instant)
+
+%% sisu_0.38.10.orig.tar.gz (2006w18/5 | 2006-05-05) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.10.orig.tar.gz
+3bc28f808280673e2f8b86dfe071a53a 3402660 sisu_0.38.10.orig.tar.gz
+6c930e4ea4e3b41388bb61c9b6aad7ac 650 sisu_0.38.10-2.dsc
+43717b69a0bf29cbd810a0c36066fb2e 95761 sisu_0.38.10-2.diff.gz
+
+ * rebuilt using debian standards version 3.7.2
+ (previous build used 3.7.0)
+
+%% sisu_0.38.10.orig.tar.gz (2006w18/4 | 2006-05-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.10.orig.tar.gz
+3bc28f808280673e2f8b86dfe071a53a 3402660 sisu_0.38.10.orig.tar.gz
+26c4ae2cca2e1b22e826834fcd4c135b 650 sisu_0.38.10-1.dsc
+2e17298545f1afb64d6258fb7f732be8 94904 sisu_0.38.10-1.diff.gz
+
+ * minor fixes, need resulting from default removal of ._sst temporary files
+ (master documents:processed composite documents:temporary files)
+
+ process .ssm master file instead where possible, e.g. -R (and url info),
+ (implemented in hub)
+
+ _ flag provided as hack to have ._sst files kept at the end of a run, (as
+ an alternative to use of the -M (maintenance) flag (which changes screen
+ output))
+
+ * vim ftplugin, minor irritation with vim folds sorted
+
+%% sisu_0.38.9.orig.tar.gz (2006w18/3 | 2006-05-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.9.orig.tar.gz
+f513d112435ff923e5197a5f5875c58a 3402148 sisu_0.38.9.orig.tar.gz
+317ff04be060a534cc9ddaf356ebbe79 647 sisu_0.38.9-1.dsc
+1b389daf0e1f52c6c1cc88bb48aaba0c 94879 sisu_0.38.9-1.diff.gz
+
+ * sisupod/ sisu_doc, .ssm, renamed sisupod.tgz. Master document pod now
+ contains the composite elements of the master, .ssm and .ssi files rather
+ than the "composited document" ._sst, examine for example:
+ http://www.jus.uio.no/sisu/alices_adventures_in_wonderland_and_through_the_looking_glass.lewis_carroll/sisupod.tgz
+ [consider giving the option as this may not always be preferred, is
+ necessary to find master within pod, but otherwise seems a more elegant
+ solution]
+
+ * search, debian:sisu "recommends" added hyperestraier
+ [option in addition to sisu "atomic" search with postgresql and sqlite]
+
+ some help on setting hyperestraier up (in very basic way) for sisu
+ provided: sisu help hyperestraier
+
+ documentation for hyperestraier: http://hyperestraier.sourceforge.net/
+ file:///usr/share/doc/hyperestraier/index.html man estcmd
+
+ for help on sisu search generally follow suggestions in: sisu help search
+
+ * vim filetypes fix, the temporary ._sst rather than ._ssi
+
+ * temporary files ._sst are now removed after run, unless -M (maintenance)
+ flag is used
+
+ * rexml fix necessary
+
+ * help prompt fix
+
+ * fix, 0.38 markup interpretation, evident particularly in XML Dom variant
+ -X of a few documents, more strict regex
+
+ * removed reference to 0.38 markup as experimental in help and man page
+ (conversion script makes it easy to switch between markup versions)
+
+ * debian 'Standards' version changed to 3.7.0
+
+NOTE DISCARDED BUILD -{6d2149ba45d601347d9562edc2995fe7 3401901
+sisu_0.38.9.orig.tar.gz}- -{b96ce1d8b5801c1e2ffa12eddbb1850a 647
+sisu_0.38.9-1.dsc}- -{ee7182ffdca58bd94dec3d07d4ccb9f8 94874
+sisu_0.38.9-1.diff.gz}-
+
+%% sisu_0.38.8.orig.tar.gz (2006w17/6 | 2006-04-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.8.orig.tar.gz
+9c1df6c4524fa3a047ca566b779f6600 3398443 sisu_0.38.8.orig.tar.gz
+7514ebf71f95c0d3dd99d2355ad65fc0 647 sisu_0.38.8-1.dsc
+63ae62d331f23a5f79819656e345ef8f 94794 sisu_0.38.8-1.diff.gz
+
+ * images, in particular to do with remote sisu markup source
+ e.g. sisu -3
+ http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst
+ sisu -3
+ http://www.jus.uio.no/sisu/sphinx_or_robot.leena_krohn.1996/sphinx_or_robot.leena_krohn.1996.sst
+ should once again pull down and generate documents with images (consider
+ using url base plus directory, to make unique image directories for
+ external documents images)
+
+ * vim:sisu syntax, spell
+ [Re: use of Vim, have made the transition to Vim 7]
+
+ * (html_tune, some renaming which could cause breaks)
+
+%% sisu_0.38.7.orig.tar.gz (2006w17/4 | 2006-04-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.7.orig.tar.gz
+39bf0e31035f4a97259e2b077835b7bc 3397454 sisu_0.38.7.orig.tar.gz
+b37cba6a7ef7436dc9b4f95648d12a0d 647 sisu_0.38.7-1.dsc
+75aa4afefc0bf8867de5498c6b9642fe 94763 sisu_0.38.7-1.diff.gz
+
+ * sisu, code rearrangement, relatively minor, /usr/bin contains require only
+
+ * vim:sisu ftplugin, only activate :setlocal spell spelllang
+ if version >= 700
+
+ * html, link to concordance only if < build concordance word count limit
+
+ * (html, sub_toc fix for pg texts)
+
+%% sisu_0.38.6.orig.tar.gz (2006w17/2 | 2006-04-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.6.orig.tar.gz
+d01345fe0748ea24af2e206648be1df0 3397003 sisu_0.38.6.orig.tar.gz
+a3819708b447aa1391c923847bc5f868 647 sisu_0.38.6-1.dsc
+fa4f965f92835dccbdcadfbabc29528e 94717 sisu_0.38.6-1.diff.gz
+
+ * a glance forward at ruby 1.9, some early tests passed
+ [ruby 1.9.0 (2006-04-21)]
+
+ * vim:sisu
+ syntax: Spell on vim 7, not quite right colors: slate, vim colors, toned
+ down, endnotes (green changed to "darkkhaki")
+
+ * concordance, wordmaps renamed
+
+%% sisu_0.38.5.orig.tar.gz (2006w16/7 | 2006-04-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.5.orig.tar.gz
+b9eae129c6a86c89398a3af5170a22a8 3396296 sisu_0.38.5.orig.tar.gz
+8a559bc917ef9bb082c46949cc77ac53 647 sisu_0.38.5-1.dsc
+2f4ea49bd593d5557b9043b354335181 94686 sisu_0.38.5-1.diff.gz
+
+ * primarily a new debian build as lintian 1.23.17 "published"
+ yesterday, complains about existing builds
+
+ * vim ftplugin, folds, another minor modification
+ [without which would have been built as 0.38.4-2]
+
+%% sisu_0.38.4.orig.tar.gz (2006w16/5 | 2006-04-21) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.4.orig.tar.gz
+84d5e911d17aaf6a360972acd5bb3a3f 3395161 sisu_0.38.4.orig.tar.gz
+60aa30b124edcd87a622f2a895f3c1a5 647 sisu_0.38.4-1.dsc
+7aeae2641bf9b3968a08bb8fb9eeb8e2 94665 sisu_0.38.4-1.diff.gz
+
+ * param, fix, correction to a condition for setting markup type to 'rad'
+ (0.38)
+
+ * param introduced header @clatalogue: (documented in man)
+
+ * markup_convert and param, a refinement to matching :A type headings
+
+ * vim ftplugin, folds, minor modification
+
+%% sisu_0.38.3.orig.tar.gz (2006w16/4 | 2006-04-20) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.3.orig.tar.gz
+aacb2696144a0d91da658266bff34010 3394702 sisu_0.38.3.orig.tar.gz
+85ad80241d8be30c15af31979d4ed69e 647 sisu_0.38.3-1.dsc
+8e3044976461dce97d78601f0f073c0a 94622 sisu_0.38.3-1.diff.gz
+
+ * convert, refinement in 0.37 to 0.38 and back, required.
+
+ * sample documents, header 'markup' not very descriptive, 'level' preferred,
+ but not ideal either..., changed though accordingly
+
+%% sisu_0.38.2.orig.tar.gz (2006w16/3 | 2006-04-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.2.orig.tar.gz
+b7183828d8debf7dfeb671c44fcf984d 3394425 sisu_0.38.2.orig.tar.gz
+6e4c33da7880dede7de035f53003388e 647 sisu_0.38.2-1.dsc
+1df895d8457cf0e2a90c70536c65a5c9 94598 sisu_0.38.2-1.diff.gz
+
+ * --identify ; --convert ; --query ; minor adjustments
+
+%% sisu_0.38.1.orig.tar.gz (2006w16/1 | 2006-04-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.1.orig.tar.gz
+6d6a57fb0671c0740abdd75389c8255e 3393572 sisu_0.38.1.orig.tar.gz
+db731e962a0e6553602a978addc49933 647 sisu_0.38.1-1.dsc
+7601b42bb90e739bdac0c65e4a46d753 94579 sisu_0.38.1-1.diff.gz
+
+ * sisu --convert [filename/wildcard] converts between 0.38 and 0.37 markup
+ (which is substantially the same as 0.16 markup, only the file names
+ changed)
+
+ * sisu --identify [filename/wildcard] attempts to recognises the markup
+ version
+
+ * sisu --query [version number| or history] provides a bit of information
+ on changes to markup and file naming conventions used
+
+ * urls, minor fix,
+ (screen output of generated output omitted -H, (-h was ok))
+
+ * generated cgi search form needs a writable present directory,
+ warning of failure posted if it is not (consider placing result elsewhere)
+
+ * vim syntax minor touch
+
+%% sisu_0.38.0.orig.tar.gz (2006w15/7 | 2006-04-16)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.38.0.orig.tar.gz
+ed0af7fd0c4b05301642422bd95647cc 3388111 sisu_0.38.0.orig.tar.gz
+e8611c3610409c083c92d76da8c8ef6d 647 sisu_0.38.0-1.dsc
+5b9872b1b278bf8697d76350038bc47b 94504 sisu_0.38.0-1.diff.gz
+
+ Summary: there is some scope for breakage. preliminary tests passed new
+ markup introduced, as alternative, existing markup is not affected - new
+ document header markup, new document structure markup, experimental, [new
+ header for tagging categories or topics, stub]
+
+ a script modify.rb is provided for easy conversion between 0.37 standard
+ and 0.38 experimental markup
+
+ * alternative header notation, for consideration, an example
+ @title: is equivalent to 0~title
+
+ * sisu structure, experimental alternative notation,
+ A,B,C,1,2,3 mapping to 1,2,3,4,5,6 switched on on encountering level A~ or
+ if document header should contains @markup: rad
+ * SiSU has in effect two sets of levels to be considered
+ 1-3 headings/levels, pre-ordinary paragraphs /pre-substantive text, and 4-6
+ headings/levels, levels which are followed by ordinary text. This may be
+ conceptualised as levels A,B,C, 1,2,3, and using such letter number
+ notation, in effect: A must exist, optional B and C may follow in sequence
+ (not strict) 1 must exist, optional 2 and 3 may follow in sequence i.e.
+ there are two independent heading level sequences A,B,C and 1,2,3 or using
+ the standard notation 1,2,3 and 4,5,6 on the positive side:
+ * the A,B,C,1,2,3 alternative makes explicit an aspect of structuring
+ documents in SiSU that is not otherwise obvious to the newcomer (though
+ it appears more complicated, is more in your face and likely to be
+ understood fairly quickly)
+ * the substantive text follows levels 1,2,3 and it is 'nice' to do
+ most work in those levels a couple of issues to consider:
+ * 1,2,3 usually precede A,B,C (and do for generated output),
+ but in the form is better suited to this context, it takes some getting
+ used to though, and may be necessary to add a marker (an optional
+ exclamation mark (!) or colon (:) perhaps) to the A,B,C to indicate
+ that they are not subsidiary values, and are 'greater' than 1,2,3.
+ :A,:B,:C,1,2,3 colon selected as aesthetically more pleasing (to me)
+ (despite exclamation mark already being in use for bold lines/headings)
+ * there ends up being more in marking up to know, (which needs to be
+ balanced against any perceived convenience) unless ultimately only one
+ markup structure style is adopted
+ * ok within code may confuse a bit, as things simple are not always what
+ you would expect, present solution is to translate rad markup values to
+ standard ones, so A,B,C,1,2,3 and references to them become 1,2,3,4,5,6
+ (where you expect to find 1 you may find a 4)
+ * a note on implementation of 0.38 experimental (rad), within the program
+ structural markup is converted back to the the standard notation, i.e.
+ levels A,B,C,1,2,3 are re-mapped to 1,2,3,4,5,6 which is used for
+ processing
+
+ * param, header, 0~tag or to use newer notation @tag: introduced,
+ a stub for topic lists, categories, classification within documents.
+ Formal only in the sense that to make work you need to be aware of previous
+ categories, a degree of organisation is necessary. Raises technical
+ questions in relation to method and notation used for SiSU structuring.
+ Mapping may be fairly simple for an independent system, however, it is a
+ bit more complex to directly map to SiSU structure as SiSU has in effect
+ two sets of levels to be considered A technically simple but inconvenient
+ solution for making SiSU pages out of tags would be to have them between 4
+ and 6 levels deep, four levels is however from a practical tagging
+ perspective (a bit arbitrary and) an inconvenient minimum depth to require
+ it also also could be inconvenient for other technical purposes
+
+ * sysenv, utf-8 assumed if file encoding cannot be determined, 'fix' results
+ from an unexpected issue with the use of alternative document header markup
+ introduced in 0.38 (@title:) the program 'file' used to check document type
+ no longer parses the markup document and recognises it as utf-8 unless the
+ document starts with a sisu comment line %2
+
+ * an auto-converter, with canned conversion from 0.37/traditional to 0.38
+ (rad) markup and back from 0.38 (rad) to 0.37/traditional is tossed in to
+ sisu-examples (permissions at 644) sisu-examples/config/convert/modify.rb
+ once enabled (permissions and path set), usage: modify.rb --convert
+ [filename/wildcard] for further options and generally a better place to
+ begin: modify.rb --help this is a fairly generic simple tool that can be
+ used to store other canned conversions
+
+ * an auto-converter with canned conversion
+ from 0.37/traditional to 0.38 (rad) markup and back from 0.38 (rad) to
+ 0.37/traditional is tossed in to sisu-examples (permissions at 644)
+ sisu-examples/config/convert/modify.rb
+
+ * refactor, minor, moved some dublin core checking, affects
+ plaintext, html, xhtml, xml, odf ...
+
+ * db, create added as synonym for createall
+
+ * sqlite, common_db, create command makes directory for output if it
+ does not already exist
+
+ * header @structure: added as a synonym for @toc: it is used to build
+ the table of contents, but probably more usefully thought of and described
+ as the document structure header
+
+ * sisu help, some additions and a fix
+ sisu help env, 'issues' reporting when machine offline
+
+ * vim syntax highlighting file (sisu-0.38),
+ ftplugin more vimrc type defaults review, and colors minor
+
+0.37 introduces NEW FILE-NAME EXTENSIONS rename 's/\.s[123]$/\.sst/' *.s{1,2,3}
+rename 's/\.r[123]$/\.ssm/' *.r{1,2,3} rename 's/\.si$/\.ssi/' *.si
+
+%% sisu_0.37.12.orig.tar.gz (2006w14/7 | 2006-04-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.12.orig.tar.gz
+cf6d1cc419522f353e8b3e1f0c01afa6 3351564 sisu_0.37.12.orig.tar.gz
+31f19920cceee8a8212c12ba5eb62ffe 650 sisu_0.37.12-1.dsc
+73693cb634ddae10ebef21ddeffb0c26 93059 sisu_0.37.12-1.diff.gz
+
+ * vim syntax highlighting file, further testing
+
+%% sisu_0.37.11.orig.tar.gz (2006w14/7 | 2006-04-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.11.orig.tar.gz
+7004d8060065f8c4f6108a7d8ba3b825 3350939 sisu_0.37.11.orig.tar.gz
+e8ff904f31207140cbc35802c710b3ee 650 sisu_0.37.11-1.dsc
+73a9275c43abfbee672d15b60262eb1c 93046 sisu_0.37.11-1.diff.gz
+
+ * vim related files, cleaning
+ (filetype.vim, syntax/sisu.vim ftplugin/sisu.vim & colors/slate.vim)
+ syntax/sisu.vim minor refinements; colors/slate.vim has become a bit of a
+ christmas tree, pretty far from what it started out as, will probably tone
+ it down again, (it works only on dark backgrounds)
+
+ * help, 'environment' information, minor addition,
+ (and sysenv remote host rescue so works when machine is offline): 'sisu
+ help env'
+
+%% sisu_0.37.10.orig.tar.gz (2006w14/4 | 2006-04-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.10.orig.tar.gz
+416094f2d0e04e1a5c38df6a321712e3 3350639 sisu_0.37.10.orig.tar.gz
+d7f836eec596a99db9bcbd8a21ebb885 650 sisu_0.37.10-1.dsc
+a70a47001d321c3429eee72b0e0e7ea6 93016 sisu_0.37.10-1.diff.gz
+
+ * vim related files, cleaning
+ (filetype.vim, syntax/sisu.vim ftplugin/sisu.vim & colors/slate.vim)
+
+%% sisu_0.37.9.orig.tar.gz (2006w13/6 | 2006-04-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.9.orig.tar.gz
+4d546c58a828821baf2463a8fa75d3d9 3350076 sisu_0.37.9.orig.tar.gz
+886fd0492b54340111fead7edb20b250 649 sisu_0.37.9-1.dsc
+d080e93446a7304e6fa699ffaec8cd80 92985 sisu_0.37.9-1.diff.gz
+
+ * vim related files, cleaning
+ (filetype.vim, syntax/sisu.vim ftplugin/sisu.vim & colors/slate.vim)
+
+ * db common, fix for table representation
+
+%% sisu_0.37.8.orig.tar.gz (2006w12/6 | 2006-03-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.8.orig.tar.gz
+60a8f59bb38a43f6de2018a0ce150a60 3353064 sisu_0.37.8.orig.tar.gz
+4782c9516557f93bf8aedea985068e14 649 sisu_0.37.8-1.dsc
+b667a88206342970a051734073f7b791 92945 sisu_0.37.8-1.diff.gz
+
+ * screen text ansi color turned off by default, (color does not suit all
+ terms/consoles)
+ * to turn color on by default, edit sisurc.yaml in (found in ./_sisu
+ * ~/.sisu
+ or /etc/sisu) set flag: color: true
+ * to toggle screen color (on/off) use the -c flag
+
+ * processing path where markup directory is not writable [and no other
+ * default
+ has been set] is now /tmp/_sisu_processing/$USER (instead of
+ /tmp/_sisu_processing) [if document markup directory is writable, it
+ remains ./_sisu_processing, unless a different processing path is set in
+ active sisurc.yaml] e.g. of a non-writable document markup directory:
+ /usr/share/sisu-examples/sample/document_samples_sisu_markup
+
+ * processing path when /tmp/_sisu_processing/$USER is used, clean of content
+ after use (as is in public area on a multi-user system) unless maintenance
+ flag (-M) is used
+
+ * sisurc.yaml, removed processing directory entry, rely on sysenv default
+ (can still change default in sisurc.yaml)
+
+ * help, added a bit of 'environment' information, [expand further as needed]
+ sisu --help env
+
+%% sisu_0.37.7.orig.tar.gz (2006w12/4 | 2006-03-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.7.orig.tar.gz
+246a94c92f19e0640f6b5cf368ec6bd1 3351292 sisu_0.37.7.orig.tar.gz
+eefac162286ca49563b20692536a6092 649 sisu_0.37.7-1.dsc
+6794d8e1f5593fae1c920e301fd59fd7 92902 sisu_0.37.7-1.diff.gz
+
+ * common_db, fix affecting pgsql for endnotes in heading levels 1-3
+ [relational db catch-up with footnote fix in 0.36.24]
+
+%% sisu_0.37.6.orig.tar.gz (2006w12/4 | 2006-03-23) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.6.orig.tar.gz
+f0623474f1635d87f0d5674e0d3ae927 3351023 sisu_0.37.6.orig.tar.gz
+c546a82203c685fe59be60ab5492fa96 649 sisu_0.37.6-1.dsc
+699b594457459248a22e2ed97e56c4f5 92886 sisu_0.37.6-1.diff.gz
+
+ * sisu control, minor cleaning
+
+ * gedit/gobby syntax highlighting, very basic start, in:
+ sisu-examples/config/syntax_hi
+
+%% sisu_0.37.5.orig.tar.gz (2006w12/3 | 2006-03-22) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.5.orig.tar.gz
+9a03bbcea82c1625bad4a92d6498e408 3351422 sisu_0.37.5.orig.tar.gz
+46dca71f33c206dbff9b798f75733484 649 sisu_0.37.5-1.dsc
+d3c5ed96ca85254870e2500d2e3957a2 92863 sisu_0.37.5-1.diff.gz
+
+ * metaverse, digest: sha256 offered as alternative to md5
+ (configure in sisurc.yaml, md5 should be sufficient for most purposes and
+ remains default)
+
+ * metaverse, auto bold markup fix
+
+ * some code shuffling and method and variable renaming
+ (including in sisu control file)
+
+ * wmap, sorting of matches (object citation numbers)
+
+ * wmap, words capitalised unless several letters uppercase or is a phrase
+ (rather than a single word)
+
+ * wmap, names/id associated to phrases, space replaced with underscore
+
+ * html, heading tag names #h dropped if heading starts with alphabet so e.g.:
+ #h1.2 but #linux [consider #h_linux]
+
+%% sisu_0.37.4.orig.tar.gz (2006w10/4 | 2006-03-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.4.orig.tar.gz
+22970c76bd545a4852076b958f288d0b 3350498 sisu_0.37.4.orig.tar.gz
+4add721933eaf0b4418e28b61937c837 647 sisu_0.37.4-1.dsc
+cd31e7f43b70bc8bbff7a53f8b96a540 92832 sisu_0.37.4-1.diff.gz
+
+ * w3c compliance in html for: default homepage, document manifest, and
+ wordmap, (and check that renders properly in lynx, elinks, links2, w3m,
+ dillo as well as the rest)
+
+%% sisu_0.37.3.orig.tar.gz (2006w10/4 | 2006-03-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.3.orig.tar.gz
+a2f28400c4e741991cbca6c1239003a1 3350055 sisu_0.37.3.orig.tar.gz
+cce7e960ead1ff0fdc2fb4903cdefcd7 647 sisu_0.37.3-1.dsc
+acbada001ba115b5ac1c2f476a5b6d97 92809 sisu_0.37.3-1.diff.gz
+
+ * default home page, make sure that html is w3c compliant, (and renders in
+ lynx, elinks, links2, w3m, dillo as well as the rest)
+
+ * editors (other than vim already done) filetypes match new filenames
+
+%% sisu_0.37.2.orig.tar.gz (2006w10/2 | 2006-03-07) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.2.orig.tar.gz
+422703f270dd8a0df5ea6de38097708b 3356778 sisu_0.37.2.orig.tar.gz
+3669c92aa335a335f0e51a4566747862 647 sisu_0.37.2-1.dsc
+db86dcd03b1ca8c3b730331ba1df62b8 92772 sisu_0.37.2-1.diff.gz
+
+ * filename extensions, reduce in number and rename processed
+ secondary/temporary files to make matching of editable files trivial *.ss?
+ (editable files .sst .ssm .ssi matched with *.ss? or more precisely
+ *.ss[tmi])
+
+ * .sst (sisu structured text). .ssf removed, reason this is processed as
+ being the same file as .sst and increases the possibility of confusion for
+ the user. .ssm (sisu structured master) .ssc removed for same reason as
+ removal of .ssf described above. .ssm files may include .sst and/or .ssi
+ files within them.
+
+ * filename extensions, processed secondary/temporary files
+ ._sst was .sss and previously .t (substantive content of composite/master
+ file) .-sst was .ssu and previously .u (sisu markup .sst downloaded as
+ url for processing) reason for choice, identifies as .sst files and are
+ processed as such, while easily ignored/excluded on the command line for
+ editing and processing. These can be ignored by the user, but should be
+ processable by sisu as .sst files.
+
+ * .ssd (sisu structured document) is retained, for use in sisudoc,
+ or sisupod, where a zipped file with image and other content necessary to
+ reproduce the original is made.
+
+ * .ssi (sisu structured insert/information) unprocessed, sisu markup text,
+ for use in master documents, is likewise unchanged
+
+ * filetypes.vim made to match (filename extensions)
+
+%% sisu_0.37.1.orig.tar.gz (2006w10/1 | 2006-03-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.1.orig.tar.gz
+50064bf4ca448ca512f0867342bda977 3355756 sisu_0.37.1.orig.tar.gz
+47cf73b44e96185a59eaf963ae832cf2 647 sisu_0.37.1-1.dsc
+89a542fc1f5eb054ad6f701e368d2829 92500 sisu_0.37.1-1.diff.gz
+
+ * cgi search forms in sisu-examples, updated to match filename extensions
+ [and to match 'sisu-F webrick' equivalent]
+
+%% sisu_0.37.0.orig.tar.gz (2006w09/7 | 2006-03-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.37.0.orig.tar.gz
+24760db51b627f553d57e6b8126a37b5 3355565 sisu_0.37.0.orig.tar.gz
+4cfb6fac0ac6179f1140389c38ef943b 647 sisu_0.37.0-1.dsc
+8ca3ac75f71e776aeffa9727adb6e185 92371 sisu_0.37.0-1.diff.gz
+
+ WARNING: FILE RENAMING NECESSARY as file name extensions have been changed,
+ (there is scope for program breakage as a result, though preliminary tests
+ have been passed).
+
+ Also note that, SiSU markup syntax is unchanged. Repeat: there is NO CHANGE
+ to SiSU markup syntax. Renaming of file-extensions should be all that is
+ necessary for things to work as before.
+
+ File extension name changes, note this does not affect SiSU markup in any
+ way... but the .s1 .s2 .s3 and like types are discontinued, files should be
+ renamed as explained below
+
+ NEW FILE EXTENSIONS the obvious sd and sdf appear to be taken, and there is
+ some use of .st and .sm extensions, so will use .ss extensions, which from an
+ examination of vim filetype.vim and mime.types appear to be available.
+
+ * sst (.ssf) ('sisu structured text')
+ .sst == .s3 (also .s1 and .s2) .ssf == .s3 (also .s1 and .s2)
+
+ rename 's/\.s[123]$/\.sst/' *.s{1,2,3}
+
+ * ssm & ssc
+ ('sisu structured master' and 'sisu structured composite') .ssm == .r3
+ (also .r1 and .r2) .ssc == .r3 (also .r1 and .r2) [r was for require]
+
+ rename 's/\.r[123]$/\.ssc/' *.r{1,2,3}
+
+ suggested convention: use ssm where the master contains only requests for
+ parts; use ssc where the composite document contains its own text but
+ requests inserts. they are in fact (technically) interchangeable, not
+ being recognised as distinct by sisu.
+
+ * ssi
+ ('sisu structured insert/information') (this is an unprocessed recognised
+ as being in sisu markup but only used as part of a composite document .ssm
+ or .ssc)
+
+ ssi == si
+
+ rename 's/\.si$/\.ssi/' *.si
+
+ * ssd
+ ('sisu structured document') [filename].ssd should be mapped to sisudoc.tgz
+
+ THE FOLLOWING OCCUR IN PROCESSING they should be taken care of automatically
+ on use of sisu
+
+ * sss
+ secondary file .sss == .t3 [t was for tmp]
+
+ * ssu
+ downloaded url .ssu == .u3 [u was for url]
+
+ * sst_meta
+ human readable processing file (metaverse)
+
+ .sst_meta == .s3.meta
+
+ * sst_meta.rbm
+ ruby marshal processing file (metaverse)
+
+ .sst_meta.rbm == .marshalMeta
+
+ OTHER CHANGES
+
+ * sample markup documents file type extensions changed to .sst from
+ .s3
+
+ * sisu, provide warning and advice on renaming when requests are made to
+ * process files with old filename extensions.
+
+ * xml(s) and xhtml, escape greater than and less than in "code" mode.
+
+ * cgi search form, postgresql, fix - create canned url etc., in line with
+ * what sqlite form does
+
+%% sisu_0.36.25.orig.tar.gz (2006w09/7 | 2006-03-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.25.orig.tar.gz
+c614a0f838c46065853ce8a70660df55 3355275 sisu_0.36.25.orig.tar.gz
+14bb8779affa6b1fe88bcdfeb81d2c35 650 sisu_0.36.25-1.dsc
+3091300f2045e946aff51a04beec9b77 91154 sisu_0.36.25-1.diff.gz
+
+ [A Fix is Necessary will revisit]
+
+ * metaverse, don't number headings that are numbered (or rather, start with
+ numbers), [may need an escape]
+
+ * manifest, don't assume a document will contain header (related/recommended)
+ links
+
+ * vim syntax highlighting, sisu.vim, added check that url not preceded or
+ followed by > or < without an intervening space (or <br> which is a bit
+ redundant but a fairly common error that is highlighted as such in full),
+ needed for auto-markup match
+
+%% sisu_0.36.24.orig.tar.gz (2006w09/2 | 2006-02-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.24.orig.tar.gz
+f2a727ef111585efbb84fad7d131fdb0 3354247 sisu_0.36.24.orig.tar.gz
+109b804513271cc4b0da43d27dcef8ef 650 sisu_0.36.24-1.dsc
+95838c0b653fc987b69d76c4713015cc 91128 sisu_0.36.24-1.diff.gz
+
+ * html, segmented, footnote in heading levels 1, 2, or 3, (deposit in first
+ segment 4 that follows), and clean heading of the footnote reference marker
+ after the segment in which footnote (for the heading) occurs
+
+ * html, multilingual documents, ensure html filetype suffix is used in html
+ i.e. use html file suffixes within html, even when -H (rather than -h) is
+ selected
+ [decision to hardcode protection is a bit arbitrary, suffixes required here
+ by existing server configuration. Consequences of overlooking this
+ requirement are a bit latent and fairly dire..., add configuration file
+ escape of protection]
+
+%% sisu_0.36.23.orig.tar.gz (2006w09/1 | 2006-02-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.23.orig.tar.gz
+ c0677a4ae79820261fa28dd9e21c01ee 3354053 sisu_0.36.23.orig.tar.gz
+ 65ff2fede20f8aeb10a9f6cd55089e21 650 sisu_0.36.23-1.dsc
+ 51233be83917282cc1d13647902bd0f6 90413 sisu_0.36.23-1.diff.gz
+
+ * odf, use of brackets (also square) within linked text (and linked images
+ with text), fix
+ { text to link (use of brackets odf issue fix) }http://url
+
+ * odf, issue with ? in url in linked text and images, fix
+
+ * odf, single step indent with bullet, fix
+
+ * html, rights passed through special character filter...
+ [do for other "fields"]
+
+ * metaverse, a couple more characters sanitised
+ “” converted to "
+ — converted to -
+ 'irregular' whitespace converted to space
+
+ * html, segmented, footnotes in subheadings (levels 5 & 6) a clumsy fix
+ revisit and address upstream, [also notes name tag remains unclosed]
+
+ * regex, set for utf-8, [you may wish to reconsider fixed default]
+
+ * [sisu-examples, free_culture, minor adjustments to text]
+
+%% sisu_0.36.22.orig.tar.gz (2006w08/4 | 2006-02-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.22.orig.tar.gz
+ 78d8d224b4db8985072b1806617b5ff0 3352595 sisu_0.36.22.orig.tar.gz
+ 6b8caa7cbf4893111deb30ccd05fc680 650 sisu_0.36.22-1.dsc
+ b54396f9443c7f77a9c4ef695128a0bc 90388 sisu_0.36.22-1.diff.gz
+
+ * odf, footnote fix for url matches
+
+%% sisu_0.36.21.orig.tar.gz (2006w08/3 | 2006-02-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.21.orig.tar.gz
+ a8e7a6adf347c9b20965b3d19ad872a7 3352881 sisu_0.36.21.orig.tar.gz
+ b0ff57766149bf1dd63c002d4cba3a84 650 sisu_0.36.21-1.dsc
+ 089441cf1a4f72e63772f037036a18be 90358 sisu_0.36.21-1.diff.gz
+
+ * metaverse, further fix to catch exception for auto-heading/title numbering,
+ change of 0.36.19 (non-substantive/editorial hedings)
+
+ * html cosmetic, lower navigation band in scroll (doc.html), fix
+
+%% sisu_0.36.20.orig.tar.gz (2006w08/3 | 2006-02-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.20.orig.tar.gz
+ 60c3775c4f553906118f01f5976c2d70 3352515 sisu_0.36.20.orig.tar.gz
+ 264cb03dbd7a789568f70d94d117e56f 650 sisu_0.36.20-1.dsc
+ e4d05f5a543f53bfe4acac5fb7ea3b66 90313 sisu_0.36.20-1.diff.gz
+
+ * metaverse, fix required, issue introduced by 0.36.19, affected pdf
+
+%% sisu_0.36.19.orig.tar.gz (2006w08/3 | 2006-02-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.19.orig.tar.gz
+ 3ff5116481aeb77583c4144a76f41589 3351726 sisu_0.36.19.orig.tar.gz
+ a096c23f194e748505432b4ea0ae2a2b 650 sisu_0.36.19-1.dsc
+ b6cedff150ad4a65aa85ad9e507a293b 90281 sisu_0.36.19-1.diff.gz
+
+ * metaverse, document auto-heading/title numbering, rule change
+
+ * odf anchor of heading matches to start of line, fix
+
+ * odf hyperlinked text match, escape brackets within linked text, fix
+
+%% sisu_0.36.18.orig.tar.gz (2006w08/1 | 2006-02-20) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.18.orig.tar.gz
+ 5d1e674fc8d61c703b8479c230abbe21 3351642 sisu_0.36.18.orig.tar.gz
+ 4186636de25bb42888c519cd62891101 650 sisu_0.36.18-1.dsc
+ 6f61755dc6baeb6b09aac52bba504616 90236 sisu_0.36.18-1.diff.gz
+
+ * cgi sample form, sql search improved
+ [development iterations necessary]
+
+%% sisu_0.36.17.orig.tar.gz (2006w07/7 | 2006-02-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.17.orig.tar.gz
+ 3715d971d556c5eb4de10ccb8cae4857 3352507 sisu_0.36.17.orig.tar.gz
+ 2667514040bbdb928c130b2e565aea18 650 sisu_0.36.17-1.dsc
+ f393dd1f8ba8b344aba976af2c92771e 90212 sisu_0.36.17-1.diff.gz
+
+ * cgi sample forms (sqlite), match highlighting made case insensitive
+ character 'i' added to two files in two places
+
+%% sisu_0.36.16.orig.tar.gz (2006w07/7 | 2006-02-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.16.orig.tar.gz
+ 1d4ab63bb65308f27fc057e2c4f045de 3352304 sisu_0.36.16.orig.tar.gz
+ 2215b97903545574fe57c8b413ac5ba1 650 sisu_0.36.16-1.dsc
+ 5100b3d4bfb0eabf11cc3614e389005a 90196 sisu_0.36.16-1.diff.gz
+
+ * cgi form (generator),
+ canned url populates search field
+ more cosmetic rearrangement of code, e.g. cgi_common_sql introduced
+ for common code (in pgsql & sqlite forms)
+
+ * manual cgi samples renamed and updated
+ sisu-examples/sample/cgi-bin/sisu_search_pgsql.cgi
+ sisu-examples/sample/cgi-bin/sisu_search_sqlite.cgi
+
+%% sisu_0.36.15.orig.tar.gz (2006w07/6 | 2006-02-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.15.orig.tar.gz
+ 7daadfb8ea39c30c0bc2317e24a3ce17 3358917 sisu_0.36.15.orig.tar.gz
+ 13501be6212b0fd7067f4fccd575d22e 650 sisu_0.36.15-1.dsc
+ 12d5fcca3dfedf94d0f3360b06b78ffb 90169 sisu_0.36.15-1.diff.gz
+
+ * cgi form (generator), some cosmetic rearrangement of code,
+ order by output esp. for sqlite,
+ image paths rearranged
+
+%% sisu_0.36.14.orig.tar.gz (2006w07/6 | 2006-02-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.14.orig.tar.gz
+ bb206e160026ee8a0804a86191d088fc 3355327 sisu_0.36.14.orig.tar.gz
+ c3c8df68d3c9dea339fd18afce83f258 650 sisu_0.36.14-1.dsc
+ dcbdde8b5401d7aa2ea08cf30d2a4202 90155 sisu_0.36.14-1.diff.gz
+
+ * cgi form (generator) for pgsql and sqlite split up
+
+ * cgi form (generator) match highlighting added
+ [sample search form remains very basic]
+
+ * images, minor change to sisu.png and
+ inclusion of fsf/gnu levitating gnu
+
+ * metaverse, sanitize ’ character
+
+%% sisu_0.36.13.orig.tar.gz (2006w06/7 | 2006-02-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.13.orig.tar.gz
+ 7a4aa2e929e19df900f18b96ae1d5de6 3286170 sisu_0.36.13.orig.tar.gz
+ 92cde921735e33b3a781c2632470b721 650 sisu_0.36.13-1.dsc
+ 7a4aa2e929e19df900f18b96ae1d5de6 3286170 sisu_0.36.13-1.diff.gz
+
+ * bold line shortcut tag, !_ where no bold list, a fix
+
+ * minor, cosmetic code changes of tests with equivalents (type .nil? and
+ .empty?) [done a bit quickly though]
+
+ * minor, one spelling correction in free_as_in_freedom
+
+%% sisu_0.36.12.orig.tar.gz (2006w06/4 | 2006-02-09) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.12.orig.tar.gz
+ 0e5ca6878d119dafc6652b4f3dd0fb24 3285735 sisu_0.36.12.orig.tar.gz
+ 01ecb4df7879f576e284339abc6b49e2 650 sisu_0.36.12-1.dsc
+ 8fe27729103af5a5cbddc26a89d7522e 90101 sisu_0.36.12-1.diff.gz
+
+ * metaverse_syntax, fix required for alternative markup endnotes
+
+ * cgi (frontend for pgsql), url link fix (.html suffix) for webrick server
+
+ * digests/dcc, added info, minor
+
+%% sisu_0.36.11.orig.tar.gz (2006w06/4 | 2006-02-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.11.orig.tar.gz
+ 31749714603f3730a5589eb736e26cab 3284870 sisu_0.36.11.orig.tar.gz
+ 49a9807d5b7cf436a303de1c8f7100d1 650 sisu_0.36.11-1.dsc
+ 79301acf6b43364639f34e2baa5697c3 90088 sisu_0.36.11-1.diff.gz
+
+ * digest/dcc, further tuning of output presentation (digest.txt)
+
+%% sisu_0.36.10.orig.tar.gz (2006w06/3 | 2006-02-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.10.orig.tar.gz
+ 672259d2176c1fa5bba0414493d74970 3284698 sisu_0.36.10.orig.tar.gz
+ da64e5f067408b6db1ffac97649e246b 650 sisu_0.36.10-1.dsc
+ 25000b7faf86e44ccdb65b9c9bc0a42d 90073 sisu_0.36.10-1.diff.gz
+
+ * digest/dcc, (document content certificate), a bit more information
+ provided, in output and on man pages, e.g. see
+ http://www.jus.uio.no/sisu/sisu_changelog/digest.txt
+ or
+ http://www.jus.uio.no/sisu/SiSU/digest.txt
+ etc.
+
+ * sisu man page, minor fixes and minor embellishments
+
+ * home page, in default and skins, minor change
+
+%% sisu_0.36.9.orig.tar.gz (2006w06/2 | 2006-02-07) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.9.orig.tar.gz
+ e76442aac4a8cdd7492ad167dca41925 3282776 sisu_0.36.9.orig.tar.gz
+ eedec4d07f05ea60143d87fe0b7a4d98 647 sisu_0.36.9-1.dsc
+ 565b0a6b88f2eda2dcd22284e5d6ff72 90040 sisu_0.36.9-1.diff.gz
+
+ * fix of filelists where param is not parsed, relevant to rsync, scp and zap
+ [problem introduced by changes made for multilingual documents which
+ assumed that param is always parsed]
+ [solution not elegant, but likely to remain a while]
+
+%% sisu_0.36.8.orig.tar.gz (2006w06/1 | 2006-02-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.8.orig.tar.gz
+ 9ed1bf836f160a2bc1b731f28603b546 3281967 sisu_0.36.8.orig.tar.gz
+ 6284e201cc9cf8c0eccf7e25ac7d3868 647 sisu_0.36.8-1.dsc
+ bc6c9675bfc3e14ef1a44b0b93d9cf6f 90003 sisu_0.36.8-1.diff.gz
+
+ * plaintext dos/Unix, check that all dos linefeeds are in place
+
+ * help (man pages, html, program), minor adjustments, and sync html
+ with man pages
+
+ * remote (rsync,scp) building of filelist for placement of output
+ improved, relevant for multilingual documents
+ [could be improved further especially for scp, where there is no
+ language code all documents are copied, which results in
+ duplication]
+
+%% sisu_0.36.7.orig.tar.gz (2006w05/7 | 2006-02-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.7.orig.tar.gz
+ b803f347a64d0419965e194f380988fe 3281398 sisu_0.36.7.orig.tar.gz
+ d07542cb5d8789af37a89db8b5ef2753 647 sisu_0.36.7-1.dsc
+ 9cda1006001769a03a22245499ebc321 89967 sisu_0.36.7-1.diff.gz
+
+ * metaverse, linefeed conversion, convert msdos line feeds \r\n to unix \n
+ for processing
+
+ * sisu(1) man page, note added on how to produce dos plaintext output file
+ (instead of linux/unix)
+
+ * plaintext, default shortcut flags changed to produce dos ascii files,
+ reason, Unix/Linux seldom has a problem dealing other ascii filetypes, MS
+ based programs are more likely to stumble, also if manifest built
+ concurrently with plaintext will use plaintext command flag to give
+ information on output type - whether Unix or dos etc. [could add a file
+ check of type where manifest is built separately, not really necessary]
+
+ * skins, minor edits, path to css corrected
+
+%% sisu_0.36.6.orig.tar.gz (2006w05/6 | 2006-02-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.6.orig.tar.gz
+ 490413665dc030ac80eafde61d816aa0 3280852 sisu_0.36.6.orig.tar.gz
+ 5823740759b6c1cd7af9f0427f5e5446 647 sisu_0.36.6-1.dsc
+ fcc375a5464c65be9a665d600b7b775a 89943 sisu_0.36.6-1.diff.gz
+
+ * html (some w3c compliance steps) [2006-01-15]:
+ * object "id" number names changed, preceded by letter o
+ * use of name tag to give objects numbers (instead of id for numeric value)
+ * footnote links changed (use of underscore (instead of tilde not permitted))
+ * image tags "closed"
+ * skin adjustment
+ * finally reinstate w3c transitional xhtml header
+
+ * html tables, changed organisation of code [2006-01-16]
+
+ * odf tables [2006-01-17]
+ [display only without tables headings]
+
+ * odf pagebreaks [2006-01-17]
+
+ * odf bullets [2006-01-17]
+
+ * odf multiple images in object [2006-01-18]
+ image handling, fix [2006-01-22]
+ image captions [2006-01-22]
+ placement within text "as char" [2006-01-23]
+
+ * overview.txt updated with things done
+
+ * url screen display, fix to urls in batch processing [2006-01-17]
+ [overlooked because of personal practice of using rant/make to run all
+ requested processes on each markup file in a batch process]
+
+ * sisu headers, document recommended links, 12 link limit removed [2006-01-20]
+
+ * tables, introduced an alternative visual representation [2006-01-20]
+
+ * odf tables, max number of columns increased to 14 from 8 [2006-01-22]
+ (12 may be useful for months plus at least one to describe content)
+
+ * sisu_test.s3 document added to serve as quick test of markup forms and a
+ rough guide however it does not at all serve as an example of a typical
+ document [2006-01-21]
+
+ * html anchor heading matches to start of line, [watch] [2006-01-22]
+
+ * odf text links [2006-01-22]
+
+ * odf bullets, as image, currently using "red pill" [2006-01-23]
+
+ * texpdf special character vertical bar / pipe, fix [2006-01-23]
+
+ * digests, document content certification, work on multiple images [2006-01-26]
+
+ * digests, document content certification, (digest info) digest for
+ document skin digest, and repeat of document digest [2006-01-27]
+
+ * sql (pgsql, sqlite), special character escape, changes [2006-01-28]
+
+ * docbook experimental introduced, another form of xml (may need to rename,
+ so far represents a quick first pass at docbook, and does not qualify as
+ docbook: docbook is released under a liberal license permitting all manner
+ of modifications, but if modified may not be called docbook) is as noted
+ experimental and undocumented, (and may as easily be quietly removed, or
+ renamed as improved upon) [2006-01-31] [will need to study a number of things
+ including embedding document parts (within parts)..., may take opportunity
+ to introduce some substantive tags to sisu that are docbook compatible]
+
+%% sisu_0.36.5.orig.tar.gz (2006w01/5 | 2006-01-06) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.5.orig.tar.gz
+ e774624280d20e8e7153a5eaf6cfeadd 3271834 sisu_0.36.5.orig.tar.gz
+ 3dc07a05827739b13aebcdb07c777aed 647 sisu_0.36.5-1.dsc
+ 1b15ff3121d71868fcc64a912dd7d5c4 89869 sisu_0.36.5-1.diff.gz
+
+ * sisu man page minor edit
+
+ * copyright file contains information on setup.rb included with tarball
+ and on Rant used to generate install,
+ both under Gnu Lesser Public License
+
+ * Debian build changed, fewer packages, hope to unify the SiSU development
+ and SiSU Debian upload builds
+
+%% sisu_0.36.4.orig.tar.gz (2006w00/7 | 2006-01-01) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.4.orig.tar.gz
+ 4fb9343d78745fe582c1d91c5874d8cf 3270301 sisu_0.36.4.orig.tar.gz
+ d89b702d13d00b1bb34f6aca2a03b77a 691 sisu_0.36.4-1.dsc
+ c0889387ad3fe063c38d04a7cdcd0695 89581 sisu_0.36.4-1.diff.gz
+
+ * plaintext, multi-language document url adjustments
+
+ * termsheet, output path and urls
+
+ * [some multi-language document markup samples added to debian build in
+ sisu-examples]
+
+%% sisu_0.36.3.orig.tar.gz (2005w52/6 | 2005-12-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.3.orig.tar.gz
+ b2ab154a1f2656edd9032500e757c03e 3261612 sisu_0.36.3.orig.tar.gz
+ 964e4279748cf63526b8963f162f1eaf 691 sisu_0.36.3-1.dsc
+ ad3b135cb8dd825e56769b0f583b5542 13969 sisu_0.36.3-1.diff.gz
+
+ * adjustments made for consequences of possibility of multi-language documents in sysenv, wmap, sql (psql/sqlite), remote put
+
+ * sql prefix column changed to TEXT (from VARCHAR)
+
+ * sysenv, change to the initialization of constants [revisit]
+
+%% sisu_0.36.2.orig.tar.gz (2005w52/5 | 2005-12-30)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.2.orig.tar.gz
+ 990dd7e60ecfee3b9dce863a0a28cc4e 3261132 sisu_0.36.2.orig.tar.gz
+ e2a3e592727eb67eacdc863a817df482 691 sisu_0.36.2-1.dsc
+ d8e12848dc94f0c0da1a2afa23312e53 13913 sisu_0.36.2-1.diff.gz
+
+ * sql (pgsql/sqlite), (a fix:) "manifest" column replaces "summary" column
+
+ * html_format_table.rb removed, last dependency removed, rely on css
+
+ * wmap use main css, and own styles
+
+%% sisu_0.36.1.orig.tar.gz (2005w52/4 | 2005-12-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.1.orig.tar.gz
+ 099b3c9735e664d164a42835e157055b 3262472 sisu_0.36.1.orig.tar.gz
+ 646d6b052d0de625badd2ae22551808b 691 sisu_0.36.1-1.dsc
+ 31fc43e92b23ceb2834c8b2fdc4caaf5 13896 sisu_0.36.1-1.diff.gz
+
+ * html batch processing fix, placement of files:
+ index.html, toc.html and doc.html
+
+%% sisu_0.36.0.orig.tar.gz (2005w52/4 | 2005-12-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.36.0.orig.tar.gz
+ 9f81885774e9bccf267ba1bde2d9894b 3261722 sisu_0.36.0.orig.tar.gz
+ f380ff4f31e1e92c796017bf2636f037 691 sisu_0.36.0-1.dsc
+ 44f61789decda5816cf4b106fade30b2 13864 sisu_0.36.0-1.diff.gz
+
+ * html -h -H behaviour switch, -h now produces urls with suffixes (hardlinks,
+ including .html .pdf etc.) (this being the default that just works,
+ including for reading output in a browser directly off a file-system), -H
+ omits them and requires an appropriately configured web server.
+ [change in behaviour is the reason for this version number bump]
+
+ * multilingual/(multiple language) document filenaming convention and
+ associated behaviour, made default, unless turned off in configuration file
+ default:
+ multilingual: false
+
+ * multilingual/(multiple language) document output filenaming convention set
+ at 1 in following example list:
+ (1) outputdir/es.[file].html
+ (2) outputdir/[file].es.html
+ (3) outputdir/[file].html.es (which Apache for example can be
+ the first option is convenient in that it organises versions of document by
+ language in the output directory, (i tend to use 2 though)
+
+ default:
+ language_file: 2
+
+ (the default in the absence of a setting is 1 es.index.html, rather than 2
+ index.es.html)
+
+ [contains a batch processing bug affecting some html output, fix in 0.36.1]
+
+%% sisu_0.35.0.orig.tar.gz (2005w52/3 | 2005-12-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.35.0.orig.tar.gz
+ f86673b0bf576a82aa73c80540a2303f 3260953 sisu_0.35.0.orig.tar.gz
+ 4db5b9c912b117286460a85b59fd8d8a 691 sisu_0.35.0-1.dsc
+ 362829f8d71ee03eaf47aa1f8b8f3856 13828 sisu_0.35.0-1.diff.gz
+
+ * sisupod, sisu multi-language document pod, in place
+ if config file permits, will search for multiple versions of the same
+ document in different languages, by file naming convention, and all these
+ will be placed into the same sisudoc source file, the intention will be
+ to separate the sisudoc file format for single documents and sisupod for
+ multi-lingual versions of the same.
+ (changes to sysenv and sisudoc for this purpose)
+
+ * multi-lingual versions of document naming and output conventions
+ conceptually sorted,
+ e.g. assuming config file set as appropriate
+ language version name takes the form:
+ filename~es.s3
+ output alternatives become, (depending on config file setting)
+ (1) filename/es.index.html
+ (2) filename/index.es.html
+ (3) filename/index.html.es (which Apache for example can be
+ configured to use for automatically serving the users preference)
+ it is now just to stepwise implement the rules for output...
+ some detail remains as what to do with the default language, will this
+ feature be strict so that too will have the language version code included,
+ or, is it more convenient to drop it in that instance
+
+ default:
+ language_file: 2
+ # multilingual: true
+
+ * param, config filename placement information gathering rules for
+ multi-document version output are in place, done with flexibility in mind,
+ language insertions may be made at any of three points in filename
+
+ * sub-numbering system, default behaviour change/correction, reset when any
+ major number changes [consider offering the alternative of running
+ sub-numbers, below 4~, would be set in header]
+
+ * urls (-u, -U, -v), match new multilingual file naming convention
+
+ * manifest, show multilingual version manifests, if available
+
+ [contains a batch processing bug affecting some html output, fix in 0.36.1]
+
+%% sisu_0.34.2.orig.tar.gz (2005w51/1 | 2005-12-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.34.2.orig.tar.gz
+ db01ece3bc2314c57f0aa88d6ebd2974 3254394 sisu_0.34.2.orig.tar.gz
+ 197f762e774ddb42bc35c922386d3133 691 sisu_0.34.2-1.dsc
+ 2520379d811471ff5a3ca7fab6c4c646 13798 sisu_0.34.2-1.diff.gz
+
+ * default css, fix to image links (paths),
+ necessitated by changes to directory structure
+
+ * digests, include in header url for set sisu_manifest, and time and version
+ information at the top of the document
+
+%% sisu_0.34.1.orig.tar.gz (2005w50/7 | 2005-12-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.34.1.orig.tar.gz
+ d42234876268924db8dddd33faecd3b0 3254032 sisu_0.34.1.orig.tar.gz
+ ba33053014594db6cc36489ccf49b5c1 691 sisu_0.34.1-1.dsc
+ 0d7297accec601ff4e9f93a4746f3cd5 13756 sisu_0.34.1-1.diff.gz
+
+ * html and wmap output manifest cosmetic link change and a link fix in html
+
+ * manifest, md5 if markup source is shared, show if -v
+
+%% sisu_0.34.0.orig.tar.gz (2005w50/6 | 2005-12-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.34.0.orig.tar.gz
+ b46664690687cec318848df0f2d663f7 3253826 sisu_0.34.0.orig.tar.gz
+ 2c5cdede22b60b4f71294ca1a2a1e804 691 sisu_0.34.0-1.dsc
+ 1c636c138c29931d6216349f0655a709 13695 sisu_0.34.0-1.diff.gz
+
+ * directory structure changes
+ [reason for version number jump]
+ * all sisu output server configuration
+ goes into subdirectories named _sisu,
+ one within the main server directory
+ and another within each document directory created
+ _sisu/image
+ _sisu/css
+ _sisu/dtd
+ * localised sisu markup/input configuration
+ is placed directly under _sisu in the markup directory
+ (rather than _sisu/config), the hierarchy becoming
+ ./_sisu
+ ~/sisu
+ /etc/sisu
+ NOTE: it is again necessary to run sisu -CC
+ NOTE: the following have so far been considered and discarded as
+ alternatives to _sisu: "sisu" discarded as a name sometimes used for a
+ document directory; ".sisu" discarded as hidden output directories may be
+ confusing to the user; "sisurc" remains a possible alternative which is a
+ bit descriptive, however "_sisu" is consistent with the configuration
+ directories, and chosen for now
+
+ * see notes on css and images
+ for changes to image and css output directories
+ * see notes on configuration for notes on changes within
+ _sisu in local markup directory
+
+ * manifest, renamed from summary, sisu_manifest.html instead of summary.html
+ [reason: less likely to be useful in other circumstances, summary freed as
+ a reserved filename] [contains: #output #metadata #links]
+
+ * _sisu: _sisu/conf files and subdirectories moved to _sisu
+ [reason: the deeper directory structure made sense when sisu_processing was
+ also contained with _sisu, it is no longer helpful,
+ the directory structure of ./_sisu mirrors that of ~/.sisu]
+
+ * images now placed within output directory sisu/image
+ (there is a main sisurc directory and each subdirectory (mapping to a
+ markup directory stub) contains its own sisurc directory)
+
+ * generation of remote markup/source documents url, some work, on image
+ mappings
+
+ * css: logic in place for manually created css substitution
+ * -CC copies css files to output/webserver director sisu_css
+ if they exist in ./_sisu/css, ~/.sisu/css or /etc/sisu/css
+ * -H or -h html -x -X for xml etc. will look in output/webserver
+ sisu_css directory for any requested css. If it exists, pages created
+ will link to it, otherwise, the default css files provded by sisu are used.
+ * css requests may be done on a document or directory stub basis 0~css grey
+ will look for grey_html.css and the directory stub book, will look for
+ book_html.css
+ [note: check and make pages more css friendly]
+
+ * fix, if the within a document markup directory the directory
+ _sisu_processing exists and is writable it will be used for processing
+ otherwise /tmp/_sisu_processing is used
+ [i.e. to use ./_sisu_processing for processing, create it]
+
+ * sisurc.yaml defaults set to false to prevent zap (-Z) and css changes
+
+ * Sam Williams copyright notice, included under 0~rights in Free as in
+ Freedom, not sure how this has been missed.
+
+ * minor screen display url correction, in sax.xml
+
+%% sisu_0.33.0.orig.tar.gz (2005w50/4 | 2005-12-15)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.33.0.orig.tar.gz
+ 8a0907a006a1cb7187b5006db4f5ff7c 3252270 sisu_0.33.0.orig.tar.gz
+ 42b0ac73e9c5d680c70c86d9ee3115c2 691 sisu_0.33.0-1.dsc
+ 2c1a41d51aefa57d3a7c0f4c82356ce5 13649 sisu_0.33.0-1.diff.gz
+
+ * processing directory, moved to ./_sisu_processing from ./_sisu/processing
+ [reason: makes it easier to backup _sisu [you will almost never want _sisu_processing]]
+ /tmp/_sisu_processing is default and used if the former directory is absent
+ (instead of /tmp/sisu_processing for consistency)
+ [reason for local directory processing option if /tmp is default, exists,
+ if you prefer to keep processing out of /tmp]
+ [consider for /tmp adding to path /tmp/_sisu_processing/[$USER]/[directory
+ stub] to minimise likelihood of collisions, unlikely currently as the
+ default is to regenerate "metaverse" for each request]
+
+ * css, moved to [web_output]/sisu_css from [web_output]/style
+ [reason: collision with other efforts, manual or otherwise even less likely]
+ this means it is necessary to reinitialise directories, see sisu -CC
+
+ * external document (using url to call for processing), paths for processing
+ and downloaded images adjusted (processing and output)
+
+ * install (Rantfile and rant: install), a fix required
+
+%% sisu_0.32.5.orig.tar.gz (2005w50/3 | 2005-12-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.5.orig.tar.gz
+ aaaa1f0b62a45f5631d6875b8d1c4f60 3250422 sisu_0.32.5.orig.tar.gz
+ e201e7b1429886cf9b2be3ec14a63f18 691 sisu_0.32.5-1.dsc
+ 01009df572a86b00e2ea1d3ddf7b1211 13627 sisu_0.32.5-1.diff.gz
+
+ * orig.tar.gz should now be updated together with debian package
+ orig.tar.gz has not been updated properly since 0.31.4, debian package has
+ issue with autopackage builder
+
+ * debian package improved, however: diffs started from scratch, information/history abandoned
+ Reason: undetermined problem with automated package builder.
+ automated package builder (which uses darcs and darcs-buildpackage) builds package
+ normally/properly with a pristine directory structure, but not with accumulated debian build history.
+ For now, the orig.tar.gz and debian package structure are updated, and debian history is not included.
+
+ * directory named extra removed from source tarball,
+ extra/debian/man moved to debian/man
+
+ * debian, correction of a man page
+
+%% sisu_0.32.4.orig.tar.gz (2005w50/1 | 2005-12-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.4.orig.tar.gz
+ bd699b88457a2daf06de35681cd4df47 3265783 sisu_0.32.4.orig.tar.gz
+ 2e8a85326c7e14845481affb4df00fc0 692 sisu_0.32.4-1.dsc
+ e18913a52d26cf6bd1e5952b288cc08a sisu_0.32.4-1.diff.gz
+
+ * odf (opendocument), images - an image per paragraph/object only, at present
+ (thanks Alex Hudson #odf so_solid_moo for feedback, was placing paragraphs
+ within paragraphs, last step in getting images working)
+
+ * odf (opendocument), sisu document metadata
+
+%% sisu_0.32.3.orig.tar.gz (2005w49/7 | 2005-12-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.3.orig.tar.gz
+ 83e69d4ae96e578e8d089e9ad52c53c0 3265897 sisu_0.32.3.orig.tar.gz
+ e5c79923d0f574b7c9b8c5e36b9cead8 692 sisu_0.32.3-1.dsc
+ 6b95e5e713468c957da365e05bf5b3a7 258645 sisu_0.32.3-1.diff.gz
+
+ * html endnote url re-fix
+
+%% sisu_0.32.2.orig.tar.gz (2005w49/4 | 2005-12-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.2.orig.tar.gz
+ b95ce4a61d1ad27eca528624fcc582c9 3265864 sisu_0.32.2.orig.tar.gz
+ 8d84f343edb6dc7dd5e4edbc54f5633c 692 sisu_0.32.2-1.dsc
+ a95ac72c37636ac3ba15f6a9ec6ab4d2 258346 sisu_0.32.2-1.diff.gz
+
+ * sqlite, repair
+
+%% sisu_0.32.1.orig.tar.gz (2005w48/6 | 2005-12-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.1.orig.tar.gz
+ 568917465359a1324f973929009c6993 3265886 sisu_0.32.1.orig.tar.gz
+ 6f539432cebe4abfeadf87e993416fcb 692 sisu_0.32.1-1.dsc
+ 3420efac3b35079d0ad3197a1e7fb4e0 257563 sisu_0.32.1-1.diff.gz
+
+ * minor code cleaning, mostly removal of commented out code,
+ lib html_css.rb, removed as redundant
+
+ * package: html files in data/doc/sisu moved to data/doc/sisu/html
+
+ * debian:control a missing comma added to comma delimited depends list
+
+%% sisu_0.32.0.orig.tar.gz (2005w48/4 | 2005-12-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.32.0.orig.tar.gz
+ d9a549c11f77809c874ab664fc24d41f 3265763 sisu_0.32.0.orig.tar.gz
+ f3605f1094fb587dbc113198054c868f 692 sisu_0.32.0-1.dsc
+ 54f1ebd40f654df574043270e8c939f4 257434 sisu_0.32.0-1.diff.gz
+
+ * -v urls, minor correction
+
+ * -q quieter
+ pdflatex quieter [/dev/null screen ouput except for -v up]
+
+ * -q -v -V -M -u screen information levels better sorted
+
+%% sisu_0.31.5.orig.tar.gz (2005w48/4 | 2005-12-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.5.orig.tar.gz
+ 9fe95a6f45eb21dabcdf227ccce1dae9 3273030 sisu_0.31.5.orig.tar.gz
+ a7faf0e8797755a628c055e29e2da34a 691 sisu_0.31.5-1.dsc
+ fa5e70331f75052e604297d900907f38 13116 sisu_0.31.5-1.diff.gz
+ [this should have been 0.32.0]
+
+ * -v -M etc. (cosmetic) url, output path information improved
+ additional possibilities in configuration, sisurc.yaml
+ setting of programs used:
+ text_editer, web_browser, pdf_viewer, odf_viewer
+ setting of viewing preference, vis path, and url
+
+ * -CC re homepages, new option setting the (manually crafted) home page,
+ copy from first found of:
+ ./_sisu/conf/home/index.html
+ ~/.sisu/home/index.html
+ /etc/sisu/home/index.html
+ otherwise, as before will look for home page in:
+ ./_sisu/conf/skin/doc/skin_sisu.rb
+ ~/.sisu/skin/doc/skin_sisu.rb
+ /etc/sisu/skin/doc/skin_sisu.rb
+ and as before if that is not found, take the sisu default
+
+ * css styles, start implementing a more flexible model for using
+ alternative stylesheets, stylesheets may be specified in document header
+ 0~css or 0~stylesheet [name], and if that existws, or if a stylesheet
+ exists that matches the markup directory stub, results in html, xhtml, xml
+ as appropriate, requesting the matching stylesheets documunts
+ [needs work and testing before it becomes really useable, for the time
+ being is switched off by default to use must be enabled in conf file]
+ [css stylesheets renamed, likely to be noticed]
+
+ * -CCr -CCRZ stubs for remote copying/building of base site,
+ images, css stylesheets, index.html and toc.html
+ (not to be confused with existing remote placement of generated output)
+
+ * Debian package adjustment
+
+%% sisu_0.31.4.orig.tar.gz (2005w48/2 | 2005-11-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.4.orig.tar.gz
+ 5f9e68079806301e4f32ddc801ffdbd0 3249616 sisu_0.31.4.orig.tar.gz
+ 9bdc2f510a981efbd811194dddb230a4 679 sisu_0.31.4-1.dsc
+ 27db1bffe6571ee571e54961a450775e 11351 sisu_0.31.4-1.diff.gz
+
+ * Debian packages broken into smaller packages, for better control over
+ dependencies, source package structure affected (control, .install,
+ .manpages)
+
+ * sisu-composite together with sisu-examples installs the whole of SiSU
+
+%% sisu_0.31.3.orig.tar.gz (2005w48/1 | 2005-11-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.3.orig.tar.gz
+ 562d89e8a4346350f749f660eb266a57 3245995 sisu_0.31.3.orig.tar.gz
+ af095b570f9aa0a7d1472747ea854e8e 10769 sisu_0.31.3-1.diff.gz
+ 68cd0ea97435cc03c893d68d7e70259a 10789 sisu_0.31.3-2.diff.gz
+ 198aef746935e6fcf673b8fb33d6e581 579 sisu_0.31.3-2.dsc
+
+ * remote url gathering of images re-fixed, e.g.
+ sisu -Hpv http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.s3
+ should produce html and pdf of Free Culture from the online marked up file, with the images
+ [sisu -CC (to copy downloaded images to the output directory)]
+ sisu -pHv http://www.jus.uio.no/sisu/sphinx_or_robot.leena_krohn.1996/sphinx_or_robot.leena_krohn.1996.s3
+ [has even more images, you will have to repeat sisu -CC]
+ [includes a workaround for an odd bug: retry needed on first attempt]
+
+ * sisu control, ensure file array unique
+ [some risk of unforeseen consequences, test]
+
+ * -v verbose output, minor, tagged on mention of sisu -W starting ruby
+ webserver on sisu output directory
+
+ * add link to sisu_faq, maintain faq
+
+ * [debian, started using pbuilder
+ (otherwise, package still built using darcs-buildpackage, and additional
+ enthusiastic use of mercurial for version control)]
+
+ * sisu_0.31.3-1 debian:control: Depends: ruby1.8 (>=1.8.3)
+
+ * sisu_0.31.3-2 debian:control: Depends: ruby (>=1.8.2)
+
+%% sisu_0.31.2.orig.tar.gz (2005w47/6 | 2005-11-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.2.orig.tar.gz
+ e928fc31ce6109f924836c79a3c19027 3245306 sisu_0.31.2.orig.tar.gz
+ 374bbe3ae0ddc53a652c5abcb421d6a7 10726 sisu_0.31.2-1.diff.gz
+
+ * debian autobuild fix [external scaffolding]
+
+%% sisu_0.31.1.orig.tar.gz (2005w47/6 | 2005-11-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.1.orig.tar.gz
+ b1734e76a39d043010e30722bbb3359c 3245133 sisu_0.31.1.orig.tar.gz
+ 20bbb1f84c34779e55abed80aae7fdf0 10679 sisu_0.31.1-1.diff.gz
+
+ * odf, minor fix url match
+
+ * [sample documents urls to amazon and barnes and noble
+ added as courtesy to authors]
+
+ * [Note: change to automated debian package build procedure]
+
+%% sisu_0.31.0.orig.tar.gz (2005w47/5 | 2005-11-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.31.0.orig.tar.gz
+ e6beae75cda1d00c68dc0d97c67cb540 3244304 sisu_0.31.0.orig.tar.gz
+ 8785cf622dee3fe07eed841b8cfbf8e1 10626 sisu_0.31.0-1.diff.gz
+
+ * metaverse, header, italicise and bold lists,
+ results in significant changes
+ markup change use regex directly
+ [results in odf (openoffice) repair of 0.30.9]
+
+%% sisu_0.30.10.orig.tar.gz (2005w47/5 | 2005-11-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.10.orig.tar.gz
+ ed89acbe1f406f2f55052651d12f1b78 3242816 sisu_0.30.10.orig.tar.gz
+ 6495690d1611efd7c9a8145a8b0ca73e 10589 sisu_0.30.10-1.diff.gz
+
+ * rollback to 0.30.8 header, italicise and bold lists,
+ use of semi-colon delimited list,
+ [new version number 0.31 opened for header use of regex
+ to italicise and bold]
+
+%% sisu_0.30.9.orig.tar.gz (2005w47/2 | 2005-11-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.9.orig.tar.gz
+ 70cc77083106e86b98bcf719ec35d657 3242867 sisu_0.30.9.orig.tar.gz
+ 5ab1832552e65f598304baff2e253a88 10499 sisu_0.30.9-1.diff.gz
+
+ * setup.rb 3.4.1 by Minero Aoki included with SiSU as an installer
+
+ * package directory structure modified to comply with setup.rb default
+ data/man moved to man as setup.rb, affects debian
+
+ * header, italicise and bold lists, markup change use regex directly
+ [instead of converting semi-colon delimited list]
+
+ * minor notes on installation in README
+
+%% sisu_0.30.8.orig.tar.gz (2005w47/2 | 2005-11-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.8.orig.tar.gz
+ a75adbe1198732ec577c630e4b4e94dd 3229748 sisu_0.30.8.orig.tar.gz
+ 3a4cd20539b968f37d10c1a8383bc315 10595 sisu_0.30.8-1.diff.gz
+
+ * latex pdf, the pdfetex parameters used appear to be Debian specific,
+ SiSU LaTeX is written for pdflatex... change precedence/ search order,
+ use pdflatex if present, otherwise try use pdfetex (with pdflatex parameter)
+
+ * url/document output, (largely cosmetic fix) screen information,
+ sisudoc (-S) and sisu markup source (-s) [-S was linked to sqlite]
+
+ * url (-U) print urls without -v
+
+%% sisu_0.30.7.orig.tar.gz (2005w47/1 | 2005-11-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.7.orig.tar.gz
+ 83c56fa696a75a9111295c99c2e5196e 3229287 sisu_0.30.7.orig.tar.gz
+ 2e581d080177a0aa24f7076597676438 10552 sisu_0.30.7-1.diff.gz
+
+ * rsync screen message adjustment
+
+ * skin:hp linked to sisu_changelog which has been separated from sisu_download
+
+ * composite documents, fix manual closure of file is apparently necessary !
+
+%% sisu_0.30.6.orig.tar.gz (2005w46/7 | 2005-11-20)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.6.orig.tar.gz
+ c9abcf18916ac55d67308039f01933bb 3228496 sisu_0.30.6.orig.tar.gz
+ 810751b72796f862fe5d9f4cfcbe195b 10510 sisu_0.30.6-1.diff.gz
+
+ * numeric shortcuts accept rsync extra command flag (-R)
+
+ * rsync (-R), screen output minor (what default, verbose and quiet do)
+
+%% sisu_0.30.5.orig.tar.gz (2005w46/7 | 2005-11-20)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.5.orig.tar.gz
+ e3e08897e4d7c3373c5898f31926c094 3228219 sisu_0.30.5.orig.tar.gz
+ 583723571b8df2aa7717a7872b143227 10497 sisu_0.30.5-1.diff.gz
+
+ * conf, homepage, skin path precedence, fix
+ (related to finding ./_sisu/conf/skin/doc/skin_sisu.rb)
+
+ * summary, suggested links, cosmetic: fix to static url
+
+ * sisu_doc, drop making of directory _sisu/config
+ (using _sisu/conf)
+
+%% sisu_0.30.4.orig.tar.gz (2005w46/6 | 2005-11-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.4.orig.tar.gz
+ a2a1bf159e3ccfdd7a15baf4f2603fbf 3227828 sisu_0.30.4.orig.tar.gz
+ 895212c9fb09f100674338b7694ad921 10481 sisu_0.30.4-1.diff.gz
+
+ * html segments, summary button, fix (icon and link)
+
+ * sisudoc, cosmetic: screen output, touch (remove repeat of output filename)
+
+ * summary, suggested links, cosmetic: replace relative links with static url
+
+ * conf.rb renamed from config.rb
+
+ * moved sisu_changelog out of main SiSU document [has grown large]
+
+%% sisu_0.30.3.orig.tar.gz (2005w46/6 | 2005-11-19) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.3.orig.tar.gz
+ 444a194aae38120f13fd3bf2f9ae505a 3227547 sisu_0.30.3.orig.tar.gz
+ 1d1b49a957cb118a3110574d26bb9304 10413 sisu_0.30.3-1.diff.gz
+
+ * configuration, change, use ./_sisu/conf
+ [WARNING ./_sisu/config is depreciated and will be removed]
+
+ * db:pgsql, bugfix FROM required in a select statement
+ [postgresql 8.1 complained]
+
+ * zap, delete, -Z disable by default,
+ to use must enable in sisurc.yaml
+
+ * rmagick, disable load/require by default, sisurc.yaml
+ problem with some local installs of ruby
+
+ * pdfetex, call with -fmt=pdflatex
+
+ * summary, metadata suggested links added
+
+ * xml,xhtml,html tidy only run with -V or -M
+ rexml only with -M, primary reason a considerable speedup
+ in skipping step unless specifically requested for testing
+
+ * sisu control file, changes a bit arbitrary, but a bit easier
+
+ * debian control suggests keychain (added)
+
+ * summary and place of composite document source (-s -y), though just request
+ for other documents [decide later whether to include constituent document
+ parts]
+
+ * help, update, sync with man pages
+
+%% sisu_0.30.2.orig.tar.gz (2005w46/2 | 2005-11-15) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.2.orig.tar.gz
+ d0f8f7dfe1106616e3e0790c034cf190 3228007 sisu_0.30.2.orig.tar.gz
+ f953aa19d54e99a7a8d4669aaffe87ad 10130 sisu_0.30.2-1.diff.gz
+
+ * minor cleaning
+
+%% sisu_0.30.1.orig.tar.gz (2005w46/1 | 2005-11-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.1.orig.tar.gz
+ 6367fc10883a98452d87044193338062 3227345 sisu_0.30.1.orig.tar.gz
+ 59706eabd49a51394887d4ebb218cd3c 10112 sisu_0.30.1-1.diff.gz
+
+ * summary, include plain.txt where available
+
+%% sisu_0.30.0.orig.tar.gz (2005w45/7 | 2005-11-13)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.30.0.orig.tar.gz
+ 2ab163fbf4a3b2ed31e14328ce69cbac 3227035 sisu_0.30.0.orig.tar.gz
+ 6b0103b794fe8c6c015043b56f7770cd 10096 sisu_0.30.0-1.diff.gz
+
+ * param, polishing...
+
+ * sql metadata, reworked ... ongoing
+
+ * sisudoc, re-named sisu_doc rather than sisu_ball
+
+ * sisudoc, only -V and -M show verbose tgz of what goes in to sisudoc (previously -v did)
+
+ * name correction: SiSU is a recursive acronym, and has other
+ alternative possible expansions, one of which i got wrong,
+ under the influenced of the other !
+ * SiSU information Structuring Universe
+ * Simple information Structuring Universe
+ * _Structured information Serialized Units_
+ [<-- i got my last name wrong consistently wrote Serialized information
+ Structured Units, which makes less sense, (i am guessing i managed to
+ overlook this because of the position of the word structured in the first
+ and second expansion) i guess this correction calls for a major version
+ number change! hope no one (else) notices ;-) ]
+
+%% sisu_0.29.5.orig.tar.gz (2005w45/5 | 2005-11-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.5.orig.tar.gz
+ 3e0ad7d2f8b02d0f3e61f113b2430269 3223938 sisu_0.29.5.orig.tar.gz
+ 90a2570933de02fabd965fe8218fa354 10060 sisu_0.29.5-1.diff.gz
+
+ * for present have gone back to using pdfatex, need to spend some time to
+ figure what needs to be done for pdfetex, LaTeX headers may need to change,
+ in any event, calling it in same manner as padflatex broke pdf output, (no
+ time et to sort out)
+
+ * minor fixes, [regex match of param metadata and copyright sign in odf]
+
+%% sisu_0.29.4.orig.tar.gz (2005w45/5 | 2005-11-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.4.orig.tar.gz
+ 0d47f551de9f140d6cabc84614e2b4d8 3223745 sisu_0.29.4.orig.tar.gz
+ 600d5725cd8835ce4cc345a10d074ca2 10035 sisu_0.29.4-1.diff.gz
+
+ * summary, make easily available from different outputs
+
+ * metaverse, autonumbering of segments from manual text markup,
+ re-checked/re-fixed [as presents some risk must be selected in heading]
+
+ * metaverse, when run remove maintenance metaverse file unless -M flag used
+
+ * param, endnotes checking, where endnote references and endotes are separate
+ check than number count matches else report error, [and place error in
+ document summary]
+
+ * opendocument, renamed file odf
+
+ * opnedocument, added matching & linking of urls and mail address
+
+ * summary, warning of document error if endnote number mismatch, note this
+ cannot occur if the preferred markup style for endnotes is used.
+
+ * sysenv, pdfetex, debian renaming, search for pdfetex, pdftex and pdflatex
+ to generate pdf from SiSU's LaTeX output
+
+%% sisu_0.29.3.orig.tar.gz (2005w45/2 | 2005-11-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.3.orig.tar.gz
+ f4b9e6b875e9d01c1c52bfa68f1e3d56 3222790 sisu_0.29.3.orig.tar.gz
+ da61f9e61a5e5b7538c47d996b24a937 9961 sisu_0.29.3-1.diff.gz
+
+ * rsync use added for remote puts -R (scp is -r)
+
+ * summary bug fix, variable scope reduced
+ (incorrectly retained information from previous files in batch runs)
+
+ * introduced -K which deletes output files prior to processing of files of
+ same type
+
+ * -s sisu markup source copied to output directory, (placed remotely with -sr)
+
+ * -S sisudoc made and copied to output directory, (placed remotely with -Sr)
+ [renamed from -Z]
+
+ * --update updates previous output, with same filetype output only, useful
+
+ * [-F renaming from -S naive cgi search form sample]
+
+ * [minor editing of program file headers]
+
+%% sisu_0.29.2.orig.tar.gz (2005w45/1 | 2005-11-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.2.orig.tar.gz
+ b8ecd141040e1ffa0820cdf9382304a7 3220476 sisu_0.29.2.orig.tar.gz
+ 3d42aeb8d9648fed4baf837c59cff7a5 9899 sisu_0.29.2-1.diff.gz
+
+ * sql table metadata created, replaces table titles
+ [breaks former table structure]
+
+ * sql urls replaces links table
+
+ * pgsql comments
+
+ * cgi scripts use table:metadata instead of table:tiles
+
+ * xml series, poem and group (and code) first pass
+
+ * opendocument renamed odt.tgz instead of o_doc.tgz
+
+ * summary, (-y) summary of document outputs generated and document metadata
+ (metaverse includes links to summary, as does html band and latex doc info)
+
+ * data/sisu (/usr/share/sisu) created for sisu shared images and odf,
+ subdirectories, separating packages sisu from sisu-examples which is
+ recommended only, and should not be needed to provide what sisu requires.
+
+ * debian/sisu.install map data/sisu to /usr/share/sisu
+
+ * [small changes: webserv var rename; cosmetic removal in html and xml of
+ less-than greater-than on copy @ \<< home \>>]
+
+%% sisu_0.29.1.orig.tar.gz (2005w44/6 | 2005-11-05)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.1.orig.tar.gz
+ c2a36974bf9c9d04e3c402a01500be68 3214920 sisu_0.29.1.orig.tar.gz
+ 398f1f15f798bb31679ca91cb1b400ab 9802 sisu_0.29.1-1.diff.gz
+
+ * tar gzip files changed file suffix to .tgz (instead of .gz)
+ comment added to man page and help
+
+ * html some character encoding corrections (é and a few others)
+
+ * param recognises rcs in addition to cvs and 0~rcs+ $Id$ may be used
+ [as alternative to 0~cvs equivalent, metaverse and downstream adjusted
+ accordingly]
+
+ * debian/control added suggests lv and rcs as alternative to cvs
+ [to which it is personally preferred for document control (as making
+ more sense working with favoured used development distributed source
+ control management systems, mercurial and darcs)]
+
+%% sisu_0.29.0.orig.tar.gz (2005w44/1 | 2005-10-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.29.0.orig.tar.gz
+ a1658902d929eee564c77f061568a677 3214113 sisu_0.29.0.orig.tar.gz
+ fc3c5c566c307636d23467476d38b5bf 9732 sisu_0.29.0-1.diff.gz
+
+ * metaverse autonumbering changed,
+ affecting default html segment naming
+ [change to metaverse affects downstream processing]
+
+%% sisu_0.28.4.orig.tar.gz (2005w44/1 | 2005-10-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.4.orig.tar.gz
+ f3f00e850a17d2fbfbffadf8a0d6ef5d 3213380 sisu_0.28.4.orig.tar.gz
+ e9e5a3f5a1ed1065b2c02b15d630a213 9718 sisu_0.28.4-1.diff.gz
+
+ * opendocument -o now defaults to produce metaverse first -mo
+ (this is behaviour for other outupts such as html, latex/pdf...)
+
+ * metaverse footnote url matches, tuning
+
+ * texpdf url matches, tuning, especially footnotes
+
+ * help update of processing flags, checked against man pages
+
+ * some changes to variable names, cf instead of rf (also used pf briefly)
+
+ * debian control file, minor edit of description of SiSU
+
+ * doc/overview.txt update on things not done in list
+
+%% sisu_0.28.3.orig.tar.gz (2005w42/7 | 2005-10-23) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.3.orig.tar.gz
+ 144e450c59d99c9baa24e1f265e19182 3212941 sisu_0.28.3.orig.tar.gz
+ bf0ecc4e8a2378acfadee2158005a500 9669 sisu_0.28.3-1.diff.gz
+
+ * metaverse, bullets accidentally removed, and put back
+
+%% sisu_0.28.2.orig.tar.gz (2005w42/6 | 2005-10-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.2.orig.tar.gz
+ ae92bc6a14600a15f4bfbe5512bf9af2 3213202 sisu_0.28.2.orig.tar.gz
+ ee23f7ac2122521fe4d802e023921a7f 9644 sisu_0.28.2-1.diff.gz
+
+ * texpdf character encoding bugfix, (removed iconv) however,
+ sisu requires utf-8 input for extended character sets
+
+ * character encoding touches, e.g. sample files saved as utf-8
+
+%% sisu_0.28.1.orig.tar.gz (2005w42/6 | 2005-10-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.1.orig.tar.gz
+ e672ccc483cf48fed084bfce99f87b8d 3212728 sisu_0.28.1.orig.tar.gz
+ dbe154e00f8421a2f05c67a11c2e7cbc 9618 sisu_0.28.1-1.diff.gz
+
+ * character encoding, moved a basic transform to metaverse,
+ hopefully more predictable characters to deal with and
+ made easier to work with postgresql, affects other modules
+ changes to html and texpdf, neither perfect, both need work
+ esp. html. two steps forward one step back
+
+ * some database operations visited, (update)
+
+%% sisu_0.28.0.orig.tar.gz (2005w42/5 | 2005-10-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.28.0.orig.tar.gz
+ 12064bd92864441ab8b103f094412c2f 3210000 sisu_0.28.0.orig.tar.gz
+ 22c5452ca4a060ddbb4bcb768a4bd119 9600 sisu_0.28.0-1.diff.gz
+
+ Release (and version number bump) primarily to put ruby sisu segfault
+ bug behind us, Debian ruby-1.8.3-2 released and fixes this
+ [an emergency build to work around the problem was made available as
+ 0.27.0 see note there for details]
+
+ * remote placement of open document files added (odt)
+
+ * added open document format to several default shortcuts sisu -2 etc.
+
+ * made note of opendocument format output on sisu home page
+ [feature not complete]
+
+ * synced skin_sisu.rb files, (there are a bit too many of them, most would normally be syslinks)
+
+%% sisu_0.26.4.orig.tar.gz (2005w42/2 | 2005-10-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.4.orig.tar.gz
+ 6cd9d7bcb42a48a7475d6bd724b766be 3202069 sisu_0.26.4.orig.tar.gz
+ 5f0a0dec3a5819f2e266581d912255ad 9499 sisu_0.26.4-1.diff.gz
+
+ * sisu file format flag moved to -Z (from -B)
+
+ * sisu -Z without [filename/wildcard] makes gzip of sisu directory of
+ marked up files, including sisu markup source files, local configuration
+ file, images and skins.
+
+ * sisu -Z [filename/wildcard] makes gzip of individual sisu file specified
+ including sisu markup source file and related images and skin
+
+ * opendocument format, -o, experimental, incomplete, [ignore]
+
+ done:
+ headings
+ footnotes
+ bold underscore italics strikethrough
+ superscript subscript
+ extended ascii set
+ indents
+ groups
+ tables
+ poem
+ code
+
+ todo:
+ groups
+ tables
+ images
+ bullet
+ line break?
+ page break?
+ table of contents
+ page header/footer?
+
+ * debian build (i) recommends sqlite added, overlooked previously;
+ (ii) added recommend zip, used in the making of open document;
+ (iii) removed recommended incorrect libcgi_ruby. libfcgi-ruby1.8, remains;
+ (iv) have added a basic open document file structure as a tgz file.
+
+%% sisu_0.26.3.orig.tar.gz (2005w40/5 | 2005-10-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.3.orig.tar.gz
+ 309cbdc9b2ab048a670ca9301aaeee87 3183245 sisu_0.26.3.orig.tar.gz
+ 3dc4a9587427db4819a10958c4adde5c 9342 sisu_0.26.3-1.diff.gz
+
+ * a sisu file format introduced:, -B, a gzipped file, containing:
+ sisu markup sourcefile,
+ its images
+ and its skins,
+ opens as sisu_ball directory, which once unipped sisu may be run within,
+ (sisu does not at present automatically unpack and run on these files,
+ but is a convenient way of packing the contents of a file for sending)
+ [early days]
+
+ * man1/sisu.1 upadated and html on -B sisu file format (sisu help not yet done)
+
+ * cosmetic firefox taken from list of lightweight browsers,
+ remains very much amongst the heavies
+
+ * cosmetic correction on info related to librmagick-ruby contained within
+ sample document free_culture
+
+%% sisu_0.26.2.orig.tar.gz (2005w39/5 | 2005-09-30)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.2.orig.tar.gz
+ 2b5f2c65088a6f95303c2b99d5033386 3179769 sisu_0.26.2.orig.tar.gz
+ 9d2aa597a50af0608c382e6f52f8a873 9322 sisu_0.26.2-1.diff.gz
+
+ * css, minor, caption - display: inline;
+
+ * syntax highlighting (sisu markup), editor configuration files, added, see
+ sisu-examples/config/syntax_hi/README
+ /usr/share/sisu-examples/sisu-examples/config/syntax_hi/README
+
+ for the editors:
+ * nano http://www.nano-editor.org/
+ * diakonos http://purepistos.net/diakonos/
+
+ NOT REALLY DONE, but intitial attempt included anyway:
+ * nedit http://www.nedit.org/
+ * gedit http://www.gnome.org/projects/gedit
+ * kate http://kate.kde.org
+ * emacs http://www.gnu.org/software/emacs/emacs.html
+
+ [vim-sisu still provides the most comprehensive sisu markup
+ editor environment]
+
+ * evince becomes the default pdf in maintenance urls etc. (previous was xpdf)
+
+ * document samples image dimensions manually provided, affected document
+ sample "Free Culture", Lawrence Lessig. Note this is not necessary from
+ sisu-0.20.0 onwards, if you have rubymagick installed.
+
+WARNING ruby 1.8.3 (2005-09-21) [i486-linux] segfaults SiSU
+FIXED in 1.8.3 (2005-09-29) [i486-linux] thank you TS/Guy Decoux
+the new ruby build is not as yet uploaded to Debian unstale
+
+%% sisu_0.27.0.orig.tar.gz (2005w39/1 | 2005-09-26) %% Emergency Release:
+
+NOTE: this is an emergency version of SiSU that does not segfault with
+problem versions of ruby, see note follwing. It is prepared without Syck/Yaml
+
+Problem ruby versions:
+* ruby 1.8.3 (2005-09-21) and was removed by TS:Guy in ruby 1.8.3 (2005-09-29),
+ released as Debian unstable ruby-1.8.2-1, and in
+* ruby 1.8.3 (2005-10-12) and was again removed by TS:Guy in ruby 1.8.3 (2005-10-13).
+
+ * Temporary Emergency Release
+ ruby 1.8.3 (2005-09-21) [i486-linux]] segfaults sisu
+ bug report made to ruby-core 2005-09-24
+
+ this version of sisu built without Syck/Yaml
+ and is not configurable, (uses sisu default configuration only)
+ ignoring yaml user config files
+
+ as such this emergency release:
+ * only uses sisu default configuration settings,
+ ignoring yaml user config files
+ * does not provide sisu version information
+
+%% sisu_0.26.1.orig.tar.gz (2005w37/7 | 2005-09-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.1.orig.tar.gz
+ a6e020a9932d972cc92a8abdcb704238 3156526 sisu_0.26.1.orig.tar.gz
+ 4cbe9d5240b03eea9fc6392ebb2aca46 9304 sisu_0.26.1-1.diff.gz
+
+ * pruning, removed words.rb (vocab is used)
+
+ * wmap & vocabulary, minor modifications, and runs metaverse
+
+ * minor pruning and renaming, small changes
+
+%% sisu_0.26.0.orig.tar.gz (2005w37/7 | 2005-09-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.26.0.orig.tar.gz
+ 4d1702c6cb8f162f4c7ece7a236148c6 3159698 sisu_0.26.0.orig.tar.gz
+ 99f922789101f388cf3a7562ec2953c5 9293 sisu_0.26.0-1.diff.gz
+
+ * sisu_webrick server no longer builds url paths with tilde prefix
+
+ * sysenv, and link urls updated accordingly
+
+ * sisu-examples, cgi sql search form, minor updates
+ sqlite sample set for webrick server defaults, port 8081, with url suffixes
+ pgsql sample set without (port is default port, and no url suffixes)
+
+ * sisu_webrick server defaults must be changed in rc files, rather than by
+ command-line parameters (reason, the rest of sisu would not see command
+ line parameter changes, and would continue to provide rc details)
+
+ * start enforcing lower case sisu markup tagging
+
+%% sisu_0.25.11.orig.tar.gz (2005w37/6 | 2005-09-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.11.orig.tar.gz
+ 5330033ca4c32a20424b212d5e15705e 3158745 sisu_0.25.11.orig.tar.gz
+ bdd533301ed392ec7c27f1e364dc8388 sisu_0.25.11-1.diff.gz
+
+ * cgi, cgi sql search form sample generator, link suffixes added
+
+ * cgi, cgi sql search form sample generator, -S takes additional parameter
+ webrick to provide port links that webrick server will use.
+
+ * sisu_webrick, -W does cgi form.
+
+ * sisu_skin & defaults, home page, adjustments
+
+ * html output (tune), fix image, no link where non provided, i.e. where the
+ { imagename.png }image notation is used
+
+ * html output (css & tune), image caption, smaller font
+
+ * configure, (-C & -CC) absence of trang is only reported
+ if -V (extra verbose) flag is used
+
+ * processing remote urls, (-C & -CC) absence of external_images is only
+ reported if -V (extra verbose), is used [re-test]
+
+ * man page, man sisu, updated to include "-S webrick"
+
+%% sisu_0.25.10.orig.tar.gz (2005w37/5 | 2005-09-15)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.10.orig.tar.gz
+ 1b7fa60d23869d33f5d918d5aa1cf424 3157417 sisu_0.25.10.orig.tar.gz
+ 9d4b75bde3f0f138d1e4d31b7964d374 9262 sisu_0.25.10-1.diff.gz
+
+ * urls, minor correction (maintenance mode output)
+
+ * man sisu(1) and sisu(8), minor edits
+
+ * minor code cleaning
+
+%% sisu_0.25.9.orig.tar.gz (2005w37/3 | 2005-09-14) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.9.orig.tar.gz
+ 48249bcd13900d9d68519585a3e825f6 3162000 sisu_0.25.9.orig.tar.gz
+ 2c74d1288dea0c604603185ae71a4421 9247 sisu_0.25.9-1.diff.gz
+
+ * latex/pdf, librmagick-ruby: will throw a warning and refuse to build
+ latex/pdf output for documents that are marked up without image dimensions,
+ that require the librmagick library. [librmagick-ruby is not "required" as
+ provided documents are marked up accordingly, it is never needed. As an
+ example first image markup form requires the library, the second does not:
+ { freeculture01.png }http://www.free-culture.cc/
+ {freeculture01.png 350x350 }http://www.free-culture.cc/
+
+ * man pages additions, mostly "man 8 sisu"
+
+%% sisu_0.25.8.orig.tar.gz (2005w37/3 | 2005-09-14) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.8.orig.tar.gz
+ bd8edf228360f3f3795812c93edfee19 3159743 sisu_0.25.8.orig.tar.gz
+ 17b662d3d2e7f1881c7eebecb6dca192 9232 sisu_0.25.8-1.diff.gz
+
+ * metaverse, default is to run metaverse wherever it may be required,
+ i.e. when any of - abDdeHhINptXxz
+
+ * plaintext, endnotes version (-e) sorted,
+ -a (footnotes following paragraphs) is ok
+ [however is currently an either or, both output plain.txt]
+
+ * texinfo, basic output working again (with pinfo).
+ [fix later, moving of & to <=and>]
+
+ * debian, recommends, added pinfo
+
+ * help, fix help on markup \ escape character (escaped)
+
+%% sisu_0.25.7.orig.tar.gz (2005w37/2 | 2005-09-13)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.7.orig.tar.gz
+ b86531a1788f6bce8e81328760801fa3 3158773 sisu_0.25.7.orig.tar.gz
+ a2824de38545b6695eb06ea35bb73fea 9207 sisu_0.25.7-1.diff.gz
+
+ * metaverse, possibility to escape backslash (\\ to produce \) [Special
+ character escape set near complete for regular text, verify situation for
+ code blocks (code{) where characters should be treated verbatim].
+
+ * metaverse, markup, test and addition of possibility to escape contextual
+ special characters, such as asterisk (*) and exclamation mark (!), which
+ are not normally a special characters that need to be escaped, but the
+ ability to do so is useful where for example used to describe their markup
+ function as in \*{bold}* \!{emphasis}! verified others used in a similar
+ way (*!/_\^,+), either already available or also added \/{italicise}/
+ \_{underscore}_ \^{superscript}\^~{ note that the caret (\^) is a special
+ character that must always be escaped, unlike the other characters
+ described here which are contextual }~ \,{subscript}, \+{inserted}+
+ \-{strikethrough}-
+
+ * man page and help, comments added on escaping special characters and
+ headers
+
+ [extensive testing escaping the full range of special characters is necessary
+ these include \\ \< \> \{ \} and the contextual * ! / _ \^ , + ]
+
+%% sisu_0.25.6.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.6.orig.tar.gz
+ c0b6aa1a71a4d139d65c43fb2d21b8b0 3156969 sisu_0.25.6.orig.tar.gz
+ 283c663e1b3e7803217d80709dcc7b73 9186 sisu_0.25.6-1.diff.gz
+
+ * metaverse, cosmetic corrections related to bold, italics and punctuation
+
+ * metaverse, and add a few language settings
+
+ * latex/pdf start looking at language settings, set language selected for
+ document \documentclass \usepackage \selectlanguage
+
+ * latex/pdf creator copymark turned off by adding minus sign to creator
+ header, as in 0~creator- [name of author]
+
+ * man pages, help files updated on language settings
+
+ * copyright SiSU system, object numbering etc. in pdfs, (reduced font size &
+ words from previous Debian release, [a bit more than in 0.25.5])
+
+%% sisu_0.25.5.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.5.orig.tar.gz
+ dadf9ffb77c629189be5f08345f451cf 3154083 sisu_0.25.5.orig.tar.gz
+ 7749d8a2a4ed73e9f0d85e5fae5d9027 9178 sisu_0.25.5-1.diff.gz
+
+ * latex/pdf cosmetic reduced size of font related to document
+ processing information.
+
+%% sisu_0.25.4.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.4.orig.tar.gz
+ b2bd5bd90ebb3af821f7b60a03cfecaa 3153879 sisu_0.25.4.orig.tar.gz
+ 894ed52890f238a8feab48e80e86aae8 9166 sisu_0.25.4-1.diff.gz
+
+ * metaverse, fix related to 0.25.3 (interaction between operation of
+ bold lines and bold words selected in header).
+
+%% sisu_0.25.3.orig.tar.gz (2005w37/1 | 2005-09-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.3.orig.tar.gz
+ 079f2c259f8de88e48ce16a6b0eed242 3153671 sisu_0.25.3.orig.tar.gz
+ 1388f9f6183f76b49aa52ccef26bc5bc 9153 sisu_0.25.3-1.diff.gz
+
+ * metaverse, subtle correction todo with interaction between operation of
+ bold lines and bold words selected in header.
+
+ * changes to text accompanying latex/pdfs, toning down of language,
+ correction of gpl2 url to fsf.org rather than gnu.org
+
+%% sisu_0.25.2.orig.tar.gz (2005w36/6 | 2005-09-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.2.orig.tar.gz
+ de5b7c20ec8e793d131c0f7665a1447a 3153602 sisu_0.25.2.orig.tar.gz
+ e46bcf337617273e1ef715010c0a7542 9134 sisu_0.25.2-1.diff.gz
+
+ * latex/pdf fix, produce text without object numbers
+ (problem with documents including grouped text markers, poem{ etc.)
+ fix affects processing with the -0 flag (zero), e.g.
+ sisu -mHp0v [filename].s3
+
+%% sisu_0.25.1.orig.tar.gz (2005w36/6 | 2005-09-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.1.orig.tar.gz
+ a82d3a227babf3bc1a6660fafba17ecc 3153326 sisu_0.25.1.orig.tar.gz
+ 5df9ff95789c457566e0fc822449f1ef 9122 sisu_0.25.1-1.diff.gz
+
+ * cgi search for generator: fix, removal of an errant line of code
+ (removal of hardlink to version number)
+ fix affects
+ sisu -S
+
+%% sisu_0.25.0.orig.tar.gz (2005w36/6 | 2005-09-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.25.0.orig.tar.gz
+ 15d88f5a33da7f3cb427e5a8a0dae573 3153121 sisu_0.25.0.orig.tar.gz
+ a191b69a92500d8880b764b6c33a4957 9111 sisu_0.25.0-1.diff.gz
+
+ * db/sql: changes to database table names, cleaner
+
+ * db/sql/search: cgi search examples and cgi search sample generator modified
+ accordingly
+
+ * db/sql: recreate, creates if no existing database, instead of complaining
+ (createall complains if database exists - you may not wish to remove
+ existing)
+
+ * db/sql: replaced oid table with links table, and provide links to output files,
+ affects both pgsql and sqlite
+
+
+%% sisu_0.24.2.orig.tar.gz (2005w36/5 | 2005-09-09)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.2.orig.tar.gz
+ 924f791aa2ab18e3917451ff09183a3b 3152290 sisu_0.24.2.orig.tar.gz
+ cbbfdde8fd261b1bfdd47f633c895222 9093 sisu_0.24.2-1.diff.gz
+
+ * character encoding, existing table hash replaced with a KirbyBase table
+ character encoding lib is not currently used by sisu,
+ (& KirbyBase is not included with sisu), for what it is see
+ http://www.netpromi.com/kirbybase_ruby.html )
+ hoever, this is a possible way forward should such a table be needed
+
+%% sisu_0.24.1.orig.tar.gz (2005w36/4 | 2005-09-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.1.orig.tar.gz
+ 328d2c858900bca8594aaf9fdad48687 3154040 sisu_0.24.1.orig.tar.gz
+ 2a8e982a69c58ea39a82c3c1e849fcc3 9083 sisu_0.24.1-1.diff.gz
+
+ * latex/pdf fix: tilde may be printed if marked up as escaped character
+ has been a problem, (revisit, refactor what is done with tilde)
+
+ * escaping sisu special characters a bit of work done, html latex/pdf
+ done { } ~ < > _ - / # | : ! ^ examine need for others such as *
+
+ * latex/pdf, also html, bugfix, a bit of work on escaping of sisu special
+ characters, html latex/pdf, done \{ \} \~ \< \> \&. Several characters are
+ only special characters in given particular locations or combinations, these
+ should be escapable in any event. Further testing and work necessary, hash
+ is still a problem. { } ~ < > _ - / & | : ! ^ #
+
+ * metaverse_syntax, in code mode special characters should not be escaped
+
+ code{
+
+ { } ~ < > _ - / & | : ! ^ #
+ $ & @ *
+
+ }code
+
+ test more extensively, and correct over time. Note that the hash is for the
+ moment a problem (in latex/pdf)
+
+ * latex/pdf and other files make sure headers are only given special
+ treatment if at start of text, i.e. if actually headers, so can have a
+ description of a header within text like 0\~level new=1,2,3; break=4
+
+%% sisu_0.24.0.orig.tar.gz (2005w36/3 | 2005-09-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.24.0.orig.tar.gz
+ 2270344926ff777132f50dbba0270c11 3153987 sisu_0.24.0.orig.tar.gz
+ f0bc72f3a3f07984113d7dd21ba7afae 9071 sisu_0.24.0-1.diff.gz
+
+ * pdf page breaks, accepts header notation:
+ 0~level new=1,2,3; break=4
+
+ * html fix to links band -H added .html to home url, removed
+
+ * metaverse_syntax, adjustment to lines parsed, (result affects some endnotes)
+
+ * plaintext small fix &amp; is &
+
+ * minor touches to documentation
+
+ * tested supported encodings utf8 and iso8859
+
+ % sisu_0.23.1.orig.tar.gz (2005w36/3 | 2005-09-07)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.23.1.orig.tar.gz
+ 6182d22f7f4e00a3f224a5362717431a 3151165 sisu_0.23.1.orig.tar.gz
+ 6a52b9dd5ce21d46cf365da088d1f334 9063 sisu_0.23.1-1.diff.gz
+
+ * fix to the still very naive sqlite search cgi example for sqlite
+
+ * sisu -S will generate a copy of the naive sqlite and pgsql cgi search form
+ it then needs to be copied to the cgi-bin directory. It differs from the
+ example given in that it looks at output directories and includes them as
+ database options. It is more accurate on sqlite, checking that a database
+ exists, however both forms in their current form leave a lot to be desired.
+
+ * url to location of sqlite database
+
+ * latex/pdf cosmetic fix to front page removed angle brackets
+ << [location] >> appeared incorrectly, and looks cleaner without
+
+ % sisu_0.23.0.orig.tar.gz (2005w36/2 | 2005-09-06)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.23.0.orig.tar.gz
+ 4e8c4fd6e8d377d4e5af7145c37ac99a 3131414 sisu_0.23.0.orig.tar.gz
+ f7e8ecb953b39ae45772130d54b158b3 9020 sisu_0.23.0-1.diff.gz
+
+ * texpdf, utf8 added properly by way of ucs package (now requires latex-ucs)
+ breaks some things but in the long run is hopefully an improvement
+ currently supported encodings utf8 and iso8859.
+
+ Resulting in out of the box improved Iñtërnâtiônàlizætiøn a slightly more
+ extended character set, using utf-8, [ tested so far on LaTeX / pdf output,
+ line-breaking is not perfect ] ! # $ % & \ () * + , - . / ' 1 2 3 4 5 6 7
+ 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]
+ … † ‡ < - ~ t ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ' µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å
+ æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+
+ * character encoding, utf-8 improved basic table, not yet utilised though,
+ [and even as a small utf-8 table is on the large side]
+
+ * minor code play with output (webserve) path
+
+ * sqlite db output mapped to webserve path, current directory stub
+ [instead of being deposited in pwd]
+
+ * very naive sqlite search cgi example for sqlite
+
+ * metaverse, changes to automatic naming of levels 5 & 6
+ same methods used as has been for level 4, could possibly clash at times
+ with level 4 in doc version consider implications [easy to attach somthing
+ to level 5 & 6 names]
+
+ * document digest in document information by default
+ (previously only when cvs info also selected)
+
+ * loading of skins for inserts
+
+%% sisu_0.22.1.orig.tar.gz (2005w35/4 | 2005-09-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.22.1.orig.tar.gz
+ bd05b8766c923fefe62194ccfb851e40 3106333 sisu_0.22.1.orig.tar.gz
+ a3c3f1369d34c477db9422de98ed7306 8955 sisu_0.22.1-1.diff.gz
+
+ * metaverse, regex fix for bold line syntax (^!_)
+
+ * latex/pdf, placement of object numbers re-sorted,
+ an inelegant fix, revisit later.
+
+%% sisu_0.22.0.orig.tar.gz (2005w35/3 | 2005-08-31)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.22.0.orig.tar.gz
+ 7a9d78e29a2809767f5510ec8958155d 3105938 sisu_0.22.0.orig.tar.gz
+ 9b7babcf4278dc69a94ec7b9f00609e0 8936 sisu_0.22.0-1.diff.gz
+
+ * sysenv, option to check load path and only load module if available reduce
+ dependency on other packages, introduced for rmagick and now used also for
+ dbi.
+
+ * rmagick if installed can be used to calculate image dimensions, so these
+ need not be provided in markup.
+
+ * sql database operations only attempted if dbi is loaded(/available for
+ loading)
+
+ * texpdf, used parskip and removed use of smallskip from latex output
+ (& other minor edits)
+
+ * FSF address updated:
+ Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ [from: 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]
+
+%% sisu_0.21.2.orig.tar.gz (2005w34/7 | 2005-08-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.21.2.orig.tar.gz
+ b6deafd5e3627851a11b3865c7b54a36 3104604 sisu_0.21.2.orig.tar.gz
+ db780c3273a6a6dd3b488dc1ee70cf82 8882 sisu_0.21.2-1.diff.gz
+
+ * sisu-examples sisu_search.cgi sample correction
+
+%% sisu_0.21.1.orig.tar.gz (2005w34/7 | 2005-08-28)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.21.1.orig.tar.gz
+ df503b6de6a98cca07c010ead14c8083 3104417 sisu_0.21.1.orig.tar.gz
+ 4ce92696c4eb3c87434ea6c3984f3054 8870 sisu_0.21.1-1.diff.gz
+
+ * debian Sources.gz
+
+ * minor code edits
+
+%% sisu_0.21.0.orig.tar.gz (2005w34/7 | 2005-08-28) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.21.0.orig.tar.gz
+ 095879ae2f0784868b9506eb09012b41 3105687 sisu_0.21.0.orig.tar.gz
+ 5d0274cb2a1f0e88c22c78d03dd869da 8852 sisu_0.21.0-1.diff.gz
+
+ * changes to file structure for processing and provided images
+ now placed under the markup directory in _sisu
+ ./_sisu/processing [built by sisu] unless ./ is not writable
+ then /tmp/sisu_processing
+ ./_sisu/image [added to manually]
+ ./_sisu/config [precedence: ./_sisu/config ~/.sisu /etc/sisu]
+
+ * skin fix reading and precedence
+ [uses ./_sisu/config/skin ~/.sisu/skin /etc/sisu/skin
+ ./_sisu/processing/external_document/skin]
+
+ * external documents, provide similar logic
+ placed in ./_sisu/processing/external_document/{image,config}
+ this should mean that along external documents are downloaded
+ together with their skins and images and processed as a unit
+
+ * changed a couple of search path statements (skin,sisurc) to use blocks.
+
+ * sisu manpage updated to take account of changes (help not yet)
+
+%% sisu_0.20.9.orig.tar.gz (2005w34/5 | 2005-08-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.9.orig.tar.gz
+ 0f267a8fb912193b3714ea573ccaefea 3090429 sisu_0.20.9.orig.tar.gz
+ 8b46fe8954ebdfaa89c5ecb608771b6a 8832 sisu_0.20.9-1.diff.gz
+
+ * merged/rearranged (and renamed Postgresql and Sqlite classes).
+ Now SiSU_SQL (avoid possibility of namespace clashes).
+
+ * plaintext, xml (sax & dom), xhtml, run on a new file creates required
+ output sub-directory, it was relying on other selections for directory
+ creation [thought done previously] affects flags -a -x -X -b
+
+%% sisu_0.20.8.orig.tar.gz (2005w34/4 | 2005-08-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.8.orig.tar.gz
+ 2fee766bb3079d7f955dbeb8c7e1c9dd 3089931 sisu_0.20.8.orig.tar.gz
+ 6505b8ad8e6ccdc73676a61b25a466a2 8815 sisu_0.20.8-1.diff.gz
+
+ * minor database rationalisation,
+ postgresql & sqlite logic in same files
+ [additional testing required]
+
+%% sisu_0.20.7.orig.tar.gz (2005w34/3 | 2005-08-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.7.orig.tar.gz
+ 1fe53caf785a25d4a59ffb05e7c9c3aa 3098483 sisu_0.20.7.orig.tar.gz
+ 914f8a07adb73f761c42e4c914abd3b2 8799 sisu_0.20.7-1.diff.gz
+
+ * added metadata categories (to the Dublin Core 15) added the following metatags, which seemed appropriate/useful:
+ translator (or translated_by)
+ illustrator (or illustrated_by)
+ prepared_by
+ digitized_by
+ (added to parameters, metaverse, sql databases)
+
+ * note in man pages and help about sisu markup files being in
+ UNIX ASCII
+
+ * vim auto-conversion to UNIX ASCII for sisu markup files
+ (sisu parses unix ascii, not dos ascii ... consider further,
+ an issue for example with many(most/all?) Project Gutenberg texts)
+
+%% sisu_0.20.6.orig.tar.gz (2005w34/1 | 2005-08-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.6.orig.tar.gz
+ 8e50493f947b6c1e0ed77bb1fb4e8ede 3096291 sisu_0.20.6.orig.tar.gz
+ 0636fedf8a38e0cb62dbdf7c0ad9397f 8778 sisu_0.20.6-1.diff.gz
+
+ * (composite) fix for new header links where linbreak used
+ and imported into composite document, result in .t? suffix
+
+ * (sisu_search.cgi) sample search form, minor fixes &
+ improvements, still a mess
+
+%% sisu_0.20.5.orig.tar.gz (2005w33/5 | 2005-08-19)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.5.orig.tar.gz
+ 1df854fd95731c9272c89c62b06ce70a 3095741 sisu_0.20.5.orig.tar.gz
+ 31d98e13292c9ab21b77f77bd4e769df 8763 sisu_0.20.5-1.diff.gz
+
+ * fix for old style header links, (broken in 0.20.4 with
+ introduction of new)
+
+%% sisu_0.20.4.orig.tar.gz (2005w33/4 | 2005-08-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.4.orig.tar.gz
+ c65c974dbdef638014c578c8a06d4560 3095378 sisu_0.20.4.orig.tar.gz
+ bca68a13d322deee67a4e20730c55acb 8741 sisu_0.20.4-1.diff.gz
+
+ * (param) header links notation made similar to links within text
+ old markup syntax remains possible, (i.e. backward compatibility kept)
+ [should possibly force version number change to 0.21 but is minor change]
+
+ * small touch to sisu vim syntax file, remove false positive error
+ highlighting for alternative links markup
+
+ * touch to remove relevance of whitespace in image markup
+ (previously a problem in composite texts for latex/pdf output)
+
+ * (metaverse for html) touch, whitespace reintroduced where name is given to
+ an object as easy solution to interference that may otherwise arise with
+ urls
+
+ * html touch whitespace reintroduced where name is given to an object
+ as easy solution to interference that may otherwise arise with urls
+
+ * ruby-libyaml removed from debian control,
+ [a DD had informed me that he had neeeded it early in packaging days he
+ must have been working with a version of ruby older than sisu is written
+ for]
+
+%% sisu_0.20.3.orig.tar.gz (2005w32/7 | 2005-08-14) [Debian Release snapshot, uploaded by Wookey]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.3.orig.tar.gz
+ 0a1b40b4c00ab6a7b4c9528b0664cba5 3094654 sisu_0.20.3.orig.tar.gz
+ aea0778abd99cd1f301d059fe83c81e4 8653 sisu_0.20.3-1.diff.gz
+
+ * fix sisu -CC removed attempt to create pg db
+ (this is done rather on -D createall request if does not exist)
+
+%% sisu_0.20.2.orig.tar.gz (2005w32/7 | 2005-08-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.2.orig.tar.gz
+ 56c7a77c9a78f12cd132e06234ded543 3094356 sisu_0.20.2.orig.tar.gz
+ 774b095fc376f4decde435fd6d32fbc2 8631 sisu_0.20.2-1.diff.gz
+
+ * sisu_vim manpage
+
+ * latex/pdf monospace font (ttfamily) where code{ }code is used
+
+ * html monospace font where code{ }code is used
+
+ * rescue and attempt to create pg db only if db of pg type requested
+
+ * a rule for stripping deleted text from clean text md5 digest introcued
+
+ * debian signing of package against ralph@amissah.com
+
+%% sisu_0.20.1.orig.tar.gz (2005w32/5 | 2005-08-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.1.orig.tar.gz
+ 1cdbe3739722c877af1095135a7a6f9e 3089912 sisu_0.20.1.orig.tar.gz
+ 90e8a6ac6a1c868d8f7138c8974b2611 8588 sisu_0.20.1-1.diff.gz
+
+ * console output XML clutter reduced,
+ REXML parsed headers now only produced for -V not -v
+
+ * debian package, started signing dsc and changes file
+ both email addresses ralph@amissah.com and ralph.amissah@gmail.com
+ on ring, singing ended up being done against latter,
+ the former being what debian knows me as, correct on next signing
+
+ Key fingerprint = F899 5A87 C648 3F38 5107 79F1 B97B 7C4D BD76 E77F
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.1 (GNU/Linux)
+
+mQGiBEL8fs4RBADNNhIsG6i13rDL4JLTgqy0fzcx8oJ9E/xDKeQo/5pqs18FvyKo
+VsHdkUrPptZgxowalPi2aWvZgdi56yUFt295pNedMNXfTnwkVF/9PSA3r4OTBFWw
+7NJYRUu2ZaSqtj3LpnBhsPpDqcl2g5Mry88mMLUeWB9OtsZE/QFVnoJqawCg4QSY
+IOtgdxZVJfibHbFA0/2iG3cD/A98l/BuRWF+kwNacj1q+D0glC/u9mvg56fnAzTL
+Osbhza/ebqvPgtFpP4PlIuvTcRZ9QsSJgmCTxNRPSKWPGqDmj7B7MDcPKUyJAPKB
+fSLm5v5BuKTCLl9jyihbOqIdTgF1hoBHxTyfYWpVVuhdFP1kahityDNGpRhSfTif
+doDLBACkB090RwyYBR589CMjF4miOo5m29ooQZO3tkR+6w5ny81H+qIHVx3TQZa9
+d2166YcxMOFLh2mXBcVNsF8gQpv8Otk+Oyu5FFKqJiGV6JkEPf/W+iXMdpvTrxtc
+rmU8cKagKxxBjue8PlI6bGusEjJXgmsTwOZB5WxCW4QQs49VoLQhUmFscGggQW1p
+c3NhaCA8cmFscGhAYW1pc3NhaC5jb20+iGQEExECACQFAkL8fs4CGwMFCQPCZwAG
+CwkIBwMCAxUCAwMWAgECHgECF4AACgkQuXt8Tb1253+R+gCg3KfzSGEmdWf01ryr
+QLm35LutXS8AoNVfXb3OB1BMph6bOSNJpIyZAOgstCdSYWxwaCBBbWlzc2FoIDxy
+YWxwaC5hbWlzc2FoQGdtYWlsLmNvbT6IZAQTEQIAJAUCQvyEaAIbAwUJA8JnAAYL
+CQgHAwIDFQIDAxYCAQIeAQIXgAAKCRC5e3xNvXbnf12SAJ44Tuntdnqv7lAGgRes
+KMFbHSt3YgCgjXkkHqY167kvDWmxrdAfupv7Ad65Ag0EQvx+2RAIAL23ShZnJJi/
+1un84eoUoQ/AaXmGAhYjVlYiJzMjTXBygS12TnpNkqibnnIqbn/6v1WFIgZNRhzS
+GzKo//MYtORdhB25UYe0YeOhZhyABLNSFKCye1ACBfDpJAFzc+kh7GjA1k2hnDsn
+zox49eJyubO1FxiXXYrKaSMOGkuhp/JaLEVHZZyY++Zq0TuS8t3bOmNkUbL5X5oZ
+n600yZzNfdQ8/5LjwIUvY9BDR+tHyypGyegDDmS5BVEjmW2d9ujDbVYRY6twA0q6
+6WSx2WqT/HzdvSirEiPp3ENwQAaTnGT0G5q2zmYtutb9Yd/V/5aQBMEkAXF/JT4H
+uw5ad3C6xNcAAwUH/jmC7wmvfA6Dqh9TfqDux9LzWbIny0NsgYTsE2Bkhg8kuHgb
+PeqpOeJRFYxQkhknzW1PZZVwtxmfFgWgvukW4fqGSPWSpWDaYL91zkx2HRMBG1Nb
+YwqNOLQnolRE9z/42b/M4oyIWhd0WTi6tZt5pMvpW5Dn7tOsnU3PlNM3AAv3Bjp9
+QBki1KRjZC7PdKnQa9KSwvr4hgvvBlT4Is9131vmAZhu41Ni8UORmoq5e/lqd5O/
+0QuySo+ZJEyLQuulfK19NPALZM+fu6/3dUHAu4D27MafYdQNqY3Xks4mquQ2p95k
+OhNer8Yu7SSyBCIO/8V71UhkgyUdG7fMl0BzqPmITwQYEQIADwUCQvx+2QIbDAUJ
+A8JnAAAKCRC5e3xNvXbnfzpwAJ0ZKPoWuWrx8K/zGSIRRj7ZRbf6KgCgji13BXoF
+tJaIUHauen7hNIoUQXo=
+=6US6
+-----END PGP PUBLIC KEY BLOCK-----
+
+%% sisu_0.20.0.orig.tar.gz (2005w32/4 | 2005-08-11)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.20.0.orig.tar.gz
+ 0c0c5ef53a3dd85fcaf5912a971c3b26 3089497 sisu_0.20.0.orig.tar.gz
+ 741731b3d842820cb2b427fdf1197e4a 8517 sisu_0.20.0-1.diff.gz
+ 0b1ea809280f45b293cb5a9ea9453b49 8551 sisu_0.20.0-2.diff.gz
+
+ * remap sisu psql database names to SiSU_[directory name stub]
+ instead of just [directory name stub] as this will make name collisions
+ (and accidents) with other databases, when using SiSU to creating, deleting
+ and recreating databases much less likely happening to other databases far
+ less likely. [renaming means databases need rebuilding for use]
+
+ * (psql) have made postgresql >=8.0 the default requirement. An issue
+ showed up with sisu & postgresql 7 series and UNICODE sequences used, as
+ sisu as released is fairly new there is little incentive to maintain it
+ [however, problem would seem to indicate a lot of bug testing is required,
+ i am currently using UTF-8 locale (en_GB.UTF-8)]
+ [corrected to postgresql >=8.0.0; but is currently named posgreql-8.0]
+
+ * cgi script example updated to match SiSU_[directory name stub] convention
+ and to default to search of sisu-examples as this is a standard/common
+ directory anyone might generate (or rather ./document_samples_sisu_markup)
+
+%% sisu_0.18.8.orig.tar.gz (2005w32/3 | 2005-08-10)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.8.orig.tar.gz
+ aa7e128202d4e60dfa9b328888406a3d 3087797 sisu_0.18.8.orig.tar.gz
+ 262edbc6bcd7b29cf70d8f3b0fd1a9cf 8404 sisu_0.18.8-1.diff.gz
+
+ * (webrick url) console display of output text default to webrick url
+ (can be switched off in sisurc.yaml, by setting
+ webserve,webrick_url: false)
+ however this assumes people know to start sisu_webrick
+ (it is a toss-up between advertising webrick's availability,
+ and sticking with filesystem paths as default, may have
+ to revert) have thought of tying webrick url output to
+ starting sisu_webrick automatically, would need to look at
+ log files and get logging off the console, else would disturb
+ other sisu console output
+ [a problem appears to be that in some browsers old cached pdf
+ is served when requested, so changes made in subsequent document
+ generation may not be displayed, consider implications]
+
+ * sisu_webrick port sysenv default set back to 8081
+ (instead of 8111, consider 8123)
+
+ * use createdb to attempt to create relevant pgsql database
+ (using stub of directory name; uses a system command and assumes user has
+ permission to create db, if user does not, and the database does not exist,
+ would not be able to proceed anyway)
+
+ * inelegant handling of "" image bug (no image) that appears
+ in a test document.
+
+ * a few urls shortend back to http://www.jus.uio.no/sisu
+ from http://www.jus.uio.no/sisu/SiSU in defaults
+
+ * minor touch to man page and help
+
+%% sisu_0.18.7.orig.tar.gz (2005w32/2 | 2005-08-09) [Debian Release snapshot, uploaded by Joachim Breitner]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.7.orig.tar.gz
+ ace9eb421e31f7d3f1d12ba29b00baaf 3086170 sisu_0.18.7.orig.tar.gz
+ 3530196ebba2260a60bfe885ee536731 8393 sisu_0.18.7-1.diff.gz
+
+ * some license clean up, gpl2 or later (appearing in pdf text output),
+ removed sentences referring to alternative, somehow missed in previous
+ grand cleanup sisu_0.16.24 where all document headers were cleaned, and the
+ rest i thought [apologies 0.18.7 was rebuilt to include this change, they
+ occurred in the file defaults.rb and texpdf_format.rb].
+
+ * fix -N md5 digests batch mode, garbage cleaning
+
+ * fix -N remote placement (revisit remote placement)
+
+ * sequence digests if requested follow on directly after metaverse -mN...
+
+ * html and latex/pdf so far, continue tradition of assuming that a comma (,)
+ or full stop (.) following a url is part of a sentence, i.e. if a url
+ actually is terminated by a comma or a dot are not parsed correctly, is
+ extremely convenient, consider implications though, may need to change.
+ {~^ this ends the sentence }http://www.url. (this would also {~^ end the
+ sentence. }http://www.url and as before the comma and stop attached to
+ these urls are part of the sentences punctuation http://www.url,
+ http://www.url.)
+
+%% sisu_0.18.6.orig.tar.gz (2005w32/1 | 2005-08-08)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.6.orig.tar.gz
+ 0687159545781ee1caeb802fd6da9ecf 3085058 sisu_0.18.6.orig.tar.gz
+ 096c5f256ecc1b38642186822c55f137 8377 sisu_0.18.6-1.diff.gz
+
+ * fixed metadata (metaverse) sourcefilename (where rc not used)
+
+ * fixed digest tree where image not found
+
+ * defaults for shortcut flags (-1v -3v etc.) set to
+ create the digest tree (-N)
+ and to include filetype suffix (-H) as this works with webrick
+ (sisu_webrick)
+
+ * jpg image support consistently added (to existing png & jpg) gif
+ consistently removed as on cursory glance does not appear to be
+ supported by tetex, trivial to add later
+
+ man page and help mention of verbose screen output of digest tree
+
+%% sisu_0.18.5.orig.tar.gz (2005w31/6 | 2005-08-06)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.5.orig.tar.gz
+ e41ba898a4514b8f951015df3a30e3e2 3084020 sisu_0.18.5.orig.tar.gz
+ 4120df15adf03f14bb58d7fba068c27c 8359 sisu_0.18.5-1.diff.gz
+
+ * bugfix output paths, may change again, currently the default
+ if writable is /var/www/sisu (and if no ~/sisu_www)
+ (in previous version wrote to /var/sisu/www/sisu if writable
+ too idiosyncratic a solution)
+
+ * bugfix image markup where url not used
+ {imagename.png}image working for html and pdf again
+ {imagename.png}image fix also for pdf
+
+%% sisu_0.18.4.orig.tar.gz (2005w30/2 | 2005-07-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.4.orig.tar.gz
+ 9ee3ba3a68640e060a92beb1ffd4351a 3081850 sisu_0.18.4.orig.tar.gz
+ 3fabff77f7a9db7e8c47ffa6d01c5bc0 8344 sisu_0.18.4-1.diff.gz
+
+ * detailed document md5 digest output as digest.txt generated with -N flag
+ [decide whether to:
+ keep multiple document digest versions; and
+ whether to link to html or databse
+ (at some stage add digest names to html generated)]
+
+ * added -N flag (document digests) to man pages and help
+
+ * replaced uses of include? with plain regex (some vague recollection of
+ rumours of depreciation in future ruby)... no rush, perhaps should have
+ waited
+
+ * (re)moved use of -o flag from old table based html
+
+%% sisu_0.18.3.orig.tar.gz (2005w30/2 | 2005-07-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.3.orig.tar.gz
+ 76b9a55723151f7dd08437fb9a604813 3079656 sisu_0.18.3.orig.tar.gz
+ d6ce0c7986a47436843d3a36ba000822 8322 sisu_0.18.3-1.diff.gz
+
+ * digests on clean text, rule... revisit, but body and endnotes treated "same"
+
+ * tmp fix for special image characters, (e.g. Euro and Copyleft) tmp because
+ image is taken from local directory images where ought to be taken from
+ general image set, revisit.
+
+%% sisu_0.18.2.orig.tar.gz (2005w30/1 | 2005-07-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.2.orig.tar.gz
+ cbb34fcf021158193c6e6f366ae9e645 3077824 sisu_0.18.2.orig.tar.gz
+ 35ac35ae6872d923c3704c45aae867f4 8306 sisu_0.18.2-1.diff.gz
+
+ * document meta_data, version information re-organization
+
+ * texinfo cursory look, initial 0.18 fix
+
+ * db pg/sqlite md5_all fix for level 4
+
+ * dbi_unicode unused, and removed, (common_db used)
+
+%% sisu_0.18.1.orig.tar.gz (2005w29/0 | 2005-07-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.1.orig.tar.gz
+ 030ba198b242541bd261ec5fb0776b0a 3086052 sisu_0.18.1.orig.tar.gz
+ 6cd8c2b571c485edbe77946fe7245a14 8301 sisu_0.18.1-1.diff.gz
+
+ * latex/pdf, tmp bugfix, substitute & with 'and' in toc,
+ needed e.g. for AT&T, see ffa, REVISIT
+
+ * a bit of play with texinfo module, but (still) broken
+ (in 0.18) until tested
+
+ * some writing in man pages
+
+%% sisu_0.18.0.orig.tar.gz (2005w29/5 | 2005-07-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.18.0.orig.tar.gz
+ ff45f2bca98b6e8fbae0714684576571 3086151 sisu_0.18.0.orig.tar.gz
+ 9f0cf2ca1b6e02aea52f9dd22e51c32d 8268 sisu_0.18.0-1.diff.gz
+
+ Development branch 0.17 (opened 2005-07-14)
+ rolled back into main as 0.18:
+
+ sisu_0.17.5.orig.tar.gz (2005w29/5 | 2005-07-22)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.5.orig.tar.gz
+ 23e3b01175d55e815933881fcfe415c5 3085611 sisu_0.17.5.orig.tar.gz
+ 41e800763be26bb37a8f1901a05bff08 8570 sisu_0.17.5-1.diff.gz
+
+ * plaintext linebreaks in endnotes <br />
+
+ * xml series, branch-fix todo with tables (common_xml)
+
+ * html endnote section branch-fix
+
+ sisu_0.17.4.orig.tar.gz (2005w29/4 | 2005-07-21)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.4.orig.tar.gz
+ 23bef7ae21ac0b65cb7b27c049f3ea15 3085478 sisu_0.17.4.orig.tar.gz
+ 6542bc3d7f65440f02834de6141e74dd 8553 sisu_0.17.4-1.diff.gz
+
+ * url maintenance mode, minor fix
+
+ * small fixes to latex pdf mostly todo with & character
+
+ sisu_0.17.3.orig.tar.gz (2005w29/3 | 2005-07-20)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.3.orig.tar.gz
+ 086b054dba3ee8837406157c74062252 3084736 sisu_0.17.3.orig.tar.gz
+ 3029bdb8375586b57cec9997578d8f98 8535 sisu_0.17.3-1.diff.gz
+
+ * md5 into postgresql and sqlite modules, (including endnotes clean md5
+ digest)
+
+ * Implemented, but need to be consistent about content of paragraphs on which
+ md5 digest is made:
+
+ 1. clean/stripped text without any markup, paragraph, headings etc. without
+ endnotes
+
+ 2. endnotes clean/stripped text digest only (there may be several endnotes
+ within a paragraph)
+
+ 3. whole object, text with markup and any endnotes, (question: with or
+ without the endnote digests??? presumption better without, [however may be
+ easier to check with?])
+
+ * some renaming in db modules
+
+ [deleted accidentally and rebuilt]
+
+ sisu_0.17.2.orig.tar.gz (2005w28/5 | 2005-07-15)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.2.orig.tar.gz
+ dab5f72a55e525e3f2bac4053db57c6a 3083022 sisu_0.17.2.orig.tar.gz
+ 4fad5f499da1d26d89070ce1cb26ad8d 8512 sisu_0.17.2-1.diff.gz
+
+ * change in metaverse representation of md5 hashes
+
+ * cleaning up of output after introduction of md5 digests
+
+ sisu_0.17.1.orig.tar.gz (2005w28/5 | 2005-07-15)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.1.orig.tar.gz
+ ed3301693f3a86535b6d7c1595c1afdf 3082665 sisu_0.17.1.orig.tar.gz
+ a3bf9b7198544ae341e0c4b397b185fd 8467 sisu_0.17.1-1.diff.gz
+
+ * arrangement of md5s
+
+ sisu_0.17.1.orig.tar.gz (2005w28/5 | 2005-07-15)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.1.orig.tar.gz
+ *** sisu_0.17.1.orig.tar.gz
+ *** sisu_0.17.1-1.diff.gz
+
+ * todo with use of dev branch and being 0.17 rather than 0.16
+
+ sisu_0.17.0.orig.tar.gz (2005w28/4 | 2005-07-14)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.17.0.orig.tar.gz
+ MD5(sisu_0.17.0.orig.tar.gz)= 46d56d54e6040170cbaad77f6764e2ca
+
+ * incorporated two md5 digests for each object, available for use
+ downstream as desired
+
+%% sisu_0.16.26.orig.tar.gz (2005w28/6 | 2005-07-16)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.26.orig.tar.gz
+ *** sisu_0.16.26.orig.tar.gz
+ *** sisu_0.16.26-1.diff.gz
+
+* LaTeX output remove individual /parindent placed in header
+
+%% sisu_0.16.25.orig.tar.gz (2005w28/6 | 2005-07-16) [First Debian Release, uploaded by Gunnar Wolf]
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.25.orig.tar.gz
+ *** sisu_0.16.25.orig.tar.gz
+ *** sisu_0.16.25-1.diff.gz
+
+ * sisu-examples, Free as in Freedom ... minor touch,
+ previous markup broken, will check later
+
+%% sisu_0.16.24.orig.tar.gz (2005w28/2 | 2005-07-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.24.orig.tar.gz
+ 2072677c897ffa9c677b2b4760003396 3081483 sisu_0.16.24.orig.tar.gz
+ 2879560a1af4f0dc27670f519cf5bd94 8211 sisu_0.16.24-1.diff.gz
+
+ * copyright string made more clear as 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005 ... only question being whether it should not have been
+ 1996.
+
+%% sisu_0.16.23.orig.tar.gz (2005w28/2 | 2005-07-12)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.23.orig.tar.gz
+ db0052818b106e0d4c47d8039bdb8497 3081204 sisu_0.16.23.orig.tar.gz
+ f77bab59f3eb7db8ae249411f1685292 8114 sisu_0.16.23-1.diff.gz
+
+ * copyright headers changed within files for Debian
+
+ * some changes in use of ocn for segment naming in html output
+
+ * a couple of postgresql fileds changed to text
+
+ * using Rant 4.0 for package build and install(er)
+
+ * cosmetic rearrangement of code
+
+%% sisu_0.16.22.orig.tar.gz (2005w27/4 | 2005-07-07)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.22.orig.tar.gz
+ 4c290986eb68607420a602c3fae4baaf 3087090 sisu_0.16.22.orig.tar.gz
+ c925bddaee01bb7b5d5a2c241f3f75e0 8089 sisu_0.16.22-1.diff.gz
+
+ * metaverse fix for alternative endnote markup marker
+ at end of line~^
+
+ * texpdf fix for images, (where dimensions not
+ provided) not final, may need to pass through
+ imagemagick at metaverse stage
+
+ * fix to cgi sample sisu_search.cgi
+
+%% sisu_0.16.21.orig.tar.gz (2005w26/0 | 2005-07-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.21.orig.tar.gz
+ 9c4a29a357d1b988a351d2f035f8f8ea 3086501 sisu_0.16.21.orig.tar.gz
+ c80c80a6a90ea037267c127796a0fde5 7956 sisu_0.16.21-1.diff.gz
+
+ * small bugfix (param screen print)
+
+%% sisu_0.16.20.orig.tar.gz (2005w26/0 | 2005-07-03)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.20.orig.tar.gz
+ df663db73934d980ba484d69a2efc361 3086090 sisu_0.16.20.orig.tar.gz
+ 1aee087cb250a1fbd760ceb53fbc8c2b 7927 sisu_0.16.20-1.diff.gz
+
+ * separated out sisu vim files (syntax & folds)
+
+ * touch to syntax highlighting
+
+%% sisu_0.16.19.orig.tar.gz (2005w26/5 | 2005-07-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.19.orig.tar.gz
+ bf5a17871dfa7f1322bdaa774d24e4bb 3105899 sisu_0.16.19.orig.tar.gz
+ be224695722d529a481beaadecd695d3 7860 sisu_0.16.19-1.diff.gz
+
+ * small touches to vim syntax highlighting.
+
+%% sisu_0.16.18.orig.tar.gz (2005w26/5 | 2005-07-01)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.18.orig.tar.gz
+ 0d6bc75f1c631a423941bd20b8cb8ea0 3105726 sisu_0.16.18.orig.tar.gz
+ 2265f2449b63b2ba9af39e61a09198c9 7846 sisu_0.16.18-1.diff.gz
+
+ * some fixes to syntax highlighing: - changes to markup syntax introduced in
+ 0.16 release broke parts of syntax highlighter, more no doubt to follow.
+
+%% sisu_0.16.17.orig.tar.gz (2005w26/4 | 2005-06-30)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.17.orig.tar.gz
+ 410f1c01c261e2cf2bb25ff782b4c0b8 3105488 sisu_0.16.17.orig.tar.gz
+ 649cbe59bf940d93a74cdac46e59123c 7774 sisu_0.16.17-1.diff.gz
+
+ * separated color file out from ftplugin ... called dusk (or slate) by
+ me for several years i now call it sisu... perhaps i should stick
+ with slate as it is pretty appropriate... hmmm, slate
+
+%% sisu_0.16.16.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.16.orig.tar.gz
+ f5ce8002e6876feba22c276d4e49d3f5 3105731 sisu_0.16.16.orig.tar.gz
+ 251af2096015e193888a429cd69a328d 7576 sisu_0.16.16-1.diff.gz
+
+ * small touches to offer vim config files working the way i am used to
+ with Debian install... needs testing by someone with different
+ habits though.
+
+%% sisu_0.16.15.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.15.orig.tar.gz
+ 4de2570843cacd2c665fa8204eaab750 3105521 sisu_0.16.15.orig.tar.gz
+ c650a78d6b079db9c021a608236a920e 7494 sisu_0.16.15-1.diff.gz
+
+* separated vim syntax and ftplugin directory...
+ have still got color file in ftplugin/sisu.vim file
+ which is not acceptable
+
+%% sisu_0.16.14.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.14.orig.tar.gz
+ 18e0cfcac265ecb03e9af5f958aad0f7 3105239 sisu_0.16.14.orig.tar.gz
+ 493c64b453dc43ff36565aacacbc0b8c 7441 sisu_0.16.14-1.diff.gz
+
+ * sisu vim ftplugin ... for folds, syntax, colors, markup
+ auto installed in debian,
+ (but uses shared filetype in /usr/share/vim/addons
+ check how that is supposed to work)
+ else (non-debian install)
+ Rantfile places in /usr/share/sisu-examples/config/vim
+
+%% sisu_0.16.13.orig.tar.gz (2005w26/3 | 2005-06-29)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.13.orig.tar.gz
+ 775c33a1e6f0140f5552cb3f2784b00a 3124785 sisu_0.16.13.orig.tar.gz
+ 04242b7e8fec91a0b4f69bd 7328 sisu_0.16.13-1.diff.gz
+
+ * debian setup of vim syntax ok... however much vim setup still to automate,
+ immediately noticeable: folds for sisu not sorted; and permitting cursor
+ movement up and down without following long lines with screen wrap; (and no
+ clever way yet to contribute colors other than through sisu-examples, but
+ they being user preference should be contributed with care).
+
+ * on_markup.txt quick check & minor update
+
+%% sisu_0.16.12.orig.tar.gz (2005w26/1 | 2005-06-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.12.orig.tar.gz
+ 5bdff14e999ea933abdb3f3bfbbc0dcb 3119368 sisu_0.16.12.orig.tar.gz
+ 5a9f5898165c74e60b6292b6e777beba 7105 sisu_0.16.12-1.diff.gz
+
+ * home page index.html creation, path precedence set:
+ ~/.sisu/skin/doc
+ /etc/sisu/skin/doc
+ defaults
+ and content is interchangeable (so future latent break
+ is less likely)
+
+ * touch to Rantfile.
+
+%% sisu_0.16.11.orig.tar.gz (2005w26/1 | 2005-06-27)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.11.orig.tar.gz
+ b14414943ca84f66cde1f646da7a2329 3118990 sisu_0.16.11.orig.tar.gz
+ 742089f905479231a32fb6b4fc62824f 7024 sisu_0.16.11-1.diff.gz
+
+ * bugfix a default variable, in defaults version should be @ver
+ introduced by cuts and pastes between different files,
+ with recent default home page updates; make less likely to
+ happen in future, for now quick fix, revisit:
+ currently index.html taken from
+ ~/.sisu/skin/doc if it exists else defaults,
+ /etc/sisu/skin/doc is ignored, breaking expected
+ search precedence
+
+%% sisu_0.16.10.orig.tar.gz (2005w25/0 | 2005-06-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.10.orig.tar.gz
+ 73a4f8c6ffedbee7f1a9571b5f9c25da 3118710 sisu_0.16.10.orig.tar.gz
+ d6307e6e6f42f795d31d6516f6ef48ec 6919 sisu_0.16.10-1.diff.gz
+
+ * small edits to man pages and help
+ NB have taken out reference to alternative markup possibilities
+ e.g. b{ for bold }b being available as well as
+ *{ bold text }* (as the letter the and html equivalents are
+ depreciated, having or using alternative markup styles is
+ less tidy)
+
+%% sisu_0.16.9.orig.tar.gz (2005w25/0 | 2005-06-26)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.9.orig.tar.gz
+ 28615d4dcdc00d8342d2d88273f2f5a1 3118488 sisu_0.16.9.orig.tar.gz
+ 00142e23bfd377bc4e1a9d7be287d108 6775 sisu_0.16.9-1.diff.gz
+
+ * cleaning up of man pages, largely for html presentation
+ generated by rman
+
+%% sisu_0.16.8.orig.tar.gz (2005w25/6 | 2005-06-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.8.orig.tar.gz
+ d050e1532def2b862843ac653010c97e 3117054 sisu_0.16.8.orig.tar.gz
+ 89fb5d9a06748d1c12da98d7b947e0c9 6696 sisu_0.16.8-1.diff.gz
+
+ * minor edits
+
+%% sisu_0.16.7.orig.tar.gz (2005w25/6 | 2005-06-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.7.orig.tar.gz
+ c0afd925e862a2d149f642af6e02f231 3116725 sisu_0.16.7.orig.tar.gz
+ 28093c9d63cb5cbdd4bbc9d5cca16020 6678 sisu_0.16.7-1.diff.gz
+
+ * added the man pages in html (converted to html using rman)
+ http://polyglotman.sourceforge.net/rman.html
+
+ * related rather cosmetic changes
+
+%% sisu_0.16.6.orig.tar.gz (2005w25/6 | 2005-06-25)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.6.orig.tar.gz
+ 23e4aecd915e86191c8e4622cae787bb 3100364 sisu_0.16.6.orig.tar.gz
+ cf7b0f29ecaba525d0c4f875ee8ba01f 6632 sisu_0.16.6-1.diff.gz
+
+ * vim folds for sisu markup files updated
+ command is :F (ruby folds :R)
+ assuming the file is in place and in use
+
+%% sisu_0.16.5.orig.tar.gz (2005w25/5 | 2005-06-24)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.5.orig.tar.gz
+ 7e7ad7b08a1e6177f6333f699a23b4bb 3099726 sisu_0.16.5.orig.tar.gz
+ 8796ef31f655d9f074af00c352492653 6599 sisu_0.16.5-1.diff.gz
+
+ * some cleaning of wordmap output, regex exclusions added, not elegant
+ (special issue pages include sha and md5 output, also excluded)
+
+ * [released 0.16.6:] vim folds for sisu markup files updated
+ command is :F (ruby folds :R)
+ assuming the file is in place and in use
+
+ * comments, url locations of samples, output, etc. added to markup syntax
+ files (in addition to SiSU home which was already there)
+
+ * removed from tarball markup samples eu contract law principles
+ can be found at http://www.jus.uio.no/sisu/sample
+
+%% sisu_0.16.4.orig.tar.gz (2005w25/4 | 2005-06-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.4.orig.tar.gz
+ 899e08a81adf3544079e61f058c76388 3125518 sisu_0.16.4.orig.tar.gz
+ 2b70dde1fa067b1b03729be4c1688e2e 6379 sisu_0.16.4-1.diff.gz
+
+ * man 8 sisu post installation instructions looked at
+
+ * an image path adjusted
+
+%% sisu_0.16.3.orig.tar.gz (2005w25/4 | 2005-06-23)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.3.orig.tar.gz
+ 7dc657a1299e3ff831c932eb3975293f 3124710 sisu_0.16.3.orig.tar.gz
+ 93210116080bed4f22356e8ac1bba570 6324 sisu_0.16.3-1.diff.gz
+
+ * tables fixed, much latent breakage sorted
+ html segments fixed (scroll was ok)
+ xml sax and dom sorted
+ xml css naive but done
+ latex/pdf done
+
+%% sisu_0.16.2.orig.tar.gz (2005w25/3 | 2005-06-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.2.orig.tar.gz
+ c3306db32d485d515a4464766d3b81c8 3124314 sisu_0.16.2.orig.tar.gz
+ e82cc99b1a8a62cb1d590aa3dc65a4eb 6227 sisu_0.16.2-1.diff.gz
+
+ * conditional heading reinstated /^[12]~\?\s/
+ (may be used when it is expected that a document may be
+ imported into another, and the controlling documents level
+ 1 and/or 2 headings should be used instead (take precedence))
+
+ * rant install options, force specification of root if wish to
+ proceed as root, (previously was default on ok or continue)
+
+%% sisu_0.16.1.orig.tar.gz (2005w25/3 | 2005-06-22)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.1.orig.tar.gz
+ ad0220d5d7097833f404f3ffa1301525 3123961 sisu_0.16.1.orig.tar.gz
+ a7f0bf6bd77746a57f6724d3922bbf2c 6039 sisu_0.16.1-1.diff.gz
+
+ * touches to documentation, markup related
+
+ * markup syntax table is out of date, reference to it removed
+ replaced by suggestion you see online markup sample directory
+ http://www.jus.uio.no/sisu/sample
+
+ * fix, one sample document was overlooked in last package
+ (autonomy_markup2)
+
+%% sisu_0.16.0.orig.tar.gz (2005w25/2 | 2005-06-21)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.16.0.orig.tar.gz
+ d6ddb880cf0958893665ca0f0609acea 3123554 sisu_0.16.0.orig.tar.gz
+ 329d30ee875d4d2be75f981a9a875457 5830 sisu_0.16.0-1.diff.gz
+
+% WARNING Syntax Changes in 0.16 break previous markup
+% WARNING Despite Move to Stable Further Testing is Required
+
+ Syntax Cleaning - reduction in characters used
+ and the removal of several uses of unclosed curly brackets
+
+% Vim Regex Substitution Summary of Markup Syntax Changes:
+ :%s/\([0-6]\){\~\?/\1\~/c
+ :%s/ #\~\(\S\+\)/\*\~\1/c
+ :%s/^#{\~\?\s*/% /c
+ :%s/^r{ /<< /c
+ :%s/\~e/\~^/c
+ :%s/[-~]{{ /^\~ /c
+
+% sisu_0.15.0.orig.tar.gz (2005w24/0 | 2005-06-19)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.0.orig.tar.gz
+ MD5(sisu_0.15.0.orig.tar.gz)= a367efb13c3dbd2757e4ba968d61a8b2
+
+ * Syntax Changes, WARNING breaks old syntax,
+ a theme is the reduction of characters,
+ and the removal of most unclosed curly braces where used previously
+
+ * to mark headers and heading levels:
+ [0-6]~ replaces [0-6]\{ and [0-6]\{~ [at the start of a line]
+ header and headings marked by digit tilde at the start of the line
+ tilde replacing unclosed curly brace occurring after digit at
+ beginning of line
+ vim:
+ :%s/\([0-6]\){\~\?/\1\~/c
+ * to provide html name tag within text:
+ *~name replaces #~name
+ vim:
+ :%s/ #\~\(\S\+\)/\*\~\1/c
+ * a comment:
+ % replacing #{ [at the start of a line]
+ ^%% fold set in vim for such comment marker
+ vim:
+ :%s/^#{ /% /c
+ * require external document fold marker
+ << replacing r{
+ vim:
+ :%s/^r{ /<< /c
+
+ header and headings change is fairly major as affects most code
+ worth the break, i think so, given goal of simplicity and minimalism
+ however, syntax higlighting becomes even more crucial
+ as becomes more difficult to spot headings otherwise
+
+% sisu_0.15.1.orig.tar.gz (2005w25/1 | 2005-06-20)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.1.orig.tar.gz
+ MD5(sisu_0.15.1.orig.tar.gz)= d00ff37b438fe38732d887d8555dddb5
+
+ * Syntax Changes, WARNING breaks old syntax,
+
+ * endnotes where not embedded within text,
+ i.e. endnote following paragraph with endnote marker
+ ~^ replaces ~e as marker within text
+ ^~ for endnote content instead of -{{ or ~{{ [at the start of a line]
+ {~^ shortcut for making link with url as endnote }http://url
+ instead of {~e previous shortcut}http://url
+ vim:
+ :%s/\~e/\~^/c
+ :%s/[-~]{{ /^\~ /c
+
+% sisu_0.15.2.orig.tar.gz (2005w25/1 | 2005-06-20)
+ http://www.jus.uio.no/sisu/pkg/src/sisu_0.15.2.orig.tar.gz
+ MD5(sisu_0.15.2.orig.tar.gz)= c28a58664d9a5f1726ed4c5f875e8f12
+
+ * bugfix for composite documents, place newline
+ and mark end of import
+ (bug also in current stable 0.14.6)
+
+ * bugfix for [html] endnotes introduced (in param)
+ in development branch
+
+ * number paragraph in given heading sequence
+ while escaping from being a heading 5~- 6~-
+
+ * filenames for termsheet and standard_form
+ sisu -t
+
+ * fix webrick port settings sysenv
+
+ * html subtoc touch required
+
+ * help files updated on syntax changes
+
+ * document markup samples updated
+
+ * vim syntax files updated
+
+ * extensive testing required
+
+%% Syntax Changes in 0.16 break previous markup
+
+%% sisu_0.14.6.orig.tar.gz (2005w24/6 | 2005-06-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.6.orig.tar.gz
+ 6c027f44470c313eaae1569a5df8cfb7 3121245 sisu_0.14.6.orig.tar.gz
+ 069eafa4261ffc542172a4fc84d5fa44 4723 sisu_0.14.6-1.diff.gz
+
+ * texpdf removed whitespace around \\href{[url]} in a few locations
+ (latexpdf appears possibly to have problem in passing url to browser
+ including whitespaces before and after url)
+
+ * in all source code headers took out development branch reference,
+ leave it to the download page to keep other urls updated
+ author field Ralph Amissah, (instead of similar email address)
+ propagated alternative name 'Serialized Information, Structured Units'
+ (used earlier but not consistently)
+
+ * skin headers likewise looked at and modified
+
+ * touch to default index.html (in defaults and associated skin)
+
+ * (touch to sisu-examples description in debian control file)
+
+%% sisu_0.14.5.orig.tar.gz (2005w24/6 | 2005-06-18)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.5.orig.tar.gz
+ 1d86c68c0e44f835aeeb2d9b89502f1d 3120463 sisu_0.14.5.orig.tar.gz
+ c3589fc3343d0503e452b846d778f9d3 4412 sisu_0.14.5-1.diff.gz
+
+ * debian build sisu suggests sisu-examples
+
+ * added reference to abandoned U.S. provisional patent application
+
+%% sisu_0.14.4.orig.tar.gz (2005w24/5 | 2005-06-17)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.4.orig.tar.gz
+ 15ea5387b4cd88717c12c4d1a583d99d 3119833 sisu_0.14.4.orig.tar.gz
+ 10961f292abd7ad47b6c072aad6f525e 4339 sisu_0.14.4-1.diff.gz
+
+ * removed copyright mark from 0{~prefix
+ is distinct from 0{~rights which is related to copyright
+
+ * texpdf - pass author through "special character" filter
+
+ * bug fix for minor numbering using # mark, and re-calibrating
+ removed an extraneous tilde (~)
+
+%% sisu_0.14.3.orig.tar.gz (2005w24/3 | 2005-06-15)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.3.orig.tar.gz
+ 7324ba16cdf644bb560a99 3119435 sisu_0.14.3.orig.tar.gz
+ 3988a9ad582121b1972a 4190 sisu_0.14.3-1.diff.gz
+
+ * removed files cgi.rb and cgi_supplies.rb as unused.
+
+%% sisu_0.14.2.orig.tar.gz (2005w24/2 | 2005-06-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.2.orig.tar.gz
+ 90ab342311461a0c7b752df78e43d3b5 3121884 sisu_0.14.2.orig.tar.gz
+ 257f8716e88e0a29aa6853d73520821d 3414 sisu_0.14.2-1.diff.gz
+
+ * -g option taken out, unused and forgotten
+ -h and -H currently do what -g used to by default
+ (will revisit)
+
+%% sisu_0.14.1.orig.tar.gz (2005w23/2 | 2005-06-14)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.1.orig.tar.gz
+ 3c1ea0dfcf670316bd2ce49f0a4d65f8 3121529 sisu_0.14.1.orig.tar.gz
+ b87620429c979c9a85f3cf39911d9347 3463 sisu_0.14.1-1.diff.gz
+
+ * documentation related, but minor
+
+%% sisu_0.14.0.orig.tar.gz (2005w22/6 | 2005-06-04)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.14.0.orig.tar.gz
+ a7ba5eeedad74ba6231f13c3a39535ec 3121235 sisu_0.14.0.orig.tar.gz
+ fd74f52531699370664657064aed8578 3406 sisu_0.14.0-1.diff.gz
+
+ * Flattened directory structure for ./conf/sisu which maps to /etc/sisu
+ or equivalent i.e. removed the additional version number which is
+ not supported by debian packaging, and unnecessary anyway.
+ (this change is the reason for version the hop to 0.14.0)
+
+ * Changed name of ./conf/sisu/sisurc.yaml.sample_disabled,
+ is now ./conf/sisu/sisurc.yaml
+ and enabled with some parts commented out
+
+ * Source Document Digest (using openssl and currently set to MD5) generated
+ were cvs document details requested, (request set in document header).
+
+ * Added man page summary of sisu-examples
+ (and a README for directory which refers you to man page)
+
+%% sisu_0.12.7.tar.gz (2005w22/3 | 2005-06-01 )
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.12.7.tar.gz
+ MD5(sisu_0.12.7.tar.gz)= 080a45e3e94ed744cca9d0222aa0ae9b
+ [(self inflicted) glitch with Debian build, not released together with source tarball.]
+
+ * Make SiSU convenient to use to produce other formats (including LaTeX)
+ without the software necessary to produce pdf, i.e. pdflatex
+ http://www.tug.org/applications/pdftex/
+ all this does really is recognise when pdflatex is absent
+ and pdfs cannot be generated in html generated output
+ (i.e. no links to pdf are produced, as was previously the case
+ where pdf output was assumed)
+
+ * Removed Debian require dependency on tetex-base and tetex-extra (in which
+ pdflatex resides).
+
+%% sisu_0.12.6.orig.tar.gz (2005w21/4 | 2005-05-26 )
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.12.6.orig.tar.gz
+ 4cb96905865bead50d0a53c8b0f12e91 3118290 sisu_0.12.6.orig.tar.gz
+ b03f53624fa3030646c5f4e5ff020262 3379 sisu_0.12.6-1.diff.gz
+
+ * sisu_webrick default port set to 8081 (from 2000), [also considered 8111,
+ 8123] [0.12.5]
+
+ * short man pages on sisu_webrick and sisu_termsheet provided [0.12.5]
+
+ * sisu_termsheet (changed name from sisu_termsheet.rb) [0.12.5]
+
+ * removed sisu-[version number] executable, is not necessary, (resulted in
+ skip from 0.12.6 from 0.12.4) [0.12.6]
+
+%% sisu_0.12.5.orig.tar.gz
+skipped, synced tarball and deb in 0.12.6
+
+%% sisu_0.12.4.orig.tar.gz (2005w21/4 | 2005-05-26 ):
+ 2ba51878d3e68ac1d268b3aa0294a2ab 3123433 sisu_0.12.4.orig.tar.gz
+ 9c0309ccdce1d13946d1a74c48f07ff4 3300 sisu_0.12.4-1.diff.gz
+
+ * sisu_webrick fix, update
+
+%% sisu_0.12.3.orig.tar.gz (2005w21/3 | 2005-05-25 ):
+ ac5e82b8d2a88503d8d004bee12cd979 3123419 sisu_0.12.3.orig.tar.gz
+ db7b4401a63dea7b9f47b6ead5cf9d4a 3272 sisu_0.12.3-1.diff.gz
+
+ * updated man 8 sisu
+
+ * updated part of interactive help in line with 'man 1 sisu' and 'man 8 sisu'
+
+ * debian package added as required in current ubuntu at least: libyaml-ruby
+
+ * touch to sisu_termsheet, colour fix
+
+%% sisu_0.12.2.orig.tar.gz (2005w21/1 | 2005-05-23 ):
+ 65d8cc8021579e307f8c2cce31cc988 3119888 sisu_0.12.2.orig.tar.gz
+ 6a13bc64be600e96366ccff0fac66344 3208 sisu_0.12.2-1.diff.gz
+
+ * changes with packaging methods (rather than sisu), and redone from
+ scratch with new origional source
+
+ * switch from using the sha digest to md5
+
+%% sisu_0.12.1.orig.tar.gz (2005w21/1 | 2005-05-23 ):
+ 2c877136005c5052921e619d435f0c91 3119846 sisu_0.12.1.orig.tar.gz
+ 28e4022ff40fcfc0c5d8f6d64279ede7 3146 sisu_0.12.0-1.diff.gz
+
+ * changes with packaging methods (rather than sisu), and redone from
+ scratch with new original source
+
+ * switch from using the sha digest to md5
+
+%% sisu_0.12.0.orig.tar.gz (2005w20/4 | 2005-05-20 ):
+ SHA1(sisu_0.12.0.orig.tar.gz)= ca95d1bc6e601d74bbe17516b2d5abbe09c76c49
+ MD5(sisu_0.12.0.orig.tar.gz)= 9a2ec914f925b275045d5a0846edab79
+ 9a2ec914f925b275045d5a0846edab79 3101948 sisu_0.12.0.orig.tar.gz
+ a9faa27de0ec632513b0ed81997d44af 20 sisu_0.12.0-1.diff.gz
+
+ * changes to packaging methods (better integration of debian package
+ builds - use of rant and darcs-buildpackage)
+
+ * apt-gettable package built
+
+ * switch from using the sha digest to md5
+
+%% SiSU version 0.10.9 of 2005w20/2 (2005-05-17):
+ sisu_0.10.9.tar.gz
+ SHA1(sisu_0.10.9.tar.gz)= bdb1ea25792549e77f88e9dac56442393714cd7c
+ Debian sisu_0.10.9-1.dsc
+ 689f92bce4d1a9390d0c62726410d47b 3128684 sisu_0.10.9.orig.tar.gz
+ 2775d317627ca5902b5c430defb39421 235 sisu_0.10.9-1.diff.gz
+
+ * default generic install of sisu is to type as root
+ (in the root directory of the unpacked tarball):
+
+ ruby install
+
+ For additional options:
+
+ ruby install help
+
+ or
+
+ ruby install -T
+
+ Thanks to rant.
+
+ * rant install file (used by sisu) has been made fairly
+ generic, and mirrors the directory structure used by
+ setup.rb
+
+ sisu specific post setup instructions are included
+ in rant/plugin directory.
+
+ * removed Rakefile, I do like rake, but do find
+ rant more flexible and remove the duplication of
+ effort. The Rantfile, or rather install works without
+ the separate installation of rant.
+
+%% SiSU version 0.10.8 of 2005w20/1 (2005-05-16):
+ sisu_0.10.8.tar.gz
+ SHA1(sisu_0.10.8.tar.gz)= 09618366119ae0e7cf047083b860e71fce2cd599
+ Debian sisu_0.10.8-1.dsc: 25da3de61eb78d31abf70472022e7a32 3078004 sisu_0.10.8-1.tar.gz
+
+ * Package directory structure changed to suit setup.rb default mapping
+ and applied to Rant and debian builds (Rake not checked)
+ ./etc renamed ./conf
+ ./man moved to ./data/man
+ destination path mapping as before.
+
+ * renamed some files document text files in ./data/doc/sisu
+ such as this version_manifest
+
+ * copy of version_maifest and README placed in package root
+
+ * SiSU version information adjustment, see display e.g.:
+ sisu -v
+
+%% SiSU version 0.10.7 of 2005w19/0 (2005-05-15):
+ sisu_0.10.7.tar.gz
+ SHA1(sisu_0.10.7.tar.gz)= e18a47f07c1627f353bfc3a7c1e9d647c3265cf3
+ Debian sisu_0.10.7-1.dsc: d5978970a1e5891e5e9b0b406f503f79 3094556 sisu_0.10.7-1.tar.gz
+
+ * Rantfile for installation, (Stefan Lang's rant)
+ to install SiSU, in the root directory of the unpacked SiSU as root type:
+ ruby install
+
+ * Rakefile fix to path for sisu-examples
+
+%% SiSU version 0.10.6 of 2005w19/3 (2005-05-11):
+ sisu_0.10.6.tar.gz
+ SHA1(sisu_0.10.6.tar.gz)= 55c891acbfe9eb734f96950d4cc646022112eda8
+ Debian sisu_0.10.6-1.dsc: 1124ffebc09426d2c16854069c398483 6140896 sisu_0.10.6-1.tar.gz
+
+ * some re-calibration of ocn required.
+
+%% SiSU version 0.10.5 of 2005w18/0 (2005-05-08):
+ sisu_0.10.5.tar.gz
+ SHA1(sisu_0.10.5.tar.gz)= 274be3ca806288d7cce5607707c4fd35fe1ecc6c
+
+ * version detail [synchronising packaging]
+
+%% SiSU version 0.10.4 of 2005w18/0 (2005-05-08):
+ sisu_0.10.4.tar.gz
+ SHA1(sisu_0.10.4.tar.gz)= 3adfc0400055fa45200158c34523486fdede895a
+
+ * small fix on reporting, generated by information, metaverse
+
+%% SiSU version 0.10.3 of 2005w18/0 (2005-05-08):
+ sisu_0.10.3.tar.gz
+ SHA1(sisu_0.10.3.tar.gz)= ad95cbe339115437f1605e4aa7d7cd4519bb34cb
+
+ * cleaning in packages
+
+%% SiSU version 0.10.2 of 2005w18/0 (2005-05-08):
+ sisu_0.10.2.tar.gz
+ SHA1(sisu_0.10.2.tar.gz)= 6e02af05df9b32ed3565b2058bb15ab19482c893
+
+ * rebuilt to correct debian package paths
+ .deb installation paths should be correct
+
+ * work-nickname Sabaki dropped from naming convention, will for
+ the time being stick to just sisu
+ (previous work-names/nick-names included scribbler, and scribe)
+
+%% SiSU version 0.10.1 of 2005w18/5 (2005-05-06):
+ sisu_0.10.1.tar.gz
+ SHA1(sisu_0.10.1.tar.gz)= 210f6ba09aa8d78239a5b01ef981c1f615bce1f6
+ Contains development-branch, version 0.11.1 of 2005w18/5
+
+ 0.11.1 of 2005w18/5
+ * debian packaging,
+ all architectures,
+ use debian sub_version numbers 0.11.1-1
+
+ change darcs directory tarball directory and name to comply
+ with tarball created by debuild (remove sabaki and date stamp)
+
+ the sha provided here is for the darcs tarball,
+ will have to consider what to do when also providing debuild
+ source tarball with it's own sha, and in any event to reduce
+ duplication
+
+ * deb package provided together with debian source package
+ and ***, which contains debian package sha.
+
+ * tinkering in database lib, minor renaming edits,
+ (tuple instead of loadline)
+
+ * fix to cgi sample: sisu_search.cgi
+ related to match linking to endnotes, (#~\d instead of #\d)
+
+%% SiSU Sabaki, version 0.10.0 of 2005w18/2 (2005-05-03):
+ sisu-sabaki_0.10.0_2005w18-2.tar.gz
+ SHA1(sisu-sabaki_0.10.0_2005w18-2.tar.gz)=
+ fe59ad4f07346713e945de0d87b8b4b57b69fd62
+ Contains development-branch, version 0.11.0 of 2005w18/2
+
+ 0.11.0 of 2005w18/2 (0.9.10 - 0.11.0)
+ * debian packaging re-visited,
+ (based on help from wookey earlier in the year,
+ thanks also to geoff for testing, ...
+ more to be done, but progress.)
+
+ 0.9.9 of 2005w17/0
+ * looking at debian packaging
+ synchronise packaging (0.9.7 - 0.9.9)
+
+%% SiSU Sabaki, version 0.8.4 of 2005w17/6 (2005-04-30):
+ sisu-sabaki_0.8.4_2005w17-6.tar.gz
+ SHA1(sisu-sabaki_0.8.4_2005w17-6.tar.gz)=
+ b8385ec8b6cecd4a2cda06fd42151244a3697e5e
+ Contains development-branch, version 0.9.7 of 2005w17/6
+
+ 0.9.7 2005w17/6
+ * tex/pdf document information
+
+%% SiSU Sabaki, version 0.8.3 of 2005w17/5 (2005-04-29):
+ sisu-sabaki_0.8.3_2005w17-5.tar.gz
+ SHA1(sisu-sabaki_0.8.3_2005w17-5.tar.gz)=
+ 5603a862909c24eaec7a65b91f376e581fc76362
+ Contains development-branch, version 0.9.6 of 2005w17/5
+
+ 0.9.5 - 6 2005w17/5
+ * xml series tables
+
+%% SiSU Sabaki, version 0.8.2 of 2005w17/5 (2005-04-29):
+ sisu-sabaki_0.8.2_2005w17-5.tar.gz
+ SHA1(sisu-sabaki_0.8.2_2005w17-5.tar.gz)=
+ 6564d4babe9a04520699bdeaac0f13c0bd723fa3
+ Contains development-branch, version 0.9.4 of 2005w17/5
+
+ 0.9.4 2005w17/5
+
+ * fixes:
+ * html table of contents, use of ocn
+ * xml series, (metaverse & xml_common)
+ tables not created at present, and removed
+ revisit, (previous version inserted non-"tidy" xml markup)
+
+%% SiSU Sabaki, version 0.8.1 of 2005w17/4 (2005-04-28):
+ sisu-sabaki_0.8.1_2005w17-4.tar.gz
+ SHA1(sisu-sabaki_0.8.1_2005w17-4.tar.gz)=
+ c3508979690aad04834238354b259ae0c2588bfb
+ Contains development-branch, version 0.9.3 of 2005w17/4
+
+ 0.9.3 2005w17/4 (contains rad of 2005w17/4)
+
+ * hot on the heels of 0.8.0 some fixes, and more likely to follow.
+
+%% SiSU Sabaki, version 0.8.0 of 2005w17/4 (2005-04-28):
+ sisu-sabaki_0.8.0_2005w17-4.tar.gz
+ SHA1(sisu-sabaki_0.8.0_2005w17-4.tar.gz)=
+ 8fcfc3f8d7661a0b3110a3206491581a93e0e920
+ Contains development-branch, version 0.9.2 of 2005w17/4 (rad - 0.9.2)
+
+ Summary, an old idea reinstated, to permit alternative text
+ presentations downstream:
+
+ rad of 2005w17/3
+
+ * old idea reinstated:
+ metaverse now carries three ocn (numbering) schemes for each document
+
+ * ocn as before all substantive objects numbered sequentially
+ * ocn divided, with headings distinguished from other substantive objects
+ * ocn specific, with each object identified and numbered by type
+
+ * changes to html and latex/pdf and database libraries to accommodate ocn
+ some bugs remain
+
+ rad of 2005w17/4
+ * changes to plaintext, xml series, and wmap to take account of ocn
+ changes
+
+ 0.9.0 2005w17/4 (contains rad of 2005w17/3-4)
+
+ * fixes needed in libraries using altered ocn/metaverse
+ (more to follow)
+
+ * cgi-bin search form sample
+ 0.9/data/sisu/sample/cgi-bin/sisu_search.cgi
+ break fix (table structure had been changed)
+
+ 0.9.1 - 2 2005w17/4 (contains rad of 2005w17/3-4)
+
+ * more fixes needed in libraries using altered ocn/metaverse
+
+%% SiSU Sabaki, version 0.6.1 of 2005w16/0 (2005-04-24):
+ sisu-sabaki_0.6.1_2005w16-0.tar.gz
+ SHA1(sisu-sabaki_0.6.1_2005w16-0.tar.gz)=
+ c824120ade54278b78a82ed535318974b30d3073
+ Contains development-branch, version 0.7.5 of 2005w15/0 (5.10-7.5)
+
+ 0.5.10 of 2005w16/2
+
+ * default shortuct flags -1 to -5 (what they do) can be modified in
+ sisurc.yaml (by changing the default flags they call)
+
+ * screen output ansi colour default can be set to true or false in
+ sisu.rc with -c acting as a toggle to turn screen output colour on
+ or off as appropriate against the default set.
+
+ 0.7.0 of 2005w16/3
+
+ * Remove old markup syntax, simplifies description of SiSU markup, without
+ any loss of functionality (the newer markup style is already a superset of
+ the old). Removal of old markup syntax necessitates branch/ version change.
+ Removal of the alternative markup syntax, which dates way back. It was
+ convenient and a bit impressive to be able to use SiSU on documents marked
+ up in 1997; and maintaining the accompanying code was unproblematic, but
+ after reflection over a prolonged period of time, have decided i would
+ rather not encourage alternative markup styles, especially where one is
+ clearly preferred over the other. There are still alternative ways of
+ representing endnotes for examples as either may confer an advantage,
+ depending on circumstances (usually the pre-markup source document) but
+ only within the new markup style.
+
+ 0.7.1 of 2005w16/4
+
+ * removal of alternative markup syntax continues.
+
+ * remote file operations and file letter naming conventions, now
+ composite, requesting, requiring files have filename with extension .r
+ when processed a temporary file is created with the extension .t
+
+ when a url is provided to request the processing of a remote file, the file
+ is downloaded saved and processed with the .u extension
+
+ 0.7.2 of 2005w16/6
+
+ * Work with the downloading of images where remote documents are requested
+ either by use of a url on the command line or within a composite document
+ images if not found there are downloaded to a subdirectory of the working
+ directory sisu_images_external. Composite documents flagged with the
+ extension .r1 .r2 and .r3 are if external downloaded and scanned for
+ images, which are downloaded if not found in the directory
+ ./sisu_images_external, and the document as expanded is saved with as a
+ temporary file with the extension .t1, .t2 or .t3 accordingly, for
+ processing. Where a uri is provided on the command line referring to a sisu
+ markup document for processing, that document is downloaded and saved with
+ the extension .u1, .u2 or .u3 which is then processed. In all cases the
+ file extension is dropped with respect to output.
+
+ * Some updates to the man pages with regard to different types of remote
+ processing.
+
+ * pdftex possibility to set image centering in header, default off.
+
+ * pdftex visited sisu and latex special characters, escaping for pdfs
+
+ 0.7.3 of 2005w16/0
+
+ * Special characters in pdf, minor
+
+ 0.7.4 of 2005w16/0
+
+ * marker, problem with tables detected, make sure can rollback
+
+ 0.7.5 of 2005w16/0
+
+ * table fix...
+
+%% SiSU Sabaki, version 0.4.3 of 2005w16/1 (2005-04-18):
+ sisu-sabaki_0.4.3_2005w16-1.tar.gz
+ SHA1(sisu-sabaki_0.4.3_2005w16-1.tar.gz)=
+ ***
+ Contains development-branch, version 0.5.9 of 2005w15/0 (5-9)
+
+ 0.5.5 of 2005w15/5
+
+ * sisu control, minor, e.g. reduce number of counters
+
+ [downloaded ruby1.9, this branch uses ruby1.8 though]
+
+ 0.5.6 of 2005w15/6
+
+ * changes for ruby1.9, including metaverse, (also sysenv, html & plaintext)
+ most that needs to be done appears to be in place. worst fix ansi colour,
+ revisit all later. much testing needed.
+
+ * param header US Library of Congress cataloguing option ~class_loc also
+ ~class_dewey recall issues with dewey being proprietary? check (perhaps add
+ option and leave unused?) considered all this years ago... ~class_isbn,
+ issue here is that some material will be published under an isbn, and will
+ have page numbering etc. which sisu publication does not follow, i.e. sisu
+ publication is an independent publication, so isbn is a reference to an
+ original hard copy publication... what of asin etc. revisit, and determine
+ what else to add.
+
+ 0.5.7 of 2005w15/0
+
+ * sysenv ansi colors, revisit later
+
+ * wordmaps, revisit later... problem introduced (a loop removed,
+ double counting removed)
+
+ * rescue single line syntax rescue: ...
+
+ 0.5.8 of 2005w15/0
+
+ * introduce -c ansi color flag for screen output, (perhaps should be
+ color off instead), and
+ -q quiet mode, no screen output
+ there is some scope for breakage here, continue to examine the
+ plumbing
+
+ * man page updated
+
+ 0.5.9 of 2005w16/1
+
+ * dbi fixes from 0.5.8 changes (ansi)
+
+%% SiSU Sabaki, version 0.4.2 of 2005w15/4 (2005-04-14):
+ sisu-sabaki_0.4.2_2005w15-4.tar.gz
+ SHA1(sisu-sabaki_0.4.2_2005w15-4.tar.gz)=
+ d670058fe019a106b385049416db5c914fbf308d
+ Contains development-branch, version 0.5.4 of 2005w15/4 (4)
+
+ 0.5.4 of 2005w15/4
+
+ * sqlite default file name created to sisu_sqlite.db (was lex.db)
+
+ * plaintext some cleaning of output
+
+ * xml, minor touch, image tag, version/revision control info optional
+
+%% SiSU Sabaki, version 0.4.1 of 2005w15/3 (2005-04-13):
+ sisu-sabaki_0.4.1_2005w15-3.tar.gz
+ SHA1(sisu-sabaki_0.4.1_2005w15-3.tar.gz)=
+ 0b1c6f10832e114f55e4a7d37f6f98d7c345b55f
+ Contains development-branch, version 0.5.3 of 2005w15/3 (1-3)
+
+ 0.5.1 of 2005w15/3
+
+ * dbi sqlite re-introduced, though not tested. some things moved to
+ common_db
+
+ 0.5.2 of 2005w15/3
+
+ * common_db, dbi, pg and sqlite most logic is common and moved to
+ common_db
+
+ 0.5.3 of 2005w15/3
+
+ * dbi increased field size for text contents again,
+ (to 12,000 for now from inadequate 2712)
+ both postgresql and sqlite appear to support this
+
+%% SiSU Sabaki, version 0.4.0 of 2005w15/2 (2005-04-12):
+ sisu-sabaki_0.4.0_2005w15-2.tar.gz
+ SHA1(sisu-sabaki_0.4.0_2005w15-2.tar.gz)=
+ 832f47c37910dfbac05c401f26865b5f53dea358
+ Contains development-branch, version
+ 0.5.0 == 0.3.0 of 2005w15/2
+
+ 0.3.1 of 2005w15/2
+
+ * image representation changed dimensions now represented as
+ width x height i.e. \d+x\d+ e.g. 480x640 (as in imagemagick)
+ previously was explicit w=480 h=640
+ (this change causes breakage in sample text with images)
+
+ * sample marked-up documents updated accordingly
+
+ 0.5.0 of 2005w15/2
+
+ * sorry for the quick version number turn around, and for its being applied
+ to pretty minor changes.
+
+ The version numbering rule applied is that a second digit version number
+ change will be made when potential breakage is caused by code changes.
+
+ This has happened now with the decision to alter representation of image
+ dimensions. Backward compatibility, though easily provided is not thought
+ to be necessary (or desirable) in this instance, based on current user
+ base, and modest use of images in text. 0.4.0 is on it's way. This type of
+ event is fairly rare, though it has occurred occasionally in subtle ways.
+ For example Tainaron marked up in 1997-1998 markup style still builds.
+
+ For description of change see 0.3.1
+
+%% SiSU Sabaki, version 0.2.0 of 2005w14/0 (2005-04-10):
+ sisu-sabaki_0.2.0_2005w14-0.tar.gz
+ SHA1(sisu-sabaki_0.2.0_2005w14-0.tar.gz)=
+ 36986ffa6a17651a0d52646c9c91032af33bb32a
+ From stable 0.1.4-11
+ Contains development-branch, version
+ 0.3 == 0.1.5-58 of 2005w13/6
+
+ * version number changes:
+ stable branch is 0.2
+ development branch is 0.3
+
+ * replaced config_environment.rb file which had dropped out of stable
+ tarball. [lesson, test future setup/installs from clean slate]
+
+%% STABLE MANIFEST (@ 0.1.4 branch)
+
+%% SiSU Sabaki, version 0.1.4-11 of 2005w14/6 (2005-04-09):
+ sisu-sabaki-stable_0.1.4-10_2005w14-6.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-11_2005w14-6.tar.gz)=
+ bdb2b09d467804a6d3a4bd92abb13c015c57d897
+ Contains development-branch, version
+ 0.1.5-58 of 2005w13/6 (56-58)
+
+ 0.1.5-56 of 2005w14/3
+
+ * html endnote segment, (introduced bug fixed) linkback to
+ main text broken, url was split on more than one line,
+ resulting in error
+
+ * special characters escaping for use within text
+ looked at, (mostly there previously but not documented)
+ ~ { } < > - _ / also used : ^ ! #
+ note added to man pages
+ (more to be done)
+
+ 0.1.5-57 of 2005w14/5
+
+ * distinguish text poem from other text groupings by giving an
+ object citation number to each verse
+
+ * cosmetic html default colors for navigation band and home button
+ surround made neutral (white)
+
+ 0.1.5-58 of 2005w14/6
+
+ * distinguish text poem from other text groupings by giving an
+ object citation number to each verse
+
+ * alt and group text groupings bugfix
+
+%% SiSU Sabaki, version 0.1.4-10 of 2005w13/6 (2005-04-02):
+ sisu-sabaki-stable_0.1.4-10_2005w13-6.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-10_2005w13-6.tar.gz)=
+ bdd91b004c456251d6e7074439f6e9b571ae5316
+ Contains development-branch, version
+ 0.1.5-55 of 2005w13/6 (47-55)
+
+ 0.1.5-47 of 2005w13/3
+
+ * texpdf suggested urls at end of document problems with latex special
+ characters, not fully looked into, or passed through the appropriate
+ filter, but some ad hoc corrections made
+
+ 0.1.5-48 of 2005w13/3
+
+ * cosmetic + information in html navigation band (revisit)
+
+ * texpdf suggested urls special character fix for both url and linked text
+ done.
+
+ 0.1.5-49 of 2005w13/3
+
+ * html subtoc fix (as it failed in certain circumstances, watch)
+
+ * html endnotes, cosmetic (presentation of headings, and invisible navigation)
+
+ 0.1.5-50 of 2005w13/3
+
+ * html change to display of title and headings in segments (dc and headings)
+ display dc small, and heading normal
+
+ 0.1.5-51 of 2005w13/4
+
+ * initial xml table logic is in place (logic taken from html unit) [still using
+ html type tags but logic is in place]
+
+ 0.1.5-52 of 2005w13/6
+
+ * object character numbering of special blocks "code", "poem", "group"
+ and "alt" finally corrected, in line with "tables". (may introduce a subtle
+ variation, between poem and code, or alt and others, numbering the equivalent
+ of each verse, but need a bit of time to consider) numbering correct, some
+ cosmetic adjustments to follow, e.g. in pdfs, more work necessary in xml
+ series.
+
+ 0.1.5-53 of 2005w13/6
+
+ * dbi a bit of cleaning of search column, and touch to data
+
+ 0.1.5-54 of 2005w13/6
+
+ * texpdf adjustment to position of ocn in special text blocks
+
+ 0.1.5-55 of 2005w13/6
+
+ * texpdf blocks fix
+
+ * texpdf prefix_b issue with portrait, (not landscape) fix
+
+ * sisu info improved in latex output
+
+%% SiSU Sabaki, version 0.1.4-9 of 2005w13/2 (2005-03-29):
+ sisu-sabaki-stable_0.1.4-9_2005w13-2.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-9_2005w13-2.tar.gz)=
+ 743b912beddc235ec96456e97fe9350b2a275370
+ Contains development-branch, version
+ 0.1.5-46 of 2005w13/1 (44-46)
+
+ * small updates to man page
+
+%% SiSU Sabaki, version 0.1.4-8 of 2005w13/2 (2005-03-29):
+ sisu-sabaki-stable_0.1.4-8_2005w13-1.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-8_2005w13-1.tar.gz)=
+ f8a7760bbd583e5d8637420d153c178ffafcbf68
+ Contains development-branch, version
+ 0.1.5-43 of 2005w13/1 (34-43)
+
+ Quick summary (context sisu markup):
+
+ * allows creation of composite (sisu markup) documents, documents that
+ require other documents or bits of marked up text that are not independent
+ documents (i.e. not capable of being generated as standalone documents),
+ content may be sourced remotely (url)
+
+ * allows processing of remote (sisu markup) documents
+
+ * various small fixes
+
+ -- detail from development branch
+
+ 0.1.5-44 of 2005w13/2:
+
+ * documentation updates
+
+ 0.1.5-43 of 2005w13/1:
+
+ * composite documents and remote (url) documents, some on error code
+
+ * composite documents, screen information provided, both cosmetic and on
+ error
+
+ 0.1.5-42 of 2005w12/0:
+
+ * composite documents may link to remote urls for their constituent parts
+ using any of its (composite link) syntaxes with an html url, but advisedly
+ either of the following:
+
+ #basic sisu markup
+ r{http://www.url.org/filename.si}
+ {http://www.url.org/filename.s3}require
+ r{ {http://www.url.org/filename.si}req #for vim folds
+
+ #using thlnk
+ <url:http://www.url.org/filename.si>require
+ r{ <url:http://www.url.org/filename.s3>req #for vim folds
+
+ with thlnk is attractive if you use vim because it recognises and permits
+ the plain-text hyperlinking to the remote file, which can be called in for
+ viewing.
+
+ in this context (urls) textlink markup has little meaning as it does not
+ work for editors with url hyperlinking, while the basic sisu markup does no
+ more or less than it always does. For everyday use, as a means of
+ hyper-linking within an editor i do find textlink attractive though.
+
+ * file suffix naming convention -
+ .s[1-3] ordinary sisu marked up documents
+ .si sisu marked up snippets for incorporation into other documents
+ .r[1-3] documents using require - (like a master document)
+ .t[1-3] temporary marked up files, usually created by sisu for processing,
+ e.g. from building the master file, or on having downloaded a remote
+ sisu markup file for local processing.
+
+ while on the subject the 1 to 3 is an old naming convention for processing
+ html output, .s1 indicating that only a scroll, long single text should
+ be produced; .s2 for only segmented html, the document in parts should be
+ produced, no single/full length document (this is used for example on war
+ and peace); and .s3 requesting both the scroll and segments.
+
+ 0.1.5-41 of 2005w12/0:
+
+ * more alpha code: remote source a sisu markup file using url (http://) for
+ local processing.
+
+ For example, assuming sisu is installed, you could generate the text of the
+ GPL in plain-text, html, xhtml, XML, pdf and a wordmap of its contents using
+ the following string:
+
+ sisu -mhpabxXwv http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3
+
+ or to just do html and pdf files from one remote source to the default
+ remote destination (assuming you have one setup):
+
+ sisu -mhpr http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.s3
+
+ [this works for texts without embedded images, unless you already have the
+ images stored locally - it will be a relatively easy matter to get the
+ program to search relative parts on the remote server and download them for
+ processing with the document... no doubt it will happen one day, but is not
+ a priority in the near future, also; will be a small step to permit remote
+ (and local files) to be stored in zip format and unzipped prior to
+ processing if desired, to reduce bandwidth and time]
+
+ Nice from a flexibility perspective, though I expect SiSU's use to be
+ primarily on locally stored marked up document sets.
+
+ * vim updates (small touches) to sisu: syntax highlighting; folds, and;
+ recognised filetypes (included .si .[rst][0-3] already being recognised)
+
+ 0.1.5-40 of 2005w12/0:
+
+ * *{composite document}*, alpha code: introduced alternative ways of
+ specifying document require, using vim's hypertext ascii thlnk or textlink.
+ The following forms of document require are valid, to incorporate a
+ document fragment named filename.si (the require statement must be at the
+ start of a line):
+
+ #basic sisu markup
+ r{filename}
+ {filename.si}require
+ r{ {filename.si}req #for vim folds
+
+ #using textlink
+ |filename.si|@|^|require
+ r{ |filename.si|@|^|req #for vim folds
+
+ #using thlnk
+ <url:filename.si>require
+ r{ <url:filename.si>req #for vim folds
+
+ the value of the textlink and thlnk style is they are live hyperlinks to
+ the constituent parts of the document, which can be brought up at a
+ keystroke for viewing or editing.
+
+ [An interesting possibility to consider, is to permit sisu to get the
+ composite parts of a document from a remote url source via http, using
+ thlnk syntax which permits this <URL:http://www.bf-consulting.de/thlnk/vim>
+ - NOTE: implemented in 0.1.5-42]
+
+ 0.1.5-39 of 2005w12/6:
+
+ * *alpha* code: assemble source document for processing from a document
+ requesting additional parts ... i.e. a master document, or a document with
+ regular markup plus external insertions. Requesting documents currently
+ with named suffix .r[1-3] documents requested may be complete valid sisu
+ documents named with suffix .s[1-3] or valid sisu markup constituting part
+ of a document named with suffix .si (to distinguish and to prevent attempt
+ to generate the snippet). A temporary or transient document is assembled
+ for processing and na med with the suffix .t[1-3] (retaining the
+ processing instruction digit) [current intention is that the .t file will
+ be clobbered at the end of processing unless the maintenance processing
+ flag is used] parts are requested with:
+ {[name_of_file_to_load.s[i1-3]]}require
+ e.g.
+ {name_of_file_to_load.si}require
+ or
+ { name_of_file_to_load.s3 }require
+
+ 0.1.5-38 of 2005w12/6:
+
+ * xml sax and dom, pass data through...
+
+ development-branch, version 0.1.5-37 of 2005w12/6
+
+ * document generator information added as comment to head of xml & xhtml
+ output
+
+ 0.1.5-36 of 2005w12/6:
+
+ * fix, remote sending of xhtml files (-r on -b option), include [b] in
+ regex match for file to be placed correctly in remote directory
+
+ * cosmetic, (still with screen output on doing remote sending)
+
+ * [ratchet fix so yyyymmdd date info displayed correctly, was dropping
+ the 0 before month and day where less than 10]
+
+ * css and default home page modified
+
+ 0.1.5-35 of 2005w12/4:
+
+ * xml sax dom and xhtml change to header match
+
+ * xml dom changes to css
+
+ * some feedback provided on remote file placement -r
+
+ * document version guide added to toc html, (stub only unused)
+
+ 0.1.5-34 of 2005w12/4:
+
+ * xhtml filename extension now scroll.xhtml instead of doc.xhtml
+
+ * man page small update, file name extensions (xhtml and plain-text)
+
+%% SiSU Sabaki, version 0.1.4-7 of 2005w12/3 (2005-03-23):
+ sisu-sabaki-stable_0.1.4-7_2005w12-3.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-7_2005w12-3.tar.gz)=
+ 929875de0658f1adeabd837fa09aca3ae48197e0
+ Contains development-branch, version
+ 0.1.5-33 of 2005w12/3 (30-33)
+
+ 0.1.5-33 of 2005w12/3:
+
+ * largely cosmetic changes to default home page.
+
+ 0.1.5-32 of 2005w12/3:
+
+ * finally removed double bullets from ie on ms, problem with html tagging
+ <ul> and <li> both required. Small related changes to css and more to
+ follow.
+
+ 0.1.5-31 of 2005w12/3:
+
+ * sysenv: reverted to using ruby -v for ruby version info (no longer find
+ what i want within rbconfig: Config::CONFIG)
+
+ * plaintext: pass metadata through wrapper, some document rights info extends
+ beyond line wrap limit.
+
+ 0.1.5-30 of 2005w12/1:
+
+ * passed css (sisu.css) through a validator, corrections made
+
+ * expressly close segment files as produced, (else problem remote sending
+ last metadata file created as is not yet closed)
+
+%% SiSU Sabaki, version 0.1.4-6 of 2005w12/1 (2005-03-21):
+ sisu-sabaki-stable_0.1.4-6_2005w12-1.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-6_2005w12-1.tar.gz)=
+ 3f8ded60f1f43e3ba3e745d9bbc045bb0ab43ffb
+ Contains development-branch, version
+ 0.1.5-29 of 2005w11/6 (22-29)
+
+ from development-branch, version 0.1.5-26 to 0.1.5-29 of 2005w11/6
+
+ * -h0 turns off object character number display in html ouput
+ (-p0 to turn of object character number display in pdf, already
+ exists) [this is the digit 0 not upercase o]
+
+ * man page alphabetised
+
+ * renamed ascii plaintext, as use utf-8
+
+ * renamed plaintext output file plain.txt from file.txt (recently was
+ doc.txt but there were "webserver conflicts" with doc.html)
+
+ * manually constructed homepage embedded, and created on initialisation (-C),
+ will probably have to consider how and when this is done.
+
+ 0.1.5-25 of 2005w11/5:
+
+ * on table of contents page (for segmented text), new arrow navigation
+ button linked to first segment.
+
+ * -ru forces use of scp so as to build remote file structure and for input
+ files selected for processing, to copy all output files in their
+ directories (rather than only the currently selected output types).
+ [Bugcheck: There may be a bug, check that metaverse.html closes after
+ normal html processing and before copy, ... seems to end up posted empty,
+ when actually is built.]
+
+ * html for segmented table of contents, correction url markup levels 4,5 & 6
+
+ * [removal of erroneous reference to lexmercatoria]
+
+ 0.1.5-24 of 2005w11/3:
+
+ * [decided how to represent blockquotes, propagte]
+
+ * provided sisu home site urls (not a code change)
+
+ 0.1.5-23 of 2005w11/3:
+
+ * remote -r only ssh copy file types for which processing requested
+ (e.g. all pdf files for the following files to be processed - previously
+ copied all files from output directory of file for which processing was
+ requested) has a drawback though, as rely on scp -r to build the directory
+ structure, the first sending of any file must be done by calling the
+ -r flag alone, ie without other sisu instructions.
+
+ 0.1.5-22 of 2005w11/2:
+
+ * html, css more ...
+ [some problems reported with presentation of bullet lists in IE, will sort
+ later]
+
+ * use name file.txt instead of doc.txt for basic text (ascii type)
+ presentation output. Reason, some web servers are configured to give
+ precedence to .txt extension over .html i.e. when doc is requested doc.txt
+ rather than doc.html (the sisu preferred default) would be presented.
+
+%% SiSU Sabaki, version 0.1.4-5 of 2005w11/2 (2005-03-15):
+ sisu-sabaki-stable_0.1.4-5_2005w11-2.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-5_2005w11-2.tar.gz)=
+ 25e35edc2f932269d21b17c29890ad72c54510a5
+ Contains development-branch, version
+ 0.1.5-21 of 2005w11/2
+
+ * html, css, indented bullet fixed
+
+ * [see 0.1.4-4 for recent changes]
+
+%% SiSU Sabaki, version 0.1.4-4 of 2005w11/1 (2005-03-14):
+ sisu-sabaki-stable_0.1.4-4_2005w11-1.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-4_2005w11-1.tar.gz)=
+ 2ab9fa0a45275ca65a23e5199ef13851f00042f2
+ Contains development-branch, version
+ 0.1.5-16 to 0.1.5-20 of 2005w11/1
+
+ * html markup, a quick glance at & nod (anew) towards css
+ changes to ruby html code & to markup arranging & pruning (also get rid of
+ some line noise) from 0.1.5-16 to 0.1.5-20 (an ongoing longer term sort of
+ thing) quite a few changes, more to be done though
+
+ * line wrap visited
+
+ * ascii touched
+
+ * some code files moved and renamed
+
+%% SiSU Sabaki, version 0.1.4-3 of 2005w10/5 (2005-03-11):
+ sisu-sabaki-stable_0.1.4-3_2005w10-5.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-3_2005w10-5.tar.gz)=
+ 7e06a3b37e85eaebc74892244f6626ee4f2fcc8a
+ Contains development-branch, version
+ 0.1.5-15 of 2005w10/5
+
+ * remote host secure copy: adjustments, and flagged in help as EXPERIMENTAL
+ and as requiring configuration. Checks provided - no action taken if
+ username and remote hostname have not been provided and host not found.
+ Further checks necessary, first no action if network not available
+ (actually this feature should not yet have been made available in stable,
+ but so be it). [0.1.5-14 & 15 of 2005w10/4] - does not currently create
+ base directory for output on remote server - only sub-directories for each
+ document produced.
+
+%% SiSU Sabaki, version 0.1.4-2 of 2005w10/5 (2005-03-11):
+ sisu-sabaki-stable_0.1.4-2_2005w10-5.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-2_2005w10-5.tar.gz)=
+ 46ad3b254b5e9293610dccd6274e039e49c5b9a2
+ Contains development-branch, version
+ 0.1.5-12 of 2005w10/5
+
+ * forgot to update Rakefile along with rest of last stable relese (this is
+ excuse for current update)
+
+ * [A potentially useful feature, released prematurely] remote host secure
+ copy using system call, -r flag introduced, hostname and user must be
+ configured in sisurc.yaml (It is much more convenient to install SiSU on
+ remote machine, and do processing there, but that is not possible and it is
+ often convenient to have the files you are working on placed on the remote
+ host without further intervention [this serves as (an occasional?) fix],
+ (note is faster i am sure to send a compressed tarball)) [could do same for
+ ftp etc.] Note also would be more efficiently implemented as a threaded,
+ will consider later, for now the output of this implementation is
+ appreciated.
+
+ * ascii.rb minor touch, (repeated require removed)
+
+ * an email address update for author
+
+%% SiSU Sabaki, version 0.1.4-1 of 2005w10/3 (2005-03-09):
+ sisu-sabaki-stable_0.1.4-1_2005w10-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki-stable_0.1.4-0_2005w10-3.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-1_2005w10-3.tar.gz)=
+ 8ab95e942f7dd2449e1c92ec94f15a938d01edce
+ Contains development-branch, version
+ 0.1.5-1 (post 2005w06/4) - 0.1.5-11 of 2005w10/2
+
+ 0.1.5-11 of 2005w10/1:
+
+ * latex/pdf match regex improved (for work referred to in 0.1.5-10)
+
+ 0.1.5-10 of 2005w10/2 - fold back into stable:
+
+ * fix for bug in latex/pdf for certain types of multiple url/endnote tagging
+ within a paragraph, previously not properly caught (not much need had arisen
+ for multiple 'such' tags... but sorted)
+
+ 0.1.5-9 of 2005w10/1:
+
+ * cosmetic changes, html navigation
+
+ 0.1.5-8 of 2005w09/0:
+
+ * cosmetic changes, css visited turned off in html, and previous, next arrow
+ buttons changed (with image-buttons from darcs wiki)
+
+ 0.1.5-7 of 2005w09/0:
+
+ * utf8 xml
+
+ * utf8 related transforms in one file, (but should profile), so far latexpdf
+ and html, (xml to follow)
+
+ * switch over to UTF-8 from ISO-8859-1
+
+ 0.1.5-6 of 2005w09/5:
+
+ * platform architechture hooks in place
+
+ * Iñtërnâtiônàlizætiøn a few more utf-8 characters added
+ ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûü
+ ¢£¥§©ª«®°±²³µ¶¹º»¼½¾×÷
+
+ * man page, looked odd under utf8, adjustments made (post 0.1.5-5 and
+ uploaded)
+
+ * rake base, function updated to setup man along with: bin, lib, etc
+
+ 0.1.5-5 of 2005w09/3:
+
+ * papersize, LaTeX/pdf start adjusting, further refinement necessary
+
+ * documentation, small update
+
+ 0.1.5-4 of 2005w09/3:
+
+ * internationalisation, Unicode UTF-8 (preferred default (from now on)): the
+ locale common denominator between various programs used, from LaTeX and
+ Postgresql to ... vim, appears to be utf-8
+ Changed computer environment to utf8 (locale, postgresql, vim etc.), and
+ run SiSU to see what breaks...
+ * issues detected with LaTeX/pdf and sorted
+
+ * hooks for paper size used by latex/pdf in place currently only default a4 set
+ for all available types, sort out LaTeX settings later.
+
+ * text version of version manifest included start to provide 2004-02-27
+
+ * small changes to rakefile
+
+ * small changes to dates in sysenv
+
+ * termsheets wrapper included, (termsheet sisu pre-processing for merging a
+ computer legal 'termsheet' into a set of standard contract documents)
+ included wrapper. However, to be useful need to provide examples, and/or
+ detail as to how this works... this is left out for now, as having so many
+ appendages is a distraction and make sisu look more complicated than it
+ need be, or rather than it is for its' ordinary functions.
+
+ * included Debian directory, first attempt at making a deb.
+ [still only in development directory]
+
+%% SiSU Sabaki, version 0.1.4-0 of 2005w07/2 (2005-02-15):
+ sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz
+ SHA1(sisu-sabaki-stable_0.1.4-0_2005w07-2.tar.gz)=
+ 0867a884c6741751e73e664c6fe485ec7161dcdb
+
+ * substantively the same as 0.1.5-0 (development branch)
+
+ * tables get object citation numbers
+
+ * tables are currently omitted from xml output, and table notes are disabled
+ for the moment
+
+%% SiSU Sabaki, version 0.1.2-27 of 2005w05/0 (2005-02-06):
+ sisu-sabaki_0.1.2-27_2005w05-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-27_2005w05-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-27_2005w05-0.tar.gz)=
+ af17a4a3f8c192e772fb862f16f6c93bd48129b5
+
+ * adjustments to Rakefile post installation configuration and generation of
+ sample file output, post-installation options
+
+ * word map hardlinks ... (.html suffix previously handled by webserver
+ configuration)
+
+%% SiSU Sabaki, version 0.1.2-26 of 2005w05/0 (2005-02-06):
+ sisu-sabaki_0.1.2-26_2005w05-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-26_2005w05-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-26_2005w05-0.tar.gz)=
+ 3fe1d7aafacad9926ef228b48bf13af0cafa9217
+
+ * adjustments to Rakefile post installation configuration and generation of
+ sample file output
+
+%% SiSU Sabaki, version 0.1.2-25 of 2005w05/5 (2005-02-04):
+ sisu-sabaki_0.1.2-25_2005w05-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-25_2005w05-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-25_2005w05-5.tar.gz)=
+ 0f00d3bf6883a02da4270e953781aec4cfe6ebb9
+
+ * tweaking of default output and processing paths, (for testing, may have
+ broken something)
+
+ * adjustment to url pattern match for LaTeX output
+
+ * As rake has been configured to do post installation setup, it is the
+ preferred method of installation for the present time.
+
+%% SiSU Sabaki, version 0.1.2-24 of 2005w05/5 (2005-02-04):
+ sisu-sabaki_0.1.2-24_2005w05-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-24_2005w05-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-24_2005w05-5.tar.gz)=
+ d93c2b510d3784dc7b396541734bcdaf198c0c9b
+
+ * if you have ruby1.8.2, rake and sudo install and setup should be automated -
+ small adjustments to Rakefile, if sudo is used on machine, will request
+ user (name) to be used when generating test document, and attempts to do
+ additional setup required and generate the first document; if not skips
+ that final step, manual configuration, being required (basically running
+ sisu -CC in document markup directory first before generating first
+ document)
+
+ * hard test for presence of rexml which is supposed to be part of ruby1.8 I
+ thought but reports back from a number of distros that is not always there...
+ as it is so far only used in SiSU for cosmetic purposes, rexml is ignored if
+ not found. Caused hiccup if not present in previous version.
+
+ * on Debian testers had to have the following packages installed in addition to
+ having ruby1.8 and preferably rake as well:
+ tetex-base tetex-bin tetex-extra
+ libyaml-ruby
+ other programs used if available
+ librexml-ruby trang and tidy
+
+ * on Mac the following page was valuable to one who had not previously used
+ Ruby
+ http://www.rubygarden.org/ruby?RubyOnMacintosh
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.2-23 of 2005w05/4 (2005-02-03):
+ sisu-sabaki_0.1.2-23_2005w05-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-23_2005w05-4.tar.gz)=
+ 771e0a98246162c61618dc941ab9831e57551e9f
+
+ Withdrawn because more was done setting up SiSU in root than is practicable,
+ causing problems for ordinary use of sisu.
+
+ * small adjustments to Rakefile, still need to decide whether default action
+ should include an attempt to generate a test document
+
+ * sisurc.yaml sample provided disabled by default (
+ /etc/sisu/0.1.2/sisurc.yaml.sample_disabled probably best copied to ~/.sisu
+ and renamed sisurc.yaml)
+
+%% SiSU Sabaki, version 0.1.2-22 of 2005w05/3 (2005-02-02):
+ sisu-sabaki_0.1.2-22_2005w05-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-22_2005w05-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-22_2005w05-3.tar.gz)=
+ b9b51c7f9e5a95f32df91632fb43c96c1a9057a3
+
+ * SiSU's Rakefile configure automation taken a bit further. If using Rake setup
+ then after the installation of SiSU, Rake will attempt to do initial
+ configuration of the sisu document samples output directory, and to
+ generate multiple output versions of a sample text file (html, ascii, xml
+ (dom and sax versions), latex, pdf). Will consider whether to keep things
+ this way, it does provide early feedback as the status of the installation.
+
+ * Permissions on files placed by Rake, bin 755 the rest 644
+
+ * /etc added to sisurc.yaml search path, was previously a sample document.
+
+%% SiSU Sabaki, version 0.1.2-21 of 2005w05/3 (2005-02-02):
+ sisu-sabaki_0.1.2-21_2005w05-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-21_2005w05-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-21_2005w05-3.tar.gz)=
+ 6f5ae5a24ff8099aea492e47ac99c73f906d18e4
+
+ * LaTex/pdf output should now work across the platforms on which sisu has been
+ tested, Linux and Mac/OSX/BSD, but this is anticipated rather than
+ extensively tested...
+
+ * sisu -CC from within a document working directory, after install should do
+ additional things related to initialising output directory
+
+ * system calls were mostly placed in one library/module and the availability of
+ the binary tested for with whereis -b, apparently the -b flag for binary
+ only is not available across all Linux/Unix, so the whereis check has been
+ modified.
+
+ * various little things todo with setup and installation
+
+ * Thanks O-E P, and chris2 for help and feedback with Mac OSX installations.
+
+%% SiSU Sabaki, version 0.1.2-20 of 2005w05/2 (2005-02-01):
+ sisu-sabaki_0.1.2-20_2005w05-2.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-20_2005w05-2.tar.gz
+ SHA1(sisu-sabaki_0.1.2-20_2005w05-2.tar.gz)=
+ 1e28dde239c96b82acfced1a37615ca7255d102a
+
+ * Most remaining system calls moved to single location, and binaries checked
+ for before use, will be very easy to have alternative calls for different
+ platforms
+
+ * Well this is news SiSU ran on a Mac yesterday - html, ascii, xml Very much a
+ first look. There are issues to resolve, but not major ones: sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2004-12-25) [powerpc-darwin7.7.0]
+
+ * & my info, sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2005-01-10) [i386-linux]
+
+%% SiSU Sabaki, version 0.1.2-19 of 2005w05/1 (2005-01-31):
+ sisu-sabaki_0.1.2-19_2005w05-1.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-19_2005w05-1.tar.gz
+ SHA1(sisu-sabaki_0.1.2-19_2005w05-1.tar.gz)= eb7ef826f2fa69c4ef8eaf33ff297f3141c1217e
+
+ * Rakefile modified, same result ... a few more options
+
+ * touch to vim folds
+
+ * cosmetic change to code headers
+
+ * a touch related to initialisation of directories (probably more to follow),
+ checks done as to whether to -C on use of -m and -M flags
+
+ * SiSU ran on a Mac today - html, ascii, xml. There are issues to resolve, but
+ not major ones: sisu -v on a powerpc yesterday:
+
+ * Well this is news SiSU ran on a Mac yesterday - html, ascii, xml Very much a
+ first look. There are issues to resolve, but not major ones): sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2004-12-25) [powerpc-darwin7.7.0]
+
+ * my info, sisu -v:
+
+ SiSU Sabaki: version 0.1.2-19 of 2005w05/1 (2005-01-31) & Ruby: ruby 1.8.2
+ (2005-01-10) [i386-linux]
+
+ * Released together with 0.1.2-18 which was held back because some remaining
+ issues with extension of feature set introduced in 0.1.2-14 and 0.1.2-15
+ were detected. These have been largely but not completely resolved. Will
+ have to study effects of changes on middle layer more closely in subsequent
+ releases. There will be some. The release is made now anyway because
+ there are a number of installations taking place this week, and it does
+ contain improvements over previous versions, in the install procedures
+ which are primarily what is to be looked at.
+
+%% SiSU Sabaki, version 0.1.2-18 of 2005w04/0 (2005-01-30):
+ sisu-sabaki_0.1.2-18_2005w04-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-18_2005w04-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-18_2005w04-0.tar.gz)=
+ 99cb98163fad28aec1111429d505e8c54cc6f353
+
+ * Rakefile modified, same result ... a few more options
+
+ * touch to vim folds
+
+ * cosmetic change to code headers
+
+ * a touch related to initialisation of directories (probably more to follow),
+ checks done as to whether to -C on use of -m and -M flags
+
+ * Held back and released at the same time as 0.1.2-19. While containing the
+ noted improvements over 0.1.2-17 was withheld as some remaining issues
+ resulting from the extension of features in 0.1.2-14 & 0.1.2-15, which
+ 0.1.2-18 goes some way to address as well.
+
+%% SiSU Sabaki, version 0.1.2-17 of 2005w04/4 (2005-01-27):
+ sisu-sabaki_0.1.2-17_2005w04-4.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-17_2005w04-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-17_2005w04-4.tar.gz)=
+ e61952bcde4b7cd936fdcd35835287d50af83814
+
+ * Test documents regenerated.
+
+ * Bugfix release, fixing bug intruduced by longtime planned nifty new feature
+ introduced in 0.1.2-14 and 0.1.2-15 ¿ in keeping with markup ergonomics,
+ emphasis, i.e. word list to be made bold and italics can be adjusted in
+ skins as well as in headers, or directly in text, see 0.1.2-14 and 0.1.2-15
+ release and notes below for general details.
+
+ * bugfix of feature introduced in 0.1.2-15
+ single fix for bug in 0.1.2-15 (markup wordlist defaults and skin
+ adjustment), 0.1.2-16 (earlier bugfix). In special circumstances the bug
+ could also affect 0.1.2-14 (markup wordlist header adjustment)
+
+ * max pdf image size optimised for landscape output. sizes changed in
+ 0.1.2-16, incidentally, really should have different maximum values for
+ landscape and portrait, planned.
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.2-16 of 2005w04/4 (2005-01-27):
+ sisu-sabaki_0.1.2-16_2005w04-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-16_2005w04-4.tar.gz)=
+ d6ab8845e160821fc41bdd79a5f6b35df0ce236a
+
+ * bugfix release which itself had to be fixed, see bugfix, 0.1.2-17 of 2005w04/4
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.2-15 of 2005w04/3 (2005-01-26):
+ sisu-sabaki_0.1.2-15_2005w04-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-15_2005w04-3.tar.gz)=
+ 5b101f13f4cef41989ace6d801b657ab559f95c5
+
+ * in keeping with markup ergonomics, emphasis, i.e. word list to be made bold
+ and italics can be adjusted in skins as well as in headers (0.1.2-14), or
+ directly in text (as before), see 0.1.2-14 release and notes below for
+ general details.
+
+ * See bugfix, 0.1.2-17 of 2005w04/4
+
+%% SiSU Sabaki, version 0.1.2-14 of 2005w04/3 (2005-01-26):
+ sisu-sabaki_0.1.2-14_2005w04-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-14_2005w04-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-14_2005w04-3.tar.gz)=
+ 55cb833cae5cd8e4e2c44ff09c9574a90877275b
+
+ * auto-detect and configure output directory (autorun sisu -C if related
+ directories are not detected)
+
+ * minor touch to Rakefile
+
+ * in keeping with markup ergonomics, word list to emphasise, ie bold and
+ italics can be added in document headers,[*] where a word is to be
+ consistently tagged in this way
+
+ * documentation updated accordingly
+
+%% SiSU Sabaki, version 0.1.2-13 of 2005w03/0 (2005-01-23):
+ sisu-sabaki_0.1.2-13_2005w03-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-13_2005w03-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-13_2005w03-0.tar.gz)=
+ dc540fe8152651dec93454401e6703064734b4bc
+
+ * Rakefile updated (rake help)
+
+%% SiSU Sabaki, version 0.1.2-12 of 2005w03/6 (2005-01-22):
+ sisu-sabaki_0.1.2-12_2005w03-6.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-12_2005w03-6.tar.gz
+ SHA1(sisu-sabaki_0.1.2-12_2005w03-6.tar.gz)=
+ 1674a9189c30726be2225b8576eae847ab9aaaee
+
+ * Rakefile added (sudo rake)
+
+%% SiSU Sabaki, version 0.1.2-11 of 2005w03/5 (2005-01-21):
+ sisu-sabaki_0.1.2-11_2005w03-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-11_2005w03-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-11_2005w03-5.tar.gz)=
+ 1eb07edd9f3e83cd4792f2c4c533fb97d70bac72
+
+ * removed install.rb which has been stripped of almost all function (and rely
+ on setup.rb)
+
+%% SiSU Sabaki, version 0.1.2-10 of 2005w03/5 (2005-01-21):
+ sisu-sabaki_0.1.2-10_2005w03-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-10_2005w03-5.tar.gz
+ SHA1(sisu-sabaki_0.1.2-10_2005w03-5.tar.gz)=
+ 375b0bf022d2c0f8a73ded67c4155821b6afa0bb
+
+ * some basic default install issues...
+
+ * Minero Aoki's setup.rb used for basic installation, but rough home brew
+ install.rb copies remaining required files to /etc. setup.rb used to
+ install sisu package (bin,lib,data) apart from the /etc directory.
+ install.rb used for /etc only. Will switch to using only setup.rb when it
+ sets up etc in addition to bin, lib, and data. When there is time,
+ (possibly as late as next month) will work towards having a release that
+ uses setup.rb for installation.
+
+%% SiSU Sabaki, version 0.1.2-9 of 2005w03/4 (2005-01-20):
+ sisu-sabaki_0.1.2-9_2005w03-4.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-9_2005w03-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-9_2005w03-4.tar.gz)=
+ c0080dc1f58f8889845ac34c38d995bc7e33badc
+
+ * only change is to man pages
+
+%% SiSU Sabaki, version 0.1.2-8 of 2005w03/3 (2005-01-19):
+ sisu-sabaki_0.1.2-8_2005w03-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-8_2005w03-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-8_2005w03-3.tar.gz)=
+ 4fa129cc49d5ecf1f4deed14129904e6bd6bf37a
+
+ * Still pre-setup.rb
+
+ * Minero Aoki's setup.rb and the rough home brew install.rb put together for
+ sisu, both included...
+
+ * setup.rb included and can be used to install sisu package (bin,lib,data)
+ apart from the /etc directory
+
+ * install.rb still used for general installation of sisu package (bin,lib,etc),
+ it does nothing with data directory
+
+ * man page updated, and can be "installed" using setup.rb
+
+%% SiSU Sabaki, version 0.1.2-7 of 2005w03/3 (2005-01-19):
+ sisu-sabaki_0.1.2-7_2005w03-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-7_2005w03-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-7_2005w03-3.tar.gz)=
+ 9953ecc0a3e3e23733e734c09210507649f3dc62
+
+ * Still pre-setup.rb
+
+ * directory structure maps that used by setup.rb
+
+%% SiSU Sabaki, version 0.1.2-6 of 2005w03/3 (2005-01-19):
+ sisu-sabaki_0.1.2-6_2005w03-3.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-6_2005w03-3.tar.gz
+ SHA1(sisu-sabaki_0.1.2-6_2005w03-3.tar.gz)=
+ 10dea0de4424180b8af2413a95c165286022eafe
+
+Previous bundle inclomplete, and withdrawn
+SHA1(sisu-sabaki_0.1.2-5_2005w03-2.tar.gz)=
+6c39c531356e7a954d9e49c6fac4541fe6f9ce89
+
+ * Still pre-setup.rb
+
+ * using yaml instead of pstore for version info, taken from read-only /etc
+
+ * no attempt to setup ~/.sisu resource configuration directory, make it
+ yourself as required.
+
+%% SiSU Sabaki, version 0.1.2-4 of 2005w03/1 (2005-01-17):
+ sisu-sabaki_0.1.2-4_2005w03-1.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-4_2005w03-1.tar.gz
+ SHA1(sisu-sabaki_0.1.2-4_2005w03-1.tar.gz)=
+ 80e8a4ebfac3989174a0b9be7afa5cc9dc22e935
+
+ * minor fix made to LaTeX for pdfs (package loaded twice)
+
+ * minor fix made to example cgi search form, front-end for Postgresql db, (a
+ counter contained a typo, plus cosmetic touches)
+
+%% SiSU Sabaki, version 0.1.2-3 of 2005w02/4 (2005-01-13):
+ sisu-sabaki_0.1.2-3_2005w02-4.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-3_2005w02-4.tar.gz
+ SHA1(sisu-sabaki_0.1.2-3_2005w02-4.tar.gz)=
+ b94ff6f770d11a9ef33fa989b8aeefa07aac6432
+
+ * Installation and configuration issues.
+
+ * does output check on directory permissions, and defaults to home directory if
+ web server directory does not have write permission
+
+ * can switch off external programs that are unavailable in resource
+ configuration file
+
+ * note in README on which external programs are used
+
+ * bug detected [2005-01-16] in released behaviour of object citation numbering,
+ tables should be numbered. Not yet fixed. Unlikely to touch before
+ mid-February.
+ Not certain when behaviour changed. It appears to be pre-introduction of
+ new table syntax. Each table gets an ocn, required amongst other things for
+ relational database. Check consistency of ocn elsewhere.
+
+%% SiSU Sabaki, version 0.1.2-2 of 2005w02/2 (2005-01-11):
+ sisu-sabaki_0.1.2-2_2005w02-2.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-2_2005w02-2.tar.gz
+ SHA1(sisu-sabaki_0.1.2-2_2005w02-2.tar.gz)=
+ 7ca13bb377bb7403cf2b9436984c2c8a1ac629b3
+
+ * manual location anchor/marker/tagging provided for html, (at present in html
+ only, adds nothing to other output types). Interactive help (and SiSU_MARKUP
+ textfile in tar bundle) updated accordingly.
+ Very minor code addition, has existed previously, decided is still useful
+ on some occasions. Use sparingly, the author is currently responsible for
+ non-duplication of such names. There is a remote possibility it breaks
+ something. An example of such a link:
+ http://www.jus.uio.no/sisu/SiSU/2004#ibm
+ http://www.jus.uio.no/sisu/SiSU/2004#2004-06-17
+
+ * endnotes were missing from the html full length, scroll outputs, and are now
+ back.
+
+ * skins included (now properly marked for revision control - or rather
+ accidental marking as "boring" removed for darcs).
+
+%% SiSU Sabaki, version 0.1.2-1 of 2005w02/1 (2005-01-10):
+ sisu-sabaki_0.1.2-1_2005w02-1.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-1_2005w02-1.tar.gz
+ SHA1(sisu-sabaki_0.1.2-1_2005w02-1_sha1)=
+ 6afa36b152359da215df84244cb156c2ee61d61f
+
+ * previous bundle not quite complete (skins missing) - [still missing were
+ marked incorrectly for darcs revision control exclusion]
+
+ * also previous version 0.1.2-0 despite its name worked as part of previous
+ 0.1.1 version, directories created etc.
+
+%% SiSU Sabaki, version 0.1.2-0 of 2005w01/0 (2005-01-09):
+ sisu-sabaki_0.1.2-0_2005w01-0.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.2-0_2005w01-0.tar.gz
+ SHA1(sisu-sabaki_0.1.2-0_2005w01-0_sha1)=
+ 7c500761f8aadb55faaf3aec4d20996f38462ece
+
+ * syntax tidying and small additions, old syntax remains effective, but
+ possibility to reduce some repetatition. See interactive help on markup
+ which has been updated accordingly, and within bundle SiSU_MARKUP.txt
+
+ * bugfix, pdf: corrects inconsistent behaviour in marking up urls in
+ footnotes, should be live hyperlinks and small font, introduced in 0.1.1-2
+
+ * bugfix, metaverse: tables with headings did not previously work with
+ updated table syntax, in release 0.1.1-2
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.1-3 of 2005w01/6 (2005-01-08):
+ sisu-sabaki_0.1.1-3_2005w01-6.tar.gz
+ SHA1(sisu-sabaki_0.1.1-3_2005w01-6.tar.gz)=
+ 21d9591f1c069e7111470b2bc98751a36833030d
+
+ * The default markup for: tables, grouped text, poems, code etc. has been
+ tidied/simplified. These are changes that have been planned for some time
+ and bring the style for these in line with the other markup syntax used.
+ The default syntax has been stable for a few years now, I thought this best
+ done prior to use by others. Note however: the previous syntax form is
+ still supported but depreciated. The default syntax has been stable for a
+ few years now.
+
+ * For help on markup syntax see one of the following:
+
+ interactive help - type 'sisu help tables'
+
+ marked up text samples
+
+ the SiSU_Markup.txt file provided with the program
+
+ * Quick fixes have been made to the vim syntax file which is provided.
+
+ [Will slow down updates for a while though there are still issues with the install.]
+
+%% *Withdrawn* - SiSU Sabaki, version 0.1.1-2 of 2005w01/6 (2005-01-08):
+ SHA1(sisu-sabaki_0.1.1-2_2005w01-6.tar.gz)=
+ 6acb02f98d100ff9a7f7a01ad71b88c215488009
+
+ * Few lines of code changed from 0.1.1-2, which is withdrawn.
+
+%% SiSU Sabaki, version 0.1.1-1 of 2005w01/5 (2005-01-07):
+ sisu-sabaki_0.1.1-1_2005w01-5.tar.gz
+ http://www.jus.uio.no/sisu/download/sisu-sabaki_0.1.1-1_2005w01-5.tar.gz
+ SHA1(sisu-sabaki_0.1.1-1_2005w01-5_sha1)=
+ 541bad03cba1bcb35c2582534e4312acc0bacd70
+
+ * install touch
+
+ * version information moved
+
+ * Still things to sort out with installation
+
+ * Manually change ownership on the resource configuration directory
+
+%% SiSU Sabaki, version 0.1.1-0 of 2005w01/4 (2005-01-06):
+ sisu_0.1.1-0_2005w01-4.tgz
+ http://www.jus.uio.no/sisu/download/sisu_0.1.1-0_2005w01-4.tgz
+ SHA1(sisu_0.1.1-0_2005w01-4.tgz)=
+ ff5ca4cf45d34ca3a6491e8ba29da30474b47b2b
+
+ * Modifications to installation script, configuration paths, and help only.
+
+ * Install script a bit smarter, (also installs the configuration files that
+ come along with the sample marked up documents) and more information
+ provided on paths, both by the install script and interactive help once
+ installed. Not much effort spent on installer, however, he directory
+ structure used is fine, paths may need to be reset, and information
+ provided on what is being attempted should make it easier to figure out
+ what may need to be done should problems arise.
+
+ [preferably run old remove script prior to install... otherwise you link
+ /usr/local/bin/sisu to /usr/local/bin/sisu-0.1.1]
+
+First release of SiSU - sisu_0.1.0-9_2005w01-2.tgz
+ http://www.jus.uio.no/sisu/download/sisu_0.1.0-9_2005w01-2.tgz
+ SHA1(sisu_0.1.0-9_2005w01-2.tgz)=
+ 14b230ba5a4c8f1c7264b38cd2d9c95a97477f3a
+
+ SiSU Sabaki, version 0.1.0-9 of 2005w01/2 (2005-01-04) was released to the
+ public on January 4th 2005. It may be downloaded from:
+ http://www.jus.uio.no/sisu/download/sisu_0.1.0-9_2005w01-2.tgz
+
+%% DEVELOPMENT (Merged into STABLE) MANIFEST (@ 0.1.5 branch)
+
+SiSU Sabaki development-branch, version 0.5.8 of 2005w15-0 [==0.4.3]
+
+SiSU Sabaki development-branch, version 0.5.4 of 2005w15-4 [==0.4.2]
+
+SiSU Sabaki development-branch, version 0.5.3 of 2005w15-3 [==0.4.1]
+
+SiSU Sabaki development-branch, version 0.5.0 of 2005w15-2 [==0.4.0]
+
+SiSU Sabaki development-branch, version 0.3.0 of 2005w14-0 [==0.1.5-58]
+* substantively the same as 0.2.0 [== 0.1.4-11]
+
+SiSU Sabaki development-branch, version 0.1.5-58 of 2005w14/6
+* substantively the same as 0.1.4-11
+
+SiSU Sabaki development-branch, version 0.1.5-55 of 2005w13/6
+* substantively the same as 0.1.4-10
+
+SiSU Sabaki development-branch, version 0.1.5-46 of 2005w13/2
+* substantively the same as 0.1.4-9
+
+SiSU Sabaki development-branch, version 0.1.5-44 of 2005w13/2
+* substantively the same as 0.1.4-8
+
+SiSU Sabaki development-branch, version 0.1.5-33 of 2005w12/3
+* substantively the same as 0.1.4-7
+
+SiSU Sabaki development-branch, version 0.1.5-29 of 2005w12/1
+* substantively the same as 0.1.4-6
+
+SiSU Sabaki development-branch, version 0.1.5-21 of 2005w11/2
+* substantively the same as 0.1.4-5
+
+SiSU Sabaki development-branch, version 0.1.5-20 of 2005w11/1
+* substantively the same as 0.1.4-4
+
+SiSU Sabaki development-branch, version 0.1.5-15 of 2005w10/4
+* substantively the same as 0.1.4-3
+
+SiSU Sabaki development-branch, version 0.1.5-12 of 2005w10/4
+* substantively the same as 0.1.4-2
+
+SiSU Sabaki development-branch, version 0.1.5-11 of 2005w10/2
+* substantively the same as 0.1.4-1
+
+SiSU Sabaki development-branch, version 0.1.5-0 of 2005w06/4
+* substantively the same as 0.1.4-0
+
diff --git a/data/doc/sisu/README b/data/doc/sisu/README
new file mode 100644
index 00000000..a688fcb5
--- /dev/null
+++ b/data/doc/sisu/README
@@ -0,0 +1,422 @@
+SiSU 0.49 2007w08/5 20070223
+homepage: http://www.jus.uio.no/sisu
+
+%% Description
+---------------
+
+ SiSU is lightweight markup based document creation and publishing framework
+ that is controlled from the command line. Prepare documents for SiSU using
+ your text editor of choice, then use SiSU to generate various output document
+ formats.
+
+ With minimal preparation of a plain-text (UTF-8) file using its native
+ markup-syntax, SiSU produces: plain-text, HTML, XHTML, XML, ODF:ODT
+ (Opendocument), LaTeX, PDF, and populates an SQL database (PostgreSQL or
+ SQLite) in paragraph sized chunks so that document searches are done at this
+ "atomic" level of granularity.
+
+ Outputs share a common citation numbering system, and any semantic meta-data
+ provided about the document.
+
+ SiSU also provides concordance files, document content certificates and
+ manifests of generated output.
+
+ SiSU takes advantage of well established open standard ways of representing
+ text, and provides a bridge to take advantage of the strengths of each,
+ while remaining simple. SiSU implements across document formats a "useful
+ common feature set" [coming from a humanities, law, and possibly social
+ sciences perspective, rather than technical or scientific writing] ...
+ focus is primarily on content and data integrity rather than appearance,
+ (though outputs in the various formats are respectable).
+
+ A vim syntax highlighting file and an ftplugin with folds for sisu markup is
+ provided. Vim 7 includes syntax highlighting for SiSU.
+
+ man pages, and interactive help are provided.
+
+ Dependencies for various features are taken care of in sisu related packages.
+ The package sisu-complete installs the whole of SiSU.
+
+ Additional document markup samples are provided in the package
+ sisu-markup-samples which is found in the non-free archive the licenses for
+ the substantive content of the marked up documents provided is that provided
+ by the author or original publisher.
+
+ Homepage: http://www.jus.uio.no/sisu
+
+-----
+
+SiSU - simple information structuring universe, is a publishing tool, document
+generation and management, (and search enabling) tool primarily for literary,
+academic and legal works.
+
+SiSU can be used for Internet, Intranet, local filesystem or cd publishing.
+
+SiSU can be used directly off the filesystem, or from a database.
+
+SiSU's scalability, is be dependent on your hardware, and filesystem (in my
+case Reiserfs), and/or database Postgresql.
+
+Amongst it's characteristics are:
+
+* simple mnemonoic markup style,
+
+* the ability to produce multiple output formats, including
+html, structured XML, LaTeX, pdf (via LaTeX), stream to a relational database
+whilst retaining document structure - Postgresql and Sqlite,
+
+* that all share a common citation system (a simple idea from which much good),
+possibly most exciting, the following: if fed into a relational database (as it
+can be automatically), the document set is searchable, with results displayed
+at a paragraph level, or the possibility of an indexed display of documents in
+which the match is found together with a hyperlinked listing for each of each
+paragraph in which the match is found. In any event citations using this system
+(with or without the relational database) are relevant for all output formats.
+
+* it is command line driven, and can be set up on a remote server
+
+* Documents are marked up in SiSU syntax in your favourite editor. SiSU syntax
+may be regarded as a type of smart ascii - which in its basic form is simpler
+than the most elementary html. There is currently a syntax highlighter, and
+folding for Vim. Syntax highlighters for other editors are welcome.
+
+Input files should be UTF-8
+
+Once set up it is simple to use.
+
+%% Online Information, places to look
+---------------
+
+http://www.jus.uio.no/sisu
+
+Download Sources:
+ http://www.jus.uio.no/sisu/SiSU/download.html#current
+ http://www.jus.uio.no/sisu/SiSU/download.html#debian
+or the same:
+ http://www.jus.uio.no/sisu/sisu_download/download.html#current
+ http://www.jus.uio.no/sisu/sisu_download/download.html#debian
+
+%% Installation
+---------------
+NB. Platform is Unix / Linux.
+
+%% Debian
+---------------
+If you use Debian use the Debian packages,
+check the information at:
+ http://www.jus.uio.no/sisu/SiSU/download.html#debian
+ http://www.jus.uio.no/sisu/sisu_download/download.html#debian
+
+(A) SiSU is available directly off the Debian archives for Sid and testing. It
+should necessary only to run as root:
+
+ aptitude update
+ aptitude install sisu-complete
+
+(B) If there are newer versions of SiSU upstream of the Debian archives, they
+will be available by adding the following to your /etc/apt/sources.list
+
+ deb http://www.jus.uio.no/sisu/archive unstable main non-free
+ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free
+
+ [the non-free line is for document markup
+ samples, for which the substantive text is
+ provided under the author or original
+ publisher's license and which in most cases will
+ not be debian free software guideline compliant]
+
+Then as root run:
+ aptitude update
+ aptitude install sisu-complete
+
+%% RPM
+---------------
+RPMs are provided though untested, they are prepared by running alien against the
+source package, and against the debs.
+
+They may be downloaded from:
+ http://www.jus.uio.no/sisu/SiSU/download.html#rpm
+
+%% Source package .tgz
+---------------
+Otherwise to install SiSU from source, check information at:
+ http://www.jus.uio.no/sisu/SiSU/download.html#current
+ http://www.jus.uio.no/sisu/sisu_download/download.html#current
+
+two alternative modes of installation from source are provided,
+setup.rb (by Minero Aoki) and a rant(by Stefan Lang) built install file,
+in either case: the first steps are the same, download and unpack the
+source file:
+
+1. Download the latest source (information available) from:
+ http://www.jus.uio.no/sisu/SiSU/download.html#current
+
+2. Unpack the source
+
+%% to use setup.rb
+---------------
+this is a three step process,
+in the root directory of the unpacked SiSU as root type:
+
+ ruby setup.rb config
+ ruby setup.rb setup
+ #[as root:]
+ ruby setup.rb install
+
+ further information:
+ http://i.loveruby.net/en/projects/setup/
+ http://i.loveruby.net/en/projects/setup/doc/usage.html
+
+%% to use install (prapared with "Rant")
+---------------
+in the root directory of the unpacked SiSU as root type:
+ ruby install
+
+or
+ ruby install base
+
+This makes use of Rant (by Stefan Lang) and the provided Rantfile. It has been
+configured to do post installation setup setup configuration and generation of
+first test file. Note however, that additional external package dependencies,
+such as tetex-extra are not taken care of for you.
+
+ further information:
+ http://make.rubyforge.org/
+ http://rubyforge.org/frs/?group_id=615
+
+For a list of alternative actions you may type:
+ ruby install help
+ ruby install -T
+
+Dependencies
+--------------
+Once installed see 'man 8 sisu' for some information on additional programs
+that sisu makes use of, and that you may need or wish to install. (this will
+depend on such factors as whether you want to generate pdf, whether you will be
+using SiSU with or without a database, ...) 'man sisu_markup-samples' may also be of
+interest if the sisu-markup-samples package has also been installed.
+
+The information in man 8 may not be most up to date, and it is possible that
+more useful information can be gleaned from the following notes taken from the
+Debian control file (end edited), gives an idea of additional packages that
+SiSU can make use of if available, (the use/requirement of some of which are
+interdependent for specific actions by SiSU):
+
+Package: sisu
+Depends: ruby (>= 1.8.4), libwebrick-ruby
+Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, librmagick-ruby, trang,
+ tidy, librexml-ruby, zip, unzip, openssl, rsync, openssh-client | lsh-client,
+ keychain, hyperestraier, kdissert
+Suggests: libfcgi-ruby1.8, rcs | cvs, lv, texinfo, pinfo, rename
+
+Package: sisu-complete
+Depends: ruby (>= 1.8.4), sisu, sisu-pdf, sisu-postgresql, sisu-sqlite
+Recommends: hyperestraier
+
+Package: sisu-pdf
+Depends: sisu, tetex-bin | texlive-base-bin, tetex-extra | texlive-latex-extra,
+ texlive-latex-extra, latex-ucs
+Suggests: evince, xpdf
+
+Package: sisu-postgresql
+Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
+Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1
+
+Package: sisu-sqlite
+Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
+Suggests: libdbd-sqlite
+
+Package: sisu-markup-samples
+Depends: sisu
+
+%% Quick start
+---------------
+Most of the installation should be taken care of by the aptitude or rant
+install. (The rant install if run in full will also test run the generation of
+the first document).
+
+After installation of sisu-complete, move to the document samples directory
+
+ cd /usr/share/doc/sisu/sisu_markup_samples/dfsg
+
+and run
+
+ sisu -3 free_as_in_freedom.rms_and_free_software.sam_williams.sst
+
+[or the same:
+ sisu -NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst
+]
+
+look at output results, see the "sisu_manifest" page created for the document
+
+or to generate an online document move to a writable directory, as the file
+will be downloaded there and e.g.
+
+sisu -3 http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst
+
+the database stuff is extra perhaps, the latex stuff could be considered extra
+perhaps but neither needs to be installed for most of sisu output to work
+
+examine source document, vim has syntax support
+
+gvim free_as_in_freedom.rms_and_free_software.sam_williams.sst
+
+additional markup samples in
+http://www.jus.uio.no/sisu/SiSU/2.html
+
+For help
+ man sisu
+
+or
+ sisu --help
+
+e.g.
+sisu --help env
+for the way sisu "sees/maps" your system
+sisu --help commands
+for list of commands and so on
+
+%% Configuration files
+---------------
+
+The default configuration/setup is contained within the program and is altered
+by configuration settings in /etc/[sisu version]/sisurc.yml
+or in ~/.sisu/sisurc.yml
+
+* configuration file - a yaml file
+ /etc/sisu/[sisu version]/sisurc.yml
+ ~/.sisu/sisurc.yml
+
+* directory structure - setting up of output and working directory.
+
+* skins - changing the appearance of a project, directory or individual
+documents within ~/.sisu/skin
+ ~/.sisu/skin/doc contains individual skins, with symbolic links from
+ ~/.sisu/skin/dir if the contents of a directory are to take a particular
+ document skin.
+
+* additional software - eg. Tex and LaTeX (tetex, tetex-base, tetex-extra on
+Debian), Postgresql, [sqlite], trang, tidy, makeinfo, ... none of which are
+required for basic html or XML processing.
+
+* if you use Vim as editor there is a syntax highlighter and fold resource
+config file for SiSU. I hope more syntax highlighters follow.
+
+There are post installation steps (which are really part of the overall
+installation)
+
+sisu -C in your marked up document directory, should do some auto-configuring
+provided you have the right permissions for the output directories. (and
+provided the output directories have already been specified if you are not
+using the defaults).
+
+%% Use General Overview
+---------------
+Documents are marked up in SiSU syntax and kept in an ordinary text editable
+file, named with the suffix .sst, or .ssm
+
+Marked up SiSU documents are usually kept in a sub-directory of your choosing
+
+use the interactive help and man pages
+ sisu --help
+ man sisu
+
+%% Help
+---------------
+
+interactive help described below, or man page:
+
+ man sisu
+
+ man 8 sisu
+ 'man sisu_markup-samples' [if the sisu-markup-samples package is also installed]
+
+Once installed an interactive help is available typing 'sisu' (without) any
+flags, and select an option:
+
+ sisu
+
+alternatively, you could type e.g.
+ sisu --help commands
+ sisu --help env
+ sisu --help headers
+ sisu --help markup
+ sisu --help headings
+ etc.
+
+for questions about mappings, output paths etc.
+ sisu --help env
+ sisu --help path
+ sisu --help directory
+
+%% Directory Structure
+---------------
+Once installed, type:
+ sisu --help env
+
+%% Configuration File
+---------------
+
+The defaults can be changed via SiSU's configure file sisurc.yml which the
+program expects to find in ./_sisu ~/.sisu or /etc/sisu
+
+%% Markup
+---------------
+
+See man pages.
+ man sisu
+
+Once installed there is some information on SiSU Markup in its help:
+ sisu --help markup
+and
+ sisu --help headers
+
+Sample marked up document are provided with the download tarball in the
+directory:
+ ./data/doc/sisu/sisu_markup_samples/dfsg
+
+These are installed on the system usually at:
+ /usr/share/doc/sisu/sisu_markup_samples/dfsg
+
+More markup samples are available in the package sisu-markup-samples
+
+Many more are available online off:
+ http://www.jus.uio.no/sisu/SiSU/2.html
+
+%% Additional Things
+---------------
+
+There is syntax support for some editors provided (together with a README file) in
+
+ ./data/sisu/conf/syntax
+
+usually installed to:
+
+ /usr/share/sisu/conf/syntax
+
+%% License
+---------------
+
+License: GPL 2 or later see the copyright file in
+
+ ./data/doc/sisu
+
+usually installed to:
+
+ /usr/share/doc/sisu
+
+%% SiSU Standard
+-----------------
+
+SiSU uses:
+
+* Standard SiSU markup syntax,
+* Standard SiSU meta-markup syntax, and the
+* Standard SiSU object citation numbering and system
+
+© Ralph Amissah 1997, current 2006.
+All Rights Reserved.
+
+* however note the License section
+
+
diff --git a/data/doc/sisu/copyright b/data/doc/sisu/copyright
new file mode 100644
index 00000000..06b9f0e1
--- /dev/null
+++ b/data/doc/sisu/copyright
@@ -0,0 +1,67 @@
+This is sisu, written and maintained by Ralph Amissah <ralph@amissah.com>
+on Mon, 2 May 2005 17:33:58 +0100.
+
+The homepage is:
+ <http://www.jus.uio.no/sisu>
+
+The original source can always be found at:
+ <http://www.jus.uio.no/sisu/SiSU/download>
+ <http://www.jus.uio.no/sisu/pkg/src>
+
+Copyright (C) 1997, 1998, 1999, 2000, 20001, 2002, 2003, 2004, 2005
+Ralph Amissah
+
+License: GPL 2 or later
+
+ GPL2 summary:
+
+ 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 2 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 package; 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 from these locations:
+ <http://www.fsf.org/licenses/gpl.html>
+ <http://www.gnu.org/copyleft/gpl.html>
+ <http://www.jus.uio.no/sisu/gpl2.fsf>
+
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL'.
+
+ The Free Software Foundation:
+ <http://www.fsf.org/>
+
+For installation purposes the SiSU tarball includes
+
+setup.rb by Minero Aoki
+
+Hompepage:
+ <http://i.loveruby.net/en/projects/setup/>
+
+License:
+ LGPL
+
+and
+
+install, an installer generated by
+Rant which is by Stefan Lang
+
+Homepage:
+ <http://make.rubyforge.org/>
+
+License:
+ LGPL
+
+NB: Rant is not included in the SiSU tarball, and is not itself required for
+ the Rant generated install file to work
diff --git a/data/doc/sisu/html/README b/data/doc/sisu/html/README
new file mode 100644
index 00000000..1c320ced
--- /dev/null
+++ b/data/doc/sisu/html/README
@@ -0,0 +1 @@
+SiSU man pages 0.48 (last major syntax additions 0.38)
diff --git a/data/doc/sisu/html/homepage/index.html b/data/doc/sisu/html/homepage/index.html
new file mode 100644
index 00000000..8493cffd
--- /dev/null
+++ b/data/doc/sisu/html/homepage/index.html
@@ -0,0 +1,264 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>SiSU information Structuring Universe - Structured
+information, Serialized Units - software for electronic texts,
+documents, books, digital libraries in plaintext, html, xhtml, XML,
+ODF (OpenDocument), LaTeX, pdf, SQL (PostgreSQL and SQLite), and
+for search</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="dc.title" content=
+"SiSU information Structuring Universe, Structured information Serialised Units, 2007" />
+<meta name="dc.creator" content="Ralph Amissah" />
+<meta name="dc.subject" content=
+"ebook, publishing, pdf, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, search, digital library" />
+<meta name="dc.publisher" content=
+"SiSU http://www.jus.uio.no/sisu" />
+<meta name="dc.language" content="en" />
+<meta name="dc.rights" content="Copyright Ralph Amissah" />
+<meta name="generator" content="SiSU 0.48.9 of 2007w01/1 (20070101) (n*x and Ruby!)" />
+<link rel="generator" href="http://www.jus.uio.no/sisu/SiSU" />
+<link rel="stylesheet" href="./_sisu/css/html.css" type="text/css" />
+<link rel="shortcut icon" href="./_sisu/image/rb7.ico" />
+</head>
+<body>
+<div id="top_band">
+<p class="top_band_image">
+ <a href="http://www.jus.uio.no/sisu/SiSU" target="_top" >
+ <img border="0" src="./_sisu/image/sisu.png" alt="SiSU &gt;&gt;">
+ </a>
+</p>
+<h1 class="top_band">
+ SiSU information Structuring Universe
+</h1>
+<h2 class="top_band_tiny">
+ Structured information, Serialized Units
+</h2>
+<h2 class="top_band_tiny">
+software for electronic texts, document collections, books, digital libraries, and search
+</h2>
+<h2 class="top_band_tiny">
+ with "atomic search" and text positioning system (shared text citation numbering: "<i>ocn</i>")
+</h2>
+<h2 class="top_band_tiny">
+outputs include: plaintext, html, xhtml, XML, ODF (OpenDocument), LaTeX, pdf, SQL (PostgreSQL and SQLite)
+</h2>
+</div>
+<div id="column_left">
+<p class="bold">
+ <a href="http://www.jus.uio.no/sisu/SiSU" target="_top" >
+ SiSU
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/1.html#summary" target="_top" >
+ What does SiSU do? Summary
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/2.html" target="_top" >
+ Book Samples and Markup Examples
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/1.html#ocn" target="_top" >
+ Object Citation Numbering - <i>ocn</i>
+ </a>
+</p>
+<p class="tiny">(a text positioning system)</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+<p>
+ <a href="http://www.jus.uio.no/sisu/SiSU/1.html#search" target="_top" >
+ Search - "<i>Atomic</i>"
+ </a>
+</p>
+<p class="tiny">
+ Of interest is the ease of streaming documents to a relational database, at an object (roughly paragraph) level and the potential for increased precision in the presentation of matches that results thereby. The ability to serialise html, LaTeX, XML, SQL, (whatever) is also inherent in / incidental to the design. For a description see the
+ <a href="http://www.jus.uio.no/sisu/sisu_provisional_patent_application_200408" target="_top" >
+ abandoned U.S. provisional patent application
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/download.html" target="_top" >
+ <b>Download</b>
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/changelog.html" target="_top" >
+ Changelog
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/license.html" target="_top" >
+ License
+ </a>
+</p>
+<p class="tiny">
+ Gnu / Linux / Unix
+</p>
+<p class="tiny">
+ =============
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/man" target="_top" >
+ sisu man pages
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="tiny">
+ document preparation can be on any platform, in any editor:
+ (syntax highlight support currently for: vim, kate, write, gedit, diakonos)
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/syntax_highlight" target="_top" >
+ Syntax highlighting
+ </a>
+</p>
+<p class="tiny">
+ =============
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU" target="_top" >
+ * Composite document
+ </a>
+</p>
+<p class="tiny">
+ the composite document is a superset of the following documents:
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_description" target="_top" >
+ SiSU description
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_examples" target="_top" >
+ SiSU examples
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_chronology" target="_top" >
+ SiSU chronology
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_technical_info" target="_top" >
+ SiSU technical
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_faq" target="_top" >
+ SiSU FAQ
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_download" target="_top" >
+ SiSU download
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_changelog" target="_top" >
+ SiSU changelog
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_license" target="_top" >
+ SiSU license
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_standard" target="_top" >
+ SiSU standard
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_provisional_patent_application_200408" target="_top" >
+ SiSU abandoned provisional patent
+ </a>
+</p>
+<p class="tiny">
+ Note: the placement of SiSU documents on the Net predate the release of SiSU.
+</p>
+</div>
+<div id="column_center">
+<p class="bold">
+ For less markup than the most elementary HTML you can have so much more.
+</p>
+<p><a href="http://www.jus.uio.no/sisu/SiSU" target="_top" ><b>SiSU</b> - Structured information, Serialized Units</a> for Electronic Documents, is an information structuring, transforming and publishing framework with the following features:</p>
+<p><b>(i)</b> markup syntax: (a) simpler than html, (b) mnemonic, influenced by mail/messaging/wiki markup practices, (c) human readable, and easily writable,</p>
+<p><b>(ii)</b> (a) minimal markup requirement, (b) single file marked up for multiple outputs,</p>
+<p><b>(iii)</b> (a) multiple outputs include amongst others: html; pdf via LaTeX; (structured) XML; ODF (OpenDocument); sql - currently PostgreSQL (and SQLite); ascii, (also texinfo), (b) takes advantage of the strengths implicit in these very different output types, (e.g. pdfs produced using typsetting of LaTeX, databases populated with documents at an individual object/paragraph level, with implications for search possibilities...)</p>
+<p><b>(iv)</b> provides a common object positioning and citation system for all outputs, which is human relevant and machine usable: <u><i>object citation numbering</i></u>, all objects (paragraphs, headings, verse, tables etc. and images) are numbered identically, for citation purposes, in all outputs (html, pdf, sql etc.),</p>
+<p><b>(v)</b> use of Dublin Core and other meta-tags to permit the addition of some semantic information on documents, and making easy integration of rdf/rss feeds etc.,</p>
+<p><b>(vi)</b> creates organised directory/file structure for (file-system) output, easily mapped with its clearly defined structure, with all text objects numbered, you know in advance where in each document output type, a bit of text will be found (eg. from an sql search, you know where to go to find the prepared html output or pdf etc.)... there is more; easy directory management and document associations, the document preparation (sub-)directory may be used to determine output (sub-)directory, the skin used, and the sql database used,</p>
+<p><b>(vii)</b> search of document sets, at object/paragraph level, the relational database retains information on the document structure, and citation numbering makes it possible for example to present search matches as an index of documents and locations within the document where the match is found,</p>
+<p><b>(viii)</b> "Concordance file" wordmap, consisting of all the words in a document and their (text/ object) locations within the text, (and the possibility of adding vocabularies),</p>
+<p><b>(ix)</b> document content certification and comparison considerations: (a) the document and each object within it stamped with an md5 hash making it possible to easily check or guarantee that the substantive content of a document is unchanged, (b) version control, documents integrated with time based source control system, default RCS or CVS with use of $Id$ tag, which SiSU checks
+<p><b>(x)</b> SiSU's minimalist markup makes for meaningful "diffing" of the substantive content of markup-files,</p>
+<p><b>(xi)</b> easily skinnable, document appearance on a project/site wide, directory wide, or document instance level easily controlled/changed,</p>
+<p><b>(xii)</b> in many cases a regular expression may be used (once in the document header) to define all or part of a documents structure obviating or reducing the need to provide structural markup within the document,</p>
+<p><b>(xiii)</b> is a batch processor for handling large document sets, ... though once generated they need not be re-generated, unless changes are made to the desired presentation of a particular output type,</p>
+<p><b>(xiv)</b> possible to pre-process, which permits: the easy creation of standard form documents, and templates/term-sheets, or; building of composite documents (master documents) from other sisu marked up documents, or marked up parts, i.e. import documents or parts of text into a main document should this be desired</p>
+<p><b>(xv)</b> future proofing, a framework for adding further capability or updating existing capability as required: (a) modular, (thanks in no small part to Ruby) another output format required, write another module....(b) easy to update output formats (eg html, xhtml, latex/pdf produced can be updated in program and run against whole document set), (c) easy to add, modify, or have alternative syntax rules for input, should you need to,</p>
+<p><b>(xvi)</b> scalability, dependent on your file-system (in my case Reiserfs) and on the relational database used (currently Postgresql and SQLite), and your hardware,</p>
+<p><b>(xvii)</b> only marked up files need be backed up, to secure the larger document set produced,</p>
+<p><b>(xviii)</b> document management,</p>
+<p><b>(xix)</b> use your favourite editor, syntax highlighting files for markup, primarily (g)vim so far,</p>
+<p><b>(xx)</b> remote operations: (a) run SiSU on a remote server, (having prepared sisu markup documents locally or on that server, i.e. this solution where sisu is installed on the remote server, would work whatever type of machine you chose to prepare your markup documents on), (b) alternatively, (assuming sisu is available to you locally but not installed on the remote server) configure sisu to securely copy (scp) its output to your remote host and run sisu locally, (c) request a remotely located sisu markup file and process it locally by identifying it by its' url.</p>
+<br />
+<p class="small">
+More information on <a href="http://www.jus.uio.no/sisu/SiSU/"><b>SiSU</b></a> provided at <a href="http://www.jus.uio.no/sisu/SiSU/">www.jus.uio.no/sisu/SiSU</a></p>
+</div>
+<div id="column_right">
+<p class="small">
+ More information on <a href="http://www.jus.uio.no/sisu/SiSU/"><b>SiSU</b></a> provided at:
+ <a href="http://www.jus.uio.no/sisu/SiSU/">
+ www.jus.uio.no/sisu/SiSU
+ </a>
+<p class="tiny">
+SiSU was developed in relation to legal documents, and is strong across a wide variety of texts (law, literature...(humanities, law and part of the social sciences)). SiSU handles images but is not suitable for formulae/ statistics, or for technical writing at this time.</p>
+<p class="tiny">
+SiSU has been developed and has been in use for several years. Requirements to cover a wide range of documents within its use domain have been explored.</p>
+<p class="tiny">
+Some modules are more mature than others, the most mature being Html and LaTeX / pdf. PostgreSQL and search functions are useable and together with <i>ocn</i> unique (to the best of my knowledge). The XML output document set is "well formed" but largely proof of concept, as is the OpenDocument output which is a limited SiSU feature set (SiSU is interested in a very limited ODF feature set).</p>
+<p class="small">
+<a href="mailto://ralph@amissah.com">
+ralph@amissah.com
+</a>
+</p>
+<p class="small">
+<a href="mailto://ralph.amissah@gmail.com">
+ralph.amissah@gmail.com
+</a>
+</p>
+<p class="small">
+2007
+</p>
+<p class="tiny">
+w3 since October 3 1993
+</p>
+</div>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu.1.html b/data/doc/sisu/html/sisu.1.html
new file mode 100644
index 00000000..4922bab1
--- /dev/null
+++ b/data/doc/sisu/html/sisu.1.html
@@ -0,0 +1,1335 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>"sisu"("1") manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<b>sisu</b> <b>[</b> <i>-AabcDdEeFHhIMmNnopqrRSstUuVvwXxYyZz0-9</i>
+<b>] [</b> <i>filename/</i> wildcard <b>]</b> <p>
+<b>sisu</b> <b>[</b> <i>-Ddcv</i> <b>] [</b> <i>instruction</i> <b>]</b> <p>
+<b>sisu</b> <b>[</b> <i>-CcFLSVvW</i>
+<b>]</b> <p>
+Note: commands should be issued from within the directory that contains
+the marked up files, cd to markup directory.
+<h2><a name='sect2' href='#toc2'>Description</a></h2>
+<b>SiSU</b> SiSU is a
+document publishing system, that from a simple single marked-up document,
+produces multiple of output formats including: plaintext, html, LaTeX,
+pdf, xhtml, XML, info, and SQL (PostgreSQL and SQLite), which share numbered
+text objects ("object citation numbering") and the same document structure
+information. For more see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i> <p>
+
+<h2><a name='sect3' href='#toc3'>Summary of man page</a></h2>
+
+<dl>
+
+<dt>This
+man page covers a number of subjects in brief, including: document processing
+command flags; document markup (basic markup and headers); configuration
+files; directory structure; skins; document naming; interactive help and
+other information. </dt>
+<dd> </dd>
+</dl>
+
+<h2><a name='sect4' href='#toc4'>Document Processing Command Flags</a></h2>
+
+<dl>
+
+<dt><b>-A</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces <i>plaintext</i> with <i>dos</i> linefeeds and without markup, (object numbers
+are omitted), has footnotes at end of each paragraph that contains them
+[ <i>-a</i> for equivalent Unix (linefeed) output file] [see <i>-E</i> for endnotes]. </dd>
+
+<dt><b>-a</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces <i>plaintext</i> with <i>Unix</i> linefeeds and without markup, (object numbers
+are omitted), has footnotes at end of each paragraph that contains them
+[ <i>-A</i> for equivalent dos (linefeed) output file] [see <i>-e</i> for endnotes]. </dd>
+
+<dt><b>-b</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces <i>xhtml/XML</i> output for browser viewing (sax parsing). </dd>
+
+<dt><b>-C</b><i>&nbsp;[--init=site]</i>
+</dt>
+<dd><i>configure/initialise</i> shared output directory files initialize shared output
+directory (config files such as css and dtd files are not updated if they
+already exist unless modifier is used). <b>-C</b><i>&nbsp;--init=site</i> <i>configure/initialise</i>
+site more extensive than <i>-C</i> on its own, shared output directory files/force
+update, existing shared output config files such as css and dtd files are
+updated if this modifier is used. </dd>
+
+<dt><b>-c</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>screen <i>toggle</i> ansi
+screen colour on or off depending on default set (unless -c flag is used:
+if sisurc colour default is set to &rsquo;true&rsquo;, output to screen will be with
+colour, if sisurc colour default is set to &rsquo;false&rsquo; or is undefined screen
+output will be without colour). </dd>
+
+<dt><b>-D</b><i>&nbsp;[instruction]</i><b>&nbsp;[filename]</b> </dt>
+<dd>database postgresql
+( <i>--pgsql</i> may be used instead) possible instructions, include: <i>--createdb;</i>
+<i>--create;</i> <i>--dropall;</i> <i>--import</i> &nbsp;[filename]; <i>--update</i> &nbsp;[filename]; <i>--remove</i> &nbsp;[filename];
+see database section below. </dd>
+
+<dt><b>-d</b><i>&nbsp;[--db-[database</i><b>&nbsp;type</b><i>&nbsp;(sqlite|pg)]]</i><b>&nbsp;--[instruction]</b><i>&nbsp;[filename]</i>
+</dt>
+<dd>database type default set to sqlite, (for which <i>--sqlite</i> may be used instead)
+or to specify another database <i>--db-[pgsql,</i> sqlite] (however see -D) possible
+instructions include: <i>--createdb;</i> <i>--create;</i> <i>--dropall;</i> <i>--import</i> &nbsp;[filename]; <i>--update</i>
+&nbsp;[filename]; <i>--remove</i> &nbsp;[filename]; see database section below. </dd>
+
+<dt><b>-E</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces <i>plaintext</i> with <i>dos</i> linefeeds, and without markup, endnotes follow
+the main text (in <i>-a</i> endnotes follow the paragraphs that contain them).
+There are no object numbers [see <i>-e</i> for Unix (linefeed) output file] [see
+<i>-A</i> for footnotes]. </dd>
+
+<dt><b>-e</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>produces <i>plaintext</i> with <i>Unix</i> linefeeds,
+and without markup, endnotes follow the main text. Object numbers are omitted.
+[ <i>-E</i> for equivalent dos (linefeed) output file] [ <i>-a</i> for footnotes]. </dd>
+
+<dt><b>-F</b><i>&nbsp;[--webserv=webrick]</i>
+</dt>
+<dd>generate examples of (naive) <i>cgi</i> search form for <i>sqlite</i> and <i>pgsql</i> depends
+on your already having used sisu to populate an sqlite and/or pgsql database,
+(the sqlite version scans the output directories for existing sisu_sqlite
+databases, so it is first necessary to create them, before generating the
+search form) see <i>-d</i> <i>-D</i> and the <i>database</i> section below. If the optional
+parameter <i>--webserv=webrick</i> is passed, the cgi examples created will be set
+up to use the default port set for use by the webrick server, (otherwise
+the port is left blank and the system setting used, usually 80). The samples
+are dumped in the present work directory which must be writable, (with
+screen instructions given that they be copied to the <i>cgi-bin</i> directory).
+<i>-Fv</i> (in addition to the above) provides some information on setting up
+<i>hyperestraier</i> for sisu </dd>
+
+<dt> <b>-H</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>produces <i>html</i> without
+link suffixes (.html .pdf etc.) ("Hide"). Requires an appropriately configured
+web server. [behaviour switched after 0.35 see -h]. </dd>
+
+<dt><b>-h</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>produces
+ <i>html</i> (with hardlinks i.e. with name suffixes in links/local urls). html,
+with internal document links that include the document suffix, i.e. whether
+it is .html or .pdf (required for browsing directly off a file system, and
+works with most web servers). [behaviour switched after 0.35 see -H]. </dd>
+
+<dt><b>-I</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces <i>texinfo</i> file. </dd>
+
+<dt><b>-L</b> </dt>
+<dd>prints license information. </dd>
+
+<dt><b>-M</b><i>&nbsp;[filename/wildcard/url]</i>
+</dt>
+<dd><i>maintenance</i> mode files created for processing preserved and their locations
+indicated. (also see -V) </dd>
+
+<dt><b>-m</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
+<dd>assumed for most other
+flags, creates new meta-markup file, (the <i>metaverse</i> ) that is used in all
+subsequent processing of other output. This step is assumed for most processing
+flags. To skip it see <i>-n</i> </dd>
+
+<dt><b>-N</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
+<dd>document <i>digest</i> or <i>document</i>
+content certificate ( <i>DCC</i> ) as <i>md5</i> digest tree of the document: the digest
+for the document, and digests for each object contained within the document
+(together with information on software versions that produced it) (digest.txt).
+<i>-NV</i> for verbose digest output to screen. </dd>
+
+<dt><b>-n</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
+<dd>skip meta-markup
+(building of "metaverse"), this skips the equivalent of <i>-m</i> which is otherwise
+assumed by most processing flags. </dd>
+
+<dt><b>-o</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
+<dd>output basic
+document in <i>opendocument</i> file format (opendocument.odt). </dd>
+
+<dt><b>-p</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces <i>LaTeX</i> pdf (portrait.pdf &amp; landscape.pdf). Default paper size is set
+in config file, or document header, or provided with additional command
+line parameter, e.g. <i>--papersize-a4</i> preset sizes include: &rsquo;A4&rsquo;, U.S. &rsquo;letter&rsquo; and
+&rsquo;legal&rsquo; and book sizes &rsquo;A5&rsquo; and &rsquo;B5&rsquo; (system defaults to A4). </dd>
+
+<dt><b>-q</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd><i>quiet</i> less output to screen. </dd>
+
+<dt><b>-R</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd><i>copies</i> sisu output files
+to <i>remote</i> host using rsync. This requires that sisurc.yml has been provided
+with information on hostname and username, and that you have your "keys"
+and ssh agent in place. Note the behavior of rsync different if -R is used
+with other flags from if used alone. Alone the rsync --delete parameter is
+sent, useful for cleaning the remote directory (when -R is used together
+with other flags, it is not). Also see <i>-r</i> </dd>
+
+<dt><b>-r</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd><i>copies</i> sisu
+output files to <i>remote</i> host using scp. This requires that sisurc.yml has
+been provided with information on hostname and username, and that you have
+your "keys" and ssh agent in place. Also see <i>-R</i> </dd>
+
+<dt><b>-S</b> </dt>
+<dd>produces a <i>sisupod</i> a zipped
+sisu directory of markup files including <i>sisu</i> markup source files and
+the directories local <i>configuration</i> file, <i>images</i> and <i>skins.</i> <b>Note:</b> this
+only includes the configuration files or skins contained in <i>./_sisu</i> not
+those in <i>~/.sisu</i> <i>-S</i> &nbsp;[filename/wildcard] option. <b>Note:</b> (this option is tested
+only with zsh). </dd>
+
+<dt><b>-S</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>produces a zipped file of the prepared
+document specified along with associated images, by default named <i>sisupod.zip</i>
+they may alternatively be named with the filename extension <i>.ssp</i> This provides
+a quick way of gathering the relevant parts of a sisu document which can
+then for example be emailed. A sisupod includes <i>sisu</i> markup source file,
+ (along with associated documents if a master file, or available in multilingual
+versions), together with related <i>images</i> and <i>skin.</i> SiSU commands can be
+run directly against a sisupod contained in a local directory, or provided
+as a url on a remote site. As there is a security issue with skins provided
+by other users, they are not applied unless the flag --trust or --trusted is
+added to the command instruction, it is recommended that file that are
+not your own are treated as untrusted. The directory structure of the unzipped
+file is understood by sisu, and sisu commands can be run within it. <b>Note:</b>
+if you wish to send multiple files, it quickly becomes more space efficient
+to zip the sisu markup directory, rather than the individual files for
+sending). See the <i>-S</i> option without [filename/wildcard]. </dd>
+
+<dt><b>-s</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>copies sisu markup file to output directory. </dd>
+
+<dt><b>-t</b><i>&nbsp;[filename/wildcard</i><b>&nbsp;(*.termsheet.rb)]</b>
+</dt>
+<dd>standard form document builder, preprocessing feature </dd>
+
+<dt><b>-U</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>prints <i>url</i> output list/map for the available processing flags options
+and resulting files that could be requested, (can be used to get a list
+of processing options in relation to a file, together with information
+on the output that would be produced), <i>-u</i> provides <i>url</i> output mapping
+for those flags requested for processing. The default assumes sisu_webrick
+is running and provides webrick url mappings where appropriate, but these
+can be switched to file system paths in sisurc.yml </dd>
+
+<dt><b>-u</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>provides <i>url</i> mapping of output files for the flags requested for processing,
+also see <i>-U</i> </dd>
+
+<dt><b>-V</b> </dt>
+<dd>on its own, provides SiSU <i>version</i> and <i>environment</i> information
+(sisu --help env) </dd>
+
+<dt><b>-V</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>even more <i>verbose</i> than the <i>-v</i> flag.
+(also see -M) </dd>
+
+<dt><b>-v</b> </dt>
+<dd>on its own, provides SiSU <i>version</i> information </dd>
+
+<dt><b>-v</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>provides <i>verbose</i> output of what is being built, where it is being built
+(and error messages if any), as with <i>-u</i> flag provides a url mapping of
+files created for each of the processing flag requests. See also <b>-V</b> </dd>
+
+<dt><b>-W</b> </dt>
+<dd>starts
+ruby&rsquo;s <i>webrick</i> webserver points at sisu output directories, the default
+port is set to 8081 and can be changed in the resource configuration files.
+[tip: the webrick server requires link suffixes, so html output should
+be created using the <i>-h</i> option rather than <i>-H</i> ; also, note <i>-F</i> webrick
+]. </dd>
+
+<dt><b>-w</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>produces <i>concordance</i> (wordmap) a rudimentary
+index of all the words in a document. </dd>
+
+<dt><b>-X</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>produces <i>XML</i>
+output with deep document structure, in the nature of dom. </dd>
+
+<dt><b>-x</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces <i>XML</i> output shallow structure (sax parsing). </dd>
+
+<dt><b>-Y</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces a short sitemap entry for the document, based on html output and
+the sisu_manifest. <i>--sitemaps</i> generates/updates the sitemap index of existing
+sitemaps. (Experimental, [g,y,m announcement this week]) </dd>
+
+<dt><b>-y</b><i>&nbsp;[filename/wildcard]</i>
+</dt>
+<dd>produces an html summary of output generated (hyperlinked to content) and
+document specific metadata (sisu_manifest.html). This step is assumed for
+most processing flags. </dd>
+
+<dt><b>-Z</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>Zap, if used with other processing
+flags <i>deletes</i> output files of the type about to be processed, prior to
+processing. If -Z is used as the lone processing related flag (or in conjunction
+with a combination of -[mMvVq]), will remove the related document output
+directory. </dd>
+
+<dt><b>-z</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>produces <i>php</i> (zend) [this feature is disabled
+for the time being] </dd>
+</dl>
+
+<h2><a name='sect5' href='#toc5'>modifiers</a></h2>
+
+<dl>
+
+<dt><b>--no-ocn</b> </dt>
+<dd>[with -h -H or -p] switches off object
+citation numbering. Produce output without identifying numbers in margins
+of html or LaTeX/pdf output. </dd>
+
+<dt><b>--no-annotate</b> </dt>
+<dd>strips output text of editor endnotes~[*
+square brackets ]~ denoted by asterisk or dagger/plus sign </dd>
+
+<dt><b>--no-asterisk</b> </dt>
+<dd>strips
+output text of editor endnotes~[* square brackets ]~ denoted by asterisk
+sign </dd>
+
+<dt><b>--no-dagger</b> </dt>
+<dd>strips output text of editor endnotes~[+ square brackets
+]~ denoted by dagger/plus sign </dd>
+</dl>
+
+<h2><a name='sect6' href='#toc6'>databases</a></h2>
+
+<dl>
+
+<dt>dbi - database interface
+</dt>
+<dd><b>-D</b> or <b>--pgsql</b> set for <i>postgresql</i> <b>-d</b> or <b>--sqlite</b> default set for <i>sqlite</i> -d is
+modifiable with --db=[database &nbsp;type &nbsp;(pgsql &nbsp;or &nbsp;sqlite)] </dd>
+
+<dt><b>-Dv --createall</b> </dt>
+<dd>initial
+step, creates required relations (tables, indexes) in existing postgresql
+database (a database should be created manually and given the same name
+as working directory, as requested) (rb.dbi) [ <i>-dv</i> --createall sqlite equivalent]
+it may be necessary to run sisu <i>-Dv</i> --createdb initially </dd>
+
+<dt>NOTE: at the present
+time for postgresql it may be necessary to manually create the database.
+The command would be </dt>
+<dd><i>&rsquo;createdb</i> [database name]&rsquo; where database name would
+be SiSU_[present working directory name (without path)]. Please use only
+alphanumerics and underscores. </dd>
+
+<dt><b>-Dv --import </b> </dt>
+<dd><i>[filename/wildcard]</i> imports data
+specified to postgresql db (rb.dbi) [ <i>-dv</i> --import sqlite equivalent] </dd>
+
+<dt><b>-Dv --update
+</b> </dt>
+<dd><i>[filename/wildcard]</i> updates/imports specified data to postgresql db (rb.dbi)
+[ <i>-dv</i> --update sqlite equivalent] </dd>
+
+<dt><b>-D --remove</b> </dt>
+<dd><i>[filename/wildcard]</i> removes specified
+data to postgresql db (rb.dbi) [ <i>-d</i> --remove sqlite equivalent] </dd>
+
+<dt><b>-D --dropall</b>
+</dt>
+<dd>kills data" and drops (postgresql or sqlite) db, tables &amp; indexes [ <i>-d</i> --dropall
+sqlite equivalent] </dd>
+
+<dt>The v in e.g. -Dv is for verbose output. </dt>
+<dd></dd>
+</dl>
+</blockquote>
+
+<h2><a name='sect7' href='#toc7'>Shortcuts, Shorthand
+for multiple flags</a></h2>
+
+<dl>
+
+<dt><b>--update</b><i>&nbsp;[filename/wildcard]</i> </dt>
+<dd>Checks existing file output
+and runs the flags required to update this output. This means that if only
+html and pdf output was requested on previous runs, only the -hp files will
+be applied, and only these will be generated this time, together with the
+summary. This can be very convenient, if you offer different outputs of
+different files, and just want to do the same again. </dd>
+
+<dt>-0 to -5 [filename or
+wildcard] </dt>
+<dd>Default shorthand mappings (note that the defaults can be
+changed/configured in the sisurc.yml file): </dd>
+</dl>
+<p>
+<i>-0</i> -mNhwpAobxXyYv [this is the
+default action run when no options are give, i.e. on &rsquo;sisu [filename]&rsquo;] <p>
+<i>-1</i> -mNHwpy
+<p>
+<i>-2</i> -mNHwpaoy <p>
+<i>-3</i> -mNhwpAobxXyY <p>
+<i>-4</i> -mNhwpAobxXDyY &nbsp;--import <p>
+<i>-5</i> -mNhwpAobxXDyY &nbsp;--update
+<p>
+add <i>-v</i> for verbose mode and <i>-c</i> for color, e.g. <i>sisu</i> -2vc [filename or wildcard]
+<p>
+consider <i>-u</i> for appended url info or <i>-v</i> for verbose output
+<h2><a name='sect8' href='#toc8'>Document Markup</a></h2>
+<b>SiSU
+Markup</b> an incomplete summary. <p>
+<b>Note:</b> files should be marked up for SiSU
+using <i>UTF-8</i> encoding. <p>
+Some interactive help on markup is available, by typing
+ <i>sisu</i> and selecting <i>markup</i> or <i>sisu</i> --help markup
+<dl>
+
+<dt>Sample markup files can
+be used as examples: </dt>
+<dd><i>&lt;<a href='http://www.jus.uio.no/sisu/sample'>http://www.jus.uio.no/sisu/sample</a>
+&gt;</i> </dd>
+
+<dt>actual marked up plaintext
+files ready for use: </dt>
+<dd><i>&lt;<a href='http://www.jus.uio.no/sisu/sample/markup'>http://www.jus.uio.no/sisu/sample/markup</a>
+&gt;</i> </dd>
+
+<dt>as html with
+syntax highlighting for viewing: </dt>
+<dd><i>&lt;<a href='http://www.jus.uio.no/sisu/sample/syntax'>http://www.jus.uio.no/sisu/sample/syntax</a>
+&gt;</i>
+</dd>
+
+<dt>an alternative presentation of markup syntax: </dt>
+<dd><i>&lt;<a href='http://www.jus.uio.no/sisu/sample/on_markup.txt'>http://www.jus.uio.no/sisu/sample/on_markup.txt</a>
+&gt;</i>
+ </dd>
+</dl>
+
+<h2><a name='sect9' href='#toc9'>Basic Markup</a></h2>
+Data text markup (alternative to available html subset) <p>
+Heading
+levels are :A~ ,:B~ ,:C~ ,1~ ,2~ ,3~ ... :A - :C being part / section headings,
+followed by other heading levels, and 1 -6 being headings followed by substantive
+text or sub-headings. <i>:A~</i> usually the title <i>:A~?</i> conditional level 1 heading
+(used where a stand-alone document may be imported into another) <p>
+<i>1~filename</i>
+level 1 heading, the primary division such as Chapter that is followed
+by substantive text, and may be further subdivided (this is the level on
+which by default html segments are made) <p>
+<i>!{</i> emphasis <i>}!</i> <p>
+<i>*{</i> bold text <i>}*</i>
+<p>
+<i>_{</i> underscore <i>}_</i> <p>
+<i>/{</i> italics <i>}/</i> <p>
+<i>&rsquo;"{</i> citation <i>}"</i> <p>
+<i>^{</i> superscript <i>}^</i> <p>
+<i>,{</i> subscript
+<i>},</i> <p>
+<i>+{</i> inserted text <i>}+</i> <p>
+<i>-{</i> strikethrough <i>}-</i>
+<h2><a name='sect10' href='#toc10'>Footnotes/Endnotes</a></h2>
+<p>
+<i>~{</i> a footnote
+or endnote <i>}~</i> <p>
+footnote/endnote <i>~{</i> self contained endnote marker &amp; endnote
+in one <i>}~</i> <p>
+<i>~{*</i> unnumbered asterisk footnote/endnote, insert multiple asterisks
+if required <i>}~</i> <p>
+<i>~[*</i> editors notes, numbered asterisk footnote/endnote series
+<i>]~</i> (+ the plus sign may be used as well) <p>
+alternative endnote pair notation:
+<p>
+<i>~^</i> endnote marker <p>
+<i>^~</i> endnote text following the paragraph in which the marker
+occurs
+<h2><a name='sect11' href='#toc11'>Line Operations (marker placed at start of line)</a></h2>
+<p>
+<i>!_</i> bold line <p>
+<i>_1</i>
+indent paragraph one level <p>
+<i>_2</i> indent paragraph two steps <p>
+<i>_*</i> bullet paragraph
+<p>
+<i>#</i> number paragraph (see headers for numbering document headings)
+<p>
+<i>_#</i> number paragraph level 2 (see headers for numbering document headings)
+
+<h2><a name='sect12' href='#toc12'>Links</a></h2>
+<p>
+<i>{</i> link name <i>}<a href='http://url.org'>http://url.org</i></a>
+ <p>
+<i>{</i> image.png <i>}<a href='http://url.org'>http://url.org</i></a>
+ <p>
+<i>{</i> image.png <i>}image</i>
+<p>
+<i>{</i> tux.png 64x80 <i>}image</i> <p>
+NOTE: (a) png and jpg support only (no gif) (b) width
+x height, not required if imagemagick is installed, (where provided, dimensions
+may be smaller than the actual image), [images should be no larger than
+width: 480 and height: 640] <p>
+the shortcut: <p>
+<i>{~^</i> [text to link] <i>}<a href='http://url.org'>http://url.org</i></a>
+
+<p>
+is equivalent to: <p>
+<i>{</i> [text to link] <i>}<a href='http://url.org'>http://url.org</i></a>
+ <i>~{</i> <a href='http://url.org'>http://url.org</a>
+ <i>}~</i>
+<p>
+(which produces hyper-linked text within a document/paragraph, with an endnote
+providing the url for the text location used in the hyperlink) <p>
+url example:
+<p>
+<i>{</i> SiSU Geek Writer <i>}<a href='http://www.jus.uio.no/sisu/'>http://www.jus.uio.no/sisu/</i></a>
+ <p>
+linked image: <p>
+<i>{</i> tux.png 64x80
+"a better way" <i>}<a href='http://www.jus.uio.no/sisu/'>http://www.jus.uio.no/sisu/</i></a>
+ image example with all options
+<p>
+note width x height <p>
+the shortcut: <p>
+<i>{</i> [text to link] <i>[3sS]}markup_source_filename.sst</i>
+<p>
+if a server host name has been provided/configured, will provide a list
+of available output types that would be generated using the shortcut command
+and the markup file provided, i.e. output generated using the command (as
+configured): "sisu -3sS markup_source_filename.sst", using server host, directory
+stub, filename to compose the link.
+<h2><a name='sect13' href='#toc13'>Adding a fixed names in html</a></h2>
+<p>
+<i>*~[name]</i>
+manual location marker/tagging at present only in html to produce &lt;a name="[name]"&gt;&lt;/a&gt;
+(use sparingly) <blockquote>note at a heading level the same is automatically achieved
+by providing names to headings 5 and 6 i.e. 5~[name] and 6~[name] or in the
+case of auto-heading numbering, without further intervention. </blockquote>
+
+<h2><a name='sect14' href='#toc14'>Escape object
+citation numbering</a></h2>
+<p>
+(place marker at end of paragraph) <p>
+<i>~#</i> unnumbered paragraph
+<p>
+<i>-#</i> unnumbered paragraph, delete when not required (place marker at end of
+paragraph) [used in dummy headings, eg. for segmented html] <p>
+It is convenient
+to mention here that the <i>-0</i> flag generates html and latex/pdf output without
+visible object character numbers. <p>
+<i>sisu</i> -0 [filename.sst]
+<h2><a name='sect15' href='#toc15'>Page breaks (LaTeX/pdf)</a></h2>
+<p>
+page
+breaks are introduced to pdfs either as header instructions, indicating
+that pages should break at given levels, and mentioned in the header section,
+or manually, using the following notation <p>
+<i>&lt;:pb&gt;</i> page break, which breaks
+a page, starting a new page in single column text and a new column in double
+column text <p>
+<i>&lt;:pn&gt;</i> page new, which starts a new page, in both single and double
+column text (leaving an empty column in double column text if necessary).
+
+<h2><a name='sect16' href='#toc16'>Comment line</a></h2>
+<p>
+<i>%</i> ignored by sisu in processing if placed at beginning of
+line <p>
+<i>%%</i> ignored by sisu in processing if placed at beginning of line, used
+for folding by vim folds
+<h2><a name='sect17' href='#toc17'>Special characters</a></h2>
+special characters can be escaped
+with a backslash <i>{</i> } &lt; &gt; are contextual special characters, (in combination
+with other characters). <i>~</i> - _ / % ^ and occasionally <i>!</i> # + , are special characters
+in particular circumstances, see the syntax chart. [note that SiSU is not
+optimised for technical writing]
+<h2><a name='sect18' href='#toc18'>Tables</a></h2>
+<p>
+<i>table{</i> [number of columns] [column
+width %];[column width %]
+<p> [table content, line breaks are important
+see example below]<br>
+
+<p> <i>}table</i>
+<p> sample table:<br>
+
+<p> <i>table{~h</i> c3; 26; 32; 32;
+<p> This is a table, column1<br>
+ this would become row one of column two<br>
+ column three of row one is here<br>
+
+<p> column one row 2<br>
+ column two of row two<br>
+ column three of row two, and so on<br>
+
+<p> column one row three<br>
+ and so on<br>
+ here<br>
+ <br>
+ <i>}table</i>
+<p> whole table gets an object citation number
+<p>
+<h2><a name='sect19' href='#toc19'>Other Grouped or
+Pre-formatted Text</a></h2>
+<i>poem{</i>
+<p> [Text here]<br>
+
+<p> [Text here]<br>
+
+<p> <i>}poem</i>
+<p> each verse is given an object citation number
+<p> ----<br>
+
+<p> <i>group{</i>
+<p> [Text here]<br>
+
+<p> <i>}group</i>
+<p> whole group gets an object citation number
+<p> ----<br>
+
+<p> <i>code{</i>
+<p> [Text here]<br>
+
+<p> <i>}code</i>
+<p> whole group gets an object citation number
+<p>
+<h2><a name='sect20' href='#toc20'>Composite Documents</a></h2>
+<p>
+It
+is possible to build a document by requiring other documents. The documents
+required may complete documents that could be generated independently,
+or they could be markup snippets, prepared so as to be easily available
+to be placed within another text. If the calling document is a master document
+(built mainly from other documents), by convention it should be named with
+the suffix <i>.ssm</i> (master) Within this document you would provide information
+on the other documents that should be included within the text. These may
+be other documents that would be processed in a regular way, or markup
+bits prepared only for inclusion within a master document <i>.sst</i> regular markup
+file, or <i>.ssi</i> (insert/information) <i>.sst</i> A secondary file of the composite
+document is built prior to processing with the same prefix and the suffix
+ <i>._sst</i> and <i>._sst</i> There are a number of alternative syntaxes for requiring
+external documents in order to permit use of ascii hypertext linking available
+in the vim editor. They are as follows:
+<p>
+<dl>
+
+<dt>basic markup for importing a document
+</dt>
+<dd>
+<p> <i>r{</i> filename <i>}</i>
+<p> <i>{</i> filename.si <i>}require</i>
+<p> <i>&lt;&lt;</i> { filename.si <i>}</i> #for vim folds
+<p>
+</dd>
+
+<dt>importing a document with textlink syntax </dt>
+<dd>
+<p> <i>|filename.si|@|^|require</i>
+<p> <i>&lt;&lt;</i> |filename.si|@|^|
+
+<p>#for vim folds
+<p> </dd>
+
+<dt>importing a document with thlnk syntax </dt>
+<dd>
+<p> <i>&lt;url:filename.si&gt;require</i>
+
+<p> <i>&lt;&lt;</i> &lt;url:filename.si&gt; #for vim folds
+<p> </dd>
+
+<dt>remote documents may be called with the
+thlnk syntax (or regular sisu syntax), e.g. </dt>
+<dd>
+<p> <i>&lt;&lt;</i> &lt;url:<a href='http://www.url.com/filename.si'>http://www.url.com/filename.si</a>
+&gt;
+
+<p> </dd>
+</dl>
+
+<h2><a name='sect21' href='#toc21'>Document Headers</a></h2>
+Header tags appear at the beginning of a document and
+provide meta information on the document (such as the Dublin Core), or
+information as to how the document as a whole is to be processed.
+<p> All
+header instructions may take either form: <i>@headername:</i> [introduced in 0.38]
+
+<p>or <i>0~headername</i> All Dublin Core meta tags are available
+<p> <i>@indentifier:</i>
+information or instructions [introduced in 0.38]
+<p> or
+<p> <i>0~indentifier</i> information
+or instructions, old equivalent, depreciated
+<p> where the "identifier" is
+a tag recognised by the program, and the "information" or "instructions"
+belong to the tag/indentifier specified.
+<p> Note: a header where used should
+only be used once; all headers apart from @title: (0~title) are optional;
+the @structure: (0~toc) header is used to describe document structure,
+and can be useful to know.
+<p> @structure: PART; CHAPTER; SECTION; ARTICLE;
+none; none;
+<p> structure can be defined by a match words or regular expression
+(the regular expression is assumed to start at the beginning of a line
+of text i.e. ^)
+<p> For help see one of the following (and markup samples):<br>
+
+<p> * interactive help - type &rsquo;sisu --help headers&rsquo;<br>
+
+<p> * marked up text samples<br>
+
+<p> * the SiSU_Markup.txt file provided with the program<br>
+
+<p> * an outline of headers is provided below --&gt;<br>
+
+<h2><a name='sect22' href='#toc22'>Outline of header options</a></h2>
+<i>%</i> SiSU 0.38 [declared file-type identifier with
+markup version]
+<p> <i>@title:</i> My Title - This is now the Title of the Document
+
+<p>and used as such
+<p> <i>@subtitle:</i> The Subtitle if any
+<p> <i>@creator:</i> [or ~author]
+
+<p>Ralph Amissah
+<p> <i>@subject:</i> (whatever your subject)
+<p> <i>@description:</i>
+<p> <i>@publisher:</i>
+
+<p> <i>@contributor:</i>
+<p> <i>@translator:</i> [or ~translated_by]
+<p> <i>@illustrator:</i> [or ~illustrated_by]
+
+<p> <i>@prepared_by:</i> [or ~digitized_by]
+<p> <i>@date:</i> 2000-08-27 [ also @date.created:
+@date.issued: @date.available: @date.valid: @date.modified: ]
+<p> <i>@type:</i> article
+
+<p> <i>@format:</i>
+<p> <i>@identifier:</i>
+<p> <i>@source:</i>
+<p> <i>@language:</i> [or @language.document:]
+language in which current version of document is published. Some country
+settings result in processing adjustments, e.g. in LaTeX hyphenation, some
+country codes are recognized, but the language name in Engish is preferred.
+English is the default setting. (en - English, fr - French, de - German, it
+- Italian, es - Spanish, pt - Portuguese, sv - Swedish, da - Danish, fi - Finnish,
+no - Norwegian, is - Icelandic, nl - Dutch, ee - Estonian, hu - Hungarian, pl
+- Polish, ro - Romanian, ru - Russian, gl - Greek, uk - Ukranian, tr - Turkish,
+si - Slovene, sk - Slovak, hr - Croatian, cs - Czech, bg - Bulgarian ) [however,
+encodings are not available for all of the languages listed.]
+<p> <i>@language.original:</i>
+
+<p>original language in which the work was published
+<p> <i>@papersize:</i> (A4|US_letter|book_B5|book_A5|US_legal)
+
+<p> <i>@relation:</i>
+<p> <i>@coverage:</i>
+<p> <i>@rights:</i> copyright, all rights reserved, public
+domain, copyleft, creative commons variant, etc.
+<p> <i>@owner:</i>
+<p> <i>@keywords:</i> text
+document generation processing management LaTeX pdf structured XML citation
+[your keywords here, used for example by rss feeds, and in sql sear ches]
+
+<p> <i>@abstract:</i> [paper abstract, placed after table of contents]
+<p> <i>@comment:</i>
+[...]
+<p> <i>@catalogue:</i> loc=[Library of Congress classification]; dewey=[Dewey
+classification]; isbn=[ISBN]; pg=[Project Gutenberg text number]
+<p> <i>@classify_loc:</i>
+
+<p>Library of Congress classification
+<p> <i>@classify_dewey:</i> Dewey classification
+
+<p> <i>@classify_isbn:</i> ISBN
+<p> <i>@classify_pg:</i> Project Gutenberg text number
+<p> <i>@prefix_a:</i>
+[prefix is placed just before table of contents - not implemented]
+<p> <i>@prefix_b:</i>
+or @prefix: [prefix is placed just after table of contents]
+<p> <i>@rcs:</i> $Id$
+[or <i>@cvs:</i> used by rcs or cvs to embed version (revision control) information
+into document, rcs or cvs can usefully provide a history of updates to
+a document ]
+<p> <i>@structure:</i> PART; CHAPTER; SECTION; ARTICLE; none; none;
+optional, where document structure can be defined by a match words or regular
+expression (the regular expression is assumed to start at the beginning
+of a line of text i.e. ^) default markers :A~ to :C~ and 1~ to 6~ can be used
+within text instead, without this header ta g, and may be used to supplement
+the instructions provided in this header tag if provided (@structure: is
+a synonym for @toc:)
+<p> <i>@markup:</i> information on the markup used, e.g. <i>new=1,2,3;</i>
+break=4; num_top=4 [or newpage=1,2,3; breakpage=4; num_top=4] newpage and
+breakpage, heading level, used by LaTeX to breakpages. breakpage: starts
+on a new page in single column text and on a new column in double column
+text; newpage: starts on a new page for both single and double column texts.
+<i>num_top=4</i> [auto-number document, starting at level 4. the default is to provide
+3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged
+within level] <i>num_extract</i> [take numbering of headings provided (manually
+in marked up source document), and use for numbering of segments. Available
+where a clear numbering structure is provided within document, without
+the repetition of a number in a header.] [In 0.38 notation, you would map
+to the equivalent levels, the examples provided would map to the following
+new=A,B,C; break=1; num_top=1 [or newpage=A,B,C; breakpage=1; num_top=1]
+see headings]
+<p> <i>@bold:</i> [regular expression of words/phrases to be made bold]
+
+<p> <i>@italics:</i> [regular expression of words/phrases to italicise] <br>
+ <i>@vocabulary:</i> name of taxonomy/vocabulary/wordlist to use against document
+
+<p> <i>@skin:</i> skin_doc_[name_of_desired_document_skin]
+<p> <i>@links:</i> { SiSU }<a href='http://www.jus.uio.no/sisu/'>http://www.jus.uio.no/sisu/</a>
+
+{ FSF }<a href='http://www.fsf.org'>http://www.fsf.org</a>
+
+<p> <i>@promo:</i> sisu, ruby, search_libre_docs, open_society
+[places content in right pane in html, makes use of list.yml and promo.yml,
+commented out sample in document sample: free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams.sst]
+
+<p> <i>:A~</i> Top level heading [this usually has similar content to the title @title:
+] NOTE: the heading levels described here are in 0.38 notation, see heading
+
+<p> <i>:B~</i> Second level heading [this is a heading level divider]
+<p> <i>:C~</i> Third
+level heading [this is a heading level divider]
+<p> <i>1~</i> Top level heading preceding
+substantive text of document or sub-heading 2, the heading level that would
+normally be marked 1. or 2. or 3. etc. in a document, and the level on which
+sisu by default would break html output into named segments, names are
+provided automatically if none are given (a number), otherwise takes the
+
+<p>form 1~my_filename_for_this_segment
+<p> <i>2~</i> Second level heading preceding
+substantive text of document or sub-heading 3 , the heading level that would
+normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc. in a document.
+<p> <i>3~</i> Third level
+heading preceding substantive text of document, that would normally be
+marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document
+<p> NOTE: headers and heading
+levels used in the description provided refer to 0.38 markup (a conversion
+script provided in sisu-examples, modify.rb makes conversion between 0.37
+and 0.38 markup simple)
+<p> For some help on document structure try
+<p> <i>sisu</i> --help
+
+<p>headings
+<p> and view sample markup documents provided
+<p>
+<p>
+<h2><a name='sect23' href='#toc23'>Configuration
+Files</a></h2>
+<p>
+Some configuration is required for SiSU, specifying in which directory
+processing should be done, and where the generated output should be placed.
+<p>
+SiSU resource configuration is determined by looking at the following files
+if they exist: <p>
+<i>./_sisu/sisurc.yml</i> <p>
+<i>~/.sisu/sisurc.yml</i> <p>
+<i>/etc/sisu/sisurc.yml</i> <p>
+In
+the absence of instructions in any of these it falls back to the internal
+program defaults. <p>
+Configuration determines the output and processing directories
+and the database access details. <p>
+A sample sisurc.yml may be found in /etc/sisu/sisurc.yml
+
+<p>
+<h2><a name='sect24' href='#toc24'>More HELP on Markup and headers</a></h2>
+type: sisu ~<br>
+ sisu --help<br>
+
+<p> markup help is available on:<br>
+ document wide instructions: headers (document structure)<br>
+ general text markup: headings; endnotes; tables<br>
+
+<p> A markup table and sample marked-up files (also in html with syntax highlighting)
+are available at:
+<p> <i>&lt;<a href='http://www.jus.uio.no/sisu/sample'>http://www.jus.uio.no/sisu/sample</a>
+&gt;</i>
+<p>
+<h2><a name='sect25' href='#toc25'>DIRECTORY STRUCTURE
+&amp; Document Output</a></h2>
+
+<dl>
+
+<dt>SiSU determines output directories by looking at the resource
+configuration files, and in their absence the programs internal defaults.
+</dt>
+<dd> </dd>
+</dl>
+
+<h2><a name='sect26' href='#toc26'>Default Directories</a></h2>
+
+<dl>
+
+<dt>In the absence of other specifications in </dt>
+<dd><i>~/.sisu/sisurc.yml</i>
+in <i>/etc/sisu/sisurc.yml</i> SiSU writes to the following directories, processing
+files are placed in sub-directories within <i>./_sisu/processing</i> and if that
+is not writable to <i>/tmp/sisu_processing</i> </dd>
+</dl>
+<p>
+Output is written to sub-directories
+within <i>/var/www/</i> if it exists and is writable, and otherwise to <i>~/sisu_output</i>
+
+<h2><a name='sect27' href='#toc27'>Markup Document Directories and File Mapping</a></h2>
+
+<dl>
+
+<dt>Ideally documents should be
+placed as collections sub-directories of their own, with a common denominator,
+such as subject or author. </dt>
+<dd></dd>
+
+<dt>The last part of a directory path is used to
+create a sub-directory into which generated documents are placed, in (sub-sub)directories
+of their own. </dt>
+<dd></dd>
+
+<dt>the document </dt>
+<dd></dd>
+</dl>
+<p>
+<blockquote><i>~/ebook/free_culture.sst</i> </blockquote>
+
+<dl>
+
+<dt>would map to </dt>
+<dd></dd>
+</dl>
+<p>
+<blockquote><i>~[configured</i>
+output path]/ebook/free_culture </blockquote>
+
+<dl>
+
+<dt>within which would be placed all html,
+XML, pdf output, typically under the names: </dt>
+<dd></dd>
+</dl>
+<p>
+<blockquote><i>index.html</i> index for segmented
+text <p>
+<i>doc.html</i> full length scrollable document <p>
+<i>toc.html</i> index for segmented
+text <p>
+html segments, as many as there may be...
+<dl>
+
+<dt><i>portrait.pdf</i> </dt>
+<dd></dd>
+</dl>
+<p>
+<i>landscape.pdf</i> <p>
+<i>sax.xml</i>
+XML shallow structure, sax type parsing <p>
+<i>dom.xml</i> XML deeper structure, dom
+type parsing <p>
+<i>scroll.xhtml</i> xhtml <p>
+<i>plain.txt</i> plain text </blockquote>
+
+<h2><a name='sect28' href='#toc28'>Multi-language Document
+File Naming and Directory Mapping</a></h2>
+
+<dl>
+
+<dt>If the same document exists in different
+language versions, and it is desired that the published language versions
+should reside in the same output directory, the following filenaming convention
+should be observed, using Spannish as the sample language code (es) [it
+is very likley the use of country codes as language codes will be changed
+or extended in future] [filename]~[language code].sst </dt>
+<dd></dd>
+
+<dt>filename~es.sst </dt>
+<dd></dd>
+
+<dt>within
+sisurc.yml under the heading default the setting of language file: at 1,
+2 or 3 determines the output filenaming convention used, as follows: </dt>
+<dd></dd>
+
+<dt>(1)
+[output directory path]/filename/es.index.html </dt>
+<dd></dd>
+
+<dt>(2) [output directory path]/filename/index.es.html
+</dt>
+<dd></dd>
+
+<dt>(3) [output directory path]/filename/index.html.es (which Apache for example
+can be configured to use to automatically serve each users preference)
+</dt>
+<dd></dd>
+
+<dt>filename~fr.sst </dt>
+<dd></dd>
+
+<dt>filename~de.sst </dt>
+<dd></dd>
+
+<dt>etc. would be placed in the same directory
+using the same convention as indeed would: </dt>
+<dd></dd>
+
+<dt>filename.sst </dt>
+<dd></dd>
+
+<dt>using the default
+convention mapping convention. </dt>
+<dd></dd>
+
+<dt>Selecting this form of filename will overide
+other language settings including the language header within a document.
+</dt>
+<dd> </dd>
+</dl>
+
+<h2><a name='sect29' href='#toc29'>Markup Document Directories and Database Mapping</a></h2>
+<p>
+Similarly there is a mapping
+to the database into which documents are placed. <p>
+The last part of a directory
+path is used to create a sub-directory into which generated documents are
+placed, in a database of the same name, unless overridden. <p>
+Documents within
+the directory <i>~/ebook</i> <p>
+<blockquote><i>~/ebook/free_culture.sst</i> </blockquote>
+<p>
+would be placed in tables
+within the database <p>
+<blockquote><i>SiSU_ebook</i> </blockquote>
+
+<h2><a name='sect30' href='#toc30'>SKINS - document, directory and site skins</a></h2>
+<p>
+Skins
+modify the default appearance of document output on a document, directory,
+or site wide basis. Skins are looked for in the following locations: <p>
+<i>./_sisu/skin</i>
+<p>
+<i>~/.sisu/skin</i> <p>
+<i>/etc/sisu/skin</i> <p>
+Within the skin directory are the following
+the default sub-directories for document skins: <p>
+<i>./skin/doc</i> <p>
+<i>./skin/dir</i> <p>
+<i>./skin/site</i>
+<p>
+Documents take on a document skin, if the header of the document specifies
+a skin to be used. <p>
+A directory may be mapped on to a particular skin, so
+all documents within that directory take on a particular appearance. If
+a skin exists in the skin/dir with the same name as the document directory,
+it will automatically be used for each of the documents in that directory,
+(except where a document specifies the use of another skin, in the skin/doc
+directory). when end <p>
+A personal habit is to place all skins within the
+doc directory, and symbolic links as needed from the site, or dir directories
+as required. <p>
+A site skin, modifies the program default skin. <p>
+Sample skins
+may be found in /etc/sisu/skin/doc and /usr/share/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc
+(or equivalent directory) <p>
+Samples of list.yml and promo.yml may be found
+in /usr/share/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml (or equivalent
+directory)
+<h2><a name='sect31' href='#toc31'>Document Naming Convention</a></h2>
+<p>
+SiSU documents are named with the
+suffix <i>ss</i> followed by a third distinguishing letter, usually t for ordinary
+text files. <p>
+<i>.sst</i> is used by regular documents, and for most purposes is all
+you need to be aware of <p>
+<i>.ssm</i> suffix indicates a master or composite document,
+i.e. a document which requests other documents, which may have the file extension
+.sst or .ssi. See section on Composite Documents for information on how these
+are prepared. <p>
+<i>.ssi</i> indicates some prepared sisu markup information that is
+to be requested within master or composite document(s) and is not to be
+processed as a stand-alone document. <p>
+<i>._sst</i> and <i>.-sst</i> suffix are reserved for
+SiSU processing, and indicate a secondary file. Such secondary files are
+created when a composite file is constructed, and when a url is provided,
+it is saved locally for processing, as a secondary processing file. Secondary
+files may be clobbered by SiSU at will, and are not a way of storing information.
+
+<p> <i>.sxs.xml</i> simple xml sax, sisu markup representation
+<p> <i>.sxd.xml</i> simple xml dom,
+
+<p>sisu markup representation
+<p> <i>.sxn.xml</i> simple xml node, sisu markup representation
+
+<p> <i>.sxs.xml.sst</i> or <i>.sxd.xml.sst</i> or <i>.sxn.xml.sst</i> auto-converted from a simple xml markup
+representation (sxs, sxd, sxn)
+<h2><a name='sect32' href='#toc32'>Remote Operations</a></h2>
+<p>
+These may be of three
+basic types. <p>
+Instruction that processed files are to be copied to a remote
+server, using the -r or -R flag as part of the processing instruction. This
+requires previous setting up/configuration of the method to be used (eg
+scp assumed for -r and rsync for -R) and url to which these files are to
+be sent. * <p>
+The downloading of a remote file for processing using SiSU locally,
+which is achieved in one of two ways: <p>
+A processing instruction may include
+the url to the a remote file that is to be processed - this will be downloaded
+and given a temporary file .t extension, and will be processed using SiSU
+locally. <p>
+A file may request the inclusion of a remote document within it,
+see comments on "Composite Documents" for the request syntax. <p>
+Finally SiSU
+may be run on a remote server, which you download marked up files to for
+processing. This is not really a function of the operation of SiSU, just
+an available possibility given that not much bandwidth is required. <p>
+* with
+regard to remote files processed locally, the -r option, a limitation is
+that it is up to the user to ensure that the remote file does not have
+an identical filename to another, e.g. local file, that is to be processed
+in the same directory. So far this has not been found to happen in practice...
+Alternative solutions are under consideration, but it is desired that filenames
+be human assigned, and meaningful, so hash keys of contents for filenames
+are not amongst the options considered.
+<h2><a name='sect33' href='#toc33'>Note</a></h2>
+<p>
+For basic use only a fraction
+of the information provided here is required. There may be a bit of an information
+management problem in determining what though. For the markup of a book
+see the samples provided in <i>&lt;<a href='http://www.jus.uio.no/sisu/sample'>http://www.jus.uio.no/sisu/sample</a>
+&gt;</i> and referred
+to in the text <i>&lt;<a href='http://www.jus.uio.no/sisu/SiSU'>http://www.jus.uio.no/sisu/SiSU</a>
+&gt;</i> The flags to generate html
+and pdf for use locally would be sisu -mHp [name of file to be processed]
+This does assume an ok install and setup of SiSU and the associated software
+it uses.
+<p>
+<h2><a name='sect34' href='#toc34'>Processing Examples</a></h2>
+<p>
+To initialise a new directory <b>sisu</b> <i>-C</i> <p>
+Note:
+this create a corresponding output subdirectory and this copies css stylesheet
+files and basic image files to the output directory. The output directory
+is created in the output path/directory as a subdirectory with its name
+corresponding to that of the directory you are currently initialising. <p>
+generate
+the metafile used in subsequent processing only (note changes made to the
+markup file will not appear in subsequently generated text unless this
+flag is used: <b>sisu</b> <i>-m</i> [filename or wildcard] <p>
+to create html and pdf output,
+with verbose output of samplefile1.sst and samplefile2.sst <b>sisu</b> <i>-mhpv</i> samplefile1.sst
+samplefile2.sst <blockquote>Note: <i>-m</i> does initial processing, and <i>-H</i> omits filename
+suffixes and requires a properly configured web server. <i>-h</i> is used to include
+filename suffixes for file system viewing </blockquote>
+<p>
+generate html, a word map and
+pdf with verbose output for all marked up documents in a directory: <b>sisu</b>
+<i>-mhwpv</i> * <p>
+generate html, word map, pdf, plaintext, xhtml, xml sax and xml
+dom versions with verbose output for all marked up documents in a directory:
+<b>sisu</b> <i>-mhwpabxXv</i> * <p>
+to create html, pdf, xml, plaintext and a concordance
+file (wordmap) as output, with verbose output of all marked up files in
+a directory <b>sisu</b> <i>-mhpxXawv</i> *.{r,s}? <p>
+generate html, word map and pdf and place
+on remote server with verbose output 2 named example files in a directory
+(assumes has been set up, and first time must be run without other flags
+ie sisu <i>-mrv</i> [filenames/wildcard]): <b>sisu</b> <i>-mhwprv</i> example_file.sst other_example_file.sst
+<p>
+to process a remote sisu marked up file (html,pdf,concordance), provide
+the url(s) (works for text only files, will be downloaded and processed
+locally): <b>sisu</b> <i>-mhwpv</i> <a href='http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.sst'>http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.sst</a>
+ http://www.jus.uio.no/sisu/sample/markup/autonomy_markup0.sst
+<p>
+one file is local the other remote process (html,pdf,concordance,plaintext
+and place on pre-set remote destination): <b>sisu</b> <i>-mhwparv</i> gpl2.fsf.sst <a href='http://www.jus.uio.no/sisu/sample/markup/autonomy_markup0.sst'>http://www.jus.uio.no/sisu/sample/markup/autonomy_markup0.sst</a>
+
+<p>
+initialize database, create relations (first manually create database with
+same name as working directory): <b>sisu</b> <i>-Dv</i> createall <p>
+it may be necessary
+to first run <b>sisu</b> <i>-Dv</i> createdb <p>
+import all marked up files first time into
+a database: <b>sisu</b> <i>-Dv</i> import * <p>
+<i>-c</i> toggles color
+<h2><a name='sect35' href='#toc35'>Interactive Help Options</a></h2>
+<p>
+SiSU
+has an interactive help, which is accessed by typing just "sisu" at the
+command line, or as described below: <b>sisu</b> commands, document preparation,
+customisation, installation etc. <br>
+<pre>try:
+sisu --help
+ sisu help
+ help sisu --help
+ commands sisu --help commands
+ environment sisu --help env
+ ------------------------------------------
+ Using SiSU
+ commands: sisu --help commands
+ ------------------------------------------
+ Preparing Documents for SiSU
+ markup: sisu --help markup (an incomplete overview)
+ headers: sisu --help headers (document-wide instructions, meta-data)
+ structure sisu --help structure (document structure, headings,
+tables of contents)
+ endnotes: sisu --help endnotes
+ tables: sisu --help tables
+ an example 0.37: sisu --help example37
+ an example 0.38: sisu --help example38
+ ------------------------------------------
+ search sisu --help search
+ ------------------------------------------
+ customise: sisu --help customise
+ ------------------------------------------
+ SiSU&rsquo;s License
+ license: sisu --help license
+ sisu interactive help topics include:
+ keywords include: list, commands, shortcuts, markup, syntax, headers,
+ headings, endnotes, tables, example, customise, skin, environment,
+ directories, path, language, db, install, setup, configure,
+ external_programs, dublincore, termsheet, search, features,
+ external_programs, license, exit
+</pre>
+<p>
+<h2><a name='sect36' href='#toc36'>SiSU VERSION CONVERSION</a></h2>
+<p>
+<i>sisu</i> --to-current [filename/wildcard] converts from
+0.37 markup to current markup (0.38)
+<p> <i>sisu</i> --to-38 [filename/wildcard] converts
+
+<p>from 0.37 markup to 0.38
+<p> <i>sisu</i> --to-37 [filename/wildcard] converts from 0.38
+
+<p>markup to 0.37
+<p> <i>sisu</i> --convert-36to37 [filename/wildcard] re-names file from
+
+<p>pre-0.36 convention to 0.37
+<p> <i>sisu</i> --convert-footnotes [filename/wildcard] converts
+
+<p>footnotes to preferred embedded footnote markup style
+<p> <i>sisu</i> --convert-footnotes-force
+[filename/wildcard] converts footnotes to preferred embedded footnote markup
+style, even if there is a mismatch of footnote numbers. WARNING: there is
+a problem with the source document and it is necessary to manually check
+where each footnotes actually should be.
+<p> convert from sst to simple xml
+representations (sax, dom and node):
+<p> <i>sisu</i> --to-sax [filename/wildcard] or
+<i>sisu</i> --to-sxs [filename/wildcard]
+<p> <i>sisu</i> --to-dom [filename/wildcard] or <i>sisu</i>
+--to-sxd [filename/wildcard]
+<p> <i>sisu</i> --to-node [filename/wildcard] or <i>sisu</i> --to-sxn
+[filename/wildcard]
+<p> convert to sst from simple xml representations (sax,
+dom and node):
+<p> <i>sisu</i> --from-xml2sst [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]]
+
+<p> or the same:
+<p> <i>sisu</i> --from-sxml [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]]
+
+<p> <i>sisu</i> --from-kdi [kdissert filename] attempts to convert a kdissert file (.kdi)
+
+<p>to sisu markup
+<p> <i>sisu</i> --identify [filename/wildcard] attempts to identify
+
+<p>the markup version of the file
+<p> <i>sisu</i> --query=[version number] and <i>sisu</i> --query=history
+
+<p>provides a brief summary of changes to SiSU markup
+<p>
+<h2><a name='sect37' href='#toc37'>Sample Markup Documents</a></h2>
+<p>
+
+<p>
+Sample markup documents are provided in sisu-examples and are available
+online.
+<p>
+<h2><a name='sect38' href='#toc38'>Home Page</a></h2>
+<p>
+<i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i>
+<p>
+<h2><a name='sect39' href='#toc39'>Author</a></h2>
+Ralph Amissah <i>&lt;ralph@amissah.com&gt;</i>
+or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+<p>
+<h2><a name='sect40' href='#toc40'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b> <a href='http:~/bin/man2html?sisu_webrick:1'><b>sisu_webrick(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu_termsheet:1'><b>sisu_termsheet(1)</a>
+,</b>
+<a href='http:~/bin/man2html?sisu_pdf:1'><b>sisu_pdf(1)</b></a>
+ <a href='http:~/bin/man2html?sisu_sqlite:1'><b>sisu_sqlite(1)</b></a>
+ <a href='http:~/bin/man2html?sisu_postgresql:1'><b>sisu_postgresql(1)</b></a>
+ <a href='http:~/bin/man2html?sisu_vim:7'><b>sisu_vim(7)</b></a>
+ <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Description</a></li>
+<li><a name='toc3' href='#sect3'>Summary of man page</a></li>
+<li><a name='toc4' href='#sect4'>Document Processing Command Flags</a></li>
+<li><a name='toc5' href='#sect5'>modifiers</a></li>
+<li><a name='toc6' href='#sect6'>databases</a></li>
+<li><a name='toc7' href='#sect7'>Shortcuts, Shorthand for multiple flags</a></li>
+<li><a name='toc8' href='#sect8'>Document Markup</a></li>
+<li><a name='toc9' href='#sect9'>Basic Markup</a></li>
+<li><a name='toc10' href='#sect10'>Footnotes/Endnotes</a></li>
+<li><a name='toc11' href='#sect11'>Line Operations (marker placed at start of line)</a></li>
+<li><a name='toc12' href='#sect12'>Links</a></li>
+<li><a name='toc13' href='#sect13'>Adding a fixed names in html</a></li>
+<li><a name='toc14' href='#sect14'>Escape object citation numbering</a></li>
+<li><a name='toc15' href='#sect15'>Page breaks (LaTeX/pdf)</a></li>
+<li><a name='toc16' href='#sect16'>Comment line</a></li>
+<li><a name='toc17' href='#sect17'>Special characters</a></li>
+<li><a name='toc18' href='#sect18'>Tables</a></li>
+<li><a name='toc19' href='#sect19'>Other Grouped or Pre-formatted Text</a></li>
+<li><a name='toc20' href='#sect20'>Composite Documents</a></li>
+<li><a name='toc21' href='#sect21'>Document Headers</a></li>
+<li><a name='toc22' href='#sect22'>Outline of header options</a></li>
+<li><a name='toc23' href='#sect23'>Configuration Files</a></li>
+<li><a name='toc24' href='#sect24'>More HELP on Markup and headers</a></li>
+<li><a name='toc25' href='#sect25'>DIRECTORY STRUCTURE & Document Output</a></li>
+<li><a name='toc26' href='#sect26'>Default Directories</a></li>
+<li><a name='toc27' href='#sect27'>Markup Document Directories and File Mapping</a></li>
+<li><a name='toc28' href='#sect28'>Multi-language Document File Naming and Directory Mapping</a></li>
+<li><a name='toc29' href='#sect29'>Markup Document Directories and Database Mapping</a></li>
+<li><a name='toc30' href='#sect30'>SKINS - document, directory and site skins</a></li>
+<li><a name='toc31' href='#sect31'>Document Naming Convention</a></li>
+<li><a name='toc32' href='#sect32'>Remote Operations</a></li>
+<li><a name='toc33' href='#sect33'>Note</a></li>
+<li><a name='toc34' href='#sect34'>Processing Examples</a></li>
+<li><a name='toc35' href='#sect35'>Interactive Help Options</a></li>
+<li><a name='toc36' href='#sect36'>SiSU VERSION CONVERSION</a></li>
+<li><a name='toc37' href='#sect37'>Sample Markup Documents</a></li>
+<li><a name='toc38' href='#sect38'>Home Page</a></li>
+<li><a name='toc39' href='#sect39'>Author</a></li>
+<li><a name='toc40' href='#sect40'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu.8.html b/data/doc/sisu/html/sisu.8.html
new file mode 100644
index 00000000..755d1d32
--- /dev/null
+++ b/data/doc/sisu/html/sisu.8.html
@@ -0,0 +1,229 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>sisu(8) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<b>sisu</b> <b>[-mhwpxXv...] [</b> <i>filename/wildcard</i> <b>]</b>
+<h2><a name='sect2' href='#toc2'>Description</a></h2>
+A
+document publishing system, that from a simple single marked-up document,
+produces a multitude of output formats including: html, latex, pdf, info,
+and sql output, which can be cross referenced as having the same document
+structure and text object numbering, "object citation numbering". Features
+include its&rsquo; simple syntax; the semantic identification of documents using
+the Dublin Core; document management; built to be associated with a revision
+control system; text object numbering for the identification of a texts
+location in any of the output formats, easy skinning on a site wide, or
+per document basis, ... for more see <i>man</i> 1 sisu or <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i>
+<p>
+<b>SiSU is an alternative way of publishing and managing documents.</b>
+<h2><a name='sect3' href='#toc3'>Installation</a></h2>
+<p>
+Up
+to date information on SiSU downloads, and their installation should be
+available from: <i>&lt;<a href='http://www.jus.uio.no/sisu/SiSU/download.html'>http://www.jus.uio.no/sisu/SiSU/download.html</a>
+&gt;</i> or at: <i>&lt;<a href='http://www.jus.uio.no/sisu/sisu_download/download.html'>http://www.jus.uio.no/sisu/sisu_download/download.html</a>
+&gt;</i>
+<p>
+There you should find links to the latest source tarball, and instructions
+on how to install SiSU. <p>
+Sample marked up documents are are available at
+<i>/usr/share/doc/sisu/sisu_markup_samples/dfsg</i> or equivalent directory, or
+online at <i>&lt;<a href='http://www.jus.uio.no/sisu/sample/markup.html'>http://www.jus.uio.no/sisu/sample/markup.html</a>
+&gt;</i> or for viewing in html
+with syntax highlighting from <i>&lt;<a href='http://www.jus.uio.no/sisu/sample/syntax'>http://www.jus.uio.no/sisu/sample/syntax</a>
+&gt;</i> <p>
+A syntax
+table is provided at <i>/usr/share/doc/sisu/on_markup.txt</i> or equivalent, and
+online at <i>&lt;<a href='http://www.jus.uio.no/sisu/sample/on_markup.txt'>http://www.jus.uio.no/sisu/sample/on_markup.txt</a>
+&gt;</i> <p>
+<i>man</i> 1 sisu has a
+syntax table along with processing commands. <p>
+SiSU also provides some help
+via the command: <i>sisu</i> --help and selecting an appropriate subject, e.g. <p>
+<i>sisu</i>
+--help commands <p>
+<i>sisu</i> --help markup <p>
+<i>sisu</i> --help headers <p>
+<i>sisu</i> --help env <p>
+The rest
+of this note is on post installation setup
+<h2><a name='sect4' href='#toc4'>Post Installation Setup - Quick
+start</a></h2>
+<p>
+After installation of sisu-complete, move to the document samples directory
+<p>
+ cd /usr/share/doc/sisu/sisu_markup_samples/dfsg<br>
+ <p>
+and run <p>
+ sisu -1 free_as_in_freedom.rms_and_free_software.sam_williams.sst<br>
+ <p>
+or the same: <p>
+ sisu -NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst<br>
+ <p>
+look at output results, see the "sisu_manifest" page created for the document
+<p>
+To generate an online document move to a writable directory, (create a
+work directory and cd into it) as the file will be downloaded there and
+e.g. <p>
+<i>sisu</i> -1 <a href='http://www.jus.uio.no/sisu/gpl2.fsf/gpl2.fsf.sst'>http://www.jus.uio.no/sisu/gpl2.fsf/gpl2.fsf.sst</a>
+ <p>
+<i>sisu</i> -3 <a href='http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst'>http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst</a>
+
+<p>
+examine source document, vim has syntax highlighting support <p>
+gvim free_as_in_freedom.rms_and_free_software.sam_williams.sst
+<p>
+additional markup samples in <i>&lt;<a href='http://www.jus.uio.no/sisu/SiSU/2.html'>http://www.jus.uio.no/sisu/SiSU/2.html</a>
+&gt;</i> <p>
+it should
+also be possible to run sisu against sisupods (prepared zip files, created
+by running the command sisu -S [filename]), whether stored locally or remotely.
+<p>
+<i>sisu</i> -3 <a href='http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip'>http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip</a>
+ <p>
+there
+is a security issue associated with the running of document skins that
+are not your own, so these are turned of by default, and the use of the
+following command, which switches on the associated skin is not recommended:
+<p>
+<i>sisu</i> -3 --trust <a href='http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip'>http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip</a>
+
+<p>
+For help <i>man</i> sisu <p>
+<i>sisu</i> --help <p>
+<i>sisu</i> --help env for the way sisu "sees/maps"
+your system <p>
+<i>sisu</i> --help commands for list of commands and so on <p>
+ <b>Document
+markup directory</b> <p>
+Perhaps the easiest way to begin is to create a directory
+for sisu marked up documents within your home directory, and copy the file
+structure (and document samples) provided in the document sample directory:
+<i>mkdir</i> ~/sisu_test <p>
+<i>cd</i> ~/sisu_test <p>
+<i>cp</i> -a /usr/share/doc/sisu/sisu_markup_samples/dfsg/*
+~/sisu_test/. <p>
+<b>----------</b> <p>
+<b>Tip: </b> the markup syntax examples may be of interest <i>&lt;<a href='http://www.jus.uio.no/sisu/sample/'>http://www.jus.uio.no/sisu/sample/</a>
+&gt;</i>
+<p>
+<b>Tip:</b> <i>sisu</i> -U [sisu markup filename] should printout the different possible
+outputs and where sisu would place them. <p>
+<b>Tip: </b> if you want to toggle ansi
+color add <i>c</i> to your flags. <p>
+<b>----------</b> <p>
+ <b>SiSU configuration file search path is:</b> <p>
+<i>./_sisu/sisurc.yaml</i>
+<p>
+<i>~/.sisu/sisurc.yaml</i> <p>
+<i>/etc/sisu/sisurc.yaml</i> <p>
+
+<h2><a name='sect5' href='#toc5'>Debian INSTALLATION Note</a></h2>
+<p>
+It is best
+you see <i>&lt;<a href='http://www.jus.uio.no/sisu/SiSU/download.html#debian'>http://www.jus.uio.no/sisu/SiSU/download.html#debian</a>
+&gt;</i> for up the most
+up to date information. <p>
+notes taken from the Debian control file (end edited),
+gives an idea of additional packages that SiSU can make use of if available,
+(the use/requirement of some of which are interdependent for specific actions
+by SiSU): <p>
+Package: sisu <p>
+Depends: ruby (&gt;= 1.8.4), libwebrick-ruby <p>
+Recommends:
+sisu-pdf, sisu-sqlite, sisu-postgresql, librmagick-ruby, trang, tidy, librexml-ruby,
+zip, unzip, openssl, rsync, openssh-client lsh-client,<br>
+ keychain, hyperestraier, kdissert<br>
+ <p>
+Suggests: libfcgi-ruby1.8, rcs cvs, lv, texinfo, pinfo, rename <p>
+Package:
+sisu-complete <p>
+Depends: ruby (&gt;= 1.8.4), sisu, sisu-pdf, sisu-postgresql, sisu-sqlite
+<p>
+Recommends: hyperestraier <p>
+Package: sisu-pdf <p>
+Depends: sisu, tetex-bin texlive-base-bin,
+tetex-extra texlive-latex-extra, texlive-latex-extra, latex-ucs<br>
+ <p>
+Suggests: evince, xpdf <p>
+Package: sisu-postgresql <p>
+Depends: sisu, postgresql-8.1,
+libdbi-ruby, libdbm-ruby, libdbd-pg-ruby <p>
+Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1
+<p>
+Package: sisu-sqlite <p>
+Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
+<p>
+Suggests: libdbd-sqlite <p>
+Package: sisu-markup-samples <p>
+Depends: sisu <p>
+</pre>
+<h2><a name='sect6' href='#toc6'>Document
+Resource Configuration</a></h2>
+<b>sisu</b> resource configuration information is obtained
+from sources (where they exist): <br>
+<pre>~/.sisu/sisurc.yaml/etc/sisu/[sisu version]/sisurc.yamlsisu program defaults</pre><p>
+
+<b>Skins</b> <p>
+default document appearance may be modified using skins contained
+in sub-directories located at the following paths: <br>
+<pre>./_sisu/skin~/.sisu/skin/etc/sisu/skin</pre><p>
+more specifically, the following locations
+(or their /etc/sisu equivalent) should be used: <p>
+<i>~/.sisu/skin/doc</i> skins for
+individual documents; <p>
+<i>~/.sisu/skin/dir</i> skins for directories of matching
+names; <p>
+<i>~/.sisu/skin/site</i> site-wide skin modifying the site-wide appearance
+of documents. <p>
+Usually all skin files are placed in the document skin directory:
+<i>~/.sisu/skin/doc</i> with softlinks being made to the skins contained there
+from other skin directories as required.
+<h2><a name='sect7' href='#toc7'>Further Information</a></h2>
+<p>
+For more information
+on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i> <p>
+or <i>man</i> sisu
+<h2><a name='sect8' href='#toc8'>Author</a></h2>
+Ralph Amissah
+<i>&lt;ralph@amissah.com&gt;</i> or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+<h2><a name='sect9' href='#toc9'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu_examples:1'><b>sisu_examples(1)</a>
+,</b>
+<a href='http:~/bin/man2html?sisu_webrick:1'><b>sisu_webrick(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu_pdf:1'><b>sisu_pdf(1)</b></a>
+ <a href='http:~/bin/man2html?sisu_sqlite:1'><b>sisu_sqlite(1)</b></a>
+ <a href='http:~/bin/man2html?sisu_postgresql:1'><b>sisu_postgresql(1)</b></a>
+ <a href='http:~/bin/man2html?sisu_termsheet:1'><b>sisu_termsheet(1)</a>
+,</b>
+<p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Description</a></li>
+<li><a name='toc3' href='#sect3'>Installation</a></li>
+<li><a name='toc4' href='#sect4'>Post Installation Setup - Quick start</a></li>
+<li><a name='toc5' href='#sect5'>Debian INSTALLATION Note</a></li>
+<li><a name='toc6' href='#sect6'>Document Resource Configuration</a></li>
+<li><a name='toc7' href='#sect7'>Further Information</a></li>
+<li><a name='toc8' href='#sect8'>Author</a></li>
+<li><a name='toc9' href='#sect9'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu_complete.7.html b/data/doc/sisu/html/sisu_complete.7.html
new file mode 100644
index 00000000..b4ab749e
--- /dev/null
+++ b/data/doc/sisu/html/sisu_complete.7.html
@@ -0,0 +1,54 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>sisu_complete(7) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system, complete dependency package <p>
+
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+Dummy package installs
+the whole of SiSU, excluding sisu-examples <p>
+sisu-complete together with sisu-examples
+is the whole of sisu
+<h2><a name='sect2' href='#toc2'>Further Information</a></h2>
+<p>
+For more information on <i>SiSU</i>
+see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i> <p>
+or <i>man</i> sisu
+<h2><a name='sect3' href='#toc3'>Author</a></h2>
+Ralph Amissah <i>&lt;ralph@amissah.com&gt;</i>
+or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+<h2><a name='sect4' href='#toc4'>See</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b>
+<h2><a name='sect5' href='#toc5'>Also</a></h2>
+<a href='http:~/bin/man2html?sisu_webrick:1'><b>sisu_webrick(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu_pdf:7'><b>sisu_pdf(7)</b></a>
+
+<a href='http:~/bin/man2html?sisu_sqlite:7'><b>sisu_sqlite(7)</b></a>
+ <a href='http:~/bin/man2html?sisu_postgresql:7'><b>sisu_postgresql(7)</b></a>
+ <a href='http:~/bin/man2html?sisu_vim:7'><b>sisu_vim(7)</b></a>
+ <a href='http:~/bin/man2html?sisu_termsheet:1'><b>sisu_termsheet(1)</a>
+,</b> <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Further Information</a></li>
+<li><a name='toc3' href='#sect3'>Author</a></li>
+<li><a name='toc4' href='#sect4'>See</a></li>
+<li><a name='toc5' href='#sect5'>Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu_pdf.7.html b/data/doc/sisu/html/sisu_pdf.7.html
new file mode 100644
index 00000000..6f0cd214
--- /dev/null
+++ b/data/doc/sisu/html/sisu_pdf.7.html
@@ -0,0 +1,48 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>sisu_pdf(7) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system <p>
+Dummy package installs the dependencies required to convert
+LaTeX output from SiSU to pdf
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<b>sisu</b> <b>-p</b> [filename/wildcard]
+<h2><a name='sect2' href='#toc2'>Description</a></h2>
+<b>sisu_pdf</b>
+<i>is</i> part of SiSU (man sisu) sisu_pdf is a dummy package to install dependencies
+needed for sisu to make rudimentary info files output, documented in man
+sisu
+<h2><a name='sect3' href='#toc3'>Further Information</a></h2>
+<p>
+For more information on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i>
+<p>
+or <i>man</i> sisu
+<h2><a name='sect4' href='#toc4'>Author</a></h2>
+Ralph Amissah <i>&lt;ralph@amissah.com&gt;</i> or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+
+<h2><a name='sect5' href='#toc5'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b> <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Description</a></li>
+<li><a name='toc3' href='#sect3'>Further Information</a></li>
+<li><a name='toc4' href='#sect4'>Author</a></li>
+<li><a name='toc5' href='#sect5'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu_postgresql.7.html b/data/doc/sisu/html/sisu_postgresql.7.html
new file mode 100644
index 00000000..90f04be4
--- /dev/null
+++ b/data/doc/sisu/html/sisu_postgresql.7.html
@@ -0,0 +1,95 @@
+ Universe . Description: sisu postgresql package manpage . arch-tag: sisu
+manpage . later . -man -Tascii sisu.1 . most . sisu_postgresql 7 "September 09,
+2006" "version 0.46" "sisu -I" <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>sisu_postgresql(7) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized
+Units - a document publishing system, postgresql dependency package <p>
+Dummy
+package to install the dependencies required by SiSU to populate a postgresql
+database
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<b>sisu</b> <i>-D</i> [instruction] <p>
+<i>-d</i> --(sqlite|pg) --[instruction] [filename/wildcard
+if required] <p>
+<b>sisu</b> <i>--pgsql</i> --[instruction] [filename/wildcard if required] <p>
+
+
+<h2><a name='sect2' href='#toc2'>Description</a></h2>
+<b>sisu_postgresql</b> <i>is</i> part of SiSU (man sisu) sisu_postgresql is
+a dummy dummy package to install dependencies needed for sisu to populate
+a postgresql database, documented in man sisu
+<h2><a name='sect3' href='#toc3'>databases</a></h2>
+
+<dl>
+
+<dt>dbi - database interface
+</dt>
+<dd><b>-D</b> set for <i>postgresql</i> </dd>
+
+<dt><b>--pgsql --createall</b> </dt>
+<dd>initial step, creates required relations
+(tables, indexes) in existing postgresql database (a database should be
+created manually and given the same name as working directory, as requested)
+(rb.dbi) </dd>
+
+<dt><b>--pgsql --import -v </b> </dt>
+<dd><i>[filename/wildcard]</i> imports data specified to postgresql
+db (rb.dbi) </dd>
+
+<dt><b>--pgsql --update -v </b> </dt>
+<dd><i>[filename/wildcard]</i> updates/imports specified
+data to (postgresql) db (rb.dbi) </dd>
+
+<dt><b>--pgsql --remove -v </b> </dt>
+<dd><i>[filename/wildcard]</i> removes
+specified data to (postgresql) db (rb.dbi) </dd>
+
+<dt><b>--pgsql --dropall </b> </dt>
+<dd>kills data" and
+drops (postgresql) db, tables &amp; indexes </dd>
+
+<dt><b>--pgsql --recreate </b> </dt>
+<dd>kills data" and
+drops and rebuilds empty (postgresql) db, tables &amp; </dd>
+</dl>
+indexes </blockquote>
+
+<h2><a name='sect4' href='#toc4'>Further Information</a></h2>
+<p>
+For
+more information on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i> <p>
+or <i>man</i> sisu
+<h2><a name='sect5' href='#toc5'>Author</a></h2>
+Ralph
+Amissah <i>&lt;ralph@amissah.com&gt;</i> or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+<h2><a name='sect6' href='#toc6'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b>
+<a href='http:~/bin/man2html?sisu_sqlite:7'><b>sisu_sqlite(7)</a>
+,</b> <a href='http:~/bin/man2html?sisu_vim:7'><b>sisu_vim(7)</b></a>
+ <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Description</a></li>
+<li><a name='toc3' href='#sect3'>databases</a></li>
+<li><a name='toc4' href='#sect4'>Further Information</a></li>
+<li><a name='toc5' href='#sect5'>Author</a></li>
+<li><a name='toc6' href='#sect6'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu_sqlite.7.html b/data/doc/sisu/html/sisu_sqlite.7.html
new file mode 100644
index 00000000..4d85c37b
--- /dev/null
+++ b/data/doc/sisu/html/sisu_sqlite.7.html
@@ -0,0 +1,91 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>sisu_sqlite(7) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system, sqlite dependency package <p>
+This is a dummy package to
+install the dependencies required by SiSU to populate an sqlite database
+
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<b>sisu</b> <i>-d</i> [instruction] [filename/wildcard if required] <p>
+<b>sisu</b> <i>-d</i> --(sqlite|pg)
+--[instruction] [filename/wildcard if required] <p>
+
+<h2><a name='sect2' href='#toc2'>Description</a></h2>
+<b>sisu_sqlite</b> <i>is</i>
+part of SiSU (man sisu) sisu_sqlite is a dummy package to install dependencies
+needed for sisu to populate an sqlite database, documented in man sisu
+
+<h2><a name='sect3' href='#toc3'>databases</a></h2>
+
+<dl>
+
+<dt>dbi - database interface </dt>
+<dd><b>-d</b> set for <i>sqlite</i> </dd>
+
+<dt><b>--sqlite --createall</b> </dt>
+<dd>initial
+step, creates required relations (tables, indexes) in existing (sqlite)
+database (a database should be created manually and given the same name
+as working directory, as requested) (rb.dbi) </dd>
+
+<dt><b>--sqlite --import -v </b> </dt>
+<dd><i>[filename/wildcard]</i>
+imports data specified to (sqlite) db (rb.dbi) </dd>
+
+<dt><b>--sqlite --update -v </b> </dt>
+<dd><i>[filename/wildcard]</i>
+updates/imports specified data to (sqlite) db (rb.dbi) </dd>
+
+<dt><b>--sqlite --remove -v </b>
+</dt>
+<dd><i>[filename/wildcard]</i> removes specified data to (sqlite) db (rb.dbi) </dd>
+
+<dt><b>--sqlite
+--dropall </b> </dt>
+<dd>kills data" and drops (postgresql) db, tables &amp; indexes </dd>
+
+<dt><b>--sqlite
+--recreate </b> </dt>
+<dd>kills data" and drops and rebuilds empty (postgresql) db, tables
+&amp; </dd>
+</dl>
+indexes </blockquote>
+
+<h2><a name='sect4' href='#toc4'>Further Information</a></h2>
+<p>
+For more information on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i>
+<p>
+or <i>man</i> sisu
+<h2><a name='sect5' href='#toc5'>Author</a></h2>
+Ralph Amissah <i>&lt;ralph@amissah.com&gt;</i> or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+
+<h2><a name='sect6' href='#toc6'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b> <a href='http:~/bin/man2html?sisu_postgresql:7'><b>sisu_postgresql(7)</a>
+,</b> <a href='http:~/bin/man2html?sisu_vim:7'><b>sisu_vim(7)</b></a>
+ <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Description</a></li>
+<li><a name='toc3' href='#sect3'>databases</a></li>
+<li><a name='toc4' href='#sect4'>Further Information</a></li>
+<li><a name='toc5' href='#sect5'>Author</a></li>
+<li><a name='toc6' href='#sect6'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu_termsheet.1.html b/data/doc/sisu/html/sisu_termsheet.1.html
new file mode 100644
index 00000000..14a904d3
--- /dev/null
+++ b/data/doc/sisu/html/sisu_termsheet.1.html
@@ -0,0 +1,63 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>sisu_termsheet(1) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<p>
+<b>sisu</b> <b>-t</b> <i>[termsheet-name(s)]</i>
+<h2><a name='sect2' href='#toc2'>Description</a></h2>
+<b>sisu_termsheet</b>
+<i>is</i> part of SiSU is <b>invoked</b> <i>through</i> the sisu command (man sisu) <p>
+
+<h2><a name='sect3' href='#toc3'>Summary
+of man page</a></h2>
+<p>
+sisu_termsheet, is started with the command: <b>sisu -t </b> <i>[termsheet-name(s)]</i>
+
+<h2><a name='sect4' href='#toc4'>Document Processing Command Flags</a></h2>
+<p>
+<b>sisu</b><i>&nbsp;-t</i><b>&nbsp;[termsheet-name(s)]</b> (runs sisu_termsheet)
+merges the termsheet(s) specified on the commandline with the documents
+it is instructed to merge in the termsheet(s), and produces regular <i>SiSU</i>
+output documents from the merged results. <p>
+[further documentation on termsheets
+required]
+<h2><a name='sect5' href='#toc5'>Further Information</a></h2>
+<p>
+For more information on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i>
+<p>
+or <i>man</i> sisu
+<h2><a name='sect6' href='#toc6'>Author</a></h2>
+Ralph Amissah <i>&lt;ralph@amissah.com&gt;</i> or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+
+<h2><a name='sect7' href='#toc7'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b> <a href='http:~/bin/man2html?sisu_webrick:1'><b>sisu_webrick(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu_vim:7'><b>sisu_vim(7)</b></a>
+ <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Description</a></li>
+<li><a name='toc3' href='#sect3'>Summary of man page</a></li>
+<li><a name='toc4' href='#sect4'>Document Processing Command Flags</a></li>
+<li><a name='toc5' href='#sect5'>Further Information</a></li>
+<li><a name='toc6' href='#sect6'>Author</a></li>
+<li><a name='toc7' href='#sect7'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu_vim.7.html b/data/doc/sisu/html/sisu_vim.7.html
new file mode 100644
index 00000000..0909ce6a
--- /dev/null
+++ b/data/doc/sisu/html/sisu_vim.7.html
@@ -0,0 +1,60 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>vim_sisu(7) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system.
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<p>
+An ftplugin to provide vim folds for SiSU markup,
+and to set some defaults for SiSU markup in installed by sisu. <p>
+Vim 7 includes
+sisu markup syntax highlighting. <p>
+Vim related files are included in /usr/share/sisu/vim/addons,
+(including the syntax highlighter which may be used by Vim 6). <p>
+sisu-vim actions
+are activated on files with the suffix .sst .ssm .ssi .-sst ._sst (and the same
+with a further .meta extension) <p>
+<b>&lt;ctrl&gt;F</b> activate folds on headings matched
+in a document (also provides folds when sourced on a ruby program file),
+also <b>:F</b> <p>
+<b>&lt;ctrl&gt;S</b> search and replace down <p>
+<b>&lt;ctrl&gt;G</b> search and replace globally
+within file <p>
+<b>&lt;ctrl&gt;X</b> ruby regex global search and replace within file <p>
+<b>&lt;ctrl&gt;C</b>
+set color scheme to <b>slate</b> which is provided
+<h2><a name='sect2' href='#toc2'>Further Information</a></h2>
+<p>
+For more
+information on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i> <p>
+or <i>man</i> sisu
+<h2><a name='sect3' href='#toc3'>Author</a></h2>
+Ralph
+Amissah <i>&lt;ralph@amissah.com&gt;</i> or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+<h2><a name='sect4' href='#toc4'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b>
+<a href='http:~/bin/man2html?sisu_webrick:1'><b>sisu_webrick(1)</b></a>
+ <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Further Information</a></li>
+<li><a name='toc3' href='#sect3'>Author</a></li>
+<li><a name='toc4' href='#sect4'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/html/sisu_webrick.1.html b/data/doc/sisu/html/sisu_webrick.1.html
new file mode 100644
index 00000000..f82412e2
--- /dev/null
+++ b/data/doc/sisu/html/sisu_webrick.1.html
@@ -0,0 +1,69 @@
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+<!-- available at http://polyglotman.sourceforge.net/ -->
+
+<html>
+<head>
+<title>sisu_webrick(1) manual page</title>
+</head>
+<body bgcolor='white'>
+<a href='#toc'>Table of Contents</a><p>
+
+<h2><a name='sect0' href='#toc0'>Name</a></h2>
+<b>SiSU</b> - Structured information, Serialized Units - a document
+publishing system
+<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
+<b>sisu_webrick</b> <i>[port]</i> <p>
+or <p>
+<b>sisu</b> <b>-W</b> <i>[port]</i>
+<h2><a name='sect2' href='#toc2'>Description</a></h2>
+<b>sisu_webrick</b>
+<i>is</i> part of SiSU (man sisu) sisu_webrick starts Ruby&rsquo;s Webrick web-server
+and points it to the directories to which <i>SiSU</i> output is written, providing
+a list of these directories (assuming <i>SiSU</i> is in use and they exist).
+<p>
+The default port for sisu_webrick is set to 8081, this may be modified
+in the yaml file: <i>~/.sisu/sisurc.yaml</i> a sample of which is provided as <i>/etc/sisu/sisurc.yaml</i>
+(or in the equivalent directory on your system).
+<h2><a name='sect3' href='#toc3'>Summary of man page</a></h2>
+<p>
+sisu_webrick,
+may be started on it&rsquo;s own with the command: <b>sisu_webrick</b> <i>[port]</i> or using
+the sisu command with the -W flag: <b>sisu -W </b> <i>[port]</i> <p>
+where no port is given
+and settings are unchanged the default port is 8081
+<h2><a name='sect4' href='#toc4'>Document Processing
+Command Flags</a></h2>
+<p>
+<b>sisu</b><i>&nbsp;-W</i><b>&nbsp;[port]</b> starts Ruby Webrick web-server, serving <i>SiSU</i> output
+directories, on the port provided, or if no port is provided and the defaults
+have not been changed in <i>~/.sisu/sisurc.yaml</i> then on port 8081
+<h2><a name='sect5' href='#toc5'>Further
+Information</a></h2>
+<p>
+For more information on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;</i> <p>
+or
+<i>man</i> sisu
+<h2><a name='sect6' href='#toc6'>Author</a></h2>
+Ralph Amissah <i>&lt;ralph@amissah.com&gt;</i> or <i>&lt;ralph.amissah@gmail.com&gt;</i>
+
+<h2><a name='sect7' href='#toc7'>See Also</a></h2>
+<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
+,</b> <a href='http:~/bin/man2html?sisu_vim:7'><b>sisu_vim(7)</b></a>
+ <a href='http:~/bin/man2html?sisu:8'><b>sisu(8)</a>
+,</b> <p>
+
+<hr><p>
+<a name='toc'><b>Table of Contents</b></a><p>
+<ul>
+<li><a name='toc0' href='#sect0'>Name</a></li>
+<li><a name='toc1' href='#sect1'>Synopsis</a></li>
+<li><a name='toc2' href='#sect2'>Description</a></li>
+<li><a name='toc3' href='#sect3'>Summary of man page</a></li>
+<li><a name='toc4' href='#sect4'>Document Processing Command Flags</a></li>
+<li><a name='toc5' href='#sect5'>Further Information</a></li>
+<li><a name='toc6' href='#sect6'>Author</a></li>
+<li><a name='toc7' href='#sect7'>See Also</a></li>
+</ul>
+</body>
+</html>
diff --git a/data/doc/sisu/model/README b/data/doc/sisu/model/README
new file mode 100644
index 00000000..0b03e45e
--- /dev/null
+++ b/data/doc/sisu/model/README
@@ -0,0 +1,14 @@
+Models of SiSU xml
+[early attempt at modelling, not definitive]
+* xsd - xml schema
+* rnc - relax ng compact format
+* rng - relax ng xml format
+
+* input (markup) formats
+ * sax (.sxs.xml)
+ * dom (.sxd.xml)
+ * node (.sxn.xml)
+
+* output formats
+ * sax (sax.xml)
+ * dom (dom.xml)
diff --git a/data/doc/sisu/model/relaxng/sisu_object_model_dom.rnc b/data/doc/sisu/model/relaxng/sisu_object_model_dom.rnc
new file mode 100644
index 00000000..2ab5cf79
--- /dev/null
+++ b/data/doc/sisu/model/relaxng/sisu_object_model_dom.rnc
@@ -0,0 +1,148 @@
+#%% sisu object model: input
+# Name: SiSU information Structuring Universe - Structured information, Serialized Units
+# Author: Ralph Amissah
+# http://www.jus.uio.no/sisu
+# http://www.jus.uio.no/sisu/SiSU/download.html
+
+# Description: sisu object models in relaxNG dom model base
+# used for preliminary modeling, not definitive
+
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah
+
+# License: GPL 2 or later
+
+# Summary of GPL 2
+
+# 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 2 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/gpl2.fsf
+
+# SiSU was first released to the public on January 4th 2005
+
+# SiSU uses:
+#
+# Standard SiSU markup syntax,
+# Standard SiSU meta-markup syntax, and the
+# Standard SiSU object citation numbering and system
+#
+# © Ralph Amissah 1997, current 2006.
+# All Rights Reserved.
+
+#%% definitions
+#dublin core:
+element-dc =
+ ( attribute title { text }
+ #attribute subtitle { text }?
+ & attribute creator { text }?
+ & attribute subject { text }?
+ & attribute description { text }?
+ & attribute publisher { text }?
+ & attribute contributor { text }?
+ & attribute date { text }?
+ & attribute datecreated { text }?
+ & attribute dateissued { text }?
+ & attribute dateavailable { text }?
+ & attribute datevalid { text }?
+ & attribute datemodified { text }?
+ & attribute type { text }?
+ & attribute format { text }?
+ & attribute identifier { text }?
+ & attribute source { text }?
+ & attribute relation { text }?
+ & attribute coverage { text }?
+ & attribute rights { text }?
+ & attribute keywords { text }? )
+#element-paragraph =
+# text
+# element b
+# element i
+# element u
+#endnotes, zero or many, embedded in text:
+element-endnote =
+ element endnote {
+ element number { text },
+ element note { text }
+ }*
+#body text/contents
+element-text =
+ element mytext {
+ text
+ & element-endnote
+ }
+#object citation number, unique sequential number for objects:
+element-ocn =
+ element ocn { text }
+#object container:
+element-object =
+ element object {
+ element-ocn,
+ #note nametag is only used in element-heading, object is used in both heading and content ->
+ element nametag { text }?,
+ element-text
+ }+
+#heading object container
+element-heading =
+ element heading {
+ element-object
+ }
+#content/paragraph/main text object container
+element-content =
+ element content {
+ element-object*
+ },
+#text includes <en> endnote pointer numbers, and <b> <i> <u> etc.
+#note includes <b> <i> <u> etc.
+#%% structure
+element document {
+ #document head:
+ element head {
+ attribute id { text },
+ element-dc,
+ attribute copyright { text }?
+ #element title {
+ # attribute xml:lang { text },
+ # text
+ #}
+ },
+ #document body:
+ element body {
+ element heading1 {
+ element-heading,
+ element heading2 {
+ element-heading,
+ element heading3 {
+ element-heading,
+ element contents1 {
+ element-heading,
+ element-content*,
+ element contents2 {
+ element-heading,
+ element-content*,
+ element contents3 {
+ element-heading,
+ element-content*
+ }*
+ }*
+ }+
+ }+
+ }+
+ }+
+ }
+}
+
diff --git a/data/doc/sisu/model/relaxng/sisu_object_model_input.rnc b/data/doc/sisu/model/relaxng/sisu_object_model_input.rnc
new file mode 100644
index 00000000..56c2606c
--- /dev/null
+++ b/data/doc/sisu/model/relaxng/sisu_object_model_input.rnc
@@ -0,0 +1,186 @@
+#%% sisu object model: input
+# Name: SiSU information Structuring Universe - Structured information, Serialized Units
+# Author: Ralph Amissah
+# http://www.jus.uio.no/sisu
+# http://www.jus.uio.no/sisu/SiSU/download.html
+
+# Description: sisu object models in relaxNG input model base
+# used for preliminary modeling, not definitive
+
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah
+
+# License: GPL 2 or later
+
+# Summary of GPL 2
+
+# 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 2 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/gpl2.fsf
+
+# SiSU was first released to the public on January 4th 2005
+
+# SiSU uses:
+#
+# Standard SiSU markup syntax,
+# Standard SiSU meta-markup syntax, and the
+# Standard SiSU object citation numbering and system
+#
+# © Ralph Amissah 1997, current 2006.
+# All Rights Reserved.
+
+#%% definitions
+# dublin core:
+element-semantic =
+ element semantic {
+ # dublin core:
+ element title { text }
+ & element creator { text }?
+ & element subject { text }?
+ & element description { text }?
+ & element publisher { text }?
+ & element contributor { text }?
+ & element date { text }?
+ & element date.created { text }?
+ & element date.issued { text }?
+ & element date.available { text }?
+ & element date.valid { text }?
+ & element date.modified { text }?
+ & element type { text }?
+ & element format { text }?
+ & element identifier { text }?
+ & element source { text }?
+ & element relation { text }?
+ & element coverage { text }?
+ & element rights { text }?
+ & element keywords { text }?
+ # extended semantic metadata:
+ & attribute subtitle { text }?
+ & attribute illustrator { text }?
+ & attribute translator { text }?
+ & attribute prepared_by { text }?
+ & attribute digitized_by { text }?
+ & attribute language { text }?
+ & attribute language.original { text }?
+ & attribute classify.pg { text }?
+ & attribute classify.isbn { text }?
+ & attribute classify.dewey { text }?
+ & attribute classify.loc { text }?
+ & attribute prefix.a { text }?
+ & attribute prefix.b { text }?
+ & attribute suffix { text }?
+ & attribute comments { text }?
+ & attribute abstract { text }?
+ # & attribute information { text }?
+ & attribute contact { text }?
+ & attribute links { text }?
+ }
+element-processing =
+ element processing {
+ attribute structure { text }?
+ & attribute level { text }?
+ & attribute markup { text }?
+ & attribute bold { text }?
+ & attribute italics { text }?
+ & attribute papersize { text }?
+ & attribute vocabulary { text }?
+ & element date_scheme { text }?
+ & element date.issued.scheme { text }?
+ & element date.available.scheme { text }?
+ & element date.valid.scheme { text }?
+ & element date.modified.scheme { text }?
+ }?
+element-head =
+ element head {
+ # processing instructions, and semantic data, distinguish?:
+ element metadata {
+ element title { text },
+ element file { text },
+ element generator { text },
+ element-semantic,
+ element-processing
+ }+
+ }
+# body text/contents
+# includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc.
+element-txt =
+ element txt {
+ text*
+ & element b { text }*
+ & element i { text }*
+ & element u { text }*
+ & element ins { text }*
+ & element del { text }*
+ }
+element-endnote =
+ element endnote {
+ element number { text },
+ element note { element-txt }+
+ }+
+element-para =
+ element para {
+ # attribute paragraph_format { text },
+ element-txt+
+ & element-endnote?
+ }
+element-external_space =
+ element external_space {
+ # ignored by sisu, provide program needs
+ element program {
+ # e.g. kdissert
+ element name { text },
+ element xpos { text },
+ element ypos { text },
+ element font { text },
+ element outline_color { text },
+ element text_color { text },
+ element comment { text }
+ }*
+ }*,
+#%% structure
+ element document {
+ # document head:
+ element-head,
+ # document body:
+ element body {
+ # object, a unit of text, usually a paragraph with any associated endnotes
+ element node {
+ element structure {
+ # structure document using either node:heading levels or node:heading relationships:
+ # (i) sisu default uses node:heading levels (1-6 or A-C,1-3) to build document structure
+ element level { text }?,
+ # (ii) sisu alternatively could use node:heading relationship information to build document structure
+ element node.id { text },
+ element node.parent { text },
+ element node.child { text }*
+ },
+ element node.objects {
+ element object.heading {
+ # nametag used only in headings, especially important for segmented html
+ element nametag { text },
+ element-para
+ },
+ element object.para {
+ element-para
+ }*
+ }+,
+ element-external_space
+ }+
+ }
+ }
+
diff --git a/data/doc/sisu/model/relaxng/sisu_object_model_metaverse.rnc b/data/doc/sisu/model/relaxng/sisu_object_model_metaverse.rnc
new file mode 100644
index 00000000..913aee90
--- /dev/null
+++ b/data/doc/sisu/model/relaxng/sisu_object_model_metaverse.rnc
@@ -0,0 +1,210 @@
+#%% sisu object model: input
+# Name: SiSU information Structuring Universe - Structured information, Serialized Units
+# Author: Ralph Amissah
+# http://www.jus.uio.no/sisu
+# http://www.jus.uio.no/sisu/SiSU/download.html
+
+# Description: sisu object models in relaxNG metaverse model base
+# used for preliminary modeling, not definitive
+
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah
+
+# License: GPL 2 or later
+
+# Summary of GPL 2
+
+# 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 2 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/gpl2.fsf
+
+# SiSU was first released to the public on January 4th 2005
+
+# SiSU uses:
+#
+# Standard SiSU markup syntax,
+# Standard SiSU meta-markup syntax, and the
+# Standard SiSU object citation numbering and system
+#
+# © Ralph Amissah 1997, current 2006.
+# All Rights Reserved.
+
+#%% definitions
+# dublin core:
+element-semantic =
+ element semantic {
+ # dublin core:
+ element title { text }
+ & element creator { text }?
+ & element subject { text }?
+ & element description { text }?
+ & element publisher { text }?
+ & element contributor { text }?
+ & element date { text }?
+ & element date.created { text }?
+ & element date.issued { text }?
+ & element date.available { text }?
+ & element date.valid { text }?
+ & element date.modified { text }?
+ & element type { text }?
+ & element format { text }?
+ & element identifier { text }?
+ & element source { text }?
+ & element relation { text }?
+ & element coverage { text }?
+ & element rights { text }?
+ & element keywords { text }?
+ # extended semantic metadata:
+ & attribute subtitle { text }?
+ & attribute illustrator { text }?
+ & attribute translator { text }?
+ & attribute prepared_by { text }?
+ & attribute digitized_by { text }?
+ & attribute language { text }?
+ & attribute language.original { text }?
+ & attribute classify.pg { text }?
+ & attribute classify.isbn { text }?
+ & attribute classify.dewey { text }?
+ & attribute classify.loc { text }?
+ & attribute prefix.a { text }?
+ & attribute prefix.b { text }?
+ & attribute suffix { text }?
+ & attribute comments { text }?
+ & attribute abstract { text }?
+ # & attribute information { text }?
+ & attribute contact { text }?
+ & attribute links { text }?
+ }
+element-processing =
+ element processing {
+ attribute structure { text }?
+ & attribute level { text }?
+ & attribute markup { text }?
+ & attribute bold { text }?
+ & attribute italics { text }?
+ & attribute papersize { text }?
+ & attribute vocabulary { text }?
+ & element date_scheme { text }?
+ & element date.issued.scheme { text }?
+ & element date.available.scheme { text }?
+ & element date.valid.scheme { text }?
+ & element date.modified.scheme { text }?
+ }?
+element-head =
+ element head {
+ # processing instructions, and semantic data, distinguish?:
+ element metadata {
+ element title { text },
+ element file { text },
+ element generator { text },
+ element-semantic,
+ element-processing
+ }+
+ }
+# body text/contents
+# includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc.
+element-txt =
+ element txt {
+ text*
+ & element b { text }*
+ & element i { text }*
+ & element u { text }*
+ & element ins { text }*
+ & element del { text }*
+ }
+element-checksum.endnote = element checksum.clean { text }
+element-endnote =
+ element endnote {
+ element number { text },
+ element note { element-txt }+,
+ element-checksum.endnote
+ }+
+element-checksum.para =
+ element checksum.para {
+ element checksum.clean { text },
+ element checksum.marked { text }
+ }
+element-para =
+ element para {
+ # attribute paragraph_format { text },
+ element-txt+
+ & element-endnote?
+ }
+element-object =
+ element object {
+ element-para,
+ element-checksum.para
+ }
+# object citation number, unique sequential number for objects:
+element-ocn = element ocn { text }
+element-object_structure_summary =
+ element-ocn,
+ # type: heading level value 1 -6, or normal text
+ element type { text },
+ # type number: sequential number for designated type
+ element type_number { text },
+ # type category: sequential number for designated category, e.g. sequentially counting all headers
+ element category_number { text }
+element-external_space =
+ element external_space {
+ # ignored by sisu, provide program needs
+ element program {
+ # e.g. kdissert
+ element name { text },
+ element xpos { text },
+ element ypos { text },
+ element font { text },
+ element outline_color { text },
+ element text_color { text },
+ element comment { text }
+ }*
+ }*,
+#%% structure
+ element document {
+ # document head:
+ element-head,
+ # document body:
+ element body {
+ # object, a unit of text, usually a paragraph with any associated endnotes
+ element node {
+ element structure {
+ # structure document using either node:heading levels or node:heading relationships:
+ # (i) sisu default uses node:heading levels (1-6 or A-C,1-3) to build document structure
+ element level { text }?,
+ # (ii) sisu alternatively could use node:heading relationship information to build document structure
+ element node.id { text },
+ element node.parent { text },
+ element node.child { text }*
+ },
+ element node.objects {
+ element object.heading {
+ element-object_structure_summary,
+ # nametag used only in headings, especially important for segmented html
+ element nametag { text },
+ element-object
+ },
+ element object.para {
+ element-object_structure_summary,
+ element-object
+ }*
+ }+,
+ element-external_space
+ }+
+ }
+ }
+
diff --git a/data/doc/sisu/model/relaxng/sisu_object_model_sax.rnc b/data/doc/sisu/model/relaxng/sisu_object_model_sax.rnc
new file mode 100644
index 00000000..0c82dae1
--- /dev/null
+++ b/data/doc/sisu/model/relaxng/sisu_object_model_sax.rnc
@@ -0,0 +1,86 @@
+#%% sisu object model: input
+# Name: SiSU information Structuring Universe - Structured information, Serialized Units
+# Author: Ralph Amissah
+# http://www.jus.uio.no/sisu
+# http://www.jus.uio.no/sisu/SiSU/download.html
+
+# Description: sisu object models in relaxNG sax model base
+# used for preliminary modeling, not definitive
+
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah
+
+# License: GPL 2 or later
+
+# Summary of GPL 2
+
+# 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 2 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/gpl2.fsf
+
+# SiSU was first released to the public on January 4th 2005
+
+# SiSU uses:
+#
+# Standard SiSU markup syntax,
+# Standard SiSU meta-markup syntax, and the
+# Standard SiSU object citation numbering and system
+#
+# © Ralph Amissah 1997, current 2006.
+# All Rights Reserved.
+
+# Ralph Amissah: ralph@amissah.com
+# ralph.amissah@gmail.com
+
+#%% definitions
+#text includes <en> endnote pointer numbers, and <b> <i> <u> etc.
+#note includes <b> <i> <u> etc.
+
+#%% structure
+element document {
+ #document head:
+ element head {
+ #dublin core:
+ element dc {
+ attribute class { text }
+ }+
+ },
+ #document body:
+ element body {
+ #object, a unit of text, usually a paragraph with any associated endnotes
+ element object {
+ attribute number { text },
+ element ocn { text },
+ #body content/text, whether ordinary paragraph or heading:
+ element text {
+ #attributes indicates whether ordinary text (norm) or heading, (levels h[1-6]):
+ attribute class { text },
+ text
+ },
+ #endnotes, zero or many:
+ element endnote {
+ attribute notenumber { text },
+ #endnotes number:
+ element number { text },
+ #endnotes content/text:
+ element note { text }
+ }*
+ }+
+ }
+}
+
diff --git a/data/doc/sisu/model/relaxng/sisu_object_model_xhtml.rnc b/data/doc/sisu/model/relaxng/sisu_object_model_xhtml.rnc
new file mode 100644
index 00000000..c4930a40
--- /dev/null
+++ b/data/doc/sisu/model/relaxng/sisu_object_model_xhtml.rnc
@@ -0,0 +1,105 @@
+#%% sisu object model: input
+# Name: SiSU information Structuring Universe - Structured information, Serialized Units
+# Author: Ralph Amissah
+# http://www.jus.uio.no/sisu
+# http://www.jus.uio.no/sisu/SiSU/download.html
+
+# Description: sisu object models in relaxNG xhtml model base
+# used for preliminary modeling, not definitive
+
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah
+
+# License: GPL 2 or later
+
+# Summary of GPL 2
+
+# 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 2 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/gpl2.fsf
+
+# SiSU was first released to the public on January 4th 2005
+
+# SiSU uses:
+#
+# Standard SiSU markup syntax,
+# Standard SiSU meta-markup syntax, and the
+# Standard SiSU object citation numbering and system
+#
+# © Ralph Amissah 1997, current 2006.
+# All Rights Reserved.
+
+#%% definitions
+#dublin core:
+element-dc =
+ ( attribute title { text }
+ #attribute subtitle { text }?
+ & attribute creator { text }?
+ & attribute subject { text }?
+ & attribute description { text }?
+ & attribute publisher { text }?
+ & attribute contributor { text }?
+ & attribute date { text }?
+ & attribute datecreated { text }?
+ & attribute dateissued { text }?
+ & attribute dateavailable { text }?
+ & attribute datevalid { text }?
+ & attribute datemodified { text }?
+ & attribute type { text }?
+ & attribute format { text }?
+ & attribute identifier { text }?
+ & attribute source { text }?
+ & attribute relation { text }?
+ & attribute coverage { text }?
+ & attribute rights { text }?
+ & attribute keywords { text }? ),
+#text includes <en> endnote pointer numbers, and <b> <i> <u> etc.
+#note includes <b> <i> <u> etc.
+#%% structure
+element document {
+ #document head:
+ element head {
+ attribute id { text },
+ element-dc,
+ attribute copyright { text }?
+ #element title {
+ # attribute xml:lang { text },
+ # text
+ #}
+ },
+ #document body:
+ element body {
+ #object, unit
+ element object {
+ #may or may not be a heading, if heading provide heading level [1-6]:
+ element heading { text }?,
+ #object citation number, unique sequential number for objects:
+ element ocn { text },
+ #body content/text, whether heading or ordinary paragraph:
+ element text { text },
+ #endnotes, zero or many:
+ element endnote {
+ #endnotes number:
+ element en_n { text },
+ #endnotes content/text:
+ element note { text }
+ }*
+ }+
+ }
+}
+
diff --git a/data/doc/sisu/model/xml/input/rnc/dom.rnc b/data/doc/sisu/model/xml/input/rnc/dom.rnc
new file mode 100644
index 00000000..7391eca4
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/rnc/dom.rnc
@@ -0,0 +1,69 @@
+#% dom input model, part of SiSU and under the same license
+default namespace = ""
+start =
+ element document {
+ element head {
+ element header {
+ attribute class { xsd:NCName },
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date.available { xsd:NMTOKEN }
+ | element date.created { xsd:NMTOKEN }
+ | element date.issued { xsd:NMTOKEN }
+ | element date.modified { xsd:NMTOKEN }
+ | element date.valid { xsd:NMTOKEN }
+ | element italicize { text }
+ | element language { xsd:NCName }
+ | element links { text }
+ | element markup { text }
+ | element rights { text }
+ | element skin { xsd:NCName }
+ | element subject { text }
+ | element title { text }
+ | element type { xsd:NCName }
+ | element vocabulary { xsd:NCName })
+ }+
+ },
+ element body {
+ element heading1 {
+ heading,
+ element heading2 {
+ heading,
+ contents1+,
+ element heading3 { heading, contents1+ }+
+ }
+ }
+ }
+ }
+heading = element heading { object }
+contents1 =
+ element contents1 {
+ heading,
+ content,
+ element contents2 {
+ heading,
+ content,
+ element contents3 { heading, content }*
+ }*
+ }
+object =
+ element object {
+ element text {
+ (text
+ | italic
+ | element bold { xsd:NMTOKEN }
+ | element endnote {
+ element symbol { text }?,
+ element note {
+ (text
+ | italic
+ | element br { empty })+
+ }
+ }
+ | element underscore { italic }
+ | element image.path { text }
+ | element italic { text })+
+ }
+ }
+italic = element italic { text }
+content = element content { object+ }
diff --git a/data/doc/sisu/model/xml/input/rnc/node.rnc b/data/doc/sisu/model/xml/input/rnc/node.rnc
new file mode 100644
index 00000000..5116f629
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/rnc/node.rnc
@@ -0,0 +1,67 @@
+#% node input model, part of SiSU and under the same license
+default namespace = ""
+start =
+ element document {
+ element head {
+ element header {
+ attribute class { xsd:NCName },
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date.available { xsd:NMTOKEN }
+ | element date.created { xsd:NMTOKEN }
+ | element date.issued { xsd:NMTOKEN }
+ | element date.modified { xsd:NMTOKEN }
+ | element date.valid { xsd:NMTOKEN }
+ | element italicize { (text | i)+ }
+ | element language { xsd:NCName }
+ | element links { text }
+ | element markup { text }
+ | element rights { text }
+ | element skin { xsd:NCName }
+ | element subject { text }
+ | element title { text }
+ | element type { xsd:NCName }
+ | element vocabulary { xsd:NCName })
+ }+
+ },
+ element body {
+ element object {
+ (element text {
+ attribute class { xsd:NCName },
+ (text
+ | b
+ | i
+ | element br { empty }
+ | element endnote {
+ attribute symbol { xsd:NCName },
+ (text | i)+
+ }
+ | element image.path { text }
+ | element sub { text })+
+ }
+ | (element ocn { empty },
+ element table {
+ attribute align { xsd:NCName },
+ attribute bgcolor { xsd:NCName },
+ attribute border { xsd:integer },
+ attribute cellpadding { xsd:integer },
+ attribute summary { text },
+ attribute width { text },
+ element tr {
+ element td {
+ attribute valign { xsd:NCName },
+ attribute width { text },
+ (text | b)+
+ }+
+ }+
+ })),
+ element node {
+ element id { xsd:integer },
+ element parent { xsd:integer },
+ element offspring { text }?
+ }
+ }+
+ }
+ }
+b = element b { text }
+i = element i { text }
diff --git a/data/doc/sisu/model/xml/input/rnc/sax.rnc b/data/doc/sisu/model/xml/input/rnc/sax.rnc
new file mode 100644
index 00000000..891a18f8
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/rnc/sax.rnc
@@ -0,0 +1,47 @@
+#% sax input model, part of SiSU and under the same license
+default namespace = ""
+start =
+ element document {
+ element head {
+ element header {
+ attribute class { xsd:NCName },
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date.available { xsd:NMTOKEN }
+ | element date.created { xsd:NMTOKEN }
+ | element date.issued { xsd:NMTOKEN }
+ | element date.modified { xsd:NMTOKEN }
+ | element date.valid { xsd:NMTOKEN }
+ | element italicize { text }
+ | element language { xsd:NCName }
+ | element links { text }
+ | element markup { text }
+ | element rights { text }
+ | element skin { xsd:NCName }
+ | element subject { text }
+ | element title { text }
+ | element type { xsd:NCName }
+ | element vocabulary { xsd:NCName })
+ }+
+ },
+ element body {
+ element object {
+ element text {
+ attribute class { xsd:NCName },
+ (text
+ | b
+ | i
+ | element endnote {
+ attribute symbol { xsd:NCName },
+ (text
+ | i
+ | element br { empty })+
+ }
+ | element u { i }
+ | element image.path { text })+
+ }?
+ }+
+ }
+ }
+i = element i { text }
+b = element b { text }
diff --git a/data/doc/sisu/model/xml/input/rng/dom.rng b/data/doc/sisu/model/xml/input/rng/dom.rng
new file mode 100644
index 00000000..746421c8
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/rng/dom.rng
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- dom rng input model, part of SiSU and under the same license -->
+<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <element name="document">
+ <element name="head">
+ <oneOrMore>
+ <element name="header">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <choice>
+ <element name="creator">
+ <text/>
+ </element>
+ <element name="date">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.available">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.created">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.issued">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.modified">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.valid">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="italicize">
+ <text/>
+ </element>
+ <element name="language">
+ <data type="NCName"/>
+ </element>
+ <element name="links">
+ <text/>
+ </element>
+ <element name="markup">
+ <text/>
+ </element>
+ <element name="rights">
+ <text/>
+ </element>
+ <element name="skin">
+ <data type="NCName"/>
+ </element>
+ <element name="subject">
+ <text/>
+ </element>
+ <element name="title">
+ <text/>
+ </element>
+ <element name="type">
+ <data type="NCName"/>
+ </element>
+ <element name="vocabulary">
+ <data type="NCName"/>
+ </element>
+ </choice>
+ </element>
+ </oneOrMore>
+ </element>
+ <element name="body">
+ <element name="heading1">
+ <ref name="heading"/>
+ <element name="heading2">
+ <ref name="heading"/>
+ <oneOrMore>
+ <ref name="contents1"/>
+ </oneOrMore>
+ <oneOrMore>
+ <element name="heading3">
+ <ref name="heading"/>
+ <oneOrMore>
+ <ref name="contents1"/>
+ </oneOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </element>
+ </element>
+ </element>
+ </start>
+ <define name="heading">
+ <element name="heading">
+ <ref name="object"/>
+ </element>
+ </define>
+ <define name="contents1">
+ <element name="contents1">
+ <ref name="heading"/>
+ <ref name="content"/>
+ <zeroOrMore>
+ <element name="contents2">
+ <ref name="heading"/>
+ <ref name="content"/>
+ <zeroOrMore>
+ <element name="contents3">
+ <ref name="heading"/>
+ <ref name="content"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="object">
+ <element name="object">
+ <element name="text">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="italic"/>
+ <element name="bold">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="endnote">
+ <optional>
+ <element name="symbol">
+ <text/>
+ </element>
+ </optional>
+ <element name="note">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="italic"/>
+ <element name="br">
+ <empty/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </element>
+ <element name="underscore">
+ <ref name="italic"/>
+ </element>
+ <element name="image.path">
+ <text/>
+ </element>
+ <element name="italic">
+ <text/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </element>
+ </define>
+ <define name="italic">
+ <element name="italic">
+ <text/>
+ </element>
+ </define>
+ <define name="content">
+ <element name="content">
+ <oneOrMore>
+ <ref name="object"/>
+ </oneOrMore>
+ </element>
+ </define>
+</grammar>
diff --git a/data/doc/sisu/model/xml/input/rng/node.rng b/data/doc/sisu/model/xml/input/rng/node.rng
new file mode 100644
index 00000000..8b60cce8
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/rng/node.rng
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- node rng input model, part of SiSU and under the same license -->
+<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <element name="document">
+ <element name="head">
+ <oneOrMore>
+ <element name="header">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <choice>
+ <element name="creator">
+ <text/>
+ </element>
+ <element name="date">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.available">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.created">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.issued">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.modified">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.valid">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="italicize">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="language">
+ <data type="NCName"/>
+ </element>
+ <element name="links">
+ <text/>
+ </element>
+ <element name="markup">
+ <text/>
+ </element>
+ <element name="rights">
+ <text/>
+ </element>
+ <element name="skin">
+ <data type="NCName"/>
+ </element>
+ <element name="subject">
+ <text/>
+ </element>
+ <element name="title">
+ <text/>
+ </element>
+ <element name="type">
+ <data type="NCName"/>
+ </element>
+ <element name="vocabulary">
+ <data type="NCName"/>
+ </element>
+ </choice>
+ </element>
+ </oneOrMore>
+ </element>
+ <element name="body">
+ <oneOrMore>
+ <element name="object">
+ <choice>
+ <element name="text">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ <element name="br">
+ <empty/>
+ </element>
+ <element name="endnote">
+ <attribute name="symbol">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="image.path">
+ <text/>
+ </element>
+ <element name="sub">
+ <text/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ <group>
+ <element name="ocn">
+ <empty/>
+ </element>
+ <element name="table">
+ <attribute name="align">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="bgcolor">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="border">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="cellpadding">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="summary"/>
+ <attribute name="width"/>
+ <oneOrMore>
+ <element name="tr">
+ <oneOrMore>
+ <element name="td">
+ <attribute name="valign">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="width"/>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </group>
+ </choice>
+ <element name="node">
+ <element name="id">
+ <data type="integer"/>
+ </element>
+ <element name="parent">
+ <data type="integer"/>
+ </element>
+ <optional>
+ <element name="offspring">
+ <text/>
+ </element>
+ </optional>
+ </element>
+ </element>
+ </oneOrMore>
+ </element>
+ </element>
+ </start>
+ <define name="b">
+ <element name="b">
+ <text/>
+ </element>
+ </define>
+ <define name="i">
+ <element name="i">
+ <text/>
+ </element>
+ </define>
+</grammar>
diff --git a/data/doc/sisu/model/xml/input/rng/sax.rng b/data/doc/sisu/model/xml/input/rng/sax.rng
new file mode 100644
index 00000000..14412938
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/rng/sax.rng
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- sax rng input model, part of SiSU and under the same license -->
+<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <element name="document">
+ <element name="head">
+ <oneOrMore>
+ <element name="header">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <choice>
+ <element name="creator">
+ <text/>
+ </element>
+ <element name="date">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.available">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.created">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.issued">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.modified">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date.valid">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="italicize">
+ <text/>
+ </element>
+ <element name="language">
+ <data type="NCName"/>
+ </element>
+ <element name="links">
+ <text/>
+ </element>
+ <element name="markup">
+ <text/>
+ </element>
+ <element name="rights">
+ <text/>
+ </element>
+ <element name="skin">
+ <data type="NCName"/>
+ </element>
+ <element name="subject">
+ <text/>
+ </element>
+ <element name="title">
+ <text/>
+ </element>
+ <element name="type">
+ <data type="NCName"/>
+ </element>
+ <element name="vocabulary">
+ <data type="NCName"/>
+ </element>
+ </choice>
+ </element>
+ </oneOrMore>
+ </element>
+ <element name="body">
+ <oneOrMore>
+ <element name="object">
+ <optional>
+ <element name="text">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ <element name="endnote">
+ <attribute name="symbol">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ <element name="br">
+ <empty/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="u">
+ <ref name="i"/>
+ </element>
+ <element name="image.path">
+ <text/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </optional>
+ </element>
+ </oneOrMore>
+ </element>
+ </element>
+ </start>
+ <define name="i">
+ <element name="i">
+ <text/>
+ </element>
+ </define>
+ <define name="b">
+ <element name="b">
+ <text/>
+ </element>
+ </define>
+</grammar>
diff --git a/data/doc/sisu/model/xml/input/xsd/dom.xsd b/data/doc/sisu/model/xml/input/xsd/dom.xsd
new file mode 100644
index 00000000..8de8999a
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/xsd/dom.xsd
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- dom input model, part of SiSU and under the same license -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="document">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="head"/>
+ <xs:element ref="body"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="head">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="header"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="header">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="creator"/>
+ <xs:element ref="date"/>
+ <xs:element ref="date.available"/>
+ <xs:element ref="date.created"/>
+ <xs:element ref="date.issued"/>
+ <xs:element ref="date.modified"/>
+ <xs:element ref="date.valid"/>
+ <xs:element ref="italicize"/>
+ <xs:element ref="language"/>
+ <xs:element ref="links"/>
+ <xs:element ref="markup"/>
+ <xs:element ref="rights"/>
+ <xs:element ref="skin"/>
+ <xs:element ref="subject"/>
+ <xs:element ref="title"/>
+ <xs:element ref="type"/>
+ <xs:element ref="vocabulary"/>
+ </xs:choice>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="creator" type="xs:string"/>
+ <xs:element name="date" type="xs:NMTOKEN"/>
+ <xs:element name="date.available" type="xs:NMTOKEN"/>
+ <xs:element name="date.created" type="xs:NMTOKEN"/>
+ <xs:element name="date.issued" type="xs:NMTOKEN"/>
+ <xs:element name="date.modified" type="xs:NMTOKEN"/>
+ <xs:element name="date.valid" type="xs:NMTOKEN"/>
+ <xs:element name="italicize" type="xs:string"/>
+ <xs:element name="language" type="xs:NCName"/>
+ <xs:element name="links" type="xs:string"/>
+ <xs:element name="markup" type="xs:string"/>
+ <xs:element name="rights" type="xs:string"/>
+ <xs:element name="skin" type="xs:NCName"/>
+ <xs:element name="subject" type="xs:string"/>
+ <xs:element name="title" type="xs:string"/>
+ <xs:element name="type" type="xs:NCName"/>
+ <xs:element name="vocabulary" type="xs:NCName"/>
+ <xs:element name="body">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="heading1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element ref="heading2"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="heading2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element maxOccurs="unbounded" ref="contents1"/>
+ <xs:element maxOccurs="unbounded" ref="heading3"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="heading3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element maxOccurs="unbounded" ref="contents1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="heading">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="object"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contents1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element ref="content"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="contents2"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contents2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element ref="content"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="contents3"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contents3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element ref="content"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="object">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="text">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="italic"/>
+ <xs:element ref="bold"/>
+ <xs:element ref="endnote"/>
+ <xs:element ref="underscore"/>
+ <xs:element ref="image.path"/>
+ <xs:element ref="italic"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="bold" type="xs:NMTOKEN"/>
+ <xs:element name="endnote">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="symbol"/>
+ <xs:element ref="note"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="symbol" type="xs:string"/>
+ <xs:element name="note">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="italic"/>
+ <xs:element ref="br"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="br">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="underscore">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="italic"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="image.path" type="xs:string"/>
+ <xs:element name="italic" type="xs:string"/>
+ <xs:element name="content">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="object"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
diff --git a/data/doc/sisu/model/xml/input/xsd/node.xsd b/data/doc/sisu/model/xml/input/xsd/node.xsd
new file mode 100644
index 00000000..f0fc9614
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/xsd/node.xsd
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- node input model, part of SiSU and under the same license -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="document">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="head"/>
+ <xs:element ref="body"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="head">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="header"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="header">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="creator"/>
+ <xs:element ref="date"/>
+ <xs:element ref="date.available"/>
+ <xs:element ref="date.created"/>
+ <xs:element ref="date.issued"/>
+ <xs:element ref="date.modified"/>
+ <xs:element ref="date.valid"/>
+ <xs:element ref="italicize"/>
+ <xs:element ref="language"/>
+ <xs:element ref="links"/>
+ <xs:element ref="markup"/>
+ <xs:element ref="rights"/>
+ <xs:element ref="skin"/>
+ <xs:element ref="subject"/>
+ <xs:element ref="title"/>
+ <xs:element ref="type"/>
+ <xs:element ref="vocabulary"/>
+ </xs:choice>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="creator" type="xs:string"/>
+ <xs:element name="date" type="xs:NMTOKEN"/>
+ <xs:element name="date.available" type="xs:NMTOKEN"/>
+ <xs:element name="date.created" type="xs:NMTOKEN"/>
+ <xs:element name="date.issued" type="xs:NMTOKEN"/>
+ <xs:element name="date.modified" type="xs:NMTOKEN"/>
+ <xs:element name="date.valid" type="xs:NMTOKEN"/>
+ <xs:element name="italicize">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="i"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="language" type="xs:NCName"/>
+ <xs:element name="links" type="xs:string"/>
+ <xs:element name="markup" type="xs:string"/>
+ <xs:element name="rights" type="xs:string"/>
+ <xs:element name="skin" type="xs:NCName"/>
+ <xs:element name="subject" type="xs:string"/>
+ <xs:element name="title" type="xs:string"/>
+ <xs:element name="type" type="xs:NCName"/>
+ <xs:element name="vocabulary" type="xs:NCName"/>
+ <xs:element name="body">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="object"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="object">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element ref="text"/>
+ <xs:sequence>
+ <xs:element ref="ocn"/>
+ <xs:element ref="table"/>
+ </xs:sequence>
+ </xs:choice>
+ <xs:element ref="node"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="text">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="i"/>
+ <xs:element ref="br"/>
+ <xs:element ref="endnote"/>
+ <xs:element ref="image.path"/>
+ <xs:element ref="sub"/>
+ </xs:choice>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="br">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="endnote">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="i"/>
+ </xs:sequence>
+ <xs:attribute name="symbol" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="image.path" type="xs:string"/>
+ <xs:element name="sub" type="xs:string"/>
+ <xs:element name="ocn">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="table">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="tr"/>
+ </xs:sequence>
+ <xs:attribute name="align" use="required" type="xs:NCName"/>
+ <xs:attribute name="bgcolor" use="required" type="xs:NCName"/>
+ <xs:attribute name="border" use="required" type="xs:integer"/>
+ <xs:attribute name="cellpadding" use="required" type="xs:integer"/>
+ <xs:attribute name="summary" use="required"/>
+ <xs:attribute name="width" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="tr">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="td"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="td">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="b"/>
+ </xs:sequence>
+ <xs:attribute name="valign" use="required" type="xs:NCName"/>
+ <xs:attribute name="width" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="node">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="id"/>
+ <xs:element ref="parent"/>
+ <xs:element minOccurs="0" ref="offspring"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="id" type="xs:integer"/>
+ <xs:element name="parent" type="xs:integer"/>
+ <xs:element name="offspring" type="xs:string"/>
+ <xs:element name="b" type="xs:string"/>
+ <xs:element name="i" type="xs:string"/>
+</xs:schema>
diff --git a/data/doc/sisu/model/xml/input/xsd/sax.xsd b/data/doc/sisu/model/xml/input/xsd/sax.xsd
new file mode 100644
index 00000000..450bfce5
--- /dev/null
+++ b/data/doc/sisu/model/xml/input/xsd/sax.xsd
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- sax input model, part of SiSU and under the same license -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="document">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="head"/>
+ <xs:element ref="body"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="head">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="header"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="header">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="creator"/>
+ <xs:element ref="date"/>
+ <xs:element ref="date.available"/>
+ <xs:element ref="date.created"/>
+ <xs:element ref="date.issued"/>
+ <xs:element ref="date.modified"/>
+ <xs:element ref="date.valid"/>
+ <xs:element ref="italicize"/>
+ <xs:element ref="language"/>
+ <xs:element ref="links"/>
+ <xs:element ref="markup"/>
+ <xs:element ref="rights"/>
+ <xs:element ref="skin"/>
+ <xs:element ref="subject"/>
+ <xs:element ref="title"/>
+ <xs:element ref="type"/>
+ <xs:element ref="vocabulary"/>
+ </xs:choice>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="creator" type="xs:string"/>
+ <xs:element name="date" type="xs:NMTOKEN"/>
+ <xs:element name="date.available" type="xs:NMTOKEN"/>
+ <xs:element name="date.created" type="xs:NMTOKEN"/>
+ <xs:element name="date.issued" type="xs:NMTOKEN"/>
+ <xs:element name="date.modified" type="xs:NMTOKEN"/>
+ <xs:element name="date.valid" type="xs:NMTOKEN"/>
+ <xs:element name="italicize" type="xs:string"/>
+ <xs:element name="language" type="xs:NCName"/>
+ <xs:element name="links" type="xs:string"/>
+ <xs:element name="markup" type="xs:string"/>
+ <xs:element name="rights" type="xs:string"/>
+ <xs:element name="skin" type="xs:NCName"/>
+ <xs:element name="subject" type="xs:string"/>
+ <xs:element name="title" type="xs:string"/>
+ <xs:element name="type" type="xs:NCName"/>
+ <xs:element name="vocabulary" type="xs:NCName"/>
+ <xs:element name="body">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="object"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="object">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="text">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="i"/>
+ <xs:element ref="endnote"/>
+ <xs:element ref="u"/>
+ <xs:element ref="image.path"/>
+ </xs:choice>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="endnote">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="i"/>
+ <xs:element ref="br"/>
+ </xs:choice>
+ <xs:attribute name="symbol" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="br">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="u">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="i"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="image.path" type="xs:string"/>
+ <xs:element name="i" type="xs:string"/>
+ <xs:element name="b" type="xs:string"/>
+</xs:schema>
diff --git a/data/doc/sisu/model/xml/output/rnc/dom.rnc b/data/doc/sisu/model/xml/output/rnc/dom.rnc
new file mode 100644
index 00000000..e8a3ed42
--- /dev/null
+++ b/data/doc/sisu/model/xml/output/rnc/dom.rnc
@@ -0,0 +1,144 @@
+#% dom output model, part of SiSU and under the same license
+default namespace = ""
+namespace xlink = "http://www.w3.org/1999/xlink"
+start =
+ element document {
+ element head {
+ element header {
+ meta,
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date_available { xsd:NMTOKEN }
+ | element date_created { xsd:NMTOKEN }
+ | element date_issued { xsd:NMTOKEN }
+ | element date_modified { xsd:NMTOKEN }
+ | element date_valid { xsd:NMTOKEN }
+ | element keywords { text }
+ | element language { xsd:NCName }
+ | element rights { (text | link)+ }
+ | element source { text }
+ | element structure { text }
+ | element subject { text }
+ | element title { text }
+ | element type { text }
+ | element source_control {
+ (br
+ | meta
+ | element sc {
+ attribute class { xsd:NCName },
+ text
+ })+
+ })
+ }+
+ },
+ element body {
+ element heading1 {
+ heading,
+ contents1*,
+ element heading2 {
+ heading,
+ contents1*,
+ element heading3 {
+ heading,
+ element contents1 {
+ heading,
+ content,
+ element contents2 {
+ heading,
+ content,
+ element contents3 { heading, content }*
+ }*
+ }+
+ }*
+ }*
+ }+
+ }
+ }
+meta = element meta { text }
+br = element br { empty }
+heading = element heading { object }
+contents1 =
+ element contents1 {
+ heading,
+ content,
+ element contents2 {
+ heading,
+ content,
+ element contents3 { heading, content }*
+ }*
+ }
+content = element content { object* }
+object =
+ element object {
+ attribute id { xsd:integer },
+ element ocn { text },
+ element nametag { text }?,
+ (element table {
+ attribute align { xsd:NCName },
+ attribute bgcolor { xsd:NCName },
+ attribute border { xsd:integer },
+ attribute cellpadding { xsd:integer },
+ attribute summary { text },
+ attribute width { text },
+ element tr {
+ element td {
+ attribute valign { xsd:NCName },
+ attribute width { text },
+ (text | b | i)+
+ }+
+ }+
+ }
+ | element text {
+ attribute class { xsd:NCName }?,
+ (text
+ | b
+ | del
+ | endnote
+ | i
+ | link
+ | element br { empty }
+ | element endnote {
+ element number { xsd:integer },
+ element note { (text | i | link)+ }
+ }
+ | element image {
+ attribute height { xsd:integer },
+ attribute width { xsd:integer },
+ attribute xlink:actuate { xsd:NCName },
+ attribute xlink:href { text },
+ attribute xlink:show { xsd:NCName },
+ attribute xlink:type { xsd:NCName }
+ }
+ | element sub { text })+
+ })
+ }
+i = element i { text }
+b = element i { text }
+u = element u { (text | b | i)+ }
+sub = element sub { xsd:NCName }
+sup = element sup { xsd:NCName }
+del = element del { (text | b | i | link)+ }
+link =
+ element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ xsd:anyURI
+ }
+endnote =
+ element endnote {
+ (element number { xsd:integer }
+ | element symbol { text }),
+ element note {
+ (text
+ | b
+ | br
+ | del
+ | i
+ | link
+ | sub
+ | sup
+ | u
+ | element em { xsd:NCName }
+ | element sub { xsd:NCName })+
+ }
+ }
diff --git a/data/doc/sisu/model/xml/output/rnc/sax.rnc b/data/doc/sisu/model/xml/output/rnc/sax.rnc
new file mode 100644
index 00000000..b242afb3
--- /dev/null
+++ b/data/doc/sisu/model/xml/output/rnc/sax.rnc
@@ -0,0 +1,164 @@
+# % sax output model, part of SiSU and distributed under the same license
+
+default namespace = ""
+namespace xlink = "http://www.w3.org/1999/xlink"
+
+start =
+ element document {
+ element head {
+ (br
+ | meta
+ | element creator {
+ attribute class { xsd:NCName },
+ (text
+ | element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ xsd:anyURI
+ })+
+ }
+ | element date {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_available {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_created {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_issued {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_modified {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_valid {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element keywords {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element language {
+ attribute class { xsd:NCName },
+ xsd:NCName
+ }
+ | element meta { xsd:NMTOKEN }
+ | element rights {
+ attribute class { xsd:NCName },
+ (text | link)+
+ }
+ | element source {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element structure {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element subject {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element title {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element type {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element source_control {
+ (br
+ | meta
+ | element sc {
+ attribute class { xsd:NCName },
+ text
+ })+
+ })+
+ },
+ element body {
+ element object {
+ attribute id { text },
+ element ocn {
+ text
+ },
+ element text {
+ attribute class { xsd:NCName },
+ (text
+ | b
+ | br
+ | del
+ | en
+ | i
+ | link
+ | sub
+ | sup
+ | u
+ | element image {
+ attribute alt { text }?,
+ attribute height { xsd:integer }?,
+ attribute width { xsd:integer }?,
+ attribute xlink:actuate { xsd:NCName },
+ attribute xlink:href { text },
+ attribute xlink:show { xsd:NCName },
+ attribute xlink:type { xsd:NCName }
+ })+
+ }?,
+ element table {
+ attribute align { xsd:NCName },
+ attribute bgcolor { xsd:NCName },
+ attribute border { xsd:integer },
+ attribute cellpadding { xsd:integer },
+ attribute summary { text },
+ attribute width { text },
+ element tr {
+ element td {
+ attribute valign { xsd:NCName },
+ attribute width { text },
+ (text | b | i)+
+ }+
+ }+
+ }?,
+ element endnote {
+ attribute notenumber { xsd:integer }?,
+ attribute symbol { text }?,
+ (element number { xsd:integer }
+ | element symbol { text }),
+ element note {
+ (text
+ | b
+ | br
+ | del
+ | i
+ | link
+ | sup
+ | u
+ | element em { xsd:NCName }
+ | element sub { xsd:NCName })+
+ }
+ }*
+ }+
+ }
+ }
+meta = element meta { text }
+br = element br { empty }
+b = element b { (text | en | i | link | sup)+ }
+i = element i { (text | b | br | sup)+ }
+en = element en { text }
+sub = element sub { xsd:NCName }
+sup = element sup { xsd:NCName }
+link =
+ element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ (xsd:anyURI | text | b | i | sup)+
+ }
+u = element u { (text | b | i)+ }
+del = element del { (text | b | i | link)+ }
diff --git a/data/doc/sisu/model/xml/output/rng/dom.rng b/data/doc/sisu/model/xml/output/rng/dom.rng
new file mode 100644
index 00000000..eea891ec
--- /dev/null
+++ b/data/doc/sisu/model/xml/output/rng/dom.rng
@@ -0,0 +1,438 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- dom output model, part of SiSU and under the same license -->
+<grammar xmlns:xlink="http://www.w3.org/1999/xlink" ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <element name="document">
+ <element name="head">
+ <oneOrMore>
+ <element name="header">
+ <ref name="meta"/>
+ <choice>
+ <element name="creator">
+ <text/>
+ </element>
+ <element name="date">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_available">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_created">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_issued">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_modified">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_valid">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="keywords">
+ <text/>
+ </element>
+ <element name="language">
+ <data type="NCName"/>
+ </element>
+ <element name="rights">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="link"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="source">
+ <text/>
+ </element>
+ <element name="structure">
+ <text/>
+ </element>
+ <element name="subject">
+ <text/>
+ </element>
+ <element name="title">
+ <text/>
+ </element>
+ <element name="type">
+ <text/>
+ </element>
+ <element name="source_control">
+ <oneOrMore>
+ <choice>
+ <ref name="br"/>
+ <ref name="meta"/>
+ <element name="sc">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </choice>
+ </element>
+ </oneOrMore>
+ </element>
+ <element name="body">
+ <oneOrMore>
+ <element name="heading1">
+ <ref name="heading"/>
+ <zeroOrMore>
+ <ref name="contents1"/>
+ </zeroOrMore>
+ <zeroOrMore>
+ <element name="heading2">
+ <ref name="heading"/>
+ <zeroOrMore>
+ <ref name="contents1"/>
+ </zeroOrMore>
+ <zeroOrMore>
+ <element name="heading3">
+ <ref name="heading"/>
+ <oneOrMore>
+ <element name="contents1">
+ <ref name="heading"/>
+ <ref name="content"/>
+ <zeroOrMore>
+ <element name="contents2">
+ <ref name="heading"/>
+ <ref name="content"/>
+ <zeroOrMore>
+ <element name="contents3">
+ <ref name="heading"/>
+ <ref name="content"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ </zeroOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </zeroOrMore>
+ </element>
+ </zeroOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </element>
+ </start>
+ <define name="meta">
+ <element name="meta">
+ <text/>
+ </element>
+ </define>
+ <define name="br">
+ <element name="br">
+ <empty/>
+ </element>
+ </define>
+ <define name="heading">
+ <element name="heading">
+ <ref name="object"/>
+ </element>
+ </define>
+ <define name="contents1">
+ <element name="contents1">
+ <ref name="heading"/>
+ <ref name="content"/>
+ <zeroOrMore>
+ <element name="contents2">
+ <ref name="heading"/>
+ <ref name="content"/>
+ <zeroOrMore>
+ <element name="contents3">
+ <ref name="heading"/>
+ <ref name="content"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="content">
+ <element name="content">
+ <zeroOrMore>
+ <ref name="object"/>
+ </zeroOrMore>
+ </element>
+ </define>
+<!--
+ <define name="contents1">
+ <element name="contents1">
+ <ref name="heading"/>
+ <element name="content">
+ <oneOrMore>
+ <ref name="object"/>
+ </oneOrMore>
+ </element>
+ </element>
+ </define>
+-->
+ <define name="object">
+ <element name="object">
+ <attribute name="id">
+ <data type="integer"/>
+ </attribute>
+ <element name="ocn">
+ <text/>
+ </element>
+ <optional>
+ <element name="nametag">
+ <text/>
+ </element>
+ </optional>
+ <choice>
+ <element name="table">
+ <attribute name="align">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="bgcolor">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="border">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="cellpadding">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="summary"/>
+ <attribute name="width"/>
+ <oneOrMore>
+ <element name="tr">
+ <oneOrMore>
+ <element name="td">
+ <attribute name="valign">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="width"/>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ <element name="text">
+ <optional>
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ </optional>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="del"/>
+ <ref name="endnote"/>
+ <ref name="i"/>
+ <ref name="link"/>
+ <element name="br">
+ <empty/>
+ </element>
+ <element name="endnote">
+ <element name="number">
+ <data type="integer"/>
+ </element>
+ <element name="note">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ <ref name="link"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </element>
+ <element name="image">
+ <attribute name="height">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="width">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="xlink:actuate">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="xlink:href"/>
+ <attribute name="xlink:show">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="xlink:type">
+ <data type="NCName"/>
+ </attribute>
+ </element>
+ <element name="sub">
+ <text/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </choice>
+<!--
+ <element name="text">
+ <optional>
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ </optional>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ <element name="b">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="endnote">
+ <choice>
+ <element name="number">
+ <data type="integer"/>
+ </element>
+ <element name="symbol">
+ <text/>
+ </element>
+ </choice>
+ <element name="note">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ <element name="br">
+ <empty/>
+ </element>
+ <element name="link">
+ <attribute name="xlink:href">
+ <data type="anyURI"/>
+ </attribute>
+ <attribute name="xlink:type">
+ <data type="NCName"/>
+ </attribute>
+ <data type="anyURI"/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </element>
+ <element name="u">
+ <ref name="i"/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+-->
+ </element>
+ </define>
+<!--
+ <define name="content">
+ <element name="content">
+ <zeroOrMore>
+ <ref name="object"/>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="b">
+ <element name="b">
+ <text/>
+ </element>
+ </define>
+-->
+ <define name="i">
+ <element name="i">
+ <text/>
+ </element>
+ </define>
+ <define name="b">
+ <element name="i">
+ <text/>
+ </element>
+ </define>
+ <define name="u">
+ <element name="u">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="sub">
+ <element name="sub">
+ <data type="NCName"/>
+ </element>
+ </define>
+ <define name="sup">
+ <element name="sup">
+ <data type="NCName"/>
+ </element>
+ </define>
+ <define name="del">
+ <element name="del">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ <ref name="link"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="link">
+ <element name="link">
+ <attribute name="xlink:href">
+ <data type="anyURI"/>
+ </attribute>
+ <attribute name="xlink:type">
+ <data type="NCName"/>
+ </attribute>
+ <data type="anyURI"/>
+ </element>
+ </define>
+ <define name="endnote">
+ <element name="endnote">
+ <choice>
+ <element name="number">
+ <data type="integer"/>
+ </element>
+ <element name="symbol">
+ <text/>
+ </element>
+ </choice>
+ <element name="note">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="br"/>
+ <ref name="del"/>
+ <ref name="i"/>
+ <ref name="link"/>
+ <ref name="sub"/>
+ <ref name="sup"/>
+ <ref name="u"/>
+ <element name="em">
+ <data type="NCName"/>
+ </element>
+ <element name="sub">
+ <data type="NCName"/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </element>
+ </define>
+</grammar>
diff --git a/data/doc/sisu/model/xml/output/rng/sax.rng b/data/doc/sisu/model/xml/output/rng/sax.rng
new file mode 100644
index 00000000..a2df4fed
--- /dev/null
+++ b/data/doc/sisu/model/xml/output/rng/sax.rng
@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- % sax output model, part of SiSU and distributed under the same license -->
+<grammar xmlns:xlink="http://www.w3.org/1999/xlink" ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <element name="document">
+ <element name="head">
+ <oneOrMore>
+ <choice>
+ <ref name="br"/>
+ <ref name="meta"/>
+ <element name="creator">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <element name="link">
+ <attribute name="xlink:href">
+ <data type="anyURI"/>
+ </attribute>
+ <attribute name="xlink:type">
+ <data type="NCName"/>
+ </attribute>
+ <data type="anyURI"/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="date">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_available">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_created">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_issued">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_modified">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="date_valid">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="keywords">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ <element name="language">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <data type="NCName"/>
+ </element>
+ <element name="meta">
+ <data type="NMTOKEN"/>
+ </element>
+ <element name="rights">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="link"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="source">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ <element name="structure">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ <element name="subject">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ <element name="title">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ <element name="type">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ <element name="source_control">
+ <oneOrMore>
+ <choice>
+ <ref name="br"/>
+ <ref name="meta"/>
+ <element name="sc">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <text/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ <element name="body">
+ <oneOrMore>
+ <element name="object">
+ <attribute name="id"/>
+ <!--
+ <attribute name="id">
+ <data type="integer"/>
+ </attribute>
+ -->
+ <element name="ocn">
+ <text/>
+ <!--
+ <data type="integer"/>
+ -->
+ </element>
+ <optional>
+ <element name="text">
+ <attribute name="class">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="br"/>
+ <ref name="del"/>
+ <ref name="en"/>
+ <ref name="i"/>
+ <ref name="link"/>
+ <ref name="sub"/>
+ <ref name="sup"/>
+ <ref name="u"/>
+ <element name="image">
+ <optional>
+ <attribute name="alt"/>
+ </optional>
+ <optional>
+ <attribute name="height">
+ <data type="integer"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="width">
+ <data type="integer"/>
+ </attribute>
+ </optional>
+ <attribute name="xlink:actuate">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="xlink:href"/>
+ <attribute name="xlink:show">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="xlink:type">
+ <data type="NCName"/>
+ </attribute>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </optional>
+ <optional>
+ <element name="table">
+ <attribute name="align">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="bgcolor">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="border">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="cellpadding">
+ <data type="integer"/>
+ </attribute>
+ <attribute name="summary"/>
+ <attribute name="width"/>
+ <oneOrMore>
+ <element name="tr">
+ <oneOrMore>
+ <element name="td">
+ <attribute name="valign">
+ <data type="NCName"/>
+ </attribute>
+ <attribute name="width"/>
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </optional>
+ <zeroOrMore>
+ <element name="endnote">
+ <optional>
+ <attribute name="notenumber">
+ <data type="integer"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="symbol"/>
+ </optional>
+ <choice>
+ <element name="number">
+ <data type="integer"/>
+ </element>
+ <element name="symbol">
+ <text/>
+ </element>
+ </choice>
+ <element name="note">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="br"/>
+ <ref name="del"/>
+ <ref name="i"/>
+ <ref name="link"/>
+ <ref name="sup"/>
+ <ref name="u"/>
+ <element name="em">
+ <data type="NCName"/>
+ </element>
+ <element name="sub">
+ <data type="NCName"/>
+ </element>
+ </choice>
+ </oneOrMore>
+ </element>
+ </element>
+ </zeroOrMore>
+ </element>
+ </oneOrMore>
+ </element>
+ </element>
+ </start>
+ <define name="meta">
+ <element name="meta">
+ <text/>
+ </element>
+ </define>
+ <define name="br">
+ <element name="br">
+ <empty/>
+ </element>
+ </define>
+ <define name="b">
+ <element name="b">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="en"/>
+ <ref name="i"/>
+ <ref name="link"/>
+ <ref name="sup"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="i">
+ <element name="i">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="br"/>
+ <ref name="sup"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="en">
+ <element name="en">
+ <text/>
+ </element>
+ </define>
+ <define name="sub">
+ <element name="sub">
+ <data type="NCName"/>
+ </element>
+ </define>
+ <define name="sup">
+ <element name="sup">
+ <data type="NCName"/>
+ </element>
+ </define>
+ <define name="link">
+ <element name="link">
+ <attribute name="xlink:href">
+ <data type="anyURI"/>
+ </attribute>
+ <attribute name="xlink:type">
+ <data type="NCName"/>
+ </attribute>
+ <oneOrMore>
+ <choice>
+ <data type="anyURI"/>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ <ref name="sup"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="u">
+ <element name="u">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="del">
+ <element name="del">
+ <oneOrMore>
+ <choice>
+ <text/>
+ <ref name="b"/>
+ <ref name="i"/>
+ <ref name="link"/>
+ </choice>
+ </oneOrMore>
+ </element>
+ </define>
+</grammar>
diff --git a/data/doc/sisu/model/xml/output/xsd/dom.xsd b/data/doc/sisu/model/xml/output/xsd/dom.xsd
new file mode 100644
index 00000000..3132338a
--- /dev/null
+++ b/data/doc/sisu/model/xml/output/xsd/dom.xsd
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- dom output model, part of SiSU and under the same license -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
+ <xs:element name="document">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="head"/>
+ <xs:element ref="body"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="head">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="header"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="header">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="meta"/>
+ <xs:choice>
+ <xs:element ref="creator"/>
+ <xs:element ref="date"/>
+ <xs:element ref="date_available"/>
+ <xs:element ref="date_created"/>
+ <xs:element ref="date_issued"/>
+ <xs:element ref="date_modified"/>
+ <xs:element ref="date_valid"/>
+ <xs:element ref="keywords"/>
+ <xs:element ref="language"/>
+ <xs:element ref="rights"/>
+ <xs:element ref="source"/>
+ <xs:element ref="structure"/>
+ <xs:element ref="subject"/>
+ <xs:element ref="title"/>
+ <xs:element ref="type"/>
+ <xs:element ref="source_control"/>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="creator" type="xs:string"/>
+ <xs:element name="date" type="xs:NMTOKEN"/>
+ <xs:element name="date_available" type="xs:NMTOKEN"/>
+ <xs:element name="date_created" type="xs:NMTOKEN"/>
+ <xs:element name="date_issued" type="xs:NMTOKEN"/>
+ <xs:element name="date_modified" type="xs:NMTOKEN"/>
+ <xs:element name="date_valid" type="xs:NMTOKEN"/>
+ <xs:element name="keywords" type="xs:string"/>
+ <xs:element name="language" type="xs:NCName"/>
+ <xs:element name="rights">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="link"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="source" type="xs:string"/>
+ <xs:element name="structure" type="xs:string"/>
+ <xs:element name="subject" type="xs:string"/>
+ <xs:element name="title" type="xs:string"/>
+ <xs:element name="type" type="xs:string"/>
+ <xs:element name="source_control">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded">
+ <xs:element ref="br"/>
+ <xs:element ref="meta"/>
+ <xs:element ref="sc"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="sc">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="body">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="heading1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="heading1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="contents1"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading2"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="heading2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="contents1"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="heading3"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="heading3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element maxOccurs="unbounded" ref="contents1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contents1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element ref="content"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="contents2"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contents2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element ref="content"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="contents3"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contents3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="heading"/>
+ <xs:element ref="content"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="meta" type="xs:string"/>
+ <xs:element name="br">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="heading">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="object"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="content">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="object"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <!--
+ <define name="contents1">
+ <element name="contents1">
+ <ref name="heading"/>
+ <element name="content">
+ <oneOrMore>
+ <ref name="object"/>
+ </oneOrMore>
+ </element>
+ </element>
+ </define>
+ -->
+ <xs:element name="object">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="ocn"/>
+ <xs:element minOccurs="0" ref="nametag"/>
+ <xs:choice>
+ <xs:element ref="table"/>
+ <xs:element ref="text"/>
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="id" use="required" type="xs:integer"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ocn" type="xs:string"/>
+ <xs:element name="nametag" type="xs:string"/>
+ <xs:element name="table">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="tr"/>
+ </xs:sequence>
+ <xs:attribute name="align" use="required" type="xs:NCName"/>
+ <xs:attribute name="bgcolor" use="required" type="xs:NCName"/>
+ <xs:attribute name="border" use="required" type="xs:integer"/>
+ <xs:attribute name="cellpadding" use="required" type="xs:integer"/>
+ <xs:attribute name="summary" use="required"/>
+ <xs:attribute name="width" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="tr">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="td"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="td">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="i"/>
+ <xs:element ref="i"/>
+ </xs:choice>
+ <xs:attribute name="valign" use="required" type="xs:NCName"/>
+ <xs:attribute name="width" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="text">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="i"/>
+ <xs:element ref="del"/>
+ <xs:element ref="endnote"/>
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ <xs:element ref="br"/>
+ <xs:element name="endnote">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="number"/>
+ <xs:element name="note">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="image"/>
+ <xs:element name="sub" type="xs:string"/>
+ </xs:choice>
+ <xs:attribute name="class" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="number" type="xs:integer"/>
+ <xs:element name="image">
+ <xs:complexType>
+ <xs:attribute name="height" use="required" type="xs:integer"/>
+ <xs:attribute name="width" use="required" type="xs:integer"/>
+ <xs:attribute ref="xlink:actuate" use="required"/>
+ <xs:attributeGroup ref="xlink:href"/>
+ <xs:attribute ref="xlink:show" use="required"/>
+ <xs:attribute ref="xlink:type" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <!--
+ <define name="content">
+ <element name="content">
+ <zeroOrMore>
+ <ref name="object"/>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="b">
+ <element name="b">
+ <text/>
+ </element>
+ </define>
+ -->
+ <xs:element name="i" type="xs:string"/>
+ <xs:element name="u">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="i"/>
+ <xs:element ref="i"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="sub" type="xs:NCName"/>
+ <xs:element name="sup" type="xs:NCName"/>
+ <xs:element name="del">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="i"/>
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="link">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:anyURI">
+ <xs:attributeGroup ref="xlink:href1"/>
+ <xs:attribute ref="xlink:type" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="endnote">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element ref="number"/>
+ <xs:element ref="symbol"/>
+ </xs:choice>
+ <xs:element name="note">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="i"/>
+ <xs:element ref="br"/>
+ <xs:element ref="del"/>
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ <xs:element ref="sub"/>
+ <xs:element ref="sup"/>
+ <xs:element ref="u"/>
+ <xs:element ref="em"/>
+ <xs:element ref="sub"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="symbol" type="xs:string"/>
+ <xs:element name="em" type="xs:NCName"/>
+</xs:schema>
diff --git a/data/doc/sisu/model/xml/output/xsd/sax.xsd b/data/doc/sisu/model/xml/output/xsd/sax.xsd
new file mode 100644
index 00000000..db6eb147
--- /dev/null
+++ b/data/doc/sisu/model/xml/output/xsd/sax.xsd
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- % sax output model, part of SiSU and distributed under the same license -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
+ <xs:element name="document">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="head"/>
+ <xs:element ref="body"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="head">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded">
+ <xs:element ref="br"/>
+ <xs:element ref="meta"/>
+ <xs:element ref="creator"/>
+ <xs:element ref="date"/>
+ <xs:element ref="date_available"/>
+ <xs:element ref="date_created"/>
+ <xs:element ref="date_issued"/>
+ <xs:element ref="date_modified"/>
+ <xs:element ref="date_valid"/>
+ <xs:element ref="keywords"/>
+ <xs:element ref="language"/>
+ <xs:element name="meta" type="xs:NMTOKEN"/>
+ <xs:element ref="rights"/>
+ <xs:element ref="source"/>
+ <xs:element ref="structure"/>
+ <xs:element ref="subject"/>
+ <xs:element ref="title"/>
+ <xs:element ref="type"/>
+ <xs:element ref="source_control"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="creator">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" name="link">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:anyURI">
+ <xs:attributeGroup ref="xlink:href"/>
+ <xs:attribute ref="xlink:type" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="date">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:NMTOKEN">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="date_available">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:NMTOKEN">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="date_created">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:NMTOKEN">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="date_issued">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:NMTOKEN">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="date_modified">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:NMTOKEN">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="date_valid">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:NMTOKEN">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="keywords">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="language">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:NCName">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rights">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="link"/>
+ </xs:sequence>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="source">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="structure">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="subject">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="title">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="type">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="source_control">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded">
+ <xs:element ref="br"/>
+ <xs:element ref="meta"/>
+ <xs:element ref="sc"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="sc">
+ <xs:complexType mixed="true">
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="body">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="object"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="object">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="ocn"/>
+ <xs:element minOccurs="0" ref="text"/>
+ <xs:element minOccurs="0" ref="table"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="endnote"/>
+ </xs:sequence>
+ <xs:attribute name="id" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ocn" type="xs:string"/>
+ <xs:element name="text">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="br"/>
+ <xs:element ref="del"/>
+ <xs:element ref="en"/>
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ <xs:element ref="sub"/>
+ <xs:element ref="sup"/>
+ <xs:element ref="u"/>
+ <xs:element ref="image"/>
+ </xs:choice>
+ <xs:attribute name="class" use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="image">
+ <xs:complexType>
+ <xs:attribute name="alt"/>
+ <xs:attribute name="height" type="xs:integer"/>
+ <xs:attribute name="width" type="xs:integer"/>
+ <xs:attribute ref="xlink:actuate" use="required"/>
+ <xs:attributeGroup ref="xlink:href1"/>
+ <xs:attribute ref="xlink:show" use="required"/>
+ <xs:attribute ref="xlink:type" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="table">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="tr"/>
+ </xs:sequence>
+ <xs:attribute name="align" use="required" type="xs:NCName"/>
+ <xs:attribute name="bgcolor" use="required" type="xs:NCName"/>
+ <xs:attribute name="border" use="required" type="xs:integer"/>
+ <xs:attribute name="cellpadding" use="required" type="xs:integer"/>
+ <xs:attribute name="summary" use="required"/>
+ <xs:attribute name="width" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="tr">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="td"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="td">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="i"/>
+ </xs:choice>
+ <xs:attribute name="valign" use="required" type="xs:NCName"/>
+ <xs:attribute name="width" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="endnote">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element ref="number"/>
+ <xs:element ref="symbol"/>
+ </xs:choice>
+ <xs:element ref="note"/>
+ </xs:sequence>
+ <xs:attribute name="notenumber" type="xs:integer"/>
+ <xs:attribute name="symbol"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="number" type="xs:integer"/>
+ <xs:element name="symbol" type="xs:string"/>
+ <xs:element name="note">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="br"/>
+ <xs:element ref="del"/>
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ <xs:element ref="sup"/>
+ <xs:element ref="u"/>
+ <xs:element ref="em"/>
+ <xs:element ref="sub"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="em" type="xs:NCName"/>
+ <xs:element name="sub" type="xs:NCName"/>
+ <xs:element name="meta" type="xs:string"/>
+ <xs:element name="br">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="b">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="en"/>
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ <xs:element ref="sup"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="i">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="br"/>
+ <xs:element ref="sup"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="en" type="xs:string"/>
+ <xs:element name="sup" type="xs:NCName"/>
+ <xs:element name="link">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="i"/>
+ <xs:element ref="sup"/>
+ </xs:choice>
+ <xs:attributeGroup ref="xlink:href"/>
+ <xs:attribute ref="xlink:type" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="u">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="i"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="del">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="b"/>
+ <xs:element ref="i"/>
+ <xs:element ref="link"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
diff --git a/data/doc/sisu/on_markup.txt b/data/doc/sisu/on_markup.txt
new file mode 100644
index 00000000..72aee93b
--- /dev/null
+++ b/data/doc/sisu/on_markup.txt
@@ -0,0 +1,343 @@
+SiSU Markup Standard
+* Copyright Ralph Amissah
+* version 0.16.0
+* homepage: http://www.jus.uio.no/sisu
+* manpages 'man sisu'
+* markup examples
+ * data/sisu-markup-samples/document_samples_sisu_markup
+ * /usr/share/sisu-markup-samples/document_samples_sisu_markup
+ * http://www.jus.uio.no/sisu/sample/markup
+ * http://www.jus.uio.no/sisu/sample/syntax
+* book samples
+ * http://www.jus.uio.no/sisu/sisu_examples/1#books
+ * http://www.jus.uio.no/sisu/SiSU/2#books
+
+The man pages 'man sisu' are likely to be more up to date than this document,
+please consult them.
+
+Examples of marked up documents are also provided, under the directory branch
+data/sisu-markup-samples
+or online at
+
+SiSU Markup syntax
+
+sisu
+ Data text markup (alternative to available html subset)
+
+ 1~ heading/title [levels 1 to 6 available]
+
+ 4~filename heading [segmentation level]
+
+ !{emphasis}!
+
+ *{bold text}*
+
+ _{underscore}_
+
+ /{italics}/
+
+ "{citation}"
+
+ ^{superscript}^
+
+ ,{subscript},
+
+ +{inserted text}+
+
+ -{strikethrough}-
+
+ ------------------------------------------
+ Indentation and bullets
+
+ _1 indent paragraph one level
+
+ _2 indent paragraph two steps
+
+ _2 indent paragraph two steps
+
+ _* bullet text
+
+ _1* bullet text, first indent
+
+ ------------------------------------------
+ Numbered List (not to be confused with headings/titles, (document structure))
+
+ # numbered list numbered list 1., 2., 3, etc.
+
+ _# numbered list numbered list indented a., b., c., d., etc.
+
+ ------------------------------------------
+ Endnotes
+
+ ~{ endnote }~ endnote~{ self contained endnote marker & endnote in one }~
+
+ ---
+ alternative endnote pair notation
+
+ ~^ endnote marker
+ ^~ endnote text following the paragraph in which the marker occurs
+
+ ------------------------------------------
+ Links
+
+ A url within text is automatically hyperlinked to itself, ie raw urls within text are automatically marked up.
+
+ http://url.org would be hyperlinked to itself
+
+ { [text to link] }http://url.org
+
+ { image.png }http://url.org
+
+ { image.png }image { tux.png 64x80 }image width x height
+
+ Linked image
+
+ { SiSU Geek Writer }http://www.jus.uio.no/sisu/ url example
+
+ { tux.png 64x80 "a better way" }http://www.jus.uio.no/sisu/ image example with all options
+
+ shortcut - hyper-linked text with endnote providing the url information
+
+ {~^ [text to link] }http://url.org maps to { [text to link] }http://url.org ~{ http://url.org }~
+ which produces hyper-linked text within a document/paragraph, with an endnote providing the url for the text location used in the hyperlink
+
+ manual location marker/tagging at present only in html to produce <a name="[name]"> (use sparingly)
+
+ *~[name]
+
+ note at a heading level the same is automatically achieved by providing names to headings 5 and 6 i.e. 5~[name] and 6~[name] or in the case of auto-heading numbering, without further intervention.
+
+ ------------------------------------------
+
+ ~# unnumbered paragraph (place marker at end of paragraph)
+
+ -# unnumbered paragraph, delete when not required (place marker at end of paragraph) [used in dummy headings, eg. for segmented html]
+
+ ------------------------------------------
+ % add a comment to text, that will be removed prior to processing (place marker at beginning of line)
+
+ ------------------------------------------
+
+ There are some things to be aware of <br> may be used, but urls occuring before or after a break must have a space. The vim syntax highlighter catches most of the rules...
+
+ ------------------------------------------
+
+ More HELP on Markup markup help is available on:
+
+ document wide instructions: headers (document structure)
+
+ general text markup: headings; endnotes; tables
+
+ configuration and customisation
+
+ document or site wide customisation: customise; skin
+
+TABLES
+
+
+table{ [number of columns] [column width %];[column width %]
+
+[table content, line breaks are important see example below]
+
+}table
+----
+This is a sample table:
+-----------------------
+
+table{ c3; 40; 30; 30;
+
+This is a table
+this would become column two of row one
+column three of row one is here
+
+And here begins another row
+column two of row two
+column three of row two, and so on
+
+}table
+
+PREFORMATTED TEXT
+
+poem{
+
+ [Text here]
+
+}poem
+----
+
+group{
+
+ [Text here]
+
+}group
+----
+
+code{
+
+ [Text here]
+
+}code
+
+HEADERS
+
+Header tags appear at the beginning of a document and provide meta information on the document (such as the Dublin Core), or information as to how the document as a whole is to be processed.
+All header instructions take either the form 0~ . All Dublin Core meta tags are available
+0~indentifier information
+where the "identifier" is a tag recognised by the program, and the "information" or "instructions" belong to the tag/indentifier specified
+The { form was introduced to take advantage of vim folds, and its use is reserved primarily for document structural instructions: namely header and heading tags (also a footnote/endnote option).
+This is a sample header (Dublin Core in fuschia, other information headers in cyan, markup instructions in red):
+
+0~title My Title - This is now the Title of the Document and used as such
+
+0~subtitle The Subtitle if any
+
+0~creator [or ~author] Ralph Amissah
+
+0~subject Document production and management (or whatever your subject)
+
+0~description
+
+0~publisher
+
+0~contributor
+
+0~date 2000-08-27
+ [ also 0~date.created 0~date.issued 0~date.available 0~date.valid 0~date.modified ]
+
+0~type article
+
+0~format
+
+0~identifier
+
+0~source
+
+0~language (en|us|fr|de|es|se|dk|fi|no)
+
+0~relation
+
+0~coverage
+
+0~rights copyright, all rights reserved, public domain, copyleft, creative commons variant, etc.
+
+0~owner
+
+0~keywords text document generation processing management latex pdf structured xml citation [your keywords here, used for example by rss feeds, and in sql searches]
+
+0~abstract [paper abstract, placed after table of contents]
+
+0~comment [...]
+
+0~classify_loc [Library of Congress classification]
+
+0~classify_dewey [Dewey classification system]
+
+0~classify_isbn [ISBN]
+
+0~classify_pg [Project Gutenberg text number]
+
+0~prefix_a [prefix is placed just before table of contents - not implemented]
+
+0~prefix_b or 0~prefix [prefix is placed just after table of contents]
+
+0~rcs $Id$ [or 0~cvs used by rcs or cvs to embed version (revision control) information into document, rcs or cvs can usefully provide a history of updates to a document ]
+
+0~toc PART; CHAPTER; SECTION; ARTICLE; none; none;
+optional, where document structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text)
+default markers 1~ to 6~ can be used within text instead, without this header tag, and may be used to suppliment the instructions provided in this header tag if provided
+
+0~level newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage]
+
+0~markup num_top=4 [various markup instructions, eg: num_top=4 headings tobe numbered, starting at heading level 4... the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level]
+
+0~vocabulary name of taxonomy/vocabulary/wordlist to use against document
+
+0~skin skin_doc_[name_of_desired_document_skin]
+
+0~links http://google.com; Google;
+
+1~ Top level heading [this is usually the same as the title 0~title ]
+
+2~ Second level heading [this is a heading level divider]
+
+3~ Third level heading [this is a heading level divider]
+
+4~ Top level heading preceeding substantive text of document or sub-heading 5, the heading level that would normally be marked 1. or 2. or 3. etc. in a document
+
+5~ Second level heading preceeding substantive text of document or sub-heading 6, the heading level that would normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc in a document
+
+6~ Third level heading preceeding substantive text of document, that would normally be marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document
+
+SAMPLE DOCUMENT
+
+For sample marked up documents see the directory
+ markup_samples
+
+0~title Working Sample Document
+
+0~subtitle Demonstrating markup
+
+0~creator Ralph Amissah
+
+0~date
+
+0~markup num_top=4
+
+0~links
+
+1~ A Sample Document
+
+2~ just for fun
+
+4~ This is Chapter One or Article One
+
+Ordinary Text follows here. The Title would be a Chapter or Article depending on the type of document you were working to produce.
+
+4~ This would be Chapter Two or Article Two
+
+And so on.
+
+Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .s3 if saved as example.s3, by typing sisu -mhwxp example.s3 while in the directory in which the file is saved.
+
+_1 -m initial processing, -h html (css based), -w wordmap for html, -x xml, -p pdf output, generated via latex, there are of course additional options
+
+_1 for a listing type: sisu ~ commands
+
+_1 for an outline of sisu markup type: sisu ~ markup
+
+The example ends here.
+
+-------------------
+
+Composite Documents
+
+It is possible to build a document by requiring other documents. The documents required may complete documents that could be gener ated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other doc uments), by convention it should be named with the suffix .r1 , .r2 , or .r3 .s1 , .s2 , or .s3 , and if markup snippets .si. A tempo rary file of the composite document is built prior to processing with the same prefix and the suffix .t1 , .t2 , or .t3
+
+basic markup for importing a document into another,
+[note placement is at start of the line, no spaces despite presentation below]
+
+ r{ filename }
+
+ { filename.si }require
+
+ << { filename.si } #for vim folds
+
+importing a document with textlink syntax
+
+ |filename.si|@|^|require
+
+ << |filename.si|@|^| #for vim folds
+
+
+importing a document with thlnk syntax
+
+ <url:filename.si>require
+
+ << <url:filename.si> #for vim folds
+
+
+remote documents may be called with the thlnk syntax (or regular
+sisu syntax), e.g.
+
+ << <url:http://www.url.com/filename.si>
+
diff --git a/data/doc/sisu/on_standards.txt b/data/doc/sisu/on_standards.txt
new file mode 100644
index 00000000..fc34468b
--- /dev/null
+++ b/data/doc/sisu/on_standards.txt
@@ -0,0 +1,17 @@
+* Name: SiSU information Structuring Universe
+* Author: Ralph@Amissah.com
+* Description: Information on SiSU Standards
+* homepage: http://www.jus.uio.no/sisu
+
+SiSU uses:
+* Standard SiSU markup syntax,
+* Standard SiSU meta-markup syntax, and the
+* Standard SiSU object citation numbering and system
+
+Information on these may be obtained from:
+ http://www.jus.uio.no/sisu/SiSU
+
+More information to be provided later.
+
+? Ralph Amissah 1997, current 2005
+All Rights Reserved
diff --git a/data/doc/sisu/sisu_markup_samples/README.samples b/data/doc/sisu/sisu_markup_samples/README.samples
new file mode 100644
index 00000000..56ec4c21
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/README.samples
@@ -0,0 +1,9 @@
+Document samples for sisu processing are contained in the sub-directory
+./dfsg and if it exists ./non-free
+
+DFSG stands for Debian Free Software Guidelines.
+
+Sample documents in the dfsg directory should comply with the guidelines.
+
+The non-free directory if it exists contains document samples that do not or
+may not comply with the DFSG.
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/README b/data/doc/sisu/sisu_markup_samples/dfsg/README
new file mode 100644
index 00000000..ef602a54
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/README
@@ -0,0 +1,6 @@
+A few document markup samples, note that more can be found at
+http://www.jus.uio.no/sisu
+http://www.jus.uio.no/sisu/SiSU/2
+
+"Free as in Freedom" on Richard Stallman by Sam Williams
+was published under the GNU Free Documentation License
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/Gnu_Debian_Linux_Ruby_Way_Better.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/Gnu_Debian_Linux_Ruby_Way_Better.png
new file mode 100644
index 00000000..0f3f4a16
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/Gnu_Debian_Linux_Ruby_Way_Better.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/b_doc.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/b_doc.png
new file mode 100644
index 00000000..13ca8ebe
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/b_doc.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Copyleft.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Copyleft.png
new file mode 100644
index 00000000..5b3865b8
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Copyleft.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Euro.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Euro.png
new file mode 100644
index 00000000..8e5c13a9
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/c_Euro.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/debian_home.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/debian_home.png
new file mode 100644
index 00000000..cee42aa0
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/debian_home.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom.png
new file mode 100644
index 00000000..ad4c05b2
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_01_rms.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_01_rms.png
new file mode 100644
index 00000000..3b4563b0
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_01_rms.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_02_rms_snr_year_report.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_02_rms_snr_year_report.png
new file mode 100644
index 00000000..5d5a57aa
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_02_rms_snr_year_report.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_03_rms_st_ignucius.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_03_rms_st_ignucius.png
new file mode 100644
index 00000000..d84bf568
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_03_rms_st_ignucius.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_04_rms_pleasure_card.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_04_rms_pleasure_card.png
new file mode 100644
index 00000000..2ab79e1c
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/free_as_in_freedom_04_rms_pleasure_card.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/kdissert.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/kdissert.png
new file mode 100644
index 00000000..2dff3753
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/kdissert.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/levitating_gnu.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/levitating_gnu.png
new file mode 100644
index 00000000..9a25319a
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/levitating_gnu.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/philosophical_gnu.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/philosophical_gnu.png
new file mode 100644
index 00000000..ebd239ef
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/philosophical_gnu.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/sisu.png b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/sisu.png
new file mode 100644
index 00000000..b449fa6b
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/image/sisu.png
Binary files differ
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb
new file mode 100644
index 00000000..66786cea
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb
@@ -0,0 +1,105 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph@Amissah.com
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin for SiSU descriptive pages, ...
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require SiSU_lib + '/defaults'
+ class Skin
+ #% widget
+ def widget_search
+ true
+ end
+ def widget_promo
+#put s "#{__LINE__} #{__FILE__}"
+ #['sisu','ruby','sisu_search_libre','ruby','open_society']
+ end
+ #% path
+ def path_root
+#puts "#{__LINE__} #{__FILE__}"
+ './sisu/' # the only parameter that cannot be changed here
+ end
+ def path_rel
+#puts "#{__LINE__} #{__FILE__}"
+ '../'
+ end
+ #% url
+ def url_home
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu/'
+ end
+ def url_site # used in pdf header
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_txt # text to go with url usually stripped url
+#puts "#{__LINE__} #{__FILE__}"
+ 'www.jus.uio.no/sisu/'
+ end
+ def url_home_url
+#puts "#{__LINE__} #{__FILE__}"
+ '../index.html'
+ end
+ #def url_root_http
+ #root server path info, used in document information
+ #end
+ #% color
+ def color_band1
+ '"#ffffff"'
+ end
+ def color_band2
+ '"#ffffff"'
+ end
+ #% text
+ def text_hp
+ '&nbsp;SiSU'
+ end
+ def text_home
+ 'SiSU'
+ end
+ #% icon
+ def icon_home_button
+ 'sisu.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#ffffff"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}</td></tr></table></center>}
+ end
+ #% stamp
+ def stamp_stmp
+ "\\copyright Ralph Amissah, released under the GPL \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Ralph Amissah}"
+ end
+ def owner_chapter
+ 'Document owner details'
+ end
+ end
+end
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb
new file mode 100644
index 00000000..50516f85
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb
@@ -0,0 +1,96 @@
+=begin
+ * Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Free Software Foundation, Gnu sisu skin
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require SiSU_lib + '/defaults'
+ class Skin
+ #% widget
+ def widget_promo
+ # ['sisu_icon','sisu','sisu_search_libre','open_society','fsf','ruby']
+ end
+ #% home
+ def home_index
+ end
+ def home_toc
+ end
+ #% path
+ def path_root
+ './sisu/' # the only parameter that cannot be changed here
+ end
+ def path_rel
+ '../'
+ end
+ #% url
+ def url_home
+ 'http://www.fsf.org'
+ end
+ def url_site # used in pdf header
+ 'http://www.fsf.org'
+ end
+ def url_txt # text to go with url usually stripped url
+ 'www.fsf.org'
+ end
+ def url_home_url
+ '../index.html'
+ end
+ # color
+ def color_band1
+ '"#000070"'
+ end
+ #% txt
+ def txt_hp
+ 'Free Software Foundation'
+ end
+ def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ...
+ #"www.jus.uio.no/sisu/"
+ 'Free Software Foundation'
+ end
+ #% icon
+ def icon_home_button
+ 'philosophical_gnu.png'
+ end
+ def icon_home_banner
+ icion_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table border="0" summary="home button" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#f1e8de"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}#{table_close}</center>}
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.fsf.org}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Free Software Foundation}"
+ end
+ def owner_chapter
+ "Document owner details"
+ end
+ end
+ class Stamp
+ def stmp
+ "\\copyright Ralph Amissah to be released under the GPL (or QT License equivalent as to be decided) \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+end
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb
new file mode 100644
index 00000000..0df9c7ff
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb
@@ -0,0 +1,218 @@
+=begin
+ * Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin sample prepared for Gutenberg Project (first used with "War and Peace")
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require "#{SiSU_lib}/defaults"
+ class Skin
+ #% path
+ def path_root # the only parameter that cannot be changed here
+ './sisu/'
+ end
+ def path_rel
+ '../'
+ end
+ #% url
+ def url_home
+ 'http://www.gutenberg.net'
+ end
+ def url_txt # text to go with url usually stripped url
+ 'www.gutenberg.net'
+ end
+ #% txt
+ def txt_hp
+ 'www.gutenberg.net'
+ end
+ def txt_home
+ 'Gutenberg Project'
+ end
+ #% icon
+ def icon_home_button
+ 'gutenberg.home.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor=#{color_yellow_dark}><a href="#{url_home}">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor=#{color_yellow_dark}><a href="#{url_home}" target="_top">#{png_home}</a></td></tr></table></td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#f1e8de"><font face="arial" size="2"><a href="toc.html" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font></td></tr></table></center></center></td><td width="20%">&nbsp;</td></tr></table>}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor=#{color_yellow_dark}><a href="#{url_home}" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<table summary="credits" align="center"bgcolor="#ffffff"><tr><td><font color="black"><center><a href="http://www.gutenberg.net/"><img border="0" align="center" src="../_sisu/image_local/gutenberg_icon.png" alt="Gutenberg Project"><br />Courtesy of The Gutenberg Project</a><br />#{widget_sisu}</center></font></td></tr></table>}
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_home}}{www.gutenberg.net}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_home}}{www.gutenberg.net}"
+ end
+ def home
+ "\\href{#{@vz.url_home}}{Gutenberg Project}"
+ end
+ def owner_chapter
+ "Document owner details"
+ end
+ def stmp
+ "\\copyright Ralph Amissah, licence GPL \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+ class Inserts
+ def insert1
+<<CONTENTS
+
+3~ Project Gutenberg~#
+
+4~ Project Gutenberg Notes~#
+
+Copyright laws are changing all over the world, be sure to check the copyright laws for your country before posting these files!!~#
+
+Please take a look at the important information in this header. We encourage you to keep this file on your own disk, keeping an electronic path open for the next readers. Do not remove this.~#
+
+*{It must legally be the first thing seen when opening the book.}* In fact, our legal advisors said we can't even change margins.~#
+
+*{Welcome To The World of Free Plain Vanilla Electronic Texts}*~#
+
+*{Etexts Readable By Both Humans and By Computers, Since 1971}*~#
+
+*{These Etexts Prepared By Hundreds of Volunteers and Donations}*~#
+
+Information on contacting Project Gutenberg to get Etexts, and further information is included below. We need your donations.~#
+
+CONTENTS
+ end
+ def insert2 #note took out stop after http://promo.net/pg and created space after this url repeated in subsequent paragraph, as broke latex/pdf, think of modifying regexs for urls
+<<CONTENTS
+Project Gutenberg Etexts are usually created from multiple editions, all of which are in the Public Domain in the United States, unless a copyright notice is included. Therefore, we usually do NOT keep any of these books in compliance with any particular paper edition.~#
+
+We are now trying to release all our books one month in advance of the official release dates, leaving time for better editing.~#
+
+Please note: neither this list nor its contents are final till midnight of the last day of the month of any such announcement. The official release date of all Project Gutenberg Etexts is at Midnight, Central Time, of the last day of the stated month. A preliminary version may often be posted for suggestion, comment and editing by those who wish to do so. To be sure you have an up to date first edition [xxxxx10x.xxx] please check file sizes in the first week of the next month. Since our ftp program has a bug in it that scrambles the date [tried to fix and failed] a look at the file size will have to do, but we will try to see a new copy has at least one byte more or less.~#
+
+4~ Information about Project Gutenberg (one page)~#
+
+We produce about two million dollars for each hour we work. The time it takes us, a rather conservative estimate, is fifty hours to get any etext selected, entered, proofread, edited, copyright searched and analyzed, the copyright letters written, etc. This projected audience is one hundred million readers. If our value per text is nominally estimated at one dollar then we produce $2 million dollars per hour this year as we release thirty-six text files per month, or 432 more Etexts in 1999 for a total of 2000+ If these reach just 10% of the computerized population, then the total should reach over 200 billion Etexts given away this year.~#
+
+The Goal of Project Gutenberg is to Give Away One Trillion Etext Files by December 31, 2001. [10,000 x 100,000,000 = 1 Trillion] This is ten thousand titles each to one hundred million readers, which is only ~5% of the present number of computer users. At our revised rates of production, we will reach only one-third of that goal by the end of 2001, or about 3,333 Etexts unless we manage to get some real funding; currently our funding is mostly from Michael Hart's salary at Carnegie-Mellon University, and an assortment of sporadic gifts; this salary is only good for a few more years, so we are looking for something to replace it, as we don't want Project Gutenberg to be so dependent on one person.~#
+
+We need your donations more than ever!~#
+
+All donations should be made to "Project Gutenberg/CMU": and are tax deductible to the extent allowable by law. (CMU = Carnegie-Mellon University).~#
+
+For these and other matters, please mail to:~#
+
+Project Gutenberg~#
+
+P. O. Box 2782~#
+
+Champaign, IL 61825~#
+
+When all other email fails. . .try our Executive Director: Michael S. Hart hart@pobox.com forwards to hart@prairienet.org and archive.org if your mail bounces from archive.org, I will still see it, if it bounces from prairienet.org, better resend later on. . . .~#
+
+We would prefer to send you this information by email.~#
+
+******~#
+
+To access Project Gutenberg etexts, use any Web browser to view http://promo.net/pg This site lists Etexts by author and by title, and includes information about how to get involved with Project Gutenberg. You could also download our past Newsletters, or subscribe here. This is one of our major sites, please email hart@pobox.com, for a more complete list of our various sites.~#
+
+To go directly to the etext collections, use FTP or any Web browser to visit a Project Gutenberg mirror (mirror sites are available on 7 continents; mirrors are listed at http://promo.net/pg ).~#
+
+Mac users, do NOT point and click, typing works better.~#
+
+Example FTP session:~#
+
+ftp metalab.unc.edu~#
+
+login: anonymous~#
+
+password: your@login~#
+
+cd pub/docs/books/gutenberg~#
+
+cd etext90 through etext99 or etext00 through etext01, etc.~#
+
+dir [to see files]~#
+
+get or mget [to get files. . .set bin for zip files]~#
+
+GET GUTINDEX.?? [to get a year's listing of books, e.g., GUTINDEX.99]~#
+
+GET GUTINDEX.ALL [to get a listing of ALL books]~#
+
+***~#
+
+3~ Information prepared by the Project Gutenberg legal advisor** (three pages)~#
+
+4~ THE SMALL PRINT!**FOR PUBLIC DOMAIN ETEXTS~#
+
+Why is this "Small Print!" statement here? You know: lawyers. They tell us you might sue us if there is something wrong with your copy of this etext, even if you got it for free from someone other than us, and even if what's wrong is not our fault. So, among other things, this "Small Print!" statement disclaims most of our liability to you. It also tells you how you can distribute copies of this etext if you want to.~#
+
+5~ *BEFORE!* YOU USE OR READ THIS ETEXT~#
+
+By using or reading any part of this PROJECT GUTENBERG-tm etext, you indicate that you understand, agree to and accept this "Small Print!" statement. If you do not, you can receive a refund of the money (if any) you paid for this etext by sending a request within 30 days of receiving it to the person you got it from. If you received this etext on a physical medium (such as a disk), you must return it with your request.~#
+
+5~ ABOUT PROJECT GUTENBERG-TM ETEXTS~#
+
+This PROJECT GUTENBERG-tm etext, like most PROJECT GUTENBERG-tm etexts, is a "public domain" work distributed by Professor Michael S. Hart through the Project Gutenberg Association at Carnegie-Mellon University (the "Project"). Among other things, this means that no one owns a United States copyright on or for this work, so the Project (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth below, apply if you wish to copy and distribute this etext under the Project's "PROJECT GUTENBERG" trademark.~#
+
+To create these etexts, the Project expends considerable efforts to identify, transcribe and proofread public domain works. Despite these efforts, the Project's etexts and any medium they may be on may contain "Defects". Among other things, Defects may take the form of incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other etext medium, a computer virus, or computer codes that damage or cannot be read by your equipment.~#
+
+5~ LIMITED WARRANTY; DISCLAIMER OF DAMAGES~#
+
+But for the "Right of Replacement or Refund" described below, [1] the Project (and any other party you may receive this etext from as a PROJECT GUTENBERG-tm etext) disclaims all liability to you for damages, costs and expenses, including legal fees, and [2] YOU HAVE NO REMEDIES FOR NEGLIGENCE OR UNDER STRICT LIABILITY, OR FOR BREACH OF WARRANTY OR CONTRACT, INCLUDING BUT NOT LIMITED TO INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES, EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.~#
+
+If you discover a Defect in this etext within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending an explanatory note within that time to the person you received it from. If you received it on a physical medium, you must return it with your note, and such person may choose to alternatively give you a replacement copy. If you received it electronically, such person may choose to alternatively give you a second opportunity to receive it electronically.~#
+
+THIS ETEXT IS OTHERWISE PROVIDED TO YOU "AS-IS". NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, ARE MADE TO YOU AS TO THE ETEXT OR ANY MEDIUM IT MAY BE ON, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.~#
+
+Some states do not allow disclaimers of implied warranties or the exclusion or limitation of consequential damages, so the above disclaimers and exclusions may not apply to you, and you may have other legal rights.~#
+
+5~ INDEMNITY~#
+
+You will indemnify and hold the Project, its directors, officers, members and agents harmless from all liability, cost and expense, including legal fees, that arise directly or indirectly from any of the following that you do or cause: [1] distribution of this etext, [2] alteration, modification, or addition to the etext, or [3] any Defect.~#
+
+5~ DISTRIBUTION UNDER "PROJECT GUTENBERG-tm"~#
+
+You may distribute copies of this etext electronically, or by disk, book or any other medium if you either delete this "Small Print!" and all other references to Project Gutenberg, or:~#
+
+*{[1]}* Only give exact copies of it. Among other things, this requires that you do not remove, alter or modify the etext or this "small print!" statement. You may however, if you wish, distribute this etext in machine readable binary, compressed, mark-up, or proprietary form, including any form resulting from conversion by word pro- cessing or hypertext software, but only so long as *{EITHER}*:~#
+
+_1 *{[*]}* The etext, when displayed, is clearly readable, and does *not* contain characters other than those intended by the author of the work, although tilde (~), asterisk (*) and underline (_) characters may be used to convey punctuation intended by the author, and additional characters may be used to indicate hypertext links; OR~#
+
+_1 *{[*]}* The etext may be readily converted by the reader at no expense into plain ASCII, EBCDIC or equivalent form by the program that displays the etext (as is the case, for instance, with most word processors); OR~#
+
+_1 *{[*]}* You provide, or agree to also provide on request at no additional cost, fee or expense, a copy of the etext in its original plain ASCII form (or in EBCDIC or other equivalent proprietary form).~#
+
+*{[2]}* Honor the etext refund and replacement provisions of this "Small Print!" statement.~#
+
+*{[3]}* Pay a trademark license fee to the Project of 20% of the net profits you derive calculated using the method you already use to calculate your applicable taxes. If you don't derive profits, no royalty is due. Royalties are payable to "Project Gutenberg Association/Carnegie-Mellon University" within the 60 days following each date you prepare (or were legally required to prepare) your annual (or equivalent periodic) tax return.~#
+
+5~ WHAT IF YOU *WANT* TO SEND MONEY EVEN IF YOU DON'T HAVE TO?~#
+
+The Project gratefully accepts contributions in money, time, scanning machines, OCR software, public domain etexts, royalty free copyright licenses, and every other sort of contribution you can think of. Money should be paid to "Project Gutenberg Association / Carnegie-Mellon University".~#
+
+We are planning on making some changes in our donation structure in 2000, so you might want to email me, hart@pobox.com beforehand.~#
+
+*END THE SMALL PRINT! FOR PUBLIC DOMAIN ETEXTS*Ver.04.29.93*END*~#
+
+<!pn!>
+
+CONTENTS
+ end
+ end
+end
+
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb
new file mode 100644
index 00000000..87d371f2
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb
@@ -0,0 +1,93 @@
+=begin
+ * Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Kdissert
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require "#{SiSU_lib}/defaults"
+ class Skin
+ ##% path
+ #def path_root
+ # './sisu/' # the only parameter that cannot be changed here
+ #end
+ #def path_rel
+ # '../'
+ #end
+ #% url
+ def url_home
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_site # used in pdf header
+ url_home
+ end
+ def url_txt # text to go with url usually stripped url
+ 'www.jus.uio.no/sisu'
+ url_home
+ end
+ def url_hp
+ 'http://freehackers.org/~tnagy/kdissert'
+ end
+ def url_home_url
+ '../index.html'
+ end
+ #% color
+ def color_band1
+ '"#ffffff"'
+ end
+ #% txt
+ def txt_hp
+ 'Kdissert, Document Mapping'
+ end
+ def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ...
+ #"www.jus.uio.no/sisu/"
+ 'SiSU (document prepared using Kdissert)'
+ end
+ #% icon
+ def icon_home_button
+ 'kdissert.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table border="0" summary="home button" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_hp}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#000070"><a href="#{url_hp}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#f1e8de"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_hp}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ def banner_home_guide
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}#{table_close}</center>}
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.fsf.org}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Free Software Foundation}"
+ end
+ def owner_chapter
+ "Document owner details"
+ end
+ end
+ class Stamp
+ def stmp
+ "\\copyright Ralph Amissah to be released under the GPL (or QT License equivalent as to be decided) \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+end
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb
new file mode 100644
index 00000000..2ec6c841
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb
@@ -0,0 +1,105 @@
+=begin
+ * Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin used for Free as in Freedom
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require "#{SiSU_lib}/defaults"
+ class Skin
+ #% promo
+ def promo_promo
+ ['sisu_icon','sisu','sisu_search_libre','open_society','fsf','ruby']
+ end
+ ##% home
+ #def home_index
+ #end
+ #def home_toc
+ #end
+ ##% path
+ #def path_root # the only parameter that cannot be changed here
+ # './sisu/'
+ #end
+ #def path_rel
+ # '../'
+ #end
+ #% url
+ def url_home
+ 'http://www.gnu.org'
+ end
+ def url_site # used in pdf header
+ 'http://www.gnu.org'
+ end
+ def url_txt # text to go with url usually stripped url
+ 'www.gnu.org'
+ end
+ def url_home_url
+ '../index.html'
+ end
+ #def url_root_http
+ #root server path info, used in document information
+ #end
+ #% color
+ def color_band1
+ '"#cccccc"'
+ #'"#000070"'
+ end
+ #% txt
+ def txt_hp
+ 'Free as in Freedom'
+ end
+ def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ...
+ #"www.jus.uio.no/sisu/"
+ 'Free as in Freedom'
+ end
+ #% icon
+ def icon_home_button
+ 'free_as_in_freedom.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#cccccc"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#cccccc"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#f1e8de"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#cccccc"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ def banner_home_guide
+ end
+ #% credits
+ def insert_levitating_gnu #used locally this skin only
+ %{<center><a href="http://www.fsf.org/"><img border="0" height="133" width="135" src="#{url_path_image_base}/levitating_gnu.png" alt="RMS/FSF - Levitating Gnu --&gt;" /></a></center>}
+ end
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td><font color="#666666">#{insert_levitating_gnu}#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}</font></center></td></tr></table></center>}
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.gnu.org}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{GNU - Free Software Foundation}"
+ end
+ def owner_chapter
+ "Document owner details"
+ end
+ end
+ class Stamp
+ def stmp
+ "\\copyright Ralph Amissah to be released under the GPL (or QT License equivalent as to be decided) \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+end
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb
new file mode 100644
index 00000000..66786cea
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb
@@ -0,0 +1,105 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph@Amissah.com
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ * Description: Document skin for SiSU descriptive pages, ...
+ * License: Same as SiSU see http://www.jus.uio.no/sisu
+ * Notes: Site default appearance variables set in defaults.rb
+ Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb
+=end
+module SiSU_Viz
+ require SiSU_lib + '/defaults'
+ class Skin
+ #% widget
+ def widget_search
+ true
+ end
+ def widget_promo
+#put s "#{__LINE__} #{__FILE__}"
+ #['sisu','ruby','sisu_search_libre','ruby','open_society']
+ end
+ #% path
+ def path_root
+#puts "#{__LINE__} #{__FILE__}"
+ './sisu/' # the only parameter that cannot be changed here
+ end
+ def path_rel
+#puts "#{__LINE__} #{__FILE__}"
+ '../'
+ end
+ #% url
+ def url_home
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu/'
+ end
+ def url_site # used in pdf header
+#puts "#{__LINE__} #{__FILE__}"
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_txt # text to go with url usually stripped url
+#puts "#{__LINE__} #{__FILE__}"
+ 'www.jus.uio.no/sisu/'
+ end
+ def url_home_url
+#puts "#{__LINE__} #{__FILE__}"
+ '../index.html'
+ end
+ #def url_root_http
+ #root server path info, used in document information
+ #end
+ #% color
+ def color_band1
+ '"#ffffff"'
+ end
+ def color_band2
+ '"#ffffff"'
+ end
+ #% text
+ def text_hp
+ '&nbsp;SiSU'
+ end
+ def text_home
+ 'SiSU'
+ end
+ #% icon
+ def icon_home_button
+ 'sisu.png'
+ end
+ def icon_home_banner
+ icon_home_button
+ end
+ #% banner
+ def banner_home_button
+ %{<table summary="home button" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/">#{png_home}</a></td></tr></table>\n}
+ end
+ def banner_home_and_index_buttons
+ %{<table><tr><td width="20%"><table summary="home and index buttons" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}</td><td width="60%"><center><center><table summary="buttons" border="1" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#ffffff"><font face="arial" size="2"><a href="toc" target="_top">&nbsp;This&nbsp;text&nbsp;sub-&nbsp;<br />&nbsp;Table&nbsp;of&nbsp;Contents&nbsp;</a></font>#{table_close}</center></center></td><td width="20%">&nbsp;#{table_close}}
+ end
+ def banner_band
+ %{<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="#{url_site}/" target="_top">#{png_home}</a>#{table_close}}
+ end
+ #% credits
+ def credits_splash
+ %{<center><table summary="credits" align="center"bgcolor="#ffffff"><tr><td>#{widget_sisu}#{widget_wayBetter}#{widget_browsers}#{widget_pdfviewers}</td></tr></table></center>}
+ end
+ #% stamp
+ def stamp_stmp
+ "\\copyright Ralph Amissah, released under the GPL \\\\\n ralph@amissah.com \\\\\n www.jus.uio.no/sisu/"
+ end
+ end
+ class TeX
+ def header_center
+ "\\chead{\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}}"
+ end
+ def home_url
+ "\\href{#{@vz.url_site}/}{www.jus.uio.no/sisu/}"
+ end
+ def home
+ "\\href{#{@vz.url_site}/}{Ralph Amissah}"
+ end
+ def owner_chapter
+ 'Document owner details'
+ end
+ end
+end
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/list.yml b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/list.yml
new file mode 100644
index 00000000..1deded88
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/list.yml
@@ -0,0 +1,23 @@
+sisu:
+ site:
+ - sisu
+open_society:
+ site:
+ - twon
+ - fc
+ - faif
+# - ffa
+ - catb
+sisu_icon:
+ site:
+ - sisu_icon
+fsf:
+ site:
+ - fsf
+gpl:
+ site:
+ - gpl
+sample_search:
+ search:
+ - sample
+
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/promo.yml b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/promo.yml
new file mode 100644
index 00000000..88497d41
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/promo.yml
@@ -0,0 +1,142 @@
+# Author: Ralph@Amissah.com
+site:
+ sisu_icon:
+ url: SiSU
+ image: sisu.png
+ blurb: ~
+ sisu:
+ title: SiSU
+ url: index.html
+ blurb: ~
+ links:
+ -
+ title: What does SiSU do? Summary
+ url: SiSU/1.html#summary
+ -
+ title: SiSU Book Samples and Markup Examples
+ url: SiSU/2.html
+ -
+ title: SiSU Download
+ url: SiSU/download.html
+ -
+ title: SiSU Changelog
+ url: SiSU/changelog.html
+ blurb: ~
+ -
+ title: Wikipedia entry
+ url: http://en.wikipedia.org/wiki/SiSU
+ blurb: ~
+ -
+ title: Freshmeat
+ url: http://freshmeat.net/projects/sisu/
+ -
+ title: Ruby Application Archive
+ url: http://raa.ruby-lang.org/project/sisu/
+ twon:
+ title: The Wealth of Networks
+ subtitle: How Social Production Transforms Markets and Freedom
+ author: Yochai Benkler
+ year: 2006
+ url: the_wealth_of_networks.yochai_benkler
+ links:
+ -
+ title: Wikipedia entry
+ url: http://en.wikipedia.org/wiki/The_Wealth_of_Networks
+ -
+ title: Source Wiki
+ url: http://www.benkler.org/wealth_of_networks/index.php/Main_Page
+ fc:
+ title: Free Culture
+ subtitle: How Big Media Uses Technology and the Law to Lock Down Culture and Control Creativity
+ author: Lawrence Lessig
+ year: 2004
+ url: free_culture.lawrence_lessig
+ links:
+ -
+ title: Wikipedia entry
+ url: http://en.wikipedia.org/wiki/Free_Culture_%28book%29
+ -
+ title: Creative Commons
+ url: http://creativecommons.org/
+ -
+ title: Source
+ url: http://www.free-culture.cc/
+ faif:
+ title: Free As In Freedom
+ subtitle: Richard Stallman's Crusade for Free Software
+ author: Sam Williams
+ year: 2002
+ url: free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams
+ links:
+ -
+ title: Wikipedia entry
+ url: http://en.wikipedia.org/wiki/Free_as_in_Freedom:_Richard_Stallman%27s_Crusade_for_Free_Software
+ -
+ title: Source
+ url: http://faifzilla.org/
+ -
+ title: FSF
+ url: http://www.fsf.org/
+ -
+ title: FSF Wikipedia
+ url: http://en.wikipedia.org/wiki/Free_Software_Foundation
+ -
+ title: GPL
+ url: http://www.gnu.org/copyleft/gpl.html
+ -
+ title: GPL Wikipedia
+ url: http://en.wikipedia.org/wiki/GNU_General_Public_License
+ ffa:
+ title: Free For All
+ subtitle: How Linux and the Free Software Movement Undercut the High Tech Titans
+ author: Peter Wayner
+ year: 2002
+ url: free_for_all.peter_wayner
+ links:
+ -
+ title: Source
+ url: http://www.wayner.org/books/ffa/
+ catb:
+ title: The Cathedral & the Bazaar
+ subtitle: Musings on Linux and Open Source by an Accidental Revolutionary
+ author: Erik S. Raymond
+ year: 1999
+ url: the_cathedral_and_the_bazaar.eric_s_raymond
+ links:
+ -
+ title: Wikipedia entry
+ url: http://en.wikipedia.org/wiki/Cathedral_and_the_bazaar
+ -
+ title: Source
+ url: http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/
+ fsf:
+ title: Free Software Foundation
+ subtitle: FSF
+ url: http://www.fsf.org/
+ links:
+ -
+ title: Wikipedia entry
+ url: http://en.wikipedia.org/wiki/Free_Software_Foundation
+ -
+ title: GPL
+ subtitle: GNU General Public License
+ url: http://www.gnu.org/copyleft/gpl.html
+ gpl:
+ title: GNU General Public License
+ subtitle: GPL
+ url: http://www.gnu.org/copyleft/gpl.html
+ links:
+ -
+ title: Wikipedia entry
+ url: http://en.wikipedia.org/wiki/GNU_General_Public_License
+ -
+ title: GPL 3
+ url: http://gplv3.fsf.org/
+ -
+ title: Software License List
+ url: http://www.fsf.org/licensing/licenses/
+search:
+ sample:
+ action: http://search.sisudoc.org
+ target: _top
+ db: sisu
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml
new file mode 100644
index 00000000..a68903e1
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml
@@ -0,0 +1,482 @@
+# arch-tag: yaml country list
+# Author: Ralph@Amissah.com
+# License: Same as SiSU see http://www.jus.uio.no/sisu
+id: AF
+ name: Afghanistan
+id: AL
+ name: Albania
+id: DZ
+ name: Algeria
+id: AS
+ name: American Samoa
+id: AD
+ name: Andorra
+id: AO
+ name: Angola
+id: AI
+ name: Anguilla
+id: AQ
+ name: Antarctica
+id: AG
+ name: Antigua and Barbuda
+id: AR
+ name: Argentina
+id: AM
+ name: Armenia
+id: AW
+ name: Aruba
+id: AU
+ name: Australia
+id: AT
+ name: Austria
+id: AZ
+ name: Azerbaijan
+id: BS
+ name: Bahamas
+id: BH
+ name: Bahrain
+id: BD
+ name: Bangladesh
+id: BB
+ name: Barbados
+id: BY
+ name: Belarus
+id: BE
+ name: Belgium
+id: BZ
+ name: Belize
+id: BJ
+ name: Benin
+id: BM
+ name: Bermuda
+id: BT
+ name: Bhutan
+id: BO
+ name: Bolivia
+id: BA
+ name: Bosnia and Herzegovina
+id: BW
+ name: Botswana
+id: BV
+ name: Bouvet Island
+id: BR
+ name: Brazil
+id: IO
+ name: British Indian Ocean Territory
+id: BN
+ name: Brunei Darussalam
+id: BG
+ name: Bulgaria
+id: BF
+ name: Burkina Faso
+id: BI
+ name: Burundi
+id: KH
+ name: Cambodia
+id: CM
+ name: Cameroon
+id: CA
+ name: Canada
+id: CV
+ name: Cape Verde
+id: KY
+ name: Cayman Islands
+id: CF
+ name: Central African Republic
+id: TD
+ name: Chad
+id: CL
+ name: Chile
+id: CN
+ name: China
+id: CX
+ name: Christmas Island
+id: CC
+ name: Cocos (Keeling) Islands
+id: CO
+ name: Colombia
+id: KM
+ name: Comoros
+id: CG
+ name: Congo
+id: CK
+ name: Cook Islands
+id: CR
+ name: Costa Rica
+id: HR
+ name: Croatia (Hrvatska)
+id: CU
+ name: Cuba
+id: CY
+ name: Cyprus
+id: CZ
+ name: Czech Republic
+id: CS
+ name: Czechoslovakia
+id: DK
+ name: Denmark
+id: DJ
+ name: Djibouti
+id: DM
+ name: Dominica
+id: DO
+ name: Dominican Republic
+id: TP
+ name: East Timor
+id: EC
+ name: Ecuador
+id: EG
+ name: Egypt
+id: SV
+ name: El Salvador
+id: GQ
+ name: Equatorial Guinea
+id: ER
+ name: Eritrea
+id: EE
+ name: Estonia
+id: ET
+ name: Ethiopia
+id: FK
+ name: Falkland Islands (Malvinas)
+id: FO
+ name: Faroe Islands
+id: FJ
+ name: Fiji
+id: FI
+ name: Finland
+id: FR
+ name: France
+id: FX
+ name: France, Metroplitan
+id: GF
+ name: French Guiana
+id: PF
+ name: French Polynesia
+id: TF
+ name: French Southern Territories
+id: GA
+ name: Gabon
+id: GM
+ name: Gambia
+id: GE
+ name: Georgia
+id: DE
+ name: Germany
+id: GH
+ name: Ghana
+id: GI
+ name: Gibraltar
+id: GB
+ name: Great Britain (UK)
+id: GR
+ name: Greece
+id: GL
+ name: Greenland
+id: GD
+ name: Grenada
+id: GP
+ name: Guadeloupe
+id: GU
+ name: Guam
+id: GT
+ name: Guatemala
+id: GN
+ name: Guinea
+id: GW
+ name: Guinea-Bissau
+id: GY
+ name: Guyana
+id: HT
+ name: Haiti
+id: HM
+ name: Heard and McDonald Islands
+id: HN
+ name: Honduras
+id: HK
+ name: Hong Kong
+id: HU
+ name: Hungary
+id: IS
+ name: Iceland
+id: IN
+ name: India
+id: ID
+ name: Indonesia
+id: IR
+ name: Iran
+id: IQ
+ name: Iraq
+id: IE
+ name: Ireland
+id: IL
+ name: Israel
+id: IT
+ name: Italy
+id: CI
+ name: Ivory Coast
+id: JM
+ name: Jamaica
+id: JP
+ name: Japan
+id: JO
+ name: Jordan
+id: KZ
+ name: Kazakhstan
+id: KE
+ name: Kenya
+id: KI
+ name: Kiribati
+id: KP
+ name: Korea (North)
+id: KR
+ name: Korea (South)
+id: KW
+ name: Kuwait
+id: KG
+ name: Kyrgyzstan
+id: LA
+ name: Laos
+id: LV
+ name: Latvia
+id: LB
+ name: Lebanon
+id: LS
+ name: Lesotho
+id: LR
+ name: Liberia
+id: LY
+ name: Libya
+id: LI
+ name: Liechtenstein
+id: LT
+ name: Lithuania
+id: LU
+ name: Luxembourg
+id: MO
+ name: Macau
+id: ME
+ name: Macedonia
+id: MG
+ name: Madagascar
+id: MW
+ name: Malawi
+id: MY
+ name: Malaysia
+id: MV
+ name: Maldives
+id: ML
+ name: Mali
+id: MT
+ name: Malta
+id: MB
+ name: Marshall Islands
+id: MQ
+ name: Martinique
+id: MR
+ name: Mauritania
+id: MU
+ name: Mauritius
+id: YT
+ name: Mayotte
+id: MX
+ name: Mexico
+id: FM
+ name: Micronesia
+id: MD
+ name: Moldova
+id: MC
+ name: Monaco
+id: MN
+ name: Mongolia
+id: MS
+ name: Montserrat
+id: MA
+ name: Morocco
+id: MZ
+ name: Mozambique
+id: MM
+ name: Myanmar
+id: NA
+ name: Namibia
+id: NR
+ name: Nauru
+id: NP
+ name: Nepal
+id: NL
+ name: Netherlands
+id: AN
+ name: Netherlands Antilles
+id: NT
+ name: Neutral Zone
+id: NC
+ name: New Caledonia
+id: NZ
+ name: New Zealand (Aotearoa)
+id: NI
+ name: Nicaragua
+id: NE
+ name: Niger
+id: NG
+ name: Nigeria
+id: NU
+ name: Niue
+id: NF
+ name: Norfolk Island
+id: MP
+ name: Northern Mariana Islands
+id: NO
+ name: Norway
+id: OM
+ name: Oman
+id: 00
+ name: Other
+id: PK
+ name: Pakistan
+id: PW
+ name: Palau
+id: PA
+ name: Panama
+id: PG
+ name: Papua New Guinea
+id: PY
+ name: Paraguay
+id: PE
+ name: Peru
+id: PH
+ name: Philippines
+id: PN
+ name: Pitcairn
+id: PL
+ name: Poland
+id: PT
+ name: Portugal
+id: PR
+ name: Puerto Rico
+id: QA
+ name: Qatar
+id: RE
+ name: Reunion
+id: RO
+ name: Romania
+id: RU
+ name: Russian Federation
+id: RW
+ name: Rwanda
+id: GS
+ name: S. Georgia and S. Sandwich Isls.
+id: KN
+ name: Saint Kitts and Nevis
+id: LC
+ name: Saint Lucia
+id: VC
+ name: Saint Vincent and the Grenadines
+id: WS
+ name: Samoa
+id: SM
+ name: San Marino
+id: ST
+ name: Sao Tome and Principe
+id: SA
+ name: Saudi Arabia
+id: SN
+ name: Senegal
+id: SC
+ name: Seychelles
+id: SL
+ name: Sierra Leone
+id: SG
+ name: Singapore
+id: SK
+ name: Slovak Republic
+id: SI
+ name: Slovenia
+id: SB
+ name: Solomon Islands
+id: SO
+ name: Somalia
+id: ZA
+ name: South Africa
+id: ES
+ name: Spain
+id: LK
+ name: Sri Lanka
+id: SH
+ name: St. Helena
+id: PM
+ name: St. Pierre and Miquelon
+id: SD
+ name: Sudan
+id: SR
+ name: Suriname
+id: SJ
+ name: Svalbard and Jan Mayen Islands
+id: SZ
+ name: Swaziland
+id: SE
+ name: Sweden
+id: CH
+ name: Switzerland
+id: SY
+ name: Syria
+id: TW
+ name: Taiwan
+id: TJ
+ name: Tajikistan
+id: TZ
+ name: Tanzania
+id: TH
+ name: Thailand
+id: TG
+ name: Togo
+id: TK
+ name: Tokelau
+id: TO
+ name: Tonga
+id: TT
+ name: Trinidad and Tobago
+id: TN
+ name: Tunisia
+id: TR
+ name: Turkey
+id: TM
+ name: Turkmenistan
+id: TC
+ name: Turks and Caicos Islands
+id: TV
+ name: Tuvalu
+id: UM
+ name: US Minor Outlying Islands
+id: SU
+ name: USSR (former)
+id: UG
+ name: Uganda
+id: UA
+ name: Ukraine
+id: AE
+ name: United Arab Emirates
+id: UK
+ name: United Kingdom
+id: US
+ name: United States
+id: UY
+ name: Uruguay
+id: UZ
+ name: Uzbekistan
+id: VU
+ name: Vanuatu
+id: VA
+ name: Vatican City State (Holy See)
+id: VE
+ name: Venezuela
+id: VN
+ name: Viet Nam
+id: VG
+ name: Virgin Islands (British)
+id: VI
+ name: Virgin Islands (U.S.)
+id: WF
+ name: Wallis and Futuna Islands
+id: EH
+ name: Western Sahara
+
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml
new file mode 100644
index 00000000..ebaf8ace
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml
@@ -0,0 +1,735 @@
+# arch-tag: yaml country list array
+# Author: Ralph@Amissah.com
+# License: Same as SiSU see http://www.jus.uio.no/sisu
+-
+ - AF
+ - Afghanistan
+-
+ - AL
+ - Albania
+-
+ - DZ
+ - Algeria
+-
+ - AS
+ - American Samoa
+-
+ - AD
+ - Andorra
+-
+ - AO
+ - Angola
+-
+ - AI
+ - Anguilla
+-
+ - AQ
+ - Antarctica
+-
+ - AG
+ - Antigua and Barbuda
+-
+ - AR
+ - Argentina
+-
+ - AM
+ - Armenia
+-
+ - AW
+ - Aruba
+-
+ - AU
+ - Australia
+-
+ - AT
+ - Austria
+-
+ - AZ
+ - Azerbaijan
+-
+ - BS
+ - Bahamas
+-
+ - BH
+ - Bahrain
+-
+ - BD
+ - Bangladesh
+-
+ - BB
+ - Barbados
+-
+ - BY
+ - Belarus
+-
+ - BE
+ - Belgium
+-
+ - BZ
+ - Belize
+-
+ - BJ
+ - Benin
+-
+ - BM
+ - Bermuda
+-
+ - BT
+ - Bhutan
+-
+ - BO
+ - Bolivia
+-
+ - BA
+ - Bosnia and Herzegovina
+-
+ - BW
+ - Botswana
+-
+ - BV
+ - Bouvet Island
+-
+ - BR
+ - Brazil
+-
+ - IO
+ - British Indian Ocean Territory
+-
+ - BN
+ - Brunei Darussalam
+-
+ - BG
+ - Bulgaria
+-
+ - BF
+ - Burkina Faso
+-
+ - BI
+ - Burundi
+-
+ - KH
+ - Cambodia
+-
+ - CM
+ - Cameroon
+-
+ - CA
+ - Canada
+-
+ - CV
+ - Cape Verde
+-
+ - KY
+ - Cayman Islands
+-
+ - CF
+ - Central African Republic
+-
+ - TD
+ - Chad
+-
+ - CL
+ - Chile
+-
+ - CN
+ - China
+-
+ - CX
+ - Christmas Island
+-
+ - CC
+ - Cocos (Keeling) Islands
+-
+ - CO
+ - Colombia
+-
+ - KM
+ - Comoros
+-
+ - CG
+ - Congo
+-
+ - CK
+ - Cook Islands
+-
+ - CR
+ - Costa Rica
+-
+ - HR
+ - Croatia (Hrvatska)
+-
+ - CU
+ - Cuba
+-
+ - CY
+ - Cyprus
+-
+ - CZ
+ - Czech Republic
+-
+ - CS
+ - Czechoslovakia (former)
+-
+ - DK
+ - Denmark
+-
+ - DJ
+ - Djibouti
+-
+ - DM
+ - Dominica
+-
+ - DO
+ - Dominican Republic
+-
+ - TP
+ - East Timor
+-
+ - EC
+ - Ecuador
+-
+ - EG
+ - Egypt
+-
+ - SV
+ - El Salvador
+-
+ - GQ
+ - Equatorial Guinea
+-
+ - ER
+ - Eritrea
+-
+ - EE
+ - Estonia
+-
+ - ET
+ - Ethiopia
+-
+ - FK
+ - Falkland Islands (Malvinas)
+-
+ - FO
+ - Faroe Islands
+-
+ - FJ
+ - Fiji
+-
+ - FI
+ - Finland
+-
+ - FR
+ - France
+-
+ - FX
+ - France, Metropolitan
+-
+ - GF
+ - French Guiana
+-
+ - PF
+ - French Polynesia
+-
+ - TF
+ - French Southern Territories
+-
+ - GA
+ - Gabon
+-
+ - GM
+ - Gambia
+-
+ - GE
+ - Georgia
+-
+ - DE
+ - Germany
+-
+ - GH
+ - Ghana
+-
+ - GI
+ - Gibraltar
+-
+ - GB
+ - Great Britain (UK)
+-
+ - GR
+ - Greece
+-
+ - GL
+ - Greenland
+-
+ - GD
+ - Grenada
+-
+ - GP
+ - Guadeloupe
+-
+ - GU
+ - Guam
+-
+ - GT
+ - Guatemala
+-
+ - GN
+ - Guinea
+-
+ - GW
+ - Guinea-Bissau
+-
+ - GY
+ - Guyana
+-
+ - HT
+ - Haiti
+-
+ - HM
+ - Heard and McDonald Islands
+-
+ - HN
+ - Honduras
+-
+ - HK
+ - Hong Kong
+-
+ - HU
+ - Hungary
+-
+ - IS
+ - Iceland
+-
+ - IN
+ - India
+-
+ - ID
+ - Indonesia
+-
+ - IR
+ - Iran
+-
+ - IQ
+ - Iraq
+-
+ - IE
+ - Ireland
+-
+ - IL
+ - Israel
+-
+ - IT
+ - Italy
+-
+ - CI
+ - Ivory Coast
+-
+ - JM
+ - Jamaica
+-
+ - JP
+ - Japan
+-
+ - JO
+ - Jordan
+-
+ - KZ
+ - Kazakhstan
+-
+ - KE
+ - Kenya
+-
+ - KI
+ - Kiribati
+-
+ - KP
+ - Korea (North)
+-
+ - KR
+ - Korea (South)
+-
+ - KW
+ - Kuwait
+-
+ - KG
+ - Kyrgyzstan
+-
+ - LA
+ - Laos
+-
+ - LV
+ - Latvia
+-
+ - LB
+ - Lebanon
+-
+ - LS
+ - Lesotho
+-
+ - LR
+ - Liberia
+-
+ - LY
+ - Libya
+-
+ - LI
+ - Liechtenstein
+-
+ - LT
+ - Lithuania
+-
+ - LU
+ - Luxembourg
+-
+ - MO
+ - Macau
+-
+ - ME
+ - Macedonia
+-
+ - MG
+ - Madagascar
+-
+ - MW
+ - Malawi
+-
+ - MY
+ - Malaysia
+-
+ - MV
+ - Maldives
+-
+ - ML
+ - Mali
+-
+ - MT
+ - Malta
+-
+ - MB
+ - Marshall Islands
+-
+ - MQ
+ - Martinique
+-
+ - MR
+ - Mauritania
+-
+ - MU
+ - Mauritius
+-
+ - YT
+ - Mayotte
+-
+ - MX
+ - Mexico
+-
+ - FM
+ - Micronesia
+-
+ - MD
+ - Moldova
+-
+ - MC
+ - Monaco
+-
+ - MN
+ - Mongolia
+-
+ - MS
+ - Montserrat
+-
+ - MA
+ - Morocco
+-
+ - MZ
+ - Mozambique
+-
+ - MM
+ - Myanmar
+-
+ - NA
+ - Namibia
+-
+ - NR
+ - Nauru
+-
+ - NP
+ - Nepal
+-
+ - NL
+ - Netherlands
+-
+ - AN
+ - Netherlands Antilles
+-
+ - NT
+ - Neutral Zone
+-
+ - NC
+ - New Caledonia
+-
+ - NZ
+ - New Zealand (Aotearoa)
+-
+ - NI
+ - Nicaragua
+-
+ - NE
+ - Niger
+-
+ - NG
+ - Nigeria
+-
+ - NU
+ - Niue
+-
+ - NF
+ - Norfolk Island
+-
+ - MP
+ - Northern Mariana Islands
+-
+ - 'NO'
+ - Norway
+-
+ - OM
+ - Oman
+-
+ - '00'
+ - Other
+-
+ - PK
+ - Pakistan
+-
+ - PW
+ - Palau
+-
+ - PA
+ - Panama
+-
+ - PG
+ - Papua New Guinea
+-
+ - PY
+ - Paraguay
+-
+ - PE
+ - Peru
+-
+ - PH
+ - Philippines
+-
+ - PN
+ - Pitcairn
+-
+ - PL
+ - Poland
+-
+ - PT
+ - Portugal
+-
+ - PR
+ - Puerto Rico
+-
+ - QA
+ - Qatar
+-
+ - RE
+ - Reunion
+-
+ - RO
+ - Romania
+-
+ - RU
+ - Russian Federation
+-
+ - RW
+ - Rwanda
+-
+ - GS
+ - S. Georgia and S. Sandwich Isls.
+-
+ - KN
+ - Saint Kitts and Nevis
+-
+ - LC
+ - Saint Lucia
+-
+ - VC
+ - Saint Vincent and the Grenadines
+-
+ - WS
+ - Samoa
+-
+ - SM
+ - San Marino
+-
+ - ST
+ - Sao Tome and Principe
+-
+ - SA
+ - Saudi Arabia
+-
+ - SN
+ - Senegal
+-
+ - SC
+ - Seychelles
+-
+ - SL
+ - Sierra Leone
+-
+ - SG
+ - Singapore
+-
+ - SK
+ - Slovak Republic
+-
+ - SI
+ - Slovenia
+-
+ - SB
+ - Solomon Islands
+-
+ - SO
+ - Somalia
+-
+ - ZA
+ - South Africa
+-
+ - ES
+ - Spain
+-
+ - LK
+ - Sri Lanka
+-
+ - SH
+ - St. Helena
+-
+ - PM
+ - St. Pierre and Miquelon
+-
+ - SD
+ - Sudan
+-
+ - SR
+ - Suriname
+-
+ - SJ
+ - Svalbard and Jan Mayen Islands
+-
+ - SZ
+ - Swaziland
+-
+ - SE
+ - Sweden
+-
+ - CH
+ - Switzerland
+-
+ - SY
+ - Syria
+-
+ - TW
+ - Taiwan
+-
+ - TJ
+ - Tajikistan
+-
+ - TZ
+ - Tanzania
+-
+ - TH
+ - Thailand
+-
+ - TG
+ - Togo
+-
+ - TK
+ - Tokelau
+-
+ - TO
+ - Tonga
+-
+ - TT
+ - Trinidad and Tobago
+-
+ - TN
+ - Tunisia
+-
+ - TR
+ - Turkey
+-
+ - TM
+ - Turkmenistan
+-
+ - TC
+ - Turks and Caicos Islands
+-
+ - TV
+ - Tuvalu
+-
+ - UM
+ - US Minor Outlying Islands
+-
+ - SU
+ - USSR (former)
+-
+ - UG
+ - Uganda
+-
+ - UA
+ - Ukraine
+-
+ - AE
+ - United Arab Emirates
+-
+ - UK
+ - United Kingdom
+-
+ - US
+ - United States
+-
+ - UY
+ - Uruguay
+-
+ - UZ
+ - Uzbekistan
+-
+ - VU
+ - Vanuatu
+-
+ - VA
+ - Vatican City State (Holy See)
+-
+ - VE
+ - Venezuela
+-
+ - VN
+ - Viet Nam
+-
+ - VG
+ - Virgin Islands (British)
+-
+ - VI
+ - Virgin Islands (U.S.)
+-
+ - WF
+ - Wallis and Futuna Islands
+-
+ - EH
+ - Western Sahara
+-
+ - YE
+ - Yemen
+-
+ - YU
+ - Yugoslavia
+-
+ - ZR
+ - Zaire
+-
+ - ZM
+ - Zambia
+-
+ - ZW
+ - Zimbabwe
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams.sst b/data/doc/sisu/sisu_markup_samples/dfsg/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams.sst
new file mode 100644
index 00000000..23cad62a
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams.sst
@@ -0,0 +1,2074 @@
+% SiSU 0.38
+
+@title: Free as in Freedom
+
+@subtitle: Richard Stallman's Crusade for Free Software
+
+@author: Sam Williams
+
+@rights: Copyright Sam Williams 2002, published under the GNU Free Documentation License. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Document License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being no invariant sections, with the Front-Cover Texts being no invariant sections, and with the Back-Cover Texts being no invariant sections. A copy of the license is included in Appendix C, GNU Free Documentation License. All images are to be included verbatim when the document is copied, distributed, or modified under the terms of the GFDL.
+
+@language: US
+
+@notes: March 2002
+
+% @catalogue: isbn=0596002874
+
+@links: { Home and Source }http://faifzilla.org/
+{Free as in Freedom (on Richard Stallman), Sam Williams @ SiSU}http://www.jus.uio.no/sisu/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams
+{@ Wikipedia}http://en.wikipedia.org/wiki/Free_as_in_Freedom:_Richard_Stallman%27s_Crusade_for_Free_Software
+{@ Amazon.com}http://www.amazon.com/gp/product/0596002874
+{@ Barnes & Noble}http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?isbn=0596002874
+{The Wealth of Networks, Yochai Benkler @ SiSU}http://www.jus.uio.no/sisu/the_wealth_of_networks.yochai_benkler
+{Free For All, Peter Wayner @ SiSU}http://www.jus.uio.no/sisu/free_for_all.peter_wayner
+{Free Culture, Lawrence Lessig @ SiSU}http://www.jus.uio.no/sisu/free_culture.lawrence_lessig
+{The Cathedral and the Bazaar, Eric S. Raymond @ SiSU }http://www.jus.uio.no/sisu/the_cathedral_and_the_bazaar.eric_s_raymond
+
+@skin: skin_rms
+
+@images: center
+
+@level: new=:A,:B,:C,1
+
+% @promo: sisu_icon, sample_search, fsf, open_society, sisu
+
+:A~ Free as in Freedom
+
+:B~ Richard Stallman's Crusade for Free Software
+
+:C~ By Sam Williams
+
+1~preface Preface
+
+The work of Richard M. Stallman literally speaks for itself. From the documented source code to the published papers to the recorded speeches, few people have expressed as much willingness to lay their thoughts and their work on the line.
+
+Such openness-if one can pardon a momentary un-Stallman adjective-is refreshing. After all, we live in a society that treats information, especially personal information, as a valuable commodity. The question quickly arises. Why would anybody want to part with so much information and yet appear to demand nothing in return?
+
+As we shall see in later chapters, Stallman does not part with his words or his work altruistically. Every program, speech, and on-the-record bon mot comes with a price, albeit not the kind of price most people are used to paying.
+
+I bring this up not as a warning, but as an admission. As a person who has spent the last year digging up facts on Stallman's personal history, it's more than a little intimidating going up against the Stallman oeuvre. "Never pick a fight with a man who buys his ink by the barrel," goes the old Mark Twain adage. In the case of Stallman, never attempt the definitive biography of a man who trusts his every thought to the public record.
+
+For the readers who have decided to trust a few hours of their time to exploring this book, I can confidently state that there are facts and quotes in here that one won't find in any Slashdot story or Google search. Gaining access to these facts involves paying a price, however. In the case of the book version, you can pay for these facts the traditional manner, i.e., by purchasing the book. In the case of the electronic versions, you can pay for these facts in the free software manner. Thanks to the folks at O'Reilly & Associates, this book is being distributed under the GNU Free Documentation License, meaning you can help to improve the work or create a personalized version and release that version under the same license.
+
+If you are reading an electronic version and prefer to accept the latter payment option, that is, if you want to improve or expand this book for future readers, I welcome your input. Starting in June, 2002, I will be publishing a bare bones HTML version of the book on the web site, http://www.faifzilla.org. My aim is to update it regularly and expand the Free as in Freedom story as events warrant. If you choose to take the latter course, please review Appendix C of this book. It provides a copy of your rights under the GNU Free Documentation License.
+
+For those who just plan to sit back and read, online or elsewhere, I consider your attention an equally valuable form of payment. Don't be surprised, though, if you, too, find yourself looking for other ways to reward the good will that made this work possible.
+
+One final note: this is a work of journalism, but it is also a work of technical documentation. In the process of writing and editing this book, the editors and I have weighed the comments and factual input of various participants in the story, including Richard Stallman himself. We realize there are many technical details in this story that may benefit from additional or refined information. As this book is released under the GFDL, we are accepting patches just like we would with any free software program. Accepted changes will be posted electronically and will eventually be incorporated into future printed versions of this work. If you would like to contribute to the further improvement of this book, you can reach me at sam@inow.com
+
+2~ Comments and Questions
+
+Please address comments and questions concerning this book to the publisher:
+
+poem{
+
+ O'Reilly & Associates, Inc.
+ 1005 Gravenstein Highway North
+ Sebastopol, CA 95472
+ (800) 998-9938 (in the United States or Canada)
+ (707) 829-0515 (international/local)
+ (707) 829-0104 (fax)
+
+}poem
+
+There is a web page for this book, which lists errata, examples, or any additional information. The site also includes a link to a forum where you can discuss the book with the author and other readers. You can access this site at:
+
+_1 http://www.oreilly.com/catalog/freedom/
+
+To comment or ask technical questions about this book, send email to:
+
+_1 bookquestions@oreilly.com
+
+For more information about books, conferences, Resource Centers, and the O'Reilly Network, see the O'Reilly web site at:
+
+_1 http://www.oreilly.com
+
+2~ Acknowledgments
+
+Special thanks to Henning Gutmann for sticking by this book. Special thanks to Aaron Oas for suggesting the idea to Tracy in the first place. Thanks to Laurie Petrycki, Jeffrey Holcomb, and all the others at O'Reilly & Associates. Thanks to Tim O'Reilly for backing this book. Thanks to all the first-draft reviewers: Bruce Perens, Eric Raymond, Eric Allman, Jon Orwant, Julie and Gerald Jay Sussman, Hal Abelson, and Guy Steele. I hope you enjoy this typo-free version. Thanks to Alice Lippman for the interviews, cookies, and photographs. Thanks to my family, Steve, Jane, Tish, and Dave. And finally, last but not least: thanks to Richard Stallman for having the guts and endurance to "show us the code."
+
+Sam Williams
+
+1~ Chapter 1 - For Want of a Printer
+
+I fear the Greeks. Even when they bring gifts.
+---Virgil
+The Aeneid
+
+The new printer was jammed, again.
+
+Richard M. Stallman, a staff software programmer at the Massachusetts Institute of Technology's Artificial Intelligence Laboratory (AI Lab), discovered the malfunction the hard way. An hour after sending off a 50-page file to the office laser printer, Stallman, 27, broke off a productive work session to retrieve his documents. Upon arrival, he found only four pages in the printer's tray. To make matters even more frustrating, the four pages belonged to another user, meaning that Stallman's print job and the unfinished portion of somebody else's print job were still trapped somewhere within the electrical plumbing of the lab's computer network.
+
+Waiting for machines is an occupational hazard when you're a software programmer, so Stallman took his frustration with a grain of salt. Still, the difference between waiting for a machine and waiting on a machine is a sizable one. It wasn't the first time he'd been forced to stand over the printer, watching pages print out one by one. As a person who spent the bulk of his days and nights improving the efficiency of machines and the software programs that controlled them, Stallman felt a natural urge to open up the machine, look at the guts, and seek out the root of the problem.
+
+Unfortunately, Stallman's skills as a computer programmer did not extend to the mechanical-engineering realm. As freshly printed documents poured out of the machine, Stallman had a chance to reflect on other ways to circumvent the printing jam problem.
+
+How long ago had it been that the staff members at the AI Lab had welcomed the new printer with open arms? Stallman wondered. The machine had been a donation from the Xerox Corporation. A cutting edge prototype, it was a modified version of the popular Xerox photocopier. Only instead of making copies, it relied on software data piped in over a computer network to turn that data into professional-looking documents. Created by engineers at the world-famous Xerox Palo Alto Research Facility, it was, quite simply, an early taste of the desktop-printing revolution that would seize the rest of the computing industry by the end of the decade.
+
+Driven by an instinctual urge to play with the best new equipment, programmers at the AI Lab promptly integrated the new machine into the lab's sophisticated computing infrastructure. The results had been immediately pleasing. Unlike the lab's old laser printer, the new Xerox machine was fast. Pages came flying out at a rate of one per second, turning a 20-minute print job into a 2-minute print job. The new machine was also more precise. Circles came out looking like circles, not ovals. Straight lines came out looking like straight lines, not low-amplitude sine waves.
+
+It was, for all intents and purposes, a gift too good to refuse.
+
+It wasn't until a few weeks after its arrival that the machine's flaws began to surface. Chief among the drawbacks was the machine's inherent susceptibility to paper jams. Engineering-minded programmers quickly understood the reason behind the flaw. As a photocopier, the machine generally required the direct oversight of a human operator. Figuring that these human operators would always be on hand to fix a paper jam, if it occurred, Xerox engineers had devoted their time and energies to eliminating other pesky problems. In engineering terms, user diligence was built into the system.
+
+In modifying the machine for printer use, Xerox engineers had changed the user-machine relationship in a subtle but profound way. Instead of making the machine subservient to an individual human operator, they made it subservient to an entire networked population of human operators. Instead of standing directly over the machine, a human user on one end of the network sent his print command through an extended bucket-brigade of machines, expecting the desired content to arrive at the targeted destination and in proper form. It wasn't until he finally went to check up on the final output that he realized how little of the desired content had made it through.
+
+Stallman himself had been of the first to identify the problem and the first to suggest a remedy. Years before, when the lab was still using its old printer, Stallman had solved a similar problem by opening up the software program that regulated the printer on the lab's PDP-11 machine. Stallman couldn't eliminate paper jams, but he could insert a software command that ordered the PDP-11 to check the printer periodically and report back to the PDP-10, the lab's central computer. To ensure that one user's negligence didn't bog down an entire line of print jobs, Stallman also inserted a software command that instructed the PDP-10 to notify every user with a waiting print job that the printer was jammed. The notice was simple, something along the lines of "The printer is jammed, please fix it," and because it went out to the people with the most pressing need to fix the problem, chances were higher that the problem got fixed in due time.
+
+As fixes go, Stallman's was oblique but elegant. It didn't fix the mechanical side of the problem, but it did the next best thing by closing the information loop between user and machine. Thanks to a few additional lines of software code, AI Lab employees could eliminate the 10 or 15 minutes wasted each week in running back and forth to check on the printer. In programming terms, Stallman's fix took advantage of the amplified intelligence of the overall network.
+
+"If you got that message, you couldn't assume somebody else would fix it," says Stallman, recalling the logic. "You had to go to the printer. A minute or two after the printer got in trouble, the two or three people who got messages arrive to fix the machine. Of those two or three people, one of them, at least, would usually know how to fix the problem."
+
+Such clever fixes were a trademark of the AI Lab and its indigenous population of programmers. Indeed, the best programmers at the AI Lab disdained the term programmer, preferring the more slangy occupational title of hacker instead. The job title covered a host of activities-everything from creative mirth making to the improvement of existing software and computer systems. Implicit within the title, however, was the old-fashioned notion of Yankee ingenuity. To be a hacker, one had to accept the philosophy that writing a software program was only the beginning. Improving a program was the true test of a hacker's skills.~{ For more on the term "hacker," see **Appendix B. }~
+
+Such a philosophy was a major reason why companies like Xerox made it a policy to donate their machines and software programs to places where hackers typically congregated. If hackers improved the software, companies could borrow back the improvements, incorporating them into update versions for the commercial marketplace. In corporate terms, hackers were a leveragable community asset, an auxiliary research-and-development division available at minimal cost.
+
+It was because of this give-and-take philosophy that when Stallman spotted the print-jam defect in the Xerox laser printer, he didn't panic. He simply looked for a way to update the old fix or " hack" for the new system. In the course of looking up the Xerox laser-printer software, however, Stallman made a troubling discovery. The printer didn't have any software, at least nothing Stallman or a fellow programmer could read. Until then, most companies had made it a form of courtesy to publish source-code files-readable text files that documented the individual software commands that told a machine what to do. Xerox, in this instance, had provided software files in precompiled, or binary, form. Programmers were free to open the files up if they wanted to, but unless they were an expert in deciphering an endless stream of ones and zeroes, the resulting text was pure gibberish.
+
+Although Stallman knew plenty about computers, he was not an expert in translating binary files. As a hacker, however, he had other resources at his disposal. The notion of information sharing was so central to the hacker culture that Stallman knew it was only a matter of time before some hacker in some university lab or corporate computer room proffered a version of the laser-printer source code with the desired source-code files.
+
+After the first few printer jams, Stallman comforted himself with the memory of a similar situation years before. The lab had needed a cross-network program to help the PDP-11 work more efficiently with the PDP-10. The lab's hackers were more than up to the task, but Stallman, a Harvard alumnus, recalled a similar program written by programmers at the Harvard computer-science department. The Harvard computer lab used the same model computer, the PDP-10, albeit with a different operating system. The Harvard computer lab also had a policy requiring that all programs installed on the PDP-10 had to come with published source-code files.
+
+Taking advantage of his access to the Harvard computer lab, Stallman dropped in, made a copy of the cross-network source code, and brought it back to the AI Lab. He then rewrote the source code to make it more suitable for the AI Lab's operating system. With no muss and little fuss, the AI Lab shored up a major gap in its software infrastructure. Stallman even added a few features not found in the original Harvard program, making the program even more useful. "We wound up using it for several years," Stallman says.
+
+From the perspective of a 1970s-era programmer, the transaction was the software equivalent of a neighbor stopping by to borrow a power tool or a cup of sugar from a neighbor. The only difference was that in borrowing a copy of the software for the AI Lab, Stallman had done nothing to deprive Harvard hackers the use of their original program. If anything, Harvard hackers gained in the process, because Stallman had introduced his own additional features to the program, features that hackers at Harvard were perfectly free to borrow in return. Although nobody at Harvard ever came over to borrow the program back, Stallman does recall a programmer at the private engineering firm, Bolt, Beranek & Newman, borrowing the program and adding a few additional features, which Stallman eventually reintegrated into the AI Lab's own source-code archive.
+
+"A program would develop the way a city develops," says Stallman, recalling the software infrastructure of the AI Lab. "Parts would get replaced and rebuilt. New things would get added on. But you could always look at a certain part and say, `Hmm, by the style, I see this part was written back in the early 60s and this part was written in the mid-1970s.'"
+
+Through this simple system of intellectual accretion, hackers at the AI Lab and other places built up robust creations. On the west coast, computer scientists at UC Berkeley, working in cooperation with a few low-level engineers at AT&T, had built up an entire operating system using this system. Dubbed Unix, a play on an older, more academically respectable operating system called Multics, the software system was available to any programmer willing to pay for the cost of copying the program onto a new magnetic tape and shipping it. Not every programmer participating in this culture described himself as a hacker, but most shared the sentiments of Richard M. Stallman. If a program or software fix was good enough to solve your problems, it was good enough to solve somebody else's problems. Why not share it out of a simple desire for good karma?
+
+The fact that Xerox had been unwilling to share its source-code files seemed a minor annoyance at first. In tracking down a copy of the source-code files, Stallman says he didn't even bother contacting Xerox. "They had already given us the laser printer," Stallman says. "Why should I bug them for more?"
+
+When the desired files failed to surface, however, Stallman began to grow suspicious. The year before, Stallman had experienced a blow up with a doctoral student at Carnegie Mellon University. The student, Brian Reid, was the author of a useful text-formatting program dubbed Scribe. One of the first programs that gave a user the power to define fonts and type styles when sending a document over a computer network, the program was an early harbinger of HTML, the lingua franca of the World Wide Web. In 1979, Reid made the decision to sell Scribe to a Pittsburgh-area software company called Unilogic. His graduate-student career ending, Reid says he simply was looking for a way to unload the program on a set of developers that would take pains to keep it from slipping into the public domain. To sweeten the deal, Reid also agreed to insert a set of time-dependent functions- "time bombs" in software-programmer parlance-that deactivated freely copied versions of the program after a 90-day expiration date. To avoid deactivation, users paid the software company, which then issued a code that defused the internal time-bomb feature.
+
+For Reid, the deal was a win-win. Scribe didn't fall into the public domain, and Unilogic recouped on its investment. For Stallman, it was a betrayal of the programmer ethos, pure and simple. Instead of honoring the notion of share-and-share alike, Reid had inserted a way for companies to compel programmers to pay for information access.
+
+As the weeks passed and his attempts to track down Xerox laser-printer source code hit a brick wall, Stallman began to sense a similar money-for-code scenario at work. Before Stallman could do or say anything about it, however, good news finally trickled in via the programmer grapevine. Word had it that a scientist at the computer-science department at Carnegie Mellon University had just departed a job at the Xerox Palo Alto Research Center. Not only had the scientist worked on the laser printer in question, but according to rumor, he was still working on it as part of his research duties at Carnegie Mellon.
+
+Casting aside his initial suspicion, Stallman made a firm resolution to seek out the person in question during his next visit to the Carnegie Mellon campus.
+
+He didn't have to wait long. Carnegie Mellon also had a lab specializing in artificial-intelligence research, and within a few months, Stallman had a business-related reason to visit the Carnegie Mellon campus. During that visit, he made sure to stop by the computer-science department. Department employees directed him to the office of the faculty member leading the Xerox project. When Stallman reached the office, he found the professor working there.
+
+In true engineer-to-engineer fashion, the conversation was cordial but blunt. After briefly introducing himself as a visitor from MIT, Stallman requested a copy of the laser-printer source code so that he could port it to the PDP-11. To his surprise, the professor refused to grant his request.
+
+"He told me that he had promised not to give me a copy," Stallman says.
+
+Memory is a funny thing. Twenty years after the fact, Stallman's mental history tape is notoriously blank in places. Not only does he not remember the motivating reason for the trip or even the time of year during which he took it, he also has no recollection of the professor or doctoral student on the other end of the conversation. According to Reid, the person most likely to have fielded Stallman's request is Robert Sproull, a former Xerox PARC researcher and current director of Sun Laboratories, a research division of the computer-technology conglomerate Sun Microsystems. During the 1970s, Sproull had been the primary developer of the laser-printer software in question while at Xerox PARC. Around 1980, Sproull took a faculty research position at Carnegie Mellon where he continued his laser-printer work amid other projects.
+
+"The code that Stallman was asking for was leading-edge state-of-the-art code that Sproull had written in the year or so before going to Carnegie Mellon," recalls Reid. "I suspect that Sproull had been at Carnegie Mellon less than a month before this request came in."
+
+When asked directly about the request, however, Sproull draws a blank. "I can't make a factual comment," writes Sproull via email. "I have absolutely no recollection of the incident."
+
+With both participants in the brief conversation struggling to recall key details-including whether the conversation even took place-it's hard to gauge the bluntness of Sproull's refusal, at least as recalled by Stallman. In talking to audiences, Stallman has made repeated reference to the incident, noting that Sproull's unwillingness to hand over the source code stemmed from a nondisclosure agreement, a contractual agreement between Sproull and the Xerox Corporation giving Sproull, or any other signatory, access the software source code in exchange for a promise of secrecy. Now a standard item of business in the software industry, the nondisclosure agreement, or NDA, was a novel development at the time, a reflection of both the commercial value of the laser printer to Xerox and the information needed to run it. "Xerox was at the time trying to make a commercial product out of the laser printer," recalls Reid. "They would have been insane to give away the source code."
+
+For Stallman, however, the NDA was something else entirely. It was a refusal on the part of Xerox and Sproull, or whomever the person was that turned down his source-code request that day, to participate in a system that, until then, had encouraged software programmers to regard programs as communal resources. Like a peasant whose centuries-old irrigation ditch had grown suddenly dry, Stallman had followed the ditch to its source only to find a brand-spanking-new hydroelectric dam bearing the Xerox logo.
+
+For Stallman, the realization that Xerox had compelled a fellow programmer to participate in this newfangled system of compelled secrecy took a while to sink in. At first, all he could focus on was the personal nature of the refusal. As a person who felt awkward and out of sync in most face-to-face encounters, Stallman's attempt to drop in on a fellow programmer unannounced had been intended as a demonstration of neighborliness. Now that the request had been refused, it felt like a major blunder. "I was so angry I couldn't think of a way to express it. So I just turned away and walked out without another word," Stallman recalls. "I might have slammed the door. Who knows? All I remember is wanting to get out of there."
+
+Twenty years after the fact, the anger still lingers, so much so that Stallman has elevated the event into a major turning point. Within the next few months, a series of events would befall both Stallman and the AI Lab hacker community that would make 30 seconds worth of tension in a remote Carnegie Mellon office seem trivial by comparison. Nevertheless, when it comes time to sort out the events that would transform Stallman from a lone hacker, instinctively suspicious of centralized authority, to a crusading activist applying traditional notions of liberty, equality, and fraternity to the world of software development, Stallman singles out the Carnegie Mellon encounter for special attention.
+
+"It encouraged me to think about something that I'd already been thinking about," says Stallman. "I already had an idea that software should be shared, but I wasn't sure how to think about that. My thoughts weren't clear and organized to the point where I could express them in a concise fashion to the rest of the world."
+
+Although previous events had raised Stallman's ire, he says it wasn't until his Carnegie Mellon encounter that he realized the events were beginning to intrude on a culture he had long considered sacrosanct. As an elite programmer at one of the world's elite institutions, Stallman had been perfectly willing to ignore the compromises and bargains of his fellow programmers just so long as they didn't interfere with his own work. Until the arrival of the Xerox laser printer, Stallman had been content to look down on the machines and programs other computer users grimly tolerated. On the rare occasion that such a program breached the AI Lab's walls-when the lab replaced its venerable Incompatible Time Sharing operating system with a commercial variant, the TOPS 20, for example-Stallman and his hacker colleagues had been free to rewrite, reshape, and rename the software according to personal taste.
+
+Now that the laser printer had insinuated itself within the AI Lab's network, however, something had changed. The machine worked fine, barring the occasional paper jam, but the ability to modify according to personal taste had disappeared. From the viewpoint of the entire software industry, the printer was a wake-up call. Software had become such a valuable asset that companies no longer felt the need to publicize source code, especially when publication meant giving potential competitors a chance to duplicate something cheaply. From Stallman's viewpoint, the printer was a Trojan Horse. After a decade of failure, privately owned software-future hackers would use the term " proprietary" software-had gained a foothold inside the AI Lab through the sneakiest of methods. It had come disguised as a gift.
+
+That Xerox had offered some programmers access to additional gifts in exchange for secrecy was also galling, but Stallman takes pains to note that, if presented with such a quid pro quo bargain at a younger age, he just might have taken the Xerox Corporation up on its offer. The awkwardness of the Carnegie Mellon encounter, however, had a firming effect on Stallman's own moral lassitude. Not only did it give him the necessary anger to view all future entreaties with suspicion, it also forced him to ask the uncomfortable question: what if a fellow hacker dropped into Stallman's office someday and it suddenly became Stallman's job to refuse the hacker's request for source code?
+
+"It was my first encounter with a nondisclosure agreement, and it immediately taught me that nondisclosure agreements have victims," says Stallman, firmly. "In this case I was the victim. [My lab and I] were victims."
+
+It was a lesson Stallman would carry with him through the tumultuous years of the 1980s, a decade during which many of his MIT colleagues would depart the AI Lab and sign nondisclosure agreements of their own. Because most nondisclosure aggreements (NDAs) had expiration dates, few hackers who did sign them saw little need for personal introspection. Sooner or later, they reasoned, the software would become public knowledge. In the meantime, promising to keep the software secret during its earliest development stages was all a part of the compromise deal that allowed hackers to work on the best projects. For Stallman, however, it was the first step down a slippery slope.
+
+"When somebody invited me to betray all my colleagues in that way, I remembered how angry I was when somebody else had done that to me and my whole lab," Stallman says. "So I said, `Thank you very much for offering me this nice software package, but I can't accept it on the conditions that you're asking for, so I'm going to do without it.'"
+
+As Stallman would quickly learn, refusing such requests involved more than personal sacrifice. It involved segregating himself from fellow hackers who, though sharing a similar distaste for secrecy, tended to express that distaste in a more morally flexible fashion. It wasn't long before Stallman, increasingly an outcast even within the AI Lab, began billing himself as "the last true hacker," isolating himself further and further from a marketplace dominated by proprietary software. Refusing another's request for source code, Stallman decided, was not only a betrayal of the scientific mission that had nurtured software development since the end of World War II, it was a violation of the Golden Rule, the baseline moral dictate to do unto others as you would have them do unto you.
+
+Hence the importance of the laser printer and the encounter that resulted from it. Without it, Stallman says, his life might have followed a more ordinary path, one balancing the riches of a commercial programmer with the ultimate frustration of a life spent writing invisible software code. There would have been no sense of clarity, no urgency to address a problem others weren't addressing. Most importantly, there would have been no righteous anger, an emotion that, as we soon shall see, has propelled Stallman's career as surely as any political ideology or ethical belief.
+
+"From that day forward, I decided this was something I could never participate in," says Stallman, alluding to the practice of trading personal liberty for the sake of convenience-Stallman's description of the NDA bargain-as well as the overall culture that encouraged such ethically suspect deal-making in the first place. "I decided never to make other people victims just like I had been a victim."
+
+1~ Chapter 2 - 2001: A Hacker's Odyssey
+
+The New York University computer-science department sits inside Warren Weaver Hall, a fortress-like building located two blocks east of Washington Square Park. Industrial-strength air-conditioning vents create a surrounding moat of hot air, discouraging loiterers and solicitors alike. Visitors who breach the moat encounter another formidable barrier, a security check-in counter immediately inside the building's single entryway.
+
+Beyond the security checkpoint, the atmosphere relaxes somewhat. Still, numerous signs scattered throughout the first floor preach the dangers of unsecured doors and propped-open fire exits. Taken as a whole, the signs offer a reminder: even in the relatively tranquil confines of pre-September 11, 2001, New York, one can never be too careful or too suspicious.
+
+The signs offer an interesting thematic counterpoint to the growing number of visitors gathering in the hall's interior atrium. A few look like NYU students. Most look like shaggy-aired concert-goers milling outside a music hall in anticipation of the main act. For one brief morning, the masses have taken over Warren Weaver Hall, leaving the nearby security attendant with nothing better to do but watch Ricki Lake on TV and shrug her shoulders toward the nearby auditorium whenever visitors ask about "the speech."
+
+Once inside the auditorium, a visitor finds the person who has forced this temporary shutdown of building security procedures. The person is Richard M. Stallman, founder of the GNU Project, original president of the Free Software Foundation, winner of the 1990 MacArthur Fellowship, winner of the Association of Computing Machinery's Grace Murray Hopper Award (also in 1990), corecipient of the Takeda Foundation's 2001 Takeda Award, and former AI Lab hacker. As announced over a host of hacker-related web sites, including the GNU Project's own http://www.gnu.org site, Stallman is in Manhattan, his former hometown, to deliver a much anticipated speech in rebuttal to the Microsoft Corporation's recent campaign against the GNU General Public License.
+
+The subject of Stallman's speech is the history and future of the free software movement. The location is significant. Less than a month before, Microsoft senior vice president Craig Mundie appeared at the nearby NYU Stern School of Business, delivering a speech blasting the General Public License, or GPL, a legal device originally conceived by Stallman 16 years before. Built to counteract the growing wave of software secrecy overtaking the computer industry-a wave first noticed by Stallman during his 1980 troubles with the Xerox laser printer-the GPL has evolved into a central tool of the free software community. In simplest terms, the GPL locks software programs into a form of communal ownership-what today's legal scholars now call the "digital commons"-through the legal weight of copyright. Once locked, programs remain unremovable. Derivative versions must carry the same copyright protection-even derivative versions that bear only a small snippet of the original source code. For this reason, some within the software industry have taken to calling the GPL a "viral" license, because it spreads itself to every software program it touches.~{ Actually, the GPL's powers are not quite that potent. According to section 10 of the GNU General Public License, Version 2 (1991), the viral nature of the license depends heavily on the Free Software Foundation's willingness to view a program as a derivative work, not to mention the existing license the GPL would replace.<br>If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software that is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.<br>"To compare something to a virus is very harsh," says Stallman. "A spider plant is a more accurate comparison; it goes to another place if you actively take a cutting."<br>For more information on the GNU General Public License, visit http://www.gnu.org/copyleft/gpl.html }~
+
+In an information economy increasingly dependent on software and increasingly beholden to software standards, the GPL has become the proverbial "big stick." Even companies that once laughed it off as software socialism have come around to recognize the benefits. Linux, the Unix-like kernel developed by Finnish college student Linus Torvalds in 1991, is licensed under the GPL, as are many of the world's most popular programming tools: GNU Emacs, the GNU Debugger, the GNU C Compiler, etc. Together, these tools form the components of a free software operating system developed, nurtured, and owned by the worldwide hacker community. Instead of viewing this community as a threat, high-tech companies like IBM, Hewlett Packard, and Sun Microsystems have come to rely upon it, selling software applications and services built to ride atop the ever-growing free software infrastructure.
+
+They've also come to rely upon it as a strategic weapon in the hacker community's perennial war against Microsoft, the Redmond, Washington-based company that, for better or worse, has dominated the PC-software marketplace since the late 1980s. As owner of the popular Windows operating system, Microsoft stands to lose the most in an industry-wide shift to the GPL license. Almost every line of source code in the Windows colossus is protected by copyrights reaffirming the private nature of the underlying source code or, at the very least, reaffirming Microsoft's legal ability to treat it as such. From the Microsoft viewpoint, incorporating programs protected by the "viral" GPL into the Windows colossus would be the software equivalent of Superman downing a bottle of Kryptonite pills. Rival companies could suddenly copy, modify, and sell improved versions of Windows, rendering the company's indomitable position as the No. 1 provider of consumer-oriented software instantly vulnerable. Hence the company's growing concern over the GPL's rate of adoption. Hence the recent Mundie speech blasting the GPL and the " open source" approach to software development and sales. And hence Stallman's decision to deliver a public rebuttal to that speech on the same campus here today.
+
+20 years is a long time in the software industry. Consider this: in 1980, when Richard Stallman was cursing the AI Lab's Xerox laser printer, Microsoft, the company modern hackers view as the most powerful force in the worldwide software industry, was still a privately held startup. IBM, the company hackers used to regard as the most powerful force in the worldwide software industry, had yet to to introduce its first personal computer, thereby igniting the current low-cost PC market. Many of the technologies we now take for granted-the World Wide Web, satellite television, 32-bit video-game consoles-didn't even exist. The same goes for many of the companies that now fill the upper echelons of the corporate establishment, companies like AOL, Sun Microsystems, Amazon.com, Compaq, and Dell. The list goes on and on.
+
+The fact that the high-technology marketplace has come so far in such little time is fuel for both sides of the GPL debate. GPL-proponents point to the short lifespan of most computer hardware platforms. Facing the risk of buying an obsolete product, consumers tend to flock to companies with the best long-term survival. As a result, the software marketplace has become a winner-take-all arena.~{ See Shubha Ghosh, "Revealing the Microsoft Windows Source Code," Gigalaw.com (January, 2000).<br> http://www.gigalaw.com/articles/ghosh-2000-01-p1.html }~ The current, privately owned software environment, GPL-proponents say, leads to monopoly abuse and stagnation. Strong companies suck all the oxygen out of the marketplace for rival competitors and innovative startups.
+
+GPL-opponents argue just the opposite. Selling software is just as risky, if not more risky, than buying software, they say. Without the legal guarantees provided by private software licenses, not to mention the economic prospects of a privately owned "killer app" (i.e., a breakthrough technology that launches an entirely new market),~{ Killer apps don't have to be proprietary. Witness, of course, the legendary Mosaic browser, a program whose copyright permits noncommercial derivatives with certain restrictions. Still, I think the reader gets the point: the software marketplace is like the lottery. The bigger the potential payoff, the more people want to participate. For a good summary of the killer-app phenomenon, see Philip Ben-David, "Whatever Happened to the `Killer App'?" e-Commerce News (December 7, 2000).<br> http://www.ecommercetimes.com/perl/story/5893.html }~ companies lose the incentive to participate. Once again, the market stagnates and innovation declines. As Mundie himself noted in his May 3 address on the same campus, the GPL's "viral" nature "poses a threat" to any company that relies on the uniqueness of its software as a competitive asset. Added Mundie:
+
+_1 It also fundamentally undermines the independent commercial software sector because it effectively makes it impossible to distribute software on a basis where recipients pay for the product rather than just the cost of distribution.~{ See Craig Mundie, "The Commercial Software Model," senior vice president, Microsoft Corp. Excerpted from an online transcript of Mundie's May 3, 2001, speech to the New York University Stern School of Business.<br> http://www.microsoft.com/presspass/exec/craig/05-03sharedsource.asp }~
+
+The mutual success of GNU/ Linux, the amalgamated operating system built around the GPL-protected Linux kernel, and Windows over the last 10 years reveals the wisdom of both perspectives. Nevertheless, the battle for momentum is an important one in the software industry. Even powerful vendors such as Microsoft rely on the support of third-party software developers whose tools, programs, and computer games make an underlying software platform such as Windows more attractive to the mainstream consumer. Citing the rapid evolution of the technology marketplace over the last 20 years, not to mention his own company's admirable track record during that period, Mundie advised listeners to not get too carried away by the free software movement's recent momentum:
+
+_1 Two decades of experience have shown that an economic model that protects intellectual property and a business model that recoups research and development costs can create impressive economic benefits and distribute them very broadly. ^5^
+
+Such admonitions serve as the backdrop for Stallman's speech today. Less than a month after their utterance, Stallman stands with his back to one of the chalk boards at the front of the room, edgy to begin.
+
+If the last two decades have brought dramatic changes to the software marketplace, they have brought even more dramatic changes to Stallman himself. Gone is the skinny, clean-shaven hacker who once spent his entire days communing with his beloved PDP-10. In his place stands a heavy-set middle-aged man with long hair and rabbinical beard, a man who now spends the bulk of his time writing and answering email, haranguing fellow programmers, and giving speeches like the one today. Dressed in an aqua-colored T-shirt and brown polyester pants, Stallman looks like a desert hermit who just stepped out of a Salvation Army dressing room.
+
+The crowd is filled with visitors who share Stallman's fashion and grooming tastes. Many come bearing laptop computers and cellular modems, all the better to record and transmit Stallman's words to a waiting Internet audience. The gender ratio is roughly 15 males to 1 female, and 1 of the 7 or 8 females in the room comes in bearing a stuffed penguin, the official Linux mascot, while another carries a stuffed teddy bear.
+
+{free_as_in_freedom_01_rms.png 381x321 "Richard Stallman, circa 2000. 'I decided I would develop a free software operating system or die trying ... of old age of course.' Photo courtesy of http://www.stallman.org " }http://www.free-culture.cc/
+
+Agitated, Stallman leaves his post at the front of the room and takes a seat in a front-row chair, tapping a few commands into an already-opened laptop. For the next 10 minutes Stallman is oblivious to the growing number of students, professors, and fans circulating in front of him at the foot of the auditorium stage.
+
+Before the speech can begin, the baroque rituals of academic formality must be observed. Stallman's appearance merits not one but two introductions. Mike Uretsky, codirector of the Stern School's Center for Advanced Technology, provides the first.
+
+"The role of a university is to foster debate and to have interesting discussions," Uretsky says. "This particular presentation, this seminar falls right into that mold. I find the discussion of open source particularly interesting."
+
+Before Uretsky can get another sentence out, Stallman is on his feet waving him down like a stranded motorist.
+
+"I do free software," Stallman says to rising laughter. "Open source is a different movement."
+
+The laughter gives way to applause. The room is stocked with Stallman partisans, people who know of his reputation for verbal exactitude, not to mention his much publicized 1998 falling out with the open source software proponents. Most have come to anticipate such outbursts the same way radio fans once waited for Jack Benny's trademark, "Now cut that out!" phrase during each radio program.
+
+Uretsky hastily finishes his introduction and cedes the stage to Edmond Schonberg, a professor in the NYU computer-science department. As a computer programmer and GNU Project contributor, Schonberg knows which linguistic land mines to avoid. He deftly summarizes Stallman's career from the perspective of a modern-day programmer.
+
+"Richard is the perfect example of somebody who, by acting locally, started thinking globally [about] problems concerning the unavailability of source code," says Schonberg. "He has developed a coherent philosophy that has forced all of us to reexamine our ideas of how software is produced, of what intellectual property means, and of what the software community actually represents."
+
+Schonberg welcomes Stallman to more applause. Stallman takes a moment to shut off his laptop, rises out of his chair, and takes the stage.
+
+At first, Stallman's address seems more Catskills comedy routine than political speech. "I'd like to thank Microsoft for providing me the opportunity to be on this platform," Stallman wisecracks. "For the past few weeks, I have felt like an author whose book was fortuitously banned somewhere."
+
+For the uninitiated, Stallman dives into a quick free software warm-up analogy. He likens a software program to a cooking recipe. Both provide useful step-by-step instructions on how to complete a desired task and can be easily modified if a user has special desires or circumstances. "You don't have to follow a recipe exactly," Stallman notes. "You can leave out some ingredients. Add some mushrooms, 'cause you like mushrooms. Put in less salt because your doctor said you should cut down on salt-whatever."
+
+Most importantly, Stallman says, software programs and recipes are both easy to share. In giving a recipe to a dinner guest, a cook loses little more than time and the cost of the paper the recipe was written on. Software programs require even less, usually a few mouse-clicks and a modicum of electricity. In both instances, however, the person giving the information gains two things: increased friendship and the ability to borrow interesting recipes in return.
+
+"Imagine what it would be like if recipes were packaged inside black boxes," Stallman says, shifting gears. "You couldn't see what ingredients they're using, let alone change them, and imagine if you made a copy for a friend. They would call you a pirate and try to put you in prison for years. That world would create tremendous outrage from all the people who are used to sharing recipes. But that is exactly what the world of proprietary software is like. A world in which common decency towards other people is prohibited or prevented."
+
+With this introductory analogy out of the way, Stallman launches into a retelling of the Xerox laser-printer episode. Like the recipe analogy, the laser-printer story is a useful rhetorical device. With its parable-like structure, it dramatizes just how quickly things can change in the software world. Drawing listeners back to an era before Amazon.com one-click shopping, Microsoft Windows, and Oracle databases, it asks the listener to examine the notion of software ownership free of its current corporate logos.
+
+Stallman delivers the story with all the polish and practice of a local district attorney conducting a closing argument. When he gets to the part about the Carnegie Mellon professor refusing to lend him a copy of the printer source code, Stallman pauses.
+
+"He had betrayed us," Stallman says. "But he didn't just do it to us. Chances are he did it to you."
+
+On the word "you," Stallman points his index finger accusingly at an unsuspecting member of the audience. The targeted audience member's eyebrows flinch slightly, but Stallman's own eyes have moved on. Slowly and deliberately, Stallman picks out a second listener to nervous titters from the crowd. "And I think, mostly likely, he did it to you, too," he says, pointing at an audience member three rows behind the first.
+
+By the time Stallman has a third audience member picked out, the titters have given away to general laughter. The gesture seems a bit staged, because it is. Still, when it comes time to wrap up the Xerox laser-printer story, Stallman does so with a showman's flourish. "He probably did it to most of the people here in this room-except a few, maybe, who weren't born yet in 1980," Stallman says, drawing more laughs. "[That's] because he had promised to refuse to cooperate with just about the entire population of the planet Earth."
+
+Stallman lets the comment sink in for a half-beat. "He had signed a nondisclosure agreement," Stallman adds.
+
+Richard Matthew Stallman's rise from frustrated academic to political leader over the last 20 years speaks to many things. It speaks to Stallman's stubborn nature and prodigious will. It speaks to the clearly articulated vision and values of the free software movement Stallman helped build. It speaks to the high-quality software programs Stallman has built, programs that have cemented Stallman's reputation as a programming legend. It speaks to the growing momentum of the GPL, a legal innovation that many Stallman observers see as his most momentous accomplishment.
+
+Most importantly, it speaks to the changing nature of political power in a world increasingly beholden to computer technology and the software programs that power that technology.
+
+Maybe that's why, even at a time when most high-technology stars are on the wane, Stallman's star has grown. Since launching the GNU Project in 1984,~{ The acronym GNU stands for "GNU's not Unix." In another portion of the May 29, 2001, NYU speech, Stallman summed up the acronym's origin:<br>_1 We hackers always look for a funny or naughty name for a program, because naming a program is half the fun of writing the program. We also had a tradition of recursive acronyms, to say that the program that you're writing is similar to some existing program . . . I looked for a recursive acronym for Something Is Not UNIX. And I tried all 26 letters and discovered that none of them was a word. I decided to make it a contraction. That way I could have a three-letter acronym, for Something's Not UNIX. And I tried letters, and I came across the word "GNU." That was it.<br>_1 Although a fan of puns, Stallman recommends that software users pronounce the "g" at the beginning of the acronym (i.e., "gah-new"). Not only does this avoid confusion with the word "gnu," the name of the African antelope, Connochaetes gnou, it also avoids confusion with the adjective "new." "We've been working on it for 17 years now, so it is not exactly new any more," Stallman says.<br>Source: author notes and online transcript of "Free Software: Freedom and Cooperation," Richard Stallman's May 29, 2001, speech at New York University.<br> http://www.gnu.org/events/rms-nyu-2001-transcript.txt }~ Stallman has been at turns ignored, satirized, vilified, and attacked-both from within and without the free software movement. Through it all, the GNU Project has managed to meet its milestones, albeit with a few notorious delays, and stay relevant in a software marketplace several orders of magnitude more complex than the one it entered 18 years ago. So too has the free software ideology, an ideology meticulously groomed by Stallman himself.
+
+To understand the reasons behind this currency, it helps to examine Richard Stallman both in his own words and in the words of the people who have collaborated and battled with him along the way. The Richard Stallman character sketch is not a complicated one. If any person exemplifies the old adage "what you see is what you get," it's Stallman.
+
+"I think if you want to understand Richard Stallman the human being, you really need to see all of the parts as a consistent whole," advises Eben Moglen, legal counsel to the Free Software Foundation and professor of law at Columbia University Law School. "All those personal eccentricities that lots of people see as obstacles to getting to know Stallman really are Stallman: Richard's strong sense of personal frustration, his enormous sense of principled ethical commitment, his inability to compromise, especially on issues he considers fundamental. These are all the very reasons Richard did what he did when he did."
+
+Explaining how a journey that started with a laser printer would eventually lead to a sparring match with the world's richest corporation is no easy task. It requires a thoughtful examination of the forces that have made software ownership so important in today's society. It also requires a thoughtful examination of a man who, like many political leaders before him, understands the malleability of human memory. It requires an ability to interpret the myths and politically laden code words that have built up around Stallman over time. Finally, it requires an understanding of Stallman's genius as a programmer and his failures and successes in translating that genius to other pursuits.
+
+When it comes to offering his own summary of the journey, Stallman acknowledges the fusion of personality and principle observed by Moglen. "Stubbornness is my strong suit," he says. "Most people who attempt to do anything of any great difficulty eventually get discouraged and give up. I never gave up."
+
+He also credits blind chance. Had it not been for that run-in over the Xerox laser printer, had it not been for the personal and political conflicts that closed out his career as an MIT employee, had it not been for a half dozen other timely factors, Stallman finds it very easy to picture his life following a different career path. That being said, Stallman gives thanks to the forces and circumstances that put him in the position to make a difference.
+
+"I had just the right skills," says Stallman, summing up his decision for launching the GNU Project to the audience. "Nobody was there but me, so I felt like, `I'm elected. I have to work on this. If not me , who?'"
+
+1~ Chapter 3 - A Portrait of the Hacker as a Young Man
+
+Richard Stallman's mother, Alice Lippman, still remembers the moment she realized her son had a special gift.
+
+"I think it was when he was eight," Lippman recalls.
+
+The year was 1961, and Lippman, a recently divorced single mother, was wiling away a weekend afternoon within the family's tiny one-bedroom apartment on Manhattan's Upper West Side. Leafing through a copy of Scientific American, Lippman came upon her favorite section, the Martin Gardner-authored column titled "Mathematical Games." A substitute art teacher, Lippman always enjoyed Gardner's column for the brain-teasers it provided. With her son already ensconced in a book on the nearby sofa, Lippman decided to take a crack at solving the week's feature puzzle.
+
+"I wasn't the best person when it came to solving the puzzles," she admits. "But as an artist, I found they really helped me work through conceptual barriers."
+
+Lippman says her attempt to solve the puzzle met an immediate brick wall. About to throw the magazine down in disgust, Lippman was surprised by a gentle tug on her shirt sleeve.
+
+"It was Richard," she recalls, "He wanted to know if I needed any help."
+
+Looking back and forth, between the puzzle and her son, Lippman says she initially regarded the offer with skepticism. "I asked Richard if he'd read the magazine," she says. "He told me that, yes, he had and what's more he'd already solved the puzzle. The next thing I know, he starts explaining to me how to solve it."
+
+Hearing the logic of her son's approach, Lippman's skepticism quickly gave way to incredulity. "I mean, I always knew he was a bright boy," she says, "but this was the first time I'd seen anything that suggested how advanced he really was."
+
+Thirty years after the fact, Lippman punctuates the memory with a laugh. "To tell you the truth, I don't think I ever figured out how to solve that puzzle," she says. "All I remember is being amazed he knew the answer."
+
+Seated at the dining-room table of her second Manhattan apartment-the same spacious three-bedroom complex she and her son moved to following her 1967 marriage to Maurice Lippman, now deceased-Alice Lippman exudes a Jewish mother's mixture of pride and bemusement when recalling her son's early years. The nearby dining-room credenza offers an eight-by-ten photo of Stallman glowering in full beard and doctoral robes. The image dwarfs accompanying photos of Lippman's nieces and nephews, but before a visitor can make too much of it, Lippman makes sure to balance its prominent placement with an ironic wisecrack.
+
+"Richard insisted I have it after he received his honorary doctorate at the University of Glasgow," says Lippman. "He said to me, `Guess what, mom? It's the first graduation I ever attended.'"~{ See Michael Gross, "Richard Stallman: High School Misfit, Symbol of Free Software, MacArthur-certified Genius" (1999). This interview is one of the most candid Stallman interviews on the record. I recommend it highly.<br> http://www.mgross.com/interviews/stallman1.html }~
+
+Such comments reflect the sense of humor that comes with raising a child prodigy. Make no mistake, for every story Lippman hears and reads about her son's stubbornness and unusual behavior, she can deliver at least a dozen in return.
+
+"He used to be so conservative," she says, throwing up her hands in mock exasperation. "We used to have the worst arguments right here at this table. I was part of the first group of public city school teachers that struck to form a union, and Richard was very angry with me. He saw unions as corrupt. He was also very opposed to social security. He thought people could make much more money investing it on their own. Who knew that within 10 years he would become so idealistic? All I remember is his stepsister coming to me and saying, `What is he going to be when he grows up? A fascist?'"
+
+As a single parent for nearly a decade-she and Richard's father, Daniel Stallman, were married in 1948, divorced in 1958, and split custody of their son afterwards-Lippman can attest to her son's aversion to authority. She can also attest to her son's lust for knowledge. It was during the times when the two forces intertwined, Lippman says, that she and her son experienced their biggest battles.
+
+"It was like he never wanted to eat," says Lippman, recalling the behavior pattern that set in around age eight and didn't let up until her son's high-school graduation in 1970. "I'd call him for dinner, and he'd never hear me. I'd have to call him 9 or 10 times just to get his attention. He was totally immersed."
+
+Stallman, for his part, remembers things in a similar fashion, albeit with a political twist.
+
+"I enjoyed reading," he says. "If I wanted to read, and my mother told me to go to the kitchen and eat or go to sleep, I wasn't going to listen. I saw no reason why I couldn't read. No reason why she should be able to tell me what to do, period. Essentially, what I had read about, ideas such as democracy and individual freedom, I applied to myself. I didn't see any reason to exclude children from these principles."
+
+The belief in individual freedom over arbitrary authority extended to school as well. Two years ahead of his classmates by age 11, Stallman endured all the usual frustrations of a gifted public-school student. It wasn't long after the puzzle incident that his mother attended the first in what would become a long string of parent-teacher conferences.
+
+"He absolutely refused to write papers," says Lippman, recalling an early controversy. "I think the last paper he wrote before his senior year in high school was an essay on the history of the number system in the west for a fourth-grade teacher."
+
+Gifted in anything that required analytical thinking, Stallman gravitated toward math and science at the expense of his other studies. What some teachers saw as single-mindedness, however, Lippman saw as impatience. Math and science offered simply too much opportunity to learn, especially in comparison to subjects and pursuits for which her son seemed less naturally inclined. Around age 10 or 11, when the boys in Stallman's class began playing a regular game of touch football, she remembers her son coming home in a rage. "He wanted to play so badly, but he just didn't have the coordination skills," Lippman recalls. "It made him so angry."
+
+The anger eventually drove her son to focus on math and science all the more. Even in the realm of science, however, her son's impatience could be problematic. Poring through calculus textbooks by age seven, Stallman saw little need to dumb down his discourse for adults. Sometime, during his middle-school years, Lippman hired a student from nearby Columbia University to play big brother to her son. The student left the family's apartment after the first session and never came back. "I think what Richard was talking about went over his head," Lippman speculates.
+
+Another favorite maternal anecdote dates back to the early 1960s, shortly after the puzzle incident. Around age seven, two years after the divorce and relocation from Queens, Richard took up the hobby of launching model rockets in nearby Riverside Drive Park. What started as aimless fun soon took on an earnest edge as her son began recording the data from each launch. Like the interest in mathematical games, the pursuit drew little attention until one day, just before a major NASA launch, Lippman checked in on her son to see if he wanted to watch.
+
+"He was fuming," Lippman says. "All he could say to me was, `But I'm not published yet.' Apparently he had something that he really wanted to show NASA."
+
+Such anecdotes offer early evidence of the intensity that would become Stallman's chief trademark throughout life. When other kids came to the table, Stallman stayed in his room and read. When other kids played Johnny Unitas, Stallman played Werner von Braun. "I was weird," Stallman says, summing up his early years succinctly in a 1999 interview. "After a certain age, the only friends I had were teachers." ^7^
+
+Although it meant courting more run-ins at school, Lippman decided to indulge her son's passion. By age 12, Richard was attending science camps during the summer and private school during the school year. When a teacher recommended her son enroll in the Columbia Science Honors Program, a post-Sputnik program designed for gifted middle- and high-school students in New York City, Stallman added to his extracurriculars and was soon commuting uptown to the Columbia University campus on Saturdays.
+
+Dan Chess, a fellow classmate in the Columbia Science Honors Program, recalls Richard Stallman seeming a bit weird even among the students who shared a similar lust for math and science. "We were all geeks and nerds, but he was unusually poorly adjusted," recalls Chess, now a mathematics professor at Hunter College. "He was also smart as shit. I've known a lot of smart people, but I think he was the smartest person I've ever known."
+
+Seth Breidbart, a fellow Columbia Science Honors Program alumnus, offers bolstering testimony. A computer programmer who has kept in touch with Stallman thanks to a shared passion for science fiction and science-fiction conventions, he recalls the 15-year-old, buzz-cut-wearing Stallman as "scary," especially to a fellow 15-year-old.
+
+"It's hard to describe," Breidbart says. "It wasn't like he was unapproachable. He was just very intense. [He was] very knowledgeable but also very hardheaded in some ways."
+
+Such descriptions give rise to speculation: are judgment-laden adjectives like "intense" and "hardheaded" simply a way to describe traits that today might be categorized under juvenile behavioral disorder? A December, 2001, Wired magazine article titled "The Geek Syndrome" paints the portrait of several scientifically gifted children diagnosed with high-functioning autism or Asperger Syndrome. In many ways, the parental recollections recorded in the Wired article are eerily similar to the ones offered by Lippman. Even Stallman has indulged in psychiatric revisionism from time to time. During a 2000 profile for the Toronto Star, Stallman described himself to an interviewer as "borderline autistic,"~{ See Judy Steed, Toronto Star, BUSINESS, (October 9, 2000): C03.<br>His vision of free software and social cooperation stands in stark contrast to the isolated nature of his private life. A Glenn Gould-like eccentric, the Canadian pianist was similarly brilliant, articulate, and lonely. Stallman considers himself afflicted, to some degree, by autism: a condition that, he says, makes it difficult for him to interact with people. }~ a description that goes a long way toward explaining a lifelong tendency toward social and emotional isolation and the equally lifelong effort to overcome it.
+
+Such speculation benefits from the fast and loose nature of most so-called " behavioral disorders" nowadays, of course. As Steve Silberman, author of " The Geek Syndrome," notes, American psychiatrists have only recently come to accept Asperger Syndrome as a valid umbrella term covering a wide set of behavioral traits. The traits range from poor motor skills and poor socialization to high intelligence and an almost obsessive affinity for numbers, computers, and ordered systems.~{ See Steve Silberman, "The Geek Syndrome," Wired (December, 2001).<br> http://www.wired.com/wired/archive/9.12/aspergers_pr.html }~ Reflecting on the broad nature of this umbrella, Stallman says its possible that, if born 40 years later, he might have merited just such a diagnosis. Then again, so would many of his computer-world colleagues.
+
+"It's possible I could have had something like that," he says. "On the other hand, one of the aspects of that syndrome is difficulty following rhythms. I can dance. In fact, I love following the most complicated rhythms. It's not clear cut enough to know."
+
+Chess, for one, rejects such attempts at back-diagnosis. "I never thought of him [as] having that sort of thing," he says. "He was just very unsocialized, but then, we all were."
+
+Lippman, on the other hand, entertains the possibility. She recalls a few stories from her son's infancy, however, that provide fodder for speculation. A prominent symptom of autism is an oversensitivity to noises and colors, and Lippman recalls two anecdotes that stand out in this regard. "When Richard was an infant, we'd take him to the beach," she says. "He would start screaming two or three blocks before we reached the surf. It wasn't until the third time that we figured out what was going on: the sound of the surf was hurting his ears." She also recalls a similar screaming reaction in relation to color: "My mother had bright red hair, and every time she'd stoop down to pick him up, he'd let out a wail."
+
+In recent years, Lippman says she has taken to reading books about autism and believes that such episodes were more than coincidental. "I do feel that Richard had some of the qualities of an autistic child," she says. "I regret that so little was known about autism back then."
+
+Over time, however, Lippman says her son learned to adjust. By age seven, she says, her son had become fond of standing at the front window of subway trains, mapping out and memorizing the labyrinthian system of railroad tracks underneath the city. It was a hobby that relied on an ability to accommodate the loud noises that accompanied each train ride. "Only the initial noise seemed to bother him," says Lippman. "It was as if he got shocked by the sound but his nerves learned how to make the adjustment."
+
+For the most part, Lippman recalls her son exhibiting the excitement, energy, and social skills of any normal boy. It wasn't until after a series of traumatic events battered the Stallman household, she says, that her son became introverted and emotionally distant.
+
+The first traumatic event was the divorce of Alice and Daniel Stallman, Richard's father. Although Lippman says both she and her ex-husband tried to prepare their son for the blow, she says the blow was devastating nonetheless. "He sort of didn't pay attention when we first told him what was happening," Lippman recalls. "But the reality smacked him in the face when he and I moved into a new apartment. The first thing he said was, `Where's Dad's furniture?'"
+
+For the next decade, Stallman would spend his weekdays at his mother's apartment in Manhattan and his weekends at his father's home in Queens. The shuttling back and forth gave him a chance to study a pair of contrasting parenting styles that, to this day, leaves Stallman firmly opposed to the idea of raising children himself. Speaking about his father, a World War II vet who passed away in early 2001, Stallman balances respect with anger. On one hand, there is the man whose moral commitment led him to learn French just so he could be more helpful to Allies when they'd finally come. On the other hand, there was the parent who always knew how to craft a put-down for cruel effect.~{ Regrettably, I did not get a chance to interview Daniel Stallman for this book. During the early research for this book, Stallman informed me that his father suffered from Alzheimer's. When I resumed research in late 2001, I learned, sadly, that Daniel Stallman had died earlier in the year. }~
+
+"My father had a horrible temper," Stallman says. "He never screamed, but he always found a way to criticize you in a cold, designed-to-crush way."
+
+As for life in his mother's apartment, Stallman is less equivocal. "That was war," he says. "I used to say in my misery, `I want to go home,' meaning to the nonexistent place that I'll never have."
+
+For the first few years after the divorce, Stallman found the tranquility that eluded him in the home of his paternal grandparents. Then, around age 10 his grandparents passed away in short succession. For Stallman, the loss was devastating. "I used to go and visit and feel I was in a loving, gentle environment," Stallman recalls. "It was the only place I ever found one, until I went away to college."
+
+Lippman lists the death of Richard's paternal grandparents as the second traumatic event. "It really upset him," she says. He was very close to both his grandparents. Before they died, he was very outgoing, almost a leader-of-the-pack type with the other kids. After they died, he became much more emotionally withdrawn."
+
+From Stallman's perspective, the emotional withdrawal was merely an attempt to deal with the agony of adolescence. Labeling his teenage years a "pure horror," Stallman says he often felt like a deaf person amid a crowd of chattering music listeners.
+
+"I often had the feeling that I couldn't understand what other people were saying," says Stallman, recalling the emotional bubble that insulated him from the rest of the adolescent and adult world. "I could understand the words, but something was going on underneath the conversations that I didn't understand. I couldn't understand why people were interested in the things other people said."
+
+For all the agony it produced, adolescence would have a encouraging effect on Stallman's sense of individuality. At a time when most of his classmates were growing their hair out, Stallman preferred to keep his short. At a time when the whole teenage world was listening to rock and roll, Stallman preferred classical music. A devoted fan of science fiction, Mad magazine, and late-night TV, Stallman cultivated a distinctly off-the-wall personality that fed off the incomprehension of parents and peers alike.
+
+"Oh, the puns," says Lippman, still exasperated by the memory of her son's teenage personality. "There wasn't a thing you could say at the dinner table that he couldn't throw back at you as a pun."
+
+Outside the home, Stallman saved the jokes for the adults who tended to indulge his gifted nature. One of the first was a summer-camp counselor who handed Stallman a print-out manual for the IBM 7094 computer during his 12th year. To a preteenager fascinated with numbers and science, the gift was a godsend.~{ Stallman, an atheist, would probably quibble with this description. Suffice it to say, it was something Stallman welcomed. See previous note 1: "As soon as I heard about computers, I wanted to see one and play with one." }~ By the end of summer, Stallman was writing out paper programs according to the 7094's internal specifications, anxiously anticipating getting a chance to try them out on a real machine.
+
+With the first personal computer still a decade away, Stallman would be forced to wait a few years before getting access to his first computer. His first chance finally came during his junior year of high school. Hired on at the IBM New York Scientific Center, a now-defunct research facility in downtown Manhattan, Stallman spent the summer after high-school graduation writing his first program, a pre-processor for the 7094 written in the programming language PL/I. "I first wrote it in PL/I, then started over in assembler language when the PL/I program was too big to fit in the computer," he recalls.
+
+After that job at the IBM Scientific Center, Stallman had held a laboratory-assistant position in the biology department at Rockefeller University. Although he was already moving toward a career in math or physics, Stallman's analytical mind impressed the lab director enough that a few years after Stallman departed for college, Lippman received an unexpected phone call. "It was the professor at Rockefeller," Lippman says. "He wanted to know how Richard was doing. He was surprised to learn that he was working in computers. He'd always thought Richard had a great future ahead of him as a biologist."
+
+Stallman's analytical skills impressed faculty members at Columbia as well, even when Stallman himself became a target of their ire. "Typically once or twice an hour [Stallman] would catch some mistake in the lecture," says Breidbart. "And he was not shy about letting the professors know it immediately. It got him a lot of respect but not much popularity."
+
+Hearing Breidbart's anecdote retold elicits a wry smile from Stallman. "I may have been a bit of a jerk sometimes," he admits. "But I found kindred spirits among the teachers, because they, too, liked to learn. Kids, for the most part, didn't. At least not in the same way."
+
+Hanging out with the advanced kids on Saturday nevertheless encouraged Stallman to think more about the merits of increased socialization. With college fast approaching, Stallman, like many in his Columbia Science Honors Program, had narrowed his list of desired schools down to two choices: Harvard and MIT. Hearing of her son's desire to move on to the Ivy League, Lippman became concerned. As a 15-year-old high-school junior, Stallman was still having run-ins with teachers and administrators. Only the year before, he had pulled straight A's in American History, Chemistry, French, and Algebra, but a glaring F in English reflected the ongoing boycott of writing assignments. Such miscues might draw a knowing chuckle at MIT, but at Harvard, they were a red flag.
+
+During her son's junior year, Lippman says she scheduled an appointment with a therapist. The therapist expressed instant concern over Stallman's unwillingness to write papers and his run-ins with teachers. Her son certainly had the intellectual wherewithal to succeed at Harvard, but did he have the patience to sit through college classes that required a term paper? The therapist suggested a trial run. If Stallman could make it through a full year in New York City public schools, including an English class that required term papers, he could probably make it at Harvard. Following the completion of his junior year, Stallman promptly enrolled in summer school at Louis D. Brandeis High School, a public school located on 84th Street, and began making up the mandatory art classes he had shunned earlier in his high-school career.
+
+By fall, Stallman was back within the mainstream population of New York City high-school students. It wasn't easy sitting through classes that seemed remedial in comparison with his Saturday studies at Columbia, but Lippman recalls proudly her son's ability to toe the line.
+
+"He was forced to kowtow to a certain degree, but he did it," Lippman says. "I only got called in once, which was a bit of a miracle. It was the calculus teacher complaining that Richard was interrupting his lesson. I asked how he was interrupting. He said Richard was always accusing the teacher of using a false proof. I said, `Well, is he right?' The teacher said, `Yeah, but I can't tell that to the class. They wouldn't understand.'"
+
+By the end of his first semester at Brandeis, things were falling into place. A 96 in English wiped away much of the stigma of the 60 earned 2 years before. For good measure, Stallman backed it up with top marks in American History, Advanced Placement Calculus, and Microbiology. The crowning touch was a perfect 100 in Physics. Though still a social outcast, Stallman finished his 11 months at Brandeis as the fourth-ranked student in a class of 789.
+
+{free_as_in_freedom_02_rms_snr_year_report.png 381x286 "Stallman's senior-year transcript at Louis D. Brandeis H.S., November, 1969. Note turnaround in English class performance. 'He was forced to kowtow to a certain degree,' says his mother, 'but he did it.'" }http://www.free-culture.cc/
+
+Outside the classroom, Stallman pursued his studies with even more diligence, rushing off to fulfill his laboratory-assistant duties at Rockefeller University during the week and dodging the Vietnam protesters on his way to Saturday school at Columbia. It was there, while the rest of the Science Honors Program students sat around discussing their college choices, that Stallman finally took a moment to participate in the preclass bull session.
+
+Recalls Breidbart, "Most of the students were going to Harvard and MIT, of course, but you had a few going to other Ivy League schools. As the conversation circled the room, it became apparent that Richard hadn't said anything yet. I don't know who it was, but somebody got up the courage to ask him what he planned to do."
+
+Thirty years later, Breidbart remembers the moment clearly. As soon as Stallman broke the news that he, too, would be attending Harvard University in the fall, an awkward silence filled the room. Almost as if on cue, the corners of Stallman's mouth slowly turned upward into a self-satisfied smile.
+
+Says Breidbart, "It was his silent way of saying, `That's right. You haven't got rid of me yet.'"
+
+1~ Chapter 4 - Impeach God
+
+Although their relationship was fraught with tension, Richard Stallman would inherit one noteworthy trait from his mother: a passion for progressive politics.
+
+It was an inherited trait that would take several decades to emerge, however. For the first few years of his life, Stallman lived in what he now admits was a "political vacuum."~{ See Michael Gross, "Richard Stallman: High School Misfit, Symbol of Free Software, MacArthur-certified Genius" (1999). }~ Like most Americans during the Eisenhower age, the Stallman family spent the 50s trying to recapture the normalcy lost during the wartime years of the 1940s.
+
+"Richard's father and I were Democrats but happy enough to leave it at that," says Lippman, recalling the family's years in Queens. "We didn't get involved much in local or national politics."
+
+That all began to change, however, in the late 1950s when Alice divorced Daniel Stallman. The move back to Manhattan represented more than a change of address; it represented a new, independent identity and a jarring loss of tranquility.
+
+"I think my first taste of political activism came when I went to the Queens public library and discovered there was only a single book on divorce in the whole library," recalls Lippman. "It was very controlled by the Catholic church, at least in Elmhurst, where we lived. I think that was the first inkling I had of the forces that quietly control our lives."
+
+Returning to her childhood neighborhood, Manhattan's Upper West Side, Lippman was shocked by the changes that had taken place since her departure to Hunter College a decade and a half before. The skyrocketing demand for postwar housing had turned the neighborhood into a political battleground. On one side stood the pro-development city-hall politicians and businessmen hoping to rebuild many of the neighborhood's blocks to accommodate the growing number of white-collar workers moving into the city. On the other side stood the poor Irish and Puerto Rican tenants who had found an affordable haven in the neighborhood.
+
+At first, Lippman didn't know which side to choose. As a new resident, she felt the need for new housing. As a single mother with minimal income, however, she shared the poorer tenants' concern over the growing number of development projects catering mainly to wealthy residents. Indignant, Lippman began looking for ways to combat the political machine that was attempting to turn her neighborhood into a clone of the Upper East Side.
+
+Lippman says her first visit to the local Democratic party headquarters came in 1958. Looking for a day-care center to take care of her son while she worked, she had been appalled by the conditions encountered at one of the city-owned centers that catered to low-income residents. "All I remember is the stench of rotten milk, the dark hallways, the paucity of supplies. I had been a teacher in private nursery schools. The contrast was so great. We took one look at that room and left. That stirred me up."
+
+The visit to the party headquarters proved disappointing, however. Describing it as "the proverbial smoke-filled room," Lippman says she became aware for the first time that corruption within the party might actually be the reason behind the city's thinly disguised hostility toward poor residents. Instead of going back to the headquarters, Lippman decided to join up with one of the many clubs aimed at reforming the Democratic party and ousting the last vestiges of the Tammany Hall machine. Dubbed the Woodrow Wilson/FDR Reform Democratic Club, Lippman and her club began showing up at planning and city-council meetings, demanding a greater say.
+
+"Our primary goal was to fight Tammany Hall, Carmine DeSapio and his henchman,"~{ Carmine DeSapio holds the dubious distinction of being the first Italian-American boss of Tammany Hall, the New York City political machine. For more information on DeSapio and the politics of post-war New York, see John Davenport, "Skinning the Tiger: Carmine DeSapio and the End of the Tammany Era," New York Affairs (1975): 3:1. }~ says Lippman. "I was the representative to the city council and was very much involved in creating a viable urban-renewal plan that went beyond simply adding more luxury housing to the neighborhood."
+
+Such involvement would blossom into greater political activity during the 1960s. By 1965, Lippman had become an "outspoken" supporter for political candidates like William Fitts Ryan, a Democratic elected to Congress with the help of reform clubs and one of the first U.S. representatives to speak out against the Vietnam War.
+
+It wasn't long before Lippman, too, was an outspoken opponent of U.S. involvement in Indochina. "I was against the Vietnam war from the time Kennedy sent troops," she says. "I had read the stories by reporters and journalists sent to cover the early stages of the conflict. I really believed their forecast that it would become a quagmire."
+
+Such opposition permeated the Stallman-Lippman household. In 1967, Lippman remarried. Her new husband, Maurice Lippman, a major in the Air National Guard, resigned his commission to demonstrate his opposition to the war. Lippman's stepson, Andrew Lippman, was at MIT and temporarily eligible for a student deferment. Still, the threat of induction should that deferment disappear, as it eventually did, made the risk of U.S. escalation all the more immediate. Finally, there was Richard who, though younger, faced the prospect of choosing between Vietnam or Canada when the war lasted into the 1970s.
+
+"Vietnam was a major issue in our household," says Lippman. "We talked about it constantly: what would we do if the war continued, what steps Richard or his stepbrother would take if they got drafted. We were all opposed to the war and the draft. We really thought it was immoral."
+
+For Stallman, the Vietnam War elicited a complex mixture of emotions: confusion, horror, and, ultimately, a profound sense of political impotence. As a kid who could barely cope in the mild authoritarian universe of private school, Stallman experienced a shiver whenever the thought of Army boot camp presented itself.
+
+"I was devastated by the fear, but I couldn't imagine what to do and didn't have the guts to go demonstrate," recalls Stallman, whose March 18th birthday earned him a dreaded low number in the draft lottery when the federal government finally eliminated college deferments in 1971. "I couldn't envision moving to Canada or Sweden. The idea of getting up by myself and moving somewhere. How could I do that? I didn't know how to live by myself. I wasn't the kind of person who felt confident in approaching things like that."
+
+Stallman says he was both impressed and shamed by the family members who did speak out. Recalling a bumper sticker on his father's car likening the My Lai massacre to similar Nazi atrocities in World War II, he says he was "excited" by his father's gesture of outrage. "I admired him for doing it," Stallman says. "But I didn't imagine that I could do anything. I was afraid that the juggernaut of the draft was going to destroy me."
+
+Although descriptions of his own unwillingness to speak out carry a tinge of nostalgic regret, Stallman says he was ultimately turned off by the tone and direction of the anti-war movement. Like other members of the Science Honors Program, he saw the weekend demonstrations at Columbia as little more than a distracting spectacle.~{ Chess, another Columbia Science Honors Program alum, describes the protests as "background noise." "We were all political," he says, "but the SHP was imporant. We would never have skipped it for a demonstration." }~ Ultimately, Stallman says, the irrational forces driving the anti-war movement became indistinguishable from the irrational forces driving the rest of youth culture. Instead of worshiping the Beatles, girls in Stallman's age group were suddenly worshiping firebrands like Abbie Hoffman and Jerry Rubin. To a kid already struggling to comprehend his teenage peers, escapist slogans like "make love not war" had a taunting quality. Not only was it a reminder that Stallman, the short-haired outsider who hated rock 'n' roll, detested drugs, and didn't participate in campus demonstrations, wasn't getting it politically; he wasn't "getting it" sexually either.
+
+"I didn't like the counter culture much," Stallman admits. "I didn't like the music. I didn't like the drugs. I was scared of the drugs. I especially didn't like the anti-intellectualism, and I didn't like the prejudice against technology. After all, I loved a computer. And I didn't like the mindless anti-Americanism that I often encountered. There were people whose thinking was so simplistic that if they disapproved of the conduct of the U.S. in the Vietnam War, they had to support the North Vietnamese. They couldn't imagine a more complicated position, I guess."
+
+Such comments alleviate feelings of timidity. They also underline a trait that would become the key to Stallman's own political maturation. For Stallman, political confidence was directly proportionate to personal confidence. By 1970, Stallman had become confident in few things outside the realm of math and science. Nevertheless, confidence in math gave him enough of a foundation to examine the anti-war movement in purely logical terms. In the process of doing so, Stallman had found the logic wanting. Although opposed to the war in Vietnam, Stallman saw no reason to disavow war as a means for defending liberty or correcting injustice. Rather than widen the breach between himself and his peers, however, Stallman elected to keep the analysis to himself.
+
+In 1970, Stallman left behind the nightly dinnertime conversations about politics and the Vietnam War as he departed for Harvard. Looking back, Stallman describes the transition from his mother's Manhattan apartment to life in a Cambridge dorm as an "escape." Peers who watched Stallman make the transition, however, saw little to suggest a liberating experience.
+
+"He seemed pretty miserable for the first while at Harvard," recalls Dan Chess, a classmate in the Science Honors Program who also matriculated at Harvard. "You could tell that human interaction was really difficult for him, and there was no way of avoiding it at Harvard. Harvard was an intensely social kind of place."
+
+To ease the transition, Stallman fell back on his strengths: math and science. Like most members of the Science Honors Program, Stallman breezed through the qualifying exam for Math 55, the legendary "boot camp" class for freshman mathematics "concentrators" at Harvard. Within the class, members of the Science Honors Program formed a durable unit. "We were the math mafia," says Chess with a laugh. "Harvard was nothing, at least compared with the SHP."
+
+To earn the right to boast, however, Stallman, Chess, and the other SHP alumni had to get through Math 55. Promising four years worth of math in two semesters, the course favored only the truly devout. "It was an amazing class," says David Harbater, a former "math mafia" member and now a professor of mathematics at the University of Pennsylvania. "It's probably safe to say there has never been a class for beginning college students that was that intense and that advanced. The phrase I say to people just to get it across is that, among other things, by the second semester we were discussing the differential geometry of Banach manifolds. That's usually when their eyes bug out, because most people don't start talking about Banach manifolds until their second year of graduate school."
+
+Starting with 75 students, the class quickly melted down to 20 by the end of the second semester. Of that 20, says Harbater, "only 10 really knew what they were doing." Of that 10, 8 would go on to become future mathematics professors, 1 would go on to teach physics.
+
+"The other one," emphasizes Harbater, "was Richard Stallman."
+
+Seth Breidbart, a fellow Math 55 classmate, remembers Stallman distinguishing himself from his peers even then.
+
+"He was a stickler in some very strange ways," says Breidbart. There is a standard technique in math which everybody does wrong. It's an abuse of notation where you have to define a function for something and what you do is you define a function and then you prove that it's well defined. Except the first time he did and presented it, he defined a relation and proved that it's a function. It's the exact same proof, but he used the correct terminology, which no one else did. That's just the way he was."
+
+It was in Math 55 that Richard Stallman began to cultivate a reputation for brilliance. Breidbart agrees, but Chess, whose competitive streak refused to yield, says the realization that Stallman might be the best mathematician in the class didn't set in until the next year. "It was during a class on Real Analysis, which I took with Richard the next year," says Chess, now a math professor at Hunter College. "I actually remember in a proof about complex valued measures that Richard came up with an idea that was basically a metaphor from the calculus of variations. It was the first time I ever saw somebody solve a problem in a brilliantly original way."
+
+Chess makes no bones about it: watching Stallman's solution unfold on the chalkboard was a devastating blow. As a kid who'd always taken pride in being the smartest mathematician the room, it was like catching a glimpse of his own mortality. Years later, as Chess slowly came to accept the professional rank of a good-but-not-great mathematician, he had Stallman's sophomore-year proof to look back on as a taunting early indicator.
+
+"That's the thing about mathematics," says Chess. "You don't have to be a first-rank mathematician to recognize first-rate mathematical talent. I could tell I was up there, but I could also tell I wasn't at the first rank. If Richard had chosen to be a mathematician, he would have been a first-rank mathematician."
+
+For Stallman, success in the classroom was balanced by the same lack of success in the social arena. Even as other members of the math mafia gathered to take on the Math 55 problem sets, Stallman preferred to work alone. The same went for living arrangements. On the housing application for Harvard, Stallman clearly spelled out his preferences. "I said I preferred an invisible, inaudible, intangible roommate," he says. In a rare stroke of bureaucratic foresight, Harvard's housing office accepted the request, giving Stallman a one-room single for his freshman year.
+
+Breidbart, the only math-mafia member to share a dorm with Stallman that freshman year, says Stallman slowly but surely learned how to interact with other students. He recalls how other dorm mates, impressed by Stallman's logical acumen, began welcoming his input whenever an intellectual debate broke out in the dining club or dorm commons.
+
+"We had the usual bull sessions about solving the world's problems or what would be the result of something," recalls Breidbart. "Say somebody discovers an immortality serum. What do you do? What are the political results? If you give it to everybody, the world gets overcrowded and everybody dies. If you limit it, if you say everyone who's alive now can have it but their children can't, then you end up with an underclass of people without it. Richard was just better able than most to see the unforeseen circumstances of any decision."
+
+Stallman remembers the discussions vividly. "I was always in favor of immortality," he says. "I was shocked that most people regarded immortality as a bad thing. How else would we be able to see what the world is like 200 years from now?"
+
+Although a first-rank mathematician and first-rate debater, Stallman shied away from clear-cut competitive events that might have sealed his brilliant reputation. Near the end of freshman year at Harvard, Breidbart recalls how Stallman conspicuously ducked the Putnam exam, a prestigious test open to math students throughout the U.S. and Canada. In addition to giving students a chance to measure their knowledge in relation to their peers, the Putnam served as a chief recruiting tool for academic math departments. According to campus legend, the top scorer automatically qualified for a graduate fellowship at any school of his choice, including Harvard.
+
+Like Math 55, the Putnam was a brutal test of merit. A six-hour exam in two parts, it seemed explicitly designed to separate the wheat from the chaff. Breidbart, a veteran of both the Science Honors Program and Math 55, describes it as easily the most difficult test he ever took. "Just to give you an idea of how difficult it was," says Breidbart, "the top score was a 120, and my score the first year was in the 30s. That score was still good enough to place me 101st in the country."
+
+Surprised that Stallman, the best student in the class, had passed on the test, Breidbart says he and a fellow classmate cornered him in the dining common and demanded an explanation. "He said he was afraid of not doing well," Breidbart recalls.
+
+Breidbart and the friend quickly wrote down a few problems from memory and gave them to Stallman. "He solved all of them," Breidbart says, "leading me to conclude that by not doing well, he either meant coming in second or getting something wrong."
+
+Stallman remembers the episode a bit differently. "I remember that they did bring me the questions and it's possible that I solved one of them, but I'm pretty sure I didn't solve them all," he says. Nevertheless, Stallman agrees with Breidbart's recollection that fear was the primary reason for not taking the test. Despite a demonstrated willingness to point out the intellectual weaknesses of his peers and professors in the classroom, Stallman hated the notion of head-to-head competition.
+
+"It's the same reason I never liked chess," says Stallman. "Whenever I'd play, I would become so consumed by the fear of making a single mistake that I would start making stupid mistakes very early in the game. The fear became a self-fulfilling prophecy."
+
+Whether such fears ultimately prompted Stallman to shy away from a mathematical career is a moot issue. By the end of his freshman year at Harvard, Stallman had other interests pulling him away from the field. Computer programming, a latent fascination throughout Stallman's high-school years, was becoming a full-fledged passion. Where other math students sought occasional refuge in art and history classes, Stallman sought it in the computer-science laboratory.
+
+For Stallman, the first taste of real computer programming at the IBM New York Scientific Center had triggered a desire to learn more. "Toward the end of my first year at Harvard school, I started to have enough courage to go visit computer labs and see what they had. I'd ask them if they had extra copies of any manuals that I could read."
+
+Taking the manuals home, Stallman would examine machine specifications, compare them with other machines he already knew, and concoct a trial program, which he would then bring back to the lab along with the borrowed manual. Although some labs balked at the notion of a strange kid coming off the street and working on the lab machinery, most recognized competence when they saw it and let Stallman run the programs he had created.
+
+One day, near the end of freshman year, Stallman heard about a special laboratory near MIT. The laboratory was located on the ninth floor an off-campus building in Tech Square, the newly built facility dedicated to advanced research. According to the rumors, the lab itself was dedicated to the cutting-edge science of artificial intelligence and boasted the cutting-edge machines and software programs to match.
+
+Intrigued, Stallman decided to pay a visit.
+
+The trip was short, about 2 miles on foot, 10 minutes by train, but as Stallman would soon find out, MIT and Harvard can feel like opposite poles of the same planet. With its maze-like tangle of interconnected office buildings, the Institute's campus offered an aesthetic yin to Harvard's spacious colonial-village yang. The same could be said for the student body, a geeky collection of ex-high school misfits known more for its predilection for pranks than its politically powerful alumni.
+
+The yin-yang relationship extended to the AI Lab as well. Unlike Harvard computer labs, there was no grad-student gatekeeper, no clipboard waiting list for terminal access, no explicit atmosphere of "look but don't touch." Instead, Stallman found only a collection of open terminals and robotic arms, presumably the artifacts of some A.I. experiment.
+
+Although the rumors said anybody could sit down at the terminals, Stallman decided to stick with the original plan. When he encountered a lab employee, he asked if the lab had any spare manuals it could loan to an inquisitive student. "They had some, but a lot of things weren't documented," Stallman recalls. "They were hackers after all."
+
+Stallman left with something even better than a manual: a job. Although he doesn't remember what the first project was, he does remember coming back to the AI Lab the next week, grabbing an open terminal and writing software code.
+
+Looking back, Stallman sees nothing unusual in the AI Lab's willingness to accept an unproven outsider at first glance. "That's the way it was back then," he says. "That's the way it still is now. I'll hire somebody when I meet him if I see he's good. Why wait? Stuffy people who insist on putting bureaucracy into everything really miss the point. If a person is good, he shouldn't have to go through a long, detailed hiring process; he should be sitting at a computer writing code."
+
+To get a taste of "bureaucratic and stuffy," Stallman need only visit the computer labs at Harvard. There, access to the terminals was doled out according to academic rank. As an undergrad, Stallman usually had to sign up or wait until midnight, about the time most professors and grad students finished their daily work assignments. The waiting wasn't difficult, but it was frustrating. Waiting for a public terminal, knowing all the while that a half dozen equally usable machines were sitting idle inside professors' locked offices, seemed the height of illogic. Although Stallman paid the occasional visit to the Harvard computer labs, he preferred the more egalitarian policies of the AI Lab. "It was a breath of fresh air," he says. "At the AI Lab, people seemed more concerned about work than status."
+
+Stallman quickly learned that the AI Lab's first-come, first-served policy owed much to the efforts of a vigilant few. Many were holdovers from the days of Project MAC, the Department of Defense-funded research program that had given birth to the first time-share operating systems. A few were already legends in the computing world. There was Richard Greenblatt, the lab's in-house Lisp expert and author of MacHack, the computer chess program that had once humbled A.I. critic Hubert Dreyfus. There was Gerald Sussman, original author of the robotic block-stacking program HACKER. And there was Bill Gosper, the in-house math whiz already in the midst of an 18-month hacking bender triggered by the philosophical implications of the computer game LIFE.~{ See Steven Levy, Hackers (Penguin USA [paperback], 1984): 144.<br>Levy devotes about five pages to describing Gosper's fascination with LIFE, a math-based software game first created by British mathematician John Conway. I heartily recommend this book as a supplement, perhaps even a prerequisite, to this one. }~
+
+Members of the tight-knit group called themselves " hackers." Over time, they extended the "hacker" description to Stallman as well. In the process of doing so, they inculcated Stallman in the ethical traditions of the "hacker ethic ." To be a hacker meant more than just writing programs, Stallman learned. It meant writing the best possible programs. It meant sitting at a terminal for 36 hours straight if that's what it took to write the best possible programs. Most importantly, it meant having access to the best possible machines and the most useful information at all times. Hackers spoke openly about changing the world through software, and Stallman learned the instinctual hacker disdain for any obstacle that prevented a hacker from fulfilling this noble cause. Chief among these obstacles were poor software, academic bureaucracy, and selfish behavior.
+
+Stallman also learned the lore, stories of how hackers, when presented with an obstacle, had circumvented it in creative ways. Stallman learned about " lock hacking," the art of breaking into professors' offices to "liberate" sequestered terminals. Unlike their pampered Harvard counterparts, MIT faculty members knew better than to treat the AI Lab's terminal as private property. If a faculty member made the mistake of locking away a terminal for the night, hackers were quick to correct the error. Hackers were equally quick to send a message if the mistake repeated itself. "I was actually shown a cart with a heavy cylinder of metal on it that had been used to break down the door of one professor's office,"~{ Gerald Sussman, an MIT faculty member and hacker whose work at the AI Lab predates Stallman's, disputes this memory. According to Sussman, the hackers never broke any doors to retrieve terminals. }~ Stallman says.
+
+Such methods, while lacking in subtlety, served a purpose. Although professors and administrators outnumbered hackers two-to-one inside the AI Lab, the hacker ethic prevailed. Indeed, by the time of Stallman's arrival at the AI Lab, hackers and the AI Lab administration had coevolved into something of a symbiotic relationship. In exchange for fixing the machines and keeping the software up and running, hackers earned the right to work on favorite pet projects. Often, the pet projects revolved around improving the machines and software programs even further. Like teenage hot-rodders, most hackers viewed tinkering with machines as its own form of entertainment.
+
+Nowhere was this tinkering impulse better reflected than in the operating system that powered the lab's central PDP-6 mini-computer. Dubbed ITS, short for the Incompatible Time Sharing system, the operating system incorporated the hacking ethic into its very design. Hackers had built it as a protest to Project MAC's original operating system, the Compatible Time Sharing System, CTSS, and named it accordingly. At the time, hackers felt the CTSS design too restrictive, limiting programmers' power to modify and improve the program's own internal architecture if needed. According to one legend passed down by hackers, the decision to build ITS had political overtones as well. Unlike CTSS, which had been designed for the IBM 7094, ITS was built specifically for the PDP-6. In letting hackers write the systems themselves, AI Lab administrators guaranteed that only hackers would feel comfortable using the PDP-6. In the feudal world of academic research, the gambit worked. Although the PDP-6 was co-owned in conjunction with other departments, A.I. researchers soon had it to themselves.~{ I apologize for the whirlwind summary of ITS' genesis, an operating system many hackers still regard as the epitome of the hacker ethos. For more information on the program's political significance, see Simson Garfinkel, Architects of the Information Society: Thirty-Five Years of the Laboratory for Computer Science at MIT (MIT Press, 1999). }~
+
+ITS boasted features most commercial operating systems wouldn't offer for years, features such as multitasking, debugging, and full-screen editing capability. Using it and the PDP-6 as a foundation, the Lab had been able to declare independence from Project MAC shortly before Stallman's arrival. ^17^
+
+As an apprentice hacker, Stallman quickly became enamored with ITS. Although forbidding to most newcomers, the program contained many built-in features that provided a lesson in software development to hacker apprentices such as himself.
+
+"ITS had a very elegant internal mechanism for one program to examine another," says Stallman, recalling the program. "You could examine all sorts of status about another program in a very clean, well-specified way."
+
+Using this feature, Stallman was able to watch how programs written by hackers processed instructions as they ran. Another favorite feature would allow the monitoring program to freeze the monitored program's job between instructions. In other operating systems, such a command would have resulted in half-computed gibberish or an automatic systems crash. In ITS, it provided yet another way to monitor the step-by-step performance.
+
+"If you said, `Stop the job,' it would always be stopped in user mode. It would be stopped between two user-mode instructions, and everything about the job would be consistent for that point," Stallman says. "If you said, `Resume the job,' it would continue properly. Not only that, but if you were to change the status of the job and then change it back, everything would be consistent. There was no hidden status anywhere."
+
+By the end of 1970, hacking at the AI Lab had become a regular part of Stallman's weekly schedule. From Monday to Thursday, Stallman devoted his waking hours to his Harvard classes. As soon as Friday afternoon arrived, however, he was on the T, heading down to MIT for the weekend. Stallman usually timed his arrival to coincide with the ritual food run. Joining five or six other hackers in their nightly quest for Chinese food, he would jump inside a beat-up car and head across the Harvard Bridge into nearby Boston. For the next two hours, he and his hacker colleagues would discuss everything from ITS to the internal logic of the Chinese language and pictograph system. Following dinner, the group would return to MIT and hack code until dawn.
+
+For the geeky outcast who rarely associated with his high-school peers, it was a heady experience, suddenly hanging out with people who shared the same predilection for computers, science fiction, and Chinese food. "I remember many sunrises seen from a car coming back from Chinatown," Stallman would recall nostalgically, 15 years after the fact in a speech at the Swedish Royal Technical Institute. "It was actually a very beautiful thing to see a sunrise, 'cause that's such a calm time of day. It's a wonderful time of day to get ready to go to bed. It's so nice to walk home with the light just brightening and the birds starting to chirp; you can get a real feeling of gentle satisfaction, of tranquility about the work that you have done that night."~{ See Richard Stallman, "RMS lecture at KTH (Sweden)," (October 30, 1986).<br> http://www.gnu.org/philosophy/stallman-kth.html }~
+
+The more Stallman hung out with the hackers, the more he adopted the hacker worldview. Already committed to the notion of personal liberty, Stallman began to infuse his actions with a sense of communal responsibility. When others violated the communal code, Stallman was quick to speak out. Within a year of his first visit, Stallman was the one breaking into locked offices, trying to recover the sequestered terminals that belonged to the lab community as a whole. In true hacker fashion, Stallman also sought to make his own personal contribution to the art of lock hacking. One of the most artful door-opening tricks, commonly attributed to Greenblatt, involved bending a stiff wire into a cane and attaching a loop of tape to the long end. Sliding the wire under the door, a hacker could twist and rotate the wire so that the long end touched the door knob. Provided the adhesive on the tape held, a hacker could open the doorknob with a few sharp twists.
+
+When Stallman tried the trick, he found it good but wanting in a few places. Getting the tape to stick wasn't always easy, and twisting the wire in a way that turned the doorknob was similarly difficult. Stallman remembered that the hallway ceiling possessed tiles that could be slid away. Some hackers, in fact, had used the false ceiling as a way to get around locked doors, an approach that generally covered the perpetrator in fiberglass but got the job done.
+
+Stallman considered an alternative approach. What if, instead of slipping a wire under the door, a hacker slid away one of the panels and stood over the door jamb?
+
+Stallman took it upon himself to try it out. Instead of using a wire, Stallman draped out a long U-shaped loop of magnetic tape, fastening a loop of adhesive tape at the base of the U. Standing over the door jamb, he dangled the tape until it looped under the doorknob. Lifting the tape until the adhesive fastened, he then pulled on the left end of the tape, twisting the doorknob counter-clockwise. Sure enough, the door opened. Stallman had added a new twist to the art of lock hacking.
+
+"Sometimes you had to kick the door after you turned the door knob," says Stallman, recalling the lingering bugginess of the new method. "It took a little bit of balance to pull it off."
+
+Such activities reflected a growing willingness on Stallman's part to speak and act out in defense of political beliefs. The AI Lab's spirit of direct action had proved inspirational enough for Stallman to break out of the timid impotence of his teenage years. Breaking into an office to free a terminal wasn't the same as taking part in a protest march, but it was effective in ways that most protests weren't. It solved the problem at hand.
+
+By the time of his last years at Harvard, Stallman was beginning to apply the whimsical and irreverent lessons of the AI Lab back at school.
+
+"Did he tell you about the snake?" his mother asks at one point during an interview. "He and his dorm mates put a snake up for student election. Apparently it got a considerable number of votes."
+
+Stallman verifies the snake candidacy with a few caveats. The snake was a candidate for election within Currier House, Stallman's dorm, not the campus-wide student council. Stallman does remember the snake attracting a fairly significant number of votes, thanks in large part to the fact that both the snake and its owner both shared the same last name. "People may have voted for it, because they thought they were voting for the owner," Stallman says. "Campaign posters said that the snake was `slithering for' the office. We also said it was an `at large' candidate, since it had climbed into the wall through the ventilating unit a few weeks before and nobody knew where it was."
+
+Running a snake for dorm council was just one of several election-related pranks. In a later election, Stallman and his dorm mates nominated the house master's son. "His platform was mandatory retirement at age seven," Stallman recalls. Such pranks paled in comparison to the fake-candidate pranks on the MIT campus, however. One of the most successful fake-candidate pranks was a cat named Woodstock, which actually managed to outdraw most of the human candidates in a campus-wide election. "They never announced how many votes Woodstock got, and they treated those votes as spoiled ballots," Stallman recalls. "But the large number of spoiled ballots in that election suggested that Woodstock had actually won. A couple of years later, Woodstock was suspiciously run over by a car. Nobody knows if the driver was working for the MIT administration." Stallman says he had nothing to do with Woodstock's candidacy, "but I admired it."~{ In an email shortly after this book went into its final edit cycle, Stallman says he drew political inspiration from the Harvard campus as well. "In my first year of Harvard, in a Chinese History class, I read the story of the first revolt against the Chin dynasty," he says. "The story is not reliable history, but it was very moving." }~
+
+At the AI Lab, Stallman's political activities had a sharper-edged tone. During the 1970s, hackers faced the constant challenge of faculty members and administrators pulling an end-run around ITS and its hacker-friendly design. One of the first attempts came in the mid-1970s, as more and more faculty members began calling for a file security system to protect research data. Most other computer labs had installed such systems during late 1960s, but the AI Lab, through the insistence of Stallman and other hackers, remained a security-free zone.
+
+For Stallman, the opposition to security was both ethical and practical. On the ethical side, Stallman pointed out that the entire art of hacking relied on intellectual openness and trust. On the practical side, he pointed to the internal structure of ITS being built to foster this spirit of openness, and any attempt to reverse that design required a major overhaul.
+
+"The hackers who wrote the Incompatible Timesharing System decided that file protection was usually used by a self-styled system manager to get power over everyone else," Stallman would later explain. "They didn't want anyone to be able to get power over them that way, so they didn't implement that kind of a feature. The result was, that whenever something in the system was broken, you could always fix it."~{ See Richard Stallman (1986). }~
+
+Through such vigilance, hackers managed to keep the AI Lab's machines security-free. Over at the nearby MIT Laboratory for Computer Sciences, however, security-minded faculty members won the day. The LCS installed its first password-based system in 1977. Once again, Stallman took it upon himself to correct what he saw as ethical laxity. Gaining access to the software code that controlled the password system, Stallman implanted a software command that sent out a message to any LCS user who attempted to choose a unique password. If a user entered "starfish," for example, the message came back something like:
+
+_1 I see you chose the password "starfish." I suggest that you switch to the password "carriage return." It's much easier to type, and also it stands up to the principle that there should be no passwords.~{ See Steven Levy, Hackers (Penguin USA [paperback], 1984): 417. I have modified this quote, which Levy also uses as an excerpt, to illustrate more directly how the program might reveal the false security of the system. Levy uses the placeholder "[such and such]." }~
+
+Users who did enter "carriage return"-that is, users who simply pressed the Enter or Return button, entering a blank string instead of a unique password-left their accounts accessible to the world at large. As scary as that might have been for some users, it reinforced the hacker notion that Institute computers, and even Institute computer files, belonged to the public, not private individuals. Stallman, speaking in an interview for the 1984 book Hackers, proudly noted that one-fifth of the LCS staff accepted this argument and employed the blank-string password.~{ See Steven Levy, Hackers (Penguin USA [paperback], 1984): 417. }~
+
+Stallman's null-string crusade would prove ultimately futile. By the early 1980s, even the AI Lab's machines were sporting password-based security systems. Even so, it represents a major milestone in terms of Stallman's personal and political maturation. To the objective observer familiar with Stallman's later career, it offers a convenient inflection point between the timid teenager afraid to speak out even on issues of life-threatening importance and the adult activist who would soon turn needling and cajoling into a full-time occupation.
+
+In voicing his opposition to computer security, Stallman drew on many of the forces that had shaped his early life: hunger for knowledge, distaste for authority, and frustration over hidden procedures and rules that rendered some people clueless outcasts. He would also draw on the ethical concepts that would shape his adult life: communal responsibility, trust, and the hacker spirit of direct action. Expressed in software-computing terms, the null string represents the 1.0 version of the Richard Stallman political worldview-incomplete in a few places but, for the most part, fully mature.
+
+Looking back, Stallman hesitates to impart too much significance to an event so early in his hacking career. "In that early stage there were a lot of people who shared my feelings," he says. "The large number of people who adopted the null string as their password was a sign that many people agreed that it was the proper thing to do. I was simply inclined to be an activist about it."
+
+Stallman does credit the AI Lab for awakening that activist spirit, however. As a teenager, Stallman had observed political events with little idea as to how a single individual could do or say anything of importance. As a young adult, Stallman was speaking out on matters in which he felt supremely confident, matters such as software design, communal responsibility, and individual freedom. "I joined this community which had a way of life which involved respecting each other's freedom," he says. "It didn't take me long to figure out that that was a good thing. It took me longer to come to the conclusion that this was a moral issue."
+
+Hacking at the AI Lab wasn't the only activity helping to boost Stallman's esteem. During the middle of his sophomore year at Harvard, Stallman had joined up with a dance troupe that specialized in folk dances . What began as a simple attempt to meet women and expand his social horizons soon expanded into yet another passion alongside hacking. Dancing in front of audiences dressed in the native garb of a Balkan peasant, Stallman no longer felt like the awkward, uncoordinated 10-year-old whose attempts to play football had ended in frustration. He felt confident, agile, and alive. For a brief moment, he even felt a hint of emotional connection. He soon found being in front of an audience fun, and it wasn't long thereafter that he began craving the performance side of dancing almost as much as the social side.
+
+Although the dancing and hacking did little to improve Stallman's social standing, they helped him overcome the feelings of weirdness that had clouded his pre-Harvard life. Instead of lamenting his weird nature, Stallman found ways to celebrate it. In 1977, while attending a science-fiction convention, he came across a woman selling custom-made buttons. Excited, Stallman ordered a button with the words "Impeach God" emblazoned on it.
+
+For Stallman, the "Impeach God" message worked on many levels. An atheist since early childhood, Stallman first saw it as an attempt to set a "second front" in the ongoing debate on religion. "Back then everybody was arguing about God being dead or alive," Stallman recalls. "`Impeach God' approached the subject of God from a completely different viewpoint. If God was so powerful as to create the world and yet do nothing to correct the problems in it, why would we ever want to worship such a God? Wouldn't it be better to put him on trial?"
+
+At the same time, "Impeach God" was a satirical take on America and the American political system. The Watergate scandal of the 1970s affected Stallman deeply. As a child, Stallman had grown up mistrusting authority. Now, as an adult, his mistrust had been solidified by the culture of the AI Lab hacker community. To the hackers, Watergate was merely a Shakespearean rendition of the daily power struggles that made life such a hassle for those without privilege. It was an outsized parable for what happened when people traded liberty and openness for security and convenience.
+
+Buoyed by growing confidence, Stallman wore the button proudly. People curious enough to ask him about it received the same well-prepared spiel. "My name is Jehovah," Stallman would say. "I have a special plan to save the universe, but because of heavenly security reasons I can't tell you what that plan is. You're just going to have to put your faith in me, because I see the picture and you don't. You know I'm good because I told you so. If you don't believe me, I'll throw you on my enemies list and throw you in a pit where Infernal Revenue Service will audit your taxes for eternity."
+
+Those who interpreted the spiel as a word-for-word parody of the Watergate hearings only got half the message. For Stallman, the other half of the message was something only his fellow hackers seemed to be hearing. One hundred years after Lord Acton warned about absolute power corrupting absolutely, Americans seemed to have forgotten the first part of Acton's truism: power, itself, corrupts. Rather than point out the numerous examples of petty corruption, Stallman felt content voicing his outrage toward an entire system that trusted power in the first place.
+
+"I figured why stop with the small fry," says Stallman, recalling the button and its message. "If we went after Nixon, why not going after Mr. Big. The way I see it, any being that has power and abuses it deserves to have that power taken away."
+
+1~ Chapter 5 - Small Puddle of Freedom
+
+Ask anyone who's spent more than a minute in Richard Stallman's presence, and you'll get the same recollection: forget the long hair. Forget the quirky demeanor. The first thing you notice is the gaze. One look into Stallman's green eyes, and you know you're in the presence of a true believer.
+
+To call the Stallman gaze intense is an understatement. Stallman's eyes don't just look at you; they look through you. Even when your own eyes momentarily shift away out of simple primate politeness, Stallman's eyes remain locked-in, sizzling away at the side of your head like twin photon beams.
+
+Maybe that's why most writers, when describing Stallman, tend to go for the religious angle. In a 1998 Salon.com article titled "The Saint of Free Software," Andrew Leonard describes Stallman's green eyes as "radiating the power of an Old Testament prophet."~{ See Andrew Leonard, "The Saint of Free Software," Salon.com (August 1998).<br> http://www.salon.com/21st/feature/1998/08/cov_31feature.html }~ A 1999 Wired magazine article describes the Stallman beard as "Rasputin-like,"~{ See Leander Kahney, "Linux's Forgotten Man," Wired News (March 5, 1999).<br> http://www.wired.com/news/print/0,1294,18291,00.html }~ while a London Guardian profile describes the Stallman smile as the smile of "a disciple seeing Jesus."~{ See "Programmer on moral high ground; Free software is a moral issue for Richard Stallman believes in freedom and free software." London Guardian (November 6, 1999).<br>These are just a small sampling of the religious comparisons. To date, the most extreme comparison has to go to Linus Torvalds, who, in his autobiography-see Linus Torvalds and David Diamond, Just For Fun: The Story of an Accidentaly Revolutionary (HarperCollins Publishers, Inc., 2001): 58-writes "Richard Stallman is the God of Free Software."<br>Honorable mention goes to Larry Lessig, who, in a footnote description of Stallman in his book-see Larry Lessig, The Future of Ideas (Random House, 2001): 270-likens Stallman to Moses:<br>_1 ... as with Moses, it was another leader, Linus Torvalds, who finally carried the movement into the promised land by facilitating the development of the final part of the OS puzzle. Like Moses, too, Stallman is both respected and reviled by allies within the movement. He is [an] unforgiving, and hence for many inspiring, leader of a critically important aspect of modern culture. I have deep respect for the principle and commitment of this extraordinary individual, though I also have great respect for those who are courageous enough to question his thinking and then sustain his wrath.<br>In a final interview with Stallman, I asked him his thoughts about the religious comparisons. "Some people do compare me with an Old Testament prophent, and the reason is Old Testament prophets said certain social practices were wrong. They wouldn't compromise on moral issues. They couldn't be bought off, and they were usually treated with contempt." }~
+
+Such analogies serve a purpose, but they ultimately fall short. That's because they fail to take into account the vulnerable side of the Stallman persona. Watch the Stallman gaze for an extended period of time, and you will begin to notice a subtle change. What appears at first to be an attempt to intimidate or hypnotize reveals itself upon second and third viewing as a frustrated attempt to build and maintain contact. If, as Stallman himself has suspected from time to time, his personality is the product of autism or Asperger Syndrome, his eyes certainly confirm the diagnosis. Even at their most high-beam level of intensity, they have a tendency to grow cloudy and distant, like the eyes of a wounded animal preparing to give up the ghost.
+
+My own first encounter with the legendary Stallman gaze dates back to the March, 1999, LinuxWorld Convention and Expo in San Jose, California. Billed as a "coming out party" for the Linux software community, the convention also stands out as the event that reintroduced Stallman to the technology media. Determined to push for his proper share of credit, Stallman used the event to instruct spectators and reporters alike on the history of the GNU Project and the project's overt political objectives.
+
+As a reporter sent to cover the event, I received my own Stallman tutorial during a press conference announcing the release of GNOME 1.0, a free software graphic user interface. Unwittingly, I push an entire bank of hot buttons when I throw out my very first question to Stallman himself: do you think GNOME's maturity will affect the commercial popularity of the Linux operating system?
+
+"I ask that you please stop calling the operating system Linux," Stallman responds, eyes immediately zeroing in on mine. "The Linux kernel is just a small part of the operating system. Many of the software programs that make up the operating system you call Linux were not developed by Linus Torvalds at all. They were created by GNU Project volunteers, putting in their own personal time so that users might have a free operating system like the one we have today. To not acknowledge the contribution of those programmers is both impolite and a misrepresentation of history. That's why I ask that when you refer to the operating system, please call it by its proper name, GNU/Linux."
+
+Taking the words down in my reporter's notebook, I notice an eerie silence in the crowded room. When I finally look up, I find Stallman's unblinking eyes waiting for me. Timidly, a second reporter throws out a question, making sure to use the term " GNU/Linux" instead of Linux. Miguel de Icaza, leader of the GNOME project, fields the question. It isn't until halfway through de Icaza's answer, however, that Stallman's eyes finally unlock from mine. As soon as they do, a mild shiver rolls down my back. When Stallman starts lecturing another reporter over a perceived error in diction, I feel a guilty tinge of relief. At least he isn't looking at me, I tell myself.
+
+For Stallman, such face-to-face moments would serve their purpose. By the end of the first LinuxWorld show, most reporters know better than to use the term "Linux" in his presence, and wired.com is running a story comparing Stallman to a pre-Stalinist revolutionary erased from the history books by hackers and entrepreneurs eager to downplay the GNU Project's overly political objectives. ^24^ Other articles follow, and while few reporters call the operating system GNU/Linux in print, most are quick to credit Stallman for launching the drive to build a free software operating system 15 years before.
+
+I won't meet Stallman again for another 17 months. During the interim, Stallman will revisit Silicon Valley once more for the August, 1999 LinuxWorld show. Although not invited to speak, Stallman does managed to deliver the event's best line. Accepting the show's Linus Torvalds Award for Community Service-an award named after Linux creator Linus Torvalds-on behalf of the Free Software Foundation, Stallman wisecracks, "Giving the Linus Torvalds Award to the Free Software Foundation is a bit like giving the Han Solo Award to the Rebel Alliance."
+
+This time around, however, the comments fail to make much of a media dent. Midway through the week, Red Hat, Inc., a prominent GNU/Linux vendor, goes public. The news merely confirms what many reporters such as myself already suspect: "Linux" has become a Wall Street buzzword, much like "e-commerce" and "dot-com" before it. With the stock market approaching the Y2K rollover like a hyperbola approaching its vertical asymptote, all talk of free software or open source as a political phenomenon falls by the wayside.
+
+Maybe that's why, when LinuxWorld follows up its first two shows with a third LinuxWorld show in August, 2000, Stallman is conspicuously absent.
+
+My second encounter with Stallman and his trademark gaze comes shortly after that third LinuxWorld show. Hearing that Stallman is going to be in Silicon Valley, I set up a lunch interview in Palo Alto, California. The meeting place seems ironic, not only because of the recent no-show but also because of the overall backdrop. Outside of Redmond, Washington, few cities offer a more direct testament to the economic value of proprietary software. Curious to see how Stallman, a man who has spent the better part of his life railing against our culture's predilection toward greed and selfishness, is coping in a city where even garage-sized bungalows run in the half-million-dollar price range, I make the drive down from Oakland.
+
+I follow the directions Stallman has given me, until I reach the headquarters of Art.net, a nonprofit "virtual artists collective." Located in a hedge-shrouded house in the northern corner of the city, the Art.net headquarters are refreshingly run-down. Suddenly, the idea of Stallman lurking in the heart of Silicon Valley doesn't seem so strange after all.
+
+I find Stallman sitting in a darkened room, tapping away on his gray laptop computer. He looks up as soon as I enter the room, giving me a full blast of his 200-watt gaze. When he offers a soothing "Hello," I offer a return greeting. Before the words come out, however, his eyes have already shifted back to the laptop screen.
+
+"I'm just finishing an article on the spirit of hacking," Stallman says, fingers still tapping. "Take a look."
+
+I take a look. The room is dimly lit, and the text appears as greenish-white letters on a black background, a reversal of the color scheme used by most desktop word-processing programs, so it takes my eyes a moment to adjust. When they do, I find myself reading Stallman's account of a recent meal at a Korean restaurant. Before the meal, Stallman makes an interesting discovery: the person setting the table has left six chopsticks instead of the usual two in front of Stallman's place setting. Where most restaurant goers would have ignored the redundant pairs, Stallman takes it as challenge: find a way to use all six chopsticks at once. Like many software hacks, the successful solution is both clever and silly at the same time. Hence Stallman's decision to use it as an illustration.
+
+As I read the story, I feel Stallman watching me intently. I look over to notice a proud but child-like half smile on his face. When I praise the essay, my comment barely merits a raised eyebrow.
+
+"I'll be ready to go in a moment," he says.
+
+Stallman goes back to tapping away at his laptop. The laptop is gray and boxy, not like the sleek, modern laptops that seemed to be a programmer favorite at the recent LinuxWorld show. Above the keyboard rides a smaller, lighter keyboard, a testament to Stallman's aging hands. During the late 1980s, when Stallman was putting in 70- and 80-hour work weeks writing the first free software tools and programs for the GNU Project, the pain in Stallman's hands became so unbearable that he had to hire a typist. Today, Stallman relies on a keyboard whose keys require less pressure than a typical computer keyboard.
+
+Stallman has a tendency to block out all external stimuli while working. Watching his eyes lock onto the screen and his fingers dance, one quickly gets the sense of two old friends locked in deep conversation.
+
+The session ends with a few loud keystrokes and the slow disassembly of the laptop.
+
+"Ready for lunch?" Stallman asks.
+
+We walk to my car. Pleading a sore ankle, Stallman limps along slowly. Stallman blames the injury on a tendon in his left foot. The injury is three years old and has gotten so bad that Stallman, a huge fan of folk dancing, has been forced to give up all dancing activities. "I love folk dancing inherently," Stallman laments. "Not being able to dance has been a tragedy for me."
+
+Stallman's body bears witness to the tragedy. Lack of exercise has left Stallman with swollen cheeks and a pot belly that was much less visible the year before. You can tell the weight gain has been dramatic, because when Stallman walks, he arches his back like a pregnant woman trying to accommodate an unfamiliar load.
+
+The walk is further slowed by Stallman's willingness to stop and smell the roses, literally. Spotting a particularly beautiful blossom, he tickles the innermost petals with his prodigious nose, takes a deep sniff and steps back with a contented sigh.
+
+"Mmm, rhinophytophilia,"~{ At the time, I thought Stallman was referring to the flower's scientific name. Months later, I would learn that rhinophytophilia was in fact a humorous reference to the activity, i.e., Stallman sticking his nose into a flower and enjoying the moment. For another humorous Stallman flower incident, visit:<br> http://www.stallman.org/texas.html }~ he says, rubbing his back.
+
+The drive to the restaurant takes less than three minutes. Upon recommendation from Tim Ney, former executive director of the Free Software Foundation, I have let Stallman choose the restaurant. While some reporters zero in on Stallman's monk-like lifestyle, the truth is, Stallman is a committed epicure when it comes to food. One of the fringe benefits of being a traveling missionary for the free software cause is the ability to sample delicious food from around the world. "Visit almost any major city in the world, and chances are Richard knows the best restaurant in town," says Ney. "Richard also takes great pride in knowing what's on the menu and ordering for the entire table."
+
+For today's meal, Stallman has chosen a Cantonese-style dim sum restaurant two blocks off University Avenue, Palo Alto's main drag. The choice is partially inspired by Stallman's recent visit to China, including a lecture stop in Guangdong province, in addition to Stallman's personal aversion to spicier Hunanese and Szechuan cuisine. "I'm not a big fan of spicy," Stallman admits.
+
+We arrive a few minutes after 11 a.m. and find ourselves already subject to a 20-minute wait. Given the hacker aversion to lost time, I hold my breath momentarily, fearing an outburst. Stallman, contrary to expectations, takes the news in stride.
+
+"It's too bad we couldn't have found somebody else to join us," he tells me. "It's always more fun to eat with a group of people."
+
+During the wait, Stallman practices a few dance steps. His moves are tentative but skilled. We discuss current events. Stallman says his only regret about not attending LinuxWorld was missing out on a press conference announcing the launch of the GNOME Foundation. Backed by Sun Microsystems and IBM, the foundation is in many ways a vindication for Stallman, who has long championed that free software and free-market economics need not be mutually exclusive. Nevertheless, Stallman remains dissatisfied by the message that came out.
+
+"The way it was presented, the companies were talking about Linux with no mention of the GNU Project at all," Stallman says.
+
+Such disappointments merely contrast the warm response coming from overseas, especially Asia, Stallman notes. A quick glance at the Stallman 2000 travel itinerary bespeaks the growing popularity of the free software message. Between recent visits to India, China, and Brazil, Stallman has spent 12 of the last 115 days on United States soil. His travels have given him an opportunity to see how the free software concept translates into different languages of cultures.
+
+"In India many people are interested in free software, because they see it as a way to build their computing infrastructure without spending a lot of money," Stallman says. "In China, the concept has been much slower to catch on. Comparing free software to free speech is harder to do when you don't have any free speech. Still, the level of interest in free software during my last visit was profound."
+
+The conversation shifts to Napster, the San Mateo, California software company, which has become something of a media cause cÈlËbre in recent months. The company markets a controversial software tool that lets music fans browse and copy the music files of other music fans. Thanks to the magnifying powers of the Internet, this so-called "peer-to-peer" program has evolved into a de facto online juke box, giving ordinary music fans a way to listen to MP3 music files over the computer without paying a royalty or fee, much to record companies' chagrin.
+
+Although based on proprietary software, the Napster system draws inspiration from the long-held Stallman contention that once a work enters the digital realm-in other words, once making a copy is less a matter of duplicating sounds or duplicating atoms and more a matter of duplicating information-the natural human impulse to share a work becomes harder to restrict. Rather than impose additional restrictions, Napster execs have decided to take advantage of the impulse. Giving music listeners a central place to trade music files, the company has gambled on its ability to steer the resulting user traffic toward other commercial opportunities.
+
+The sudden success of the Napster model has put the fear in traditional record companies, with good reason. Just days before my Palo Alto meeting with Stallman, U.S. District Court Judge Marilyn Patel granted a request filed by the Recording Industry Association of America for an injunction against the file-sharing service. The injunction was subsequently suspended by the U.S. Ninth District Court of Appeals, but by early 2001, the Court of Appeals, too, would find the San Mateo-based company in breach of copyright law,~{ See Cecily Barnes and Scott Ard, "Court Grants Stay of Napster Injunction," News.com (July 28, 2000).<br> http://news.cnet.com/news/0-1005-200-2376465.html }~ a decision RIAA spokesperson Hillary Rosen would later proclaim proclaim a "clear victory for the creative content community and the legitimate online marketplace."~{ See "A Clear Victory for Recording Industry in Napster Case," RIAA press release (February 12, 2001).<br> http://www.riaa.com/PR_story.cfm?id=372 }~
+
+For hackers such as Stallman, the Napster business model is scary in different ways. The company's eagerness to appropriate time-worn hacker principles such as file sharing and communal information ownership, while at the same time selling a service based on proprietary software, sends a distressing mixed message. As a person who already has a hard enough time getting his own carefully articulated message into the media stream, Stallman is understandably reticent when it comes to speaking out about the company. Still, Stallman does admit to learning a thing or two from the social side of the Napster phenomenon.
+
+"Before Napster, I thought it might be OK for people to privately redistribute works of entertainment," Stallman says. "The number of people who find Napster useful, however, tells me that the right to redistribute copies not only on a neighbor-to-neighbor basis, but to the public at large, is essential and therefore may not be taken away."
+
+No sooner does Stallman say this than the door to the restaurant swings open and we are invited back inside by the host. Within a few seconds, we are seated in a side corner of the restaurant next to a large mirrored wall.
+
+The restaurant's menu doubles as an order form, and Stallman is quickly checking off boxes before the host has even brought water to the table. "Deep-fried shrimp roll wrapped in bean-curd skin," Stallman reads. "Bean-curd skin. It offers such an interesting texture. I think we should get it."
+
+This comment leads to an impromptu discussion of Chinese food and Stallman's recent visit to China. "The food in China is utterly exquisite," Stallman says, his voice gaining an edge of emotion for the first time this morning. "So many different things that I've never seen in the U.S., local things made from local mushrooms and local vegetables. It got to the point where I started keeping a journal just to keep track of every wonderful meal."
+
+The conversation segues into a discussion of Korean cuisine. During the same June, 2000, Asian tour, Stallman paid a visit to South Korea. His arrival ignited a mini-firestorm in the local media thanks to a Korean software conference attended by Microsoft founder and chairman Bill Gates that same week. Next to getting his photo above Gates's photo on the front page of the top Seoul newspaper, Stallman says the best thing about the trip was the food. "I had a bowl of naeng myun, which is cold noodles," says Stallman. "These were a very interesting feeling noodle. Most places don't use quite the same kind of noodles for your naeng myun, so I can say with complete certainty that this was the most exquisite naeng myun I ever had."
+
+The term "exquisite" is high praise coming from Stallman. I know this, because a few moments after listening to Stallman rhapsodize about naeng myun, I feel his laser-beam eyes singeing the top of my right shoulder.
+
+"There is the most exquisite woman sitting just behind you," Stallman says.
+
+I turn to look, catching a glimpse of a woman's back. The woman is young, somewhere in her mid-20s, and is wearing a white sequinned dress. She and her male lunch companion are in the final stages of paying the check. When both get up from the table to leave the restaurant, I can tell without looking, because Stallman's eyes suddenly dim in intensity.
+
+"Oh, no," he says. "They're gone. And to think, I'll probably never even get to see her again."
+
+After a brief sigh, Stallman recovers. The moment gives me a chance to discuss Stallman's reputation vis-ý-vis the fairer sex. The reputation is a bit contradictory at times. A number of hackers report Stallman's predilection for greeting females with a kiss on the back of the hand.~{ See Mae Ling Mak, "Mae Ling's Story" (December 17, 1998).<br> http://www.crackmonkey.org/pipermail/crackmonkey/1998q4/003006.htm <br>So far, Mak is the only person I've found willing to speak on the record in regard to this practice, although I've heard this from a few other female sources. Mak, despite expressing initial revulsion at it, later managed to put aside her misgivings and dance with Stallman at a 1999 LinuxWorld show.<br> http://www.linux.com/interact/potd.phtml?potd_id=44 }~ A May 26, 2000 Salon.com article, meanwhile, portrays Stallman as a bit of a hacker lothario. Documenting the free software-free love connection, reporter Annalee Newitz presents Stallman as rejecting traditional family values, telling her, "I believe in love, but not monogamy."~{ See Annalee Newitz, "If Code is Free Why Not Me?" Salon.com (May 26, 2000).<br> http://www.salon.com/tech/feature/2000/05/26/free_love/print.html }~
+
+Stallman lets his menu drop a little when I bring this up. "Well, most men seem to want sex and seem to have a rather contemptuous attitude towards women," he says. "Even women they're involved with. I can't understand it at all."
+
+I mention a passage from the 1999 book Open Sources in which Stallman confesses to wanting to name the ill-fated GNU kernel after a girlfriend at the time. The girlfriend's name was Alix, a name that fit perfectly with the Unix developer convention of putting an "x" at the end of any new kernel name-e.g., "Linux." Because the woman was a Unix system administrator, Stallman says it would have been an even more touching tribute. Unfortunately, Stallman notes, the kernel project's eventual main developer renamed the kernel HURD.~{ See Richard Stallman, "The GNU Operating System and the Free Software Movement," Open Sources (O'Reilly & Associates, Inc., 1999): 65. }~ Although Stallman and the girlfriend later broke up, the story triggers an automatic question: for all the media imagery depicting him as a wild-eyed fanatic, is Richard Stallman really just a hopeless romantic, a wandering Quixote tilting at corporate windmills in an effort to impress some as-yet-unidentified Dulcinea?
+
+"I wasn't really trying to be romantic," Stallman says, recalling the Alix story. "It was more of a teasing thing. I mean, it was romantic, but it was also teasing, you know? It would have been a delightful surprise."
+
+For the first time all morning, Stallman smiles. I bring up the hand kissing. "Yes, I do do that," Stallman says. "I've found it's a way of offering some affection that a lot of women will enjoy. It's a chance to give some affection and to be appreciated for it."
+
+Affection is a thread that runs clear through Richard Stallman's life, and he is painfully candid about it when questions arise. "There really hasn't been much affection in my life, except in my mind," he says. Still, the discussion quickly grows awkward. After a few one-word replies, Stallman finally lifts up his menu, cutting off the inquiry.
+
+"Would you like some shimai?" he asks.
+
+When the food comes out, the conversation slaloms between the arriving courses. We discuss the oft-noted hacker affection for Chinese food, the weekly dinner runs into Boston's Chinatown district during Stallman's days as a staff programmer at the AI Lab, and the underlying logic of the Chinese language and its associated writing system. Each thrust on my part elicits a well-informed parry on Stallman's part.
+
+"I heard some people speaking Shanghainese the last time I was in China," Stallman says. "It was interesting to hear. It sounded quite different [from Mandarin]. I had them tell me some cognate words in Mandarin and Shanghainese. In some cases you can see the resemblance, but one question I was wondering about was whether tones would be similar. They're not. That's interesting to me, because there's a theory that the tones evolved from additional syllables that got lost and replaced. Their effect survives in the tone. If that's true, and I've seen claims that that happened within historic times, the dialects must have diverged before the loss of these final syllables."
+
+The first dish, a plate of pan-fried turnip cakes, has arrived. Both Stallman and I take a moment to carve up the large rectangular cakes, which smell like boiled cabbage but taste like potato latkes fried in bacon.
+
+I decide to bring up the outcast issue again, wondering if Stallman's teenage years conditioned him to take unpopular stands, most notably his uphill battle since 1994 to get computer users and the media to replace the popular term "Linux" with "GNU/Linux."
+
+"I believe it did help me," Stallman says, chewing on a dumpling. "I have never understood what peer pressure does to other people. I think the reason is that I was so hopelessly rejected that for me, there wasn't anything to gain by trying to follow any of the fads. It wouldn't have made any difference. I'd still be just as rejected, so I didn't try."
+
+Stallman points to his taste in music as a key example of his contrarian tendencies. As a teenager, when most of his high school classmates were listening to Motown and acid rock, Stallman preferred classical music. The memory leads to a rare humorous episode from Stallman's middle-school years. Following the Beatles' 1964 appearance on the Ed Sullivan Show, most of Stallman's classmates rushed out to purchase the latest Beatles albums and singles. Right then and there, Stallman says, he made a decision to boycott the Fab Four.
+
+"I liked some of the pre-Beatles popular music," Stallman says. "But I didn't like the Beatles. I especially disliked the wild way people reacted to them. It was like: who was going to have a Beatles assembly to adulate the Beatles the most?"
+
+When his Beatles boycott failed to take hold, Stallman looked for other ways to point out the herd-mentality of his peers. Stallman says he briefly considered putting together a rock band himself dedicated to satirizing the Liverpool group.
+
+"I wanted to call it Tokyo Rose and the Japanese Beetles."
+
+Given his current love for international folk music, I ask Stallman if he had a similar affinity for Bob Dylan and the other folk musicians of the early 1960s. Stallman shakes his head. "I did like Peter, Paul and Mary," he says. "That reminds me of a great filk."
+
+When I ask for a definition of "filk," Stallman explains the concept. A filk, he says, is a popular song whose lyrics have been replaced with parody lyrics. The process of writing a filk is called filking, and it is a popular activity among hackers and science-fiction aficionados. Classic filks include "On Top of Spaghetti," a rewrite of "On Top of Old Smokey," and "Yoda," filk-master "Weird" Al Yankovic's Star Wars-oriented rendition of the Kinks tune, "Lola."
+
+Stallman asks me if I would be interested in hearing the folk filk. As soon as I say yes, Stallman's voice begins singing in an unexpectedly clear tone:
+
+_1 How much wood could a woodchuck chuck,If a woodchuck could chuck wood? How many poles could a polak lock,If a polak could lock poles? How many knees could a negro grow, If a negro could grow knees? The answer, my dear, is stick it in your ear.The answer is to stick it in your ear.
+
+The singing ends, and Stallman's lips curl into another child-like half smile. I glance around at the nearby tables. The Asian families enjoying their Sunday lunch pay little attention to the bearded alto in their midst.~{ For more Stallman filks, visit<br> http://www.stallman.org/doggerel.html. To hear Stallman singing "The Free Software Song," visit<br> http://www.gnu.org/music/free-software-song.html. }~ After a few moments of hesitation, I finally smile too.
+
+"Do you want that last cornball?" Stallman asks, eyes twinkling. Before I can screw up the punch line, Stallman grabs the corn-encrusted dumpling with his two chopsticks and lifts it proudly. "Maybe I'm the one who should get the cornball," he says.
+
+The food gone, our conversation assumes the dynamics of a normal interview. Stallman reclines in his chair and cradles a cup of tea in his hands. We resume talking about Napster and its relation to the free software movement. Should the principles of free software be extended to similar arenas such as music publishing? I ask.
+
+"It's a mistake to transfer answers from one thing to another," says Stallman, contrasting songs with software programs. "The right approach is to look at each type of work and see what conclusion you get."
+
+When it comes to copyrighted works, Stallman says he divides the world into three categories. The first category involves "functional" works-e.g., software programs, dictionaries, and textbooks. The second category involves works that might best be described as "testimonial"-e.g., scientific papers and historical documents. Such works serve a purpose that would be undermined if subsequent readers or authors were free to modify the work at will. The final category involves works of personal expression-e.g., diaries, journals, and autobiographies. To modify such documents would be to alter a person's recollections or point of view-action Stallman considers ethically unjustifiable.
+
+Of the three categories, the first should give users the unlimited right to make modified versions, while the second and third should regulate that right according to the will of the original author. Regardless of category, however, the freedom to copy and redistribute noncommercially should remain unabridged at all times, Stallman insists. If that means giving Internet users the right to generate a hundred copies of an article, image, song, or book and then email the copies to a hundred strangers, so be it. "It's clear that private occasional redistribution must be permitted, because only a police state can stop that," Stallman says. "It's antisocial to come between people and their friends. Napster has convinced me that we also need to permit, must permit, even noncommercial redistribution to the public for the fun of it. Because so many people want to do that and find it so useful."
+
+When I ask whether the courts would accept such a permissive outlook, Stallman cuts me off.
+
+"That's the wrong question," he says. "I mean now you've changed the subject entirely from one of ethics to one of interpreting laws. And those are two totally different questions in the same field. It's useless to jump from one to the other. How the courts would interpret the existing laws is mainly in a harsh way, because that's the way these laws have been bought by publishers."
+
+The comment provides an insight into Stallman's political philosophy: just because the legal system currently backs up businesses' ability to treat copyright as the software equivalent of land title doesn't mean computer users have to play the game according to those rules. Freedom is an ethical issue, not a legal issue. "I'm looking beyond what the existing laws are to what they should be," Stallman says. "I'm not trying to draft legislation. I'm thinking about what should the law do? I consider the law prohibiting the sharing of copies with your friend the moral equivalent of Jim Crow. It does not deserve respect."
+
+The invocation of Jim Crow prompts another question. How much influence or inspiration does Stallman draw from past political leaders? Like the civil-rights movement of the 1950s and 1960s, his attempt to drive social change is based on an appeal to timeless values: freedom, justice, and fair play.
+
+Stallman divides his attention between my analogy and a particularly tangled strand of hair. When I stretch the analogy to the point where I'm comparing Stallman with Dr. Martin Luther King, Jr., Stallman, after breaking off a split end and popping it into his mouth, cuts me off.
+
+"I'm not in his league, but I do play the same game," he says, chewing.
+
+I suggest Malcolm X as another point of comparison. Like the former Nation of Islam spokesperson, Stallman has built up a reputation for courting controversy, alienating potential allies, and preaching a message favoring self-sufficiency over cultural integration.
+
+Chewing on another split end, Stallman rejects the comparison. "My message is closer to King's message," he says. "It's a universal message. It's a message of firm condemnation of certain practices that mistreat others. It's not a message of hatred for anyone. And it's not aimed at a narrow group of people. I invite anyone to value freedom and to have freedom."
+
+Even so, a suspicious attitude toward political alliances remains a fundamental Stallman character trait. In the case of his well-publicized distaste for the term "open source," the unwillingness to participate in recent coalition-building projects seems understandable. As a man who has spent the last two decades stumping on the behalf of free software, Stallman's political capital is deeply invested in the term. Still, comments such as the "Han Solo" wisecrack at the 1999 LinuxWorld have only reinforced the Stallman's reputation in the software industry as a disgrunted mossback unwilling to roll with political or marketing trends.
+
+"I admire and respect Richard for all the work he's done," says Red Hat president Robert Young, summing up Stallman's paradoxical political nature. "My only critique is that sometimes Richard treats his friends worse than his enemies."
+
+Stallman's unwillingness to seek alliances seems equally perplexing when you consider his political interests outside of the free software movement. Visit Stallman's offices at MIT, and you instantly find a clearinghouse of left-leaning news articles covering civil-rights abuses around the globe. Visit his web site, and you'll find diatribes on the Digital Millennium Copyright Act, the War on Drugs, and the World Trade Organization.
+
+Given his activist tendencies, I ask, why hasn't Stallman sought a larger voice? Why hasn't he used his visibility in the hacker world as a platform to boost rather than reduce his political voice.
+
+Stallman lets his tangled hair drop and contemplates the question for a moment.
+
+"I hesitate to exaggerate the importance of this little puddle of freedom," he says. "Because the more well-known and conventional areas of working for freedom and a better society are tremendously important. I wouldn't say that free software is as important as they are. It's the responsibility I undertook, because it dropped in my lap and I saw a way I could do something about it. But, for example, to end police brutality, to end the war on drugs, to end the kinds of racism we still have, to help everyone have a comfortable life, to protect the rights of people who do abortions, to protect us from theocracy, these are tremendously important issues, far more important than what I do. I just wish I knew how to do something about them."
+
+Once again, Stallman presents his political activity as a function of personal confidence. Given the amount of time it has taken him to develop and hone the free software movement's core tenets, Stallman is hesitant to jump aboard any issues or trends that might transport him into uncharted territory.
+
+"I wish I knew I how to make a major difference on those bigger issues, because I would be tremendously proud if I could, but they're very hard and lots of people who are probably better than I am have been working on them and have gotten only so far," he says. "But as I see it, while other people were defending against these big visible threats, I saw another threat that was unguarded. And so I went to defend against that threat. It may not be as big a threat, but I was the only one there."
+
+Chewing a final split end, Stallman suggests paying the check. Before the waiter can take it away, however, Stallman pulls out a white-colored dollar bill and throws it on the pile. The bill looks so clearly counterfeit, I can't help but pick it up and read it. Sure enough, it is counterfeit. Instead of bearing the image of a George Washington or Abe Lincoln, the bill's front side bears the image of a cartoon pig. Instead of the United States of America, the banner above the pig reads "United Swines of Avarice." The bill is for zero dollars, and when the waiter picks up the money, Stallman makes sure to tug on his sleeve.
+
+"I added an extra zero to your tip," Stallman says, yet another half smile creeping across his lips.
+
+The waiter, uncomprehending or fooled by the look of the bill, smiles and scurries away.
+
+"I think that means we're free to go," Stallman says.
+
+1~ Chapter 6 - The Emacs Commune
+
+The AI Lab of the 1970s was by all accounts a special place. Cutting-edge projects and top-flight researchers gave it an esteemed position in the world of computer science. The internal hacker culture and its anarchic policies lent a rebellious mystique as well. Only later, when many of the lab's scientists and software superstars had departed, would hackers fully realize the unique and ephemeral world they had once inhabited.
+
+"It was a bit like the Garden of Eden," says Stallman, summing up the lab and its software-sharing ethos in a 1998 Forbes article. "It hadn't occurred to us not to cooperate."~{ See Josh McHugh, "For the Love of Hacking," Forbes (August 10, 1998).<br> http://www.forbes.com/forbes/1998/0810/6203094a.html }~
+
+Such mythological descriptions, while extreme, underline an important fact. The ninth floor of 545 Tech Square was more than a workplace for many. For hackers such as Stallman, it was home.
+
+The word "home" is a weighted term in the Stallman lexicon. In a pointed swipe at his parents, Stallman, to this day, refuses to acknowledge any home before Currier House, the dorm he lived in during his days at Harvard. He has also been known to describe leaving that home in tragicomic terms. Once, while describing his years at Harvard, Stallman said his only regret was getting kicked out. It wasn't until I asked Stallman what precipitated his ouster, that I realized I had walked into a classic Stallman setup line.
+
+"At Harvard they have this policy where if you pass too many classes they ask you to leave," Stallman says.
+
+With no dorm and no desire to return to New York, Stallman followed a path blazed by Greenblatt, Gosper, Sussman, and the many other hackers before him. Enrolling at MIT as a grad student, Stallman rented an apartment in nearby Cambridge but soon viewed the AI Lab itself as his de facto home. In a 1986 speech, Stallman recalled his memories of the AI Lab during this period:
+
+_1 I may have done a little bit more living at the lab than most people, because every year or two for some reason or other I'd have no apartment and I would spend a few months living at the lab. And I've always found it very comfortable, as well as nice and cool in the summer. But it was not at all uncommon to find people falling asleep at the lab, again because of their enthusiasm; you stay up as long as you possibly can hacking, because you just don't want to stop. And then when you're completely exhausted, you climb over to the nearest soft horizontal surface. A very informal atmosphere.~{ See Stallman (1986). }~
+
+The lab's home-like atmosphere could be a problem at times. What some saw as a dorm, others viewed as an electronic opium den. In the 1976 book Computer Power and Human Reason, MIT researcher Joseph Weizenbaum offered a withering critique of the " computer bum," Weizenbaum's term for the hackers who populated computer rooms such as the AI Lab. "Their rumpled clothes, their unwashed hair and unshaved faces, and their uncombed hair all testify that they are oblivious to their bodies and to the world in which they move," Weizenbaum wrote. "[Computer bums] exist, at least when so engaged, only through and for the computers."~{ See Joseph Weizenbaum, Computer Power and Human Reason: From Judgment to Calculation (W. H. Freeman, 1976): 116. }~
+
+Almost a quarter century after its publication, Stallman still bristles when hearing Weizenbaum's "computer bum" description, discussing it in the present tense as if Weizenbaum himself was still in the room. "He wants people to be just professionals, doing it for the money and wanting to get away from it and forget about it as soon as possible," Stallman says. "What he sees as a normal state of affairs, I see as a tragedy."
+
+Hacker life, however, was not without tragedy. Stallman characterizes his transition from weekend hacker to full-time AI Lab denizen as a series of painful misfortunes that could only be eased through the euphoria of hacking. As Stallman himself has said, the first misfortune was his graduation from Harvard. Eager to continue his studies in physics, Stallman enrolled as a graduate student at MIT. The choice of schools was a natural one. Not only did it give Stallman the chance to follow the footsteps of great MIT alumni: William Shockley ('36), Richard P. Feynman ('39), and Murray Gell-Mann ('51), it also put him two miles closer to the AI Lab and its new PDP-10 computer. "My attention was going toward programming, but I still thought, well, maybe I can do both," Stallman says.
+
+Toiling in the fields of graduate-level science by day and programming in the monastic confines of the AI Lab by night, Stallman tried to achieve a perfect balance. The fulcrum of this geek teeter-totter was his weekly outing with the folk-dance troupe, his one social outlet that guaranteed at least a modicum of interaction with the opposite sex. Near the end of that first year at MIT, however, disaster struck. A knee injury forced Stallman to drop out of the troupe. At first, Stallman viewed the injury as a temporary problem, devoting the spare time he would have spent dancing to working at the AI Lab even more. By the end of the summer, when the knee still ached and classes reconvened, Stallman began to worry. "My knee wasn't getting any better," Stallman recalls, "which meant I had to stop dancing completely. I was heartbroken."
+
+With no dorm and no dancing, Stallman's social universe imploded. Like an astronaut experiencing the aftereffects of zero-gravity, Stallman found that his ability to interact with nonhackers, especially female nonhackers, had atrophied significantly. After 16 weeks in the AI Lab, the self confidence he'd been quietly accumulating during his 4 years at Harvard was virtually gone.
+
+"I felt basically that I'd lost all my energy," Stallman recalls. "I'd lost my energy to do anything but what was most immediately tempting. The energy to do something else was gone. I was in total despair."
+
+Stallman retreated from the world even further, focusing entirely on his work at the AI Lab. By October, 1975, he dropped out of MIT, never to go back. Software hacking, once a hobby, had become his calling.
+
+Looking back on that period, Stallman sees the transition from full-time student to full-time hacker as inevitable. Sooner or later, he believes, the siren's call of computer hacking would have overpowered his interest in other professional pursuits. "With physics and math, I could never figure out a way to contribute," says Stallman, recalling his struggles prior to the knee injury. "I would have been proud to advance either one of those fields, but I could never see a way to do that. I didn't know where to start. With software, I saw right away how to write things that would run and be useful. The pleasure of that knowledge led me to want to do it more."
+
+Stallman wasn't the first to equate hacking with pleasure. Many of the hackers who staffed the AI Lab boasted similar, incomplete academic rÈsumÈs. Most had come in pursuing degrees in math or electrical engineering only to surrender their academic careers and professional ambitions to the sheer exhilaration that came with solving problems never before addressed. Like St. Thomas Aquinas, the scholastic known for working so long on his theological summae that he sometimes achieved spiritual visions, hackers reached transcendent internal states through sheer mental focus and physical exhaustion. Although Stallman shunned drugs, like most hackers, he enjoyed the "high" that came near the end of a 20-hour coding bender.
+
+Perhaps the most enjoyable emotion, however, was the sense of personal fulfillment. When it came to hacking, Stallman was a natural. A childhood's worth of late-night study sessions gave him the ability to work long hours with little sleep. As a social outcast since age 10, he had little difficulty working alone. And as a mathematician with built-in gift for logic and foresight, Stallman possessed the ability to circumvent design barriers that left most hackers spinning their wheels.
+
+"He was special," recalls Gerald Sussman, an MIT faculty member and former AI Lab researcher. Describing Stallman as a "clear thinker and a clear designer," Sussman employed Stallman as a research-project assistant beginning in 1975. The project was complex, involving the creation of an AI program that could analyze circuit diagrams. Not only did it involve an expert's command of Lisp, a programming language built specifically for AI applications, but it also required an understanding of how a human might approach the same task.
+
+When he wasn't working on official projects such as Sussman's automated circuit-analysis program, Stallman devoted his time to pet projects. It was in a hacker's best interest to improve the lab's software infrastructure, and one of Stallman's biggest pet projects during this period was the lab's editor program TECO.
+
+The story of Stallman's work on TECO during the 1970s is inextricably linked with Stallman's later leadership of the free software movement. It is also a significant stage in the history of computer evolution, so much so that a brief recapitulation of that evolution is necessary. During the 1950s and 1960s, when computers were first appearing at universities, computer programming was an incredibly abstract pursuit. To communicate with the machine, programmers created a series of punch cards, with each card representing an individual software command. Programmers would then hand the cards over to a central system administrator who would then insert them, one by one, into the machine, waiting for the machine to spit out a new set of punch cards, which the programmer would then decipher as output. This process, known as " batch processing," was cumbersome and time consuming. It was also prone to abuses of authority. One of the motivating factors behind hackers' inbred aversion to centralization was the power held by early system operators in dictating which jobs held top priority.
+
+In 1962, computer scientists and hackers involved in MIT's Project MAC, an early forerunner of the AI Lab, took steps to alleviate this frustration. Time-sharing, originally known as "time stealing," made it possible for multiple programs to take advantage of a machine's operational capabilities. Teletype interfaces also made it possible to communicate with a machine not through a series of punched holes but through actual text. A programmer typed in commands and read the line-by-line output generated by the machine.
+
+During the late 1960s, interface design made additional leaps. In a famous 1968 lecture, Doug Engelbart, a scientist then working at the Stanford Research Institute, unveiled a prototype of the modern graphical interface. Rigging up a television set to the computer and adding a pointer device which Engelbart dubbed a " mouse," the scientist created a system even more interactive than the time-sharing system developed a MIT. Treating the video display like a high-speed printer, Engelbart's system gave a user the ability to move the cursor around the screen and see the cursor position updated by the computer in real time. The user suddenly had the ability to position text anywhere on the screen.
+
+Such innovations would take another two decades to make their way into the commercial marketplace. Still, by the 1970s, video screens had started to replace teletypes as display terminals, creating the potential for full-screen-as opposed to line-by-line-editing capabilities.
+
+One of the first programs to take advantage of this full-screen capability was the MIT AI Lab's TECO. Short for Text Editor and COrrector, the program had been upgraded by hackers from an old teletype line editor for the lab's PDP-6 machine.~{ According to the Jargon File, TECO's name originally stood for Tape Editor and Corrector.<br> http://www.tuxedo.org/~esr/jargon/html/entry/TECO.html }~
+
+TECO was a substantial improvement over old editors, but it still had its drawbacks. To create and edit a document, a programmer had to enter a series of software commands specifying each edit. It was an abstract process. Unlike modern word processors, which update text with each keystroke, TECO demanded that the user enter an extended series of editing instructions followed by an "end of command" sequence just to change the text.Over time, a hacker grew proficient enough to write entire documents in edit mode, but as Stallman himself would later point out, the process required "a mental skill like that of blindfold chess."~{ See Richard Stallman, "EMACS: The Extensible, Customizable, Display Editor," AI Lab Memo (1979). An updated HTML version of this memo, from which I am quoting, is available at<br> http://www.gnu.org/software/emacs/emacs-paper.html }~
+
+To facilitate the process, AI Lab hackers had built a system that displayed both the "source" and "display" modes on a split screen. Despite this innovative hack, switching from mode to mode was still a nuisance.
+
+TECO wasn't the only full-screen editor floating around the computer world at this time. During a visit to the Stanford Artificial Intelligence Lab in 1976, Stallman encountered an edit program named E. The program contained an internal feature, which allowed a user to update display text after each command keystroke. In the language of 1970s programming, E was one of the first rudimentary WYSIWYG editors. Short for "what you see is what you get," WYSIWYG meant that a user could manipulate the file by moving through the displayed text, as opposed to working through a back-end editor program."~{ See Richard Stallman, "Emacs the Full Screen Editor" (1987).<br> http://www.lysator.liu.se/history/garb/txt/87-1-emacs.txt }~
+
+Impressed by the hack, Stallman looked for ways to expand TECO's functionality in similar fashion upon his return to MIT. He found a TECO feature called Control-R, written by Carl Mikkelson and named after the two-key combination that triggered it. Mikkelson's hack switched TECO from its usual abstract command-execution mode to a more intuitive keystroke-by-keystroke mode. Stallman revised the feature in a subtle but significant way. He made it possible to trigger other TECO command strings, or " macros," using other, two-key combinations. Where users had once entered command strings and discarded them after entering then, Stallman's hack made it possible to save macro tricks on file and call them up at will. Mikkelson's hack had raised TECO to the level of a WYSIWYG editor. Stallman's hack had raised it to the level of a user-programmable WYSIWYG editor. "That was the real breakthrough," says Guy Steele, a fellow AI Lab hacker at the time. ^39^
+
+By Stallman's own recollection, the macro hack touched off an explosion of further innovation. "Everybody and his brother was writing his own collection of redefined screen-editor commands, a command for everything he typically liked to do," Stallman would later recall. "People would pass them around and improve them, making them more powerful and more general. The collections of redefinitions gradually became system programs in their own right." ^39^
+
+So many people found the macro innovations useful and had incorporated it into their own TECO programs that the TECO editor had become secondary to the macro mania it inspired. "We started to categorize it mentally as a programming language rather than as an editor," Stallman says. Users were experiencing their own pleasure tweaking the software and trading new ideas. ^39^
+
+Two years after the explosion, the rate of innovation began to exhibit dangerous side effects. The explosive growth had provided an exciting validation of the collaborative hacker approach, but it had also led to over-complexity. "We had a Tower of Babel effect," says Guy Steele.
+
+The effect threatened to kill the spirit that had created it, Steele says. Hackers had designed ITS to facilitate programmers' ability to share knowledge and improve each other's work. That meant being able to sit down at another programmer's desk, open up a programmer's work and make comments and modifications directly within the software. "Sometimes the easiest way to show somebody how to program or debug something was simply to sit down at the terminal and do it for them," explains Steele.
+
+The macro feature, after its second year, began to foil this capability. In their eagerness to embrace the new full-screen capabilities, hackers had customized their versions of TECO to the point where a hacker sitting down at another hacker's terminal usually had to spend the first hour just figuring out what macro commands did what.
+
+Frustrated, Steele took it upon himself to the solve the problem. He gathered together the four different macro packages and began assembling a chart documenting the most useful macro commands. In the course of implementing the design specified by the chart, Steele says he attracted Stallman's attention.
+
+"He started looking over my shoulder, asking me what I was doing," recalls Steele.
+
+For Steele, a soft-spoken hacker who interacted with Stallman infrequently, the memory still sticks out. Looking over another hacker's shoulder while he worked was a common activity at the AI Lab. Stallman, the TECO maintainer at the lab, deemed Steele's work "interesting" and quickly set off to complete it.
+
+"As I like to say, I did the first 0.001 percent of the implementation, and Stallman did the rest," says Steele with a laugh.
+
+The project's new name, Emacs, came courtesy of Stallman. Short for "editing macros," it signified the evolutionary transcendence that had taken place during the macros explosion two years before. It also took advantage of a gap in the software programming lexicon. Noting a lack of programs on ITS starting with the letter "E," Stallman chose Emacs, making it possible to reference the program with a single letter. Once again, the hacker lust for efficiency had left its mark. ^39^
+
+In the course of developing a standard system of macro commands, Stallman and Steele had to traverse a political tightrope. In creating a standard program, Stallman was in clear violation of the fundamental hacker tenet-"promote decentralization." He was also threatening to hobble the very flexibility that had fueled TECO's explosive innovation in the first place.
+
+"On the one hand, we were trying to make a uniform command set again; on the other hand, we wanted to keep it open ended, because the programmability was important," recalls Steele.
+
+To solve the problem, Stallman, Steele, and fellow hackers David Moon and Dan Weinreib limited their standardization effort to the WYSIWYG commands that controlled how text appeared on-screen. The rest of the Emacs effort would be devoted to retaining the program's Tinker Toy-style extensibility.
+
+Stallman now faced another conundrum: if users made changes but didn't communicate those changes back to the rest of the community, the Tower of Babel effect would simply emerge in other places. Falling back on the hacker doctrine of sharing innovation, Stallman embedded a statement within the source code that set the terms of use. Users were free to modify and redistribute the code on the condition that they gave back all the extensions they made. Stallman dubbed it the " Emacs Commune." Just as TECO had become more than a simple editor, Emacs had become more than a simple software program. To Stallman, it was a social contract. In an early memo documenting the project, Stallman spelled out the contract terms. "EMACS," he wrote, "was distributed on a basis of communal sharing, which means that all improvements must be given back to me to be incorporated and distributed."~{ See Stallman (1979): #SEC34. }~
+
+Not everybody accepted the contract. The explosive innovation continued throughout the decade, resulting in a host of Emacs-like programs with varying degrees of cross-compatibility. A few cited their relation to Stallman's original Emacs with humorously recursive names: Sine (Sine is not Emacs), Eine (Eine is not Emacs), and Zwei (Zwei was Eine initially). As a devoted exponent of the hacker ethic, Stallman saw no reason to halt this innovation through legal harassment. Still, the fact that some people would so eagerly take software from the community chest, alter it, and slap a new name on the resulting software displayed a stunning lack of courtesy.
+
+Such rude behavior was reflected against other, unsettling developments in the hacker community. Brian Reid's 1979 decision to embed "time bombs" in Scribe, making it possible for Unilogic to limit unpaid user access to the software, was a dark omen to Stallman. "He considered it the most Nazi thing he ever saw in his life," recalls Reid. Despite going on to later Internet fame as the cocreator of the Usenet alt heirarchy, Reid says he still has yet to live down that 1979 decision, at least in Stallman's eyes. "He said that all software should be free and the prospect of charging money for software was a crime against humanity."~{ In a 1996 interview with online magazine MEME, Stallman cited Scribe's sale as irksome, but hesitated to mention Reid by name. "The problem was nobody censured or punished this student for what he did," Stallman said. "The result was other people got tempted to follow his example." See MEME 2.04.<br> http://memex.org/meme2-04.html }~
+
+Although Stallman had been powerless to head off Reid's sale, he did possess the ability to curtail other forms of behavior deemed contrary to the hacker ethos. As central source-code maintainer for the Emacs "commune," Stallman began to wield his power for political effect. During his final stages of conflict with the administrators at the Laboratory for Computer Science over password systems, Stallman initiated a software " strike,"~{ See Steven Levy, Hackers (Penguin USA [paperback], 1984): 419. }~ refusing to send lab members the latest version of Emacs until they rejected the security system on the lab's computers. The move did little to improve Stallman's growing reputation as an extremist, but it got the point across: commune members were expected to speak up for basic hacker values.
+
+"A lot of people were angry with me, saying I was trying to hold them hostage or blackmail them, which in a sense I was," Stallman would later tell author Steven Levy. "I was engaging in violence against them because I thought they were engaging in violence to everyone at large." ^42^
+
+Over time, Emacs became a sales tool for the hacker ethic. The flexibility Stallman and built into the software not only encouraged collaboration, it demanded it. Users who didn't keep abreast of the latest developments in Emacs evolution or didn't contribute their contributions back to Stallman ran the risk of missing out on the latest breakthroughs. And the breakthroughs were many. Twenty years later, users had modified Emacs for so many different uses-using it as a spreadsheet, calculator, database, and web browser-that later Emacs developers adopted an overflowing sink to represent its versatile functionality. "That's the idea that we wanted to convey," says Stallman. "The amount of stuff it has contained within it is both wonderful and awful at the same time."
+
+Stallman's AI Lab contemporaries are more charitable. Hal Abelson, an MIT grad student who worked with Stallman during the 1970s and would later assist Stallman as a charter boardmember of the Free Software Foundation, describes Emacs as "an absolutely brilliant creation." In giving programmers a way to add new software libraries and features without messing up the system, Abelson says, Stallman paved the way for future large-scale collaborative software projects. "Its structure was robust enough that you'd have people all over the world who were loosely collaborating [and] contributing to it," Abelson says. "I don't know if that had been done before."~{ In writing this chapter, I've elected to focus more on the social significance of Emacs than the software significance. To read more about the software side, I recommend Stallman's 1979 memo. I particularly recommend the section titled "Research Through Development of Installed Tools" (#SEC27). Not only is it accessible to the nontechnical reader, it also sheds light on how closely intertwined Stallman's political philosophies are with his software-design philosophies. A sample excerpt follows:<br>_1 EMACS could not have been reached by a process of careful design, because such processes arrive only at goals which are visible at the outset, and whose desirability is established on the bottom line at the outset. Neither I nor anyone else visualized an extensible editor until I had made one, nor appreciated its value until he had experienced it. EMACS exists because I felt free to make individually useful small improvements on a path whose end was not in sight. }~
+
+Guy Steele expresses similar admiration. Currently a research scientist for Sun Microsystems, he remembers Stallman primarily as a "brilliant programmer with the ability to generate large quantities of relatively bug-free code." Although their personalities didn't exactly mesh, Steele and Stallman collaborated long enough for Steele to get a glimpse of Stallman's intense coding style. He recalls a notable episode in the late 1970s when the two programmers banded together to write the editor's "pretty print" feature. Originally conceived by Steele, pretty print was another keystroke-triggerd feature that reformatted Emacs' source code so that it was both more readable and took up less space, further bolstering the program's WYSIWIG qualities. The feature was strategic enough to attract Stallman's active interest, and it wasn't long before Steele wrote that he and Stallman were planning an improved version.
+
+"We sat down one morning," recalls Steele. "I was at the keyboard, and he was at my elbow," says Steele. "He was perfectly willing to let me type, but he was also telling me what to type.
+
+The programming session lasted 10 hours. Throughout that entire time, Steele says, neither he nor Stallman took a break or made any small talk. By the end of the session, they had managed to hack the pretty print source code to just under 100 lines. "My fingers were on the keyboard the whole time," Steele recalls, "but it felt like both of our ideas were flowing onto the screen. He told me what to type, and I typed it."
+
+The length of the session revealed itself when Steele finally left the AI Lab. Standing outside the building at 545 Tech Square, he was surprised to find himself surrounded by nighttime darkness. As a programmer, Steele was used to marathon coding sessions. Still, something about this session was different. Working with Stallman had forced Steele to block out all external stimuli and focus his entire mental energies on the task at hand. Looking back, Steele says he found the Stallman mind-meld both exhilarating and scary at the same time. "My first thought afterward was: it was a great experience, very intense, and that I never wanted to do it again in my life."
+
+1~ Chapter 7 - A Stark Moral Choice
+
+On September 27, 1983, computer programmers logging on to the Usenet newsgroup net.unix-wizards encountered an unusual message. Posted in the small hours of the morning, 12:30 a.m. to be exact, and signed by rms@mit-oz, the message's subject line was terse but attention-grabbing. "New UNIX implementation," it read. Instead of introducing a newly released version of Unix, however, the message's opening paragraph issued a call to arms:
+
+_1 Starting this Thanksgiving I am going to write a complete Unix-compatible software system called GNU (for Gnu's Not Unix), and give it away free to everyone who can use it. Contributions of time, money, programs and equipment are greatly needed.~{ See Richard Stallman, "Initial GNU Announcement" (September 1983).<br> http://www.gnu.ai.mit.edu/gnu/initial-announcement.html }~
+
+To an experienced Unix developer, the message was a mixture of idealism and hubris. Not only did the author pledge to rebuild the already mature Unix operating system from the ground up, he also proposed to improve it in places. The new GNU system, the author predicted, would carry all the usual components-a text editor, a shell program to run Unix-compatible applications, a compiler, "and a few other things." ^44^ It would also contain many enticing features that other Unix systems didn't yet offer: a graphic user interface based on the Lisp programming language, a crash-proof file system, and networking protocols built according to MIT's internal networking system.
+
+"GNU will be able to run Unix programs, but will not be identical to Unix," the author wrote. "We will make all improvements that are convenient, based on our experience with other operating systems."
+
+Anticipating a skeptical response on some readers' part, the author made sure to follow up his operating-system outline with a brief biographical sketch titled, "Who am I?":
+
+_1 I am Richard Stallman, inventor of the original much-imitated EMACS editor, now at the Artificial Intelligence Lab at MIT. I have worked extensively on compilers, editors, debuggers, command interpreters, the Incompatible Timesharing System and the Lisp Machine operating system. I pioneered terminal-independent display support in ITS. In addition I have implemented one crashproof file system and two window systems for Lisp machines. ^44^
+
+As fate would have it, Stallman's fanciful GNU Project missed its Thanksgiving launch date. By January, 1984, however, Stallman made good on his promise and fully immersed himself in the world of Unix software development. For a software architect raised on ITS, it was like designing suburban shopping malls instead of Moorish palaces. Even so, building a Unix-like operating system had its hidden advantages. ITS had been powerful, but it also possessed an Achilles' heel: MIT hackers had designed it to take specific advantage of the DEC-built PDP line. When AI Lab administrators elected to phase out the lab's powerful PDP-10 machine in the early 1980s, the operating system that hackers once likened to a vibrant city became an instant ghost town. Unix, on the other hand, was designed for mobility and long-term survival. Originally developed by junior scientists at AT&T, the program had slipped out under corporate-management radar, finding a happy home in the cash-strapped world of academic computer systems. With fewer resources than their MIT brethren, Unix developers had customized the software to ride atop a motley assortment of hardware systems: everything from the 16-bit PDP-11-a machine considered fit for only small tasks by most AI Lab hackers-to 32-bit mainframes such as the VAX 11/780. By 1983, a few companies, most notably Sun Microsystems, were even going so far as to develop a new generation of microcomputers, dubbed "workstations," to take advantage of the increasingly ubiquitous operating system.
+
+To facilitate this process, the developers in charge of designing the dominant Unix strains made sure to keep an extra layer of abstraction between the software and the machine. Instead of tailoring the operating system to take advantage of a specific machine's resources-as the AI Lab hackers had done with ITS and the PDP-10-Unix developers favored a more generic, off-the-rack approach. Focusing more on the interlocking standards and specifications that held the operating system's many subcomponents together, rather than the actual components themselves, they created a system that could be quickly modified to suit the tastes of any machine. If a user quibbled with a certain portion, the standards made it possible to pull out an individual subcomponent and either fix it or replace it with something better. Simply put, what the Unix approach lacked in terms of style or aesthetics, it more than made up for in terms of flexibility and economy, hence its rapid adoption.~{ See Marshall Kirk McKusick, "Twenty Years of Berkeley Unix," Open Sources (O'Reilly & Associates, Inc., 1999): 38. }~
+
+Stallman's decision to start developing the GNU system was triggered by the end of the ITS system that the AI Lab hackers had nurtured for so long. The demise of ITS had been a traumatic blow to Stallman. Coming on the heels of the Xerox laser printer episode, it offered further evidence that the AI Lab hacker culture was losing its immunity to business practices in the outside world.
+
+Like the software code that composed it, the roots of ITS' demise stretched way back. Defense spending, long a major font for computer-science research, had dried up during the post-Vietnam years. In a desperate quest for new funds, laboratories and universities turned to the private sector. In the case of the AI Lab, winning over private investors was an easy sell. Home to some of the most ambitious computer-science projects of the post-war era, the lab became a quick incubator of technology. Indeed, by 1980, most of the lab's staff, including many hackers, were dividing its time between Institute and commercial projects.
+
+What at first seemed like a win-win deal-hackers got to work on the best projects, giving the lab first look at many of the newest computer technologies coming down the pike-soon revealed itself as a Faustian bargain. The more time hackers devoted to cutting-edge commercial projects, the less time they had to devote to general maintenance on the lab's baroque software infrastructure. Soon, companies began hiring away hackers outright in an attempt to monopolize their time and attention. With fewer hackers to mind the shop, programs and machines took longer to fix. Even worse, Stallman says, the lab began to undergo a "demographic change." The hackers who had once formed a vocal minority within the AI Lab were losing membership while "the professors and the students who didn't really love the [PDP-10] were just as numerous as before."3
+
+The breaking point came in 1982. That was the year the lab's administration decided to upgrade its main computer, the PDP-10. Digital, the corporation that manufactured the PDP-10, had discontinued the line. Although the company still offered a high-powered mainframe, dubbed the KL-10, the new machine required a drastic rewrite or "port" of ITS if hackers wanted to continue running the same operating system. Fearful that the lab had lost its critical mass of in-house programming talent, AI Lab faculty members pressed for Twenex, a commercial operating system developed by Digital. Outnumbered, the hackers had no choice but to comply.
+
+"Without hackers to maintain the system, [faculty members] said, `We're going to have a disaster; we must have commercial software,'" Stallman would recall a few years later. "They said, `We can expect the company to maintain it.' It proved that they were utterly wrong, but that's what they did."~{ See Richard Stallman (1986). }~
+
+At first, hackers viewed the Twenex system as yet another authoritarian symbol begging to be subverted. The system's name itself was a protest. Officially dubbed TOPS-20 by DEC, it was a successor to TOPS-10, a commercial operating system DEC marketed for the PDP-10. Bolt Beranek Newman had deveoped an improved version, dubbed Tenex, which TOPS-20 drew upon.~{ Multiple sources: see Richard Stallman interview, Gerald Sussman email, and Jargon File 3.0.0.<br> http://www.clueless.com/jargon3.0.0/TWENEX.html }~ Stallman, the hacker who coined the Twenex term, says he came up with the name as a way to avoid using the TOPS-20 name. "The system was far from tops, so there was no way I was going to call it that," Stallman recalls. "So I decided to insert a `w' in the Tenex name and call it Twenex."
+
+The machine that ran the Twenex/TOPS-20 system had its own derisive nickname: Oz. According to one hacker legend, the machine got its nickname because it required a smaller PDP-11 machine to power its terminal. One hacker, upon viewing the KL-10-PDP-11 setup for the first time, likened it to the wizard's bombastic onscreen introduction in the Wizard of Oz. "I am the great and powerful Oz," the hacker intoned. "Pay no attention to the PDP-11 behind that console."~{ See http://www.as.cmu.edu/~geek/humor/See_Figure_1.txt }~
+
+If hackers laughed when they first encountered the KL-10, their laughter quickly died when they encountered Twenex. Not only did Twenex boast built-in security, but the system's software engineers had designed the tools and applications with the security system in mind. What once had been a cat-and-mouse game over passwords in the case of the Laboratory for Computer Science's security system, now became an out-and-out battle over system management. System administrators argued that without security, the Oz system was more prone to accidental crashes. Hackers argued that crashes could be better prevented by overhauling the source code. Unfortunately, the number of hackers with the time and inclination to perform this sort of overhaul had dwindled to the point that the system-administrator argument prevailed.
+
+Cadging passwords and deliberately crashing the system in order to glean evidence from the resulting wreckage, Stallman successfully foiled the system administrators' attempt to assert control. After one foiled "coup d'etat," Stallman issued an alert to the entire AI staff. ^46^
+
+"There has been another attempt to seize power," Stallman wrote. "So far, the aristocratic forces have been defeated." To protect his identity, Stallman signed the message "Radio Free OZ."
+
+The disguise was a thin one at best. By 1982, Stallman's aversion to passwords and secrecy had become so well known that users outside the AI Laboratory were using his account as a stepping stone to the ARPAnet, the research-funded computer network that would serve as a foundation for today's Internet. One such "tourist" during the early 1980s was Don Hopkins, a California programmer who learned through the hacking grapevine that all an outsider needed to do to gain access to MIT's vaunted ITS system was to log in under the initials RMS and enter the same three-letter monogram when the system requested a password.
+
+"I'm eternally grateful that MIT let me and many other people use their computers for free," says Hopkins. "It meant a lot to many people."
+
+This so-called "tourist" policy, which had been openly tolerated by MIT management during the ITS years,~{ See "MIT AI Lab Tourist Policy."<br> http://catalog.com/hopkins/text/tourist-policy.html }~ fell by the wayside when Oz became the lab's primary link to the ARPAnet. At first, Stallman continued his policy of repeating his login ID as a password so outside users could follow in his footsteps. Over time, however, the Oz's fragility prompted administrators to bar outsiders who, through sheer accident or malicious intent, might bring down the system. When those same administrators eventually demanded that Stallman stop publishing his password, Stallman, citing personal ethics, refused to do so and ceased using the Oz system altogether. ^46^
+
+"[When] passwords first appeared at the MIT AI Lab I [decided] to follow my belief that there should be no passwords," Stallman would later say. "Because I don't believe that it's really desirable to have security on a computer, I shouldn't be willing to help uphold the security regime." ^46^
+
+Stallman's refusal to bow before the great and powerful Oz symbolized the growing tension between hackers and AI Lab management during the early 1980s. This tension paled in comparison to the conflict that raged within the hacker community itself. By the time the KL-10 arrived, the hacker community had already divided into two camps. The first centered around a software company called Symbolics, Inc. The second centered around Symbolics chief rival, Lisp Machines, Inc. (LMI). Both companies were in a race to market the Lisp Machine, a device built to take full advantage of the Lisp programming language.
+
+Created by artificial-intelligence research pioneer John McCarthy, a MIT artificial-intelligence researcher during the late 1950s, Lisp is an elegant language well-suited for programs charged with heavy-duty sorting and processing. The language's name is a shortened version of LISt Processing. Following McCarthy's departure to the Stanford Artificial Intelligence Laboratory, MIT hackers refined the language into a local dialect dubbed MACLISP. The "MAC" stood for Project MAC, the DARPA-funded research project that gave birth to the AI Lab and the Laboratory for Computer Science. Led by AI Lab arch-hacker Richard Greenblatt, AI Lab programmers during the 1970s built up an entire Lisp-based operating system, dubbed the Lisp Machine operating system. By 1980, the Lisp Machine project had generated two commercial spin-offs. Symbolics was headed by Russell Noftsker, a former AI Lab administrator, and Lisp Machines, Inc., was headed by Greenblatt.
+
+The Lisp Machine software was hacker-built, meaning it was owned by MIT but available for anyone to copy as per hacker custom. Such a system limited the marketing advantage of any company hoping to license the software from MIT and market it as unique. To secure an advantage, and to bolster the aspects of the operating system that customers might consider attractive, the companies recruited various AI Lab hackers and set them working on various components of the Lisp Machine operating system outside the auspices of the AI Lab.
+
+The most aggressive in this strategy was Symbolics. By the end of 1980, the company had hired 14 AI Lab staffers as part-time consultants to develop its version of the Lisp Machine. Apart from Stallman, the rest signed on to help LMI.~{ See H. P. Newquist, The Brain Makers: Genius, Ego, and Greed in the Quest for Machines that Think (Sams Publishing, 1994): 172. }~
+
+At first, Stallman accepted both companies' attempt to commercialize the Lisp machine, even though it meant more work for him. Both licensed the Lisp Machine OS source code from MIT, and it was Stallman's job to update the lab's own Lisp Machine to keep pace with the latest innovations. Although Symbolics' license with MIT gave Stallman the right to review, but not copy, Symbolics' source code, Stallman says a "gentleman's agreement" between Symbolics management and the AI Lab made it possible to borrow attractive snippets in traditional hacker fashion.
+
+On March 16, 1982, a date Stallman remembers well because it was his birthday, Symbolics executives decided to end this gentlemen's agreement. The move was largely strategic. LMI, the primary competition in the Lisp Machine marketplace, was essentially using a copy of the AI Lab Lisp Machine. Rather than subsidize the development of a market rival, Symbolics executives elected to enforce the letter of the license. If the AI Lab wanted its operating system to stay current with the Symbolics operating system, the lab would have to switch over to a Symbolics machine and sever its connection to LMI.
+
+As the person responsible for keeping up the lab's Lisp Machine, Stallman was incensed. Viewing this announcement as an "ultimatum," he retaliated by disconnecting Symbolics' microwave communications link to the laboratory. He then vowed never to work on a Symbolics machine and pledged his immediate allegiance to LMI. "The way I saw it, the AI Lab was a neutral country, like Belgium in World War I," Stallman says. "If Germany invades Belgium, Belgium declares war on Germany and sides with Britain and France."
+
+The circumstances of the so-called "Symbolics War" of 1982-1983 depend heavily on the source doing the telling. When Symbolics executives noticed that their latest features were still appearing in the AI Lab Lisp Machine and, by extension, the LMI Lisp machine, they installed a "spy" program on Stallman's computer terminal. Stallman says he was rewriting the features from scratch, taking advantage of the license's review clause but also taking pains to make the source code as different as possible. Symbolics executives argued otherwise and took their case to MIT administration. According to 1994 book, The Brain Makers: Genius, Ego, and Greed, and the Quest for Machines That Think, written by Harvey Newquist, the administration responded with a warning to Stallman to "stay away" from the Lisp Machine project.~{ Ibid.: 196. }~ According to Stallman, MIT administrators backed Stallman up. "I was never threatened," he says. "I did make changes in my practices, though. Just to be ultra safe, I no longer read their source code. I used only the documentation and wrote the code from that."
+
+Whatever the outcome, the bickering solidified Stallman's resolve. With no source code to review, Stallman filled in the software gaps according to his own tastes and enlisted members of the AI Lab to provide a continuous stream of bug reports. He also made sure LMI programmers had direct access to the changes. "I was going to punish Symbolics if it was the last thing I did," Stallman says.
+
+Such statements are revealing. Not only do they shed light on Stallman's nonpacifist nature, they also reflect the intense level of emotion triggered by the conflict. According to another Newquist-related story, Stallman became so irate at one point that he issued an email threatening to "wrap myself in dynamite and walk into Symbolics' offices."~{ Ibid. Newquist, who says this anecdote was confirmed by several Symbolics executives, writes, "The message caused a brief flurry of excitement and speculation on the part of Symbolics' employees, but ultimately, no one took Stallman's outburst that seriously." }~ Although Stallman would deny any memory of the email and still describes its existence as a "vicious rumor," he acknowledges that such thoughts did enter his head. "I definitely did have fantasies of killing myself and destroying their building in the process," Stallman says. "I thought my life was over." ^48^
+
+The level of despair owed much to what Stallman viewed as the "destruction" of his "home"-i.e., the demise of the AI Lab's close-knit hacker subculture. In a later email interview with Levy, Stallman would liken himself to the historical figure Ishi, the last surviving member of the Yahi, a Pacific Northwest tribe wiped out during the Indian wars of the 1860s and 1870s. The analogy casts Stallman's survival in epic, almost mythical, terms. In reality, however, it glosses over the tension between Stallman and his fellow AI Lab hackers prior to the Symbolics-LMI schism. Instead of seeing Symbolics as an exterminating force, many of Stallman's colleagues saw it as a belated bid for relevance. In commercializing the Lisp Machine, the company pushed hacker principles of engineer-driven software design out of the ivory-tower confines of the AI Lab and into the corporate marketplace where manager-driven design principles held sway. Rather than viewing Stallman as a holdout, many hackers saw him as a troubling anachronism.
+
+Stallman does not dispute this alternate view of historical events. In fact, he says it was yet another reason for the hostility triggered by the Symbolics "ultimatum." Even before Symbolics hired away most of the AI Lab's hacker staff, Stallman says many of the hackers who later joined Symbolics were shunning him. "I was no longer getting invited to go to Chinatown," Stallman recalls. "The custom started by Greenblatt was that if you went out to dinner, you went around or sent a message asking anybody at the lab if they also wanted to go. Sometime around 1980-1981, I stopped getting asked. They were not only not inviting me, but one person later confessed that he had been pressured to lie to me to keep their going away to dinner without me a secret."
+
+Although Stallman felt anger toward the hackers who orchestrated this petty form of ostracism, the Symbolics controversy dredged up a new kind of anger, the anger of a person about to lose his home. When Symbolics stopped sending over its source-code changes, Stallman responded by holing up in his MIT offices and rewriting each new software feature and tool from scratch. Frustrating as it may have been, it guaranteed that future Lisp Machine users had unfettered access to the same features as Symbolics users.
+
+It also guaranteed Stallman's legendary status within the hacker community. Already renowned for his work with Emacs, Stallman's ability to match the output of an entire team of Symbolics programmers-a team that included more than a few legendary hackers itself-still stands has one of the major human accomplishments of the Information Age, or of any age for that matter. Dubbing it a "master hack" and Stallman himself a "virtual John Henry of computer code," author Steven Levy notes that many of his Symbolics-employed rivals had no choice but to pay their idealistic former comrade grudging respect. Levy quotes Bill Gosper, a hacker who eventually went to work for Symbolics in the company's Palo Alto office, expressing amazement over Stallman's output during this period:
+
+_1 I can see something Stallman wrote, and I might decide it was bad (probably not, but somebody could convince me it was bad), and I would still say, "But wait a minute-Stallman doesn't have anybody to argue with all night over there. He's working alone! It's incredible anyone could do this alone!"~{ See Steven Levy, Hackers (Penguin USA [paperback], 1984): 426. }~
+
+For Stallman, the months spent playing catch up with Symbolics evoke a mixture of pride and profound sadness. As a dyed-in-the-wool liberal whose father had served in World War II, Stallman is no pacifist. In many ways, the Symbolics war offered the rite of passage toward which Stallman had been careening ever since joining the AI Lab staff a decade before. At the same time, however, it coincided with the traumatic destruction of the AI Lab hacker culture that had nurtured Stallman since his teenage years. One day, while taking a break from writing code, Stallman experienced a traumatic moment passing through the lab's equipment room. There, Stallman encountered the hulking, unused frame of the PDP-10 machine. Startled by the dormant lights, lights that once actively blinked out a silent code indicating the status of the internal program, Stallman says the emotional impact was not unlike coming across a beloved family member's well-preserved corpse.
+
+"I started crying right there in the equipment room," he says. "Seeing the machine there, dead, with nobody left to fix it, it all drove home how completely my community had been destroyed."
+
+Stallman would have little opportunity to mourn. The Lisp Machine, despite all the furor it invoked and all the labor that had gone into making it, was merely a sideshow to the large battles in the technology marketplace. The relentless pace of computer miniaturization was bringing in newer, more powerful microprocessors that would soon incorporate the machine's hardware and software capabilities like a modern metropolis swallowing up an ancient desert village.
+
+Riding atop this microprocessor wave were hundreds-thousands-of commercial software programs, each protected by a patchwork of user licenses and nondisclosure agreements that made it impossible for hackers to review or share source code. The licenses were crude and ill-fitting, but by 1983 they had become strong enough to satisfy the courts and scare away would-be interlopers. Software, once a form of garnish most hardware companies gave away to make their expensive computer systems more flavorful, was quickly becoming the main dish. In their increasing hunger for new games and features, users were putting aside the traditional demand to review the recipe after every meal.
+
+Nowhere was this state of affairs more evident than in the realm of personal computer systems. Companies such as Apple Computer and Commodore were minting fresh millionaires selling machines with built-in operating systems. Unaware of the hacker culture and its distaste for binary-only software, many of these users saw little need to protest when these companies failed to attach the accompanying source-code files. A few anarchic adherents of the hacker ethic helped propel that ethic into this new marketplace, but for the most part, the marketplace rewarded the programmers speedy enough to write new programs and savvy enough to copyright them as legally protected works.
+
+One of the most notorious of these programmers was Bill Gates, a Harvard dropout two years Stallman's junior. Although Stallman didn't know it at the time, seven years before sending out his message to the n et.unix-wizards newsgroup, Gates, a budding entrepreneur and general partner with the Albuquerque-based software firm Micro-Soft, later spelled as Microsoft, had sent out his own open letter to the software-developer community. Written in response to the PC users copying Micro-Soft's software programs, Gates' " Open Letter to Hobbyists" had excoriated the notion of communal software development.
+
+"Who can afford to do professional work for nothing?" asked Gates. "What hobbyist can put three man-years into programming, finding all bugs, documenting his product, and distributing it for free?"~{ See Bill Gates, "An Open Letter to Hobbyists" (February 3, 1976).<br>To view an online copy of this letter, go to<br> http://www.blinkenlights.com/classiccmp/gateswhine.html. }~
+
+Although few hackers at the AI Lab saw the missive, Gates' 1976 letter nevertheless represented the changing attitude toward software both among commercial software companies and commercial software developers. Why treat software as a zero-cost commodity when the market said otherwise? As the 1970s gave way to the 1980s, selling software became more than a way to recoup costs; it became a political statement. At a time when the Reagan Administration was rushing to dismantle many of the federal regulations and spending programs that had been built up during the half century following the Great Depression, more than a few software programmers saw the hacker ethic as anticompetitive and, by extension, un-American. At best, it was a throwback to the anticorporate attitudes of the late 1960s and early 1970s. Like a Wall Street banker discovering an old tie-dyed shirt hiding between French-cuffed shirts and double-breasted suits, many computer programmers treated the hacker ethic as an embarrassing reminder of an idealistic age.
+
+For a man who had spent the entire 1960s as an embarrassing throwback to the 1950s, Stallman didn't mind living out of step with his peers. As a programmer used to working with the best machines and the best software, however, Stallman faced what he could only describe as a "stark moral choice": either get over his ethical objection for " proprietary" software-the term Stallman and his fellow hackers used to describe any program that carried private copyright or end-user license that restricted copying and modification-or dedicate his life to building an alternate, nonproprietary system of software programs. Given his recent months-long ordeal with Symbolics, Stallman felt more comfortable with the latter option. "I suppose I could have stopped working on computers altogether," Stallman says. "I had no special skills, but I'm sure I could have become a waiter. Not at a fancy restaurant, probably, but I could've been a waiter somewhere."
+
+Being a waiter-i.e., dropping out of programming altogether-would have meant completely giving up an activity, computer programming, that had given him so much pleasure. Looking back on his life since moving to Cambridge, Stallman finds it easy to identify lengthy periods when software programming provided the only pleasure. Rather than drop out, Stallman decided to stick it out.
+
+An atheist, Stallman rejects notions such as fate, dharma, or a divine calling in life. Nevertheless, he does feel that the decision to shun proprietary software and build an operating system to help others do the same was a natural one. After all, it was Stallman's own personal combination of stubbornness, foresight, and coding virtuosity that led him to consider a fork in the road most others didn't know existed. In describing the decision in a chapter for the 1999 book, Open Sources, Stallman cites the spirit encapsulated in the words of the Jewish sage Hillel:
+
+_1 If I am not for myself, who will be for me?If I am only for myself, what am I?If not now, when?~{ See Richard Stallman, Open Sources (O'Reilly & Associates, Inc., 1999): 56.<br>Stallman adds his own footnote to this statement, writing, "As an atheist, I don't follow any religious leaders, but I sometimes find I admire something one of them has said." }~
+
+Speaking to audiences, Stallman avoids the religious route and expresses the decision in pragmatic terms. "I asked myself: what could I, an operating-system developer, do to improve the situation? It wasn't until I examined the question for a while that I realized an operating-system developer was exactly what was needed to solve the problem."
+
+Once he reached that decision, Stallman says, everything else "fell into place." He would abstain from using software programs that forced him to compromise his ethical beliefs, while at the same time devoting his life to the creation of software that would make it easier for others to follow the same path. Pledging to build a free software operating system "or die trying-of old age, of course," Stallman quips, he resigned from the MIT staff in January, 1984, to build GNU.
+
+The resignation distanced Stallman's work from the legal auspices of MIT. Still, Stallman had enough friends and allies within the AI Lab to retain rent-free access to his MIT office. He also had the ability to secure outside consulting gigs to underwrite the early stages of the GNU Project. In resigning from MIT, however, Stallman negated any debate about conflict of interest or Institute ownership of the software. The man whose early adulthood fear of social isolation had driven him deeper and deeper into the AI Lab's embrace was now building a legal firewall between himself and that environment.
+
+For the first few months, Stallman operated in isolation from the Unix community as well. Although his announcement to the net.unix-wizards group had attracted sympathetic responses, few volunteers signed on to join the crusade in its early stages.
+
+"The community reaction was pretty much uniform," recalls Rich Morin, leader of a Unix user group at the time. "People said, `Oh, that's a great idea. Show us your code. Show us it can be done.'"
+
+In true hacker fashion, Stallman began looking for existing programs and tools that could be converted into GNU programs and tools. One of the first was a compiler named VUCK, which converted programs written in the popular C programming language into machine-readable code. Translated from the Dutch, the program's acronym stood for the Free University Compiler Kit. Optimistic, Stallman asked the program's author if the program was free. When the author informed him that the words "Free University" were a reference to the Vrije Universiteit in Amsterdam, Stallman was chagrined.
+
+"He responded derisively, stating that the university was free but the compiler was not," recalls Stallman. "I therefore decided that my first program for the GNU Project would be a multi-language, multi-platform compiler." ^46^
+
+Eventually Stallman found a Pastel language compiler written by programmers at Lawrence Livermore National Lab. According to Stallman's knowledge at the time, the compiler was free to copy and modify. Unfortunately, the program possessed a sizable design flaw: it saved each program into core memory, tying up precious space for other software activities. On mainframe systems this design flaw had been forgivable. On Unix systems it was a crippling barrier, since the machines that ran Unix were too small to handle the large files generated. Stallman made substantial progress at first, building a C-compatible frontend to the compiler. By summer, however, he had come to the conclusion that he would have to build a totally new compiler from scratch.
+
+In September of 1984, Stallman shelved compiler development for the near term and began searching for lower-lying fruit. He began development of a GNU version of Emacs, the program he himself had been supervising for a decade. The decision was strategic. Within the Unix community, the two native editor programs were vi, written by Sun Microsystems cofounder Bill Joy, and ed, written by Bell Labs scientist (and Unix cocreator) Ken Thompson. Both were useful and popular, but neither offered the endlessly expandable nature of Emacs. In rewriting Emacs for the Unix audience, Stallman stood a better chance of showing off his skills. It also stood to reason that Emacs users might be more attuned to the Stallman mentality.
+
+Looking back, Stallman says he didn't view the decision in strategic terms. "I wanted an Emacs, and I had a good opportunity to develop one."
+
+Once again, the notion of reinventing the wheel grated on Stallman's efficient hacker sensibilities. In writing a Unix version of Emacs, Stallman was soon following the footsteps of Carnegie Mellon graduate student James Gosling, author of a C-based version dubbed Gosling Emacs or GOSMACS. Gosling's version of Emacs included an interpreter that exploited a simplified offshoot of the Lisp language called MOCKLISP. Determined to build GNU Emacs on a similar Lisp foundation, Stallman borrowed copiously from Gosling's innovations. Although Gosling had put GOSMACS under copyright and had sold the rights to UniPress, a privately held software company, Stallman cited the assurances of a fellow developer who had participated in the early MOCKLISP interpreter. According to the developer, Gosling, while a Ph.D. student at Carnegie Mellon, had assured early collaborators that their work would remain accessible. When UniPress caught wind of Stallman's project, however, the company threatened to enforce the copyright. Once again, Stallman faced the prospect of building from the ground up.
+
+In the course of reverse-engineering Gosling's interpreter, Stallman would create a fully functional Lisp interpreter, rendering the need for Gosling's original interpreter moot. Nevertheless, the notion of developers selling off software rights-indeed, the very notion of developers having software rights to sell in the first place-rankled Stallman. In a 1986 speech at the Swedish Royal Technical Institute, Stallman cited the UniPress incident as yet another example of the dangers associated with proprietary software.
+
+"Sometimes I think that perhaps one of the best things I could do with my life is find a gigantic pile of proprietary software that was a trade secret, and start handing out copies on a street corner so it wouldn't be a trade secret any more," said Stallman. "Perhaps that would be a much more efficient way for me to give people new free software than actually writing it myself; but everyone is too cowardly to even take it."3
+
+Despite the stress it generated, the dispute over Gosling's innovations would assist both Stallman and the free software movement in the long term. It would force Stallman to address the weaknesses of the Emacs Commune and the informal trust system that had allowed problematic offshoots to emerge. It would also force Stallman to sharpen the free software movement's political objectives. Following the release of GNU Emacs in 1985, Stallman issued " The GNU Manifesto," an expansion of the original announcement posted in September, 1983. Stallman included within the document a lengthy section devoted to the many arguments used by commercial and academic programmers to justify the proliferation of proprietary software programs. One argument, "Don't programmers deserve a reward for their creativity," earned a response encapsulating Stallman's anger over the recent Gosling Emacs episode:
+
+"If anything deserves a reward, it is social contribution," Stallman wrote. "Creativity can be a social contribution, but only in so far [sic] as society is free to use the results. If programmers deserve to be rewarded for creating innovative programs, by the same token they deserve to be punished if they restrict the use of these programs."~{ See Richard Stallman, "The GNU Manifesto" (1985).<br> http://www.gnu.org/manifesto.html }~
+
+With the release of GNU Emacs, the GNU Project finally had code to show. It also had the burdens of any software-based enterprise. As more and more Unix developers began playing with the software, money, gifts, and requests for tapes began to pour in. To address the business side of the GNU Project, Stallman drafted a few of his colleagues and formed the Free Software Foundation (FSF), a nonprofit organization dedicated to speeding the GNU Project towards its goal. With Stallman as president and various hacker allies as board members, the FSF helped provide a corporate face for the GNU Project.
+
+Robert Chassell, a programmer then working at Lisp Machines, Inc., became one of five charter board members at the Free Software Foundation following a dinner conversation with Stallman. Chassell also served as the organization's treasurer, a role that started small but quickly grew.
+
+"I think in '85 our total expenses and revenue were something in the order of $23,000, give or take," Chassell recalls. "Richard had his office, and we borrowed space. I put all the stuff, especially the tapes, under my desk. It wasn't until sometime later LMI loaned us some space where we could store tapes and things of that sort."
+
+In addition to providing a face, the Free Software Foundation provided a center of gravity for other disenchanted programmers. The Unix market that had seemed so collegial even at the time of Stallman's initial GNU announcement was becoming increasingly competitive. In an attempt to tighten their hold on customers, companies were starting to close off access to Unix source code, a trend that only speeded the number of inquiries into ongoing GNU software projects. The Unix wizards who once regarded Stallman as a noisy kook were now beginning to see him as a software Cassandra.
+
+"A lot of people don't realize, until they've had it happen to them, how frustrating it can be to spend a few years working on a software program only to have it taken away," says Chassell, summarizing the feelings and opinions of the correspondents writing in to the FSF during the early years. "After that happens a couple of times, you start to say to yourself, `Hey, wait a minute.'"
+
+For Chassell, the decision to participate in the Free Software Foundation came down to his own personal feelings of loss. Prior to LMI, Chassell had been working for hire, writing an introductory book on Unix for Cadmus, Inc., a Cambridge-area software company. When Cadmus folded, taking the rights to the book down with it, Chassell says he attempted to buy the rights back with no success.
+
+"As far as I know, that book is still sitting on shelf somewhere, unusable, uncopyable, just taken out of the system," Chassell says. "It was quite a good introduction if I may say so myself. It would have taken maybe three or four months to convert [the book] into a perfectly usable introduction to GNU/Linux today. The whole experience, aside from what I have in my memory, was lost."
+
+Forced to watch his work sink into the mire while his erstwhile employer struggled through bankruptcy, Chassell says he felt a hint of the anger that drove Stallman to fits of apoplexy. "The main clarity, for me, was the sense that if you want to have a decent life, you don't want to have bits of it closed off," Chassell says. "This whole idea of having the freedom to go in and to fix something and modify it, whatever it may be, it really makes a difference. It makes one think happily that after you've lived a few years that what you've done is worthwhile. Because otherwise it just gets taken away and thrown out or abandoned or, at the very least, you no longer have any relation to it. It's like losing a bit of your life."
+
+1~ Chapter 8 - St. Ignucius
+
+The Maui High Performance Computing Center is located in a single-story building in the dusty red hills just above the town of Kihei. Framed by million-dollar views and the multimillion dollar real estate of the Silversword Golf Course, the center seems like the ultimate scientific boondoggle. Far from the boxy, sterile confines of Tech Square or even the sprawling research metropolises of Argonne, Illinois and Los Alamos, New Mexico, the MHPCC seems like the kind of place where scientists spend more time on their tans than their post-doctoral research projects.
+
+The image is only half true. Although researchers at the MHPCC do take advantage of the local recreational opportunities, they also take their work seriously. According to Top500.org, a web site that tracks the most powerful supercomputers in the world, the IBM SP Power3 supercomputer housed within the MHPCC clocks in at 837 billion floating-point operations per second, making it one of 25 most powerful computers in the world. Co-owned and operated by the University of Hawaii and the U.S. Air Force, the machine divides its computer cycles between the number crunching tasks associated with military logistics and high-temperature physics research.
+
+Simply put, the MHPCC is a unique place, a place where the brainy culture of science and engineering and the laid-back culture of the Hawaiian islands coexist in peaceful equilibrium. A slogan on the lab's 2000 web site sums it up: "Computing in paradise."
+
+It's not exactly the kind of place you'd expect to find Richard Stallman, a man who, when taking in the beautiful view of the nearby Maui Channel through the picture windows of a staffer's office, mutters a terse critique: "Too much sun." Still, as an emissary from one computing paradise to another, Stallman has a message to deliver, even if it means subjecting his pale hacker skin to the hazards of tropical exposure.
+
+The conference room is already full by the time I arrive to catch Stallman's speech. The gender breakdown is a little better than at the New York speech, 85% male, 15% female, but not by much. About half of the audience members wear khaki pants and logo-encrusted golf shirts. The other half seems to have gone native. Dressed in the gaudy flower-print shirts so popular in this corner of the world, their faces are a deep shade of ochre. The only residual indication of geek status are the gadgets: Nokia cell phones, Palm Pilots, and Sony VAIO laptops.
+
+Needless to say, Stallman, who stands in front of the room dressed in plain blue T-shirt, brown polyester slacks, and white socks, sticks out like a sore thumb. The fluorescent lights of the conference room help bring out the unhealthy color of his sun-starved skin. His beard and hair are enough to trigger beads of sweat on even the coolest Hawaiian neck. Short of having the words "mainlander" tattooed on his forehead, Stallman couldn't look more alien if he tried.
+
+As Stallman putters around the front of the room, a few audience members wearing T-shirts with the logo of the Maui FreeBSD Users Group (MFUG) race to set up camera and audio equipment. FreeBSD, a free software offshoot of the Berkeley Software Distribution, the venerable 1970s academic version of Unix, is technically a competitor to the GNU/Linux operating system. Still, in the hacking world, Stallman speeches are documented with a fervor reminiscent of the Grateful Dead and its legendary army of amateur archivists. As the local free software heads, it's up to the MFUG members to make sure fellow programmers in Hamburg, Mumbai, and Novosibirsk don't miss out on the latest pearls of RMS wisdom.
+
+The analogy to the Grateful Dead is apt. Often, when describing the business opportunities inherent within the free software model, Stallman has held up the Grateful Dead as an example. In refusing to restrict fans' ability to record live concerts, the Grateful Dead became more than a rock group. They became the center of a tribal community dedicated to Grateful Dead music. Over time, that tribal community became so large and so devoted that the band shunned record contracts and supported itself solely through musical tours and live appearances. In 1994, the band's last year as a touring act, the Grateful Dead drew $52 million in gate receipts alone.~{ See "Grateful Dead Time Capsule: 1985-1995 North American Tour Grosses."<br> http://www.accessplace.com/gdtc/1197.htm }~
+
+While few software companies have been able to match that success, the tribal aspect of the free software community is one reason many in the latter half of the 1990s started to accept the notion that publishing software source code might be a good thing. Hoping to build their own loyal followings, companies such as IBM, Sun Microsystems, and Hewlett Packard have come to accept the letter, if not the spirit, of the Stallman free software message. Describing the GPL as the information-technology industry's "Magna Carta," ZDNet software columnist Evan Leibovitch sees the growing affection for all things GNU as more than just a trend. "This societal shift is letting users take back control of their futures," Leibovitch writes. "Just as the Magna Carta gave rights to British subjects, the GPL enforces consumer rights and freedoms on behalf of the users of computer software."~{ See Evan Leibovitch, "Who's Afraid of Big Bad Wolves," ZDNet Tech Update (December 15, 2000).<br> http://techupdate.zdnet.com/techupdate/stories/main/0,14179,2664992,00.html }~
+
+The tribal aspect of the free software community also helps explain why 40-odd programmers, who might otherwise be working on physics projects or surfing the Web for windsurfing buoy reports, have packed into a conference room to hear Stallman speak.
+
+Unlike the New York speech, Stallman gets no introduction. He also offers no self-introduction. When the FreeBSD people finally get their equipment up and running, Stallman simply steps forward, starts speaking, and steamrolls over every other voice in the room.
+
+"Most of the time when people consider the question of what rules society should have for using software, the people considering it are from software companies, and they consider the question from a self-serving perspective," says Stallman, opening his speech. "What rules can we impose on everybody else so they have to pay us lots of money? I had the good fortune in the 1970s to be part of a community of programmers who shared software. And because of this I always like to look at the same issue from a different direction to ask: what kind of rules make possible a good society that is good for the people who are in it? And therefore I reach completely different answers."
+
+Once again, Stallman quickly segues into the parable of the Xerox laser printer, taking a moment to deliver the same dramatic finger-pointing gestures to the crowd. He also devotes a minute or two to the GNU/Linux name.
+
+"Some people say to me, `Why make such a fuss about getting credit for this system? After all, the important thing is the job is done, not whether you get recognition for it.' Well, this would be wise advice if it were true. But the job wasn't to build an operating system; the job is to spread freedom to the users of computers. And to do that we have to make it possible to do everything with computers in freedom."~{ For narrative purposes, I have hesitated to go in-depth when describing Stallman's full definition of software "freedom." The GNU Project web site lists four fundamental components:<br>The freedom to run a program, for any purpose (freedom 0).<br>The freedom to study how a program works, and adapt it to your needs (freedom 1).<br>The freedom to redistribute copies of a program so you can help your neighbor (freedom 2).<br>The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3).<br>For more information, please visit "The Free Software Definition" at http://www.gnu.org/philosophy/free-sw.html }~
+
+Adds Stallman, "There's a lot more work to do."
+
+For some in the audience, this is old material. For others, it's a little arcane. When a member of the golf-shirt contingent starts dozing off, Stallman stops the speech and asks somebody to wake the person up.
+
+"Somebody once said my voice was so soothing, he asked if I was some kind of healer," says Stallman, drawing a quick laugh from the crowd. "I guess that probably means I can help you drift gently into a blissful, relaxing sleep. And some of you might need that. I guess I shouldn't object if you do. If you need to sleep, by all means do."
+
+The speech ends with a brief discussion of software patents, a growing issue of concern both within the software industry and within the free software community. Like Napster, software patents reflect the awkward nature of applying laws and concepts written for the physical world to the frictionless universe of information technology. The difference between protecting a program under copyright and protecting a program under software patents is subtle but significant. In the case of copyright, a software creator can restrict duplication of the source code but not duplication of the idea or functionality that the source code addresses. In other words, if a developer chooses not to use a software program under the original developer's terms, that second developer is still free to reverse-engineer the program-i.e., duplicate the software program's functionality by rewriting the source code from scratch. Such duplication of ideas is common within the commercial software industry, where companies often isolate reverse-engineering teams to head off accusations of corporate espionage or developer hanky-panky. In the jargon of modern software development, companies refer to this technique as "clean room" engineering.
+
+Software patents work differently. According to the U.S. Patent Office, companies and individuals may secure patents for innovative algorithms provided they submit their claims to a public review. In theory, this allows the patent-holder to trade off disclosure of their invention for a limited monopoly of a minimum of 20 years after the patent filing. In practice, the disclosure is of limited value, since the operation of the program is often self-evident. Unlike copyright, a patent gives its holder the ability to head off the independent development of software programs with the same or similar functionality.
+
+In the software industry, where 20 years can cover the entire life cycle of a marketplace, patents take on a strategic weight. Where companies such as Microsoft and Apple once battled over copyright and the "look and feel" of various technologies, today's Internet companies use patents as a way to stake out individual applications and business models, the most notorious example being Amazon.com's 2000 attempt to patent the company's "one-click" online shopping process. For most companies, however, software patents have become a defensive tool, with cross-licensing deals balancing one set of corporate patents against another in a tense form of corporate detente. Still, in a few notable cases of computer encryption and graphic imaging algorithms, software vendors have successfully stifled rival technologies.
+
+For Stallman, the software-patent issue dramatizes the need for eternal hacker vigilance. It also underlines the importance of stressing the political benefits of free software programs over the competitive benefits. Pointing to software patents' ability to create sheltered regions in the marketplace, Stallman says competitive performance and price, two areas where free software operating systems such as GNU/Linux and FreeBSD already hold a distinct advantage over their proprietary counterparts, are red herrings compared to the large issues of user and developer freedom.
+
+"It's not because we don't have the talent to make better software," says Stallman. "It's because we don't have the right. Somebody has prohibited us from serving the public. So what's going to happen when users encounter these gaps in free software? Well, if they have been persuaded by the open source movement that these freedoms are good because they lead to more-powerful reliable software, they're likely to say, `You didn't deliver what you promised. This software's not more powerful. It's missing this feature. You lied to me.' But if they have come to agree with the free software movement, that the freedom is important in itself, then they will say, `How dare those people stop me from having this feature and my freedom too.' And with that kind of response, we may survive the hits that we're going to take as these patents explode."
+
+Such comments involve a hefty dose of spin, of course. Most open source advocates are equally, if not more, vociferous as Stallman when it comes to opposing software patents. Still, the underlying logic of Stallman's argument-that open source advocates emphasize the utilitarian advantages of free software over the political advantages-remains uncontested. Rather than stress the political significance of free software programs, open source advocates have chosen to stress the engineering integrity of the hacker development model. Citing the power of peer review, the open source argument paints programs such as GNU/Linux or FreeBSD as better built, better inspected and, by extension, more trushworthy to the average user.
+
+That's not to say the term "open source" doesn't have its political implications. For open source advocates, the term open source serves two purposes. First, it eliminates the confusion associated with the word "free," a word many businesses interpret as meaning "zero cost." Second, it allows companies to examine the free software phenomenon on a technological, rather than ethical, basis. Eric Raymond, cofounder of the Open Source Initiative and one of the leading hackers to endorse the term, effectively summed up the frustration of following Stallman down the political path in a 1999 essay, titled " Shut Up and Show Them the Code":
+
+_1 RMS's rhetoric is very seductive to the kind of people we are. We hackers are thinkers and idealists who readily resonate with appeals to "principle" and "freedom" and "rights." Even when we disagree with bits of his program, we want RMS's rhetorical style to work; we think it ought to work; we tend to be puzzled and disbelieving when it fails on the 95% of people who aren't wired like we are.~{ See Eric Raymond, "Shut Up and Show Them the Code," online essay, (June 28, 1999). }~
+
+Included among that 95%, Raymond writes, are the bulk of business managers, investors, and nonhacker computer users who, through sheer weight of numbers, tend to decide the overall direction of the commercial software marketplace. Without a way to win these people over, Raymond argues, programmers are doomed to pursue their ideology on the periphery of society:
+
+_1 When RMS insists that we talk about "computer users' rights," he's issuing a dangerously attractive invitation to us to repeat old failures. It's one we should reject-not because his principles are wrong, but because that kind of language, applied to software, simply does not persuade anybody but us. In fact, it confuses and repels most people outside our culture. ^60^
+
+Watching Stallman deliver his political message in person, it is hard to see anything confusing or repellent. Stallman's appearance may seem off-putting, but his message is logical. When an audience member asks if, in shunning proprietary software, free software proponents lose the ability to keep up with the latest technological advancements, Stallman answers the question in terms of his own personal beliefs. "I think that freedom is more important than mere technical advance," he says. "I would always choose a less advanced free program rather than a more advanced nonfree program, because I won't give up my freedom for something like that. My rule is, if I can't share it with you, I won't take it."
+
+Such answers, however, reinforce the quasi-religious nature of the Stallman message. Like a Jew keeping kosher or a Mormon refusing to drink alcohol, Stallman paints his decision to use free software in the place of proprietary in the color of tradition and personal belief. As software evangelists go, Stallman avoids forcing those beliefs down listeners' throats. Then again, a listener rarely leaves a Stallman speech not knowing where the true path to software righteousness lies.
+
+As if to drive home this message, Stallman punctuates his speech with an unusual ritual. Pulling a black robe out of a plastic grocery bag, Stallman puts it on. Out of a second bag, he pulls a reflective yellow computer disk and places it on his head. The crowd lets out a startled laugh.
+
+"I am St. Ignucius of the Church of Emacs," says Stallman, raising his right hand in mock-blessing. "I bless your computer, my child."
+
+{free_as_in_freedom_03_rms_st_ignucius.png 188x209 "Stallman dressed as St. Ignucius. Photo by Wouter van Oortmerssen." }http://www.free-culture.cc/
+
+The laughter turns into full-blown applause after a few seconds. As audience members clap, the computer disk on Stallman's head catches the glare of an overhead light, eliciting a perfect halo effect. In the blink of an eye, Stallman goes from awkward haole to Russian religious icon.
+
+" Emacs was initially a text editor," says Stallman, explaining the getup. "Eventually it became a way of life for many and a religion for some. We call this religion the Church of Emacs."
+
+The skit is a lighthearted moment of self-pardoy, a humorous return-jab at the many people who might see Stallman's form of software asceticism as religious fanaticism in disguise. It is also the sound of the other shoe dropping-loudly. It's as if, in donning his robe and halo, Stallman is finally letting listeners of the hook, saying, "It's OK to laugh. I know I'm weird."
+
+Discussing the St. Ignucius persona afterward, Stallman says he first came up with it in 1996, long after the creation of Emacs but well before the emergence of the "open source" term and the struggle for hacker-community leadership that precipitated it. At the time, Stallman says, he wanted a way to "poke fun at himself," to remind listeners that, though stubborn, Stallman was not the fanatic some made him out to be. It was only later, Stallman adds, that others seized the persona as a convenient way to play up his reputation as software ideologue, as Eric Raymond did in an 1999 interview with the linux.com web site:
+
+_1 When I say RMS calibrates what he does, I'm not belittling or accusing him of insincerity. I'm saying that like all good communicators he's got a theatrical streak. Sometimes it's conscious-have you ever seen him in his St. Ignucius drag, blessing software with a disk platter on his head? Mostly it's unconscious; he's just learned the degree of irritating stimulus that works, that holds attention without (usually) freaking people out.~{ See "Guest Interview: Eric S. Raymond," Linux.com (May 18, 1999).<br> http://www.linux.com/interviews/19990518/8/ }~
+
+Stallman takes issue with the Raymond analysis. "It's simply my way of making fun of myself," he says. "The fact that others see it as anything more than that is a reflection of their agenda, not mine."
+
+That said, Stallman does admit to being a ham. "Are you kidding?" he says at one point. "I love being the center of attention." To facilitate that process, Stallman says he once enrolled in Toastmasters, an organization that helps members bolster their public-speaking skills and one Stallman recommends highly to others. He possesses a stage presence that would be the envy of most theatrical performers and feels a link to vaudevillians of years past. A few days after the Maui High Performance Computing Center speech, I allude to the 1999 LinuxWorld performace and ask Stallman if he has a Groucho Marx complex-i.e., the unwillingness to belong to any club that would have him as a member. Stallman's response is immediate: "No, but I admire Groucho Marx in a lot of ways and certainly have been in some things I say inspired by him. But then I've also been inspired in some ways by Harpo."
+
+The Groucho Marx influence is certainly evident in Stallman's lifelong fondness for punning. Then again, punning and wordplay are common hacker traits. Perhaps the most Groucho-like aspect of Stallman's personality, however, is the deadpan manner in which the puns are delivered. Most come so stealthily-without even the hint of a raised eyebrow or upturned smile-you almost have to wonder if Stallman's laughing at his audience more than the audience is laughing at him.
+
+Watching members of the Maui High Performance Computer Center laugh at the St. Ignucius parody, such concerns evaporate. While not exactly a standup act, Stallman certainly possesses the chops to keep a roomful of engineers in stitches. "To be a saint in the Church of Emacs does not require celibacy, but it does require making a commitment to living a life of moral purity," he tells the Maui audience. "You must exorcise the evil proprietary operating system from all your computer and then install a wholly [holy] free operating system. And then you must install only free software on top of that. If you make this commitment and live by it, then you too will be a saint in the Church of Emacs, and you too may have a halo."
+
+The St. Ignucius skit ends with a brief inside joke. On most Unix systems and Unix-related offshoots, the primary competitor program to Emacs is vi, a text-editing program developed by former UC Berkeley student and current Sun Microsystems chief scientist, Bill Joy. Before doffing his "halo," Stallman pokes fun at the rival program. "People sometimes ask me if it is a sin in the Church of Emacs to use vi," he says. "Using a free version of vi is not a sin; it is a penance. So happy hacking."
+
+After a brief question-and-answer session, audience members gather around Stallman. A few ask for autographs. "I'll sign this," says Stallman, holding up one woman's print out of the GNU General Public License, "but only if you promise me to use the term GNU/Linux instead of Linux and tell all your friends to do likewise."
+
+The comment merely confirms a private observation. Unlike other stage performers and political figures, Stallman has no "off" mode. Aside from the St. Ignucius character, the ideologue you see onstage is the ideologue you meet backstage. Later that evening, during a dinner conversation in which a programmer mentions his affinity for "open source" programs, Stallman, between bites, upbraids his tablemate: "You mean free software. That's the proper way to refer to it."
+
+During the question-and-answer session, Stallman admits to playing the pedagogue at times. "There are many people who say, `Well, first let's invite people to join the community, and then let's teach them about freedom.' And that could be a reasonable strategy, but what we have is almost everybody's inviting people to join the community, and hardly anybody's teaching them about freedom once they come in."
+
+The result, Stallman says, is something akin to a third-world city. People move in, hoping to strike it rich or at the very least to take part in a vibrant, open culture, and yet those who hold the true power keep evolving new tricks and strategies-i.e., software patents-to keep the masses out. "You have millions of people moving in and building shantytowns, but nobody's working on step two: getting them out of those shantytowns. If you think talking about software freedom is a good strategy, please join in doing step two. There are plenty working on step one. We need more people working on step two."
+
+Working on "step two" means driving home the issue that freedom, not acceptance, is the root issue of the free software movement. Those who hope to reform the proprietary software industry from the inside are on a fool's errand. "Change from the inside is risky," Stallman stays. "Unless you're working at the level of a Gorbachev, you're going to be neutralized."
+
+Hands pop up. Stallman points to a member of the golf shirt-wearing contingent. "Without patents, how would you suggest dealing with commercial espionage?"
+
+"Well, those two questions have nothing to do with each other, really," says Stallman.
+
+"But I mean if someone wants to steal another company's piece of software."
+
+Stallman's recoils as if hit by a poisonous spray. "Wait a second," Stallman says. "Steal? I'm sorry, there's so much prejudice in that statement that the only thing I can say is that I reject that prejudice. Companies that develop nonfree software and other things keep lots and lots of trade secrets, and so that's not really likely to change. In the old days-even in the 1980s-for the most part programmers were not aware that there were even software patents and were paying no attention to them. What happened was that people published the interesting ideas, and if they were not in the free software movement, they kept secret the little details. And now they patent those broad ideas and keep secret the little details. So as far as what you're describing, patents really make no difference to it one way or another."
+
+"But if it doesn't affect their publication," a new audience member jumps in, his voice trailing off almost as soon as he starts speaking.
+
+"But it does," Stallman says. "Their publication is telling you that this is an idea that's off limits to the rest of the community for 20 years. And what the hell good is that? Besides, they've written it in such a hard way to read, both to obfuscate the idea and to make the patent as broad as possible, that it's basically useless looking at the published information to learn anything anyway. The only reason to look at patents is to see the bad news of what you can't do."
+
+The audience falls silent. The speech, which began at 3:15, is now nearing the 5:00 whistle, and most listeners are already squirming in their seats, antsy to get a jump start on the weekend. Sensing the fatigue, Stallman glances around the room and hastily shuts things down. "So it looks like we're done," he says, following the observation with an auctioneer's "going, going, gone" to flush out any last-minute questioners. When nobody throws their hand up, Stallman signs off with a traditional exit line.
+
+"Happy hacking," he says.
+
+1~ Chapter 9 - The GNU General Public License
+
+By the spring of 1985, Richard Stallman had settled on the GNU Project's first milestone-a Lisp-based free software version of Emacs. To meet this goal, however, he faced two challenges. First, he had to rebuild Emacs in a way that made it platform independent. Second, he had to rebuild the Emacs Commune in a similar fashion.
+
+The dispute with UniPress had highlighted a flaw in the Emacs Commune social contract. Where users relied on Stallman's expert insight, the Commune's rules held. In areas where Stallman no longer held the position of alpha hacker-pre-1984 Unix systems, for example-individuals and companies were free to make their own rules.
+
+The tension between the freedom to modify and the freedom to exert authorial privilege had been building before GOSMACS. The Copyright Act of 1976 had overhauled U.S. copyright law, extending the legal protection of copyright to software programs. According to Section 102(b) of the Act, individuals and companies now possessed the ability to copyright the "expression" of a software program but not the "actual processes or methods embodied in the program."~{ See Hal Abelson, Mike Fischer, and Joanne Costello, "Software and Copyright Law," updated version (1998).<br> http://www.swiss.ai.mit.edu/6805/articles/int-prop/software-copyright.html }~ Translated, programmers and companies had the ability to treat software programs like a story or song. Other programmers could take inspiration from the work, but to make a direct copy or nonsatirical derivative, they first had to secure permission from the original creator. Although the new law guaranteed that even programs without copyright notices carried copyright protection, programmers quickly asserted their rights, attaching coypright notices to their software programs.
+
+At first, Stallman viewed these notices with alarm. Rare was the software program that didn't borrow source code from past programs, and yet, with a single stroke of the president's pen, Congress had given programmers and companies the power to assert individual authorship over communally built programs. It also injected a dose of formality into what had otherwise been an informal system. Even if hackers could demonstrate how a given program's source-code bloodlines stretched back years, if not decades, the resources and money that went into battling each copyright notice were beyond most hackers' means. Simply put, disputes that had once been settled hacker-to-hacker were now settled lawyer-to-lawyer. In such a system, companies, not hackers, held the automatic advantage.
+
+Proponents of software copyright had their counter-arguments: without copyright, works might otherwise slip into the public domain. Putting a copyright notice on a work also served as a statement of quality. Programmers or companies who attached their name to the copyright attached their reputations as well. Finally, it was a contract, as well as a statement of ownership. Using copyright as a flexible form of license, an author could give away certain rights in exchange for certain forms of behavior on the part of the user. For example, an author could give away the right to suppress unauthorized copies just so long as the end user agreed not to create a commercial offshoot.
+
+It was this last argument that eventually softened Stallman's resistance to software copyright notices. Looking back on the years leading up to the GNU Project, Stallman says he began to sense the beneficial nature of copyright sometime around the release of Emacs 15.0, the last significant pre-GNU Project upgrade of Emacs. "I had seen email messages with copyright notices plus simple `verbatim copying permitted' licenses," Stallman recalls. "Those definitely were [an] inspiration."
+
+For Emacs 15, Stallman drafted a copyright that gave users the right to make and distribute copies. It also gave users the right to make modified versions, but not the right to claim sole ownership of those modified versions, as in the case of GOSMACS.
+
+Although helpful in codifying the social contract of the Emacs Commune, the Emacs 15 license remained too "informal" for the purposes of the GNU Project, Stallman says. Soon after starting work on a GNU version of Emacs, Stallman began consulting with the other members of the Free Software Foundation on how to shore up the license's language. He also consulted with the attorneys who had helped him set up the Free Software Foundation.
+
+Mark Fischer, a Boston attorney specializing in intellectual-property law, recalls discussing the license with Stallman during this period. "Richard had very strong views about how it should work," Fischer says, "He had two principles. The first was to make the software absolutely as open as possible. The second was to encourage others to adopt the same licensing practices."
+
+Encouraging others to adopt the same licensing practices meant closing off the escape hatch that had allowed privately owned versions of Emacs to emerge. To close that escape hatch, Stallman and his free software colleagues came up with a solution: users would be free to modify GNU Emacs just so long as they published their modifications. In addition, the resulting "derivative" works would also have carry the same GNU Emacs License.
+
+The revolutionary nature of this final condition would take a while to sink in. At the time, Fischer says, he simply viewed the GNU Emacs License as a simple contract. It put a price tag on GNU Emacs' use. Instead of money, Stallman was charging users access to their own later modifications. That said, Fischer does remember the contract terms as unique.
+
+"I think asking other people to accept the price was, if not unique, highly unusual at that time," he says.
+
+The GNU Emacs License made its debut when Stallman finally released GNU Emacs in 1985. Following the release, Stallman welcomed input from the general hacker community on how to improve the license's language. One hacker to take up the offer was future software activist John Gilmore, then working as a consultant to Sun Microsystems. As part of his consulting work, Gilmore had ported Emacs over to SunOS, the company's in-house version of Unix. In the process of doing so, Gilmore had published the changes as per the demands of the GNU Emacs License. Instead of viewing the license as a liability, Gilmore saw it as clear and concise expression of the hacker ethos. "Up until then, most licenses were very informal," Gilmore recalls.
+
+As an example of this informality, Gilmore cites a copyright notice for trn, a Unix utility. Written by Larry Wall, future creator of the Perl programming language, patch made it simple for Unix programmers to insert source-code fixes-" patches" in hacker jargon-into any large program. Recognizing the utility of this feature, Wall put the following copyright notice in the program's accompanying README file:
+
+% previous markup as 'poem' with footnote not satisfactory
+
+Copyright (c) 1985, Larry Wall<br>
+You may copy the trn kit in whole or in part as long as you don't try
+to make money off it, or pretend that you wrote it.~{ See Trn Kit README.<br> http://www.za.debian.org/doc/trn/trn-readme }~
+
+Such statements, while reflective of the hacker ethic, also reflected the difficulty of translating the loose, informal nature of that ethic into the rigid, legal language of copyright. In writing the GNU Emacs License, Stallman had done more than close up the escape hatch that permitted proprietary offshoots. He had expressed the hacker ethic in a manner understandable to both lawyer and hacker alike.
+
+It wasn't long, Gilmore says, before other hackers began discussing ways to "port" the GNU Emacs License over to their own programs. Prompted by a conversation on Usenet, Gilmore sent an email to Stallman in November, 1986, suggesting modification:
+
+_1 You should probably remove "EMACS" from the license and replace it with "SOFTWARE" or something. Soon, we hope, Emacs will not be the biggest part of the GNU system, and the license applies to all of it.~{ See John Gilmore, quoted from email to author. }~
+
+Gilmore wasn't the only person suggesting a more general approach. By the end of 1986, Stallman himself was at work with GNU Project's next major milestone, a source-code debugger, and was looking for ways to revamp the Emacs license so that it might apply to both programs. Stallman's solution: remove all specific references to Emacs and convert the license into a generic copyright umbrella for GNU Project software. The GNU General Public License, GPL for short, was born.
+
+In fashioning the GPL, Stallman followed the software convention of using decimal numbers to indicate prototype versions and whole numbers to indicate mature versions. Stallman published Version 1.0 of the GPL in 1989 (a project Stallman was developing in 1985), almost a full year after the release of the GNU Debugger, Stallman's second major foray into the realm of Unix programming. The license contained a preamble spelling out its political intentions:
+
+poem{
+
+The General Public License is designed to make sure that you have
+the freedom to give away or sell copies of free software, that you
+receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you
+know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the software, or if you modify it.
+
+}poem ~{ See Richard Stallman, et al., "GNU General Public License: Version 1," (February, 1989).<br> http://www.gnu.org/copyleft/copying-1.0.html }~
+
+In fashioning the GPL, Stallman had been forced to make an additional adjustment to the informal tenets of the old Emacs Commune. Where he had once demanded that Commune members publish any and all changes, Stallman now demanded publication only in instances when programmers circulated their derivative versions in the same public manner as Stallman. In other words, programmers who simply modified Emacs for private use no longer needed to send the source-code changes back to Stallman. In what would become a rare compromise of free software doctrine, Stallman slashed the price tag for free software. Users could innovate without Stallman looking over their shoulders just so long as they didn't bar Stallman and the rest of the hacker community from future exchanges of the same program.
+
+Looking back, Stallman says the GPL compromise was fueled by his own dissatisfaction with the Big Brother aspect of the original Emacs Commune social contract. As much as he liked peering into other hackers' systems, the knowledge that some future source-code maintainer might use that power to ill effect forced him to temper the GPL.
+
+"It was wrong to require people to publish all changes," says Stallman. "It was wrong to require them to be sent to one privileged developer. That kind of centralization and privilege for one was not consistent with a society in which all had equal rights."
+
+As hacks go, the GPL stands as one of Stallman's best. It created a system of communal ownership within the normally proprietary confines of copyright law. More importantly, it demonstrated the intellectual similarity between legal code and software code. Implicit within the GPL's preamble was a profound message: instead of viewing copyright law with suspicion, hackers should view it as yet another system begging to be hacked.
+
+"The GPL developed much like any piece of free software with a large community discussing its structure, its respect or the opposite in their observation, needs for tweaking and even to compromise it mildly for greater acceptance," says Jerry Cohen, another attorney who helped Stallman with the creation of the license. "The process worked very well and GPL in its several versions has gone from widespread skeptical and at times hostile response to widespread acceptance."
+
+In a 1986 interview with Byte magazine, Stallman summed up the GPL in colorful terms. In addition to proclaiming hacker values, Stallman said, readers should also "see it as a form of intellectual jujitsu, using the legal system that software hoarders have set up against them."~{ See David Betz and Jon Edwards, "Richard Stallman discusses his public-domain [sic] Unix-compatible software system with BYTE editors," BYTE (July, 1996). (Reprinted on the GNU Project web site: http://www.gnu.org/gnu/byte-interview.html )<br>This interview offers an interesting, not to mention candid, glimpse at Stallman's political attitudes during the earliest days of the GNU Project. It is also helpful in tracing the evolution of Stallman's rhetoric.<br>Describing the purpose of the GPL, Stallman says, "I'm trying to change the way people approach knowledge and information in general. I think that to try to own knowledge, to try to control whether people are allowed to use it, or to try to stop other people from sharing it, is sabotage."<br>Contrast this with a statement to the author in August 2000: "I urge you not to use the term `intellectual property' in your thinking. It will lead you to misunderstand things, because that term generalizes about copyrights, patents, and trademarks. And those things are so different in their effects that it is entirely foolish to try to talk about them at once. If you hear somebody saying something about intellectual property, without quotes, then he's not thinking very clearly and you shouldn't join." }~ Years later, Stallman would describe the GPL's creation in less hostile terms. "I was thinking about issues that were in a sense ethical and in a sense political and in a sense legal," he says. "I had to try to do what could be sustained by the legal system that we're in. In spirit the job was that of legislating the basis for a new society, but since I wasn't a government, I couldn't actually change any laws. I had to try to do this by building on top of the existing legal system, which had not been designed for anything like this."
+
+About the time Stallman was pondering the ethical, political, and legal issues associated with free software, a California hacker named Don Hopkins mailed him a manual for the 68000 microprocessor. Hopkins, a Unix hacker and fellow science-fiction buff, had borrowed the manual from Stallman a while earlier. As a display of gratitude, Hopkins decorated the return envelope with a number of stickers obtained at a local science-fiction convention. One sticker in particular caught Stallman's eye. It read, "Copyleft (L), All Rights Reversed." Following the release of the first version of GPL, Stallman paid tribute to the sticker, nicknaming the free software license "Copyleft." Over time, the nickname and its shorthand symbol, a backwards "C," would become an official Free Software Foundation synonym for the GPL.
+
+The German sociologist Max Weber once proposed that all great religions are built upon the "routinization" or "institutionalization" of charisma. Every successful religion, Weber argued, converts the charisma or message of the original religious leader into a social, political, and ethical apparatus more easily translatable across cultures and time.
+
+While not religious per se, the GNU GPL certainly qualifies as an interesting example of this "routinization" process at work in the modern, decentralized world of software development. Since its unveiling, programmers and companies who have otherwise expressed little loyalty or allegiance to Stallman have willingly accepted the GPL bargain at face value. A few have even accepted the GPL as a preemptive protective mechanism for their own software programs. Even those who reject the GPL contract as too compulsory, still credit it as influential.
+
+One hacker falling into this latter group was Keith Bostic, a University of California employee at the time of the GPL 1.0 release. Bostic's department, the Computer Systems Research Group (SRG), had been involved in Unix development since the late 1970s and was responsible for many key parts of Unix, including the TCP/IP networking protocol, the cornerstone of modern Internet communications. By the late 1980s, AT&T, the original owner of the Unix brand name, began to focus on commercializing Unix and began looking to the Berkeley Software Distribution, or BSD, the academic version of Unix developed by Bostic and his Berkeley peers, as a key source of commercial technology.
+
+Although the Berkeley BSD source code was shared among researchers and commercial programmers with a source-code license, this commercialization presented a problem. The Berkeley code was intermixed with proprietary AT&T code. As a result, Berkeley distributions were available only to institutions that already had a Unix source license from AT&T. As AT&T raised its license fees, this arrangement, which had at first seemed innocuous, became increasingly burdensome.
+
+Hired in 1986, Bostic had taken on the personal project of porting BSD over to the Digital Equipment Corporation's PDP-11 computer. It was during this period, Bostic says, that he came into close interaction with Stallman during Stallman's occasional forays out to the west coast. "I remember vividly arguing copyright with Stallman while he sat at borrowed workstations at CSRG," says Bostic. "We'd go to dinner afterward and continue arguing about copyright over dinner."
+
+The arguments eventually took hold, although not in the way Stallman would have liked. In June, 1989, Berkeley separated its networking code from the rest of the AT&T-owned operating system and distributed it under a University of California license. The contract terms were liberal. All a licensee had to do was give credit to the university in advertisements touting derivative programs.~{ The University of California's "obnoxious advertising clause" would later prove to be a problem. Looking for a less restrictive alternative to the GPL, some hackers used the University of California, replacing "University of California" with the name of their own instution. The result: free software programs that borrowed from dozens of other programs would have to cite dozens of institutions in advertisements. In 1999, after a decade of lobbying on Stallman's part, the University of California agreed to drop this clause.<br>See "The BSD License Problem" at http://www.gnu.org/philosophy/bsd.html. }~ In contrast to the GPL, proprietary offshoots were permissible. Only one problem hampered the license's rapid adoption: the BSD Networking release wasn't a complete operating system. People could study the code, but it could only be run in conjunction with other proprietary-licensed code.
+
+Over the next few years, Bostic and other University of California employees worked to replace the missing components and turn BSD into a complete, freely redistributable operating system. Although delayed by a legal challenge from Unix Systems Laboratories-the AT&T spin-off that retained ownership of the Unix brand name-the effort would finally bear fruit in the early 1990s. Even before then, however, many of the Berkeley utilities would make their way into Stallman's GNU Project.
+
+"I think it's highly unlikely that we ever would have gone as strongly as we did without the GNU influence," says Bostic, looking back. "It was clearly something where they were pushing hard and we liked the idea."
+
+By the end of the 1980s, the GPL was beginning to exert a gravitational effect on the free software community. A program didn't have to carry the GPL to qualify as free software-witness the case of the BSD utilities-but putting a program under the GPL sent a definite message. "I think the very existence of the GPL inspired people to think through whether they were making free software, and how they would license it," says Bruce Perens, creator of Electric Fence, a popular Unix utility, and future leader of the Debian GNU/Linux development team. A few years after the release of the GPL, Perens says he decided to discard Electric Fence's homegrown license in favor of Stallman's lawyer-vetted copyright. "It was actually pretty easy to do," Perens recalls.
+
+Rich Morin, the programmer who had viewed Stallman's initial GNU announcement with a degree of skepticism, recalls being impressed by the software that began to gather under the GPL umbrella. As the leader of a SunOS user group, one of Morin's primary duties during the 1980s had been to send out distribution tapes containing the best freeware or free software utilities. The job often mandated calling up original program authors to verify whether their programs were copyright protected or whether they had been consigned to the public domain. Around 1989, Morin says, he began to notice that the best software programs typically fell under the GPL license. "As a software distributor, as soon as I saw the word GPL, I knew I was home free," recalls Morin.
+
+To compensate for the prior hassles that went into compiling distribution tapes to the Sun User Group, Morin had charged recipients a convenience fee. Now, with programs moving over to the GPL, Morin was suddenly getting his tapes put together in half the time, turning a tidy profit in the process. Sensing a commercial opportunity, Morin rechristened his hobby as a business: Prime Time Freeware.
+
+Such commercial exploitation was completely within the confines of the free software agenda. "When we speak of free software, we are referring to freedom, not price," advised Stallman in the GPL's preamble. By the late 1980s, Stallman had refined it to a more simple mnemonic: "Don't think free as in free beer; think free as in free speech."
+
+For the most part, businesses ignored Stallman's entreaties. Still, for a few entrepreneurs, the freedom associated with free software was the same freedom associated with free markets. Take software ownership out of the commercial equation, and you had a situation where even the smallest software company was free to compete against the IBMs and DECs of the world.
+
+One of the first entrepreneurs to grasp this concept was Michael Tiemann, a software programmer and graduate student at Stanford University. During the 1980s, Tiemann had followed the GNU Project like an aspiring jazz musician following a favorite artist. It wasn't until the release of the GNU C Compiler in 1987, however, that he began to grasp the full potential of free software. Dubbing GCC a "bombshell," Tiemann says the program's own existence underlined Stallman's determination as a programmer.
+
+"Just as every writer dreams of writing the great American novel, every programmer back in the 1980s talked about writing the great American compiler," Tiemman recalls. "Suddenly Stallman had done it. It was very humbling."
+
+"You talk about single points of failure, GCC was it," echoes Bostic. "Nobody had a compiler back then, until GCC came along."
+
+Rather than compete with Stallman, Tiemann decided to build on top of his work. The original version of GCC weighed in at 110,000 lines of code, but Tiemann recalls the program as surprisingly easy to understand. So easy in fact that Tiemann says it took less than five days to master and another week to port the software to a new hardware platform, National Semiconductor's 32032 microchip. Over the next year, Tiemann began playing around with the source code, creating a native compiler for the C+ programming language. One day, while delivering a lecture on the program at Bell Labs, Tiemann ran into some AT&T developers struggling to pull off the same thing.
+
+"There were about 40 or 50 people in the room, and I asked how many people were working on the native code compiler," Tiemann recalls. "My host said the information was confidential but added that if I took a look around the room I might get a good general idea."
+
+It wasn't long after, Tiemann says, that the light bulb went off in his head. "I had been working on that project for six months," Tiemann says. I just thought to myself, whether it's me or the code this is a level of efficiency that the free market should be ready to reward."
+
+Tiemann found added inspiration in the GNU Manifesto, which, while excoriating the greed of some software vendors, encourages other vendors to consider the advantages of free software from a consumer point of view. By removing the power of monopoly from the commerical software question, the GPL makes it possible for the smartest vendors to compete on the basis of service and consulting, the two most profit-rich corners of the software marketplace.
+
+In a 1999 essay, Tiemann recalls the impact of Stallman's Manifesto. "It read like a socialist polemic, but I saw something different. I saw a business plan in disguise."~{ See Michael Tiemann, "Future of Cygnus Solutions: An Entrepreneur's Account," Open Sources (O'Reilly & Associates, Inc., 1999): 139. }~
+
+Teaming up with John Gilmore, another GNU Project fan, Tiemann launched a software consulting service dedicated to customizing GNU programs. Dubbed Cygnus Support, the company signed its first development contract in February, 1990. By the end of the year, the company had $725,000 worth of support and development contracts.
+
+GNU Emacs, GDB, and GCC were the "big three" of developer-oriented tools, but they weren't the only ones developed by Stallman during the GNU Project's first half decade. By 1990, Stallman had also generated GNU versions of the Bourne Shell (rechristened the Bourne Again Shell, or BASH), YACC (rechristened Bison), and awk (rechristened gawk). Like GCC , every GNU program had to be designed to run on multiple systems, not just a single vendor's platform. In the process of making programs more flexible, Stallman and his collaborators often made them more useful as well.
+
+Recalling the GNU universalist approach, Prime Time Freeware's Morin points to a critical, albeit mundane, software package called hello. "It's the hello world program which is five lines of C, packaged up as if it were a GNU distribution," Morin says. "And so it's got the Texinfo stuff and the configure stuff. It's got all the other software engineering goo that the GNU Project has come up with to allow packages to port to all these different environments smoothly. That's tremendously important work, and it affects not only all of [Stallman's] software, but also all of the other GNU Project software."
+
+According to Stallman, improving software programs was secondary to building them in the first place. "With each piece I may or may not find a way to improve it," said Stallman to Byte. "To some extent I am getting the benefit of reimplementation, which makes many systems much better. To some extent it's because I have been in the field a long time and worked on many other systems. I therefore have many ideas to bring to bear."~{ See Richard Stallman, BYTE (1986). }~
+
+Nevertheless, as GNU tools made their mark in the late 1980s, Stallman's AI Lab-honed reputation for design fastidiousness soon became legendary throughout the entire software-development community.
+
+Jeremy Allison, a Sun user during the late 1980s and programmer destined to run his own free software project, Samba, in the 1990s, recalls that reputation with a laugh. During the late 1980s, Allison began using Emacs. Inspired by the program's community-development model, Allison says he sent in a snippet of source code only to have it rejected by Stallman.
+
+"It was like the Onion headline," Allison says. "`Child's prayers to God answered: No.'"
+
+Stallman's growing stature as a software programmer, however, was balanced by his struggles as a project manager. Although the GNU Project moved from success to success in creation of developer-oriented tools, its inability to generate a working kernel-the central "traffic cop" program in all Unix systems that determines which devices and applications get access to the microprocessor and when-was starting to elicit grumbles as the 1980s came to a close. As with most GNU Project efforts, Stallman had started kernel development by looking for an existing program to modify. According to a January 1987 "Gnusletter," Stallman was already working to overhaul TRIX, a Unix kernel developed at MIT.
+
+A review of GNU Project "GNUsletters" of the late 1980s reflects the management tension. In January, 1987, Stallman announced to the world that the GNU Project was working to overhaul TRIX, a Unix kernel developed at MIT. A year later, in February of 1988, the GNU Project announced that it had shifted its attentions to Mach, a lightweight "micro-kernel" developed at Carnegie Mellon. All told, however, official GNU Project kernel development wouldn't commence until 1990.~{ See "HURD History."<br> http://www.gnu.org/software/hurd/history.html }~
+
+The delays in kernel development were just one of many concerns weighing on Stallman during this period. In 1989, Lotus Development Corporation filed suit against rival software company, Paperback Software International, for copying menu commands in Lotus' popular 1-2-3 Spreadsheet program. Lotus' suit, coupled with the Apple -Microsoft "look and feel" battle, provided a troublesome backdrop for the GNU Project. Although both suits fell outside the scope of the GNU Project, both revolved around operating systems and software applications developed for the personal computer, not Unix-compatible hardware systems-they threatened to impose a chilling effect on the entire culture of software development. Determined to do something, Stallman recruited a few programmer friends and composed a magazine ad blasting the lawsuits. He then followed up the ad by helping to organize a group to protest the corporations filing the suit. Calling itself the League of Programming Freedom, the group held protests outside the offices of Lotus, Inc. and the Boston courtroom hosting the Lotus trial.
+
+The protests were notable.~{ According to a League of Programming Freedom Press, the protests were notable for featuring the first hexadecimal protest chant:<br>1-2-3-4, toss the lawyers out the door;<br>5-6-7-8, innovate don't litigate;<br>9-A-B-C, 1-2-3 is not for me;<br>D-E-F-O, look and feel have got to go<br> http://lpf.ai.mit.edu/Links/prep.ai.mit.edu/demo.final.release }~ They document the evolving nature of software industry. Applications had quietly replaced operating systems as the primary corporate battleground. In its unfulfilled quest to build a free software operating system, the GNU Project seemed hopelessly behind the times. Indeed, the very fact that Stallman had felt it necessary to put together an entirely new group dedicated to battling the "look and feel" lawsuits reinforced that obsolescence in the eyes of some observers.
+
+In 1990, the John D. and Catherine T. MacArthur Foundation cerified Stallman's genius status when it granted Stallman a MacArthur fellowship, therefore making him a recipient for the organization's so-called "genius grant." The grant, a $240,000 reward for launching the GNU Project and giving voice to the free software philosophy, relieved a number of short-term concerns. First and foremost, it gave Stallman, a nonsalaried employee of the FSF who had been supporting himself through consulting contracts, the ability to devote more time to writing GNU code.~{ I use the term "writing" here loosely. About the time of the MacArthur award, Stallman began suffering chronic pain in his hands and was dictating his work to FSF-employed typists. Although some have speculated that the hand pain was the result of repetitive stress injury, or RSI, an injury common among software programmers, Stallman is not 100% sure. "It was NOT carpal tunnel syndrome," he writes. "My hand problem was in the hands themselves, not in the wrists." Stallman has since learned to work without typists after switching to a keyboard with a lighter touch. }~
+
+Ironically, the award also made it possible for Stallman to vote. Months before the award, a fire in Stallman's apartment house had consumed his few earthly possessions. By the time of the award, Stallman was listing himself as a "squatter"~{ See Reuven Lerner, "Stallman wins $240,000 MacArthur award," MIT, The Tech (July 18, 1990).
+http://the-tech.mit.edu/V110/N30/rms.30n.html }~ at 545 Technology Square. "[The registrar of voters] didn't want to accept that as my address," Stallman would later recall. "A newspaper article about the MacArthur grant said that and then they let me register."~{ See Michael Gross, "Richard Stallman: High School Misfit, Symbol of Free Software, MacArthur-certified Genius" (1999). }~
+
+Most importantly, the MacArthur money gave Stallman more freedom. Already dedicated to the issue of software freedom, Stallman chose to use the additional freedom to increase his travels in support of the GNU Project mission.
+
+Interestingly, the ultimate success of the GNU Project and the free software movement in general would stem from one of these trips. In 1990, Stallman paid a visit to the Polytechnic University in Helsinki, Finland. Among the audience members was 21-year-old Linus Torvalds, future developer of the Linux kernel-the free software kernel destined to fill the GNU Project's most sizable gap.
+
+A student at the nearby University of Helsinki at the time, Torvalds regarded Stallman with bemusement. "I saw, for the first time in my life, the stereotypical long-haired, bearded hacker type," recalls Torvalds in his 2001 autobiography Just for Fun. "We don't have much of them in Helsinki."~{ See Linus Torvalds and David Diamond, Just For Fun: The Story of an Accidentaly Revolutionary (HarperCollins Publishers, Inc., 2001): 58-59. }~
+
+While not exactly attuned to the "sociopolitical" side of the Stallman agenda, Torvalds nevertheless appreciated the agenda's underlying logic: no programmer writes error-free code. By sharing software, hackers put a program's improvement ahead of individual motivations such as greed or ego protection.
+
+Like many programmers of his generation, Torvalds had cut his teeth not on mainframe computers like the IBM 7094, but on a motley assortment of home-built computer systems. As university student, Torvalds had made the step up from C programming to Unix, using the university's MicroVAX. This ladder-like progression had given Torvalds a different perspective on the barriers to machine access. For Stallman, the chief barriers were bureaucracy and privilege. For Torvalds, the chief barriers were geography and the harsh Helsinki winter. Forced to trek across the University of Helsinki just to log in to his Unix account, Torvalds quickly began looking for a way to log in from the warm confines of his off-campus apartment.
+
+The search led Torvalds to the operating system Minix, a lightweight version of Unix developed for instructional purposes by Dutch university professor Andrew Tanenbaum. The program fit within the memory confines of a 386 PC, the most powerful machine Torvalds could afford, but still lacked a few necessary features. It most notably lacked terminal emulation, the feature that allowed Torvalds' machine to mimic a university terminal, making it possible to log in to the MicroVAX from home.
+
+During the summer of 1991, Torvalds rewrote Minix from the ground up, adding other features as he did so. By the end of the summer, Torvalds was referring to his evolving work as the "GNU/Emacs of terminal emulation programs."~{ See Linus Torvalds and David Diamond, Just For Fun: The Story of an Accidentaly Revolutionary (HarperCollins Publishers, Inc., 2001): 78. }~ Feeling confident, he solicited a Minix newsgroup for copies of the POSIX standards, the software blue prints that determined whether a program was Unix compatible. A few weeks later, Torvalds was posting a message eerily reminiscent of Stallman's original 1983 GNU posting:
+
+poem{
+
+Hello everybody out there using minix-
+
+I'm doing a (free) operating system (just a hobby, won't be big and
+professional like gnu for 386 (486) AT clones). This has been brewing
+since April, and is starting to get ready. I'd like any feedback on
+things people like/dislike in minix, as my OS resembles it somewhat
+(same physical layout of the file-system (due to practical reasons)
+among other things).
+
+}poem~{ See "Linux 10th Anniversary."<br> http://www.linux10.org/history/ }~
+
+The posting drew a smattering of responses and within a month, Torvalds had posted a 0.01 version of the operating system-i.e., the earliest possible version fit for outside review-on an Internet FTP site. In the course of doing so, Torvalds had to come up with a name for the new system. On his own PC hard drive, Torvalds had saved the program as Linux, a name that paid its respects to the software convention of giving each Unix variant a name that ended with the letter X. Deeming the name too "egotistical," Torvalds changed it to Freax, only to have the FTP site manager change it back.
+
+Although Torvalds had set out build a full operating system, both he and other developers knew at the time that most of the functional tools needed to do so were already available, thanks to the work of GNU, BSD, and other free software developers. One of the first tools the Linux development team took advantage of was the GNU C Compiler, a tool that made it possible to process programs written in the C programming language.
+
+Integrating GCC improved the performance of Linux. It also raised issues. Although the GPL's "viral" powers didn't apply to the Linux kernel, Torvald's willingness to borrow GCC for the purposes of his own free software operating system indicated a certain obligation to let other users borrow back. As Torvalds would later put it: "I had hoisted myself up on the shoulders of giants."~{ See Linus Torvalds and David Diamond, Just For Fun: The Story of an Accidentaly Revolutionary (HarperCollins Publishers, Inc., 2001): 96-97. }~ Not surprisingly, he began to think about what would happen when other people looked to him for similar support. A decade after the decision, Torvalds echoes the Free Software Foundation's Robert Chassel when he sums up his thoughts at the time:
+
+_1 You put six months of your life into this thing and you want to make it available and you want to get something out of it, but you don't want people to take advantage of it. I wanted people to be able to see [Linux], and to make changes and improvements to their hearts' content. But I also wanted to make sure that what I got out of it was to see what they were doing. I wanted to always have access to the sources so that if they made improvements, I could make those improvements myself.~{ See Linus Torvalds and David Diamond, Just For Fun: The Story of an Accidentaly Revolutionary (HarperCollins Publishers, Inc., 2001): 94-95. }~
+
+When it was time to release the 0.12 version of Linux, the first to include a fully integrated version of GCC, Torvalds decided to voice his allegiance with the free software movement. He discarded the old kernel license and replaced it with the GPL. The decision triggered a porting spree, as Torvalds and his collaborators looked to other GNU programs to fold into the growing Linux stew. Within three years, Linux developers were offering their first production release, Linux 1.0, including fully modified versions of GCC, GDB, and a host of BSD tools.
+
+By 1994, the amalgamated operating system had earned enough respect in the hacker world to make some observers wonder if Torvalds hadn't given away the farm by switching to the GPL in the project's initial months. In the first issue of Linux Journal, publisher Robert Young sat down with Torvalds for an interview. When Young asked the Finnish programmer if he felt regret at giving up private ownership of the Linux source code, Torvalds said no. "Even with 20/20 hindsight," Torvalds said, he considered the GPL "one of the very best design decisions" made during the early stages of the Linux project.~{ See Robert Young, "Interview with Linus, the Author of Linux," Linux Journal (March 1, 1994).<br> http://www.linuxjournal.com/article.php?sid=2736 }~
+
+That the decision had been made with zero appeal or deference to Stallman and the Free Software Foundation speaks to the GPL's growing portability. Although it would take a few years to be recognized by Stallman, the explosiveness of Linux development conjured flashbacks of Emacs. This time around, however, the innovation triggering the explosion wasn't a software hack like Control-R but the novelty of running a Unix-like system on the PC architecture. The motives may have been different, but the end result certainly fit the ethical specifications: a fully functional operating system composed entirely of free software.
+
+As his initial email message to the comp.os.minix newsgroup indicates, it would take a few months before Torvalds saw Linux as anything less than a holdover until the GNU developers delivered on the HURD kernel. This initial unwillingness to see Linux in political terms would represent a major blow to the Free Software Foundation.
+
+As far as Torvalds was concerned, he was simply the latest in a long line of kids taking apart and reassembling things just for fun. Nevertheless, when summing up the runaway success of a project that could have just as easily spent the rest of its days on an abandoned computer hard drive, Torvalds credits his younger self for having the wisdom to give up control and accept the GPL bargain.
+
+"I may not have seen the light," writes Torvalds, reflecting on Stallman's 1991 Polytechnic University speech and his subsequent decision to switch to the GPL. "But I guess something from his speech sunk in ."~{ See Linus Torvalds and David Diamond, Just For Fun: The Story of an Accidentaly Revolutionary (HarperCollins Publishers, Inc., 2001): 59. }~
+
+1~ Chapter 10 - GNU/Linux
+
+By 1993, the free software movement was at a crossroads. To the optimistically inclined, all signs pointed toward success for the hacker culture. Wired magazine, a funky, new publication offering stories on data encryption, Usenet, and software freedom, was flying off magazine racks. The Internet, once a slang term used only by hackers and research scientists, had found its way into mainstream lexicon. Even President Clinton was using it. The personal computer, once a hobbyist's toy, had grown to full-scale respectability, giving a whole new generation of computer users access to hacker-built software. And while the GNU Project had not yet reached its goal of a fully intact, free software operating system, curious users could still try Linux in the interim.
+
+Any way you sliced it, the news was good, or so it seemed. After a decade of struggle, hackers and hacker values were finally gaining acceptance in mainstream society. People were getting it.
+
+Or were they? To the pessimistically inclined, each sign of acceptance carried its own troubling countersign. Sure, being a hacker was suddenly cool, but was cool good for a community that thrived on alienation? Sure, the White House was saying all the right things about the Internet, even going so far as to register its own domain name, whitehouse.gov, but it was also meeting with the companies, censorship advocates, and law-enforcement officials looking to tame the Internet's Wild West culture. Sure, PCs were more powerful, but in commoditizing the PC marketplace with its chips, Intel had created a situation in which proprietary software vendors now held the power. For every new user won over to the free software cause via Linux, hundreds, perhaps thousands, were booting up Microsoft Windows for the first time.
+
+Finally, there was the curious nature of Linux itself. Unrestricted by design bugs (like GNU) and legal disputes (like BSD), Linux' high-speed evolution had been so unplanned, its success so accidental, that programmers closest to the software code itself didn't know what to make of it. More compilation album than operating system, it was comprised of a hacker medley of greatest hits: everything from GCC, GDB, and glibc (the GNU Project's newly developed C Library) to X (a Unix-based graphic user interface developed by MIT's Laboratory for Computer Science) to BSD-developed tools such as BIND (the Berkeley Internet Naming Daemon, which lets users substitute easy-to-remember Internet domain names for numeric IP addresses) and TCP/IP. The arch's capstone, of course, was the Linux kernel-itself a bored-out, super-charged version of Minix. Rather than building their operating system from scratch, Torvalds and his rapidly expanding Linux development team had followed the old Picasso adage, "good artists borrow; great artists steal." Or as Torvalds himself would later translate it when describing the secret of his success: "I'm basically a very lazy person who likes to take credit for things other people actually do."~{ Torvalds has offered this quote in many different settings. To date, however, the quote's most notable appearance is in the Eric Raymond essay, "The Cathedral and the Bazaar" (May, 1997).<br> http://www.tuxedo.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/index.html }~
+
+Such laziness, while admirable from an efficiency perspective, was troubling from a political perspective. For one thing, it underlined the lack of an ideological agenda on Torvalds' part. Unlike the GNU developers, Torvalds hadn't built an operating system out of a desire to give his fellow hackers something to work with; he'd built it to have something he himself could play with. Like Tom Sawyer whitewashing a fence, Torvalds' genius lay less in the overall vision and more in his ability to recruit other hackers to speed the process.
+
+That Torvalds and his recruits had succeeded where others had not raised its own troubling question: what, exactly, was Linux? Was it a manifestation of the free software philosophy first articulated by Stallman in the GNU Manifesto? Or was it simply an amalgamation of nifty software tools that any user, similarly motivated, could assemble on his own home system?
+
+By late 1993, a growing number of Linux users had begun to lean toward the latter definition and began brewing private variations on the Linux theme. They even became bold enough to bottle and sell their variations-or "distributions"-to fellow Unix aficionados. The results were spotty at best.
+
+"This was back before Red Hat and the other commercial distributions," remembers Ian Murdock, then a computer science student at Purdue University. "You'd flip through Unix magazines and find all these business card-sized ads proclaiming `Linux.' Most of the companies were fly-by-night operations that saw nothing wrong with slipping a little of their own source code into the mix."
+
+Murdock, a Unix programmer, remembers being "swept away" by Linux when he first downloaded and installed it on his home PC system. "It was just a lot of fun," he says. "It made me want to get involved." The explosion of poorly built distributions began to dampen his early enthusiasm, however. Deciding that the best way to get involved was to build a version of Linux free of additives, Murdock set about putting a list of the best free software tools available with the intention of folding them into his own distribution. "I wanted something that would live up to the Linux name," Murdock says.
+
+In a bid to "stir up some interest," Murdock posted his intentions on the Internet, including Usenet's comp.os.linux newsgroup. One of the first responding email messages was from rms@ai.mit.edu. As a hacker, Murdock instantly recognized the address. It was Richard M. Stallman, founder of the GNU Project and a man Murdock knew even back then as "the hacker of hackers." Seeing the address in his mail queue, Murdock was puzzled. Why on Earth would Stallman, a person leading his own operating-system project, care about Murdock's gripes over Linux?
+
+Murdock opened the message.
+
+"He said the Free Software Foundation was starting to look closely at Linux and that the FSF was interested in possibly doing a Linux system, too. Basically, it looked to Stallman like our goals were in line with their philosophy."
+
+The message represented a dramatic about-face on Stallman's part. Until 1993, Stallman had been content to keep his nose out of the Linux community's affairs. In fact, he had all but shunned the renegade operating system when it first appeared on the Unix programming landscape in 1991. After receiving the first notification of a Unix-like operating system that ran on PCs, Stallman says he delegated the task of examining the new operating system to a friend. Recalls Stallman, "He reported back that the software was modeled after System V, which was the inferior version of Unix. He also told me it wasn't portable."
+
+The friend's report was correct. Built to run on 386-based machines, Linux was firmly rooted to its low-cost hardware platform. What the friend failed to report, however, was the sizable advantage Linux enjoyed as the only freely modifiable operating system in the marketplace. In other words, while Stallman spent the next three years listening to bug reports from his HURD team, Torvalds was winning over the programmers who would later uproot and replant the operating system onto new platforms.
+
+By 1993, the GNU Project's inability to deliver a working kernel was leading to problems both within the GNU Project and within the free software movement at large. A March, 1993, a Wired magazine article by Simson Garfinkel described the GNU Project as "bogged down" despite the success of the project's many tools.~{ See Simson Garfinkel, "Is Stallman Stalled?" Wired (March, 1993). }~ Those within the project and its nonprofit adjunct, the Free Software Foundation, remember the mood as being even worse than Garfinkel's article let on. "It was very clear, at least to me at the time, that there was a window of opportunity to introduce a new operating system," says Chassell. "And once that window was closed, people would become less interested. Which is in fact exactly what happened."~{ Chassel's concern about there being a 36-month "window" for a new operating system is not unique to the GNU Project. During the early 1990s, free software versions of the Berkeley Software Distribution were held up by Unix System Laboratories' lawsuit restricting the release of BSD-derived software. While many users consider BSD offshoots such as FreeBSD and OpenBSD to be demonstrably superior to GNU/Linux both in terms of performance and security, the number of FreeBSD and OpenBSD users remains a fraction of the total GNU/Linux user population.<br>To view a sample analysis of the relative success of GNU/Linux in relation to other free software operating systems, see the essay by New Zealand hacker, Liam Greenwood, "Why is Linux Successful" (1999). }~
+
+Much has been made about the GNU Project's struggles during the 1990-1993 period. While some place the blame on Stallman for those struggles, Eric Raymond, an early member of the GNU Emacs team and later Stallman critic, says the problem was largely institutional. "The FSF got arrogant," Raymond says. "They moved away from the goal of doing a production-ready operating system to doing operating-system research." Even worse, "They thought nothing outside the FSF could affect them."
+
+Murdock, a person less privy to the inner dealings of the GNU Project, adopts a more charitable view. "I think part of the problem is they were a little too ambitious and they threw good money after bad," he says. "Micro-kernels in the late 80s and early 90s were a hot topic. Unfortunately, that was about the time that the GNU Project started to design their kernel. They ended up with alot of baggage and it would have taken a lot of backpedaling to lose it."
+
+Stallman cites a number of issues when explaining the delay. The Lotus and Apple lawsuits had provided political distractions, which, coupled with Stallman's inability to type, made it difficult for Stallman to lend a helping hand to the HURD team. Stallman also cites poor communication between various portions of the GNU Project. "We had to do a lot of work to get the debugging environment to work," he recalls. "And the people maintaining GDB at the time were not that cooperative." Mostly, however, Stallman says he and the other members of the GNU Project team underestimated the difficulty of expanding the Mach microkernal into a full-fledged Unix kernel.
+
+"I figured, OK, the [Mach] part that has to talk to the machine has already been debugged," Stallman says, recalling the HURD team's troubles in a 2000 speech. "With that head start, we should be able to get it done faster. But instead, it turned out that debugging these asynchronous multithreaded programs was really hard. There were timing books that would clobber the files, and that's no fun. The end result was that it took many, many years to produce a test version."~{ See Maui High Performance Computing Center Speech. }~
+
+Whatever the excuse, or excuses, the concurrent success of the Linux-kernel team created a tense situation. Sure, the Linux kernel had been licensed under the GPL, but as Murdock himself had noted, the desire to treat Linux as a purely free software operating system was far from uniform. By late 1993, the total Linux user population had grown from a dozen or so Minix enthusiasts to somewhere between 20,000 and 100,000.~{ GNU/Linux user-population numbers are sketchy at best, which is why I've provided such a broad range. The 100,000 total comes from the Red Hat "Milestones" site,<br> http://www.redhat.com/about/corporate/milestones.html }~ What had once been a hobby was now a marketplace ripe for exploitation. Like Winston Churchill watching Soviet troops sweep into Berlin, Stallman felt an understandable set of mixed emotions when it came time to celebrate the Linux "victory."~{ I wrote this Winston Churchill analogy before Stallman himself sent me his own unsolicited comment on Churchill:<br>_1 World War II and the determination needed to win it was a very strong memory as I was growing up. Statements such as Churchill's, "We will fight them in the landing zones, we will fight them on the beaches . . . we will never surrender," have always resonated for me. }~
+
+Although late to the party, Stallman still had clout. As soon as the FSF announced that it would lend its money and moral support to Murdock's software project, other offers of support began rolling in. Murdock dubbed the new project Debian-a compression of his and his wife, Deborah's, names-and within a few weeks was rolling out the first distribution. "[Richard's support] catapulted Debian almost overnight from this interesting little project to something people within the community had to pay attention to," Murdock says.
+
+In January of 1994, Murdock issued the " Debian Manifesto." Written in the spirit of Stallman's "GNU Manifesto" from a decade before, it explained the importance of working closely with the Free Software Foundation. Murdock wrote:
+
+_1 The Free Software Foundation plays an extremely important role in the future of Debian. By the simple fact that they will be distributing it, a message is sent to the world that Linux is not a commercial product and that it never should be, but that this does not mean that Linux will never be able to compete commercially. For those of you who disagree, I challenge you to rationalize the success of GNU Emacs and GCC, which are not commercial software but which have had quite an impact on the commercial market regardless of that fact.
+
+_1 The time has come to concentrate on the future of Linux rather than on the destructive goal of enriching oneself at the expense of the entire Linux community and its future. The development and distribution of Debian may not be the answer to the problems that I have outlined in the Manifesto, but I hope that it will at least attract enough attention to these problems to allow them to be solved.~{ See Ian Murdock, "A Brief History of Debian," (January 6, 1994): Appendix A, "The Debian Manifesto."<br> http://www.debian.org/doc/manuals/project-history/apA.html }~
+
+Shortly after the Manifesto's release, the Free Software Foundation made its first major request. Stallman wanted Murdock to call its distribution "GNU/Linux." At first, Murdock says, Stallman had wanted to use the term " Lignux"-"as in Linux with GNU at the heart of it"-but a sample testing of the term on Usenet and in various impromptu hacker focus groups had merited enough catcalls to convince Stallman to go with the less awkward GNU/Linux.
+
+Although some would dismiss Stallman's attempt to add the "GNU" prefix as a belated quest for credit, Murdock saw it differently. Looking back, Murdock saw it as an attempt to counteract the growing tension between GNU Project and Linux-kernel developers. "There was a split emerging," Murdock recalls. "Richard was concerned."
+
+The deepest split, Murdock says, was over glibc. Short for GNU C Library, glibc is the package that lets programmers make "system calls" directed at the kernel. Over the course of 1993-1994, glibc emerged as a troublesome bottleneck in Linux development. Because so many new users were adding new functions to the Linux kernel, the GNU Project's glibc maintainers were soon overwhelmed with suggested changes. Frustrated by delays and the GNU Project's growing reputation for foot-dragging, some Linux developers suggested creating a " fork"-i.e., a Linux-specific C Library parallel to glibc.
+
+In the hacker world, forks are an interesting phenomenon. Although the hacker ethic permits a programmer to do anything he wants with a given program's source code, most hackers prefer to pour their innovations into a central source-code file or " tree" to ensure compatibility with other people's programs. To fork glibc this early in the development of Linux would have meant losing the potential input of hundreds, even thousands, of Linux developers. It would also mean growing incompatibility between Linux and the GNU system that Stallman and the GNU team still hoped to develop.
+
+As leader of the GNU Project, Stallman had already experienced the negative effects of a software fork in 1991. A group of Emacs developers working for a software company named Lucid had a falling out over Stallman's unwillingness to fold changes back into the GNU Emacs code base. The fork had given birth to a parallel version, Lucid Emacs, and hard feelings all around.~{ Jamie Zawinski, a former Lucid programmer who would go on to head the Mozilla development team, has a web site that documents the Lucid/GNU Emacs fork, titled, "The Lemacs/FSFmacs Schism."<br> http://www.jwz.org/doc/lemacs.html }~
+
+Murdock says Debian was mounting work on a similar fork in glibc source code that motivated Stallman to insist on adding the GNU prefix when Debian rolled out its software distribution. "The fork has since converged. Still, at the time, there was a concern that if the Linux community saw itself as a different thing as the GNU community, it might be a force for disunity."
+
+Stallman seconds Murdock's recollection. In fact, he says there were nascent forks appearing in relation to every major GNU component. At first, Stallman says he considered the forks to be a product of sour grapes. In contrast to the fast and informal dynamics of the Linux-kernel team, GNU source-code maintainers tended to be slower and more circumspect in making changes that might affect a program's long-term viability. They also were unafraid of harshly critiquing other people's code. Over time, however, Stallman began to sense that there was an underlying lack of awareness of the GNU Project and its objectives when reading Linux developers' emails.
+
+"We discovered that the people who considered themselves Linux users didn't care about the GNU Project," Stallman says. "They said, `Why should I bother doing these things? I don't care about the GNU Project. It's working for me. It's working for us Linux users, and nothing else matters to us.' And that was quite surprising given that people were essentially using a variant of the GNU system, and they cared so little. They cared less than anybody else about GNU."
+
+While some viewed descriptions of Linux as a "variant" of the GNU Project as politically grasping, Murdock, already sympathetic to the free software cause, saw Stallman's request to call Debian's version GNU/Linux as reasonable. "It was more for unity than for credit," he says.
+
+Requests of a more technical nature quickly followed. Although Murdock had been accommodating on political issues, he struck a firmer pose when it came to the design and development model of the actual software. What had begun as a show of solidarity soon became of model of other GNU projects.
+
+"I can tell you that I've had my share of disagreements with him," says Murdock with a laugh. "In all honesty Richard can be a fairly difficult person to work with."
+
+In 1996, Murdock, following his graduation from Purdue, decided to hand over the reins of the growing Debian project. He had already been ceding management duties to Bruce Perens, the hacker best known for his work on Electric Fence, a Unix utility released under the GPL. Perens, like Murdock, was a Unix programmer who had become enamored of GNU/Linux as soon as the program's Unix-like abilities became manifest. Like Murdock, Perens sympathized with the political agenda of Stallman and the Free Software Foundation, albeit from afar.
+
+"I remember after Stallman had already come out with the GNU Manifesto, GNU Emacs, and GCC, I read an article that said he was working as a consultant for Intel," says Perens, recalling his first brush with Stallman in the late 1980s. "I wrote him asking how he could be advocating free software on the one hand and working for Intel on the other. He wrote back saying, `I work as a consultant to produce free software.' He was perfectly polite about it, and I thought his answer made perfect sense."
+
+As a prominent Debian developer, however, Perens regarded Murdock's design battles with Stallman with dismay. Upon assuming leadership of the development team, Perens says he made the command decision to distance Debian from the Free Software Foundation. "I decided we did not want Richard's style of micro-management," he says.
+
+According to Perens, Stallman was taken aback by the decision but had the wisdom to roll with it. "He gave it some time to cool off and sent a message that we really needed a relationship. He requested that we call it GNU/Linux and left it at that. I decided that was fine. I made the decision unilaterally. Everybody breathed a sigh of relief."
+
+Over time, Debian would develop a reputation as the hacker's version of Linux, alongside Slackware, another popular distribution founded during the same 1993-1994 period. Outside the realm of hacker-oriented systems, however, Linux was picking up steam in the commercial Unix marketplace. In North Carolina, a Unix company billing itself as Red Hat was revamping its business to focus on Linux. The chief executive officer was Robert Young, the former Linux Journal editor who in 1994 had put the question to Linus Torvalds, asking whether he had any regrets about putting the kernel under the GPL. To Young, Torvalds' response had a "profound" impact on his own view toward Linux. Instead of looking for a way to corner the GNU/Linux market via traditional software tactics, Young began to consider what might happen if a company adopted the same approach as Debian-i.e., building an operating system completely out of free software parts. Cygnus Solutions, the company founded by Michael Tiemann and John Gilmore in 1990, was already demonstrating the ability to sell free software based on quality and customizability. What if Red Hat took the same approach with GNU/Linux?
+
+"In the western scientific tradition we stand on the shoulders of giants," says Young, echoing both Torvalds and Sir Isaac Newton before him. "In business, this translates to not having to reinvent wheels as we go along. The beauty of [the GPL] model is you put your code into the public domain.~{ Young uses the term "public domain" incorrectly here. Public domain means not protected by copyright. GPL-protected programs are by definition protected by copyright. }~ If you're an independent software vendor and you're trying to build some application and you need a modem-dialer, well, why reinvent modem dialers? You can just steal PPP off of Red Hat Linux and use that as the core of your modem-dialing tool. If you need a graphic tool set, you don't have to write your own graphic library. Just download GTK. Suddenly you have the ability to reuse the best of what went before. And suddenly your focus as an application vendor is less on software management and more on writing the applications specific to your customer's needs."
+
+Young wasn't the only software executive intrigued by the business efficiencies of free software. By late 1996, most Unix companies were starting to wake up and smell the brewing source code. The Linux sector was still a good year or two away from full commercial breakout mode, but those close enough to the hacker community could feel it: something big was happening. The Intel 386 chip, the Internet, and the World Wide Web had hit the marketplace like a set of monster waves, and Linux-and the host of software programs that echoed it in terms of source-code accessibility and permissive licensing-seemed like the largest wave yet.
+
+For Ian Murdock, the programmer courted by Stallman and then later turned off by Stallman's micromanagement style, the wave seemed both a fitting tribute and a fitting punishment for the man who had spent so much time giving the free software movement an identity. Like many Linux aficionados, Murdock had seen the original postings. He'd seen Torvalds's original admonition that Linux was "just a hobby." He'd also seen Torvalds's admission to Minix creator Andrew Tanenbaum: "If the GNU kernel had been ready last spring, I'd not have bothered to even start my project."~{ This quote is taken from the much-publicized Torvalds-Tanenbaum "flame war" following the initial release of Linux. In the process of defending his choice of a nonportable monolithic kernel design, Torvalds says he started working on Linux as a way to learn more about his new 386 PC. "If the GNU kernel had been ready last spring, I'd not have bothered to even start my project." See Chris DiBona et al., Open Sources (O'Reilly & Associates, Inc., 1999): 224. }~ Like many, Murdock knew the opportunities that had been squandered. He also knew the excitement of watching new opportunities come seeping out of the very fabric of the Internet.
+
+"Being involved with Linux in those early days was fun," recalls Murdock. "At the same time, it was something to do, something to pass the time. If you go back and read those old [comp.os.minix] exchanges, you'll see the sentiment: this is something we can play with until the HURD is ready. People were anxious. It's funny, but in a lot of ways, I suspect that Linux would never have happened if the HURD had come along more quickly."
+
+By the end of 1996, however, such "what if" questions were already moot. Call it Linux, call it GNU/Linux; the users had spoken. The 36-month window had closed, meaning that even if the GNU Project had rolled out its HURD kernel, chances were slim anybody outside the hard-core hacker community would have noticed. The first Unix-like free software operating system was here, and it had momentum. All hackers had left to do was sit back and wait for the next major wave to come crashing down on their heads. Even the shaggy-haired head of one Richard M. Stallman.
+
+Ready or not.
+
+1~ Chapter 11 - Open Source
+
+In November , 1995, Peter Salus, a member of the Free Software Foundation and author of the 1994 book, A Quarter Century of Unix, issued a call for papers to members of the GNU Project's "system-discuss" mailing list. Salus, the conference's scheduled chairman, wanted to tip off fellow hackers about the upcoming Conference on Freely Redistributable Software in Cambridge, Massachusetts. Slated for February, 1996 and sponsored by the Free Software Foundation, the event promised to be the first engineering conference solely dedicated to free software and, in a show of unity with other free software programmers, welcomed papers on "any aspect of GNU, Linux, NetBSD, 386BSD, FreeBSD, Perl, Tcl/tk, and other tools for which the code is accessible and redistributable." Salus wrote:
+
+_1 Over the past 15 years, free and low-cost software has become ubiquitous. This conference will bring together implementers of several different types of freely redistributable software and publishers of such software (on various media). There will be tutorials and refereed papers, as well as keynotes by Linus Torvalds and Richard Stallman.~{ See Peter Salus, "FYI-Conference on Freely Redistributable Software, 2/2, Cambridge" (1995) (archived by Terry Winograd).<br> http://hci.stanford.edu/pcd-archives/pcd-fyi/1995/0078.html }~
+
+One of the first people to receive Salus' email was conference committee member Eric S. Raymond. Although not the leader of a project or company like the various other members of the list, Raymond had built a tidy reputation within the hacker community as a major contributor to GNU Emacs and as editor of The New Hacker Dictionary, a book version of the hacking community's decade-old Jargon File.
+
+For Raymond, the 1996 conference was a welcome event. Active in the GNU Project during the 1980s, Raymond had distanced himself from the project in 1992, citing, like many others before him, Stallman's "micro-management" style. "Richard kicked up a fuss about my making unauthorized modifications when I was cleaning up the Emacs LISP libraries," Raymond recalls. "It frustrated me so much that I decided I didn't want to work with him anymore."
+
+Despite the falling out, Raymond remained active in the free software community. So much so that when Salus suggested a conference pairing Stallman and Torvalds as keynote speakers, Raymond eagerly seconded the idea. With Stallman representing the older, wiser contingent of ITS/Unix hackers and Torvalds representing the younger, more energetic crop of Linux hackers, the pairing indicated a symbolic show of unity that could only be beneficial, especially to ambitious younger (i.e., below 40) hackers such as Raymond. "I sort of had a foot in both camps," Raymond says.
+
+By the time of the conference, the tension between those two camps had become palpable. Both groups had one thing in common, though: the conference was their first chance to meet the Finnish wunderkind in the flesh. Surprisingly, Torvalds proved himself to be a charming, affable speaker. Possessing only a slight Swedish accent, Torvalds surprised audience members with his quick, self-effacing wit.~{ Although Linus Torvalds is Finnish, his mother tongue is Swedish. "The Rampantly Unofficial Linus FAQ" offers a brief explanation:<br>_1 Finland has a significant (about 6%) Swedish-speaking minority population. They call themselves "finlandssvensk" or "finlandssvenskar" and consider themselves Finns; many of their families have lived in Finland for centuries. Swedish is one of Finland's two official languages.<br> http://tuxedo.org/~esr/faqs/linus/ }~ Even more surprising, says Raymond, was Torvalds' equal willingness to take potshots at other prominent hackers, including the most prominent hacker of all, Richard Stallman. By the end of the conference, Torvalds' half-hacker, half-slacker manner was winning over older and younger conference-goers alike.
+
+"It was a pivotal moment," recalls Raymond. "Before 1996, Richard was the only credible claimant to being the ideological leader of the entire culture. People who dissented didn't do so in public. The person who broke that taboo was Torvalds."
+
+The ultimate breach of taboo would come near the end of the show. During a discussion on the growing market dominance of Microsoft Windows or some similar topic, Torvalds admitted to being a fan of Microsoft's PowerPoint slideshow software program. From the perspective of old-line software purists, it was like a Mormon bragging in church about his fondness of whiskey. From the perspective of Torvalds and his growing band of followers, it was simply common sense. Why shun worthy proprietary software programs just to make a point? Being a hacker wasn't about suffering, it was about getting the job done.
+
+"That was a pretty shocking thing to say," Raymond remembers. "Then again, he was able to do that, because by 1995 and 1996, he was rapidly acquiring clout."
+
+Stallman, for his part, doesn't remember any tension at the 1996 conference, but he does remember later feeling the sting of Torvalds' celebrated cheekiness. "There was a thing in the Linux documentation which says print out the GNU coding standards and then tear them up," says Stallman, recalling one example. "OK, so he disagrees with some of our conventions. That's fine, but he picked a singularly nasty way of saying so. He could have just said `Here's the way I think you should indent your code.' Fine. There should be no hostility there."
+
+For Raymond, the warm reception other hackers gave to Torvalds' comments merely confirmed his suspicions. The dividing line separating Linux developers from GNU/Linux developers was largely generational. Many Linux hackers, like Torvalds, had grown up in a world of proprietary software. Unless a program was clearly inferior, most saw little reason to rail against a program on licensing issues alone. Somewhere in the universe of free software systems lurked a program that hackers might someday turn into a free software alternative to PowerPoint. Until then, why begrudge Microsoft the initiative of developing the program and reserving the rights to it?
+
+As a former GNU Project member, Raymond sensed an added dynamic to the tension between Stallman and Torvalds. In the decade since launching the GNU Project, Stallman had built up a fearsome reputation as a programmer. He had also built up a reputation for intransigence both in terms of software design and people management. Shortly before the 1996 conference, the Free Software Foundation would experience a full-scale staff defection, blamed in large part on Stallman. Brian Youmans, a current FSF staffer hired by Salus in the wake of the resignations, recalls the scene: "At one point, Peter [Salus] was the only staff member working in the office."
+
+For Raymond, the defection merely confirmed a growing suspicion: recent delays such as the HURD and recent troubles such as the Lucid-Emacs schism reflected problems normally associated with software project management, not software code development. Shortly after the Freely Redistributable Software Conference, Raymond began working on his own pet software project, a popmail utility called " fetchmail." Taking a cue from Torvalds, Raymond issued his program with a tacked-on promise to update the source code as early and as often as possible. When users began sending in bug reports and feature suggestions, Raymond, at first anticipating a tangled mess, found the resulting software surprisingly sturdy. Analyzing the success of the Torvalds approach, Raymond issued a quick analysis: using the Internet as his "petri dish" and the harsh scrutiny of the hacker community as a form of natural selection, Torvalds had created an evolutionary model free of central planning.
+
+What's more, Raymond decided, Torvalds had found a way around Brooks' Law. First articulated by Fred P. Brooks, manager of IBM's OS/360 project and author of the 1975 book, The Mythical Man-Month, Brooks' Law held that adding developers to a project only resulted in further project delays. Believing as most hackers that software, like soup, benefits from a limited number of cooks, Raymond sensed something revolutionary at work. In inviting more and more cooks into the kitchen, Torvalds had actually found away to make the resulting software better.~{ Brooks' Law is the shorthand summary of the following quote taken from Brooks' book:<br>_1 Since software construction is inherently a systems effort-an exercise in complex interrelationships-communication effort is great, and it quickly dominates the decrease in individual task time brought about by partitioning. Adding more men then lengthens, not shortens, the schedule.<br>See Fred P. Brooks, The Mythical Man-Month (Addison Wesley Publishing, 1995) }~
+
+Raymond put his observations on paper. He crafted them into a speech, which he promptly delivered before a group of friends and neighbors in Chester County, Pennsylvania. Dubbed " The Cathedral and the Bazaar," the speech contrasted the management styles of the GNU Project with the management style of Torvalds and the kernel hackers. Raymond says the response was enthusiastic, but not nearly as enthusiastic as the one he received during the 1997 Linux Kongress, a gathering of Linux users in Germany the next spring.
+
+"At the Kongress, they gave me a standing ovation at the end of the speech," Raymond recalls. "I took that as significant for two reasons. For one thing, it meant they were excited by what they were hearing. For another thing, it meant they were excited even after hearing the speech delivered through a language barrier."
+
+Eventually, Raymond would convert the speech into a paper, also titled "The Cathedral and the Bazaar." The paper drew its name from Raymond's central analogy. GNU programs were "cathedrals," impressive, centrally planned monuments to the hacker ethic, built to stand the test of time. Linux, on the other hand, was more like "a great babbling bazaar," a software program developed through the loose decentralizing dynamics of the Internet.
+
+Implicit within each analogy was a comparison of Stallman and Torvalds. Where Stallman served as the classic model of the cathedral architect-i.e., a programming "wizard" who could disappear for 18 months and return with something like the GNU C Compiler-Torvalds was more like a genial dinner-party host. In letting others lead the Linux design discussion and stepping in only when the entire table needed a referee, Torvalds had created a development model very much reflective of his own laid-back personality. From the Torvalds' perspective, the most important managerial task was not imposing control but keeping the ideas flowing.
+
+Summarized Raymond, "I think Linus's cleverest and most consequential hack was not the construction of the Linux kernel itself, but rather his invention of the Linux development model."~{ See Eric Raymond, "The Cathredral and the Bazaar" (1997). }~
+
+In summarizing the secrets of Torvalds' managerial success, Raymond himself had pulled off a coup. One of the audience members at the Linux Kongress was Tim O'Reilly, publisher of O'Reilly & Associates, a company specializing in software manuals and software-related books (and the publisher of this book). After hearing Raymond's Kongress speech, O'Reilly promptly invited Raymond to deliver it again at the company's inaugural Perl Conference later that year in Monterey, California.
+
+Although the conference was supposed to focus on Perl, a scripting language created by Unix hacker Larry Wall, O'Reilly assured Raymond that the conference would address other free software technologies. Given the growing commercial interest in Linux and Apache, a popular free software web server, O'Reilly hoped to use the event to publicize the role of free software in creating the entire infrastructure of the Internet. From web-friendly languages such as Perl and Python to back-room programs such as BIND (the Berkeley Internet Naming Daemon), a software tool that lets users replace arcane IP numbers with the easy-to-remember domain-name addresses (e.g., amazon.com), and sendmail, the most popular mail program on the Internet, free software had become an emergent phenomenon. Like a colony of ants creating a beautiful nest one grain of sand at a time, the only thing missing was the communal self-awareness. O'Reilly saw Raymond's speech as a good way to inspire that self-awareness, to drive home the point that free software development didn't start and end with the GNU Project. Programming languages, such as Perl and Python, and Internet software, such as BIND, sendmail, and Apache, demonstrated that free software was already ubiquitous and influential. He also assured Raymond an even warmer reception than the one at Linux Kongress.
+
+O'Reilly was right. "This time, I got the standing ovation before the speech," says Raymond, laughing.
+
+As predicted, the audience was stocked not only with hackers, but with other people interested in the growing power of the free software movement. One contingent included a group from Netscape, the Mountain View, California startup then nearing the end game of its three-year battle with Microsoft for control of the web-browser market.
+
+Intrigued by Raymond's speech and anxious to win back lost market share, Netscape executives took the message back to corporate headquarters. A few months later, in January, 1998, the company announced its plan to publish the source code of its flagship Navigator web browser in the hopes of enlisting hacker support in future development.
+
+When Netscape CEO Jim Barksdale cited Raymond's "Cathedral and the Bazaar" essay as a major influence upon the company's decision, the company instantly elevated Raymond to the level of hacker celebrity. Determined not to squander the opportunity, Raymond traveled west to deliver interviews, advise Netscape executives, and take part in the eventual party celebrating the publication of Netscape Navigator's source code. The code name for Navigator's source code was "Mozilla": a reference both to the program's gargantuan size-30 million lines of code-and to its heritage. Developed as a proprietary offshoot of Mosaic, the web browser created by Marc Andreessen at the University of Illinois, Mozilla was proof, yet again, that when it came to building new programs, most programmers preferred to borrow on older, modifiable programs.
+
+While in California, Raymond also managed to squeeze in a visit to VA Research, a Santa Clara-based company selling workstations with the GNU/Linux operating system preinstalled. Convened by Raymond, the meeting was small. The invite list included VA founder Larry Augustin, a few VA employees, and Christine Peterson, president of the Foresight Institute, a Silicon Valley think tank specializing in nanotechnology.
+
+"The meeting's agenda boiled down to one item: how to take advantage of Netscape's decision so that other companies might follow suit?" Raymond doesn't recall the conversation that took place, but he does remember the first complaint addressed. Despite the best efforts of Stallman and other hackers to remind people that the word "free" in free software stood for freedom and not price, the message still wasn't getting through. Most business executives, upon hearing the term for the first time, interpreted the word as synonymous with "zero cost," tuning out any follow up messages in short order. Until hackers found a way to get past this cognitive dissonance, the free software movement faced an uphill climb, even after Netscape.
+
+Peterson, whose organization had taken an active interest in advancing the free software cause, offered an alternative: open source.
+
+Looking back, Peterson says she came up with the open source term while discussing Netscape's decision with a friend in the public relations industry. She doesn't remember where she came upon the term or if she borrowed it from another field, but she does remember her friend disliking the term.~{ See Malcolm Maclachlan, "Profit Motive Splits Open Source Movement," TechWeb News (August 26, 1998).<br> http://content.techweb.com/wire/story/TWB19980824S0012 }~
+
+At the meeting, Peterson says, the response was dramatically different. "I was hesitant about suggesting it," Peterson recalls. "I had no standing with the group, so started using it casually, not highlighting it as a new term." To Peterson's surprise, the term caught on. By the end of the meeting, most of the attendees, including Raymond, seemed pleased by it.
+
+Raymond says he didn't publicly use the term "open source" as a substitute for free software until a day or two after the Mozilla launch party, when O'Reilly had scheduled a meeting to talk about free software. Calling his meeting "the Freeware Summit," O'Reilly says he wanted to direct media and community attention to the other deserving projects that had also encouraged Netscape to release Mozilla. "All these guys had so much in common, and I was surprised they didn't all know each other," says O'Reilly. "I also wanted to let the world know just how great an impact the free software culture had already made. People were missing out on a large part of the free software tradition."
+
+In putting together the invite list, however, O'Reilly made a decision that would have long-term political consequences. He decided to limit the list to west-coast developers such as Wall, Eric Allman, creator of sendmail, and Paul Vixie, creator of BIND. There were exceptions, of course: Pennsylvania-resident Raymond, who was already in town thanks to the Mozilla launch, earned a quick invite. So did Virginia-resident Guido van Rossum, creator of Python. "Frank Willison, my editor in chief and champion of Python within the company, invited him without first checking in with me," O'Reilly recalls. "I was happy to have him there, but when I started, it really was just a local gathering."
+
+For some observers, the unwillingness to include Stallman's name on the list qualified as a snub. "I decided not to go to the event because of it," says Perens, remembering the summit. Raymond, who did go, says he argued for Stallman's inclusion to no avail. The snub rumor gained additional strength from the fact that O'Reilly, the event's host, had feuded publicly with Stallman over the issue of software-manual copyrights. Prior to the meeting, Stallman had argued that free software manuals should be as freely copyable and modifiable as free software programs. O'Reilly, meanwhile, argued that a value-added market for nonfree books increased the utility of free software by making it more accessible to a wider community. The two had also disputed the title of the event, with Stallman insisting on "Free Software" over the less politically laden "Freeware."
+
+Looking back, O'Reilly doesn't see the decision to leave Stallman's name off the invite list as a snub. "At that time, I had never met Richard in person, but in our email interactions, he'd been inflexible and unwilling to engage in dialogue. I wanted to make sure the GNU tradition was represented at the meeting, so I invited John Gilmore and Michael Tiemann, whom I knew personally, and whom I knew were passionate about the value of the GPL but seemed more willing to engage in a frank back-and-forth about the strengths and weaknesses of the various free software projects and traditions. Given all the later brouhaha, I do wish I'd invited Richard as well, but I certainly don't think that my failure to do so should be interpreted as a lack of respect for the GNU Project or for Richard personally."
+
+Snub or no snub, both O'Reilly and Raymond say the term "open source" won over just enough summit-goers to qualify as a success. The attendees shared ideas and experiences and brainstormed on how to improve free software's image. Of key concern was how to point out the successes of free software, particularly in the realm of Internet infrastructure, as opposed to playing up the GNU/Linux challenge to Microsoft Windows. But like the earlier meeting at VA, the discussion soon turned to the problems associated with the term "free software." O'Reilly, the summit host, remembers a particularly insightful comment from Torvalds, a summit attendee.
+
+"Linus had just moved to Silicon Valley at that point, and he explained how only recently that he had learned that the word `free' had two meanings-free as in `libre' and free as in `gratis'-in English."
+
+Michael Tiemann, founder of Cygnus, proposed an alternative to the troublesome "free software" term: sourceware. "Nobody got too excited about it," O'Reilly recalls. "That's when Eric threw out the term `open source.'"
+
+Although the term appealed to some, support for a change in official terminology was far from unanimous. At the end of the one-day conference, attendees put the three terms-free software, open source, or sourceware-to a vote. According to O'Reilly, 9 out of the 15 attendees voted for "open source." Although some still quibbled with the term, all attendees agreed to use it in future discussions with the press. "We wanted to go out with a solidarity message," O'Reilly says.
+
+The term didn't take long to enter the national lexicon. Shortly after the summit, O'Reilly shepherded summit attendees to a press conference attended by reporters from the New York Times, the Wall Street Journal, and other prominent publications. Within a few months, Torvalds' face was appearing on the cover of Forbes magazine, with the faces of Stallman, Perl creator Larry Wall, and Apache team leader Brian Behlendorf featured in the interior spread. Open source was open for business.
+
+For summit attendees such as Tiemann, the solidarity message was the most important thing. Although his company had achieved a fair amount of success selling free software tools and services, he sensed the difficulty other programmers and entrepreneurs faced.
+
+"There's no question that the use of the word free was confusing in a lot of situations," Tiemann says. "Open source positioned itself as being business friendly and business sensible. Free software positioned itself as morally righteous. For better or worse we figured it was more advantageous to align with the open source crowd.
+
+For Stallman, the response to the new "open source" term was slow in coming. Raymond says Stallman briefly considered adopting the term, only to discard it. "I know because I had direct personal conversations about it," Raymond says.
+
+By the end of 1998, Stallman had formulated a position: open source, while helpful in communicating the technical advantages of free software, also encouraged speakers to soft-pedal the issue of software freedom. Given this drawback, Stallman would stick with the term free software.
+
+Summing up his position at the 1999 LinuxWorld Convention and Expo, an event billed by Torvalds himself as a "coming out party" for the Linux community, Stallman implored his fellow hackers to resist the lure of easy compromise.
+
+"Because we've shown how much we can do, we don't have to be desperate to work with companies or compromise our goals," Stallman said during a panel discussion. "Let them offer and we'll accept. We don't have to change what we're doing to get them to help us. You can take a single step towards a goal, then another and then more and more and you'll actually reach your goal. Or, you can take a half measure that means you don't ever take another step and you'll never get there."
+
+Even before the LinuxWorld show, however, Stallman was showing an increased willingness to alienate his more conciliatory peers. A few months after the Freeware Summit, O'Reilly hosted its second annual Perl Conference. This time around, Stallman was in attendance. During a panel discussion lauding IBM's decision to employ the free software Apache web server in its commercial offerings, Stallman, taking advantage of an audience microphone, disrupted the proceedings with a tirade against panelist John Ousterhout, creator of the Tcl scripting language. Stallman branded Ousterhout a "parasite" on the free software community for marketing a proprietary version of Tcl via Ousterhout's startup company, Scriptics. "I don't think Scriptics is necessary for the continued existence of Tcl," Stallman said to hisses from the fellow audience members. ^98^
+
+"It was a pretty ugly scene," recalls Prime Time Freeware's Rich Morin. "John's done some pretty respectable things: Tcl, Tk, Sprite. He's a real contributor."
+
+Despite his sympathies for Stallman and Stallman's position, Morin felt empathy for those troubled by Stallman's discordant behavior.
+
+Stallman's Perl Conference outburst would momentarily chase off another potential sympathizer, Bruce Perens. In 1998, Eric Raymond proposed launching the Open Source Initiative, or OSI, an organization that would police the use of the term "open source" and provide a definition for companies interested in making their own programs. Raymond recruited Perens to draft the definition.~{ See Bruce Perens et al., "The Open Source Definition," The Open Source Initiative (1998).
+http://www.opensource.org/docs/definition.html }~
+
+Perens would later resign from the OSI, expressing regret that the organization had set itself up in opposition to Stallman and the FSF. Still, looking back on the need for a free software definition outside the Free Software Foundation's auspices, Perens understands why other hackers might still feel the need for distance. "I really like and admire Richard," says Perens. "I do think Richard would do his job better if Richard had more balance. That includes going away from free software for a couple of months."
+
+Stallman's monomaniacal energies would do little to counteract the public-relations momentum of open source proponents. In August of 1998, when chip-maker Intel purchased a stake in GNU/Linux vendor Red Hat, an accompanying New York Times article described the company as the product of a movement "known alternatively as free software and open source."~{ See Amy Harmon, "For Sale: Free Operating System," New York Times (September 28, 1998).<br> http://www.nytimes.com/library/tech/98/09/biztech/articles/28linux.html }~ Six months later, a John Markoff article on Apple Computer was proclaiming the company's adoption of the "open source" Apache server in the article headline.~{ See John Markoff, "Apple Adopts `Open Source' for its Server Computers," New York Times (March 17, 1999).<br> http://www.nytimes.com/library/tech/99/03/biztech/articles/17apple.html }~
+
+Such momentum would coincide with the growing momentum of companies that actively embraced the "open source" term. By August of 1999, Red Hat, a company that now eagerly billed itself as "open source," was selling shares on Nasdaq. In December, VA Linux-formerly VA Research-was floating its own IPO to historical effect. Opening at $30 per share, the company's stock price exploded past the $300 mark in initial trading only to settle back down to the $239 level. Shareholders lucky enough to get in at the bottom and stay until the end experienced a 698% increase in paper wealth, a Nasdaq record.
+
+Among those lucky shareholders was Eric Raymond, who, as a company board member since the Mozilla launch, had received 150,000 shares of VA Linux stock. Stunned by the realization that his essay contrasting the Stallman-Torvalds managerial styles had netted him $36 million in potential wealth, Raymond penned a follow-up essay. In it, Raymond mused on the relationship between the hacker ethic and monetary wealth:
+
+_1 Reporters often ask me these days if I think the open-source community will be corrupted by the influx of big money. I tell them what I believe, which is this: commercial demand for programmers has been so intense for so long that anyone who can be seriously distracted by money is already gone. Our community has been self-selected for caring about other things-accomplishment, pride, artistic passion, and each other.~{ See Eric Raymond, "Surprised by Wealth," Linux Today (December 10, 1999).<br> http://linuxtoday.com/news_story.php3?ltsn=1999-12-10-001-05-NW-LF }~
+
+Whether or not such comments allayed suspicions that Raymond and other open source proponents had simply been in it for the money, they drove home the open source community's ultimate message: all you needed to sell the free software concept is a friendly face and a sensible message. Instead of fighting the marketplace head-on as Stallman had done, Raymond, Torvalds, and other new leaders of the hacker community had adopted a more relaxed approach-ignoring the marketplace in some areas, leveraging it in others. Instead of playing the role of high-school outcasts, they had played the game of celebrity, magnifying their power in the process.
+
+"On his worst days Richard believes that Linus Torvalds and I conspired to hijack his revolution," Raymond says. "Richard's rejection of the term open source and his deliberate creation of an ideological fissure in my view comes from an odd mix of idealism and territoriality. There are people out there who think it's all Richard's personal ego. I don't believe that. It's more that he so personally associates himself with the free software idea that he sees any threat to that as a threat to himself."
+
+Ironically, the success of open source and open source advocates such as Raymond would not diminish Stallman's role as a leader. If anything, it gave Stallman new followers to convert. Still, the Raymond territoriality charge is a damning one. There are numerous instances of Stallman sticking to his guns more out of habit than out of principle: his initial dismissal of the Linux kernel, for example, and his current unwillingness as a political figure to venture outside the realm of software issues.
+
+Then again, as the recent debate over open source also shows, in instances when Stallman has stuck to his guns, he's usually found a way to gain ground because of it. "One of Stallman's primary character traits is the fact he doesn't budge," says Ian Murdock. "He'll wait up to a decade for people to come around to his point of view if that's what it takes."
+
+Murdock, for one, finds that unbudgeable nature both refreshing and valuable. Stallman may no longer be the solitary leader of the free software movement, but he is still the polestar of the free software community. "You always know that he's going to be consistent in his views," Murdock says. "Most people aren't like that. Whether you agree with him or not, you really have to respect that."
+
+1~ Chapter 12 - A Brief Journey Through Hacker Hell
+
+Richard Stallman stares, unblinking, through the windshield of a rental car, waiting for the light to change as we make our way through downtown Kihei.
+
+The two of us are headed to the nearby town of Pa'ia, where we are scheduled to meet up with some software programmers and their wives for dinner in about an hour or so.
+
+It's about two hours after Stallman's speech at the Maui High Performance Center, and Kihei, a town that seemed so inviting before the speech, now seems profoundly uncooperative. Like most beach cities, Kihei is a one-dimensional exercise in suburban sprawl. Driving down its main drag, with its endless succession of burger stands, realty agencies, and bikini shops, it's hard not to feel like a steel-coated morsel passing through the alimentary canal of a giant commercial tapeworm. The feeling is exacerbated by the lack of side roads. With nowhere to go but forward, traffic moves in spring-like lurches. 200 yards ahead, a light turns green. By the time we are moving, the light is yellow again.
+
+For Stallman, a lifetime resident of the east coast, the prospect of spending the better part of a sunny Hawaiian afternoon trapped in slow traffic is enough to trigger an embolism. Even worse is the knowledge that, with just a few quick right turns a quarter mile back, this whole situation easily could have been avoided. Unfortunately, we are at the mercy of the driver ahead of us, a programmer from the lab who knows the way and who has decided to take us to Pa'ia via the scenic route instead of via the nearby Pilani Highway.
+
+"This is terrible," says Stallman between frustrated sighs. "Why didn't we take the other route?"
+
+Again, the light a quarter mile ahead of us turns green. Again, we creep forward a few more car lengths. This process continues for another 10 minutes, until we finally reach a major crossroad promising access to the adjacent highway.
+
+The driver ahead of us ignores it and continues through the intersection.
+
+"Why isn't he turning?" moans Stallman, throwing up his hands in frustration. "Can you believe this?"
+
+I decide not to answer either. I find the fact that I am sitting in a car with Stallman in the driver seat, in Maui no less, unbelievable enough. Until two hours ago, I didn't even know Stallman knew how to drive. Now, listening to Yo-Yo Ma's cello playing the mournful bass notes of "Appalachian Journey" on the car stereo and watching the sunset pass by on our left, I do my best to fade into the upholstery.
+
+When the next opportunity to turn finally comes up, Stallman hits his right turn signal in an attempt to cue the driver ahead of us. No such luck. Once again, we creep slowly through the intersection, coming to a stop a good 200 yards before the next light. By now, Stallman is livid.
+
+"It's like he's deliberately ignoring us," he says, gesturing and pantomiming like an air craft carrier landing-signals officer in a futile attempt to catch our guide's eye. The guide appears unfazed, and for the next five minutes all we see is a small portion of his head in the rearview mirror.
+
+I look out Stallman's window. Nearby Kahoolawe and Lanai Islands provide an ideal frame for the setting sun. It's a breathtaking view, the kind that makes moments like this a bit more bearable if you're a Hawaiian native, I suppose. I try to direct Stallman's attention to it, but Stallman, by now obsessed by the inattentiveness of the driver ahead of us, blows me off.
+
+When the driver passes through another green light, completely ignoring a "Pilani Highway Next Right," I grit my teeth. I remember an early warning relayed to me by BSD programmer Keith Bostic. "Stallman does not suffer fools gladly," Bostic warned me. "If somebody says or does something stupid, he'll look them in the eye and say, `That's stupid.'"
+
+Looking at the oblivious driver ahead of us, I realize that it's the stupidity, not the inconvenience, that's killing Stallman right now.
+
+"It's as if he picked this route with absolutely no thought on how to get there efficiently," Stallman says.
+
+The word "efficiently" hangs in the air like a bad odor. Few things irritate the hacker mind more than inefficiency. It was the inefficiency of checking the Xerox laser printer two or three times a day that triggered Stallman's initial inquiry into the printer source code. It was the inefficiency of rewriting software tools hijacked by commercial software vendors that led Stallman to battle Symbolics and to launch the GNU Project. If, as Jean Paul Sartre once opined, hell is other people, hacker hell is duplicating other people's stupid mistakes, and it's no exaggeration to say that Stallman's entire life has been an attempt to save mankind from these fiery depths.
+
+This hell metaphor becomes all the more apparent as we take in the slowly passing scenery. With its multitude of shops, parking lots, and poorly timed street lights, Kihei seems less like a city and more like a poorly designed software program writ large. Instead of rerouting traffic and distributing vehicles through side streets and expressways, city planners have elected to run everything through a single main drag. From a hacker perspective, sitting in a car amidst all this mess is like listening to a CD rendition of nails on a chalkboard at full volume.
+
+"Imperfect systems infuriate hackers," observes Steven Levy, another warning I should have listened to before climbing into the car with Stallman. "This is one reason why hackers generally hate driving cars-the system of randomly programmed red lights and oddly laid out one-way streets causes delays which are so goddamn unnecessary [Levy's emphasis] that the impulse is to rearrange signs, open up traffic-light control boxes . . . redesign the entire system."~{ See Steven Levy, Hackers (Penguin USA [paperback], 1984): 40. }~
+
+More frustrating, however, is the duplicity of our trusted guide. Instead of searching out a clever shortcut-as any true hacker would do on instinct-the driver ahead of us has instead chosen to play along with the city planners' game. Like Virgil in Dante's Inferno, our guide is determined to give us the full guided tour of this hacker hell whether we want it or not.
+
+Before I can make this observation to Stallman, the driver finally hits his right turn signal. Stallman's hunched shoulders relax slightly, and for a moment the air of tension within the car dissipates. The tension comes back, however, as the driver in front of us slows down. "Construction Ahead" signs line both sides of the street, and even though the Pilani Highway lies less than a quarter mile off in the distance, the two-lane road between us and the highway is blocked by a dormant bulldozer and two large mounds of dirt.
+
+It takes Stallman a few seconds to register what's going on as our guide begins executing a clumsy five-point U-turn in front of us. When he catches a glimpse of the bulldozer and the "No Through Access" signs just beyond, Stallman finally boils over.
+
+"Why, why, why?" he whines, throwing his head back. "You should have known the road was blocked. You should have known this way wouldn't work. You did this deliberately."
+
+The driver finishes the turn and passes us on the way back toward the main drag. As he does so, he shakes his head and gives us an apologetic shrug. Coupled with a toothy grin, the driver's gesture reveals a touch of mainlander frustration but is tempered with a protective dose of islander fatalism. Coming through the sealed windows of our rental car, it spells out a succinct message: "Hey, it's Maui; what are you gonna do?"
+
+Stallman can take it no longer.
+
+"Don't you fucking smile!" he shouts, fogging up the glass as he does so. "It's your fucking fault. This all could have been so much easier if we had just done it my way."
+
+Stallman accents the words "my way" by gripping the steering wheel and pulling himself towards it twice. The image of Stallman's lurching frame is like that of a child throwing a temper tantrum in a car seat, an image further underlined by the tone of Stallman's voice. Halfway between anger and anguish, Stallman seems to be on the verge of tears.
+
+Fortunately, the tears do not arrive. Like a summer cloudburst, the tantrum ends almost as soon as it begins. After a few whiny gasps, Stallman shifts the car into reverse and begins executing his own U-turn. By the time we are back on the main drag, his face is as impassive as it was when we left the hotel 30 minutes earlier.
+
+It takes less than five minutes to reach the next cross-street. This one offers easy highway access, and within seconds, we are soon speeding off toward Pa'ia at a relaxing rate of speed. The sun that once loomed bright and yellow over Stallman's left shoulder is now burning a cool orange-red in our rearview mirror. It lends its color to the gauntlet wili wili trees flying past us on both sides of the highway.
+
+For the next 20 minutes, the only sound in our vehicle, aside from the ambient hum of the car's engine and tires, is the sound of a cello and a violin trio playing the mournful strains of an Appalachian folk tune.
+
+1~ Chapter 13 - Continuing the Fight
+
+For Richard Stallman, time may not heal all wounds, but it does provide a convenient ally.
+
+Four years after " The Cathedral and the Bazaar," Stallman still chafes over the Raymond critique. He also grumbles over Linus Torvalds' elevation to the role of world's most famous hacker. He recalls a popular T-shirt that began showing at Linux tradeshows around 1999. Designed to mimic the original promotional poster for Star Wars, the shirt depicted Torvalds brandishing a lightsaber like Luke Skywalker, while Stallman's face rides atop R2D2. The shirt still grates on Stallmans nerves not only because it depicts him as a Torvalds' sidekick, but also because it elevates Torvalds to the leadership role in the free software/open source community, a role even Torvalds himself is loath to accept. "It's ironic," says Stallman mournfully. "Picking up that sword is exactly what Linus refuses to do. He gets everybody focusing on him as the symbol of the movement, and then he won't fight. What good is it?"
+
+Then again, it is that same unwillingness to "pick up the sword," on Torvalds part, that has left the door open for Stallman to bolster his reputation as the hacker community's ethical arbiter. Despite his grievances, Stallman has to admit that the last few years have been quite good, both to himself and to his organization. Relegated to the periphery by the unforeseen success of GNU/Linux, Stallman has nonetheless successfully recaptured the initiative. His speaking schedule between January 2000 and December 2001 included stops on six continents and visits to countries where the notion of software freedom carries heavy overtones-China and India, for example.
+
+Outside the bully pulpit, Stallman has also learned how to leverage his power as costeward of the GNU General Public License (GPL). During the summer of 2000, while the air was rapidly leaking out of the 1999 Linux IPO bubble, Stallman and the Free Software Foundation scored two major victories. In July, 2000, Troll Tech, a Norwegian software company and developer of Qt, a valuable suite of graphics tools for the GNU/Linux operating system, announced it was licensing its software under the GPL. A few weeks later, Sun Microsystems, a company that, until then, had been warily trying to ride the open source bandwagon without giving up total control of its software properties, finally relented and announced that it, too, was dual licensing its new OpenOffice application suite under the Lesser GNU Public License (LGPL) and the Sun Industry Standards Source License (SISSL).
+
+Underlining each victory was the fact that Stallman had done little to fight for them. In the case of Troll Tech, Stallman had simply played the role of free software pontiff. In 1999, the company had come up with a license that met the conditions laid out by the Free Software Foundation, but in examining the license further, Stallman detected legal incompatibles that would make it impossible to bundle Qt with GPL-protected software programs. Tired of battling Stallman, Troll Tech management finally decided to split the Qt into two versions, one GPL-protected and one QPL-protected, giving developers a way around the compatibility issues cited by Stallman.
+
+In the case of Sun, they desired to play according to the Free Software Foundation's conditions. At the 1999 O'Reilly Open Source Conference, Sun Microsystems cofounder and chief scientist Bill Joy defended his company's "community source" license, essentially a watered-down compromise letting users copy and modify Sun-owned software but not charge a fee for said software without negotiating a royalty agreement with Sun. A year after Joy's speech, Sun Microsystems vice president Marco Boerries was appearing on the same stage spelling out the company's new licensing compromise in the case of OpenOffice, an office-application suite designed specifically for the GNU/Linux operating system.
+
+"I can spell it out in three letters," said Boerries. "GPL."
+
+At the time, Boerries said his company's decision had little to do with Stallman and more to do with the momentum of GPL-protected programs. "What basically happened was the recognition that different products attracted different communities, and the license you use depends on what type of community you want to attract," said Boerries. "With [OpenOffice], it was clear we had the highest correlation with the GPL community."~{ See Marco Boerries, interview with author (July, 2000). }~
+
+Such comments point out the under-recognized strength of the GPL and, indirectly, the political genius of man who played the largest role in creating it. "There isn't a lawyer on earth who would have drafted the GPL the way it is," says Eben Moglen, Columbia University law professor and Free Software Foundation general counsel. "But it works. And it works because of Richard's philosophy of design."
+
+A former professional programmer, Moglen traces his pro bono work with Stallman back to 1990 when Stallman requested Moglen's legal assistance on a private affair. Moglen, then working with encryption expert Phillip Zimmerman during Zimmerman's legal battles with the National Security Administration, says he was honored by the request. "I told him I used Emacs every day of my life, and it would take an awful lot of lawyering on my part to pay off the debt."
+
+Since then, Moglen, perhaps more than any other individual, has had the best chance to observe the crossover of Stallman's hacker philosophies into the legal realm. Moglen says the difference between Stallman's approach to legal code and software code are largely the same. "I have to say, as a lawyer, the idea that what you should do with a legal document is to take out all the bugs doesn't make much sense," Moglen says. "There is uncertainty in every legal process, and what most lawyers want to do is to capture the benefits of uncertainty for their client. Richard's goal is the complete opposite. His goal is to remove uncertainty, which is inherently impossible. It is inherently impossible to draft one license to control all circumstances in all legal systems all over the world. But if you were to go at it, you would have to go at it his way. And the resulting elegance, the resulting simplicity in design almost achieves what it has to achieve. And from there a little lawyering will carry you quite far."
+
+As the person charged with pushing the Stallman agenda, Moglen understands the frustration of would-be allies. "Richard is a man who does not want to compromise over matters that he thinks of as fundamental," Moglen says, "and he does not take easily the twisting of words or even just the seeking of artful ambiguity, which human society often requires from a lot of people."
+
+Because of the Free Software Foundation's unwillingness to weigh in on issues outside the purview of GNU development and GPL enforcement, Moglen has taken to devoting his excess energies to assisting the Electronic Frontier Foundation, the organization providing legal aid to recent copyright defendants such as Dmitri Skylarov. In 2000, Moglen also served as direct counsel to a collection of hackers that were joined together from circulating the DVD decryption program deCSS. Despite the silence of his main client in both cases, Moglen has learned to appreciate the value of Stallman's stubbornness. "There have been times over the years where I've gone to Richard and said, `We have to do this. We have to do that. Here's the strategic situation. Here's the next move. Here's what he have to do.' And Richard's response has always been, `We don't have to do anything.' Just wait. What needs doing will get done."
+
+"And you know what?" Moglen adds. "Generally, he's been right."
+
+Such comments disavow Stallman's own self-assessment: "I'm not good at playing games," Stallman says, addressing the many unseen critics who see him as a shrewd strategist. "I'm not good at looking ahead and anticipating what somebody else might do. My approach has always been to focus on the foundation, to say `Let's make the foundation as strong as we can make it.'"
+
+The GPL's expanding popularity and continuing gravitational strength are the best tributes to the foundation laid by Stallman and his GNU colleagues. While no longer capable of billing himself as the "last true hacker," Stallman nevertheless can take sole credit for building the free software movement's ethical framework. Whether or not other modern programmers feel comfortable working inside that framework is immaterial. The fact that they even have a choice at all is Stallman's greatest legacy.
+
+Discussing Stallman's legacy at this point seems a bit premature. Stallman, 48 at the time of this writing, still has a few years left to add to or subtract from that legacy. Still, the autopilot nature of the free software movement makes it tempting to examine Stallman's life outside the day-to-day battles of the software industry and within a more august, historical setting.
+
+To his credit, Stallman refuses all opportunities to speculate. "I've never been able to work out detailed plans of what the future was going to be like," says Stallman, offering his own premature epitaph. "I just said `I'm going to fight. Who knows where I'll get?'"
+
+There's no question that in picking his fights, Stallman has alienated the very people who might otherwise have been his greatest champions. It is also a testament to his forthright, ethical nature that many of Stallman's erstwhile political opponents still manage to put in a few good words for him when pressed. The tension between Stallman the ideologue and Stallman the hacker genius, however, leads a biographer to wonder: how will people view Stallman when Stallman's own personality is no longer there to get in the way?
+
+In early drafts of this book, I dubbed this question the "100 year" question. Hoping to stimulate an objective view of Stallman and his work, I asked various software-industry luminaries to take themselves out of the current timeframe and put themselves in a position of a historian looking back on the free software movement 100 years in the future. From the current vantage point, it is easy to see similarities between Stallman and past Americans who, while somewhat marginal during their lifetime, have attained heightened historical importance in relation to their age. Easy comparisons include Henry David Thoreau, transcendentalist philosopher and author of On Civil Disobedience, and John Muir, founder of the Sierra Club and progenitor of the modern environmental movement. It is also easy to see similarities in men like William Jennings Bryan, a.k.a. "The Great Commoner," leader of the populist movement, enemy of monopolies, and a man who, though powerful, seems to have faded into historical insignificance.
+
+Although not the first person to view software as public property, Stallman is guaranteed a footnote in future history books thanks to the GPL. Given that fact, it seems worthwhile to step back and examine Richard Stallman's legacy outside the current time frame. Will the GPL still be something software programmers use in the year 2102, or will it have long since fallen by the wayside? Will the term "free software" seem as politically quaint as "free silver" does today, or will it seem eerily prescient in light of later political events?
+
+Predicting the future is risky sport, but most people, when presented with the question, seemed eager to bite. "One hundred years from now, Richard and a couple of other people are going to deserve more than a footnote," says Moglen. "They're going to be viewed as the main line of the story."
+
+The "couple other people" Moglen nominates for future textbook chapters include John Gilmore, Stallman's GPL advisor and future founder of the Electronic Frontier Foundation, and Theodor Holm Nelson, a.k.a. Ted Nelson, author of the 1982 book, Literary Machines. Moglen says Stallman, Nelson, and Gilmore each stand out in historically significant, nonoverlapping ways. He credits Nelson, commonly considered to have coined the term "hypertext," for identifying the predicament of information ownership in the digital age. Gilmore and Stallman, meanwhile, earn notable credit for identifying the negative political effects of information control and building organizations-the Electronic Frontier Foundation in the case of Gilmore and the Free Software Foundation in the case of Stallman-to counteract those effects. Of the two, however, Moglen sees Stallman's activities as more personal and less political in nature.
+
+"Richard was unique in that the ethical implications of unfree software were particularly clear to him at an early moment," says Moglen. "This has a lot to do with Richard's personality, which lots of people will, when writing about him, try to depict as epiphenomenal or even a drawback in Richard Stallman's own life work."
+
+Gilmore, who describes his inclusion between the erratic Nelson and the irascible Stallman as something of a "mixed honor," nevertheless seconds the Moglen argument. Writes Gilmore:
+
+_1 My guess is that Stallman's writings will stand up as well as Thomas Jefferson's have; he's a pretty clear writer and also clear on his principles . . . Whether Richard will be as influential as Jefferson will depend on whether the abstractions we call "civil rights" end up more important a hundred years from now than the abstractions that we call "software" or "technically imposed restrictions."
+
+Another element of the Stallman legacy not to be overlooked, Gilmore writes, is the collaborative software-development model pioneered by the GNU Project. Although flawed at times, the model has nevertheless evolved into a standard within the software-development industry. All told, Gilmore says, this collaborative software-development model may end up being even more influential than the GNU Project, the GPL License, or any particular software program developed by Stallman:
+
+_1 Before the Internet, it was quite hard to collaborate over distance on software, even among teams that know and trust each other. Richard pioneered collaborative development of software, particularly by disorganized volunteers who seldom meet each other. Richard didn't build any of the basic tools for doing this (the TCP protocol, email lists, diff and patch, tar files, RCS or CVS or remote-CVS), but he used the ones that were available to form social groups of programmers who could effectively collaborate.
+
+Lawrence Lessig, Stanford law professor and author of the 2001 book, The Future of Ideas, is similarly bullish. Like many legal scholars, Lessig sees the GPL as a major bulwark of the current so-called "digital commons," the vast agglomeration of community-owned software programs, network and telecommunication standards that have triggered the Internet's exponential growth over the last three decades. Rather than connect Stallman with other Internet pioneers, men such as Vannevar Bush, Vinton Cerf, and J. C. R. Licklider who convinced others to see computer technology on a wider scale, Lessig sees Stallman's impact as more personal, introspective, and, ultimately, unique:
+
+_1 [Stallman] changed the debate from is to ought. He made people see how much was at stake, and he built a device to carry these ideals forward . . . That said, I don't quite know how to place him in the context of Cerf or Licklider. The innovation is different. It is not just about a certain kind of code, or enabling the Internet. [It's] much more about getting people to see the value in a certain kind of Internet. I don't think there is anyone else in that class, before or after.
+
+Not everybody sees the Stallman legacy as set in stone, of course. Eric Raymond, the open source proponent who feels that Stallman's leadership role has diminished significantly since 1996, sees mixed signals when looking into the 2102 crystal ball:
+
+_1 I think Stallman's artifacts (GPL, Emacs, GCC) will be seen as revolutionary works, as foundation-stones of the information world. I think history will be less kind to some of the theories from which RMS operated, and not kind at all to his personal tendency towards territorial, cult-leader behavior.
+
+As for Stallman himself, he, too, sees mixed signals:
+
+_1 What history says about the GNU Project, twenty years from now, will depend on who wins the battle of freedom to use public knowledge. If we lose, we will be just a footnote. If we win, it is uncertain whether people will know the role of the GNU operating system-if they think the system is "Linux," they will build a false picture of what happened and why.
+
+_1 But even if we win, what history people learn a hundred years from now is likely to depend on who dominates politically.
+
+Searching for his own 19th-century historical analogy, Stallman summons the figure of John Brown, the militant abolitionist regarded as a hero on one side of the Mason Dixon line and a madman on the other.
+
+John Brown's slave revolt never got going, but during his subsequent trial he effectively roused national demand for abolition. During the Civil War, John Brown was a hero; 100 years after, and for much of the 1900s, history textbooks taught that he was crazy. During the era of legal segregation, while bigotry was shameless, the US partly accepted the story that the South wanted to tell about itself, and history textbooks said many untrue things about the Civil War and related events.
+
+Such comparisons document both the self-perceived peripheral nature of Stallman's current work and the binary nature of his current reputation. Although it's hard to see Stallman's reputation falling to the level of infamy as Brown's did during the post-Reconstruction period-Stallman, despite his occasional war-like analogies, has done little to inspire violence-it's easy to envision a future in which Stallman's ideas wind up on the ash-heap. In fashioning the free software cause not as a mass movement but as a collection of private battles against the forces of proprietary temptation, Stallman seems to have created a unwinnable situation, especially for the many acolytes with the same stubborn will.
+
+Then again, it is that very will that may someday prove to be Stallman's greatest lasting legacy. Moglen, a close observer over the last decade, warns those who mistake the Stallman personality as counter-productive or epiphenomenal to the "artifacts" of Stallman's life. Without that personality, Moglen says, there would be precious few artifiacts to discuss. Says Moglen, a former Supreme Court clerk:
+
+_1 Look, the greatest man I ever worked for was Thurgood Marshall. I knew what made him a great man. I knew why he had been able to change the world in his possible way. I would be going out on a limb a little bit if I were to make a comparison, because they could not be more different. Thurgood Marshall was a man in society, representing an outcast society to the society that enclosed it, but still a man in society. His skill was social skills. But he was all of a piece, too. Different as they were in every other respect, that the person I most now compare him to in that sense, all of a piece, compact, made of the substance that makes stars, all the way through, is Stallman.
+
+In an effort to drive that image home, Moglen reflects on a shared moment in the spring of 2000. The success of the VA Linux IPO was still resonating in the business media, and a half dozen free software-related issues were swimming through the news. Surrounded by a swirling hurricane of issues and stories each begging for comment, Moglen recalls sitting down for lunch with Stallman and feeling like a castaway dropped into the eye of the storm. For the next hour, he says, the conversation calmly revolved around a single topic: strengthening the GPL.
+
+"We were sitting there talking about what we were going to do about some problems in Eastern Europe and what we were going to do when the problem of the ownership of content began to threaten free software," Moglen recalls. "As we were talking, I briefly thought about how we must have looked to people passing by. Here we are, these two little bearded anarchists, plotting and planning the next steps. And, of course, Richard is plucking the knots from his hair and dropping them in the soup and behaving in his usual way. Anybody listening in on our conversation would have thought we were crazy, but I knew: I knew the revolution's right here at this table. This is what's making it happen. And this man is the person making it happen."
+
+Moglen says that moment, more than any other, drove home the elemental simplicity of the Stallman style.
+
+"It was funny," recalls Moglen. "I said to him, `Richard, you know, you and I are the two guys who didn't make any money out of this revolution.' And then I paid for the lunch, because I knew he didn't have the money to pay for it .'"
+
+1~ Chapter 14 - Epilogue: Crushing Loneliness
+
+Writing the biography of a living person is a bit like producing a play. The drama in front of the curtain often pales in comparison to the drama backstage.
+
+In The Autobiography of Malcolm X, Alex Haley gives readers a rare glimpse of that backstage drama. Stepping out of the ghostwriter role, Haley delivers the book's epilogue in his own voice. The epilogue explains how a freelance reporter originally dismissed as a "tool" and "spy" by the Nation of Islam spokesperson managed to work through personal and political barriers to get Malcolm X's life story on paper.
+
+While I hesitate to compare this book with The Autobiography of Malcolm X, I do owe a debt of gratitude to Haley for his candid epilogue. Over the last 12 months, it has served as a sort of instruction manual on how to deal with a biographical subject who has built an entire career on being disagreeable. From the outset, I envisioned closing this biography with a similar epilogue, both as an homage to Haley and as a way to let readers know how this book came to be.
+
+The story behind this story starts in an Oakland apartment, winding its way through the various locales mentioned in the book-Silicon Valley, Maui, Boston, and Cambridge. Ultimately, however, it is a tale of two cities: New York, New York, the book-publishing capital of the world, and Sebastopol, California, the book-publishing capital of Sonoma County.
+
+The story starts in April, 2000. At the time, I was writing stories for the ill-fated BeOpen web site ( http://www.beopen.com/ ). One of my first assignments was a phone interview with Richard M. Stallman. The interview went well, so well that Slashdot ( http://www.slashdot.org/ ), the popular "news for nerds" site owned by VA Software, Inc. (formerly VA Linux Systems and before that, VA Research), gave it a link in its daily list of feature stories. Within hours, the web servers at BeOpen were heating up as readers clicked over to the site.
+
+For all intents and purposes, the story should have ended there. Three months after the interview, while attending the O'Reilly Open Source Conference in Monterey, California, I received the following email message from Tracy Pattison, foreign-rights manager at a large New York publishing house:
+
+poem{
+
+To: sam@BeOpen.com Subject:
+
+RMS InterviewDate: Mon, 10 Jul 2000 15:56:37 -0400Dear Mr. Williams,
+
+I read your interview with Richard Stallman on BeOpen with great
+interest. I've been intrigued by RMS and his work for some time now
+and was delighted to find your piece which I really think you did a
+great job of capturing some of the spirit of what Stallman is trying
+to do with GNU-Linux and the Free Software Foundation.
+
+What I'd love to do, however, is read more - and I don't think I'm
+alone. Do you think there is more information and/or sources out there
+to expand and update your interview and adapt it into more of a
+profile of Stallman? Perhaps including some more anecdotal information
+about his personality and background that might really interest and
+enlighten readers outside the more hardcore programming scene?
+
+}poem
+
+The email asked that I give Tracy a call to discuss the idea further. I did just that. Tracy told me her company was launching a new electronic book line, and it wanted stories that appealed to an early-adopter audience. The e-book format was 30,000 words, about 100 pages, and she had pitched her bosses on the idea of profiling a major figure in the hacker community. Her bosses liked the idea, and in the process of searching for interesting people to profile, she had come across my BeOpen interview with Stallman. Hence her email to me.
+
+That's when Tracy asked me: would I be willing to expand the interview into a full-length feature profile?
+
+My answer was instant: yes. Before accepting it, Tracy suggested I put together a story proposal she could show her superiors. Two days later, I sent her a polished proposal. A week later, Tracy sent me a follow up email. Her bosses had given it the green light.
+
+I have to admit, getting Stallman to participate in an e-book project was an afterthought on my part. As a reporter who covered the open source beat, I knew Stallman was a stickler. I'd already received a half dozen emails at that point upbraiding me for the use of "Linux" instead of "GNU/Linux."
+
+Then again, I also knew Stallman was looking for ways to get his message out to the general public. Perhaps if I presented the project to him that way, he would be more receptive. If not, I could always rely upon the copious amounts of documents, interviews, and recorded online conversations Stallman had left lying around the Internet and do an unauthorized biography.
+
+During my research, I came across an essay titled "Freedom-Or Copyright?" Written by Stallman and published in the June, 2000, edition of the MIT Technology Review, the essay blasted e-books for an assortment of software sins. Not only did readers have to use proprietary software programs to read them, Stallman lamented, but the methods used to prevent unauthorized copying were overly harsh. Instead of downloading a transferable HTML or PDF file, readers downloaded an encrypted file. In essence, purchasing an e-book meant purchasing a nontransferable key to unscramble the encrypted content. Any attempt to open a book's content without an authorized key constituted a criminal violation of the Digital Millennium Copyright Act, the 1998 law designed to bolster copyright enforcement on the Internet. Similar penalties held for readers who converted a book's content into an open file format, even if their only intention was to read the book on a different computer in their home. Unlike a normal book, the reader no longer held the right to lend, copy, or resell an e-book. They only had the right to read it on an authorized machine, warned Stallman:
+
+_1 We still have the same old freedoms in using paper books. But if e-books replace printed books, that exception will do little good. With "electronic ink," which makes it possible to download new text onto an apparently printed piece of paper, even newspapers could become ephemeral. Imagine: no more used book stores; no more lending a book to your friend; no more borrowing one from the public library-no more "leaks" that might give someone a chance to read without paying. (And judging from the ads for Microsoft Reader, no more anonymous purchasing of books either.) This is the world publishers have in mind for us.~{ See "Safari Tech Books Online; Subscriber Agreement: Terms of Service."<br> http://safari.oreilly.com/mainhlp.asp?help=service }~
+
+Needless to say, the essay caused some concern. Neither Tracy nor I had discussed the software her company would use nor had we discussed the type of copyright that would govern the e-book's usage. I mentioned the Technology Review article and asked if she could give me information on her company's e-book policies. Tracy promised to get back to me.
+
+Eager to get started, I decided to call Stallman anyway and mention the book idea to him. When I did, he expressed immediate interest and immediate concern. "Did you read my essay on e-books?" he asked.
+
+When I told him, yes, I had read the essay and was waiting to hear back from the publisher, Stallman laid out two conditions: he didn't want to lend support to an e-book licensing mechanism he fundamentally opposed, and he didn't want to come off as lending support. "I don't want to participate in anything that makes me look like a hypocrite," he said.
+
+For Stallman, the software issue was secondary to the copyright issue. He said he was willing to ignore whatever software the publisher or its third-party vendors employed just so long as the company specified within the copyright that readers were free to make and distribute verbatim copies of the e-book's content. Stallman pointed to Stephen King's The Plant as a possible model. In June, 2000, King announced on his official web site that he was self-publishing The Plant in serial form. According to the announcement, the book's total cost would be $13, spread out over a series of $1 installments. As long as at least 75% of the readers paid for each chapter, King promised to continue releasing new installments. By August, the plan seemed to be working, as King had published the first two chapters with a third on the way.
+
+"I'd be willing to accept something like that," Stallman said. "As long as it also permitted verbatim copying."
+
+I forwarded the information to Tracy. Feeling confident that she and I might be able to work out an equitable arrangement, I called up Stallman and set up the first interview for the book. Stallman agreed to the interview without making a second inquiry into the status issue. Shortly after the first interview, I raced to set up a second interview (this one in Kihei), squeezing it in before Stallman headed off on a 14-day vacation to Tahiti.
+
+It was during Stallman's vacation that the bad news came from Tracy. Her company's legal department didn't want to adjust its copyright notice on the e-books. Readers who wanted to make their books transferable would either have to crack the encryption code or convert the book to an open format such as HTML. Either way, the would be breaking the law and facing criminal penalties.
+
+With two fresh interviews under my belt, I didn't see any way to write the book without resorting to the new material. I quickly set up a trip to New York to meet with my agent and with Tracy to see if there was a compromise solution.
+
+When I flew to New York, I met my agent, Henning Guttman. It was our first face-to-face meeting, and Henning seemed pessimistic about our chances of forcing a compromise, at least on the publisher's end. The large, established publishing houses already viewed the e-book format with enough suspicion and weren't in the mood to experiment with copyright language that made it easier for readers to avoid payment. As an agent who specialized in technology books, however, Henning was intrigued by the novel nature of my predicament. I told him about the two interviews I'd already gathered and the promise not to publish the book in a way that made Stallman "look like a hypocrite." Agreeing that I was in an ethical bind, Henning suggested we make that our negotiating point.
+
+Barring that, Henning said, we could always take the carrot-and-stick approach. The carrot would be the publicity that came with publishing an e-book that honored the hacker community's internal ethics. The stick would be the risks associated with publishing an e-book that didn't. Nine months before Dmitri Skylarov became an Internet cause cÈlËbre, we knew it was only a matter of time before an enterprising programmer revealed how to hack e-books. We also knew that a major publishing house releasing an encryption-protected e-book on Richard M. Stallman was the software equivalent of putting "Steal This E-Book" on the cover.
+
+After my meeting with Henning, I put a call into Stallman. Hoping to make the carrot more enticing, I discussed a number of potential compromises. What if the publisher released the book's content under a split license, something similar to what Sun Microsystems had done with Open Office, the free software desktop applications suite? The publisher could then release commercial versions of the e-book under a normal format, taking advantage of all the bells and whistles that went with the e-book software, while releasing the copyable version under a less aesthetically pleasing HTML format.
+
+Stallman told me he didn't mind the split-license idea, but he did dislike the idea of making the freely copyable version inferior to the restricted version. Besides, he said, the idea was too cumbersome. Split licenses worked in the case of Sun's Open Office only because he had no control over the decision making. In this case, Stallman said, he did have a way to control the outcome. He could refuse to cooperate.
+
+I made a few more suggestions with little effect. About the only thing I could get out of Stallman was a concession that the e-book's copyright restrict all forms of file sharing to "noncommercial redistribution."
+
+Before I signed off, Stallman suggested I tell the publisher that I'd promised Stallman that the work would be free. I told Stallman I couldn't agree to that statement but that I did view the book as unfinishable without his cooperation. Seemingly satisfied, Stallman hung up with his usual sign-off line: "Happy hacking."
+
+Henning and I met with Tracy the next day. Tracy said her company was willing to publish copyable excerpts in a unencrypted format but would limit the excerpts to 500 words. Henning informed her that this wouldn't be enough for me to get around my ethical obligation to Stallman. Tracy mentioned her own company's contractual obligation to online vendors such as Amazon.com. Even if the company decided to open up its e-book content this one time, it faced the risk of its partners calling it a breach of contract. Barring a change of heart in the executive suite or on the part of Stallman, the decision was up to me. I could use the interviews and go against my earlier agreement with Stallman, or I could plead journalistic ethics and back out of the verbal agreement to do the book.
+
+Following the meeting, my agent and I relocated to a pub on Third Ave. I used his cell phone to call Stallman, leaving a message when nobody answered. Henning left for a moment, giving me time to collect my thoughts. When he returned, he was holding up the cell phone.
+
+"It's Stallman," Henning said.
+
+The conversation got off badly from the start. I relayed Tracy's comment about the publisher's contractual obligations.
+
+"So," Stallman said bluntly. "Why should I give a damn about their contractual obligations?"
+
+Because asking a major publishing house to risk a legal battle with its vendors over a 30,000 word e-book is a tall order, I suggested.
+
+"Don't you see?" Stallman said. "That's exactly why I'm doing this. I want a signal victory. I want them to make a choice between freedom and business as usual."
+
+As the words "signal victory" echoed in my head, I felt my attention wander momentarily to the passing foot traffic on the sidewalk. Coming into the bar, I had been pleased to notice that the location was less than half a block away from the street corner memorialized in the 1976 Ramones song, "53rd and 3rd," a song I always enjoyed playing in my days as a musician. Like the perpetually frustrated street hustler depicted in that song, I could feel things falling apart as quickly as they had come together. The irony was palpable. After weeks of gleefully recording other people's laments, I found myself in the position of trying to pull off the rarest of feats: a Richard Stallman compromise.
+
+When I continued hemming and hawing, pleading the publisher's position and revealing my growing sympathy for it, Stallman, like an animal smelling blood, attacked.
+
+"So that's it? You're just going to screw me? You're just going to bend to their will?"
+
+I brought up the issue of a dual-copyright again.
+
+"You mean license," Stallman said curtly.
+
+"Yeah, license. Copyright. Whatever," I said, feeling suddenly like a wounded tuna trailing a rich plume of plasma in the water.
+
+"Aw, why didn't you just fucking do what I told you to do!" he shouted.
+
+I must have been arguing on behalf of the publisher to the very end, because in my notes I managed to save a final Stallman chestnut: "I don't care. What they're doing is evil. I can't support evil. Good-bye."
+
+As soon as I put the phone down, my agent slid a freshly poured Guinness to me. "I figured you might need this," he said with a laugh. "I could see you shaking there towards the end."
+
+I was indeed shaking. The shaking wouldn't stop until the Guinness was more than halfway gone. It felt weird, hearing myself characterized as an emissary of "evil." It felt weirder still, knowing that three months before, I was sitting in an Oakland apartment trying to come up with my next story idea. Now, I was sitting in a part of the world I'd only known through rock songs, taking meetings with publishing executives and drinking beer with an agent I'd never even laid eyes on until the day before. It was all too surreal, like watching my life reflected back as a movie montage.
+
+About that time, my internal absurdity meter kicked in. The initial shaking gave way to convulsions of laughter. To my agent, I must have looked like a another fragile author undergoing an untimely emotional breakdown. To me, I was just starting to appreciate the cynical beauty of my situation. Deal or no deal, I already had the makings of a pretty good story. It was only a matter of finding a place to tell it. When my laughing convulsions finally subsided, I held up my drink in a toast.
+
+"Welcome to the front lines, my friend," I said, clinking pints with my agent. "Might as well enjoy it."
+
+If this story really were a play, here's where it would take a momentary, romantic interlude. Disheartened by the tense nature of our meeting, Tracy invited Henning and I to go out for drinks with her and some of her coworkers. We left the bar on Third Ave., headed down to the East Village, and caught up with Tracy and her friends.
+
+Once there, I spoke with Tracy, careful to avoid shop talk. Our conversation was pleasant, relaxed. Before parting, we agreed to meet the next night. Once again, the conversation was pleasant, so pleasant that the Stallman e-book became almost a distant memory.
+
+When I got back to Oakland, I called around to various journalist friends and acquaintances. I recounted my predicament. Most upbraided me for giving up too much ground to Stallman in the preinterview negotiation. A former j-school professor suggested I ignore Stallman's "hypocrite" comment and just write the story. Reporters who knew of Stallman's media-savviness expressed sympathy but uniformly offered the same response: it's your call.
+
+I decided to put the book on the back burner. Even with the interviews, I wasn't making much progress. Besides, it gave me a chance to speak with Tracy without running things past Henning first. By Christmas we had traded visits: she flying out to the west coast once, me flying out to New York a second time. The day before New Year's Eve, I proposed. Deciding which coast to live on, I picked New York. By February, I packed up my laptop computer and all my research notes related to the Stallman biography, and we winged our way to JFK Airport. Tracy and I were married on May 11. So much for failed book deals.
+
+During the summer, I began to contemplate turning my interview notes into a magazine article. Ethically, I felt in the clear doing so, since the original interview terms said nothing about traditional print media. To be honest, I also felt a bit more comfortable writing about Stallman after eight months of radio silence. Since our telephone conversation in September, I'd only received two emails from Stallman. Both chastised me for using "Linux" instead of "GNU/Linux" in a pair of articles for the web magazine Upside Today. Aside from that, I had enjoyed the silence. In June, about a week after the New York University speech, I took a crack at writing a 5,000-word magazine-length story about Stallman. This time, the words flowed. The distance had helped restore my lost sense of emotional perspective, I suppose.
+
+In July, a full year after the original email from Tracy, I got a call from Henning. He told me that O'Reilly & Associates, a publishing house out of Sebastopol, California, was interested in the running the Stallman story as a biography. The news pleased me. Of all the publishing houses in the world, O'Reilly, the same company that had published Eric Raymond's The Cathedral and the Bazaar, seemed the most sensitive to the issues that had killed the earlier e-book. As a reporter, I had relied heavily on the O'Reilly book Open Sources as a historical reference. I also knew that various chapters of the book, including a chapter written by Stallman, had been published with copyright notices that permitted redistribution. Such knowledge would come in handy if the issue of electronic publication ever came up again.
+
+Sure enough, the issue did come up. I learned through Henning that O'Reilly intended to publish the biography both as a book and as part of its new Safari Tech Books Online subscription service. The Safari user license would involve special restrictions,1 Henning warned, but O'Reilly was willing to allow for a copyright that permitted users to copy and share and the book's text regardless of medium. Basically, as author, I had the choice between two licenses: the Open Publication License or the GNU Free Documentation License.
+
+I checked out the contents and background of each license. The Open Publication License (OPL)~{ See "The Open Publication License: Draft v1.0" (June 8, 1999).<br> http://opencontent.org/openpub/ }~ gives readers the right to reproduce and distribute a work, in whole or in part, in any medium "physical or electronic," provided the copied work retains the Open Publication License. It also permits modification of a work, provided certain conditions are met. Finally, the Open Publication License includes a number of options, which, if selected by the author, can limit the creation of "substantively modified" versions or book-form derivatives without prior author approval.
+
+The GNU Free Documentation License (GFDL),~{ See "The GNU Free Documentation License: Version 1.1" (March, 2000).<br> http://www.gnu.org/copyleft/fdl.html }~ meanwhile, permits the copying and distribution of a document in any medium, provided the resulting work carries the same license. It also permits the modification of a document provided certain conditions. Unlike the OPL, however, it does not give authors the option to restrict certain modifications. It also does not give authors the right to reject modifications that might result in a competitive book product. It does require certain forms of front- and back-cover information if a party other than the copyright holder wishes to publish more than 100 copies of a protected work, however.
+
+In the course of researching the licenses, I also made sure to visit the GNU Project web page titled "Various Licenses and Comments About Them."~{ See http://www.gnu.org/philosophy/license-list.html }~ On that page, I found a Stallman critique of the Open Publication License. Stallman's critique related to the creation of modified works and the ability of an author to select either one of the OPL's options to restrict modification. If an author didn't want to select either option, it was better to use the GFDL instead, Stallman noted, since it minimized the risk of the nonselected options popping up in modified versions of a document.
+
+The importance of modification in both licenses was a reflection of their original purpose-namely, to give software-manual owners a chance to improve their manuals and publicize those improvements to the rest of the community. Since my book wasn't a manual, I had little concern about the modification clause in either license. My only concern was giving users the freedom to exchange copies of the book or make copies of the content, the same freedom they would have enjoyed if they purchased a hardcover book. Deeming either license suitable for this purpose, I signed the O'Reilly contract when it came to me.
+
+Still, the notion of unrestricted modification intrigued me. In my early negotiations with Tracy, I had pitched the merits of a GPL-style license for the e-book's content. At worst, I said, the license would guarantee a lot of positive publicity for the e-book. At best, it would encourage readers to participate in the book-writing process. As an author, I was willing to let other people amend my work just so long as my name always got top billing. Besides, it might even be interesting to watch the book evolve. I pictured later editions looking much like online versions of the Talmud, my original text in a central column surrounded by illuminating, third-party commentary in the margins.
+
+My idea drew inspiration from Project Xanadu ( http://www.xanadu.com/ ), the legendary software concept originally conceived by Ted Nelson in 1960. During the O'Reilly Open Source Conference in 1999, I had seen the first demonstration of the project's open source offshoot Udanax and had been wowed by the result. In one demonstration sequence, Udanax displayed a parent document and a derivative work in a similar two-column, plain-text format. With a click of the button, the program introduced lines linking each sentence in the parent to its conceptual offshoot in the derivative. An e-book biography of Richard M. Stallman didn't have to be Udanax-enabled, but given such technological possibilities, why not give users a chance to play around?~{ Anybody willing to "port" this book over to Udanax, the free software version of Xanadu, will receive enthusiastic support from me. To find out more about this intriguing technology, visit http://www.udanax.com/. }~
+
+When Laurie Petrycki, my editor at O'Reilly, gave me a choice between the OPL or the GFDL, I indulged the fantasy once again. By September of 2001, the month I signed the contract, e-books had become almost a dead topic. Many publishing houses, Tracy's included, were shutting down their e-book imprints for lack of interest. I had to wonder. If these companies had treated e-books not as a form of publication but as a form of community building, would those imprints have survived?
+
+After I signed the contract, I notified Stallman that the book project was back on. I mentioned the choice O'Reilly was giving me between the Open Publication License and the GNU Free Documentation License. I told him I was leaning toward the OPL, if only for the fact I saw no reason to give O'Reilly's competitors a chance to print the same book under a different cover. Stallman wrote back, arguing in favor of the GFDL, noting that O'Reilly had already used it several times in the past. Despite the events of the past year, I suggested a deal. I would choose the GFDL if it gave me the possibility to do more interviews and if Stallman agreed to help O'Reilly publicize the book. Stallman agreed to participate in more interviews but said that his participation in publicity-related events would depend on the content of the book. Viewing this as only fair, I set up an interview for December 17, 2001 in Cambridge.
+
+I set up the interview to coincide with a business trip my wife Tracy was taking to Boston. Two days before leaving, Tracy suggested I invite Stallman out to dinner.
+
+"After all," she said, "he is the one who brought us together."
+
+I sent an email to Stallman, who promptly sent a return email accepting the offer. When I drove up to Boston the next day, I met Tracy at her hotel and hopped the T to head over to MIT. When we got to Tech Square, I found Stallman in the middle of a conversation just as we knocked on the door.
+
+"I hope you don't mind," he said, pulling the door open far enough so that Tracy and I could just barely hear Stallman's conversational counterpart. It was a youngish woman, mid-20s I'd say, named Sarah.
+
+"I took the liberty of inviting somebody else to have dinner with us," Stallman said, matter-of-factly, giving me the same cat-like smile he gave me back in that Palo Alto restaurant.
+
+To be honest, I wasn't too surprised. The news that Stallman had a new female friend had reached me a few weeks before, courtesy of Stallman's mother. "In fact, they both went to Japan last month when Richard went over to accept the Takeda Award," Lippman told me at the time.~{ Alas, I didn't find out about the Takeda Foundation's decision to award Stallman, along with Linus Torvalds and Ken Sakamura, with its first-ever award for "Techno-Entrepreneurial Achievement for Social/Economic Well-Being" until after Stallman had made the trip to Japan to accept the award. For more information about the award and its accompanying $1 million prize, visit the Takeda site, http://www.takeda-foundation.jp/ }~
+
+On the way over to the restaurant, I learned the circumstances of Sarah and Richard's first meeting. Interestingly, the circumstances were very familiar. Working on her own fictional book, Sarah said she heard about Stallman and what an interesting character he was. She promptly decided to create a character in her book on Stallman and, in the interests of researching the character, set up an interview with Stallman. Things quickly went from there. The two had been dating since the beginning of 2001, she said.
+
+"I really admired the way Richard built up an entire political movement to address an issue of profound personal concern," Sarah said, explaining her attraction to Stallman.
+
+My wife immediately threw back the question: "What was the issue?"
+
+"Crushing loneliness."
+
+During dinner, I let the women do the talking and spent most of the time trying to detect clues as to whether the last 12 months had softened Stallman in any significant way. I didn't see anything to suggest they had. Although more flirtatious than I remembered-a flirtatiousness spoiled somewhat by the number of times Stallman's eyes seemed to fixate on my wife's chest-Stallman retained the same general level of prickliness. At one point, my wife uttered an emphatic "God forbid" only to receive a typical Stallman rebuke.
+
+"I hate to break it to you, but there is no God," Stallman said.
+
+Afterwards, when the dinner was complete and Sarah had departed, Stallman seemed to let his guard down a little. As we walked to a nearby bookstore, he admitted that the last 12 months had dramatically changed his outlook on life. "I thought I was going to be alone forever," he said. "I'm glad I was wrong."
+
+Before parting, Stallman handed me his "pleasure card," a business card listing Stallman's address, phone number, and favorite pastimes ("sharing good books, good food and exotic music and dance") so that I might set up a final interview.
+
+{free_as_in_freedom_04_rms_pleasure_card.png 355x207 "Stallman's 'pleasure' card, handed to me the night of our dinner." }http://www.free-culture.cc/
+
+The next day, over another meal of dim sum, Stallman seemed even more lovestruck than the night before. Recalling his debates with Currier House dorm maters over the benefits and drawbacks of an immortality serum, Stallman expressed hope that scientists might some day come up with the key to immortality. "Now that I'm finally starting to have happiness in my life, I want to have more," he said.
+
+When I mentioned Sarah's "crushing loneliness" comment, Stallman failed to see a connection between loneliness on a physical or spiritual level and loneliness on a hacker level. "The impulse to share code is about friendship but friendship at a much lower level," he said. Later, however, when the subject came up again, Stallman did admit that loneliness, or the fear of perpetual loneliness, had played a major role in fueling his determination during the earliest days of the GNU Project.
+
+"My fascination with computers was not a consequence of anything else," he said. "I wouldn't have been less fascinated with computers if I had been popular and all the women flocked to me. However, it's certainly true the experience of feeling I didn't have a home, finding one and losing it, finding another and having it destroyed, affected me deeply. The one I lost was the dorm. The one that was destroyed was the AI Lab. The precariousness of not having any kind of home or community was very powerful. It made me want to fight to get it back."
+
+After the interview, I couldn't help but feel a certain sense of emotional symmetry. Hearing Sarah describe what attracted her to Stallman and hearing Stallman himself describe the emotions that prompted him to take up the free software cause, I was reminded of my own reasons for writing this book. Since July, 2000, I have learned to appreciate both the seductive and the repellent sides of the Richard Stallman persona. Like Eben Moglen before me, I feel that dismissing that persona as epiphenomenal or distracting in relation to the overall free software movement would be a grievous mistake. In many ways the two are so mutually defining as to be indistinguishable.
+
+While I'm sure not every reader feels the same level of affinity for Stallman-indeed, after reading this book, some might feel zero affinity-I'm sure most will agree. Few individuals offer as singular a human portrait as Richard M. Stallman. It is my sincere hope that, with this initial portrait complete and with the help of the GFDL, others will feel a similar urge to add their own perspective to that portrait.
+
+1~appendix_a Appendix A - Terminology
+
+For the most part, I have chosen to use the term GNU/Linux in reference to the free software operating system and Linux when referring specifically to the kernel that drives the operating system. The most notable exception to this rule comes in Chapter 9. In the final part of that chapter, I describe the early evolution of Linux as an offshoot of Minix. It is safe to say that during the first two years of the project's development, the operating system Torvalds and his colleagues were working on bore little similarity to the GNU system envisioned by Stallman, even though it gradually began to share key components, such as the GNU C Compiler and the GNU Debugger.
+
+This decision further benefits from the fact that, prior to 1993, Stallman saw little need to insist on credit.
+
+Some might view the decision to use GNU/Linux for later versions of the same operating system as arbitrary. I would like to point out that it was in no way a prerequisite for gaining Stallman's cooperation in the making of this book. I came to it of my own accord, partly because of the operating system's modular nature and the community surrounding it, and partly because of the apolitical nature of the Linux name. Given that this is a biography of Richard Stallman, it seemed inappropriate to define the operating system in apolitical terms.
+
+In the final phases of the book, when it became clear that O'Reilly & Associates would be the book's publisher, Stallman did make it a condition that I use "GNU/Linux" instead of Linux if O'Reilly expected him to provide promotional support for the book after publication. When informed of this, I relayed my earlier decision and left it up to Stallman to judge whether the resulting book met this condition or not. At the time of this writing, I have no idea what Stallman's judgment will be.
+
+A similar situation surrounds the terms "free software" and "open source." Again, I have opted for the more politically laden "free software" term when describing software programs that come with freely copyable and freely modifiable source code. Although more popular, I have chosen to use the term "open source" only when referring to groups and businesses that have championed its usage. But for a few instances, the terms are completely interchangeable, and in making this decision I have followed the advice of Christine Peterson, the person generally credited with coining the term. "The `free software' term should still be used in circumstances where it works better," Peterson writes. "[`Open source'] caught on mainly because a new term was greatly needed, not because it's ideal."
+
+1~appendix_b Appendix B - Hack, Hackers, and Hacking
+
+To understand the full meaning of the word " hacker," it helps to examine the word's etymology over the years.
+
+The New Hacker Dictionary, an online compendium of software-programmer jargon, officially lists nine different connotations of the word "hack" and a similar number for "hacker." Then again, the same publication also includes an accompanying essay that quotes Phil Agre, an MIT hacker who warns readers not to be fooled by the word's perceived flexibility. "Hack has only one meaning," argues Agre. "An extremely subtle and profound one which defies articulation."
+
+Regardless of the width or narrowness of the definition, most modern hackers trace the word back to MIT, where the term bubbled up as popular item of student jargon in the early 1950s. In 1990 the MIT Museum put together a journal documenting the hacking phenomenon. According to the journal, students who attended the institute during the fifties used the word "hack" the way a modern student might use the word "goof." Hanging a jalopy out a dormitory window was a "hack," but anything harsh or malicious-e.g., egging a rival dorm's windows or defacing a campus statue-fell outside the bounds. Implicit within the definition of "hack" was a spirit of harmless, creative fun.
+
+This spirit would inspire the word's gerund form: "hacking." A 1950s student who spent the better part of the afternoon talking on the phone or dismantling a radio might describe the activity as "hacking." Again, a modern speaker would substitute the verb form of "goof"-"goofing" or "goofing off"-to describe the same activity.
+
+As the 1950s progressed, the word "hack" acquired a sharper, more rebellious edge. The MIT of the 1950s was overly competitive, and hacking emerged as both a reaction to and extension of that competitive culture. Goofs and pranks suddenly became a way to blow off steam, thumb one's nose at campus administration, and indulge creative thinking and behavior stifled by the Institute's rigorous undergraduate curriculum. With its myriad hallways and underground steam tunnels, the Institute offered plenty of exploration opportunities for the student undaunted by locked doors and "No Trespassing" signs. Students began to refer to their off-limits explorations as "tunnel hacking." Above ground, the campus phone system offered similar opportunities. Through casual experimentation and due diligence, students learned how to perform humorous tricks. Drawing inspiration from the more traditional pursuit of tunnel hacking, students quickly dubbed this new activity "phone hacking."
+
+The combined emphasis on creative play and restriction-free exploration would serve as the basis for the future mutations of the hacking term. The first self-described computer hackers of the 1960s MIT campus originated from a late 1950s student group called the Tech Model Railroad Club. A tight clique within the club was the Signals and Power (S&P) Committee-the group behind the railroad club's electrical circuitry system. The system was a sophisticated assortment of relays and switches similar to the kind that controlled the local campus phone system. To control it, a member of the group simply dialed in commands via a connected phone and watched the trains do his bidding.
+
+The nascent electrical engineers responsible for building and maintaining this system saw their activity as similar in spirit to phone hacking. Adopting the hacking term, they began refining it even further. From the S&P hacker point of view, using one less relay to operate a particular stretch of track meant having one more relay for future play. Hacking subtly shifted from a synonym for idle play to a synonym for idle play that improved the overall performance or efficiency of the club's railroad system at the same time. Soon S&P committee members proudly referred to the entire activity of improving and reshaping the track's underlying circuitry as "hacking" and to the people who did it as "hackers."
+
+Given their affinity for sophisticated electronics-not to mention the traditional MIT-student disregard for closed doors and "No Trespassing" signs-it didn't take long before the hackers caught wind of a new machine on campus. Dubbed the TX-0, the machine was one of the first commercially marketed computers. By the end of the 1950s, the entire S&P clique had migrated en masse over to the TX-0 control room, bringing the spirit of creative play with them. The wide-open realm of computer programming would encourage yet another mutation in etymology. "To hack" no longer meant soldering unusual looking circuits, but cobbling together software programs with little regard to "official" methods or software-writing procedures. It also meant improving the efficiency and speed of already-existing programs that tended to hog up machine resources. True to the word's roots, it also meant writing programs that served no other purpose than to amuse or entertain.
+
+A classic example of this expanded hacking definition is the game Spacewar, the first interactive video game. Developed by MIT hackers in the early 1960s, Spacewar had all the traditional hacking definitions: it was goofy and random, serving little useful purpose other than providing a nightly distraction for the dozen or so hackers who delighted in playing it. From a software perspective, however, it was a monumental testament to innovation of programming skill. It was also completely free. Because hackers had built it for fun, they saw no reason to guard their creation, sharing it extensively with other programmers. By the end of the 1960s, Spacewar had become a favorite diversion for mainframe programmers around the world.
+
+This notion of collective innovation and communal software ownership distanced the act of computer hacking in the 1960s from the tunnel hacking and phone hacking of the 1950s. The latter pursuits tended to be solo or small-group activities. Tunnel and phone hackers relied heavily on campus lore, but the off-limits nature of their activity discouraged the open circulation of new discoveries. Computer hackers, on the other hand, did their work amid a scientific field biased toward collaboration and the rewarding of innovation. Hackers and "official" computer scientists weren't always the best of allies, but in the rapid evolution of the field, the two species of computer programmer evolved a cooperative-some might say symbiotic-relationship.
+
+It is a testament to the original computer hackers' prodigious skill that later programmers, including Richard M. Stallman, aspired to wear the same hacker mantle. By the mid to late 1970s, the term "hacker" had acquired elite connotations. In a general sense, a computer hacker was any person who wrote software code for the sake of writing software code. In the particular sense, however, it was a testament to programming skill. Like the term "artist," the meaning carried tribal overtones. To describe a fellow programmer as hacker was a sign of respect. To describe oneself as a hacker was a sign of immense personal confidence. Either way, the original looseness of the computer-hacker appellation diminished as computers became more common.
+
+As the definition tightened, "computer" hacking acquired additional semantic overtones. To be a hacker, a person had to do more than write interesting software; a person had to belong to the hacker "culture" and honor its traditions the same way a medieval wine maker might pledge membership to a vintners' guild. The social structure wasn't as rigidly outlined as that of a guild, but hackers at elite institutions such as MIT, Stanford, and Carnegie Mellon began to speak openly of a "hacker ethic": the yet-unwritten rules that governed a hacker's day-to-day behavior. In the 1984 book Hackers, author Steven Levy, after much research and consultation, codified the hacker ethic as five core hacker tenets.
+
+In many ways, the core tenets listed by Levy continue to define the culture of computer hacking. Still, the guild-like image of the hacker community was undermined by the overwhelmingly populist bias of the software industry. By the early 1980s, computers were popping up everywhere, and programmers who once would have had to travel to top-rank institutions or businesses just to gain access to a machine suddenly had the ability to rub elbows with major-league hackers via the ARPAnet. The more these programmers rubbed elbows, the more they began to appropriate the anarchic philosophies of the hacker culture in places like MIT. Lost within the cultural transfer, however, was the native MIT cultural taboo against malicious behavior. As younger programmers began employing their computer skills to harmful ends-creating and disseminating computer viruses, breaking into military computer systems, deliberately causing machines such as MIT Oz, a popular ARPAnet gateway, to crash-the term "hacker" acquired a punk, nihilistic edge. When police and businesses began tracing computer-related crimes back to a few renegade programmers who cited convenient portions of the hacking ethic in defense of their activities, the word "hacker" began appearing in newspapers and magazine stories in a negative light. Although books like Hackers did much to document the original spirit of exploration that gave rise to the hacking culture, for most news reporters, "computer hacker" became a synonym for "electronic burglar."
+
+Although hackers have railed against this perceived misusage for nearly two decades, the term's rebellious connotations dating back to the 1950s make it hard to discern the 15-year-old writing software programs that circumvent modern encryption programs from the 1960s college student, picking locks and battering down doors to gain access to the lone, office computer terminal. One person's creative subversion of authority is another person's security headache, after all. Even so, the central taboo against malicious or deliberately harmful behavior remains strong enough that most hackers prefer to use the term " cracker"-i.e., a person who deliberately cracks a computer security system to steal or vandalize data-to describe the subset of hackers who apply their computing skills maliciously.
+
+This central taboo against maliciousness remains the primary cultural link between the notion of hacking in the early 21st century and hacking in the 1950s. It is important to note that, as the idea of computer hacking has evolved over the last four decades, the original notion of hacking-i.e., performing pranks or exploring underground tunnels-remains intact. In the fall of 2000, the MIT Museum paid tradition to the Institute's age-old hacking tradition with a dedicated exhibit, the Hall of Hacks. The exhibit includes a number of photographs dating back to the 1920s, including one involving a mock police cruiser. In 1993, students paid homage to the original MIT notion of hacking by placing the same police cruiser, lights flashing, atop the Institute's main dome. The cruiser's vanity license plate read IHTFP, a popular MIT acronym with many meanings. The most noteworthy version, itself dating back to the pressure-filled world of MIT student life in the 1950s, is "I hate this fucking place." In 1990, however, the Museum used the acronym as a basis for a journal on the history of hacks. Titled, The Institute for Hacks Tomfoolery and Pranks, the journal offers an adept summary of the hacking.
+
+"In the culture of hacking, an elegant, simple creation is as highly valued as it is in pure science," writes Boston Globe reporter Randolph Ryan in a 1993 article attached to the police car exhibit. "A Hack differs from the ordinary college prank in that the event usually requires careful planning, engineering and finesse, and has an underlying wit and inventiveness," Ryan writes. "The unwritten rule holds that a hack should be good-natured, non-destructive and safe. In fact, hackers sometimes assist in dismantling their own handiwork."
+
+The urge to confine the culture of computer hacking within the same ethical boundaries is well-meaning but impossible. Although most software hacks aspire to the same spirit of elegance and simplicity, the software medium offers less chance for reversibility. Dismantling a police cruiser is easy compared with dismantling an idea, especially an idea whose time has come. Hence the growing distinction between "black hat" and "white hat"-i.e., hackers who turn new ideas toward destructive, malicious ends versus hackers who turn new ideas toward positive or, at the very least, informative ends.
+
+Once a vague item of obscure student jargon, the word "hacker" has become a linguistic billiard ball, subject to political spin and ethical nuances. Perhaps this is why so many hackers and journalists enjoy using it. Where that ball bounces next, however, is anybody's guess.
+
+1~appendix_c Appendix C - GNU Free Documentation License (GFDL)
+
+GNU Free Documentation License Version 1.1, March 2000 Copyright (C) 2000 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,~{ FSF address changed from: 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }~ USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+!_ PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
+
+This License is a kind of "copyleft," which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
+
+We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
+
+!_ APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you."
+
+A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.
+
+The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License.
+
+A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque."
+
+Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
+
+!_ VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and you may publicly display copies.
+
+!_ COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
+
+If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
+
+It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
+
+!_ MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
+
+_1 1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
+
+_1 2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five).
+
+_1 3. State on the Title page the name of the publisher of the Modified Version, as the publisher.
+
+_1 4. Preserve all the copyright notices of the Document.
+
+_1 5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
+
+_1 6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
+
+_1 7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
+
+_1 8. Include an unaltered copy of this License.
+
+_1 9. Preserve the section entitled "History," and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
+
+_1 10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
+
+_1 11. In any section entitled "Acknowledgements" or "Dedications," preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
+
+_1 12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
+
+_1 13. Delete any section entitled "Endorsements." Such a section may not be included in the Modified Version.
+
+_1 14. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section.
+
+If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
+
+You may add a section entitled "Endorsements," provided it contains nothing but endorsements of your Modified Version by various parties-for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
+
+!_ COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice.
+
+The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements," and any sections entitled "Dedications." You must delete all sections entitled "Endorsements."
+
+!_ COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
+
+!_ AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate," and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.
+
+!_ TRANSLATION
+
+Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.
+
+!_ TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+!_ FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/
+
+Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
+
+!_ ADDENDUM: How to Use This License for Your Documents
+
+To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
+
+_1 Copyright (C) YEAR YOUR NAME.Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A copy of the license is included in the section entitled "GNU Free Documentation License".
+
+If you have no Invariant Sections, write "with no Invariant Sections" instead of saying which ones are invariant. If you have no Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
+
+%% SiSU markup sample Notes:
+% SiSU http://www.jus.uio.no/sisu
+% SiSU markup for 0.16 and later:
+% 0.20.4 header 0~links
+% 0.22 may drop image dimensions (rmagick)
+% 0.23 utf-8 ß
+% 0.38 or later, may use alternative notation for headers, e.g. @title: (instead of 0~title)
+% 0.38 document structure alternative markup, experimental (rad) A,B,C,1,2,3 maps to 1,2,3,4,5,6
+% Output: http://www.jus.uio.no/sisu/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams/sisu_manifest.html
+% SiSU 0.38 experimental (alternative structure) markup used for this document
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst b/data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst
new file mode 100644
index 00000000..1b161087
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst
@@ -0,0 +1,161 @@
+% SiSU 0.38
+
+@title: GNU GENERAL PUBLIC LICENSE
+
+@author: Free Software Foundation
+
+@rights: Copyright Copyright 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+@links: {Free Software Foundation}http://www.fsf.org
+{GPL @ SiSU}http://www.jus.uio.no/sisu/gpl2.fsf
+{Markup}http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.sst
+{Syntax}http://www.jus.uio.no/sisu/sample/syntax/gpl2.fsf.sst.html
+{ Free as In Freedom - Richard Stallman's Crusade for Free Software }http://www.jus.uio.no/sisu/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams
+
+@skin: skin_gnu
+
+% @promo: sisu_icon, fsf, open_society, sisu
+
+:A~ GNU GENERAL PUBLIC LICENSE
+
+:B~ Version 2, June 1991
+
+1~ [note] -#
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+1~ Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+:C~ GNU GENERAL PUBLIC LICENSE
+
+1~ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+2~ NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+:C~ END OF TERMS AND CONDITIONS
+
+1~ How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+&lt;one line to give the program's name and a brief idea of what it does.&gt;
+
+Copyright (C) &lt;year &gt; &lt;name of author&gt;
+
+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 2 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~{ FSF address changed from: 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }~
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details.
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than 'show w' and 'show c'; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in the program 'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+&lt;signature of Ty Coon&gt;, 1 April 1989
+
+Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
+
+%% SiSU markup sample Notes:
+% SiSU http://www.jus.uio.no/sisu
+% SiSU markup for 0.16 and later:
+% 0.20.4 header 0~links
+% 0.22 may drop image dimensions (rmagick)
+% 0.23 utf-8 ß
+% 0.38 or later, may use alternative notation for headers, e.g. @title: (instead of 0~title)
+% 0.38 document structure alternative markup, experimental (rad) A,B,C,1,2,3 maps to 1,2,3,4,5,6
+% Output: http://www.jus.uio.no/sisu/gpl2.fsf/sisu_manifest.html
+% SiSU 0.38 experimental (alternative structure) markup used for this document
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/gpl3_draft3.fsf.sst b/data/doc/sisu/sisu_markup_samples/dfsg/gpl3_draft3.fsf.sst
new file mode 100644
index 00000000..160a6058
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/gpl3_draft3.fsf.sst
@@ -0,0 +1,293 @@
+SiSU 0.52
+
+@title: GNU GENERAL PUBLIC LICENSE
+
+@author: Free Software Foundation
+
+@rights: THIS IS A DRAFT, NOT A PUBLISHED VERSION OF THE GNU GENERAL PUBLIC LICENSE.<br>Copyright (C) 2007 Free Software Foundation, Inc. (http://fsf.org) 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA<br>Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+% @rights: THIS IS A DRAFT, NOT A PUBLISHED VERSION OF THE GNU GENERAL PUBLIC LICENSE.<br>Copyright (C) 2007 Free Software Foundation, Inc. (http://fsf.org) 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA<br>Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+@links: {Free Software Foundation}http://www.fsf.org
+{GPL @ SiSU}http://www.jus.uio.no/sisu/gpl2.fsf
+{Markup}http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.sst
+{Syntax}http://www.jus.uio.no/sisu/sample/syntax/gpl2.fsf.sst.html
+{ Free as In Freedom - Richard Stallman's Crusade for Free Software }http://www.jus.uio.no/sisu/free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams
+
+@skin: skin_gnu
+
+% @promo: sisu_icon, fsf, open_society, sisu
+
+:A~ GPLv3 - Third discussion draft
+
+% by brett — last modified 2007-03-28 09:51
+
+:B~ GNU GENERAL PUBLIC LICENSE
+
+:C~ Discussion Draft 3 of Version 3, 28 March 2007
+
+1~ [note] -#
+
+THIS IS A DRAFT, NOT A PUBLISHED VERSION OF THE GNU GENERAL PUBLIC LICENSE.
+
+poem{
+
+Copyright (C) 2007 Free Software Foundation, Inc. ( http://fsf.org )
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+}poem
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+1~ Preamble
+
+The GNU General Public License is a free, copyleft license for software and other kinds of works.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other program whose authors commit to using it. You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+To protect your rights, we need to make requirements that forbid anyone to deny you these rights or to ask you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
+
+For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be associated erroneously with the previous versions.
+
+Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the purpose of the GPL, which is to protect users' freedom to change the software where changes are possible. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
+
+Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in places where they do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+:C~ TERMS AND CONDITIONS
+
+1~0 0. Definitions.
+
+"This License" refers to version 3 of the GNU General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you." "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of a verbatim copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program.
+
+A "contributor" is a party who licenses under this License a work on which the Program is based. Such a work is called the party's "contribution."
+
+To "propagate" a work means to do (or cause others to do) anything with it that requires permission under applicable copyright law, except executing it on a computer or making modifications that you do not share. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies, excluding sublicensing. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+A party's "essential patent claims" in a work are all patent claims owned or controlled by the party, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling the work, but do not include claims that would be infringed only as a consequence of further modification of the work. For purposes of this definition, "control" includes the right to grant sublicenses in a manner consistent with the requirements of this License.
+
+1~1 1. Source Code.
+
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is normally included in the distribution of a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+1~2 2. Basic Permissions.
+
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+Propagation of covered works that you do not convey, and making modified versions of the Program that you do not convey, are permitted without conditions, so long as your license otherwise remains in force. Conveying is permitted under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+1~3 3. No Denying Users' Rights through Technical Measures.
+
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technical measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technical measures.
+
+1~4 4.[1] Conveying Verbatim Copies.
+
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+1~5 5.[2] Conveying Modified Source Versions.
+
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4 above, provided that you also meet all of these conditions:
+
+_1* a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+
+_1* b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+
+_1* c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, unmodified except as permitted by section 7, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+
+_1* d) If the work has interactive user interfaces, each must include a convenient feature that displays an appropriate copyright notice, and tells the user that there is no warranty for the work (unless you provide a warranty), that licensees may convey the work under this License, and how to view a copy of this License. Specifically, if the interface presents a list of user commands or options, such as a menu, a command to display this information must be prominent in the list; otherwise, the work must display this information at startup. However, if the Program has interactive interfaces that do not comply with this subsection, your work need not make them comply.
+
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+1~6 6.[3] Conveying Non-Source Forms.
+
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+_1* a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+
+_1* b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, either (1) to give anyone who possesses the object code a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) to provide access to copy the Corresponding Source from a network server at no charge.
+
+_1* c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+
+_1* d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+
+_1* e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. [In cases of doubt concerning whether an item is a "consumer product", the interpretation of the Magnuson-Moss Warranty Act, 15 U.S.C. 2301 et seq., shall provide the basis for interpretation, regardless of the choice of law determination for this License as a whole.]
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient. Network access may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented, with an implementation available to the public in source code form, and must require no special password or key for unpacking, reading or copying.
+
+1~7 7. Additional Terms.
+
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, you may supplement the terms of this License with terms effective under, or drafted for compatibility with, local law:
+
+_1* a. disclaiming warranty or limiting liability differently from the terms of section 15 of this License; or
+
+_1* b. requiring preservation of specified reasonable legal notices or author attributions in source or object code forms of material added by you to a covered work; or
+
+_1* c. prohibiting misrepresentation of the origin of material added by you to a covered work, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+
+_1* d. limiting the use for publicity purposes of specified names of licensors or authors, or of specified trade names, trademarks, or service marks, to the extent otherwise permitted by law.
+
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, purports to be governed by this License, supplemented by a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+1~8 8.[4] Termination.
+
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void. If you violate this License, any copyright holder may put you on notice by notifying you of the violation, by any reasonable means, provided 60 days have not elapsed since the most recent violation. Having put you on notice, the copyright holder may, at any time, terminate the rights (including any patent rights) that the copyright holder has granted to you under this License.
+
+However, if this is your first violation of this License with respect to a given copyright holder, and you cure the violation within 30 days following your receipt of the notice, then your license is automatically reinstated.
+
+In the event that your rights are terminated under this section, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as they remain in full compliance.
+
+1~9 9.[5] Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+1~10 10.[6] Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program (or the contribution of any contributor).
+
+1~11 11. Patents.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims in its contribution, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contribution.
+
+For purposes of the following three paragraphs, a "patent license" means a patent license, a covenant not to bring suit for patent infringement, or any other express agreement or commitment, however denominated, not to enforce a patent.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) disclaim the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license providing freedom to use, propagate, modify or convey a specific copy of the covered work to any of the parties receiving the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a patent license (a) in connection with copies of the covered work conveyed by you, and/or copies made from those, or (b) primarily for and in connection with specific products or compilations that contain the covered work, which license does not cover, prohibits the exercise of, or is conditioned on the non-exercise of any of the rights that are specifically granted to recipients of the covered work under this License[, unless you entered into that arrangement, or that patent license was granted, prior to March 28, 2007].
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+1~12 12.[7] No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey the Program, or other covered work, so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+1~13 13. Use with the Affero General Public License.
+
+Notwithstanding any other provision of this License, you have permission to link any covered work with a work licensed under version 2 of the Affero General Public License, and to convey the resulting combination. The terms of this License will continue to apply to your covered work but will not apply to the work with which it is linked, which will remain governed by the Affero General Public License.
+
+1~14 14.[9] Revised Versions of this License.
+
+The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide whether future versions of the GNU General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Program.
+
+1~15 15.[11, 12] Disclaimer of Warranty and Limitation of Liability.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
+1~ How to Apply These Terms to Your New Programs
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+poem{
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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
+ or write to the Free Software Foundation,Inc., 51 Franklin Street,
+ Fifth Floor, Boston, MA 02110-1301 USA
+
+}poem
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
+
+poem{
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type 'show c' for details.
+
+}poem
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than 'show w' and 'show c'; for a GUI interface, you would use an "About box" instead.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+poem{
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ 'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+}poem
+
+For more information on how to apply and follow the GNU GPL, see http://www.gnu.org/licenses.
+
+The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi b/data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi
new file mode 100644
index 00000000..4cc32196
--- /dev/null
+++ b/data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi
@@ -0,0 +1,61 @@
+% @title: SiSU overview of status of features available in various outputs
+
+% @date.created: 2005-10-31
+
+% @date.available: 2006-10-31
+
+% @date.modified: 2006-01-23
+
+% @date: 2006-01-23
+
+% :A~? SiSU overview of status of features available in various outputs
+
+!_ A Checklist of Output Features
+
+This table gives an indication of the features that are available
+for various forms of output of SiSU.~{ updated for sisu-0.36.6 on 2006-01-23 }~
+
+{t~h}
+feature |txt|ltx/pdf|HTML|XHTML|XML/s|XML/d|ODF|SQLite|pgSQL
+headings | * | * | * | * | * | * | * | * | *
+footnotes | * | * | * | * | * | * | * | * | *
+bold, underscore, italics | . | * | * | * | * | * | * | * | *
+strikethrough | . | * | * | * | * | * | * | |
+superscript, subscript | . | * | * | * | * | * | * | |
+extended ascii set (utf-8)| * | * | * | * | * | * | * | | *
+indents | * | * | * | * | * | * | * | |
+bullets | . | * | * | * | * | * | . | |
+groups | | | | | | | | |
+* tables | | * | * | . | . | . | . | . | .
+* poem | * | * | * | . | . | . | * | . | .
+* code | * | * | * | . | . | . | * | . | .
+url | * | * | * | * | * | * | * | . | .
+links | * | * | * | * | * | * | * | . | .
+images | - | * | * | T | T | T | * | T | T
+image caption | - | * | * | | | | | |
+table of contents | | * | * | * | * | * | . | |
+page header/footer? | - | * | * | * | * | * | t | |
+line break | * | * | * | * | * | * | * | |
+page break | | * | | | | | * | |
+segments | | | * | | | | | |
+skins | * | * | * | * | * | * | | |
+ocn | . | * | * | * | * | * | -?| * | *
+auto-heading numbers | * | * | * | * | * | * | * | * | *
+minor list numbering | * | * | * | * | * | * | * | * | *
+special characters | . | . | . | | | | | |
+
+group{
+
+ Done
+ * yes/done
+ . partial
+
+ - not available/appropriate
+
+ Not Done
+ T task todo
+ t lesser task/todo
+ not done
+
+}group
+
diff --git a/data/doc/sisu/sisu_output_overview.sst b/data/doc/sisu/sisu_output_overview.sst
new file mode 100644
index 00000000..7a522582
--- /dev/null
+++ b/data/doc/sisu/sisu_output_overview.sst
@@ -0,0 +1,61 @@
+0~title SiSU overview of status of features available in various outputs
+
+0~date.created 2005-10-31
+
+0~date.available 2006-10-31
+
+0~date.modified 2006-01-23
+
+0~date 2006-01-23
+
+1~? SiSU overview of status of features available in various outputs
+
+4~ A Checklist of Output Features
+
+This table gives an indication of the features that are available
+for various forms of output of SiSU.~{ updated for sisu-0.36.6 on 2006-01-23 }~
+
+{t~h}
+feature |txt|ltx/pdf|HTML|XHTML|XML/s|XML/d|ODF|SQLite|pgSQL
+headings | * | * | * | * | * | * | * | * | *
+footnotes | * | * | * | * | * | * | * | * | *
+bold, underscore, italics | . | * | * | * | * | * | * | * | *
+strikethrough | . | * | * | * | * | * | * | |
+superscript, subscript | . | * | * | * | * | * | * | |
+extended ascii set (utf-8)| * | * | * | * | * | * | * | | *
+indents | * | * | * | * | * | * | * | |
+bullets | . | * | * | * | * | * | . | |
+groups | | | | | | | | |
+* tables | | * | * | . | . | . | . | . | .
+* poem | * | * | * | . | . | . | * | . | .
+* code | * | * | * | . | . | . | * | . | .
+url | * | * | * | * | * | * | * | . | .
+links | * | * | * | * | * | * | * | . | .
+images | - | * | * | T | T | T | * | T | T
+image caption | - | * | * | | | | | |
+table of contents | | * | * | * | * | * | . | |
+page header/footer? | - | * | * | * | * | * | t | |
+line break | * | * | * | * | * | * | * | |
+page break | | * | | | | | * | |
+segments | | | * | | | | | |
+skins | * | * | * | * | * | * | | |
+ocn | . | * | * | * | * | * | -?| * | *
+auto-heading numbers | * | * | * | * | * | * | * | * | *
+minor list numbering | * | * | * | * | * | * | * | * | *
+special characters | . | . | . | | | | | |
+
+group{
+
+ Done
+ * yes/done
+ . partial
+
+ - not available/appropriate
+
+ Not Done
+ T task todo
+ t lesser task/todo
+ not done
+
+}group
+
diff --git a/data/sisu/README b/data/sisu/README
new file mode 100644
index 00000000..3f11295e
--- /dev/null
+++ b/data/sisu/README
@@ -0,0 +1,8 @@
+This directory contains shared data that sisu uses
+e.g. shared images, and odf file structure
+
+documentation is elsewhere
+try:
+/usr/share/doc/sisu
+man sisu
+sisu help
diff --git a/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi b/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi
new file mode 100644
index 00000000..0d2ed982
--- /dev/null
+++ b/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi
@@ -0,0 +1,923 @@
+#!/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)
+ * $Id$
+
+ Copyright (C) 2006 Ralph Amissah
+ Copyright (C) 2005 Ralph Amissah (first release edition)
+ Copyright (C) 1997 Ralph Amissah (first edition)
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2006.
+ All Rights Reserved.
+
+ * Ralph Amissah ralph@amissah.com
+ Ralph Amissah ralph.amissah@gmail.com
+
+=end
+require 'cgi'
+require 'fcgi'
+require 'dbi'
+@version='sisu_search_pgsql'
+@url_base="http://corundum:8081/_sisu/image"
+host=%x{echo $HOSTNAME}.chomp!
+@hosturl="http://#{host}" +
+ ':8081'
+@base="#@hosturl/cgi-bin/#@version.cgi"
+user='ralph'
+class Form
+ def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,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_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,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:__; </font>'
+ else ''
+ end
+ end
+ def submission_form
+ search_form=<<-WOK
+<label for="find"><b>SiSU PgSQL Search Form (sample):</b></label>
+<table cellpadding="2">
+<tr><td valign=\"top\">
+ <table cellpadding="2">
+ <form action="#@base" id="Test Form" method="post">
+ <tr><td valign=\"top\">
+ <!input type="text" id="find" name="find" value="#@search_field" />
+ <!input type="text" id="find" name="find" value="" />
+ <textarea id="find" name="find" type="text" rows="4" cols="30" maxlength="256">#@search_field</textarea><br />
+ </td><td valign=\"top\"><p>
+ <select name="db" size="1">
+ #@selected_db
+ <option value="SiSU_sisu">sisu</option>
+ <option value="SiSU_document_samples_sisu_markup">document_samples_sisu_markup</option>
+ </select><br />
+ <font size="2" color="#222222">
+ <input type="radio" name="view" value="index" #@checked_index> index
+ <input type="radio" name="view" value="text" #@checked_text> text
+ </font>
+ </p>
+ <p><input type="submit" value="submit" /></p>
+ </td></tr>
+ </table>
+ #@search_note
+ </td><td valign=\"top\">
+ #@tip
+ </td></tr>
+</table>
+ <font size="2" color="#222222">
+ <input type="checkbox" name="echo" #@checked_echo> echo
+ <input type="checkbox" name="searched" #@checked_searched> searched
+ <input type="checkbox" name="url" #@checked_url> url
+ <input type="checkbox" name="tip" #@checked_tip> search fields available
+ <input type="checkbox" name="sql" #@checked_sql> sql statement
+ </font>
+ <br />
+ <input type="radio" name="checks" value="check_ignore" #@checked_ignore> use selected
+ <input type="radio" name="checks" value="check_all" #@checked_all> check all
+ <input type="radio" name="checks" value="check_none" #@checked_none> check none
+ <br />
+ </form>
+#@the_can
+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
+ 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=''
+ 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:')
+ @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date
+ 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/
+ end
+ end
+ def text_to_match(identifier='')
+ m=Hash.new
+ m[:string]=/#{identifier}\s*(.+?)/
+ m[:string]=/#{identifier}\s*(.+?)(?:;|\n|\r|$)/
+ m[: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)
+ @l,@t,@q=l,t,q
+ end
+ def string
+ search=Hash.new
+ search[:search]=Array.new
+ 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=Array.new
+ unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~\( '")
+ unescaped_search.gsub!(/(.+)/,"#@l~\( '\\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
+ def initialize(conn,search_for,q)
+ @conn=conn
+ @text_search_flag=false
+ search=Hash.new
+ search[:text],search[:endnotes]=Array.new,Array.new
+ st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1']).string
+ se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).string
+ if st[:flag]
+ search[:text] << st[:search]
+ search[:endnotes] << st[:search]
+ end
+ @search_text,@search_endnotes=Array.new,Array.new
+ #%
+ search[:text].each{|x| @search_text << "#{x} AND " }
+ search[:endnotes].each{|x| @search_endnotes << "#{x} AND " }
+ @search_text=@search_text.to_s.gsub!(/AND\s+$/,'')
+ @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'')
+ end
+ def sql_select_body
+ %{SELECT metadata.title, 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, documents.ocn ;}
+ end
+ def sql_select_endnotes
+ %{SELECT metadata.title, 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, endnotes.nr ;}
+ 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
+class Tail
+ def tail
+ <<-'WOK'
+<br /><hr /><br />
+<center><table align="center"bgcolor="#ffffff"><tr><td><font color="#666666"><table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
+
+<tr align="center">
+ <td align="center"><p class="center"><font color="#666666" size="2">
+ presentations' look and feel<br />
+ generated by<br />
+ <a href="http://www.jus.uio.no/sisu" ><img border="0" src="http://corundum:8081/_sisu/image/sisu.png" alt="SiSU on Debian/Gnu/Linux or a FreeBSD &amp; Ruby - better ways, well actually, Way Better!" width="120" height="38"></a><br />
+ <a href="http://www.jus.uio.no/sisu" >SiSU</a><br />
+ version 0.36<br />2006w07/6 (20060218)<br />
+
+ <table summary="SiSU rights" bgcolor="#ffffff" cellpadding="4" border="0" align="center" width="40%">
+ <sup>&copy;</sup> Ralph Amissah<br />
+ 1993, current 2006<br />
+ GPL 2<br />
+ <i>w3 since October 3 1993</i><br />
+ <a href="mailto://ralph@amissah.com" >ralph@amissah.com</a><br />
+</font></p>
+</td></tr></table>
+
+<p><center><font color="#666666" size="2">Developed<br />using <a href="http://www.ruby-lang.org/en/">Ruby</a><br />on <a href="http://www.debian.org/">Debian/Gnu/Linux</a> software infrastructure,<br />with the usual GPL (or OSS) suspects.<br />Better - "performance, reliability, scalability, security<br />& total cost of ownership"<br />[not to mention flexibility &amp; choice]<br /><br />&lt;&lt;<a href="http://www.jus.uio.no/sisu/">Way Better!</a>&gt;&gt;</font></center></p><tr align="center"><td align="center">
+
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr>
+ <td><p><font color="#666666" size="2">
+ If you have problems viewing pages on this site please update your browser:
+ </font></p>
+</td></tr></table>
+
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+<p>
+<font color="#666666" size="2">
+If you have problems viewing pages on this site please update your browser:
+</font>
+</p>
+</td></tr>
+</table>
+
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.gnome.org/projects/epiphany/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/gnome.png" alt="Epiphany">
+&nbsp;Epiphany
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://galeon.sourceforge.net/" target="external">
+<img border="0" width="24" height="24" src="http://corundum:8081/_sisu/image/galeon.png" alt="Galeon">
+&nbsp;Galeon
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.microsoft.com/windows/ie/default.asp" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/internet.explorer.png" alt="MS I-Explorer">
+I-Explorer
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://kazehakase.sourceforge.jp/" target="external">
+Kazehakase</a>
+<sup>&reg;</sup>&nbsp;|</font></p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.konqueror.org/" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/konqueror.png" alt="Konqueror">
+Konqueror</a>
+<sup>&reg;</sup>&nbsp;|</font></p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.mozilla.org/" target="external">
+<img border="0" width="30" height="24" src="http://corundum:8081/_sisu/image/mozilla.png" alt="Mozilla">
+Mozilla
+</a>
+<a href="http://www.mozilla.org/products/firefox/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/firefox.png" alt="Firefox">
+<b>Firefox</b>
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://home.netscape.com/comprod/mirror/client_download.html" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/netscape.png" alt="Netscape">
+Netscape
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.opera.com/" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/opera.png" alt="Opera">
+Opera
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.apple.com/safari/" target="external">
+<img border="0" width="24" height="25" src="http://corundum:8081/_sisu/image/safari.png" alt="Safari">
+Safari
+</a>
+<sup>&reg;</sup>
+</font>
+</p>
+</td></tr>
+</table>
+
+<table summary="lightweight browser and text browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+<p>
+<font color="#666666" size="1">
+for console/text viewing:
+</font>
+</p>
+</td>
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://elinks.or.cz/" target="external">
+<b>elinks</b>
+</a>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links" target="external">
+<b>links2</b>
+</a>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://w3m.sourceforge.net/" target="external">
+<b>w3m</b>
+</a>
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+for lightweight gui (X) viewing try:
+</font>
+</p>
+</td>
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.dillo.org/" target="external">
+Dillo
+</a>&nbsp;|</font></p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.gnome.org/projects/epiphany/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/gnome.png" alt="Epiphany">
+&nbsp;Epiphany
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://galeon.sourceforge.net/" target="external">
+<img border="0" width="24" height="24" src="http://corundum:8081/_sisu/image/galeon.png" alt="Galeon">
+&nbsp;Galeon
+</a>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links" target="external">
+<b>links2 -g</b>
+</a>
+</font>
+</p>
+</td></tr>
+</table>
+</td></tr>
+
+<tr align="center"><td align="center">
+
+<table summary="pdf viewer suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+
+<tr><td>
+<p class="center">
+<font color="#666666" size="1">
+&amp; for
+<a href="http://www.adobe.com/products/acrobat/adobepdf.html" target="external">
+pdf
+</a>
+viewings of this site we recommend stand alone viewers
+<br />
+(rather than web browser plugins):
+</font>
+</p>
+</td></tr>
+</table>
+
+<table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
+<tr align="center"><td align="center">
+<p class="center">
+<font color="#666666" size="1">
+<a href="http://www.adobe.com/products/acrobat/readstep2.html" target="external">
+<img border="0" height="18" width="15" src="http://corundum:8081/_sisu/image/b_pdf.png" alt="Adobe Acrobat Reader">
+Acrobat Reader
+</a>
+<sup>&reg;</sup>
+&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p class="center">
+<font color="#666666" size="1">
+<a href="http://www.gnome.org/projects/evince/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/gnome.png" alt="Evince">
+<b>Evince</b>
+</a>
+<sup>&reg;</sup>
+</font>
+</p>
+</td>
+
+<td>
+<p class="center"><font color="#666666" size="1">
+<a href="http://www.cs.wisc.edu/~ghost/gv/" target="external">
+&nbsp;GhostView<sup>&reg;</sup>&nbsp;</a>,
+<a href="http://wwwthep.physik.uni-mainz.de/~plass/gv/" target="external">
+GV<sup>&reg;</sup>
+</a>
+&amp;
+<a href="http://www.cs.wisc.edu/~ghost/gsview/" target="external">
+GSview<sup>&reg;</sup>
+</a>
+&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p class="center">
+<font color="#666666" size="1">
+<a href="http://www.foolabs.com/xpdf/" target="external">
+<img border="0" width="16" height="16" src="http://corundum:8081/_sisu/image/xpdf.png" alt="Xpdf">
+&nbsp;Xpdf
+</a>
+<sup>&reg;</sup>
+</font>
+</p>
+</td></tr>
+</table>
+
+</font></center></td></tr></table></center> <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
+end
+@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=Hash.new
+ @search[:text],@search[:endnotes]=Array.new,Array.new
+ 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_searched,checked_tip,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,selected_db='','','','','','','',''
+ if cgi['view']=~/text/: checked_index,checked_text='','checked'
+ else checked_index,checked_text='checked',''
+ end
+ 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_echo='checked' if cgi['echo'] =~/\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_url=checked_searched=checked_tip=checked_echo=checked_sql='checked'
+ checked_none=''
+ elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0
+ checked_none='checked'
+ checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
+ else checked_ignore='checked'
+ end
+ selected_db=case cgi['db']
+ when /SiSU_document_samples_sisu_markup/: '<option value="SiSU_document_samples_sisu_markup">document_samples_sisu_markup</option>'
+ when /SiSU_sisu/: '<option value="SiSU_sisu">sisu</option>'
+ end
+ dbi="dbi:Pg:database=#{@db};port=5432"
+ @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/
+ 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}&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}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1"
+ end
+ @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
+ @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
+ canned_note='previous 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)=[^&]+/)
+ af=canned_search.join('; ')
+ af.gsub!(/s1=/,'text: ')
+ af.gsub!(/au=/,'author: ')
+ af.gsub!(/ti=/,'title: ')
+ af.gsub!(/%2B/,' ')
+ analyze_format=af
+ st=af.split(/\s*;\s*/)
+ search_field=st.join("\n")
+ end
+ green=%{<font size="2" color="#004000">}
+ the_can=%{<font size="2" color="#666666">#{canned_note}<br> <a href="#{canned_search_url}">#{canned_search_url}</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_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+/
+ search_note=<<-WOK
+<font size="2" color="#666666">
+<br><b>previous selection</b>:<br>
+database: #{green}#@db</font>; selected view: #{green}#{cgi['view']}</font><br>
+search string: "#{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}
+</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_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form
+ @tail=Tail.new.tail
+ 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
+ @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
+ @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
+ #dbi_request
+ dbi_statement=Dbi_search_statement.new(@conn,@search_for,q)
+ @text_search_flag=false
+ @text_search_flag=dbi_statement.text_search_flag
+ s_contents=dbi_statement.contents
+ s_endnotes=dbi_statement.endnotes
+ @body_main=Array.new
+ @endnotes=Array.new
+ 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"][/(.+?)\.ss[ftms]/, 1]
+ file_suffix=c["filename"][/.+?\.(ss[ftms])/, 1]
+ #metadata_found_body
+ if c["tid"].to_i != oldtid.to_i
+ title=%{<a href="#@hosturl/#@stub/#{location}/">#{c["title"]}</a> by #{c["creator"]} <a href="#@hosturl/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@url_base/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@url_base/b_pdf.png" alt="pdf landscape"></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 !!
+ if @search_for.text1 =~/\S+/: unescaped_search=CGI.unescape(@search_for.text1)
+ elsif q['s1'] =~/\S+/: unescaped_search=CGI.unescape(q['s1'])
+ end
+ search_regex=Array.new
+ 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*/,'|')
+ @search_regx=search_regex.to_s
+ end
+ matched_para=c["body"].gsub(/(#@search_regx)/i,%{<span style="background-color: #ffff48">\\1</span>})
+ %{<hr><p><font size="2">ocn <b><a href="#@hosturl/#@stub/#{location}/#{c["seg"]}.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/#@stub/#{location}/#{c["seg"]}.html##{c["ocn"]}">#{c["ocn"]}</a>, } if @text_search_flag
+ elsif c["suffix"] =~/1/ #doc
+ index=%{<a href="#@hosturl/#@stub/#{location}/doc.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
+ %{<font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.</font><br />}
+ else ''
+ end
+ @body_main << output #+ details
+ end
+ #text_objects_endnote
+ oldtid = 0
+ s_endnotes.each do |e| #% endnotes
+ location=e["filename"][/(.+?)\.ss[ftms]/, 1]
+ file_suffix=e["filename"][/.+?\.(ss[ftms])/, 1]
+ #metadata_found_endnotes
+ if @text_search_flag
+ if e["metadata_tid"].to_i != oldtid.to_i
+ title=%{<br><hr><a href="#@hosturl/#@stub/#{location}/">#{e["title"]}</a> by #{e["creator"]} <a href="#@hosturl/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@url_base/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@url_base/b_pdf.png" alt="pdf landscape"></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=e["body"].gsub(/(#@search_regx)/i,%{<span style="background-color: #ffff48">\\1</span>})
+ output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl/#@stub/#{location}/endnotes.html##{e["nr"]}">#{e["nr"]}</a></b> referred to from ocn <a href="#@hosturl/#@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/#@stub/#{location}/endnotes.html#_#{e["nr"]}">#{e["nr"]}</a> [&sect; <a href="#@hosturl/#@stub/#{location}/doc.html##{e["ocn"]}">#{e["ocn"]}</a>], }
+ end
+ @counters_endn=if @counter_endn_doc > 0
+ %{<font size="2" color="#666666">Found in the endnotes of #@counter_endn_doc documents, and at #@counter_endn_ocn locations within.</font><br />}
+ end
+ @endnotes << output #+ details
+ else @endnotes=Array.new #does not take out yet
+ end
+ end
+ cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + @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/conf/cgi-bin/sisu_search_sqlite.cgi b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
new file mode 100644
index 00000000..f4c5382a
--- /dev/null
+++ b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
@@ -0,0 +1,932 @@
+#!/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)
+ * $Id$
+
+ Copyright (C) 2006 Ralph Amissah
+ Copyright (C) 2005 Ralph Amissah (first release edition)
+ Copyright (C) 1997 Ralph Amissah (first edition)
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2006.
+ All Rights Reserved.
+
+ * Ralph Amissah ralph@amissah.com
+ Ralph Amissah ralph.amissah@gmail.com
+
+=end
+require 'cgi'
+require 'fcgi'
+require 'dbi'
+@version='sisu_search_sqlite'
+@url_base="http://corundum:8081/_sisu/image"
+host=%x{echo $HOSTNAME}.chomp!
+@hosturl="http://#{host}" +
+ ':8081'
+@base="#@hosturl/cgi-bin/#@version.cgi"
+class Form
+ def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,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_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,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:__; </font>'
+ else ''
+ end
+ end
+ def submission_form
+ search_form=<<-WOK
+<label for="find"><b>SiSU SQLite Search Form (sample):</b></label>
+<table cellpadding="2">
+<tr><td valign=\"top\">
+ <table cellpadding="2">
+ <form action="#@base" id="Test Form" method="post">
+ <tr><td valign=\"top\">
+ <!input type="text" id="find" name="find" value="#@search_field" />
+ <!input type="text" id="find" name="find" value="" />
+ <textarea id="find" name="find" type="text" rows="4" cols="30" maxlength="256">#@search_field</textarea><br />
+ </td><td valign=\"top\"><p>
+ <select name="db" size="1">
+ #@selected_db
+ <option value="SiSU_document_samples_sisu_markup">SiSU examples</option>
+ <option value="SiSU_sisu">SiSU</option>
+ <option value="SiSU_sisu-dev">SiSU dev</option>
+ <option value="SiSU_books">Books</option>
+ <option value="SiSU_articles">Articles</option>
+ <option value="SiSU_agreements">Agreements</option>
+ <option value="SiSU_conventions">Conventions</option>
+ </select><br />
+ <font size="2" color="#222222">
+ <input type="radio" name="view" value="index" #@checked_index> index
+ <input type="radio" name="view" value="text" #@checked_text> text
+ </font>
+ </p>
+ <p><input type="submit" value="submit" /></p>
+ </td></tr>
+ </table>
+ #@search_note
+ </td><td valign=\"top\">
+ #@tip
+ </td></tr>
+</table>
+ <font size="2" color="#222222">
+ <input type="checkbox" name="echo" #@checked_echo> echo
+ <input type="checkbox" name="searched" #@checked_searched> searched
+ <input type="checkbox" name="url" #@checked_url> url
+ <input type="checkbox" name="tip" #@checked_tip> search fields available
+ <input type="checkbox" name="sql" #@checked_sql> sql statement
+ </font>
+ <br />
+ <input type="radio" name="checks" value="check_ignore" #@checked_ignore> use selected
+ <input type="radio" name="checks" value="check_all" #@checked_all> check all
+ <input type="radio" name="checks" value="check_none" #@checked_none> check none
+ <br />
+ </form>
+#@the_can
+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
+ 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=''
+ 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:')
+ @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date
+ 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/
+ end
+ end
+ def text_to_match(identifier='')
+ m=Hash.new
+ m[:string]=/#{identifier}\s*(.+?)/
+ m[:string]=/#{identifier}\s*(.+?)(?:;|\n|\r|$)/
+ m[: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)
+ @l,@t,@q=l,t,q
+ end
+ def string
+ search=Hash.new
+ search[:search]=Array.new
+ 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=Array.new
+ 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
+ def initialize(conn,search_for,q)
+ @conn=conn
+ @text_search_flag=false
+ search=Hash.new
+ search[:text],search[:endnotes]=Array.new,Array.new
+ st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1']).string
+ se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).string
+ if st[:flag]
+ search[:text] << st[:search]
+ search[:endnotes] << st[:search]
+ end
+ @search_text,@search_endnotes=Array.new,Array.new
+ #%
+ search[:text].each{|x| @search_text << "#{x} AND " }
+ search[:endnotes].each{|x| @search_endnotes << "#{x} AND " }
+ @search_text=@search_text.to_s.gsub!(/AND\s+$/,'')
+ @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'')
+ end
+ def sql_select_body
+ %{SELECT metadata.title, 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, documents.ocn ;}
+ end
+ def sql_select_endnotes
+ %{SELECT metadata.title, 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, endnotes.nr ;}
+ 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
+class Tail
+ def tail
+ <<-'WOK'
+<br /><hr /><br />
+<center><table align="center"bgcolor="#ffffff"><tr><td><font color="#666666"><table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
+
+<tr align="center">
+ <td align="center"><p class="center"><font color="#666666" size="2">
+ presentations' look and feel<br />
+ generated by<br />
+ <a href="http://www.jus.uio.no/sisu" ><img border="0" src="http://corundum:8081/_sisu/image/sisu.png" alt="SiSU on Debian/Gnu/Linux or a FreeBSD &amp; Ruby - better ways, well actually, Way Better!" width="120" height="38"></a><br />
+ <a href="http://www.jus.uio.no/sisu" >SiSU</a><br />
+ version 0.36<br />2006w07/6 (20060218)<br />
+
+ <table summary="SiSU rights" bgcolor="#ffffff" cellpadding="4" border="0" align="center" width="40%">
+ <sup>&copy;</sup> Ralph Amissah<br />
+ 1993, current 2006<br />
+ GPL 2<br />
+ <i>w3 since October 3 1993</i><br />
+ <a href="mailto://ralph@amissah.com" >ralph@amissah.com</a><br />
+</font></p>
+</td></tr></table>
+
+<p><center><font color="#666666" size="2">Developed<br />using <a href="http://www.ruby-lang.org/en/">Ruby</a><br />on <a href="http://www.debian.org/">Debian/Gnu/Linux</a> software infrastructure,<br />with the usual GPL (or OSS) suspects.<br />Better - "performance, reliability, scalability, security<br />& total cost of ownership"<br />[not to mention flexibility &amp; choice]<br /><br />&lt;&lt;<a href="http://www.jus.uio.no/sisu/">Way Better!</a>&gt;&gt;</font></center></p><tr align="center"><td align="center">
+
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr>
+ <td><p><font color="#666666" size="2">
+ If you have problems viewing pages on this site please update your browser:
+ </font></p>
+</td></tr></table>
+
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+<p>
+<font color="#666666" size="2">
+If you have problems viewing pages on this site please update your browser:
+</font>
+</p>
+</td></tr>
+</table>
+
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.gnome.org/projects/epiphany/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/gnome.png" alt="Epiphany">
+&nbsp;Epiphany
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://galeon.sourceforge.net/" target="external">
+<img border="0" width="24" height="24" src="http://corundum:8081/_sisu/image/galeon.png" alt="Galeon">
+&nbsp;Galeon
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.microsoft.com/windows/ie/default.asp" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/internet.explorer.png" alt="MS I-Explorer">
+I-Explorer
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://kazehakase.sourceforge.jp/" target="external">
+Kazehakase</a>
+<sup>&reg;</sup>&nbsp;|</font></p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.konqueror.org/" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/konqueror.png" alt="Konqueror">
+Konqueror</a>
+<sup>&reg;</sup>&nbsp;|</font></p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.mozilla.org/" target="external">
+<img border="0" width="30" height="24" src="http://corundum:8081/_sisu/image/mozilla.png" alt="Mozilla">
+Mozilla
+</a>
+<a href="http://www.mozilla.org/products/firefox/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/firefox.png" alt="Firefox">
+<b>Firefox</b>
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://home.netscape.com/comprod/mirror/client_download.html" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/netscape.png" alt="Netscape">
+Netscape
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.opera.com/" target="external">
+<img border="0" width="29" height="25" src="http://corundum:8081/_sisu/image/opera.png" alt="Opera">
+Opera
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.apple.com/safari/" target="external">
+<img border="0" width="24" height="25" src="http://corundum:8081/_sisu/image/safari.png" alt="Safari">
+Safari
+</a>
+<sup>&reg;</sup>
+</font>
+</p>
+</td></tr>
+</table>
+
+<table summary="lightweight browser and text browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+<p>
+<font color="#666666" size="1">
+for console/text viewing:
+</font>
+</p>
+</td>
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://elinks.or.cz/" target="external">
+<b>elinks</b>
+</a>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links" target="external">
+<b>links2</b>
+</a>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://w3m.sourceforge.net/" target="external">
+<b>w3m</b>
+</a>
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+for lightweight gui (X) viewing try:
+</font>
+</p>
+</td>
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.dillo.org/" target="external">
+Dillo
+</a>&nbsp;|</font></p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://www.gnome.org/projects/epiphany/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/gnome.png" alt="Epiphany">
+&nbsp;Epiphany
+</a>
+<sup>&reg;</sup>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://galeon.sourceforge.net/" target="external">
+<img border="0" width="24" height="24" src="http://corundum:8081/_sisu/image/galeon.png" alt="Galeon">
+&nbsp;Galeon
+</a>&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p>
+<font color="#666666" size="1">
+<a href="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links" target="external">
+<b>links2 -g</b>
+</a>
+</font>
+</p>
+</td></tr>
+</table>
+</td></tr>
+
+<tr align="center"><td align="center">
+
+<table summary="pdf viewer suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+
+<tr><td>
+<p class="center">
+<font color="#666666" size="1">
+&amp; for
+<a href="http://www.adobe.com/products/acrobat/adobepdf.html" target="external">
+pdf
+</a>
+viewings of this site we recommend stand alone viewers
+<br />
+(rather than web browser plugins):
+</font>
+</p>
+</td></tr>
+</table>
+
+<table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
+<tr align="center"><td align="center">
+<p class="center">
+<font color="#666666" size="1">
+<a href="http://www.adobe.com/products/acrobat/readstep2.html" target="external">
+<img border="0" height="18" width="15" src="http://corundum:8081/_sisu/image/b_pdf.png" alt="Adobe Acrobat Reader">
+Acrobat Reader
+</a>
+<sup>&reg;</sup>
+&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p class="center">
+<font color="#666666" size="1">
+<a href="http://www.gnome.org/projects/evince/" target="external">
+<img border="0" width="25" height="25" src="http://corundum:8081/_sisu/image/gnome.png" alt="Evince">
+<b>Evince</b>
+</a>
+<sup>&reg;</sup>
+</font>
+</p>
+</td>
+
+<td>
+<p class="center"><font color="#666666" size="1">
+<a href="http://www.cs.wisc.edu/~ghost/gv/" target="external">
+&nbsp;GhostView<sup>&reg;</sup>&nbsp;</a>,
+<a href="http://wwwthep.physik.uni-mainz.de/~plass/gv/" target="external">
+GV<sup>&reg;</sup>
+</a>
+&amp;
+<a href="http://www.cs.wisc.edu/~ghost/gsview/" target="external">
+GSview<sup>&reg;</sup>
+</a>
+&nbsp;|
+</font>
+</p>
+</td>
+
+<td>
+<p class="center">
+<font color="#666666" size="1">
+<a href="http://www.foolabs.com/xpdf/" target="external">
+<img border="0" width="16" height="16" src="http://corundum:8081/_sisu/image/xpdf.png" alt="Xpdf">
+&nbsp;Xpdf
+</a>
+<sup>&reg;</sup>
+</font>
+</p>
+</td></tr>
+</table>
+
+</font></center></td></tr></table></center> <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
+end
+@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=Hash.new
+ @search[:text],@search[:endnotes]=Array.new,Array.new
+ 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_searched,checked_tip,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,selected_db='','','','','','','',''
+ if cgi['view']=~/text/: checked_index,checked_text='','checked'
+ else checked_index,checked_text='checked',''
+ end
+ 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_echo='checked' if cgi['echo'] =~/\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_url=checked_searched=checked_tip=checked_echo=checked_sql='checked'
+ checked_none=''
+ elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0
+ checked_none='checked'
+ checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
+ else checked_ignore='checked'
+ end
+ selected_db=case cgi['db']
+ when /SiSU_document_samples_sisu_markup/: '<option value="SiSU_document_samples_sisu_markup">document_samples_sisu_markup</option>'
+ when /SiSU_sisu/: '<option value="SiSU_sisu">sisu</option>'
+ end
+ db_name='sisu_sqlite.db'
+ db_sqlite=case cgi['db']
+ when /SiSU_document_samples_sisu_markup/: "/home/ralph/sisu_www/document_samples_sisu_markup/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/
+ 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}&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}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1"
+ end
+ @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
+ @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
+ canned_note='previous 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)=[^&]+/)
+ af=canned_search.join('; ')
+ af.gsub!(/s1=/,'text: ')
+ af.gsub!(/au=/,'author: ')
+ af.gsub!(/ti=/,'title: ')
+ af.gsub!(/%2B/,' ')
+ analyze_format=af
+ st=af.split(/\s*;\s*/)
+ search_field=st.join("\n")
+ end
+ green=%{<font size="2" color="#004000">}
+ the_can=%{<font size="2" color="#666666">#{canned_note}<br> <a href="#{canned_search_url}">#{canned_search_url}</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_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+/
+ search_note=<<-WOK
+<font size="2" color="#666666">
+<br><b>previous selection</b>:<br>
+database: #{green}#@db</font>; selected view: #{green}#{cgi['view']}</font><br>
+search string: "#{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}
+</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_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form
+ @tail=Tail.new.tail
+ 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
+ @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
+ @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
+ #dbi_request
+ dbi_statement=Dbi_search_statement.new(@conn,@search_for,q)
+ @text_search_flag=false
+ @text_search_flag=dbi_statement.text_search_flag
+ s_contents=dbi_statement.contents
+ s_endnotes=dbi_statement.endnotes
+ @body_main=Array.new
+ @endnotes=Array.new
+ 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"][/(.+?)\.ss[ftm]/, 1]
+ file_suffix=c["filename"][/.+?\.(ss[ftm])/, 1]
+ #metadata_found_body
+ if c["tid"].to_i != oldtid.to_i
+ title=%{<a href="#@hosturl/#@stub/#{location}/">#{c["title"]}</a> by #{c["creator"]} <a href="#@hosturl/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@url_base/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@url_base/b_pdf.png" alt="pdf landscape"></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 !!
+ if @search_for.text1 =~/\S+/: unescaped_search=CGI.unescape(@search_for.text1)
+ elsif q['s1'] =~/\S+/: unescaped_search=CGI.unescape(q['s1'])
+ end
+ search_regex=Array.new
+ 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*/,'|')
+ @search_regx=search_regex.to_s
+ end
+ matched_para=c["body"].gsub(/(#@search_regx)/i,%{<span style="background-color: #ffff48">\\1</span>})
+ %{<hr><p><font size="2">ocn <b><a href="#@hosturl/#@stub/#{location}/#{c["seg"]}.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/#@stub/#{location}/#{c["seg"]}.html##{c["ocn"]}">#{c["ocn"]}</a>, } if @text_search_flag
+ elsif c["suffix"] =~/1/ #doc
+ index=%{<a href="#@hosturl/#@stub/#{location}/doc.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
+ %{<font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.</font><br />}
+ else ''
+ end
+ @body_main << output #+ details
+ end
+ #text_objects_endnote
+ oldtid = 0
+ s_endnotes.each do |e| #% endnotes
+ location=e["filename"][/(.+?)\.ss[ftm]/, 1]
+ file_suffix=e["filename"][/.+?\.(ss[ftm])/, 1]
+ #metadata_found_endnotes
+ if @text_search_flag
+ if e["metadata_tid"].to_i != oldtid.to_i
+ title=%{<br><hr><a href="#@hosturl/#@stub/#{location}/">#{e["title"]}</a> by #{e["creator"]} <a href="#@hosturl/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@url_base/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@url_base/b_pdf.png" alt="pdf landscape"></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=e["body"].gsub(/(#@search_regx)/i,%{<span style="background-color: #ffff48">\\1</span>})
+ output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl/#@stub/#{location}/endnotes.html##{e["nr"]}">#{e["nr"]}</a></b> referred to from ocn <a href="#@hosturl/#@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/#@stub/#{location}/endnotes.html#_#{e["nr"]}">#{e["nr"]}</a> [&sect; <a href="#@hosturl/#@stub/#{location}/doc.html##{e["ocn"]}">#{e["ocn"]}</a>], }
+ end
+ @counters_endn=if @counter_endn_doc > 0
+ %{<font size="2" color="#666666">Found in the endnotes of #@counter_endn_doc documents, and at #@counter_endn_ocn locations within.</font><br />}
+ end
+ @endnotes << output #+ details
+ else @endnotes=Array.new #does not take out yet
+ end
+ end
+ cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + @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/conf/completion/README b/data/sisu/conf/completion/README
new file mode 100644
index 00000000..d723a140
--- /dev/null
+++ b/data/sisu/conf/completion/README
@@ -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/conf/completion/_sisu b/data/sisu/conf/completion/_sisu
new file mode 100644
index 00000000..076795cb
--- /dev/null
+++ b/data/sisu/conf/completion/_sisu
@@ -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/conf/convert/kdissert_to_sisu b/data/sisu/conf/convert/kdissert_to_sisu
new file mode 100644
index 00000000..aa651f80
--- /dev/null
+++ b/data/sisu/conf/convert/kdissert_to_sisu
@@ -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 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.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__
diff --git a/data/sisu/conf/convert/modify.rb b/data/sisu/conf/convert/modify.rb
new file mode 100644
index 00000000..f00da1a9
--- /dev/null
+++ b/data/sisu/conf/convert/modify.rb
@@ -0,0 +1,250 @@
+#!/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: A conversion script for canned substitutions,
+ a fairly generic simple tool that can be used to store other canned conversions,
+ used here for altering SiSU markup
+ * 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 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ © Ralph Amissah 1997, current 2006.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: configure rc in ~/.sisu/sisurc.yaml
+=end
+module SiSU_Modify
+ class Convert_markup
+ def initialize(cf,files)
+ @cf,@files=cf,files
+ @description="This is a script that contains canned text conversions for reuse"
+ end
+ def current_match_and_replace #Disable, edit manually
+ #convert_pre_37_to_38_experimental
+ end
+ def message(text)
+ response=''
+ while response !~/yes/
+ print %{
+ #{text}
+ to continue type "yes" [to exit type "no" or "quit"]: }
+ response=File.new('/dev/tty').gets.strip
+ exit if response =~/^(?:quit|no)$/
+ end
+ end
+ def help
+ print <<WOK
+
+#@description
+
+modify.rb --default [filename/wildcard]
+ performs the current default conversion that is set
+ [handle with care, (may be disabled)]
+
+modify.rb --to38 [filename/wildcard]
+ converts pre 0.37 sisu markup to 0.38 experimental
+
+modify.rb --to37 [filename/wildcard]
+ converts pre 0.37 sisu markup to 0.38 experimental
+
+note converting twice in a single direction will result
+in markup inconsistency
+
+An alternative script has been introduced,
+try 'sisu --convert'
+
+modify.rb --default
+ performs the current default conversion that is set
+ on the files matched in default the settings
+ [handle with care, (may be disabled)]
+
+WOK
+ exit
+ end
+ #%% substitutions to be made
+ def convert_pre_37_to_38_experimental
+ message('convert sisu markup from 0.37 to 0.38 experimental (rad)')
+ [
+ [/^0~(\S+?)([+-])\s+/, "@\\1:\\2 "],
+ [/^0~(\S+)\s+/, "@\\1: "],
+ [/^@toc:\s+/, "@structure: "],
+ [/^1~/, ':A~'],
+ [/^2~/, ':B~'],
+ [/^3~/, ':C~'],
+ [/^4~/, '1~'],
+ [/^5~/, '2~'],
+ [/^6~/, '3~']
+ ]
+ end
+ def convert_38_experimental_to_37
+ message('convert sisu markup from 0.38 experimental (rad) to 0.37')
+ [
+ [/^@(\S+?):([+-])\s+/, "0~\\1\\2 "],
+ [/^@(\S+?):\s+/, "0~\\1 "],
+ [/^0~structure\s+/, "0~toc "],
+ [/^1~/, '4~'],
+ [/^2~/, '5~'],
+ [/^3~/, '6~'],
+ [/^:?A~/, '1~'],
+ [/^:?B~/, '2~'],
+ [/^:?C~/, '3~']
+ ]
+ end
+ def markup_version?(i)
+ file=File.open(i,'r')
+ cont=file.readlines
+ file.close
+ markup_version=nil
+ cont.each do |y|
+ if y =~/^:?A~/
+ markup_version='0.38'
+ break
+ end
+ if y =~/^1~/
+ markup_version='0.37'
+ break
+ end
+ #if y =~/^1{~/
+ # markup_version='0.16'
+ # break
+ #end
+ markup_version='0.37'
+ end
+ markup_version
+ end
+ def conversion
+ #%% do it -------------------------->
+ if @files and @files.length > 0
+ p @files
+ mr=nil
+ #%% changes to make m match, r replace -------------------------->
+ if @cf =~/--help/: help
+ else
+ message("WARNING, proceed at your own risk,\npermanent changes requested for the above named files\n best that you check (manually) what this file is set to do\n conversions set are at the top of the file")
+ mr=case @cf
+ when /--convert|default/: current_match_and_replace
+ when /--(?:(?:37)?to38|rad)/: convert_pre_37_to_38_experimental
+ when /--(?:(?:38)?to37)/: convert_38_experimental_to_37
+ else help
+ end
+ end
+ match_and_replace=mr
+ #start_processing =/not used in this example/i
+ end_processing =/END\s+OF\s+FILE/
+ @files.each do |i|
+ @new,@matched,@flag_start,@flag_end,@empty1,@empty2=true,false,false,false,false,false
+ o="#{i}.bk" #o is for old
+ file=File.open(i,'r')
+ cont=file.readlines
+ file.close
+ cont.each do |y|
+ #p y
+ #p y if y =~/^[1-6]~/
+ match_and_replace.each do |m,r|
+ if y =~m
+ if @new
+ @new=false
+ File.unlink(o) if File.exists?(o)
+ #system("lv #{i} > #{o}")
+ File.rename(i,o)
+ File.unlink(i) if File.exists?(i)
+ @file=File.new(i,'w')
+ @matched=true
+ break
+ end
+ end
+ end
+ end
+ if @matched
+ puts "match in #{i}"
+ @flag_start=true
+ cont.each do |y|
+ if y =~end_processing: @flag_end=true
+ end
+ if @flag_start and not @flag_end
+ match_and_replace.each do |m,r|
+ if y =~m
+ p m.to_s + ' -> ' + r
+ puts "in: #{y}"
+ y.gsub!(m,r) if m and r
+ puts "out: #{y}"
+ end
+ end
+ end
+ #if y =~start_processing: @flag_start=true
+ #end
+ #if y =~m1
+ #end
+ if y=~/^\s*$/: @empty1=true
+ else @empty1=false
+ end
+ @file.puts y unless (@empty1==true and @empty2==true)
+ if y=~/^\s*$/: @empty2=true
+ else @empty2=false
+ end
+ #@file << y + "\n"
+ end
+ @file.close
+ else puts "NO match in #{f}"
+ end
+ end
+ else puts "this routine makes permanent changes to the contents of the files matched, as instructed within [no matches]"
+ end
+ end
+ end
+end
+#%% files to match for this conversion set ------------------------->
+f=$*
+p $*
+cf=f[0].to_s
+f.shift
+match_and_replace=Array.new
+#unless cf and cf =~/--/
+# puts <<WOK
+#
+##@description
+#
+#usage:
+# modify.rb --convert [filename/wildcard]
+#for help
+# modify.rb --help
+#WOK
+# exit
+#end
+unless f.length > 0: f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be
+end
+#f=Dir.glob("{bin,conf,data,lib}/**/*.rb") #sisu development
+#f=Dir.glob("[^_]/**/*") #all files subdirectories beneath pwd except those starting with _
+SiSU_Modify::Convert_markup.new(cf,f).conversion
+__END__
diff --git a/data/sisu/conf/convert/sisu_convert b/data/sisu/conf/convert/sisu_convert
new file mode 100644
index 00000000..d7876083
--- /dev/null
+++ b/data/sisu/conf/convert/sisu_convert
@@ -0,0 +1,392 @@
+#!/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
+# * arch-tag: document conversion tool to sisu markup
+# * $Date: 2004/10/16 15:51:06 $
+# * $Id: sisu_convert,v 1.37 2004/10/16 15:51:06 ralph Exp $
+# * License: GPL 2 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>
+# * <url:zxy_param.rb>|zxy_param.rb|@|^|
+module CONVERT
+ class MyOutput
+ def initialize(data, filename, instruct)
+ @data=data.compact
+ @filename=filename
+ @instruct=instruct
+ end
+ def headerBasic
+ <<WOK
+0~title
+
+0~subtitle
+
+0~creator
+
+0~type
+
+0~subject
+
+0~date
+
+0~date.available
+
+0~publisher SiSU
+
+0~rights
+
+0~level
+
+WOK
+ end
+ def headerDefault
+ <<WOK
+0~title
+
+0~subtitle
+
+0~creator
+
+0~type
+
+0~subject
+
+0~date
+
+0~date.available
+
+0~publisher SiSU
+
+0~rights ...
+
+WOK
+ end
+ def hardOutput
+ pre = Array.new
+ case @instruct
+ when /default/
+ pre << headerDefault
+ else
+ pre << headerBasic
+ end
+ @filename_wv=File.new(%{,,#{@filename}.er9}, "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}.er9 >\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, "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
+ 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}.er9 >\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.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
+ 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
+ ### 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, '~e ') #endnote marker
+ para.gsub!(/<a name=".+?"\s+href=".+?\.html#(?:[a-z_$]+)?[0-9_-]+"?>\[[a-z]?\d+\](?:<\/[bi]>)?<\/a>/i, '~e ') #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!(/~e\s+\.\s*/i, ".~e ") #check vim equiv # %s/\~e\s\+\.\s*/.\~e /c
+ para.gsub!(/\s+~e\s+/i, "~e ")
+ 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!(/^(?:<(?:\/)?[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}.er9 >\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 doWord(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.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 doHtml(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::Html.new(file_array, filename, instruct).songsheet # metaverse created here
+ end
+end
+def doDefault(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
+ doWord(argv, instruct)
+ when/^--(html)$/i #creates sisu.gz package to send
+ doHtml(argv, instruct)
+ when/^--(default)$/i #creates sisu.gz package to send
+ doDefault(argv, instruct)
+ else
+ help
+ end
+end
+require 'zxy_sysenv.rb'
+include SiSU_Env
+@dir=SiSU_Env::Info_dir.new
+@argv=Array.new
+argv=$*
+instruct = "#{argv[0].to_s}"
+argv.shift
+instruct.chomp!
+instruct = "help" if instruct.nil? or instruct == "";
+cases(argv, instruct)
diff --git a/data/sisu/conf/convert/wvHtml.xml b/data/sisu/conf/convert/wvHtml.xml
new file mode 100644
index 00000000..ec04dc33
--- /dev/null
+++ b/data/sisu/conf/convert/wvHtml.xml
@@ -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/conf/convert/wvSiSU.xml b/data/sisu/conf/convert/wvSiSU.xml
new file mode 100644
index 00000000..8d9f913e
--- /dev/null
+++ b/data/sisu/conf/convert/wvSiSU.xml
@@ -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/conf/lighttpd/lighttpd.cfg.sisu b/data/sisu/conf/lighttpd/lighttpd.cfg.sisu
new file mode 100644
index 00000000..a8819e3c
--- /dev/null
+++ b/data/sisu/conf/lighttpd/lighttpd.cfg.sisu
@@ -0,0 +1,115 @@
+# lighttpd configuration file
+#
+# use a it as base for lighttpd 1.0.0 and above
+#
+#%% Options you really have to take care of
+#%
+# modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.dir-listing = "disable"
+server.modules = ( "mod_rewrite",
+ "mod_access",
+ "mod_fastcgi",
+ "mod_compress",
+ "mod_accesslog")
+#%% a static document-root, for virtual-hosting take look at the
+#% server.virtual-* options
+server.document-root = "/var/www/"
+#server.document-root = "/home/*username*/web/public/"
+## 'Parent' domain on any server except davie.
+#server.document-root = "/home/*username*/public_html/"
+##'Parent' domain for those of you currently on davie.textdrive.com, and all future servers.
+#server.document-root = "/home/*username*/web/public/"
+#% where to send error-messages to
+server.errorlog = "/home/[*username*]/var/lighttpd/log/lighttpd.error.log"
+#% files to check for if .../ is requested
+server.indexfiles = ( "index.php", "index.html",
+ "index.htm", "index.rb")
+##% mimetype mapping
+##include "mime.types.conf"
+##include_shell "/usr/local/bin/confmimetype /etc/mime.types"
+#% mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".gz" => "application/x-gzip",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".zip" => "application/zip",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".s1" => "text/plain",
+ ".s2" => "text/plain",
+ ".s3" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".odt" => "application/vnd.oasis.opendocument.text",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar"
+ )
+# text/x-server-parsed-html
+#%Server ID Header
+server.tag = "lighttpd | TextDriven"
+#%### accesslog module
+accesslog.filename = "/home/[*username*]/var/lighttpd/log/access_log"
+#% deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+#%% Options that are good to be but not neccesary to be changed
+##% bind to port (default: 80)
+server.port = 81
+#server.port = 8111
+#server.port = 8965
+##% bind to localhost (default: all interfaces)
+server.bind = "localhost"
+#server.bind = "corundum"
+##server.bind = "grisu.home.kneschke.de"
+##% to help the rc.scripts
+server.pid-file = "/home/[*username*]/var/lighttpd/run/lighttpd.pid"
+#$HTTP["host"] =~ "\.corundum\.(name|com|net|org)" {
+$HTTP["host"] == "localhost" {
+ server.document-root = "/var/www/"
+ server.errorlog = "/home/[*username*]/var/lighttpd/log/lighttpd-error.log"
+ accesslog.filename = "/home/[*username*]/var/lighttpd/log/access_log"
+ url.rewrite-repeat = (
+ "^.*/$" => "index.html",
+ "^(.*/(landscape|portrait))$" => "$1.pdf",
+ "^(.*/(opendocument))$" => "$1.odt",
+ "^(.*/(sax|dom))$" => "$1.xml",
+ "^([^.]+)$" => "$1.html"
+ )
+ server.error-handler-404 = "/dispatch.fcgi"
+# fastcgi.server = ( ".fcgi" =>
+# ( "localhost" =>
+# (
+# "socket" => "/home/[*username*]/var/lighttpd/cgi/lighttpd-fcgi.socket",
+# "bin-path" => "/home/[*username*]/var/lighttpd/public/dispatch.fcgi",
+# "min-procs" => 1,
+# "max-procs" => 2,
+# "idle-timeout" => 60
+# )
+# )
+# )
+}
+#% change uid to <uid> (default: don't care)
+server.username = "[*username*]"
+#% change uid to <uid> (default: don't care)
+server.groupname = "[*username*]"
+#%## compress module
+compress.cache-dir = "/home/[*username*]/var/lighttpd/cache/compress/"
+compress.filetype = ("text/plain", "text/html")
diff --git a/data/sisu/conf/lighttpd/lighttpd.cfg.sisu_www b/data/sisu/conf/lighttpd/lighttpd.cfg.sisu_www
new file mode 100644
index 00000000..d23c12ce
--- /dev/null
+++ b/data/sisu/conf/lighttpd/lighttpd.cfg.sisu_www
@@ -0,0 +1,115 @@
+# lighttpd configuration file
+#
+# use a it as base for lighttpd 1.0.0 and above
+#
+#%% Options you really have to take care of
+#%
+# modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.dir-listing = "disable"
+server.modules = ( "mod_rewrite",
+ "mod_access",
+ "mod_fastcgi",
+ "mod_compress",
+ "mod_accesslog")
+#%% a static document-root, for virtual-hosting take look at the
+#% server.virtual-* options
+server.document-root = "/home/[user home]/sisu_www/"
+#server.document-root = "/home/*username*/web/public/"
+## 'Parent' domain on any server except davie.
+#server.document-root = "/home/*username*/public_html/"
+##'Parent' domain for those of you currently on davie.textdrive.com, and all future servers.
+#server.document-root = "/home/*username*/web/public/"
+#% where to send error-messages to
+server.errorlog = "/home/[*username*]/var/lighttpd/log/lighttpd.error.log"
+#% files to check for if .../ is requested
+server.indexfiles = ( "index.php", "index.html",
+ "index.htm", "index.rb")
+##% mimetype mapping
+##include "mime.types.conf"
+##include_shell "/usr/local/bin/confmimetype /etc/mime.types"
+#% mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".gz" => "application/x-gzip",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".zip" => "application/zip",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".s1" => "text/plain",
+ ".s2" => "text/plain",
+ ".s3" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".odt" => "application/vnd.oasis.opendocument.text",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar"
+ )
+# text/x-server-parsed-html
+#%Server ID Header
+server.tag = "lighttpd | TextDriven"
+#%### accesslog module
+accesslog.filename = "/home/[*username*]/var/lighttpd/log/access_log"
+#% deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+#%% Options that are good to be but not neccesary to be changed
+##% bind to port (default: 80)
+server.port = 8111
+#server.port = 8111
+#server.port = 8965
+##% bind to localhost (default: all interfaces)
+server.bind = "localhost"
+#server.bind = "corundum"
+##server.bind = "grisu.home.kneschke.de"
+##% to help the rc.scripts
+server.pid-file = "/home/[*username*]/var/lighttpd/run/lighttpd.pid"
+#$HTTP["host"] =~ "\.corundum\.(name|com|net|org)" {
+$HTTP["host"] == "localhost" {
+ server.document-root = "/home/[*username*]/sisu_www/"
+ server.errorlog = "/home/[*username*]/var/lighttpd/log/lighttpd-error.log"
+ accesslog.filename = "/home/[*username*]/var/lighttpd/log/access_log"
+ url.rewrite-repeat = (
+ "^.*/$" => "index.html",
+ "^(.*/(landscape|portrait))$" => "$1.pdf",
+ "^(.*/(opendocument))$" => "$1.odt",
+ "^(.*/(sax|dom))$" => "$1.xml",
+ "^([^.]+)$" => "$1.html"
+ )
+ server.error-handler-404 = "/dispatch.fcgi"
+# fastcgi.server = ( ".fcgi" =>
+# ( "localhost" =>
+# (
+# "socket" => "/home/[*username*]/var/lighttpd/cgi/lighttpd-fcgi.socket",
+# "bin-path" => "/home/[*username*]/var/lighttpd/public/dispatch.fcgi",
+# "min-procs" => 1,
+# "max-procs" => 2,
+# "idle-timeout" => 60
+# )
+# )
+# )
+}
+#% change uid to <uid> (default: don't care)
+server.username = "[*username*]"
+#% change uid to <uid> (default: don't care)
+server.groupname = "[*username*]"
+#%## compress module
+compress.cache-dir = "/home/[*username*]/var/lighttpd/cache/compress/"
+compress.filetype = ("text/plain", "text/html")
diff --git a/data/sisu/conf/ruby/irbrc b/data/sisu/conf/ruby/irbrc
new file mode 100644
index 00000000..b585faf6
--- /dev/null
+++ b/data/sisu/conf/ruby/irbrc
@@ -0,0 +1,19 @@
+require 'irb/completion'
+IRB.conf[:use_readline] = true
+IRB.conf[:PROMPT_MODE] = :XMP
+#IRB.conf[:PROMPT] =
+#simple-prompt
+def ri arg
+ puts `ri #{arg}`
+end
+def ri(*names)
+ system(%{ri #{names.map {|name| name.to_s}.join(" ")}})
+end
+#require 'rdoc/ri/ri_driver'
+#def ri(*names)
+# oargv = Object.const_get(:ARGV)
+# Object.const_set(:ARGV, names)
+# RiDriver.new.process_args
+# Object.const_set(:ARGV, oargv)
+#end
+
diff --git a/data/sisu/conf/syntax/README b/data/sisu/conf/syntax/README
new file mode 100644
index 00000000..04c0ea09
--- /dev/null
+++ b/data/sisu/conf/syntax/README
@@ -0,0 +1,92 @@
+This directory
+ sisu-examples/sisu-examples/config/syntax_hi/
+ /usr/share/sisu-examples/sisu-examples/config/syntax_hi
+contains rudimentary sisu syntax highlighting files for:
+
+* (g)vim http://www.vim.org
+ * package: sisu-vim
+ * status: largely done
+ * comments: not found here
+ a vim syntax highlighting and folds component of sisu exists,
+ see sisu-vim
+
+* 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/conf/syntax/diakonos.conf b/data/sisu/conf/syntax/diakonos.conf
new file mode 100644
index 00000000..212ed5b8
--- /dev/null
+++ b/data/sisu/conf/syntax/diakonos.conf
@@ -0,0 +1,979 @@
+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 3
+view.lookback 200
+view.nonfilelines.visible false
+view.nonfilelines.character ~
+
+# 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
+
+# Ensures saved files end with a newline character by adding it if necessary.
+eof_newline 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 100000
+
+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) -
+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 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
+# $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 end;cursorEOL
+key esc O F;cursorEOL
+key esc [ F;cursorEOL
+key esc [ 4 ~;cursorEOL
+key pageup;pageUp
+key pagedown;pageDown
+key ctrl+a;cursorBOL
+key ctrl+e;cursorEOL
+key alt+<;cursorBOF
+key alt+>;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 esc down;scrollDown
+key esc [ 1 ; 3 B scrollDown
+key esc [ 1 ; 5 B scrollDown
+key keycode513 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 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 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 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 keycode353 unindent
+#key tab;insertSpaces 4
+#key tab;insertTab
+key ctrl+t;insertTab
+
+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 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+space;anchorSelection
+#key ctrl+space;toggleSelection
+key ctrl+c;copySelection
+key ctrl+x;cutSelection
+key alt+u;removeSelection
+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 ctrl+alt+u;clearMatches
+
+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"
+#key esc F;shell "grep -n '$i' $F"
+#key esc F;execute "grep -n '$i' $F | less"
+key f14 evaluate
+key esc O 2 Q evaluate
+esc [ 2 6 ~ evaluate
+key ctrl+alt+c;shell "ruby -c $f"
+key ctrl+alt+d;shell "php -l $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 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 f7;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.
+# This colour command is only used when you want to 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.xml.filemask \.(xml|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 4
+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.tokens.template.open \[@--
+lang.xml.tokens.template.close --@\]
+lang.xml.tokens.template.format brown
+lang.xml.tokens.template.change_to perl
+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 4
+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.symbols ([@!#$%^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.xml_tag.tokens.symbols.format white
+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 4
+lang.xml_comment.indent.auto true
+lang.xml_comment.indent.roundup true
+#lang.xml_comment.indent.using_tabs true
+
+lang.html.filemask \.(r?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 4
+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.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_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.symbols ([@!#$%^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.html_tag.tokens.symbols.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):
+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.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
+
+# 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 [@!#$%^&*()\[\]{}/?=+\-\\|,<.>;:~]
+lang.ruby.tokens.symbols.format white
+lang.ruby.tokens.class_variables (@[A-Za-z_][A-Za-z_0-9]*)
+lang.ruby.tokens.class_variables.format white bold
+lang.ruby.tokens.comments (#.*)
+lang.ruby.tokens.comments.format 8 bold
+lang.ruby.tokens.regular_expressions (\/.+?[^\\]\/)
+lang.ruby.tokens.regular_expressions.format red bold
+lang.ruby.tokens.doublequoted_strings (\".*?[^\\]\"|\"\")
+lang.ruby.tokens.doublequoted_strings.format green bold
+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.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 4
+lang.ruby.indent.auto true
+lang.ruby.indent.roundup true
+#lang.ruby.indent.using_tabs true
+lang.ruby.indent.indenters \b(do|def|begin|ensure|when|case|else|for|while|elsif|if|class|module|rescue)\b|([{\[(]$|\{\s*\|[\w\s,]*\|\s*$)
+lang.ruby.indent.unindenters \b(end|else|when|rescue)\b|(^\s+[\]})])
+lang.ruby.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(`.+?[^\\]`)|(\/.+?[^\\]\/)|(^\s*#.*)|\S\s+if
+lang.ruby.indent.ignore ^\s*$
+lang.ruby.context.ignore ^=(begin|end)$
+
+# 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|else|this|echo|stdClass|die|switch|do|static|default|return|function|declare|require_once|foreach|continue|require|for|class|print|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.tokens.preprocessor (^\s*#.*)
+lang.php.tokens.preprocessor.format yellow bold
+lang.php.tokens.symbols ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.php.tokens.symbols.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.tokens.constants \b([A-Z_]+|[A-Z_][A-Z0-9_]+)\b
+lang.perl.tokens.constants.format yellow bold
+lang.perl.tokens.symbols [!#^&*()\[\]{}/?=+\-\\|,<.>;:~]
+lang.perl.tokens.symbols.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*\{?)$
+
+# 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.symbols [@!#$%^&*()\[\]{}/?=+\-\\|,<.>;:~]
+lang.python.tokens.symbols.format white
+lang.python.tokens.comments (#.*)
+lang.python.tokens.comments.format 8 bold
+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$
+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.tokens.symbols ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.java.tokens.symbols.format white
+lang.java.tokens.long_comments.open \/\*
+lang.java.tokens.long_comments.close \*\/
+lang.java.tokens.long_comments.format 8 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*\{?)$
+
+# 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.tokens.preprocessor (^\s*#.*)
+lang.c.tokens.preprocessor.format yellow bold
+lang.c.tokens.symbols ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.c.tokens.symbols.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.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.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.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.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.tokens.singlequoted_strings ('.*?[^\\]')
+lang.sql.tokens.singlequoted_strings.format green bold
+lang.sql.tokens.symbols ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.sql.tokens.symbols.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.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.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.symbols ([!@#$%\^&*()\[\]{}/?=+\-\\|,<.>;:])
+lang.tcl.tokens.symbols.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))$
+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.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*$
+
+#% 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 ^_[12]?\*\s+
+lang.sisu.tokens.bullet.format yellow
+lang.sisu.tokens.indent ^_[12]\s+
+lang.sisu.tokens.indent.format yellow
+lang.sisu.tokens.link \{.+?\}(?:http:\/\/\S+|image)
+lang.sisu.tokens.link.format yellow
+lang.sisu.tokens.url http:\/\/\S+
+lang.sisu.tokens.url.format blue bold
+lang.sisu.tokens.line_bold ^!_\s+.*
+lang.sisu.tokens.line_bold.format white bold
+lang.sisu.tokens.font_bold [!*]\{.+?\}[!*]
+lang.sisu.tokens.font_bold.format white bold
+lang.sisu.tokens.font_modify [/_+-^,]\{.+?\}[/_+-^,]
+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 <(?:\/\s*)?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.endnote.format green
+#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.error [a-zA-Z0-9,.::?!&]+http:\/\/\S+
+lang.sisu.tokens.error.format magenta
+
+# 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/cucumber.conf
diff --git a/data/sisu/conf/syntax/nanorc b/data/sisu/conf/syntax/nanorc
new file mode 100644
index 00000000..82183131
--- /dev/null
+++ b/data/sisu/conf/syntax/nanorc
@@ -0,0 +1,220 @@
+## 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 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/conf/syntax/sisu-mode.el b/data/sisu/conf/syntax/sisu-mode.el
new file mode 100644
index 00000000..3f56de1c
--- /dev/null
+++ b/data/sisu/conf/syntax/sisu-mode.el
@@ -0,0 +1,235 @@
+;;; sisu-mode.el.el --- Major mode for editing .sisu-files
+
+;;; It mainly defines a grammar for syntax highlighting.
+;;; SiSU http://www.jus.uio.no/sisu
+
+;;; Copyright 2005 Ralph Amissah
+
+;;; Author: Ralph Amissah <ralph.amissah@gmail.com>
+;;; Version: $Id$
+;;; Keywords: perl sisu
+
+;;; 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 2, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;;; This mode is built with help of the
+;;; "Emacs language mode creation tutorial" at
+;;; http://two-wugs.net/emacs/mode-tutorial.html
+;;;
+;;; Regexes are defined for the following font-lock-faces:
+;;;
+;;; font-lock-keyword-face
+;;; font-lock-type-face
+;;; font-lock-comment-face
+;;; font-lock-reference-face
+;;; font-lock-doc-string-face
+;;; font-lock-function-name-face
+;;;
+
+;;; Usage:
+
+;;; Put this file into your load-path and the following into your ~/.emacs:
+;;;
+;;; (require 'sisu-mode.el)
+;;;
+;;;
+;;; To associate sisu-mode.el with .s[tmi] files add the following to your ~/.emacs
+;;;
+;;; (setq auto-mode-alist
+;;; (append auto-mode-alist
+;;; '(("\\.ss[tmi]$" . sisu-mode.el))))
+;;;
+;;;
+;;; To automatically turn on font-lock-mode add the following to your ~/.emacs
+;;;
+;;; (add-hook 'sisu-mode.el-hook 'font-lock-mode)
+;;;
+;;; Code:
+
+;; ;; default variables
+;; (defvar sisu-mode.el-hook nil)
+;;
+;; (defvar sisu-mode-map
+;; (let ((sisu-mode-map (make-keymap)))
+;; (define-key wpdl-mode-map "\C-j" 'newline-and-indent)
+;; sisu-mode-map)
+;; "Keymap for SiSU major mode")
+;;
+;; (add-to-list 'auto-mode-alist '("\\.ss[tmi]\\'" . sisu-mode))
+
+(defvar sisu-mode-hook nil)
+
+(defvar sisu-mode-map
+ (let ((sisu-mode-map (make-keymap)))
+ (define-key sisu-mode-map "\C-j" 'newline-and-indent)
+ sisu-mode-map)
+ "Keymap for SiSU major mode")
+(add-to-list 'auto-mode-alist '("\\.ss[tmi]\\'" . sisu-mode))
+
+(defconst sisu-font-lock-keywords-1
+ (list
+ '("\\<\\(BOOK\\|CHAPTER\\).+" . font-lock-builtin-face)
+; '("\\<\\(BOOK\\|CHAPTER\\)\\>" . font-lock-builtin-face)
+ '("\\('\\w*'\\)" . font-lock-variable-name-face))
+ "Minimal highlighting expressions for SiSU mode")
+
+(defconst sisu-font-lock-keywords-2
+ (append sisu-font-lock-keywords-1
+ (list
+; header
+ '("^0~.+" . font-lock-keyword-face)
+; heading
+ '("^[1-6]~.+" . font-lock-keyword-face)
+; bullet
+ '("\\<\\(_\\*\\|_[12]\\|_\\*[12]\\) " . font-lock-constant-face)
+; font, bold italics etc.
+ '("^!_ .+" . font-lock-constant-face)
+ '("[/_+-^,]{.+?}[/_+-^,]" . font-lock-constant-face)
+ '("[!*]{.+?}[!*]" . font-lock-constant-face)
+; endnotes
+ '("~{.+?}~" . font-lock-constant-face)
+ '("~\\^(\s\\|$)" . font-lock-constant-face)
+ '("^\\^~\s.+" . font-lock-constant-face)
+; links
+ '("{.+?}http://[^ \n]+" . font-lock-constant-face)
+ '("http://[^ \n]+" . font-lock-constant-face)
+; breaks
+ '("<:\\(pb\\|np\\)>" . font-lock-constant-face)
+ '("<\\(\s*/\\)?br>" . font-lock-constant-face)
+; comments
+ '("[a-zA-Z0-9,.::?!&]+http://[^ \n]+" . font-lock-constant-face)
+ '("^%+ .+" . font-lock-constant-face)
+; errors
+ '("[a-zA-Z0-9,.::?!&]+http://[^ \n]+" . font-lock-constant-face)
+; not done
+; multiline matches !!
+; poem code group alt
+ '("^code{.+?}code" . font-lock-constant-face)
+; '("\\http://[a-zA-Z0-9]+" . font-lock-constant-face)
+; '("\\<\\(\\_\\*\\|\\_[12]\\|\\_\\*[12]\\) \\>" . font-lock-constant-face)
+; select more appropriate matches
+ ))
+ "Additional Keywords to highlight in SiSU mode")
+
+ (defconst sisu-font-lock-keywords-3
+ (append sisu-font-lock-keywords-2
+ (list
+; '("\\<\\(0~\\|[1-6]~\\|!_ \\)\\>" . font-lock-constant-face)
+ ))
+ "Balls-out highlighting in SiSU mode")
+
+(defvar sisu-font-lock-keywords sisu-font-lock-keywords-3
+ "Default highlighting expressions for SiSU mode")
+
+ (defvar sisu-mode-syntax-table
+ (let ((sisu-mode-syntax-table (make-syntax-table)))
+ (modify-syntax-entry ?_ "w" sisu-mode-syntax-table)
+; (modify-syntax-entry ?/ ". 124b" sisu-mode-syntax-table)
+ (modify-syntax-entry ?* ". 23" sisu-mode-syntax-table)
+ (modify-syntax-entry ?\n "> b" sisu-mode-syntax-table)
+ sisu-mode-syntax-table)
+ "Syntax table for sisu-mode")
+
+(defun sisu-mode ()
+ "Major mode for editing Workflow Process Description Language files"
+ (interactive)
+ (kill-all-local-variables)
+ (set-syntax-table sisu-mode-syntax-table)
+ (use-local-map sisu-mode-map)
+
+(set (make-local-variable 'font-lock-defaults) '(sisu-font-lock-keywords))
+(setq major-mode 'sisu-mode)
+(setq mode-name "SiSU")
+(run-hooks 'sisu-mode-hook))
+(provide 'sisu-mode.el)
+
+;; ;; keymap
+;; (defvar sisu-mode.el-map nil "Keymap for SiSU major mode.")
+;; (if sisu-mode.el-map nil
+;; (let ((map (make-sparse-keymap)))
+;; ;; insert (define-key map ...) stuff here
+;; (setq sisu-mode.el-map map)))
+;;
+;; syntax highlighting: standard keywords
+;; (defconst sisu-font-lock-keywords-1
+;; '(
+;; ("^\\(!_\\|_[12]\\|_*\\)" 0 font-lock-keyword-face)
+;; ("^_[12]\\(.*\\)$" 1 font-lock-type-face)
+;; ;; ("^[ \t]+\\(.*\\)$" 1 font-lock-type-face)
+;; )
+;; "Minimal highlighting expressions for SiSU mode.")
+;;
+;; ;; syntax highlighting: additional keywords
+;; (defconst sisu-font-lock-keywords-2
+;; (append sisu-font-lock-keywords-1
+;; '(
+;; ("%+ \\(.*\\)" 2 font-lock-comment-face)
+;; ))
+;; "Additional Keywords to highlight in SiSU mode.")
+;;
+;; ;; syntax highlighting: even more keywords
+;; (defconst sisu-font-lock-keywords-3
+;; (append sisu-font-lock-keywords-2
+;; '(
+;; ("^0~.+" 1 font-lock-reference-face)
+;; ("^[1-6]~.+" 2 font-lock-reference-face)
+;; ;; ("[IBSCF]<\\([^>]*\\)>" 1 font-lock-reference-face)
+;; ;; ("L<\\([^|>]*|\\)?\\([^>]+\\)>" 2 font-lock-reference-face)
+;; ("L<\\([^|>]*\\)|\\([^>]*\\)>" 1 font-lock-doc-string-face)
+;; ("E<\\([^>]*\\)>" 1 font-lock-function-name-face)
+;; ("\"\\([^\"]+\\)\"" 0 font-lock-string-face)
+;; ))
+;; "Balls-out highlighting in SiSU mode.")
+;;
+;; ;; default level of highlight to maximum
+;; (defvar sisu-font-lock-keywords sisu-font-lock-keywords-3
+;; "Default highlighting expressions for SiSU mode")
+;;
+;; ;; no special indenting, just pure text mode
+;; (defun sisu-indent-line ()
+;; "Indent current line as SiSU code. Does nothing yet."
+;; (interactive)
+;; )
+;;
+;; ;; no special syntax table
+;; (defvar sisu-mode.el-syntax-table nil
+;; "Syntax table for sisu-mode.el.")
+;;
+;; ;; create and activate syntax table
+;; (defun sisu-create-syntax-table ()
+;; (if sisu-mode.el-syntax-table
+;; ()
+;; (setq sisu-mode.el-syntax-table (make-syntax-table))
+;; (set-syntax-table sisu-mode.el-syntax-table)
+;; ))
+
+;; main
+; (defun sisu-mode.el ()
+; "Major mode for editing SiSU files."
+; (interactive)
+; (kill-all-local-variables)
+; (sisu-create-syntax-table)
+; (use-local-map sisu-mode.el-map)
+; (make-local-variable 'font-lock-defaults)
+; (setq font-lock-defaults '(sisu-font-lock-keywords 't))
+; ;; (make-local-variable 'indent-line-function)
+; ;; (setq indent-line-function 'sisu-indent-line)
+; (setq major-mode 'sisu-mode.el)
+; (setq mode-name "SiSU")
+; (run-hooks 'sisu-mode.el-hook))
+
+
+;;; sisu-mode.el ends here
diff --git a/data/sisu/conf/syntax/sisu.lang b/data/sisu/conf/syntax/sisu.lang
new file mode 100644
index 00000000..df126b23
--- /dev/null
+++ b/data/sisu/conf/syntax/sisu.lang
@@ -0,0 +1,90 @@
+<?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-Z0-9,.;:!?"'\/()-]+</regex>
+ </pattern-item>
+
+ <pattern-item _name="Operators" style="Function">
+ <regex>^(!_|_[12]|_[12]?\*)\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="FontFace 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>\{[^}]+\}(http:\/\/\S+|image)\s</regex>
+ </pattern-item>
+
+ <pattern-item _name="Url" style="String">
+ <regex>\bhttp:\/\/\S+</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;(\/\s*)?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/conf/syntax/sisu.xml b/data/sisu/conf/syntax/sisu.xml
new file mode 100644
index 00000000..d54483ac
--- /dev/null
+++ b/data/sisu/conf/syntax/sisu.xml
@@ -0,0 +1,157 @@
+<?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" >
+ <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-6]~.+$" 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"/>
+ <StringDetect String="&lt;br&gt;" attribute="Break" context="#pop" />
+ <RegExpr String="\{.+?\}(http:\/\/\S+|image)" attribute="Link" context="#stay"/>
+ <RegExpr String="(^|\s)http:\/\/\S+" attribute="Link" context="#stay"/>
+ <RegExpr String="^!_ .+" attribute="Bold" context="boldline"/>
+ <RegExpr String="^(_[12]|_\*|_[12]\*)\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="}~" />
+ <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" />
+ </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="#086800" 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"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
+ <comments>
+ <comment name="singleLine" start="%" />
+ </comments>
+ </general>
+</language>
diff --git a/data/sisu/conf/syntax/sisu_nedit.pats b/data/sisu/conf/syntax/sisu_nedit.pats
new file mode 100644
index 00000000..8e12cd5c
--- /dev/null
+++ b/data/sisu/conf/syntax/sisu_nedit.pats
@@ -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~":"$"::Keyword::\n\
+ bold_line:"^!_ ":"$"::Keyword::\n\
+ heading:"^[1-6]~":"$"::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:"^(_[12]|_\\*|_[12]\\*)":::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/conf/vim/addons/colors/slate.vim b/data/sisu/conf/vim/addons/colors/slate.vim
new file mode 100644
index 00000000..8350017e
--- /dev/null
+++ b/data/sisu/conf/vim/addons/colors/slate.vim
@@ -0,0 +1,55 @@
+"%% SiSU Vim color file
+" Slate Maintainer: Ralph Amissah <ralph@amissah.com>
+" (originally looked at desert Hans Fugal <hans@fugal.net> http://hans.fugal.net/vim/colors/desert.vim (April/May 2003)
+:set background=dark
+:highlight clear
+if version > 580
+ hi clear
+ if exists("syntax_on")
+ syntax reset
+ endif
+endif
+:hi Normal guifg=White guibg=grey15
+:hi Cursor guibg=khaki guifg=slategrey
+:hi VertSplit guibg=#c2bfa5 guifg=grey40 gui=none cterm=reverse
+:hi Folded guibg=black guifg=grey40 ctermfg=grey ctermbg=darkgrey
+:hi FoldColumn guibg=black guifg=grey20 ctermfg=4 ctermbg=7
+:hi IncSearch guifg=green guibg=black cterm=none ctermfg=yellow ctermbg=green
+:hi ModeMsg guifg=goldenrod cterm=none ctermfg=brown
+:hi MoreMsg guifg=SeaGreen ctermfg=darkgreen
+:hi NonText guifg=RoyalBlue guibg=grey15 cterm=bold ctermfg=blue
+:hi Question guifg=springgreen ctermfg=green
+:hi Search guibg=peru guifg=wheat cterm=none ctermfg=grey ctermbg=blue
+:hi SpecialKey guifg=yellowgreen ctermfg=darkgreen
+:hi StatusLine guibg=#c2bfa5 guifg=black gui=none cterm=bold,reverse
+:hi StatusLineNC guibg=#c2bfa5 guifg=grey40 gui=none cterm=reverse
+:hi Title guifg=gold gui=bold cterm=bold ctermfg=yellow
+:hi Statement guifg=CornflowerBlue ctermfg=lightblue
+:hi Visual gui=none guifg=khaki guibg=olivedrab cterm=reverse
+:hi WarningMsg guifg=salmon ctermfg=1
+:hi String guifg=SkyBlue ctermfg=darkcyan
+:hi Comment term=bold ctermfg=11 guifg=grey40
+:hi Constant guifg=#ffa0a0 ctermfg=brown
+:hi Special guifg=darkkhaki ctermfg=brown
+:hi Identifier guifg=salmon ctermfg=red
+:hi Include guifg=red ctermfg=red
+:hi PreProc guifg=red guibg=white ctermfg=red
+:hi Operator guifg=Red ctermfg=Red
+:hi Define guifg=gold gui=bold ctermfg=yellow
+:hi Type guifg=CornflowerBlue ctermfg=2
+:hi Function guifg=navajowhite ctermfg=brown
+:hi Structure guifg=green ctermfg=green
+:hi LineNr guifg=grey50 ctermfg=3
+:hi Ignore guifg=grey40 cterm=bold ctermfg=7
+:hi Todo guifg=orangered guibg=yellow2
+:hi Directory ctermfg=darkcyan
+:hi ErrorMsg cterm=bold guifg=White guibg=Red cterm=bold ctermfg=7 ctermbg=1
+:hi VisualNOS cterm=bold,underline
+:hi WildMenu ctermfg=0 ctermbg=3
+:hi DiffAdd ctermbg=4
+:hi DiffChange ctermbg=5
+:hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
+:hi DiffText cterm=bold ctermbg=1
+:hi Underlined cterm=underline ctermfg=5
+:hi Error guifg=White guibg=Red cterm=bold ctermfg=7 ctermbg=1
+:hi SpellErrors guifg=White guibg=Red cterm=bold ctermfg=7 ctermbg=1
diff --git a/data/sisu/conf/vim/addons/filetype.vim b/data/sisu/conf/vim/addons/filetype.vim
new file mode 100644
index 00000000..917c3e04
--- /dev/null
+++ b/data/sisu/conf/vim/addons/filetype.vim
@@ -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/conf/vim/addons/ftplugin/sisu.vim b/data/sisu/conf/vim/addons/ftplugin/sisu.vim
new file mode 100644
index 00000000..8526206c
--- /dev/null
+++ b/data/sisu/conf/vim/addons/ftplugin/sisu.vim
@@ -0,0 +1,177 @@
+"%% SiSU Vim ftplugin
+" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
+" SiSU Markup: SiSU (sisu-0.38)
+" an ftplugin setting defaults for editing sisu markup files
+:syntax on
+:filetype on
+:filetype indent on
+":let dialect='UK'
+:if version >= 700
+: setlocal spell spelllang=en_us
+:endif
+: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=agmr
+:set paste
+: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>dir :vs<cr><C-W><C-R> :Explore<cr>
+:map <leader>nn :set nonumber paste<cr>
+:map <leader>nu :set number paste<cr>
+:map <leader>no :set number nopaste<cr>
+"% vimdiff q exits
+: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 <C-S> :.,$s///c "search and replace down
+:map <c-G> :%s///c "search and replace whole file
+:map <c-X> :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 <C-F> :F<cr> "consider, is a remapping
+: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*[{>]
diff --git a/data/sisu/conf/vim/addons/syntax/sisu.vim b/data/sisu/conf/vim/addons/syntax/sisu.vim
new file mode 100644
index 00000000..13d22bb1
--- /dev/null
+++ b/data/sisu/conf/vim/addons/syntax/sisu.vim
@@ -0,0 +1,171 @@
+"%% SiSU Vim syntax file
+" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
+" SiSU Markup: SiSU (sisu-0.47.6)
+" (originally looked at Ruby Vim by Mirko Nasato)
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+else
+endif
+"% 11 Errors?
+syn match sisu_error contains=sisu_link,sisu_error_wspace "<![^ei]\S\+!>"
+"% 10 Markers: Endnote Identifiers, Pagebreaks etc.:
+if !exists("sisu_no_identifiers")
+ syn match sisu_mark_endnote "\~^"
+ syn match sisu_contain contains=@NoSpell "</\?sub>"
+ syn match sisu_break contains=@NoSpell "<br>\|<br />"
+ syn match sisu_control contains=@NoSpell "<p>\|</p>\|<p />\|<:p[bn]>"
+ syn match sisu_html "<center>\|</center>"
+ syn match sisu_marktail "[~-]#"
+ syn match sisu_html contains=@NoSpell "<td>\|<td \|<tr>\|</td>\|</tr>\|<table>\|<table \|</table>"
+ 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\+"
+ "metaverse specific
+ syn match sisu_ocn contains=@NoSpell "<\~\d\+;\w\d\+;\w\d\+>"
+ syn match sisu_marktail "<\~#>"
+ syn match sisu_markpara contains=@NoSpell "<:i[12]>"
+ syn match sisu_link " \*\~\S\+"
+ syn match sisu_action "^<:insert\d\+>"
+ syn match sisu_contain "<:e>"
+endif
+"% 9 URLs Numbers: and ASCII Codes
+syn match sisu_number "\<\(0x\x\+\|0b[01]\+\|0\o\+\|0\.\d\+\|0\|[1-9][\.0-9_]*\)\>"
+syn match sisu_number "?\(\\M-\\C-\|\\c\|\\C-\|\\M-\)\=\(\\\o\{3}\|\\x\x\{2}\|\\\=\w\)"
+"% 8 Tuned Error - is error if not already matched
+syn match sisu_error contains=sisu_error "[\~/\*!_]{\|}[\~/\*!_]"
+syn match sisu_error contains=sisu_error "<a href\|</a>]"
+"% 7 Simple Enclosed Markup:
+" Simple Markup:
+"% url/link
+syn region sisu_link contains=sisu_error,sisu_error_wspace matchgroup=sisu_action start="^<<\s*|[a-zA-Z0-9^._-]\+|@|[a-zA-Z0-9^._-]\+|"rs=s+2 end="$"
+"% header
+syn region sisu_header_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break matchgroup=sisu_header start="^0\~\(\S\+\|[^-]\)" end="$"
+syn region sisu_header_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break matchgroup=sisu_header start="^0\~\(tags\?\|date\)\s\+"rs=e-1 end="\n$"
+syn region sisu_header_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break matchgroup=sisu_header start="^@\S\+:[+-]\?\s"rs=e-1 end="$"
+syn region sisu_header_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break matchgroup=sisu_header start="^@\(tags\?\|date\):\s\+"rs=e-1 end="\n$"
+"% headings
+syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$"
+"% grouped text
+syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table"
+syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n\n"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(alt\|group\|poem\){" end="^}\(alt\|group\|poem\)"
+syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code"
+"% endnotes
+syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\~{[*+]*" end="}\~" skip="\n"
+syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\~\[[*+]*" end="\]\~" skip="\n"
+syn region sisu_content_endnote contains=sisu_strikeout,sisu_number,sisu_control,sisu_link,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\^\~" end="\n\n"
+"% links and images
+syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="}\(https\?:/\/\|\.\./\)\S\+" oneline
+syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="\[[1-5][sS]*\]}\S\+\.ss[tm]" oneline
+syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{" end="}image" oneline
+"% some line operations
+syn region sisu_control contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_error,sisu_error_wspace matchgroup=sisu_control start="\(\(^\| \)!_ \|<:b>\)" end="$"
+syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([12*]\|[12]\*\) " end="$"
+syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^\(#[ 1]\|_# \)" end="$"
+syn region sisu_comment matchgroup=sisu_comment start="^%\{1,2\} " end="$"
+"% font face curly brackets
+syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*"
+syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="!{" end="}!"
+syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="_{" end="}_"
+syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="/{" end="}/"
+syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="+{" end="}+"
+syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\^{" end="}\^"
+syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start=",{" end="},"
+syn region sisu_strikeout contains=sisu_error matchgroup=sisu_fontface start="-{" end="}-"
+syn region sisu_html contains=sisu_error contains=sisu_strikeout matchgroup=sisu_contain start="<a href=\".\{-}\">" end="</a>" oneline
+"% single words bold italicise etc. "workon
+syn region sisu_control contains=sisu_error matchgroup=sisu_control start="\([ (]\|^\)\*[^\|{\n\~\\]"hs=e-1 end="\*"he=e-0 skip="[a-zA-Z0-9']" oneline
+syn region sisu_identifier contains=sisu_error matchgroup=sisu_content_alt start="\([ ]\|^\)/[^{ \|\n\\]"hs=e-1 end="/\[ \.\]" skip="[a-zA-Z0-9']" oneline
+"% misc
+syn region sisu_identifier contains=sisu_error matchgroup=sisu_fontface start="\^[^ {\|\n\\]"rs=s+1 end="\^[ ,.;:'})\\\n]" skip="[a-zA-Z0-9']" oneline
+"% metaverse html (flagged as errors for filetype sisu)
+syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_mark matchgroup=sisu_html start="<b>" end="</b>" skip="\n" oneline
+syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_mark matchgroup=sisu_html start="<em>" end="</em>" skip="\n" oneline
+syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_mark matchgroup=sisu_html start="<i>" end="</i>" skip="\n" oneline
+syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_mark matchgroup=sisu_html start="<u>" end="</u>" skip="\n" oneline
+syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_mark matchgroup=sisu_html start="<ins>" end="</ins>" skip="\\\\\|\\'" oneline
+syn region sisu_identifier contains=sisu_error matchgroup=sisu_html start="<del>" end="</del>" oneline
+"% metaverse <:>
+syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="<:Table.\{-}>" end="<:Table[-_]end>"
+syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="<:code>" end="<:code[-_]end>"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="<:alt>" end="<:alt[-_]end>"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="<:poem>" end="<:poem[-_]end>"
+"% 6 Expensive Mode
+" Expensive Mode:
+if !exists("sisu_no_expensive")
+else " not Expensive
+ syn region sisu_content_alt matchgroup=sisu_control start="^\s*def\s" matchgroup=NONE end="[?!]\|\>" skip="\.\|\(::\)" oneline
+endif " Expensive?
+"% 5 Headers: and Headings (Document Instructions)
+syn match sisu_control contains=sisu_error,sisu_error_wspace "4\~! \S\+"
+syn region sisu_markpara contains=sisu_error,sisu_error_wspace start="^=begin" end="^=end.*$"
+"% 4 Errors?
+syn match sisu_error_wspace contains=sisu_error_wspace "^\s\+"
+syn match sisu_error_wspace contains=sisu_error_wspace "\s\s\+"
+syn match sisu_error_wspace contains=sisu_error_wspace " \s*$"
+syn match sisu_error contains=sisu_error,sisu_error_wspace "[^ (}]https\?:\S\+"
+syn match sisu_error contains=sisu_error_wspace "\t\+"
+syn match sisu_error contains=sisu_error "https\?:\S\+[}><]"
+syn match sisu_error contains=sisu_error "\([!*/_\+,^]\){\([^(\}\1)]\)\{-}\n\n"
+syn match sisu_error contains=sisu_error "^[\~]{[^{]\{-}\n\n"
+syn match sisu_error contains=sisu_error "\s\+.{{"
+syn match sisu_error contains=sisu_error "^\~\s*$"
+syn match sisu_error contains=sisu_error "^[0-9]\~\s*$"
+syn match sisu_error contains=sisu_error "^[0-9]\~\S\+\s*$"
+syn match sisu_error contains=sisu_error "[^{]\~\^[^ \)]"
+syn match sisu_error contains=sisu_error "\~\^\s\+\.\s*"
+syn match sisu_error contains=sisu_error "{\~^\S\+"
+syn match sisu_error contains=sisu_error "[_/\*!^]{[ .,:;?><]*}[_/\*!^]"
+syn match sisu_error contains=sisu_error "[^ (\"'(\[][_/\*!]{\|}[_/\*!][a-zA-Z0-9)\]\"']"
+syn match sisu_error contains=sisu_error "<dir>"
+"errors for filetype sisu, though not error in 'metaverse':
+syn match sisu_error contains=sisu_error,sisu_match,sisu_strikeout,sisu_contain,sisu_content_alt,sisu_mark,sisu_break,sisu_number "<[a-zA-Z\/]\+>"
+syn match sisu_error "/\?<\([biu]\)>[^(</\1>)]\{-}\n\n"
+"% 3 Error Exceptions?
+syn match sisu_control "\n\n" "contains=ALL
+syn match sisu_control " //"
+syn match sisu_error "%{"
+syn match sisu_error "<br>https\?:\S\+\|https\?:\S\+<br>"
+syn match sisu_error "[><]https\?:\S\+\|https\?:\S\+[><]"
+"% 2 Definitions - Define the default highlighting.
+if version >= 508 || !exists("did_sisu_syntax_inits")
+ if version < 508
+ let did_sisu_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+"% 1 Defined
+ HiLink sisu_normal Normal
+ HiLink sisu_header PreProc
+ HiLink sisu_header_content Statement
+ HiLink sisu_heading Title
+ HiLink sisu_structure Operator
+ HiLink sisu_contain Include
+ HiLink sisu_mark_endnote Include
+ HiLink sisu_link NonText
+ HiLink sisu_linked String
+ HiLink sisu_fontface Include
+ HiLink sisu_strikeout DiffDelete
+ HiLink sisu_content_alt Special
+ HiLink sisu_content_endnote Special
+ HiLink sisu_control Define
+ HiLink sisu_ocn Include
+ HiLink sisu_number Number
+ HiLink sisu_identifier Function
+ HiLink sisu_underline Underlined
+ HiLink sisu_markpara Include
+ HiLink sisu_marktail Include
+ HiLink sisu_mark Identifier
+ HiLink sisu_break Structure
+ HiLink sisu_html Type
+ HiLink sisu_action Identifier
+ HiLink sisu_comment Comment
+ HiLink sisu_error_wspace Error
+ HiLink sisu_error Error
+ delcommand HiLink
+endif
+let b:current_syntax = "sisu"
diff --git a/data/sisu/image/DebTuxRubySiSU.png b/data/sisu/image/DebTuxRubySiSU.png
new file mode 100644
index 00000000..06109cd9
--- /dev/null
+++ b/data/sisu/image/DebTuxRubySiSU.png
Binary files differ
diff --git a/data/sisu/image/arrow_next_blue.png b/data/sisu/image/arrow_next_blue.png
new file mode 100644
index 00000000..64e126bd
--- /dev/null
+++ b/data/sisu/image/arrow_next_blue.png
Binary files differ
diff --git a/data/sisu/image/arrow_next_red.png b/data/sisu/image/arrow_next_red.png
new file mode 100644
index 00000000..436a086d
--- /dev/null
+++ b/data/sisu/image/arrow_next_red.png
Binary files differ
diff --git a/data/sisu/image/arrow_prev_blue.png b/data/sisu/image/arrow_prev_blue.png
new file mode 100644
index 00000000..3e8f12fe
--- /dev/null
+++ b/data/sisu/image/arrow_prev_blue.png
Binary files differ
diff --git a/data/sisu/image/arrow_prev_red.png b/data/sisu/image/arrow_prev_red.png
new file mode 100644
index 00000000..2dac0ba7
--- /dev/null
+++ b/data/sisu/image/arrow_prev_red.png
Binary files differ
diff --git a/data/sisu/image/arrow_up_blue.png b/data/sisu/image/arrow_up_blue.png
new file mode 100644
index 00000000..2db1ce62
--- /dev/null
+++ b/data/sisu/image/arrow_up_blue.png
Binary files differ
diff --git a/data/sisu/image/arrow_up_red.png b/data/sisu/image/arrow_up_red.png
new file mode 100644
index 00000000..dc803f0a
--- /dev/null
+++ b/data/sisu/image/arrow_up_red.png
Binary files differ
diff --git a/data/sisu/image/b_bluebell.png b/data/sisu/image/b_bluebell.png
new file mode 100644
index 00000000..19be72b5
--- /dev/null
+++ b/data/sisu/image/b_bluebell.png
Binary files differ
diff --git a/data/sisu/image/b_doc.png b/data/sisu/image/b_doc.png
new file mode 100644
index 00000000..13ca8ebe
--- /dev/null
+++ b/data/sisu/image/b_doc.png
Binary files differ
diff --git a/data/sisu/image/b_home.png b/data/sisu/image/b_home.png
new file mode 100644
index 00000000..19be72b5
--- /dev/null
+++ b/data/sisu/image/b_home.png
Binary files differ
diff --git a/data/sisu/image/b_odf.png b/data/sisu/image/b_odf.png
new file mode 100644
index 00000000..6cac938f
--- /dev/null
+++ b/data/sisu/image/b_odf.png
Binary files differ
diff --git a/data/sisu/image/b_pdf.png b/data/sisu/image/b_pdf.png
new file mode 100644
index 00000000..c5982246
--- /dev/null
+++ b/data/sisu/image/b_pdf.png
Binary files differ
diff --git a/data/sisu/image/b_toc.png b/data/sisu/image/b_toc.png
new file mode 100644
index 00000000..3f9194d4
--- /dev/null
+++ b/data/sisu/image/b_toc.png
Binary files differ
diff --git a/data/sisu/image/bluebell.png b/data/sisu/image/bluebell.png
new file mode 100644
index 00000000..99c572d4
--- /dev/null
+++ b/data/sisu/image/bluebell.png
Binary files differ
diff --git a/data/sisu/image/bullet_doc.png b/data/sisu/image/bullet_doc.png
new file mode 100644
index 00000000..6b883d6b
--- /dev/null
+++ b/data/sisu/image/bullet_doc.png
Binary files differ
diff --git a/data/sisu/image/bullet_red.png b/data/sisu/image/bullet_red.png
new file mode 100644
index 00000000..c94b8687
--- /dev/null
+++ b/data/sisu/image/bullet_red.png
Binary files differ
diff --git a/data/sisu/image/c_Copyleft.png b/data/sisu/image/c_Copyleft.png
new file mode 100644
index 00000000..5b3865b8
--- /dev/null
+++ b/data/sisu/image/c_Copyleft.png
Binary files differ
diff --git a/data/sisu/image/c_Euro.png b/data/sisu/image/c_Euro.png
new file mode 100644
index 00000000..8e5c13a9
--- /dev/null
+++ b/data/sisu/image/c_Euro.png
Binary files differ
diff --git a/data/sisu/image/dot_clear.png b/data/sisu/image/dot_clear.png
new file mode 100644
index 00000000..72593400
--- /dev/null
+++ b/data/sisu/image/dot_clear.png
Binary files differ
diff --git a/data/sisu/image/dot_white.png b/data/sisu/image/dot_white.png
new file mode 100644
index 00000000..3d718d14
--- /dev/null
+++ b/data/sisu/image/dot_white.png
Binary files differ
diff --git a/data/sisu/image/next.png b/data/sisu/image/next.png
new file mode 100644
index 00000000..088ff0fb
--- /dev/null
+++ b/data/sisu/image/next.png
Binary files differ
diff --git a/data/sisu/image/previous.png b/data/sisu/image/previous.png
new file mode 100644
index 00000000..ea21f26a
--- /dev/null
+++ b/data/sisu/image/previous.png
Binary files differ
diff --git a/data/sisu/image/rb7.ico b/data/sisu/image/rb7.ico
new file mode 100644
index 00000000..08d810bc
--- /dev/null
+++ b/data/sisu/image/rb7.ico
Binary files differ
diff --git a/data/sisu/image/sisu.png b/data/sisu/image/sisu.png
new file mode 100644
index 00000000..b449fa6b
--- /dev/null
+++ b/data/sisu/image/sisu.png
Binary files differ
diff --git a/data/sisu/image/toctoc.png b/data/sisu/image/toctoc.png
new file mode 100644
index 00000000..a15a06cd
--- /dev/null
+++ b/data/sisu/image/toctoc.png
Binary files differ
diff --git a/data/sisu/odf/odt.zip b/data/sisu/odf/odt.zip
new file mode 100644
index 00000000..8f855535
--- /dev/null
+++ b/data/sisu/odf/odt.zip
Binary files differ
diff --git a/install b/install
new file mode 100644
index 00000000..5858a748
--- /dev/null
+++ b/install
@@ -0,0 +1,3088 @@
+#!/usr/bin/env ruby
+
+# install - Monolithic rant script, autogenerated by rant-import 0.5.8.
+#
+# Copyright (C) 2005 Stefan Lang <langstefan@gmx.at>
+#
+# This program is free software.
+# You can distribute/modify this program under the terms of
+# the GNU LGPL, Lesser General Public License version 2.1.
+
+
+require 'getoptlong'
+
+
+require 'rbconfig'
+
+unless Process::Status.method_defined?(:success?) # new in 1.8.2
+ class Process::Status
+ def success?; exitstatus == 0; end
+ end
+end
+unless Regexp.respond_to? :union # new in 1.8.1
+ def Regexp.union(*patterns)
+ return /(?!)/ if patterns.empty?
+ Regexp.new(patterns.join("|"))
+ end
+end
+if RUBY_VERSION < "1.8.2"
+ class Array
+ undef_method :flatten, :flatten!
+ def flatten
+ cp = self.dup
+ cp.flatten!
+ cp
+ end
+ def flatten!
+ res = []
+ flattened = false
+ self.each { |e|
+ if e.respond_to? :to_ary
+ res.concat(e.to_ary)
+ flattened = true
+ else
+ res << e
+ end
+ }
+ if flattened
+ replace(res)
+ flatten!
+ self
+ end
+ end
+ end
+end
+
+class String
+ def _rant_sub_ext(ext, new_ext = nil)
+ if new_ext
+ self.sub(/#{Regexp.escape ext}$/, new_ext)
+ else
+ self.sub(/(\.[^.]*$)|$/, ".#{ext}")
+ end
+ end
+end
+
+module Rant
+ VERSION = '0.5.8'
+
+ @__rant_no_value__ = Object.new.freeze
+ def self.__rant_no_value__
+ @__rant_no_value__
+ end
+
+ module Env
+ OS = ::Config::CONFIG['target']
+ RUBY = ::Config::CONFIG['ruby_install_name']
+ RUBY_BINDIR = ::Config::CONFIG['bindir']
+ RUBY_EXE = File.join(RUBY_BINDIR, RUBY + ::Config::CONFIG["EXEEXT"])
+
+ @@zip_bin = false
+ @@tar_bin = false
+
+ if OS =~ /mswin/i
+ def on_windows?; true; end
+ else
+ def on_windows?; false; end
+ end
+
+ def have_zip?
+ if @@zip_bin == false
+ @@zip_bin = find_bin "zip"
+ end
+ !@@zip_bin.nil?
+ end
+ def have_tar?
+ if @@tar_bin == false
+ @@tar_bin = find_bin "tar"
+ end
+ !@@tar_bin.nil?
+ end
+ def pathes
+ path = ENV[on_windows? ? "Path" : "PATH"]
+ return [] unless path
+ path.split(on_windows? ? ";" : ":")
+ end
+ def find_bin bin_name
+ if on_windows?
+ bin_name_exe = nil
+ if bin_name !~ /\.[^\.]{1,3}$/i
+ bin_name_exe = bin_name + ".exe"
+ end
+ pathes.each { |dir|
+ file = File.join(dir, bin_name)
+ return file if test(?f, file)
+ if bin_name_exe
+ file = File.join(dir, bin_name_exe)
+ return file if test(?f, file)
+ end
+ }
+ else
+ pathes.each { |dir|
+ file = File.join(dir, bin_name)
+ return file if test(?x, file)
+ }
+ end
+ nil
+ end
+ def shell_path path
+ if on_windows?
+ path = path.tr("/", "\\")
+ if path.include? ' '
+ '"' + path + '"'
+ else
+ path
+ end
+ else
+ if path.include? ' '
+ "'" + path + "'"
+ else
+ path
+ end
+ end
+ end
+ extend self
+ end # module Env
+
+ module Sys
+ def sp(arg)
+ if arg.respond_to? :to_ary
+ arg.to_ary.map{ |e| sp e }.join(' ')
+ else
+ _escaped_path arg
+ end
+ end
+ def escape(arg)
+ if arg.respond_to? :to_ary
+ arg.to_ary.map{ |e| escape e }.join(' ')
+ else
+ _escaped arg
+ end
+ end
+ if Env.on_windows?
+ def _escaped_path(path)
+ _escaped(path.to_s.tr("/", "\\"))
+ end
+ def _escaped(arg)
+ sarg = arg.to_s
+ return sarg unless sarg.include?(" ")
+ sarg << "\\" if sarg[-1].chr == "\\"
+ "\"#{sarg}\""
+ end
+ def regular_filename(fn)
+ fn.to_str.tr("\\", "/").gsub(%r{/{2,}}, "/")
+ end
+ else
+ def _escaped_path(path)
+ path.to_s.gsub(/(?=\s)/, "\\")
+ end
+ alias _escaped _escaped_path
+ def regular_filename(fn)
+ fn.to_str.gsub(%r{/{2,}}, "/")
+ end
+ end
+ private :_escaped_path
+ private :_escaped
+ def split_all(path)
+ names = regular_filename(path).split(%r{/})
+ names[0] = "/" if names[0] && names[0].empty?
+ names
+ end
+ extend self
+ end # module Sys
+
+
+ ROOT_RANTFILE = "root.rant"
+ SUB_RANTFILE = "sub.rant"
+ RANTFILES = [ "Rantfile", "rantfile", ROOT_RANTFILE ]
+
+ CODE_IMPORTS = []
+
+ class RantAbortException < StandardError
+ end
+
+ class RantDoneException < StandardError
+ end
+
+ class Error < StandardError
+ end
+
+ module Generators
+ end
+
+ module RantVar
+
+ class Error < Rant::Error
+ end
+
+ class ConstraintError < Error
+
+ attr_reader :constraint, :val
+
+ def initialize(constraint, val, msg = nil)
+ @msg = msg
+ @constraint = constraint
+ @val = val
+ end
+
+ def message
+ val_desc = @val.inspect
+ val_desc[7..-1] = "..." if val_desc.length > 10
+ "#{val_desc} doesn't match constraint: #@constraint"
+ end
+ end
+
+ class NotAConstraintFactoryError < Error
+ attr_reader :obj
+ def initialize(obj, msg = nil)
+ @msg = msg
+ @obj = obj
+ end
+ def message
+ obj_desc = @obj.inspect
+ obj_desc[7..-1] = "..." if obj_desc.length > 10
+ "#{obj_desc} is not a valid constraint factory"
+ end
+ end
+
+ class InvalidVidError < Error
+ def initialize(vid, msg = nil)
+ @msg = msg
+ @vid = vid
+ end
+ def message
+ vid_desc = @vid.inspect
+ vid_desc[7..-1] = "..." if vid_desc.length > 10
+ "#{vid_desc} is not a valid var identifier"
+ end
+ end
+
+ class InvalidConstraintError < Error
+ end
+
+ class QueryError < Error
+ end
+
+ class Space
+
+ @@env_ref = Object.new
+
+ def initialize
+ @store = {}
+ @constraints = {}
+ end
+
+ def query(*args, &block)
+ case args.size
+ when 0
+ raise QueryError, "no arguments", caller
+ when 1
+ arg = args.first
+ if Hash === arg
+ if arg.size == 1
+ arg.each { |k,v|
+ self[k] = v if self[k].nil?
+ }
+ self
+ else
+ init_all arg
+ end
+ else
+ self[arg]
+ end
+ when 2, 3
+ vid, cf, val = *args
+ constrain vid,
+ get_factory(cf).rant_constraint
+ self[vid] = val if val
+ else
+ raise QueryError, "too many arguments"
+ end
+ end
+
+ def restrict vid, ct, *ct_args
+ if vid.respond_to? :to_ary
+ vid.to_ary.each { |v| restrict(v, ct, *ct_args) }
+ else
+ constrain vid,
+ get_factory(ct).rant_constraint(*ct_args)
+ end
+ self
+ end
+
+ def get_factory id
+ if String === id || Symbol === id
+ id = Constraints.const_get(id) rescue nil
+ end
+ unless id.respond_to? :rant_constraint
+ raise NotAConstraintFactoryError.new(id), caller
+ end
+ id
+ end
+ private :get_factory
+
+ def [](vid)
+ vid = RantVar.valid_vid vid
+ val = @store[vid]
+ val.equal?(@@env_ref) ? ENV[vid] : val
+ end
+
+ def []=(vid, val)
+ vid = RantVar.valid_vid(vid)
+ c = @constraints[vid]
+ if @store[vid] == @@env_ref
+ ENV[vid] = c ? c.filter(val) : val
+ else
+ @store[vid] = c ? c.filter(val) : val
+ end
+ end
+
+ def env(*vars)
+ vars.flatten.each { |var|
+ vid = RantVar.valid_vid(var)
+ cur_val = @store[vid]
+ next if cur_val == @@env_ref
+ ENV[vid] = cur_val unless cur_val.nil?
+ @store[vid] = @@env_ref
+ }
+ nil
+ end
+
+ def set_all hash
+ unless Hash === hash
+ raise QueryError,
+ "set_all argument has to be a hash"
+ end
+ hash.each_pair { |k, v|
+ self[k] = v
+ }
+ end
+
+ def init_all hash
+ unless Hash === hash
+ raise QueryError,
+ "init_all argument has to be a hash"
+ end
+ hash.each_pair { |k, v|
+ self[k] = v if self[k].nil?
+ }
+ end
+
+ def constrain vid, constraint
+ vid = RantVar.valid_vid(vid)
+ unless RantVar.valid_constraint? constraint
+ raise InvalidConstraintError, constraint
+ end
+ @constraints[vid] = constraint
+ if @store.member? vid
+ begin
+ val = @store[vid]
+ @store[vid] = constraint.filter(@store[vid])
+ rescue
+ @store[vid] = constraint.default
+ raise ConstraintError.new(constraint, val)
+ end
+ else
+ @store[vid] = constraint.default
+ end
+ end
+
+ def has_var?(vid)
+ !self[vid].nil?
+ end
+
+ def _set(vid, val) #:nodoc:
+ @store[vid] = val
+ end
+
+ def _get(vid) #:nodoc:
+ @store[vid]
+ end
+
+ def _init(vid, val) #:nodoc:
+ @store[vid] ||= val
+ end
+
+ end # class Space
+
+ module Constraint
+ def matches? val
+ filter val
+ true
+ rescue
+ return false
+ end
+ end
+
+ def valid_vid(obj)
+ case obj
+ when String: obj
+ when Symbol: obj.to_s
+ else
+ if obj.respond_to? :to_str
+ obj.to_str
+ else
+ raise InvalidVidError.new(obj)
+ end
+ end
+ end
+
+ def valid_constraint?(obj)
+ obj.respond_to?(:filter) &&
+ obj.respond_to?(:matches?) &&
+ obj.respond_to?(:default)
+ end
+
+ module_function :valid_constraint?, :valid_vid
+
+ module Constraints
+ class AutoList
+ include Constraint
+ class << self
+ alias rant_constraint new
+ end
+ def filter(val)
+ if val.respond_to? :to_ary
+ val.to_ary
+ elsif val.nil?
+ raise ConstraintError.new(self, val)
+ else
+ [val]
+ end
+ end
+ def default
+ []
+ end
+ def to_s
+ "list or single, non-nil value"
+ end
+ end
+ end # module Constraints
+ end # module RantVar
+end # module Rant
+
+
+require 'fileutils'
+
+
+module Rant
+ def FileList(arg)
+ if arg.respond_to?(:to_rant_filelist)
+ arg.to_rant_filelist
+ elsif arg.respond_to?(:to_ary)
+ FileList.new(arg.to_ary)
+ else
+ raise TypeError,
+ "cannot convert #{arg.class} into Rant::FileList"
+ end
+ end
+ module_function :FileList
+ class FileList
+ include Enumerable
+
+ ESC_SEPARATOR = Regexp.escape(File::SEPARATOR)
+ ESC_ALT_SEPARATOR = File::ALT_SEPARATOR ?
+ Regexp.escape(File::ALT_SEPARATOR) : nil
+
+ class << self
+ def [](*patterns)
+ new.hide_dotfiles.include(*patterns)
+ end
+ def glob(*patterns)
+ fl = new.hide_dotfiles.ignore(".", "..").include(*patterns)
+ if block_given? then yield fl else fl end
+ end
+ def glob_all(*patterns)
+ fl = new.ignore(".", "..").include(*patterns)
+ if block_given? then yield fl else fl end
+ end
+ end
+
+ def initialize(store = [])
+ @pending = false
+ @def_glob_dotfiles = true
+ @items = store
+ @ignore_rx = nil
+ @keep = {}
+ @actions = []
+ end
+ alias _object_dup dup
+ private :_object_dup
+ def dup
+ c = _object_dup
+ c.items = @items.dup
+ c.actions = @actions.dup
+ c.ignore_rx = @ignore_rx.dup if @ignore_rx
+ c.instance_variable_set(:@keep, @keep.dup)
+ c
+ end
+ def copy
+ c = _object_dup
+ c.items = @items.map { |entry| entry.dup }
+ c.actions = @actions.dup
+ c.ignore_rx = @ignore_rx.dup if @ignore_rx
+ h_keep = {}
+ @keep.each_key { |entry| h_keep[entry] = true }
+ c.instance_variable_set(:@keep, h_keep)
+ c
+ end
+ def glob_dotfiles?
+ @def_glob_dotfiles
+ end
+ def glob_dotfiles=(flag)
+ @def_glob_dotfiles = flag ? true : false
+ end
+ def hide_dotfiles
+ @def_glob_dotfiles = false
+ self
+ end
+ def glob_dotfiles
+ @def_glob_dotfiles = true
+ self
+ end
+
+ protected
+ attr_accessor :actions, :items
+ attr_accessor :pending
+ attr_accessor :ignore_rx
+
+ public
+ def each(&block)
+ resolve if @pending
+ @items.each(&block)
+ self
+ end
+ def to_ary
+ resolve if @pending
+ @items
+ end
+ alias to_a to_ary
+ alias entries to_ary # entries: defined in Enumerable
+ def to_rant_filelist
+ self
+ end
+ def +(other)
+ if other.respond_to? :to_rant_filelist
+ c = other.to_rant_filelist.dup
+ c.actions.concat(@actions)
+ c.items.concat(@items)
+ c.pending = !c.actions.empty?
+ c
+ elsif other.respond_to? :to_ary
+ c = dup
+ c.actions <<
+ [:apply_ary_method_1, :concat, other.to_ary.dup]
+ c.pending = true
+ c
+ else
+ raise TypeError,
+ "cannot add #{other.class} to Rant::FileList"
+ end
+ end
+ def <<(file)
+ @actions << [:apply_ary_method_1, :push, file]
+ @keep[file] = true
+ @pending = true
+ self
+ end
+ def keep(entry)
+ @keep[entry] = true
+ @items << entry
+ self
+ end
+ def concat(ary)
+ if @pending
+ ary = ary.to_ary.dup
+ @actions << [:apply_ary_method_1, :concat, ary]
+ else
+ ix = ignore_rx and ary = ary.to_ary.reject { |f| f =~ ix }
+ @items.concat(ary)
+ end
+ self
+ end
+ def size
+ resolve if @pending
+ @items.size
+ end
+ alias length size
+ def empty?
+ resolve if @pending
+ @items.empty?
+ end
+ def join(sep = ' ')
+ resolve if @pending
+ @items.join(sep)
+ end
+ def pop
+ resolve if @pending
+ @items.pop
+ end
+ def push(entry)
+ resolve if @pending
+ @items.push(entry) if entry !~ ignore_rx
+ self
+ end
+ def shift
+ resolve if @pending
+ @items.shift
+ end
+ def unshift(entry)
+ resolve if @pending
+ @items.unshift(entry) if entry !~ ignore_rx
+ self
+ end
+if Object.method_defined?(:fcall) || Object.method_defined?(:funcall) # in Ruby 1.9 like __send__
+ @@__send_private__ = Object.method_defined?(:fcall) ? :fcall : :funcall
+ def resolve
+ @pending = false
+ @actions.each{ |action| self.__send__(@@__send_private__, *action) }.clear
+ ix = ignore_rx
+ if ix
+ @items.reject! { |f| f =~ ix && !@keep[f] }
+ end
+ self
+ end
+else
+ def resolve
+ @pending = false
+ @actions.each{ |action| self.__send__(*action) }.clear
+ ix = ignore_rx
+ if ix
+ @items.reject! { |f| f =~ ix && !@keep[f] }
+ end
+ self
+ end
+end
+ def include(*pats)
+ @def_glob_dotfiles ? glob_all(*pats) : glob_unix(*pats)
+ end
+ alias glob include
+ def glob_unix(*patterns)
+ patterns.flatten.each { |pat|
+ @actions << [:apply_glob_unix, pat]
+ }
+ @pending = true
+ self
+ end
+ def glob_all(*patterns)
+ patterns.flatten.each { |pat|
+ @actions << [:apply_glob_all, pat]
+ }
+ @pending = true
+ self
+ end
+ if RUBY_VERSION < "1.8.2"
+ FN_DOTFILE_RX_ = ESC_ALT_SEPARATOR ?
+ /(^|(#{ESC_SEPARATOR}|#{ESC_ALT_SEPARATOR})+)\..*
+ ((#{ESC_SEPARATOR}|#{ESC_ALT_SEPARATOR})+|$)/x :
+ /(^|#{ESC_SEPARATOR}+)\..* (#{ESC_SEPARATOR}+|$)/x
+ def apply_glob_unix(pattern)
+ inc_files = Dir.glob(pattern)
+ unless pattern =~ /(^|\/)\./
+ inc_files.reject! { |fn| fn =~ FN_DOTFILE_RX_ }
+ end
+ @items.concat(inc_files)
+ end
+ else
+ def apply_glob_unix(pattern)
+ @items.concat(Dir.glob(pattern))
+ end
+ end
+ private :apply_glob_unix
+ def apply_glob_all(pattern)
+ @items.concat(Dir.glob(pattern, File::FNM_DOTMATCH))
+ end
+ private :apply_glob_all
+ def exclude(*patterns)
+ patterns.each { |pat|
+ if Regexp === pat
+ @actions << [:apply_exclude_rx, pat]
+ else
+ @actions << [:apply_exclude, pat]
+ end
+ }
+ @pending = true
+ self
+ end
+ def ignore(*patterns)
+ patterns.each { |pat|
+ add_ignore_rx(Regexp === pat ? pat : mk_all_rx(pat))
+ }
+ @pending = true
+ self
+ end
+ def add_ignore_rx(rx)
+ @ignore_rx =
+ if @ignore_rx
+ Regexp.union(@ignore_rx, rx)
+ else
+ rx
+ end
+ end
+ private :add_ignore_rx
+ def apply_exclude(pattern)
+ @items.reject! { |elem|
+ File.fnmatch?(pattern, elem, File::FNM_DOTMATCH) && !@keep[elem]
+ }
+ end
+ private :apply_exclude
+ def apply_exclude_rx(rx)
+ @items.reject! { |elem|
+ elem =~ rx && !@keep[elem]
+ }
+ end
+ private :apply_exclude_rx
+ def exclude_name(*names)
+ names.each { |name|
+ @actions << [:apply_exclude_rx, mk_all_rx(name)]
+ }
+ @pending = true
+ self
+ end
+ alias shun exclude_name
+ if File::ALT_SEPARATOR
+ def mk_all_rx(file)
+ /(^|(#{ESC_SEPARATOR}|#{ESC_ALT_SEPARATOR})+)#{Regexp.escape(file)}
+ ((#{ESC_SEPARATOR}|#{ESC_ALT_SEPARATOR})+|$)/x
+ end
+ else
+ def mk_all_rx(file)
+ /(^|#{ESC_SEPARATOR}+)#{Regexp.escape(file)}
+ (#{ESC_SEPARATOR}+|$)/x
+ end
+ end
+ private :mk_all_rx
+ def exclude_path(*patterns)
+ patterns.each { |pat|
+ @actions << [:apply_exclude_path, pat]
+ }
+ @pending = true
+ self
+ end
+ def apply_exclude_path(pattern)
+ flags = File::FNM_DOTMATCH|File::FNM_PATHNAME
+ @items.reject! { |elem|
+ File.fnmatch?(pattern, elem, flags) && !@keep[elem]
+ }
+ end
+ private :apply_exclude
+ def select(&block)
+ d = dup
+ d.actions << [:apply_select, block]
+ d.pending = true
+ d
+ end
+ alias find_all select
+ def apply_select blk
+ @items = @items.select(&blk)
+ end
+ private :apply_select
+ def map(&block)
+ d = dup
+ d.actions << [:apply_ary_method, :map!, block]
+ d.pending = true
+ d
+ end
+ alias collect map
+ def sub_ext(ext, new_ext=nil)
+ map { |f| f._rant_sub_ext ext, new_ext }
+ end
+ def ext(ext_str)
+ sub_ext(ext_str)
+ end
+ def arglist
+ Rant::Sys.sp to_ary
+ end
+ alias to_s arglist
+ alias object_inspect inspect
+ def uniq!
+ @actions << [:apply_ary_method, :uniq!]
+ @pending = true
+ self
+ end
+ def sort!
+ @actions << [:apply_ary_method, :sort!]
+ @pending = true
+ self
+ end
+ def map!(&block)
+ @actions << [:apply_ary_method, :map!, block]
+ @pending = true
+ self
+ end
+ def reject!(&block)
+ @actions << [:apply_ary_method, :reject!, block]
+ @pending = true
+ self
+ end
+ private
+ def apply_ary_method(meth, block=nil)
+ @items.send meth, &block
+ end
+ def apply_ary_method_1(meth, arg1, block=nil)
+ @items.send meth, arg1, &block
+ end
+ end # class FileList
+end # module Rant
+
+if RUBY_VERSION == "1.8.3"
+ module FileUtils
+ METHODS = singleton_methods - %w(private_module_function
+ commands options have_option? options_of collect_method)
+ module Verbose
+ class << self
+ public(*::FileUtils::METHODS)
+ end
+ public(*::FileUtils::METHODS)
+ end
+ end
+end
+
+if RUBY_VERSION < "1.8.1"
+ module FileUtils
+ undef_method :fu_list
+ def fu_list(arg)
+ arg.respond_to?(:to_ary) ? arg.to_ary : [arg]
+ end
+ end
+end
+
+module Rant
+ class RacFileList < FileList
+
+ attr_reader :subdir
+ attr_reader :basedir
+
+ def initialize(rac, store = [])
+ super(store)
+ @rac = rac
+ @subdir = @rac.current_subdir
+ @basedir = Dir.pwd
+ @ignore_hash = nil
+ @add_ignore_args = []
+ update_ignore_rx
+ end
+ def dup
+ c = super
+ c.instance_variable_set(
+ :@add_ignore_args, @add_ignore_args.dup)
+ c
+ end
+ def copy
+ c = super
+ c.instance_variable_set(
+ :@add_ignore_args, @add_ignore_args.map { |e| e.dup })
+ c
+ end
+ alias filelist_ignore ignore
+ def ignore(*patterns)
+ @add_ignore_args.concat patterns
+ self
+ end
+ def ignore_rx
+ update_ignore_rx
+ @ignore_rx
+ end
+ alias filelist_resolve resolve
+ def resolve
+ Sys.cd(@basedir) { filelist_resolve }
+ end
+ def each_cd(&block)
+ old_pwd = Dir.pwd
+ Sys.cd(@basedir)
+ filelist_resolve if @pending
+ @items.each(&block)
+ ensure
+ Sys.cd(old_pwd)
+ end
+ private
+ def update_ignore_rx
+ ri = @rac.var[:ignore]
+ ri = ri ? (ri + @add_ignore_args) : @add_ignore_args
+ rh = ri.hash
+ unless rh == @ignore_hash
+ @ignore_rx = nil
+ filelist_ignore(*ri)
+ @ignore_hash = rh
+ end
+ end
+ end # class RacFileList
+
+ class MultiFileList
+
+ attr_reader :cur_list
+
+ def initialize(rac)
+ @rac = rac
+ @cur_list = RacFileList.new(@rac)
+ @lists = [@cur_list]
+ end
+
+ def each_entry(&block)
+ @lists.each { |list|
+ list.each_cd(&block)
+ }
+ end
+
+ def add(filelist)
+ @cur_list = filelist
+ @lists << filelist
+ self
+ end
+
+ def method_missing(sym, *args, &block)
+ if @cur_list && @cur_list.respond_to?(sym)
+ if @cur_list.subdir == @rac.current_subdir
+ @cur_list.send(sym, *args, &block)
+ else
+ add(RacFileList.new(@rac))
+ @cur_list.send(sym, *args, &block)
+ end
+ else
+ super
+ end
+ end
+ end # class MultiFileList
+
+ class CommandError < StandardError
+ attr_reader :cmd
+ attr_reader :status
+ def initialize(cmd, status=nil, msg=nil)
+ @msg = msg
+ @cmd = cmd
+ @status = status
+ end
+ def message
+ if !@msg && cmd
+ if status
+ "Command failed with status #{status.exitstatus}:\n" +
+ "[#{cmd}]"
+ else
+ "Command failed:\n[#{cmd}]"
+ end
+ else
+ @msg
+ end
+ end
+ end
+
+ module Sys
+ include ::FileUtils::Verbose
+
+ @symlink_supported = true
+ class << self
+ attr_accessor :symlink_supported
+ end
+
+ def fu_output_message(msg) #:nodoc:
+ end
+ private :fu_output_message
+
+ def fu_each_src_dest(src, *rest)
+ src = src.to_ary if src.respond_to? :to_ary
+ super(src, *rest)
+ end
+ private :fu_each_src_dest
+
+ def sh(*cmd_args, &block)
+ cmd_args.flatten!
+ cmd = cmd_args.join(" ")
+ fu_output_message cmd
+ success = system(*cmd_args)
+ if block_given?
+ block[$?]
+ elsif !success
+ raise CommandError.new(cmd, $?)
+ end
+ end
+
+ def ruby(*args, &block)
+ if args.empty?
+ sh(Env::RUBY_EXE, '', &block)
+ else
+ sh(args.unshift(Env::RUBY_EXE), &block)
+ end
+ end
+ def cd(dir, &block)
+ fu_output_message "cd #{dir}"
+ orig_pwd = Dir.pwd
+ Dir.chdir dir
+ if block
+ begin
+ block.arity == 0 ? block.call : block.call(Dir.pwd)
+ ensure
+ fu_output_message "cd -"
+ Dir.chdir orig_pwd
+ end
+ else
+ self
+ end
+ end
+
+ def safe_ln(src, dest)
+ dest = dest.to_str
+ src = src.respond_to?(:to_ary) ? src.to_ary : src.to_str
+ unless Sys.symlink_supported
+ cp(src, dest)
+ else
+ begin
+ ln(src, dest)
+ rescue Exception # SystemCallError # Errno::EOPNOTSUPP
+ Sys.symlink_supported = false
+ cp(src, dest)
+ end
+ end
+ end
+
+ def ln_f(src, dest)
+ ln(src, dest, :force => true)
+ end
+
+ def split_path(str)
+ str.split(Env.on_windows? ? ";" : ":")
+ end
+
+ if Env.on_windows?
+ def root_dir?(path)
+ path == "/" || path == "\\" ||
+ path =~ %r{\A[a-zA-Z]+:(\\|/)\Z}
+ end
+ def absolute_path?(path)
+ path =~ %r{\A([a-zA-Z]+:)?(/|\\)}
+ end
+ else
+ def root_dir?(path)
+ path == "/"
+ end
+ def absolute_path?(path)
+ path =~ %r{\A/}
+ end
+ end
+
+ extend self
+
+ if RUBY_VERSION >= "1.8.4" # needed by 1.9.0, too
+ class << self
+ public(*::FileUtils::METHODS)
+ end
+ public(*::FileUtils::METHODS)
+ end
+
+ end # module Sys
+
+ class SysObject
+ include Sys
+ def initialize(rant)
+ @rant = rant or
+ raise ArgumentError, "rant application required"
+ end
+ def ignore(*patterns)
+ @rant.var[:ignore].concat(patterns)
+ nil
+ end
+ def filelist(arg = Rant.__rant_no_value__)
+ if Rant.__rant_no_value__.equal?(arg)
+ RacFileList.new(@rant)
+ elsif arg.respond_to?(:to_rant_filelist)
+ arg.to_rant_filelist
+ elsif arg.respond_to?(:to_ary)
+ RacFileList.new(@rant, arg.to_ary)
+ else
+ raise TypeError,
+ "cannot convert #{arg.class} into Rant::FileList"
+ end
+ end
+ def [](*patterns)
+ RacFileList.new(@rant).hide_dotfiles.include(*patterns)
+ end
+ def glob(*patterns, &block)
+ fl = RacFileList.new(@rant).hide_dotfiles.include(*patterns)
+ fl.ignore(".", "..")
+ if block_given? then yield fl else fl end
+ end
+ def glob_all(*patterns, &block)
+ fl = RacFileList.new(@rant).include(*patterns)
+ fl.ignore(".", "..") # use case: "*.*" as pattern
+ if block_given? then yield fl else fl end
+ end
+ def expand_path(path)
+ File.expand_path(@rant.project_to_fs_path(path))
+ end
+ private
+ def fu_output_message(cmd)
+ @rant.cmd_msg cmd
+ end
+ end
+
+
+ class TaskFail < StandardError
+ def initialize(task, orig, msg)
+ @task = task
+ @orig = orig
+ @msg = msg
+ end
+ def exception
+ self
+ end
+ def task
+ @task
+ end
+ def tname
+ @task ? @task.name : nil
+ end
+ def orig
+ @orig
+ end
+ def msg
+ @msg
+ end
+ end
+
+ class Rantfile
+ attr_reader :tasks, :path
+ attr_accessor :project_subdir
+ def initialize(path)
+ @path = path or raise ArgumentError, "path required"
+ @tasks = []
+ @project_subdir = nil
+ end
+ alias to_s path
+ alias to_str path
+ end # class Rantfile
+
+ module Node
+
+ INVOKE_OPT = {}.freeze
+
+ T0 = Time.at(0).freeze
+
+ attr_reader :name
+ attr_reader :rac
+ attr_accessor :description
+ attr_accessor :rantfile
+ attr_accessor :line_number
+ attr_accessor :project_subdir
+
+ def initialize
+ @description = nil
+ @rantfile = nil
+ @line_number = nil
+ @run = false
+ @project_subdir = ""
+ @success = nil
+ end
+
+ def reference_name
+ sd = rac.current_subdir
+ case sd
+ when "": full_name
+ when project_subdir: name
+ else "@#{full_name}".sub(/^@#{Regexp.escape sd}\//, '')
+ end
+ end
+
+ alias to_s reference_name
+ alias to_rant_target name
+
+ def full_name
+ sd = project_subdir
+ sd.empty? ? name : File.join(sd, name)
+ end
+
+ def ch
+ {:file => rantfile.to_str, :ln => line_number}
+ end
+
+ def goto_task_home
+ @rac.goto_project_dir project_subdir
+ end
+
+ def file_target?
+ false
+ end
+
+ def done?
+ @success
+ end
+
+ def needed?
+ invoke(:needed? => true)
+ end
+
+ def run?
+ @run
+ end
+
+ def invoke(opt = INVOKE_OPT)
+ return circular_dep if run?
+ @run = true
+ begin
+ return !done? if opt[:needed?]
+ self.run if !done?
+ @success = true
+ ensure
+ @run = false
+ end
+ end
+
+ def fail msg = nil, orig = nil
+ raise TaskFail.new(self, orig, msg)
+ end
+
+ def each_target
+ end
+
+ def has_actions?
+ defined? @block and @block
+ end
+
+ def dry_run
+ text = "Executing #{name.dump}"
+ text << " [NOOP]" unless has_actions?
+ @rac.cmd_msg text
+ action_descs.each { |ad|
+ @rac.cmd_print " - "
+ @rac.cmd_msg ad.sub(/\n$/, '').gsub(/\n/, "\n ")
+ }
+ end
+
+ private
+ def run
+ goto_task_home
+ return if @rac.running_task(self)
+ return unless has_actions?
+ @receiver.pre_run(self) if defined? @receiver and @receiver
+ @block.arity == 0 ? @block.call : @block[self] if @block
+ end
+
+ def action_descs
+ descs = []
+ if defined? @receiver and @receiver
+ descs.concat(@receiver.pre_action_descs)
+ end
+ @block ? descs << action_block_desc : descs
+ end
+
+ def action_block_desc
+ @block.inspect =~ /^#<Proc:[\da-z]+@(.+):(\d+)>$/i
+ fn, ln = $1, $2
+ "Ruby Proc at #{fn.sub(/^#{Regexp.escape @rac.rootdir}\//, '')}:#{ln}"
+ end
+
+ def circular_dep
+ rac.warn_msg "Circular dependency on task `#{full_name}'."
+ false
+ end
+ end # module Node
+
+
+ def self.init_import_nodes__default(rac, *rest)
+ rac.node_factory = DefaultNodeFactory.new
+ end
+
+ class DefaultNodeFactory
+ def new_task(rac, name, pre, blk)
+ Task.new(rac, name, pre, &blk)
+ end
+ def new_file(rac, name, pre, blk)
+ FileTask.new(rac, name, pre, &blk)
+ end
+ def new_dir(rac, name, pre, blk)
+ DirTask.new(rac, name, pre, &blk)
+ end
+ def new_source(rac, name, pre, blk)
+ SourceNode.new(rac, name, pre, &blk)
+ end
+ def new_custom(rac, name, pre, blk)
+ UserTask.new(rac, name, pre, &blk)
+ end
+ def new_auto_subfile(rac, name, pre, blk)
+ AutoSubFileTask.new(rac, name, pre, &blk)
+ end
+ end
+
+ class Task
+ include Node
+
+ attr_accessor :receiver
+
+ def initialize(rac, name, prerequisites = [], &block)
+ super()
+ @rac = rac or raise ArgumentError, "rac not given"
+ @name = name or raise ArgumentError, "name not given"
+ @pre = prerequisites || []
+ @pre_resolved = false
+ @block = block
+ @run = false
+ @receiver = nil
+ end
+
+ def prerequisites
+ @pre.collect { |pre| pre.to_s }
+ end
+ alias deps prerequisites
+
+ def source
+ @pre.first.to_s
+ end
+
+ def has_actions?
+ @block or @receiver && @receiver.has_pre_action?
+ end
+
+ def <<(pre)
+ @pre_resolved = false
+ @pre << pre
+ end
+
+ def invoked?
+ !@success.nil?
+ end
+
+ def fail?
+ @success == false
+ end
+
+ def enhance(deps = nil, &blk)
+ if deps
+ @pre_resolved = false
+ @pre.concat deps
+ end
+ if @block
+ if blk
+ first_block = @block
+ @block = lambda { |t|
+ first_block[t]
+ blk[t]
+ }
+ end
+ else
+ @block = blk
+ end
+ end
+
+ def invoke(opt = INVOKE_OPT)
+ return circular_dep if @run
+ @run = true
+ begin
+ return if done?
+ internal_invoke opt
+ ensure
+ @run = false
+ end
+ end
+
+ def internal_invoke(opt, ud_init = true)
+ goto_task_home
+ update = ud_init || opt[:force]
+ dep = nil
+ uf = false
+ each_dep { |dep|
+ if dep.respond_to? :timestamp
+ handle_timestamped(dep, opt) && update = true
+ elsif Node === dep
+ handle_node(dep, opt) && update = true
+ else
+ dep, uf = handle_non_node(dep, opt)
+ uf && update = true
+ dep
+ end
+ }
+ if @receiver
+ goto_task_home
+ update = true if @receiver.update?(self)
+ end
+ return update if opt[:needed?]
+ run if update
+ @success = true
+ update
+ rescue StandardError => e
+ @success = false
+ self.fail(nil, e)
+ end
+ private :internal_invoke
+
+ def handle_node(dep, opt)
+ dep.invoke opt
+ end
+
+ def handle_timestamped(dep, opt)
+ dep.invoke opt
+ end
+
+ def handle_non_node(dep, opt)
+ @rac.err_msg "Unknown task `#{dep}',",
+ "referenced in `#{rantfile.path}', line #{@line_number}!"
+ self.fail
+ end
+
+ def each_dep
+ t = nil
+ if @pre_resolved
+ return @pre.each { |t| yield(t) }
+ end
+ my_full_name = full_name
+ my_project_subdir = project_subdir
+ @pre.map! { |t|
+ if Node === t
+ if t.full_name == my_full_name
+ nil
+ else
+ yield(t)
+ t
+ end
+ else
+ t = t.to_s if Symbol === t
+ if t == my_full_name #TODO
+ nil
+ else
+ selection = @rac.resolve t,
+ my_project_subdir
+ if selection.empty?
+ yield(t)
+ else
+ selection.each { |st| yield(st) }
+ selection
+ end
+ end
+ end
+ }
+ if @pre.kind_of? Rant::FileList
+ @pre.resolve
+ else
+ @pre.flatten!
+ @pre.compact!
+ end
+ @pre_resolved = true
+ end
+ end # class Task
+
+ class UserTask < Task
+
+ def initialize(*args)
+ super
+ @block = nil
+ @needed = nil
+ @target_files = nil
+ yield self if block_given?
+ end
+
+ def act(&block)
+ @block = block
+ end
+
+ def needed(&block)
+ @needed = block
+ end
+
+ def file_target?
+ @target_files and @target_files.include? @name
+ end
+
+ def each_target(&block)
+ goto_task_home
+ @target_files.each(&block) if @target_files
+ end
+
+ def file_target(*args)
+ args.flatten!
+ args << @name if args.empty?
+ if @target_files
+ @target_files.concat(args)
+ else
+ @target_files = args
+ end
+ end
+
+ def invoke(opt = INVOKE_OPT)
+ return circular_dep if @run
+ @run = true
+ begin
+ return if done?
+ internal_invoke(opt, ud_init_by_needed)
+ ensure
+ @run = false
+ end
+ end
+
+ private
+ def ud_init_by_needed
+ if @needed
+ goto_task_home
+ @needed.arity == 0 ? @needed.call : @needed[self]
+ end
+ end
+ end # class UserTask
+
+ class FileTask < Task
+
+ def initialize(*args)
+ super
+ @ts = T0
+ end
+
+ def file_target?
+ true
+ end
+
+ def invoke(opt = INVOKE_OPT)
+ return circular_dep if @run
+ @run = true
+ begin
+ return if done?
+ goto_task_home
+ if File.exist? @name
+ @ts = File.mtime @name
+ internal_invoke opt, false
+ else
+ @ts = T0
+ internal_invoke opt, true
+ end
+ ensure
+ @run = false
+ end
+ end
+
+ def timestamp(opt = INVOKE_OPT)
+ File.exist?(@name) ? File.mtime(@name) : T0
+ end
+
+ def handle_node(dep, opt)
+ return true if dep.file_target? && dep.invoke(opt)
+ if File.exist? dep.name
+ File.mtime(dep.name) > @ts
+ elsif !dep.file_target?
+ @rac.err_msg @rac.pos_text(rantfile.path, line_number),
+ "in prerequisites: no such file: `#{dep.full_name}'"
+ self.fail
+ end
+ end
+
+ def handle_timestamped(dep, opt)
+ return true if dep.invoke opt
+ dep.timestamp(opt) > @ts
+ end
+
+ def handle_non_node(dep, opt)
+ goto_task_home # !!??
+ unless File.exist? dep
+ @rac.err_msg @rac.pos_text(rantfile.path, line_number),
+ "in prerequisites: no such file or task: `#{dep}'"
+ self.fail
+ end
+ [dep, File.mtime(dep) > @ts]
+ end
+
+ def each_target
+ goto_task_home
+ yield name
+ end
+ end # class FileTask
+
+ module AutoInvokeDirNode
+ private
+ def run
+ goto_task_home
+ return if @rac.running_task(self)
+ dir = File.dirname(name)
+ @rac.build dir unless dir == "." || dir == "/"
+ return unless @block
+ @block.arity == 0 ? @block.call : @block[self]
+ end
+ end
+
+ class AutoSubFileTask < FileTask
+ include AutoInvokeDirNode
+ end
+
+ class DirTask < Task
+
+ def initialize(*args)
+ super
+ @ts = T0
+ @isdir = nil
+ end
+
+ def invoke(opt = INVOKE_OPT)
+ return circular_dep if @run
+ @run = true
+ begin
+ return if done?
+ goto_task_home
+ @isdir = test(?d, @name)
+ if @isdir
+ @ts = @block ? test(?M, @name) : Time.now
+ internal_invoke opt, false
+ else
+ @ts = T0
+ internal_invoke opt, true
+ end
+ ensure
+ @run = false
+ end
+ end
+
+ def file_target?
+ true
+ end
+
+ def handle_node(dep, opt)
+ return true if dep.file_target? && dep.invoke(opt)
+ if File.exist? dep.name
+ File.mtime(dep.name) > @ts
+ elsif !dep.file_target?
+ @rac.err_msg @rac.pos_text(rantfile.path, line_number),
+ "in prerequisites: no such file: `#{dep.full_name}'"
+ self.fail
+ end
+ end
+
+ def handle_timestamped(dep, opt)
+ return @block if dep.invoke opt
+ @block && dep.timestamp(opt) > @ts
+ end
+
+ def handle_non_node(dep, opt)
+ goto_task_home
+ unless File.exist? dep
+ @rac.err_msg @rac.pos_text(rantfile.path, line_number),
+ "in prerequisites: no such file or task: `#{dep}'"
+ self.fail
+ end
+ [dep, @block && File.mtime(dep) > @ts]
+ end
+
+ def run
+ return if @rac.running_task(self)
+ @rac.sys.mkdir @name unless @isdir
+ if @block
+ @block.arity == 0 ? @block.call : @block[self]
+ goto_task_home
+ @rac.sys.touch @name
+ end
+ end
+
+ def each_target
+ goto_task_home
+ yield name
+ end
+ end # class DirTask
+
+ class SourceNode
+ include Node
+ def initialize(rac, name, prerequisites = [])
+ super()
+ @rac = rac
+ @name = name or raise ArgumentError, "name not given"
+ @pre = prerequisites
+ @run = false
+ @ts = nil
+ end
+ def prerequisites
+ @pre
+ end
+ def timestamp(opt = INVOKE_OPT)
+ return @ts if @ts
+ goto_task_home
+ if File.exist?(@name)
+ @ts = File.mtime @name
+ else
+ rac.abort_at(ch, "SourceNode: no such file -- #@name")
+ end
+ sd = project_subdir
+ @pre.each { |f|
+ nodes = rac.resolve f, sd
+ if nodes.empty?
+ if File.exist? f
+ mtime = File.mtime f
+ @ts = mtime if mtime > @ts
+ else
+ rac.abort_at(ch,
+ "SourceNode: no such file -- #{f}")
+ end
+ else
+ nodes.each { |node|
+ node.invoke(opt)
+ if node.respond_to? :timestamp
+ node_ts = node.timestamp(opt)
+ goto_task_home
+ @ts = node_ts if node_ts > @ts
+ else
+ rac.abort_at(ch,
+ "SourceNode can't depend on #{node.name}")
+ end
+ }
+ end
+ }
+ @ts
+ end
+ def invoke(opt = INVOKE_OPT)
+ false
+ end
+ def related_sources
+ @pre
+ end
+ end # class SourceNode
+
+ module Generators
+ class Task
+ def self.rant_gen(rac, ch, args, &block)
+ unless args.size == 1
+ rac.abort("Task takes only one argument " +
+ "which has to be like one given to the " +
+ "`task' function")
+ end
+ rac.prepare_task(args.first, nil, ch) { |name,pre,blk|
+ rac.node_factory.new_custom(rac, name, pre, block)
+ }
+ end
+ end
+ class Directory
+ def self.rant_gen(rac, ch, args, &block)
+ case args.size
+ when 1
+ name, pre = rac.normalize_task_arg(args.first, ch)
+ self.task(rac, ch, name, pre, &block)
+ when 2
+ basedir = args.shift
+ if basedir.respond_to? :to_str
+ basedir = basedir.to_str
+ else
+ rac.abort_at(ch,
+ "Directory: basedir argument has to be a string.")
+ end
+ name, pre = rac.normalize_task_arg(args.first, ch)
+ self.task(rac, ch, name, pre, basedir, &block)
+ else
+ rac.abort_at(ch, "Directory takes one argument, " +
+ "which should be like one given to the `task' command.")
+ end
+ end
+
+ def self.task(rac, ch, name, prerequisites=[], basedir=nil, &block)
+ dirs = ::Rant::Sys.split_all(name)
+ if dirs.empty?
+ rac.abort_at(ch,
+ "Not a valid directory name: `#{name}'")
+ end
+ path = basedir
+ last_task = nil
+ task_block = nil
+ desc_for_last = rac.pop_desc
+ dirs.each { |dir|
+ pre = [path]
+ pre.compact!
+ if dir.equal?(dirs.last)
+ rac.cx.desc desc_for_last
+
+ dp = prerequisites.dup
+ pre.each { |elem| dp << elem }
+ pre = dp
+
+ task_block = block
+ end
+ path = path.nil? ? dir : File.join(path, dir)
+ last_task = rac.prepare_task({:__caller__ => ch,
+ path => pre}, task_block) { |name,pre,blk|
+ rac.node_factory.new_dir(rac, name, pre, blk)
+ }
+ }
+ last_task
+ end
+ end # class Directory
+ class SourceNode
+ def self.rant_gen(rac, ch, args)
+ unless args.size == 1
+ rac.abort_at(ch, "SourceNode takes one argument.")
+ end
+ if block_given?
+ rac.abort_at(ch, "SourceNode doesn't take a block.")
+ end
+ rac.prepare_task(args.first, nil, ch) { |name, pre, blk|
+ rac.node_factory.new_source(rac, name, pre, blk)
+ }
+ end
+ end
+ class Rule
+ def self.rant_gen(rac, ch, args, &block)
+ unless args.size == 1
+ rac.abort_at(ch, "Rule takes only one argument.")
+ end
+ rac.abort_at(ch, "Rule: block required.") unless block
+ arg = args.first
+ target = nil
+ src_arg = nil
+ if Symbol === arg
+ target = ".#{arg}"
+ elsif arg.respond_to? :to_str
+ target = arg.to_str
+ elsif Regexp === arg
+ target = arg
+ elsif Hash === arg && arg.size == 1
+ arg.each_pair { |target, src_arg| }
+ src_arg = src_arg.to_str if src_arg.respond_to? :to_str
+ target = target.to_str if target.respond_to? :to_str
+ src_arg = ".#{src_arg}" if Symbol === src_arg
+ target = ".#{target}" if Symbol === target
+ else
+ rac.abort_at(ch, "Rule argument " +
+ "has to be a hash with one key-value pair.")
+ end
+ esc_target = nil
+ target_rx = case target
+ when String
+ esc_target = Regexp.escape(target)
+ /#{esc_target}$/
+ when Regexp
+ target
+ else
+ rac.abort_at(ch, "rule target has " +
+ "to be a string or regular expression")
+ end
+ src_proc = case src_arg
+ when String, Array
+ unless String === target
+ rac.abort(ch, "rule target has to be " +
+ "a string if source is a string")
+ end
+ if src_arg.kind_of? String
+ lambda { |name|
+ name.sub(/#{esc_target}$/, src_arg)
+ }
+ else
+ lambda { |name|
+ src_arg.collect { |s_src|
+ s_src = ".#{s_src}" if Symbol === s_src
+ name.sub(/#{esc_target}$/, s_src)
+ }
+ }
+ end
+ when Proc: src_arg
+ when nil: lambda { |name| [] }
+ else
+ rac.abort_at(ch, "rule source has to be a " +
+ "String, Array or Proc")
+ end
+ rac.resolve_hooks <<
+ (block.arity == 2 ? Hook : FileHook).new(
+ rac, ch, target_rx, src_proc, block)
+ nil
+ end
+ class Hook
+ attr_accessor :target_rx
+ def initialize(rant, ch, target_rx, src_proc, block)
+ @rant = rant
+ @ch = ch
+ @target_rx = target_rx
+ @src_proc = src_proc
+ @block = block
+ end
+ def call(target, rel_project_dir)
+ if @target_rx =~ target
+ have_src = true
+ src = @src_proc[target]
+ if src.respond_to? :to_ary
+ have_src = src.to_ary.all? { |s|
+ have_src?(rel_project_dir, s)
+ }
+ else
+ have_src = have_src?(rel_project_dir, src)
+ end
+ if have_src
+ create_nodes(rel_project_dir, target, src)
+ end
+ end
+ end
+ alias [] call
+ private
+ def have_src?(rel_project_dir, name)
+ return true unless
+ @rant.rec_save_resolve(name, self, rel_project_dir).empty?
+ test(?e, @rant.abs_path(rel_project_dir, name))
+ end
+ def create_nodes(rel_project_dir, target, deps)
+ @rant.goto_project_dir rel_project_dir
+ case nodes = @block[target, deps]
+ when Array: nodes
+ when Node: [nodes]
+ else
+ @rant.abort_at(@ch, "Block has to " +
+ "return Node or array of Nodes.")
+ end
+ end
+ end
+ class FileHook < Hook
+ private
+ def have_src?(rel_project_dir, name)
+ test(?e, @rant.abs_path(rel_project_dir, name)) or
+ @rant.rec_save_resolve(name, self, rel_project_dir
+ ).any? { |t| t.file_target? }
+ end
+ def create_nodes(rel_project_dir, target, deps)
+ @rant.goto_project_dir rel_project_dir
+ t = @rant.file(:__caller__ => @ch,
+ target => deps, &@block)
+ [t]
+ end
+ end
+ end # class Rule
+ class Action
+ def self.rant_gen(rac, ch, args, &block)
+ case args.size
+ when 0:
+ unless (rac[:tasks] || rac[:stop_after_load])
+ yield
+ end
+ when 1:
+ rx = args.first
+ unless rx.kind_of? Regexp
+ rac.abort_at(ch, "Action: argument has " +
+ "to be a regular expression.")
+ end
+ rac.resolve_hooks << self.new(rac, block, rx)
+ nil
+ else
+ rac.abort_at(ch, "Action: too many arguments.")
+ end
+ end
+ def initialize(rant, block, rx)
+ @rant = rant
+ @subdir = @rant.current_subdir
+ @block = block
+ @rx = rx
+ end
+ def call(target, rel_project_dir)
+ if target =~ @rx
+ @rant.resolve_hooks.delete(self)
+ @rant.goto_project_dir @subdir
+ @block.call
+ @rant.resolve(target, rel_project_dir)
+ end
+ end
+ alias [] call
+ end
+ end # module Generators
+end # module Rant
+
+Rant::MAIN_OBJECT = self
+
+class String
+ alias sub_ext _rant_sub_ext
+ def to_rant_target
+ self
+ end
+end
+
+module Rant::Lib
+ def parse_caller_elem(elem)
+ return { :file => "", :ln => 0 } unless elem
+ if elem =~ /^(.+):(\d+)(?::|$)/
+ { :file => $1, :ln => $2.to_i }
+ else
+ $stderr.puts "parse_caller_elem: #{elem.inspect}"
+ { :file => elem, :ln => 0 }
+ end
+
+ end
+ module_function :parse_caller_elem
+end # module Lib
+
+module Rant::Console
+ RANT_PREFIX = "rant: "
+ ERROR_PREFIX = "[ERROR] "
+ WARN_PREFIX = "[WARNING] "
+ def msg_prefix
+ if defined? @msg_prefix and @msg_prefix
+ @msg_prefix
+ else
+ RANT_PREFIX
+ end
+ end
+ def msg(*text)
+ pre = msg_prefix
+ $stderr.puts "#{pre}#{text.join("\n" + ' ' * pre.length)}"
+ end
+ def vmsg(importance, *text)
+ msg(*text) if verbose >= importance
+ end
+ def err_msg(*text)
+ pre = msg_prefix + ERROR_PREFIX
+ $stderr.puts "#{pre}#{text.join("\n" + ' ' * pre.length)}"
+ end
+ def warn_msg(*text)
+ pre = msg_prefix + WARN_PREFIX
+ $stderr.puts "#{pre}#{text.join("\n" + ' ' * pre.length)}"
+ end
+ def ask_yes_no text
+ $stderr.print msg_prefix + text + " [y|n] "
+ case $stdin.readline
+ when /y|yes/i: true
+ when /n|no/i: false
+ else
+ $stderr.puts(' ' * msg_prefix.length +
+ "Please answer with `yes' or `no'")
+ ask_yes_no text
+ end
+ end
+ def prompt text
+ $stderr.print msg_prefix + text
+ input = $stdin.readline
+ input ? input.chomp : input
+ end
+ def option_listing opts
+ rs = ""
+ opts.each { |lopt, *opt_a|
+ if opt_a.size == 2
+ mode, desc = opt_a
+ else
+ sopt, mode, desc = opt_a
+ end
+ next unless desc # "private" option
+ optstr = ""
+ arg = nil
+ if mode != GetoptLong::NO_ARGUMENT
+ if desc =~ /(\b[A-Z_]{2,}\b)/
+ arg = $1
+ end
+ end
+ if lopt
+ optstr << lopt
+ if arg
+ optstr << " " << arg
+ end
+ optstr = optstr.ljust(30)
+ end
+ if sopt
+ optstr << " " unless optstr.empty?
+ optstr << sopt
+ if arg
+ optstr << " " << arg
+ end
+ end
+ rs << " #{optstr}\n"
+ rs << " #{desc.split("\n").join("\n ")}\n"
+ }
+ rs
+ end
+ extend self
+end # module Rant::Console
+
+module RantContext
+ include Rant::Generators
+
+ Env = Rant::Env
+ FileList = Rant::FileList
+
+ def task(targ, &block)
+ rant.task(targ, &block)
+ end
+
+ def file(targ, &block)
+ rant.file(targ, &block)
+ end
+
+ def enhance(targ, &block)
+ rant.enhance(targ, &block)
+ end
+
+ def desc(*args)
+ rant.desc(*args)
+ end
+
+ def gen(*args, &block)
+ rant.gen(*args, &block)
+ end
+
+ def import(*args, &block)
+ rant.import(*args, &block)
+ end
+
+ def plugin(*args, &block)
+ rant.plugin(*args, &block)
+ end
+
+ def subdirs(*args)
+ rant.subdirs(*args)
+ end
+
+ def source(opt, rantfile = nil)
+ rant.source(opt, rantfile)
+ end
+
+ def sys(*args, &block)
+ rant.sys(*args, &block)
+ end
+
+ def var(*args, &block)
+ rant.var(*args, &block)
+ end
+
+ def make(*args, &block)
+ rant.make(*args, &block)
+ end
+
+end # module RantContext
+
+class RantAppContext
+ include RantContext
+
+ def initialize(app)
+ @__rant__ = app
+ end
+
+ def rant
+ @__rant__
+ end
+
+ def method_missing(sym, *args)
+ Rant::MAIN_OBJECT.send(sym, *args)
+ rescue NoMethodError
+ raise NameError, "NameError: undefined local " +
+ "variable or method `#{sym}' for main:Object", caller
+ end
+end
+
+module Rant
+
+ @__rant__ = nil
+ class << self
+
+ def run(first_arg=nil, *other_args)
+ other_args = other_args.flatten
+ args = first_arg.nil? ? ARGV.dup : ([first_arg] + other_args)
+ if rant && !rant.run?
+ rant.run(args.flatten)
+ else
+ @__rant__ = Rant::RantApp.new
+ rant.run(args)
+ end
+ end
+
+ def rant
+ @__rant__
+ end
+ end
+
+end # module Rant
+
+class Rant::RantApp
+ include Rant::Console
+
+ class AutoLoadNodeFactory
+ def initialize(rant)
+ @rant = rant
+ end
+ def method_missing(sym, *args, &block)
+ @rant.import "nodes/default"
+ @rant.node_factory.send(sym, *args, &block)
+ end
+ end
+
+
+
+ OPTIONS = [
+ [ "--help", "-h", GetoptLong::NO_ARGUMENT,
+ "Print this help and exit." ],
+ [ "--version", "-V", GetoptLong::NO_ARGUMENT,
+ "Print version of Rant and exit." ],
+ [ "--verbose", "-v", GetoptLong::NO_ARGUMENT,
+ "Print more messages to stderr." ],
+ [ "--quiet", "-q", GetoptLong::NO_ARGUMENT,
+ "Don't print commands." ],
+ [ "--err-commands", GetoptLong::NO_ARGUMENT,
+ "Print failed commands and their exit status." ],
+ [ "--directory","-C", GetoptLong::REQUIRED_ARGUMENT,
+ "Run rant in DIRECTORY." ],
+ [ "--cd-parent","-c", GetoptLong::NO_ARGUMENT,
+ "Run rant in parent directory with Rantfile." ],
+ [ "--look-up", "-u", GetoptLong::NO_ARGUMENT,
+ "Look in parent directories for root Rantfile." ],
+ [ "--rantfile", "-f", GetoptLong::REQUIRED_ARGUMENT,
+ "Process RANTFILE instead of standard rantfiles.\n" +
+ "Multiple files may be specified with this option." ],
+ [ "--force-run","-a", GetoptLong::REQUIRED_ARGUMENT,
+ "Force rebuild of TARGET and all dependencies." ],
+ [ "--dry-run", "-n", GetoptLong::NO_ARGUMENT,
+ "Print info instead of actually executing actions." ],
+ [ "--tasks", "-T", GetoptLong::NO_ARGUMENT,
+ "Show a list of all described tasks and exit." ],
+
+
+ [ "--import", "-i", GetoptLong::REQUIRED_ARGUMENT, nil ],
+ [ "--stop-after-load", GetoptLong::NO_ARGUMENT, nil ],
+ [ "--trace-abort", GetoptLong::NO_ARGUMENT, nil ],
+ ]
+
+ ROOT_DIR_ID = "@"
+ ESCAPE_ID = "\\"
+
+ attr_reader :args
+ attr_reader :rantfiles
+ attr_reader :force_targets
+ attr_reader :plugins
+ attr_reader :context
+ alias cx context
+ attr_reader :tasks
+ attr_reader :imports
+ attr_reader :current_subdir
+ attr_reader :resolve_hooks
+ attr_reader :rootdir
+
+ attr_accessor :node_factory
+
+ def initialize
+ @args = []
+ @context = RantAppContext.new(self)
+ @sys = ::Rant::SysObject.new(self)
+ @rantfiles = []
+ @tasks = {}
+ @opts = {
+ :verbose => 0,
+ :quiet => false,
+ }
+ @rootdir = Dir.pwd # root directory of project
+ @arg_rantfiles = [] # rantfiles given in args
+ @arg_targets = [] # targets given in args
+ @force_targets = [] # targets given with -a option
+ @run = false # run method was called at least once
+ @done = false # run method was successful
+ @plugins = []
+ @var = Rant::RantVar::Space.new
+ @var.query :ignore, :AutoList, []
+ @imports = []
+
+ @task_desc = nil
+ @last_build_subdir = ""
+
+ @current_subdir = ""
+ @resolve_hooks = []
+
+ @node_factory = AutoLoadNodeFactory.new(self)
+ end
+
+ def [](opt)
+ @opts[opt]
+ end
+
+ def []=(opt, val)
+ @opts[opt] = val
+ end
+
+ def expand_path(subdir, path)
+ case path
+ when nil: subdir.dup
+ when "": subdir.dup
+ when /^@/: path.sub(/^@/, '')
+ else
+ path = path.sub(/^\\(?=@)/, '')
+ if subdir.empty?
+ path
+ else
+ File.join(subdir, path)
+ end
+ end
+ end
+ def resolve_root_ref(path)
+ return File.join(@rootdir, path[1..-1]) if path =~ /^@/
+ path.sub(/^\\(?=@)/, '')
+ end
+ def project_to_fs_path(path)
+ sub = expand_path(@current_subdir, path)
+ sub.empty? ? @rootdir : File.join(@rootdir, sub)
+ end
+ def abs_path(subdir, fn)
+ return fn if Rant::Sys.absolute_path?(fn)
+ path = File.join(@rootdir, subdir, fn)
+ path.gsub!(%r{/+}, "/")
+ path.sub!(%r{/$}, "") if path.length > 1
+ path
+ end
+ def goto(dir)
+ goto_project_dir(expand_path(@current_subdir, dir))
+ end
+ def goto_project_dir(dir='')
+ @current_subdir = dir
+ abs_path = @current_subdir.empty? ?
+ @rootdir : File.join(@rootdir, @current_subdir)
+ unless Dir.pwd == abs_path
+ Dir.chdir abs_path
+ vmsg 1, "in #{abs_path}"
+ end
+ end
+
+ def run?
+ @run
+ end
+
+ def done?
+ @done
+ end
+
+ def run(*args)
+ @run = true
+ @args.concat(args.flatten)
+ orig_pwd = @rootdir = Dir.pwd
+ process_args
+ Dir.chdir(@rootdir) rescue abort $!.message
+ load_rantfiles
+
+ raise Rant::RantDoneException if @opts[:stop_after_load]
+
+ @plugins.each { |plugin| plugin.rant_start }
+ if @opts[:tasks]
+ show_descriptions
+ raise Rant::RantDoneException
+ end
+ run_tasks
+ raise Rant::RantDoneException
+ rescue Rant::RantDoneException
+ @done = true
+ @plugins.each { |plugin| plugin.rant_done }
+ return 0
+ rescue Rant::RantAbortException
+ $stderr.puts "rant aborted!"
+ return 1
+ rescue Exception => e
+ ch = get_ch_from_backtrace(e.backtrace)
+ if ch && !@opts[:trace_abort]
+ err_msg(pos_text(ch[:file], ch[:ln]), e.message)
+ else
+ err_msg e.message, e.backtrace[0..4]
+ end
+ $stderr.puts "rant aborted!"
+ return 1
+ ensure
+ Dir.chdir @rootdir if test ?d, @rootdir
+ hooks = var._get("__at_return__")
+ hooks.each { |hook| hook.call } if hooks
+ @plugins.each { |plugin| plugin.rant_plugin_stop }
+ @plugins.each { |plugin| plugin.rant_quit }
+ Dir.chdir orig_pwd
+ end
+
+
+ def desc(*args)
+ if args.empty? || (args.size == 1 && args.first.nil?)
+ @task_desc = nil
+ else
+ @task_desc = args.join("\n")
+ end
+ end
+
+ def task(targ, &block)
+ prepare_task(targ, block) { |name,pre,blk|
+ @node_factory.new_task(self, name, pre, blk)
+ }
+ end
+
+ def file(targ, &block)
+ prepare_task(targ, block) { |name,pre,blk|
+ @node_factory.new_file(self, name, pre, blk)
+ }
+ end
+
+ def gen(*args, &block)
+ ch = Rant::Lib::parse_caller_elem(caller[1])
+ generator = args.shift
+ unless generator.respond_to? :rant_gen
+ abort_at(ch,
+ "gen: First argument has to be a task-generator.")
+ end
+ generator.rant_gen(self, ch, args, &block)
+ end
+
+ def import(*args, &block)
+ ch = Rant::Lib::parse_caller_elem(caller[1])
+ if block
+ warn_msg pos_text(ch[:file], ch[:ln]),
+ "import: ignoring block"
+ end
+ args.flatten.each { |arg|
+ unless String === arg
+ abort_at(ch, "import: only strings allowed as arguments")
+ end
+ unless @imports.include? arg
+ unless Rant::CODE_IMPORTS.include? arg
+ begin
+ vmsg 2, "import #{arg}"
+ require "rant/import/#{arg}"
+ rescue LoadError => e
+ abort_at(ch, "No such import - #{arg}")
+ end
+ Rant::CODE_IMPORTS << arg.dup
+ end
+ init_msg = "init_import_#{arg.gsub(/[^\w]/, '__')}"
+ Rant.send init_msg, self if Rant.respond_to? init_msg
+ @imports << arg.dup
+ end
+ }
+ end
+
+ def plugin(*args, &block)
+ clr = caller[1]
+ ch = Rant::Lib::parse_caller_elem(clr)
+ name = nil
+ pre = []
+ ln = ch[:ln] || 0
+ file = ch[:file]
+
+ pl_name = args.shift
+ pl_name = pl_name.to_str if pl_name.respond_to? :to_str
+ pl_name = pl_name.to_s if pl_name.is_a? Symbol
+ unless pl_name.is_a? String
+ abort(pos_text(file, ln),
+ "Plugin name has to be a string or symbol.")
+ end
+ lc_pl_name = pl_name.downcase
+ import_name = "plugin/#{lc_pl_name}"
+ unless Rant::CODE_IMPORTS.include? import_name
+ begin
+ require "rant/plugin/#{lc_pl_name}"
+ Rant::CODE_IMPORTS << import_name
+ rescue LoadError
+ abort(pos_text(file, ln),
+ "no such plugin library -- #{lc_pl_name}")
+ end
+ end
+ pl_class = nil
+ begin
+ pl_class = ::Rant::Plugin.const_get(pl_name)
+ rescue NameError, ArgumentError
+ abort(pos_text(file, ln),
+ "no such plugin -- #{pl_name}")
+ end
+
+ plugin = pl_class.rant_plugin_new(self, ch, *args, &block)
+ @plugins << plugin
+ vmsg 2, "Plugin `#{plugin.rant_plugin_name}' registered."
+ plugin.rant_plugin_init
+ plugin
+ end
+
+ def enhance(targ, &block)
+ prepare_task(targ, block) { |name,pre,blk|
+ t = resolve(name).last
+ if t
+ unless t.respond_to? :enhance
+ abort("Can't enhance task `#{name}'")
+ end
+ t.enhance(pre, &blk)
+ return t
+ end
+ warn_msg "enhance \"#{name}\": no such task",
+ "Generating a new file task with the given name."
+ @node_factory.new_file(self, name, pre, blk)
+ }
+ end
+
+ def source(opt, rantfile = nil)
+ unless rantfile
+ rantfile = opt
+ opt = nil
+ end
+ make_rf = opt != :n && opt != :now
+ rf, is_new = rantfile_for_path(rantfile)
+ return false unless is_new
+ make rantfile if make_rf
+ unless File.exist? rf.path
+ abort("source: No such file -- #{rantfile}")
+ end
+
+ load_file rf
+ end
+
+ def subdirs(*args)
+ args.flatten!
+ ch = Rant::Lib::parse_caller_elem(caller[1])
+ args.each { |arg|
+ if arg.respond_to? :to_str
+ arg = arg.to_str
+ else
+ abort_at(ch, "subdirs: arguments must be strings")
+ end
+ loaded = false
+ prev_subdir = @current_subdir
+ begin
+ goto arg
+ if test(?f, Rant::SUB_RANTFILE)
+ path = Rant::SUB_RANTFILE
+ else
+ path = rantfile_in_dir
+ end
+ if path
+ if defined? @initial_subdir and
+ @initial_subdir == @current_subdir
+ rf, is_new = rantfile_for_path(path, false)
+ @rantfiles.unshift rf if is_new
+ else
+ rf, is_new = rantfile_for_path(path)
+ end
+ load_file rf if is_new
+ elsif !@opts[:no_warn_subdir]
+ warn_msg(pos_text(ch[:file], ch[:ln]),
+ "subdirs: No Rantfile in subdir `#{arg}'.")
+ end
+ ensure
+ goto_project_dir prev_subdir
+ end
+ }
+ rescue SystemCallError => e
+ abort_at(ch, "subdirs: " + e.message)
+ end
+
+ def sys(*args, &block)
+ args.empty? ? @sys : @sys.sh(*args, &block)
+ end
+
+ def var(*args, &block)
+ args.empty? ? @var : @var.query(*args, &block)
+ end
+
+ def pop_desc
+ td = @task_desc
+ @task_desc = nil
+ td
+ end
+
+ def abort(*msg)
+ err_msg(msg) unless msg.empty?
+ $stderr.puts caller if @opts[:trace_abort]
+ raise Rant::RantAbortException
+ end
+
+ def abort_at(ch, *msg)
+ err_msg(pos_text(ch[:file], ch[:ln]), msg)
+ $stderr.puts caller if @opts[:trace_abort]
+ raise Rant::RantAbortException
+ end
+
+ def show_help
+ puts "rant [-f Rantfile] [Options] [targets]"
+ puts
+ puts "Options are:"
+ print option_listing(OPTIONS)
+ end
+
+ def show_descriptions
+ tlist = select_tasks { |t| t.description }
+ def_target = target_list.first
+ if tlist.empty?
+ puts "rant # => " + list_task_names(
+ resolve(def_target)).join(', ')
+ msg "No described tasks."
+ return
+ end
+ prefix = "rant "
+ infix = " # "
+ name_length = (tlist.map{ |t| t.to_s.length } << 7).max
+ cmd_length = prefix.length + name_length
+ unless tlist.first.to_s == def_target
+ defaults = list_task_names(
+ resolve(def_target)).join(', ')
+ puts "#{prefix}#{' ' * name_length}#{infix}=> #{defaults}"
+ end
+ tlist.each { |t|
+ print(prefix + t.to_s.ljust(name_length) + infix)
+ dt = t.description.sub(/\s+$/, "")
+ puts dt.gsub(/\n/, "\n" + ' ' * cmd_length + infix + " ")
+ }
+ true
+ end
+
+ def list_task_names(*tasks)
+ rsl = []
+ tasks.flatten.each { |t|
+ if t.respond_to?(:has_actions?) && t.has_actions?
+ rsl << t
+ elsif t.respond_to? :prerequisites
+ if t.prerequisites.empty?
+ rsl << t
+ else
+ t.prerequisites.each { |pre|
+ rsl.concat(list_task_names(
+ resolve(pre, t.project_subdir)))
+ }
+ end
+ else
+ rsl << t
+ end
+ }
+ rsl
+ end
+ private :list_task_names
+
+ def verbose
+ @opts[:verbose]
+ end
+
+ def quiet?
+ @opts[:quiet]
+ end
+
+ def pos_text(file, ln)
+ t = "in file `#{file}'"
+ t << ", line #{ln}" if ln && ln > 0
+ t << ": "
+ end
+
+ def cmd_msg(cmd)
+ puts cmd unless quiet?
+ end
+
+ def cmd_print(text)
+ print text unless quiet?
+ $stdout.flush
+ end
+
+ def cmd_targets
+ @force_targets + @arg_targets
+ end
+
+ def running_task(task)
+ if @current_subdir != @last_build_subdir
+ cmd_msg "(in #{@current_subdir.empty? ?
+ @rootdir : @current_subdir})"
+ @last_build_subdir = @current_subdir
+ end
+ if @opts[:dry_run]
+ task.dry_run
+ true
+ end
+ end
+
+ private
+ def have_any_task?
+ !@tasks.empty?
+ end
+
+ def target_list
+ if !have_any_task? && @resolve_hooks.empty?
+ abort("No tasks defined for this rant application!")
+ end
+
+ target_list = @force_targets + @arg_targets
+ if target_list.empty?
+ def_tasks = resolve "default"
+ unless def_tasks.empty?
+ target_list << "default"
+ else
+ @rantfiles.each { |f|
+ first = f.tasks.first
+ if first
+ target_list << first.reference_name
+ break
+ end
+ }
+ end
+ end
+ target_list
+ end
+
+ def run_tasks
+ target_list.each { |target|
+ if build(target) == 0
+ abort("Don't know how to make `#{target}'.")
+ end
+ }
+ end
+
+ def make(target, *args, &block)
+ ch = nil
+ if target.respond_to? :to_hash
+ targ = target.to_hash
+ ch = Rant::Lib.parse_caller_elem(caller[1])
+ abort_at(ch, "make: too many arguments") unless args.empty?
+ tn = nil
+ prepare_task(targ, block, ch) { |name,pre,blk|
+ tn = name
+ @node_factory.new_file(self, name, pre, blk)
+ }
+ build(tn)
+ elsif target.respond_to? :to_rant_target
+ rt = target.to_rant_target
+ opt = args.shift
+ unless args.empty?
+ ch ||= Rant::Lib.parse_caller_elem(caller[1])
+ abort_at(ch, "make: too many arguments")
+ end
+ if block
+ ch ||= Rant::Lib.parse_caller_elem(caller[1])
+ prepare_task(rt, block, ch) { |name,pre,blk|
+ @node_factory.new_file(self, name, pre, blk)
+ }
+ build(rt)
+ else
+ build(rt, opt||{})
+ end
+ elsif target.respond_to? :rant_gen
+ ch = Rant::Lib.parse_caller_elem(caller[1])
+ rv = target.rant_gen(self, ch, args, &block)
+ unless rv.respond_to? :to_rant_target
+ abort_at(ch, "make: invalid generator return value")
+ end
+ build(rv.to_rant_target)
+ rv
+ else
+ ch = Rant::Lib.parse_caller_elem(caller[1])
+ abort_at(ch,
+ "make: generator or target as first argument required.")
+ end
+ end
+ public :make
+
+ def build(target, opt = {})
+ opt[:force] = true if @force_targets.delete(target)
+ opt[:dry_run] = @opts[:dry_run]
+ matching_tasks = 0
+ old_subdir = @current_subdir
+ old_pwd = Dir.pwd
+ resolve(target).each { |t|
+ unless opt[:type] == :file && !t.file_target?
+ matching_tasks += 1
+ begin
+ t.invoke(opt)
+ rescue Rant::TaskFail => e
+ err_task_fail(e)
+ abort
+ end
+ end
+ }
+ @current_subdir = old_subdir
+ Dir.chdir old_pwd
+ matching_tasks
+ end
+ public :build
+
+ def resolve(task_name, rel_project_dir = @current_subdir)
+ s = @tasks[expand_path(rel_project_dir, task_name)]
+ case s
+ when nil
+ @resolve_hooks.each { |s|
+ s = s[task_name, rel_project_dir]
+ return s if s
+ }
+ []
+ when Rant::Node: [s]
+ else # assuming list of tasks
+ s
+ end
+ end
+ public :resolve
+
+ def rec_save_resolve(task_name, excl_hook, rel_project_dir = @current_subdir)
+ s = @tasks[expand_path(rel_project_dir, task_name)]
+ case s
+ when nil
+ @resolve_hooks.each { |s|
+ next if s == excl_hook
+ s = s[task_name, rel_project_dir]
+ return s if s
+ }
+ []
+ when Rant::Node: [s]
+ else
+ s
+ end
+ end
+ public :rec_save_resolve
+
+ def at_resolve(&block)
+ @resolve_hooks << block if block
+ end
+ public :at_resolve
+
+ def at_return(&block)
+ hooks = var._get("__at_return__")
+ if hooks
+ hooks << block
+ else
+ var._set("__at_return__", [block])
+ end
+ end
+ public :at_return
+
+ def select_tasks
+ selection = []
+ @rantfiles.each { |rf|
+ rf.tasks.each { |t|
+ selection << t if yield t
+ }
+ }
+ selection
+ end
+ public :select_tasks
+
+ def load_rantfiles
+ unless @arg_rantfiles.empty?
+ @arg_rantfiles.each { |fn|
+ if test(?f, fn)
+ rf, is_new = rantfile_for_path(fn)
+ load_file rf if is_new
+ else
+ abort "No such file -- #{fn}"
+ end
+ }
+ return
+ end
+ return if have_any_task?
+ fn = rantfile_in_dir
+ if @opts[:cd_parent]
+ old_root = @rootdir
+ until fn or @rootdir == "/"
+ @rootdir = File.dirname(@rootdir)
+ fn = rantfile_in_dir(@rootdir)
+ end
+ if @rootdir != old_root and fn
+ Dir.chdir @rootdir
+ cmd_msg "(in #@rootdir)"
+ end
+ end
+ if fn
+ rf, is_new = rantfile_for_path(fn)
+ load_file rf if is_new
+ return
+ end
+ have_sub_rantfile = test(?f, Rant::SUB_RANTFILE)
+ if have_sub_rantfile || @opts[:look_up]
+ cur_dir = Dir.pwd
+ until cur_dir == "/"
+ cur_dir = File.dirname(cur_dir)
+ Dir.chdir cur_dir
+ fn = rantfile_in_dir
+ if fn
+ @initial_subdir = @rootdir.sub(
+ /^#{Regexp.escape cur_dir}\//, '')
+ @rootdir = cur_dir
+ cmd_msg "(root is #@rootdir, in #@initial_subdir)"
+ @last_build_subdir = @initial_subdir
+ rf, is_new = rantfile_for_path(fn)
+ load_file rf if is_new
+ goto_project_dir @initial_subdir
+ if have_sub_rantfile
+ rf, is_new = rantfile_for_path(
+ Rant::SUB_RANTFILE, false)
+ if is_new
+ @rantfiles.unshift rf
+ load_file rf
+ end
+ end
+ break
+ end
+ end
+ end
+ if @rantfiles.empty?
+ abort("No Rantfile found, looking for:",
+ Rant::RANTFILES.join(", "))
+ end
+ end
+
+ def load_file(rantfile)
+ vmsg 1, "source #{rantfile}"
+ @context.instance_eval(File.read(rantfile), rantfile)
+ end
+ private :load_file
+
+ def rantfile_in_dir(dir=nil)
+ ::Rant::RANTFILES.each { |rfn|
+ path = dir ? File.join(dir, rfn) : rfn
+ return path if test ?f, path
+ }
+ nil
+ end
+
+ def process_args
+ old_argv = ARGV.dup
+ ARGV.replace(@args.dup)
+ cmd_opts = GetoptLong.new(*OPTIONS.collect { |lst| lst[0..-2] })
+ cmd_opts.quiet = true
+ cmd_opts.each { |opt, value|
+ case opt
+ when "--verbose": @opts[:verbose] += 1
+ when "--version"
+ puts "rant #{Rant::VERSION}"
+ raise Rant::RantDoneException
+ when "--help"
+ show_help
+ raise Rant::RantDoneException
+ when "--directory"
+ @rootdir = File.expand_path(value)
+ when "--rantfile"
+ @arg_rantfiles << value
+ when "--force-run"
+ @force_targets << value
+ when "--import"
+ import value
+ else
+ @opts[opt.sub(/^--/, '').tr('-', "_").to_sym] = true
+ end
+ }
+ rescue GetoptLong::Error => e
+ abort(e.message)
+ ensure
+ rem_args = ARGV.dup
+ ARGV.replace(old_argv)
+ rem_args.each { |ra|
+ if ra =~ /(^[^=]+)=([^=]+)$/
+ vmsg 2, "var: #$1=#$2"
+ @var[$1] = $2
+ else
+ @arg_targets << ra
+ end
+ }
+ end
+
+ def prepare_task(targ, block, clr = caller[2])
+
+ if targ.is_a? Hash
+ targ.reject! { |k, v| clr = v if k == :__caller__ }
+ end
+ ch = Hash === clr ? clr : Rant::Lib::parse_caller_elem(clr)
+
+ name, pre = normalize_task_arg(targ, ch)
+
+ file, is_new = rantfile_for_path(ch[:file])
+ nt = yield(name, pre, block)
+ nt.rantfile = file
+ nt.project_subdir = @current_subdir
+ nt.line_number = ch[:ln]
+ nt.description = @task_desc
+ @task_desc = nil
+ file.tasks << nt
+ hash_task nt
+ nt
+ end
+ public :prepare_task
+
+ def hash_task(task)
+ n = task.full_name
+ et = @tasks[n]
+ case et
+ when nil
+ @tasks[n] = task
+ when Rant::Node
+ mt = [et, task]
+ @tasks[n] = mt
+ else # assuming list of tasks
+ et << task
+ end
+ end
+
+ def normalize_task_arg(targ, ch)
+ name = nil
+ pre = []
+
+ if targ.is_a? Hash
+ if targ.empty?
+ abort_at(ch, "Empty hash as task argument, " +
+ "task name required.")
+ end
+ if targ.size > 1
+ abort_at(ch, "Too many hash elements, " +
+ "should only be one.")
+ end
+ targ.each_pair { |k,v|
+ name = normalize_task_name(k, ch)
+ pre = v
+ }
+ unless ::Rant::FileList === pre
+ if pre.respond_to? :to_ary
+ pre = pre.to_ary.dup
+ pre.map! { |elem|
+ normalize_task_name(elem, ch)
+ }
+ else
+ pre = [normalize_task_name(pre, ch)]
+ end
+ end
+ else
+ name = normalize_task_name(targ, ch)
+ end
+
+ [name, pre]
+ end
+ public :normalize_task_arg
+
+ def normalize_task_name(arg, ch)
+ return arg if arg.is_a? String
+ if Symbol === arg
+ arg.to_s
+ elsif arg.respond_to? :to_str
+ arg.to_str
+ else
+ abort_at(ch, "Task name has to be a string or symbol.")
+ end
+ end
+
+ def rantfile_for_path(path, register=true)
+ abs_path = File.expand_path(path)
+ file = @rantfiles.find { |rf| rf.path == abs_path }
+ if file
+ [file, false]
+ else
+ file = Rant::Rantfile.new abs_path
+ file.project_subdir = @current_subdir
+ @rantfiles << file if register
+ [file, true]
+ end
+ end
+
+ def get_ch_from_backtrace(backtrace)
+ backtrace.each { |clr|
+ ch = ::Rant::Lib.parse_caller_elem(clr)
+ if ::Rant::Env.on_windows?
+ return ch if @rantfiles.any? { |rf|
+ rf.path.tr("\\", "/").sub(/^\w\:/, '') ==
+ ch[:file].tr("\\", "/").sub(/^\w\:/, '')
+ }
+ else
+ return ch if @rantfiles.any? { |rf|
+ rf.path == ch[:file]
+ }
+ end
+ }
+ nil
+ end
+
+ def err_task_fail(e)
+ msg = []
+ t_msg = ["Task `#{e.tname}' fail."]
+ orig = e
+ loop { orig = orig.orig; break unless Rant::TaskFail === orig }
+ if orig && orig != e && !(Rant::RantAbortException === orig)
+ ch = get_ch_from_backtrace(orig.backtrace)
+ msg << pos_text(ch[:file], ch[:ln]) if ch
+ unless Rant::CommandError === orig && !@opts[:err_commands]
+ msg << orig.message
+ msg << orig.backtrace[0..4] unless ch
+ end
+ end
+ if e.msg && !e.msg.empty?
+ ch = get_ch_from_backtrace(e.backtrace)
+ t_msg.unshift(e.msg)
+ t_msg.unshift(pos_text(ch[:file], ch[:ln])) if ch
+ end
+ err_msg msg unless msg.empty?
+ err_msg t_msg
+ end
+end # class Rant::RantApp
+
+$".concat(['rant/rantlib.rb', 'rant/init.rb', 'rant/rantvar.rb', 'rant/rantsys.rb', 'rant/import/filelist/core.rb', 'rant/node.rb', 'rant/import/nodes/default.rb', 'rant/coregen.rb'])
+Rant::CODE_IMPORTS.concat %w(nodes/default
+ )
+
+# Catch a `require "rant"', sad...
+alias require_backup_by_rant require
+def require libf
+ if libf == "rant"
+ # TODO: needs rework! look at lib/rant.rb
+ self.class.instance_eval { include Rant }
+ else
+ begin
+ require_backup_by_rant libf
+ rescue
+ raise $!, caller
+ end
+ end
+end
+
+exit Rant.run
diff --git a/lib/sisu/0.52/cgi.rb b/lib/sisu/0.52/cgi.rb
new file mode 100644
index 00000000..83448613
--- /dev/null
+++ b/lib/sisu/0.52/cgi.rb
@@ -0,0 +1,76 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: generates naive cgi search form for search of sisu database (pgsql sqlite)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+=end
+module SiSU_CGI #% database building documents
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/cgi_pgsql'
+ require SiSU_lib + '/cgi_sqlite'
+ include SiSU_CGI_pgsql
+ class SiSU_search
+ def initialize(opt)
+ @opt=opt
+ @webserv=@opt.files[0].to_s.strip
+ end
+ def search_info
+ a=%{
+ For help on sisu search, type:
+ sisu --help search
+ For help on setting up hyperestraier for sisu, type:
+ sisu --help hyperestraier
+ }
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,a)
+ tell.print_grey
+ end
+ def read
+ SiSU_CGI_sqlite::SiSU_search_sqlite.new(@opt,@webserv).sqlite
+ SiSU_CGI_pgsql::SiSU_search_pgsql.new(@opt,@webserv).pgsql
+ search_info unless @opt.cmd =~/q/
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/cgi_pgsql.rb b/lib/sisu/0.52/cgi_pgsql.rb
new file mode 100644
index 00000000..a5a2ef93
--- /dev/null
+++ b/lib/sisu/0.52/cgi_pgsql.rb
@@ -0,0 +1,214 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: generates naive cgi search form for search of sisu database (pgsql sqlite)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+=end
+module SiSU_CGI_pgsql #% database building documents
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/cgi_sql_common'
+ include SiSU_CGI_sql
+ class SiSU_search_pgsql < SiSU_CGI_common
+ def initialize(opt,webserv)
+ @opt,@webserv=opt,webserv
+ @env=SiSU_Env::Info_env.new('',opt)
+ @sys=SiSU_Env::System_call.new
+ @image_src="#{@env.url.webserv_cgi}/_sisu/image"
+ @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env)
+ @db=SiSU_Env::Info_db.new
+ #p @db.port_psql
+ end
+ def pgsql
+ serve=[]
+ if @sys.psql
+ available_db_table=`psql --list` # system call requires psql
+ available_db=available_db_table.scan(/(SiSU_\S+)/) if not available_db_table.nil?
+ if available_db and available_db.class == Array
+ available_db.flatten.each do |x|
+ serve << x.gsub(/SiSU_(\S+)/,'\1')
+ end
+ else put "WARNING: no postgresql database available, (have you created one?)"
+ end
+ serve.sort!
+ f1,f2,f3=[],[],[]
+ serve.each do |x|
+ f1 << %{ <option value="SiSU_#{x}">#{x}</option>\n} unless x =~/apache|sisu\/image/ #check
+ end
+ f2 << %{ selected_db=case cgi['db']\n}
+ serve.each do |x|
+ f2 << %{ when /SiSU_#{x}/; '<option value="SiSU_#{x}">#{x}</option>'\n} unless x =~/apache|sisu\/image/ #check
+ end
+ end
+ f2 << " end\n"
+ if FileTest.writable?('.')
+ output=File.open('sisu_pgsql.cgi','w')
+ output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons_note << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << dbi_connect << @common.main2
+ a=%{ generated sisu_pgsql.cgi,
+ BASED ON ALREADY EXISTING directories that could potentially be used to populate postgresql db, (-D)
+ }
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,a)
+ tell.print_grey
+ c=case @webserv
+ when /pwd/; ''
+ else "if necessary make the directory /usr/lib/cgi-bin :
+ sudo cp -vi #{Dir.pwd}/sisu_pgsql.cgi /usr/lib/cgi-bin/.
+ sudo chmod -v 755 /usr/lib/cgi-bin/sisu_pgsql.cgi
+ (copy sisu_pgsql.cgi to your cgi directory) and set file permissions to 755"
+ end
+ a=%{#{c}
+ #{@env.webserv_base_cgi}/cgi-bin/sisu_pgsql.cgi
+ }
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,a)
+ tell.warn
+ a="postgresql db used for present directory: #{@db.db_psql}"
+ b="\n\t(to create and populate postgresql database see 'man sisu' and in particular the -D flag)\n\t[the database to be used for this directory (#{@db.db_psql}) will have to be created manually if it does not exist,\n\tsee 'sisu --help sql'\n\tif you have permission to create databases:\n\t'sisu -d --createdb'\n\tor using postgresql tools directly:\n\t'createdb #{@db.db_psql}'\n\tfor a list of existing databases try 'psql --list']"
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,a,b)
+ tell.txt_cyan
+ else puts 'failed in attempt to write sisu_pgsql.cgi to present directory, is directory writable?'
+ end
+ end
+ def header0
+ <<-WOK_SQL
+#!/usr/bin/env ruby
+=begin
+#{about}
+ * Description: generates naive cgi search form for search of sisu database (pgsql)
+#{gpl}
+=end
+ require 'cgi'
+ require 'fcgi'
+ require 'dbi'
+ @version='sisu_pgsql'
+ @image_src="#{@env.url.webserv_cgi}/_sisu/image"
+ @hosturl_db="#{@env.url.webserv_base_cgi}"
+ @hosturl_files="#{@env.url.webserv_files_from_db}"
+ @port="#{@db.port_psql}"
+ user='' # '#{@env.user}'
+ WOK_SQL
+ end
+ def search_statement
+ <<-'WOK_SQL'
+ class Dbi_search_string
+ def initialize(l,t,q)
+ @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~\( '")
+ unescaped_search.gsub!(/(.+)/,"#@l~\( '\\1' \)")
+ search_construct << unescaped_search
+ search_construct=search_construct.join(' ')
+ search[:search] << search_construct
+ search[:flag]=true
+ search
+ end
+ search
+ end
+ end
+ WOK_SQL
+ end
+ def buttons_note
+ ' <font size="2" color="#666666">case sensitive</font>'
+ end
+ def search_query1
+ <<-'WOK_SQL'
+ @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
+ WOK_SQL
+ end
+ def search_query2
+ <<-'WOK_SQL'
+ def sql_select_body
+ limit ||=@@limit
+ offset ||=@@offset
+ @sql_statement[:body]=%{SELECT metadata.title, 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, 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.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, 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
+ WOK_SQL
+ end
+ def dbi_connect
+ <<-'WOK_SQL'
+ dbi="dbi:Pg:database=#{@db};port=#{@port}"
+ @conn=DBI.connect(dbi,user)
+ WOK_SQL
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/cgi_sql_common.rb b/lib/sisu/0.52/cgi_sql_common.rb
new file mode 100644
index 00000000..ae4e170f
--- /dev/null
+++ b/lib/sisu/0.52/cgi_sql_common.rb
@@ -0,0 +1,809 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: generates naive cgi search form for search of sisu database (pgsql sqlite)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+=end
+module SiSU_CGI_sql
+ class SiSU_CGI_common
+ def initialize(webserv,cmd,image_src,dir)
+ @webserv,@cmd,@image_src,@env=webserv,cmd,image_src,dir
+ end
+ def about
+ <<-'WOK_SQL'
+ * Name: SiSU information Structuring Universe
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+ WOK_SQL
+ end
+ def gpl
+ <<-'WOK_SQL'
+
+ Copyright (C) 2007 Ralph Amissah
+ Copyright (C) 2005 Ralph Amissah (first release edition)
+ Copyright (C) 1997 Ralph Amissah (first edition)
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah ralph@amissah.com
+ Ralph Amissah ralph.amissah@gmail.com
+ WOK_SQL
+ end
+ def header1
+ <<-'WOK_SQL'
+#Common TOP
+ @@limit,@@offset=1000,0
+ @base="#@hosturl_db/cgi-bin/#@version.cgi"
+ @@canned_search_url=@base
+ class Form
+ def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,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_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,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>'
+ else ''
+ end
+ end
+ def submission_form
+ search_form=<<-WOK
+ WOK_SQL
+ end
+ def header_desc
+ <<-WOK_SQL
+ <!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="#@image_src/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="#@image_src/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>#{@env.sample_search_form_title}</b></label>
+ </td></tr>
+ </table>
+ WOK_SQL
+ end
+ def header2
+ <<-'WOK_SQL'
+ <table cellpadding="0">
+ <tr><td valign=\"top\">
+ <form action="#@base" id="Test Form" method="post">
+ <!input type="text" id="find" name="find" value="#@search_field" />
+ <!input type="text" id="find" name="find" value="" />
+ <font size="2" color="#222222">
+ select which database to search
+ </font>
+ <br />
+ <select name="db" size="1">
+ #@selected_db
+ WOK_SQL
+ end
+ def buttons1
+ <<-'WOK_SQL'
+ </select>
+ <font size="2" color="#222222">
+ <input type="radio" name="view" value="index" #@checked_index> index
+ <input type="radio" name="view" value="text" #@checked_text> text / grep
+ </font>
+ </td></tr></table>
+ <table cellpadding="2">
+ <tr><td valign=\"top\">
+ <textarea id="find" name="find" type="text" rows="4" cols="30" maxlength="256">#@search_field</textarea>
+ <br /><input type="submit" value="SiSU search" />
+ WOK_SQL
+ end
+ def buttons2
+ <<-'WOK_SQL'
+ </td>
+ <td valign=\"top\">
+ #@tip
+ #@search_note
+ #@the_can
+ </td></tr></table><table><tr><td>
+ <font size="2" color="#222222">
+ <input type="checkbox" name="echo" #@checked_echo> echo previous search
+ <input type="checkbox" name="searched" #@checked_searched> search result stats
+ <input type="checkbox" name="url" #@checked_url> url for search
+ <input type="checkbox" name="tip" #@checked_tip> available search fields
+ <input type="checkbox" name="sql" #@checked_sql> sql statement
+ <br />
+ checks:
+ <input type="radio" name="checks" value="check_ignore" #@checked_ignore> 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
+ WOK_SQL
+ end
+ def search_request
+ <<-'WOK_SQL'
+ 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
+ WOK_SQL
+ end
+ def search_statement_common
+ <<-'WOK_SQL'
+ 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)
+ @conn=conn
+ @text_search_flag=false
+ @sql_statement={ :body=>'',:endnotes=>'',:range=>'' }
+ #@offset||=@@offset
+ #@offset+=@@limit
+ search={ :text => [],:endnotes => [] }
+ st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1']).string
+ se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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']).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
+ WOK_SQL
+ end
+ def pages
+ <<-'WOK_SQL'
+ 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
+ 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
+ end
+ WOK_SQL
+ end
+ def tail
+ <<-WOK_SQL
+ def tail
+ <<-'WOK'
+ <br /><hr /><br />
+ <center><table align="center"bgcolor="#ffffff"><tr><td><font color="#666666"><table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
+
+ <tr align="center">
+ <td align="center"><p class="center"><font color="#666666" size="2">
+ presentations' look and feel<br />
+ generated by<br />
+ <a href="http://www.jus.uio.no/sisu" ><img border="0" src="#@image_src/sisu.png" alt="SiSU in Ruby with the usual GPL (or OSS) suspects - Way Better!" width="120" height="38"></a><br />
+ <a href="http://www.jus.uio.no/sisu" >SiSU</a><br />
+ version 0.50<br />2007w11/1 (2007-03-12)<br />
+
+ <table summary="SiSU rights" bgcolor="#ffffff" cellpadding="4" border="0" align="center" width="40%">
+ <sup>&copy;</sup> Ralph Amissah<br />
+ 1993, current 2007<br />
+ GPL 2<br />
+ <i>w3 since October 3 1993</i><br />
+ <a href="mailto://ralph@amissah.com" >ralph@amissah.com</a><br />
+ </font></p>
+ </td></tr></table>
+
+ <p><center><font color="#666666" size="2">the usual GPL (or OSS) suspects:<br />Better - "performance, reliability, scalability, security<br />& total cost of ownership"<br /><i>[not to mention flexibility &amp; choice]</i><br /><br />&lt;&lt;<a href="http://www.jus.uio.no/sisu/">Way Better!</a>&gt;&gt;</font></center></p><tr align="center"><td align="center">
+
+ </font></center></td></tr></table></center> <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
+ WOK_SQL
+ end
+ def main1
+ <<-'WOK_SQL'
+ @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_searched,checked_tip,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,selected_db='','','','','','','',''
+ if cgi['view']=~/text/; checked_index,checked_text='','checked'
+ else checked_index,checked_text='checked',''
+ end
+ 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_echo='checked' if cgi['echo'] =~/\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_url=checked_searched=checked_tip=checked_echo=checked_sql='checked'
+ checked_none=''
+ elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0
+ checked_none='checked'
+ checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
+ else checked_ignore='checked'
+ end
+ WOK_SQL
+ end
+ def main2
+ <<-'WOK_SQL'
+ 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']}&u=1&e=1"
+ end
+ @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
+ @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
+ canned_note='previous 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}<br /> <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">
+ <br /><b>previous selection</b>:<br />
+ database: #{green}#@db</font>; selected view: #{green}#{cgi['view']}</font><br />
+ search string: "#{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_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,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
+ @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
+ @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
+ #dbi_request
+ dbi_statement=Dbi_search_statement.new(@conn,@search_for,q)
+ @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
+ title=%{<span style="background-color: #DDFFAA"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html">#{c['title']}</a></span> by #{c['creator']} <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}/sisu_manifest#{lang}.html"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="manifest"><font size="2">&nbsp;?</font></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*/,'|')
+ search_regex.to_s
+ else nil
+ end
+ else nil
+ end
+ matched_para=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (c['body'].gsub(/(#@search_regx)/,'<span style="background-color: #ffff48">\1</span>')) : c['body'] #check
+ %{<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
+ %{<font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.</font><br />}
+ 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
+ title=%{<br /><hr><span style="background-color: #DDFFAA"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html">#{e['title']}</a></span> by #{e['creator']} <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}/sisu_manifest#{lang}.html"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="manifest"><font size="2">&nbsp;?</font></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=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (e['body'].to_s.gsub(/(#@search_regx)/,'<span style="background-color: #ffff48">\1</span>')) : e['body'] #check
+ 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
+ %{<font size="2" color="#666666">Found in the endnotes of #@counter_endn_doc documents, and at #@counter_endn_ocn locations within.</font><br />}
+ 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
+ canned=dbi_statement.sql_canned_search_url.to_s
+ 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
+ WOK_SQL
+ end
+ end
+end
+__END__
+#@counter_txt_ocn
+#@counter_endn_ocn
+
+
+ if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1
+ checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked'
+ checked_none=''
+ #elsif cgi['checks'] =~/check_fixed/ or cgi['check_fixed'] =~/\S/
+ # #checked_ignore='checked'
+ # checked_fixed='checked'
+ # checked_url='checked'
+ # checked_searched='checked'
+ # checked_echo='checked'
+ # #checked_tip='checked'
+ # #checked_sql='checked'
+ # checked_tip=checked_sql=checked_none=''
+ #elsif cgi['checks'] =~/check_ignore/ or cgi['check_ignore'] =~/\S/
+ # checked_ignore='checked'
+ # 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_echo='checked' if cgi['echo'] =~/\S/
+ # checked_sql='checked' if cgi['sql'] =~/\S/
+ # checked_none=''
+ elsif cgi['checks'] =~/check_none/ or cgi['a'].to_i==0
+ checked_none='checked'
+ checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
+ else checked_ignore='checked'
+ end
diff --git a/lib/sisu/0.52/cgi_sqlite.rb b/lib/sisu/0.52/cgi_sqlite.rb
new file mode 100644
index 00000000..d00237af
--- /dev/null
+++ b/lib/sisu/0.52/cgi_sqlite.rb
@@ -0,0 +1,207 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: generates naive cgi search form for search of sisu database (pgsql sqlite)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+=end
+module SiSU_CGI_sqlite #% database building documents
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/cgi_sql_common'
+ include SiSU_CGI_sql
+ class SiSU_search_sqlite < SiSU_CGI_common
+ def initialize(opt,webserv)
+ @opt,@webserv=opt,webserv
+ @env=SiSU_Env::Info_env.new('',opt)
+ @image_src="#{@env.url.webserv_cgi}/_sisu/image"
+ @common=SiSU_CGI_sql::SiSU_CGI_common.new(@webserv,@opt.cmd,@image_src,@env)
+ end
+ def sqlite
+ serve=[]
+ Dir.foreach(@env.path.webserv) do |x|
+ if x !~/^\./ and FileTest.directory?("#{@env.path.webserv}/#{x}")
+ if FileTest.file?("#{@env.path.webserv}/#{x}/sisu_sqlite.db"); serve << x unless x =~/^_\S+/
+ end
+ end
+ end
+ serve.sort!
+ f1,f2,f3=[],[],[]
+ serve.each do |x|
+ f1 << %{ <option value="SiSU_#{x}">#{x}</option>\n}
+ end
+ f2 << %{ selected_db=case cgi['db']\n}
+ serve.each do |x|
+ f2 << %{ when /SiSU_#{x}/; '<option value="SiSU_#{x}">#{x}</option>'\n}
+ end
+ f2 << " end\n"
+ #f3
+ f3 << %{ db_name='sisu_sqlite.db'\n}
+ f3 << %{ db_sqlite=case cgi['db']\n}
+ serve.each do |x|
+ f3 << %{ when /SiSU_#{x}/; "#{@env.path.webserv}/#{x}/sisu_sqlite.db"\n}
+ end
+ f3 << " end\n"
+ if FileTest.writable?('.')
+ output=File.open('sisu_sqlite.cgi','w')
+ output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << f3 << dbi_connect << @common.main2
+ a=%{ generated sisu_sqlite.cgi,
+ BASED ON ALREADY CREATED sisu_sqlite.db OUTPUT, (-d)
+ }
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,a)
+ tell.print_grey
+ c=case @webserv
+ when /pwd/; ''
+ else "if necessary make the directory /usr/lib/cgi-bin :
+ sudo cp -vi #{Dir.pwd}/sisu_sqlite.cgi /usr/lib/cgi-bin/.
+ sudo chmod -v 755 /usr/lib/cgi-bin/sisu_sqlite.cgi
+ (copy sisu_sqlite.cgi to your cgi directory) and set file permissions to 755"
+ end
+ a=%{#{c}
+ #{@env.webserv_base_cgi}/cgi-bin/sisu_sqlite.cgi
+ }
+ b='(to create and populate sisu sqlite database see "man sisu" and in particular the -d flag)'
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,a,b)
+ tell.warn
+ else puts 'failed in attempt to write sisu_sqlite.cgi to present directory, is directory writable?'
+ end
+ end
+ def header0
+ <<-WOK_SQL
+#!/usr/bin/env ruby
+=begin
+#{about}
+ * Description: generates naive cgi search form for search of sisu database (sqlite)
+#{gpl}
+=end
+ require 'cgi'
+ require 'fcgi'
+ require 'dbi'
+ @version='sisu_sqlite'
+ @image_src="#{@env.url.webserv_cgi}/_sisu/image"
+ @hosturl_db="#{@env.url.webserv_base_cgi}"
+ @hosturl_files="#{@env.url.webserv_files_from_db}"
+ WOK_SQL
+ end
+ def search_statement
+ <<-'WOK_SQL'
+ class Dbi_search_string
+ def initialize(l,t,q)
+ @l,@t,@q=l,t,q
+ end
+ def string
+ search={ :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
+ WOK_SQL
+ end
+ def search_query1
+ <<-'WOK_SQL'
+ @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
+ WOK_SQL
+ end
+ def search_query2
+ <<-'WOK_SQL'
+ def sql_select_body
+ limit ||=@@limit
+ offset ||=@@offset
+ @sql_statement[:body]=%{SELECT metadata.title, 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, 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.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, 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
+ WOK_SQL
+ end
+ def dbi_connect
+ <<-'WOK_SQL'
+ @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ?
+ @conn=DBI.connect(@dbi)
+ WOK_SQL
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/character_encoding.rb b/lib/sisu/0.52/character_encoding.rb
new file mode 100644
index 00000000..743eac82
--- /dev/null
+++ b/lib/sisu/0.52/character_encoding.rb
@@ -0,0 +1,369 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules related to locales, character encoding for different output generators [requires kirbybase]
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_character_encode
+ require 'kirbybase'
+ require SiSU_lib + '/sysenv'
+ class Characters
+ attr_accessor(:character_encoding,:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name)
+ def initialize(&block)
+ instance_eval(&block)
+ end
+ end
+ class Create <Characters
+ def initialize
+ #NOTE places character_encoding.tbl in correct subdirectory ./_sisu_processing/encoding
+ #@env=SiSU_Env::Info_env.new
+ #env=@env.path.encoding
+ #@db=KirbyBase.new(:local,nil,nil,env)
+ @db=KirbyBase.new #default database location, pwd
+ @ce_tbl=@db.create_table(:character_encoding, :glyph,:String, :dec,:Integer, :hex,:String, :rb,:String, :html,:String, :html_name,:String, :tex,:String, :tex_licr,:String, :tex_alt,:String, :name,:String)
+ end
+ def db
+ x=Character_encoding.new.table
+ #x.each {|y| puts y[2].inspect}
+ x.each do |c|
+ #puts "#{c[0]}, #{c[1]}, #{c[2]}, #{c[3]}, #{c[4]}, #{c[5]}, #{c[6]}, #{c[7]}, #{c[8]}, #{c[9]}"
+ @ce_tbl.insert(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9])
+ end
+ end
+ end
+ class Query
+ def initialize(find='',show='')
+ #NOTE character_encoding.tbl not read from subdirectory ./_sisu_processing/encoding
+ @db=KirbyBase.new #default database location, pwd
+ @ce_tbl=@db.get_table(:character_encoding)
+ @find=find
+ end
+ def selected(selected,show)
+ @y=[]
+ selected.each do |x|
+ @y<<case show
+ when 'glyph'; x.glyph
+ when 'dec'; x.dec
+ when 'hex'; x.hex
+ when 'rb'; x.rb
+ when 'html'; x.html
+ when 'html_name'; x.html_name
+ when 'tex'; x.tex
+ when 'ot1'; x.ot1
+ when 'ts1'; x.ts1
+ when 'name'; x.name
+ else x.hex
+ end
+ end
+ #@ce_tbl.select(:glyph,:name) { |r| r.hex == hex }.each do |r|
+ # puts '%s %s' % [r.glyph, r.name]
+ #end
+ #:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name
+ #list=['number','glyph','html','hex','rb','tex','ot1','ts1','name']
+ end
+ def hex(hex,show)
+ select=@ce_tbl.select(:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name) { |r| r.hex == hex }
+ selected(select,show)
+ @y
+ end
+ def dec(dec,show)
+ select=@ce_tbl.select(:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name) { |r| r.dec == dec }
+ selected(select,show)
+ @y
+ end
+ def name(name,show)
+ select=@ce_tbl.select(:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name) { |r| r.name =~ /#{name}/ }
+ selected(select,show)
+ @y
+ end
+ def report
+ puts @ce_tbl.select(:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name).to_report
+ end
+ def table
+ selected=@ce_tbl.select
+ #selected=@ce_tbl.select(:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name)
+ selected.each do |c|
+ puts '%s %s %s %s %s %s %s %s %s %s' % [c.glyph,c.dec,c.hex,c.rb,c.html,c.html_name,c.tex,c.tex_licr,c.tex_alt,c.name]
+ #puts "#{c.glyph}, #{c.dec}, #{c.hex}, #{c.rb}, #{c.html}, #{c.name}, #{c.tex}, #{c.tec_licr}, #{c.tex_alt}, #{c.c_name}"
+ end
+ end
+ end
+ class Character_encoding
+ def table
+ x=[]
+#:glyph, :dec,:hex, :rb, :xml , :html_name, :tex, :tex_licr, :tex_alt, :name
+ x=[
+ ['', 9, '', '', '&#009;', nil, '', '', '', 'Horizontal tab' ],
+ ['', 15, '', '', '&#015;', nil, '', '', '', 'Line feed' ],
+ ['', 17, '', '', '&#017;', nil, '', '', '', 'Carriage return' ],
+ [' ', 32, '40', '\40', '&#032;', nil, '', '', '', 'Space' ],
+ ['!', 33, '41', '\41', '&#033;', nil, '!', '!', '!', 'Punctuation Exclamation !' ],
+ ['', 34, '42', '\42', '&#034;', '&quot;', '', '', '', 'Punctuation Quotation mark' ],
+ ['#', 35, '43', '\43', '&#035;', nil, '{\#}', '\#', '', 'Hash mark #' ],
+ ['$', 36, '44', '\44', '&#036;', nil, '{\$}', '\textdollar', '', 'Dollar sign $' ],
+ ['%', 37, '45', '\45', '&#037;', nil, '{\%}', '\%', '', 'Percent sign %' ],
+ ['&', 38, '46', '\46', '&#038;', '&amp;', '{\&}', '\&', '', 'Ampersand &' ],
+ ['\'', 39, '47', '\47', '&#039;', nil, '', '', '', 'Apostrophe \''],
+ ['(', 40, '50', '\50', '&#040;', nil, '', '', '', 'Left parenthesis (' ],
+ [')', 41, '51', '\51', '&#041;', nil, '', '', '', 'Right parenthesis )' ],
+ ['*', 42, '52', '\52', '&#042;', nil, '', '', '', 'Asterisk *' ],
+ ['+', 43, '53', '\53', '&#043;', nil, '', '', '', 'Plus sign +' ],
+ [',', 44, '54', '\54', '&#044;', nil, ',', ',', ',', 'Puncutation Comma ,' ],
+ ['-', 45, '55', '\55', '&#045;', nil, '-', '-', '-', 'Puncutation Hyphen -' ],
+ ['.', 46, '56', '\56', '&#046;', nil, '.', '.', '.', 'Puncutation Period .' ],
+ ['/', 47, '57', '\57', '&#047;', nil, '/', '/', '/', 'Puncutation Slash /' ],
+ ['0', 48, '60', '\60', '&#048;', nil, '0', '0', '0', 'Digit zero 0' ],
+ ['1', 49, '61', '\61', '&#049;', nil, '1', '1', '1', 'Digit one 1' ],
+ ['2', 50, '62', '\62', '&#050;', nil, '2', '2', '2', 'Digit two 2' ],
+ ['3', 51, '63', '\63', '&#051;', nil, '3', '3', '3', 'Digit three 3' ],
+ ['4', 52, '64', '\64', '&#052;', nil, '4', '4', '4', 'Digit four 4' ],
+ ['5', 53, '65', '\65', '&#053;', nil, '5', '5', '5', 'Digit five 5' ],
+ ['6', 54, '66', '\66', '&#054;', nil, '6', '6', '6', 'Digit six 6' ],
+ ['7', 55, '67', '\67', '&#055;', nil, '7', '7', '7', 'Digit seven 7' ],
+ ['8', 56, '70', '\70', '&#056;', nil, '8', '8', '8', 'Digit eight 8' ],
+ ['9', 57, '71', '\71', '&#057;', nil, '9', '9', '9', 'Digit nine 9' ],
+ [':', 58, '72', '\72', '&#058;', nil, '', '', '', 'Punctuation Colon :' ],
+ [';', 59, '73', '\73', '&#059;', nil, '', '', '', 'Punctuation Semicolon ;' ],
+ ['<', 60, '74', '\74', '&#060;', '&lt;', '', '', '', 'Less than <' ],
+ ['=', 61, '75', '\75', '&#061;', nil, '', '', '', 'Equals sign =' ],
+ ['>', 62, '76', '\76', '&#062;', '&gt;', '', '', '', 'Greater than >' ],
+ ['?', 63, '77', '\77', '&#063;', nil, '?', '?', '?', 'Punctuation Question mark ?' ],
+ ['@', 64, '100', '\100', '&#064;', nil, '', '', '', 'Commercial at sign @' ],
+ ['A', 65, '101', '\101', '&#065;', nil, 'A', 'A', 'A', 'Captial A' ],
+ ['B', 66, '102', '\102', '&#066;', nil, 'B', 'B', 'B', 'Captial B' ],
+ ['C', 67, '103', '\103', '&#067;', nil, 'C', 'C', 'C', 'Captial C' ],
+ ['D', 68, '104', '\104', '&#068;', nil, 'D', 'D', 'D', 'Captial D' ],
+ ['E', 69, '105', '\105', '&#069;', nil, 'E', 'E', 'E', 'Captial E' ],
+ ['F', 70, '106', '\106', '&#070;', nil, 'F', 'F', 'F', 'Captial F' ],
+ ['G', 71, '107', '\107', '&#071;', nil, 'G', 'G', 'G', 'Captial G' ],
+ ['H', 72, '110', '\110', '&#072;', nil, 'H', 'H', 'H', 'Captial H' ],
+ ['I', 73, '111', '\111', '&#073;', nil, 'I', 'I', 'I', 'Captial I' ],
+ ['J', 74, '112', '\112', '&#074;', nil, 'J', 'J', 'J', 'Captial J' ],
+ ['K', 75, '113', '\113', '&#075;', nil, 'K', 'K', 'K', 'Captial K' ],
+ ['L', 76, '114', '\114', '&#076;', nil, 'L', 'L', 'L', 'Captial L' ],
+ ['M', 77, '115', '\115', '&#077;', nil, 'M', 'M', 'M', 'Captial M' ],
+ ['N', 78, '116', '\116', '&#078;', nil, 'N', 'N', 'N', 'Captial N' ],
+ ['O', 79, '117', '\117', '&#079;', nil, 'O', 'O', 'O', 'Captial O' ],
+ ['P', 80, '120', '\120', '&#080;', nil, 'P', 'P', 'P', 'Captial P' ],
+ ['Q', 81, '121', '\121', '&#081;', nil, 'Q', 'Q', 'Q', 'Captial Q' ],
+ ['R', 82, '122', '\122', '&#082;', nil, 'R', 'R', 'R', 'Captial R' ],
+ ['S', 83, '123', '\123', '&#083;', nil, 'S', 'S', 'S', 'Captial S' ],
+ ['T', 84, '124', '\124', '&#084;', nil, 'T', 'T', 'T', 'Captial T' ],
+ ['U', 85, '125', '\125', '&#085;', nil, 'U', 'U', 'U', 'Captial U' ],
+ ['V', 86, '126', '\126', '&#086;', nil, 'V', 'V', 'V', 'Captial V' ],
+ ['W', 87, '127', '\127', '&#087;', nil, 'W', 'W', 'W', 'Captial W' ],
+ ['X', 88, '130', '\130', '&#088;', nil, 'X', 'X', 'X', 'Captial X' ],
+ ['Y', 89, '131', '\131', '&#089;', nil, 'Y', 'Y', 'Y', 'Captial Y' ],
+ ['Z', 90, '132', '\132', '&#090;', nil, 'Z', 'Z', 'Z', 'Captial Z' ],
+ ['[', 91, '133', '\133', '&#091;', nil, '', '', '', 'Left square bracket [' ],
+ ['\\', 92, '134', '\134', '&#092;', nil, '', '\textbackslash', '', 'Backslash \\'],
+ [']', 93, '135', '\135', '&#093;', nil, '', '', '', 'Right square bracket ]' ],
+ ['^', 94, '136', '\136', '&#094;', nil, '', '', '', 'Caret ^' ],
+ ['_', 95, '137', '\137', '&#095;', nil, '{\_}', '\textunderscore', '', 'Underscore _' ],
+ ['`', 96, '140', '\140', '&#096;', nil, '', '', '', 'Grave accent `' ],
+ ['a', 97, '141', '\141', '&#097;', nil, 'a', 'a', 'a', 'Small a' ],
+ ['b', 98, '142', '\142', '&#098;', nil, 'b', 'b', 'b', 'Small b' ],
+ ['c', 99, '143', '\143', '&#099;', nil, 'c', 'c', 'c', 'Small c' ],
+ ['d', 100, '144', '\144', '&#100;', nil, 'd', 'd', 'd', 'Small d' ],
+ ['e', 101, '145', '\145', '&#101;', nil, 'e', 'e', 'e', 'Small e' ],
+ ['f', 102, '146', '\146', '&#102;', nil, 'f', 'f', 'f', 'Small f' ],
+ ['g', 103, '147', '\147', '&#103;', nil, 'g', 'g', 'g', 'Small g' ],
+ ['h', 104, '150', '\150', '&#104;', nil, 'h', 'h', 'h', 'Small h' ],
+ ['i', 105, '151', '\151', '&#105;', nil, 'i', 'i', 'i', 'Small i' ],
+ ['j', 106, '152', '\152', '&#106;', nil, 'j', 'j', 'j', 'Small j' ],
+ ['k', 107, '153', '\153', '&#107;', nil, 'k', 'k', 'k', 'Small k' ],
+ ['l', 108, '154', '\154', '&#108;', nil, 'l', 'l', 'l', 'Small l' ],
+ ['m', 109, '155', '\155', '&#109;', nil, 'm', 'm', 'm', 'Small m' ],
+ ['n', 110, '156', '\156', '&#110;', nil, 'n', 'n', 'n', 'Small n' ],
+ ['o', 111, '157', '\157', '&#111;', nil, 'o', 'o', 'o', 'Small o' ],
+ ['p', 112, '160', '\160', '&#112;', nil, 'p', 'p', 'p', 'Small p' ],
+ ['q', 113, '161', '\161', '&#113;', nil, 'q', 'q', 'q', 'Small q' ],
+ ['r', 114, '162', '\162', '&#114;', nil, 'r', 'r', 'r', 'Small r' ],
+ ['s', 115, '163', '\163', '&#115;', nil, 's', 's', 's', 'Small s' ],
+ ['t', 116, '164', '\164', '&#116;', nil, 't', 't', 't', 'Small t' ],
+ ['u', 117, '165', '\165', '&#117;', nil, 'u', 'u', 'u', 'Small u' ],
+ ['v', 118, '166', '\166', '&#118;', nil, 'v', 'v', 'v', 'Small v' ],
+ ['w', 119, '167', '\167', '&#119;', nil, 'w', 'w', 'w', 'Small w' ],
+ ['x', 120, '170', '\170', '&#120;', nil, 'x', 'x', 'x', 'Small x' ],
+ ['y', 121, '171', '\171', '&#121;', nil, 'y', 'y', 'y', 'Small y' ],
+ ['z', 122, '172', '\172', '&#122;', nil, 'z', 'z', 'z', 'Small z' ],
+ ['{', 123, '173', '\173', '&#123;', nil, '{\{}', '\{', '', 'Left curly brace {' ],
+ ['|', 124, '174', '\174', '&#124;', nil, '', '', '', 'Vertical bar / pipe |' ],
+ ['}', 125, '175', '\175', '&#125;', nil, '{\}}', '\}', '', 'Right curly brace }' ],
+ ['~', 126, '176', '\176', '&#126;', nil, '', '', '', 'Tilde ~' ],
+ ['', 127, '177', '', '&#127;', nil, '', '', '', ' ' ],
+ ['', 128, '200', '', '&#128;', nil, '', '', '', ' ' ],
+ ['', 129, '201', '', '&#129;', nil, '', '', '', ' ' ],
+ ['\'', 130, '202', '', '&#130;', nil, '', '', '', 'Low left single quote \''],
+ [' ', 131, '203', '', '&#131;', nil, '', '', '', 'Florin ' ],
+ ['"', 132, '204', '', '&#132;', nil, '', '', '', 'Low left double quote "' ],
+ ['…', 133, '205', '\342\200\246', '&#133;', nil, '…', '\textellipsis', '', 'Ellipsis …' ],
+ ['†', 134, '206', '\342\200\240', '&#134;', nil, '†', '\textdagger', '', 'Dagger †' ],
+ ['‡', 135, '207', '\342\200\241', '&#135;', nil, '‡', '\textdaggerbl', '', 'Double dagger ‡' ],
+ ['^', 136, '210', '', '&#136;', nil, '', '', '', 'Circumflex ^' ],
+ ['', 137, '211', '', '&#137;', nil, '', '', '', 'Permil ' ],
+ ['', 138, '212', '', '&#138;', nil, '', '', '', 'Capital S, caron ' ],
+ ['<', 139, '213', '', '&#139;', nil, '', '', '', 'Less than sign (see &060;) <' ],
+ ['', 140, '214', '', '&#140;', nil, '', '', '', 'Capital OE ligature ' ],
+ ['', 141, '215', '', '&#141;', nil, '', '', '', ' ' ],
+ ['', 142, '216', '', '&#142;', nil, '', '', '', 'Capital Z, caron ' ],
+ ['', 143, '217', '', '&#143;', nil, '', '', '', ' ' ],
+ ['', 144, '220', '', '&#144;', nil, '', '', '', ' ' ],
+ ['', 145, '221', '', '&#145;', nil, '', '', '', 'Left single quote ' ],
+ ['', 146, '222', '', '&#146;', nil, '', '', '', 'Right single quote ' ],
+ ['', 147, '223', '', '&#147;', nil, '', '', '', 'Left double quote ' ],
+ ['', 148, '224', '', '&#148;', nil, '', '', '', 'Right double quote ' ],
+ ['', 149, '225', '', '&#149;', nil, '', '', '', 'Bullet ' ],
+ ['-', 150, '226', '', '&#150;', nil, '', '', '', 'En dash -' ],
+ ['', 151, '227', '', '&#151;', nil, '', '', '', 'Em dash -' ],
+ ['~', 152, '230', '', '&#152;', nil, '', '', '', 'Tilde (see &126;) ~' ],
+ ['t', 153, '231', '', '&#153;', nil, '', '', '', 'Trademark t' ],
+ ['', 154, '232', '', '&#154;', nil, '', '', '', 'small s, caron ' ],
+ ['', 155, '233', '', '&#155;', nil, '', '', '', 'Greater than sign (see &062;) ' ],
+ ['', 156, '234', '', '&#156;', nil, '', '', '', 'Small oe ligature ' ],
+ ['', 157, '235', '', '&#157;', nil, '', '', '', ' ' ],
+ ['', 158, '236', '', '&#158;', nil, '', '', '', 'Small z, caron ' ],
+ ['', 159, '237', '', '&#159;', nil, '', '', '', 'Capital Y, umlaut ' ],
+ ['', 160, '240', '', '&#160;', '&nbsp;', '', '', '', 'Non-breaking space ' ],
+ ['¡', 161, '241', '\302\241', '&#161;', '&iexcl;', '¡', '', '', 'Inverted exclamation ' ],
+ ['¢', 162, '242', '\302\242', '&#162;', '&cent;', '¢', '', '', 'Cent sign ¢' ],
+ ['£', 163, '243', '\302\243', '&#163;', '&pound;', '£', '\textsterling', '', 'Pound sign £' ],
+ ['¤', 164, '244', '\302\244', '&#164;', '&curren;', '¤', '\textcurrency', '', 'General currency sign ' ],
+ ['¥', 165, '245', '\302\245', '&#165;', '&yen;', '¥', '', '', 'Yen sign ¥' ],
+ ['¦', 166, '246', '\302\246', '&#166;', '&brvbar;', '¦', '', '', 'Broken vertical bar ' ],
+ ['§', 167, '247', '\302\247', '&#167;', '&sect;', '§', '\textsection', '', 'Section sign §' ],
+ ['¨', 168, '250', '\302\250', '&#168;', '&uml;', '¨', '\"', '', 'Umlaut ' ],
+ ['©', 169, '251', '\302\251', '&#169;', '&copy;', '©', '\copyright', '\textcopyright', 'Copyright ©' ],
+ ['ª', 170, '252', '\302\252', '&#170;', '&ordf;', 'ª', '', '', 'Feminine ordinal ª' ],
+ ['«', 171, '253', '\302\253', '&#171;', '&laquo;', '«', '', '', 'Left angle quote «' ],
+ ['¬', 172, '254', '\302\254', '&#172;', '&not;', '¬', '', '', 'Not sign ' ],
+ ['­', 173, '255', '\302\255', '&#173;', '&shy;', '­', '', '', 'Soft hyphen ' ],
+ ['®', 174, '256', '\302\256', '&#174;', '&reg;', '®', '', '', 'Registered trademark ®' ],
+ ['¯', 175, '257', '\302\257', '&#175;', '&macr;', '¯', '', '', 'Macron accent ' ],
+ ['°', 176, '260', '\302\260', '&#176;', '&deg;', '°', '', '', 'Degree sign °' ],
+ ['±', 177, '261', '\302\261', '&#177;', '&plusmin;', '±', '', '', 'Plus or minus ±' ],
+ ['²', 178, '262', '\302\262', '&#178;', '&sup2;', '²', '', '', 'Superscript 2 ²' ],
+ ['³', 179, '263', '\302\263', '&#179;', '&sup3;', '³', '', '', 'Superscript 3 ³' ],
+ ['', 180, '264', '\302\264', '&#180;', '&acute;', ''', '', '', 'Acute accent ' ],
+ ['µ', 181, '265', '\302\265', '&#181;', '&micro;', 'µ', '', '', 'Micro sign (Greek mu) µ' ],
+ ['¶', 182, '266', '\302\266', '&#182;', '&para;', '¶', '\textparagraph', '', 'Paragraph sign ¶' ],
+ ['·', 183, '267', '\302\267', '&#183;', '&middot;', %q{·}, '', %q{}, 'Middle dot ' ],
+ ['¸', 184, '270', '\302\270', '&#184;', '&cedil;', '¸', '', '', 'Cedilla ' ],
+ ['¹', 185, '271', '\302\271', '&#185;', '&sup1;', '¹', '', '', 'Superscript 1 ¹' ],
+ ['º', 186, '272', '\302\272', '&#186;', '&ordm;', 'º', '', '', 'Masculine ordinal º' ],
+ ['»', 187, '273', '\302\273', '&#187;', '&raquo;', '»', '', '', 'Right angle quote ' ],
+ ['¼', 188, '274', '\302\274', '&#188;', '&frac14;', '¼', '', '', 'Fraction one quarter ¼' ],
+ ['½', 189, '275', '\302\275', '&#189;', '&frac12;', '½', '', '', 'Fraction on half ½' ],
+ ['¾', 190, '276', '\302\276', '&#190;', '&frac34;', '¾', '', '', 'Fraction three quarters ¾' ],
+ ['¿', 191, '277', '\302\277', '&#191;', '&iquest;', '¿', '', '', 'Inverted question mark ¿' ],
+ ['À', 192, '300', '\303\200', '&#192;', '&Agrave;', 'À', '\`{A}', '', 'Capital A, grave accent À' ],
+ ['Á', 193, '301', '\303\201', '&#193;', '&Aacute;', 'Á', %q{\'{A}}, '', 'Capital A, acute accent Á' ],
+ ['Â', 194, '302', '\303\202', '&#194;', '&Acirc;', 'Â', '^{A}', '', 'Capital A, circumflex accent Â' ],
+ ['Ã', 195, '303', '\303\203', '&#195;', '&Atilde;', 'Ã', '~{A}', '', 'Capital A, tilde Ã' ],
+ ['Ä', 196, '304', '\303\204', '&#196;', '&Auml;', 'Ä', '"{A}', '', 'Capital A, umlaut Ä' ],
+ ['Å', 197, '305', '\303\205', '&#197;', '&Aring;', 'Å', 'r{A}', '', 'Capital A, ring Å' ],
+ ['Æ', 198, '306', '\303\206', '&#198;', '&AElig;', 'Æ', 'AE', '', 'Capital AE ligature Æ' ],
+ ['Ç', 199, '307', '\303\207', '&#199;', '&Ccedil;', 'Ç', '', '', 'Capital C, cedilla Ç' ],
+ ['È', 200, '310', '\303\210', '&#200;', '&Egrave;', 'È', '`{E}', '', 'Capital E, grave accent È' ],
+ ['É', 201, '311', '\303\211', '&#201;', '&Eacute;', 'É', ''{E}', '', 'Capital E, acute accent É' ],
+ ['Ê', 202, '312', '\303\212', '&#202;', '&Ecirc;', 'Ê', '^{E}', '', 'Capital E, circumflex accent Ê' ],
+ ['Ë', 203, '313', '\303\213', '&#203;', '&Euml;', 'Ë', '"{E}', '', 'Capital E, umlaut Ë' ],
+ ['Ì', 204, '314', '\303\214', '&#204;', '&Igrave;', 'Ì', '`{I}', '', 'Capital I, grave accent Ì' ],
+ ['Í', 205, '315', '\303\215', '&#205;', '&Iacute;', 'Í', ''{I}', '', 'Capital I, acute accent Í' ],
+ ['Î', 206, '316', '\303\216', '&#206;', '&Icirc;', 'Î', '^{I}', '', 'Capital I, circumflex accent Î' ],
+ ['Ï', 207, '317', '\303\217', '&#207;', '&Iuml;', 'Ï', '"{I}', '', 'Capital I, umlaut Ï' ],
+ ['Ð', 208, '320', '\303\220', '&#208;', '&ETH;', 'Ð', '', '', 'Capital eth, Icelandic ' ],
+ ['Ñ', 209, '321', '\303\221', '&#209;', '&Ntilde;', 'Ñ', '', '', 'Capital N, tilde Ñ' ],
+ ['Ò', 210, '322', '\303\222', '&#210;', '&Ograve;', 'Ò', '`{O}', '', 'Capital O, grave accent Ò' ],
+ ['Ó', 211, '323', '\303\223', '&#211;', '&Oacute;', 'Ó', ''{O}', '', 'Capital O, acute accent Ó' ],
+ ['Ô', 212, '324', '\303\224', '&#212;', '&Ocirc;', 'Ô', '^{O}', '', 'Capital O, circumflex accent Ô' ],
+ ['Õ', 213, '325', '\303\225', '&#213;', '&Otilde;', 'Õ', '~{O}', '', 'Capital O, tilde Õ' ],
+ ['Ö', 214, '326', '\303\226', '&#214;', '&Ouml;', 'Ö', '"{O}', '', 'Capital O, umlaut Ö' ],
+ ['×', 215, '327', '\303\227', '&#215;', '&times;', '×', '', '', 'Multiply sign ×' ],
+ ['Ø', 216, '330', '\303\230', '&#216;', '&Oslash;', 'Ø', 'O', '', 'Capital O, slash Ø' ],
+ ['Ù', 217, '331', '\303\231', '&#217;', '&Ugrave;', 'Ù', '', '', 'Capital U, grave accent Ù' ],
+ ['Ú', 218, '332', '\303\232', '&#218;', '&Uacute;', 'Ú', '', '', 'Capital U, acute accent Ú' ],
+ ['Û', 219, '333', '\303\233', '&#219;', '&Ucirc;', 'Û', '', '', 'Capital U, circumflex accent Û' ],
+ ['Ü', 220, '334', '\303\234', '&#220;', '&Uuml;', 'Ü', '', '', 'Capital U, umlaut Ü' ],
+ ['Ý', 221, '335', '\303\235', '&#221;', '&Yacute;', 'Ý', '', '', 'Capital Y, acute accent Ý' ],
+ ['Þ', 222, '336', '\303\236', '&#222;', '&THORN;', 'Þ', '', '', 'Capital thorn, Icelandic Þ' ],
+ ['ß', 223, '337', '\303\237', '&#223;', '&szlig;', 'ß', '', '', 'Small sz ligature, German ß' ],
+ ['à', 224, '340', '\303\240', '&#224;', '&agrave;', 'à', '\`{a}', '', 'Small a, grave accent à' ],
+ ['á', 225, '341', '\303\241', '&#225;', '&aacute;', 'á', %q{\'{a}}, '', 'Small a, acute accent á' ],
+ ['â', 226, '342', '\303\242', '&#226;', '&acirc;', 'â', '\^{a}', '', 'Small a, circumflex accent â' ],
+ ['ã', 227, '343', '\303\243', '&#227;', '&atilde;', 'ã', '\~{a}', '', 'Small a, tilde ã' ],
+ ['ä', 228, '344', '\303\244', '&#228;', '&auml;', 'ä', '\"{a}', '', 'Small a, umlaut ä' ],
+ ['å', 229, '345', '\303\245', '&#229;', '&aring;', 'å', '\r{a}', '', 'Small a, ring å' ],
+ ['æ', 230, '346', '\303\246', '&#230;', '&aelig;', 'æ', '\ae', '', 'Small ae ligature æ' ],
+ ['ç', 231, '347', '\303\257', '&#231;', '&ccedil;', 'ç', '', '', 'Small c, cedilla ç' ],
+ ['è', 232, '350', '\303\250', '&#232;', '&egrave;', 'è', '\`{e}', '', 'Small e, grave accent è' ],
+ ['é', 233, '351', '\303\251', '&#233;', '&eacute;', 'é', %q{\'{e}}, '', 'Small e, acute accent é' ],
+ ['ê', 234, '352', '\303\252', '&#234;', '&ecirc;', 'ê', '\^{e}', '', 'Small e, circumflex accent ê' ],
+ ['ë', 235, '353', '\303\253', '&#235;', '&euml;', 'ë', '\"{e}', '', 'Small e, umlaut ë' ],
+ ['ì', 236, '354', '\303\254', '&#236;', '&igrave;', 'ì', '\`{i}', '', 'Small i, grave accent ì' ],
+ ['í', 237, '355', '\303\255', '&#237;', '&iacute;', 'í', '\'{i}', '', 'Small i, acute accent í' ],
+ ['î', 238, '356', '\303\256', '&#238;', '&icirc;', 'î', '\^{i}', '', 'Small i, circumflex accent î' ],
+ ['ï', 239, '357', '\303\257', '&#239;', '&iuml;', 'ï', '\"{i}', '', 'Small i, umlaut ï' ],
+ ['ð', 240, '360', '\303\260', '&#240;', '&eth;', 'ð', '', '', 'Small eth, Icelandic ð' ],
+ ['ñ', 241, '361', '\303\261', '&#241;', '&ntilde;', 'ñ', '', '', 'Small n, tilde ñ' ],
+ ['ò', 242, '362', '\303\262', '&#242;', '&ograve;', 'ò', '\`{o}', '', 'Small o, grave accent ò' ],
+ ['ó', 243, '363', '\303\263', '&#243;', '&oacute;', 'ó', %q{\'{o}}, '', 'Small o, acute accent ó' ],
+ ['ô', 244, '364', '\303\264', '&#244;', '&ocirc;', 'ô', '\^{o}', '', 'Small o, circumflex accent ô' ],
+ ['õ', 245, '365', '\303\265', '&#245;', '&otilde;', 'õ', '\^{o}', '', 'Small o, tilde õ' ],
+ ['ö', 246, '366', '\303\266', '&#246;', '&ouml;', 'ö', '\"{o}', '', 'Small o, umlaut ö' ],
+ ['÷', 247, '367', '\303\267', '&#247;', '&divide;', '÷', '', '', 'Divide sign ÷' ],
+ ['ø', 248, '370', '\303\270', '&#248;', '&oslash;', 'ø', '', '', 'Small o, slash ø' ],
+ ['ù', 249, '371', '\303\271', '&#249;', '&ugrave;', 'ù', '\`{u}', '', 'Small u, grave accent ù' ],
+ ['ú', 250, '372', '\303\272', '&#250;', '&uacute;', 'ú', %q{\'{u}}, '', 'Small u, acute accent ú' ],
+ ['û', 251, '373', '\303\273', '&#251;', '&ucirc;', 'û', '\^{u}', '', 'Small u, circumflex accent û' ],
+ ['ü', 252, '374', '\303\274', '&#252;', '&uuml;', 'ü', '\"{u}', '', 'Small u, umlaut ü' ],
+ ['ý', 253, '375', '\303\275', '&#253;', '&yacute;', 'ý', '', '', 'Small y, acute accent ý' ],
+ ['þ', 254, '376', '\303\276', '&#254;', '&thorn;', 'þ', '', '', 'Small thorn, Icelandic þ' ],
+ ['ÿ', 255, '377', '\303\277', '&#255;', '&yuml;', 'ÿ', '', '', 'Smally y, umlaut ÿ' ]
+]
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/composite.rb b/lib/sisu/0.52/composite.rb
new file mode 100644
index 00000000..99069b8f
--- /dev/null
+++ b/lib/sisu/0.52/composite.rb
@@ -0,0 +1,215 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: composite documents, assemble/build documents from other documents or parts of marked up text
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Assemble
+ require SiSU_lib + '/sysenv'
+ class Remote_image
+ def initialize
+ @env=SiSU_Env::Info_env.new
+ end
+ def image(dir)
+ images=[]
+ images[0]=dir
+ images
+ end
+ def download_images(images_array) #first element in array is source url
+ path="#{@env.path.processing}/external_document/image"
+ File.mkpath(path) unless FileTest.directory?(path)
+ download_from=images_array.shift
+ images_array.each do |i|
+ image="#{path}/#{i}"
+ #unless FileTest.exists?(image)
+ imagefile=File.new(image,'w+')
+ open("#{download_from}/#{i}") do |g|
+ imagefile << g.read
+ end
+ imagefile.close
+ #end
+ end
+ end
+ def download_doc_skin(doc_skin) #first element in array is source url
+ path="#{@env.path.processing}/external_document/skin/doc"
+ File.mkpath(path) unless FileTest.directory?(path)
+ download_from=doc_skin.shift
+ doc_skin.each do |i|
+ skin="#{path}/#{i}.rb"
+ unless FileTest.exists?(skin)
+ skinfile=File.new(skin,'w+')
+ open("#{download_from}/#{i}.rb") do |g|
+ skinfile << g.read
+ end
+ skinfile.close
+ end
+ end
+ end
+ end
+ class Composite
+ @@imager={}
+ def initialize(opt)
+ @opt=opt
+ @env=SiSU_Env::Info_env.new
+ end
+ def read
+ begin
+ @fns_array=IO.readlines(@opt.fns,'')
+ assembled=insertions?
+ write(assembled)
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ def write(assembled)
+ m=/(.+)?(\.ssm$)/m
+ assembled_file=File.new("#{@opt.fnb}._sst",'w+')
+ assembled.each{|a| assembled_file << a }
+ assembled_file.close
+ end
+ def download_images(download_from,images_array)
+ path="#{@env.path.processing}/external_document/image"
+ File.mkpath(path) unless FileTest.directory?(path)
+ images_array.each do |i|
+ image="#{path}/#{i}"
+ unless FileTest.exists?(image)
+ imagefile=File.new(image,'w+')
+ open("#{download_from}/#{i}") do |g|
+ imagefile << g.read
+ end
+ imagefile.close
+ end
+ end
+ end
+ def download_doc_skin(doc_skin) #first element in array is source url
+ path="#{@env.path.processing}/external_document/skin/doc"
+ File.mkpath(path) unless FileTest.directory?(path)
+ download_from=doc_skin.shift
+ doc_skin.each do |i|
+ skin="#{path}/#{i}.rb"
+ unless FileTest.exists?(skin)
+ skinfile=File.new(skin,'w+')
+ open("#{download_from}/#{i}.rb") do |g|
+ skinfile << g.read
+ end
+ skinfile.close
+ end
+ end
+ end
+ def insertion(fni,insert_array)
+ file={ :prepared=>[],:images=>[] }
+ rgx_image=/([a-zA-Z0-9._-]+?\.(?:png|jpg|gif))/
+ #file[:prepared] << "#% Date " << "\n"
+ file[:prepared] << "\n% |#{fni}|@|^|>>ok\n"
+ insert_array.each do |i|
+ i.gsub!(/^([12]|:?[AB])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax)
+ if i =~/^0~|^@\S+?:/
+ i.gsub!(/\n/m,"\n% ")
+ i.gsub!(/\n%\s+$/m,'')
+ i.gsub!(/^0~|^@\S+?:/m,"\n% [imported header:] ") #off imported headers
+ end
+ file[:prepared] << i
+ file[:images] << i.scan(rgx_image).uniq if i =~rgx_image #flag
+ end
+ file[:prepared] << "\n% end import" << "\n\n"
+ file[:images].uniq! if file[:images].length > 0
+ file[:images].flatten! if file[:images].length > 0
+ file
+ end
+ def insertions?
+ data=@fns_array
+ tuned_file,imagedir=[],[]
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Composite Document',@opt.fns)
+ tell.grey_title_hi unless @opt.cmd =~/q/
+ para=data.each do |para|
+ if para =~/^r\{(.+?)\}/ \
+ or para =~/^(?:<<\s*)\{(.+?)\}(?:req(?:quire)?\b|\s*\})?/ \
+ or para =~/^(?:<<\s*)\|(\S+?)\|@\|.+?\|(?:req(?:quire)?\b|\s*\})?/ \
+ or para =~/^(?:<<\s*)<(?:URL|url):(\S+?)>(?:req(?:require)\b|\s*\})?/ \
+ or para =~/^\{(.+?)\}(?:req(?:require)?)\b/ \
+ or para =~/^\|(\S+?)\|@\|.+?\|(?:req(?:require)?)\b/ \
+ or para =~/^<(?:URL|url):(\S+?)>(?:req(?:require))\b/
+ loadfile=$1.strip
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'loading:',loadfile)
+ tell.txt_grey if @opt.cmd =~/[MVv]/
+ tuned_file << if loadfile =~ /http:\/\/\S+?\.ss[ti]$/ # and NetTest
+ imagedir = /(http:\/\/\S+?)\/[^\/]+?\.ss[ti]$/.match(loadfile).captures.join + '/_sisu/image' #watch
+ require 'uri'
+ image_uri=URI.parse(imagedir)
+ require 'open-uri'
+ require 'pp'
+ insert=open(loadfile)
+ insert_array=insert.dup
+ insert.close
+ file=insertion(loadfile,insert_array)
+ @@imager[image_uri] ||=[]
+ @@imager[image_uri] << file[:images]
+ file[:prepared]
+ elsif loadfile =~ /\.ss[ti]$/ and FileTest.file?(loadfile)
+ insert_array=IO.readlines(loadfile,'')
+ file=insertion(loadfile,insert_array)
+ file[:prepared]
+ else
+ cX=SiSU_Screen::Ansi.new(@opt.cmd).cX
+ puts "\t #{cX.fuschia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuschia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}"
+ para
+ end
+ else tuned_file << para
+ end
+ tuned_file.compact!
+ end
+ if @@imager.length >0
+ @@imager.each do |d,i|
+ i.flatten!
+ i.uniq!
+ download_images(d,i)
+ end
+ end
+ tuned_file
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/concordance.rb b/lib/sisu/0.52/concordance.rb
new file mode 100644
index 00000000..5f251830
--- /dev/null
+++ b/lib/sisu/0.52/concordance.rb
@@ -0,0 +1,311 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: concordance file (html concordance, wordmap, linked index of words in document)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Concordance
+ require SiSU_lib + '/param'
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/dal'
+ include SiSU_Param
+ include SiSU_Env
+ include SiSU_Viz
+ require SiSU_lib + '/html_format_css'
+ include SiSU_HTML_Format
+ class Source
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ loc=@env.url.output_tell
+ tool=if @md.cmd =~/[MVv]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:concordance]}"
+ else ''
+ end
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"Concordance",tool)
+ tell.grey_title_hi unless @md.cmd =~/q/
+ wordmax=200000
+ unless @md.wc_words.nil?
+ if @md.wc_words < wordmax
+ SiSU_Concordance::Source::Words.new(@md).songsheet
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})")
+ tell.warn unless @md.cmd =~/q/
+ end
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words")
+ tell.warn unless @md.cmd =~/q/
+ SiSU_Concordance::Source::Words.new(@md).songsheet
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ private
+ class Doc_title
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ def initialize(lnk,md)
+ @md=md
+ @vz=SiSU_Env::Get_init.instance.skin
+ file_array=IO.readlines(@md.fns,'')
+ txt_path=%{#{@md.dir_out}}
+ SiSU_Env::Info_skin.new(@md).select
+ @md_title=@md.title
+ @fnb=@md.fnb
+ @env=SiSU_Env::Info_env.new
+ @lex_button=%{<a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" height="44" width="144" valign="center" src="../_sisu/image/sisu.png" alt="SiSU home --&gt;"></a>}
+ @lnk=lnk
+ @doc_details =<<WOK
+<table summary="links to text related to this rudimentary index" width="96%" border="0" bgcolor="white" cellpadding="0" align="center"><tr><td width="2%" align="right">&nbsp;</td><td width="94%" valign="top" align="justify"><p align="justify"><font size="3" color="#000000" face="times new roman"><a href="#{@md.fn[:manifest]}" #{@vz.js_toc}><img border="0" height="12" width="12" src="../_sisu/image/bullet_red.png" alt="Manifest">&nbsp;<b>#{@md.title}</b></a></font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:toc]}" #{@vz.js_toc}><img border="0" height="15" width="15" src="../_sisu/image/b_toc.png" alt="TOC">&nbsp;TOC - table of contents for individual articles</a></font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:doc]}" #{@vz.js_doc}><img border="0" height="15" width="15" src="../_sisu/image/b_doc.png" alt="Full Text">&nbsp;Full text (with indexed table of contents)</a></font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:pdf_p]}" #{@vz.js_portrait}><img border="0" height="18" width="15" src="../_sisu/image/b_pdf.png" alt="PDF portrait">&nbsp;pdf version of the document (portrait)</a></font></p><p><font size="3" color="#000000" face="times new roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#{@md.fn[:pdf_l]}" #{@vz.js_landscape}><img border="0" height="15" width="18" src="../_sisu/image/b_pdf.png" alt="PDF landscape">&nbsp;pdf version of the document (landscape)</a></font></p> </td></tr></table><p>Word index links are to html versions of the text the segmented version followed by the scroll (single document) version.<br />[For segmented text references [T1], [T2] or [T3] appearing without a link, indicates that the word appears in a title (or subtitle) of the text (that is identifiable by the appended object citation number).]</p>
+WOK
+ end
+ def create
+ <<WOK
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>
+ SiSU created WordIndex for: #{@md.dc_title}
+ </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <meta name="Description" content="&nbsp;SiSU created">
+ <meta name="keywords" content="word index for #{@md.dc_title}">
+ <meta name="generator" content="SiSU (Linux &amp; Ruby!)">
+ <link rel="generator" href="http://www.jus.uio.no/sisu" />
+ <link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
+ <link rel="stylesheet" href="../_sisu/css/html.css" type="text/css" />
+ #{@vz.js_head}
+</head>
+<body>
+ #{@vz.js_top}
+ <table summary="home button" width="100%" border="0" cellpadding="3" bgcolor= "#ffffff" align="center"><tr>
+ <td align="left" valign="top" bgcolor="#ffffff" width="20%">
+ #{@vz.banner_home_button_only}
+ </td>
+ <td width="80%" align="right">
+ #{@env.widget_static.search_form}
+ </td>
+ </tr></table>
+ #@doc_details<p>(The word listing/index is Case sensitive: Capitalized words appear before lower case)</p>
+ <p>
+ <b>word</b> (number of occurences)<br />linked references to word within document <br />
+ [if number of occurences exceed number of references - word occurs more than once in at least one reference. Footnote/endnotes are either assigned to the paragraph from which they are referenced or ignored, so it is relevant to check the footnotes referenced from within a paragraph as well.]
+ </p>
+ <p>
+ (After the page is fully loaded) you can jump directly to a word by appending a hash (#) and the word to the url for this text, (do not forget that words are case sensitive, and may be listed twice (starting with and without an upper case letter)), #your_word # [&nbsp;http://[web host]/#@fnb/concordance.html#your_word&nbsp;]
+ </p>
+WOK
+ end
+ end
+ class Word
+ @@word_previous=''
+ def initialize(word,freq)
+ @word,@freq=word,freq
+ end
+ def html
+ w=if @word.capitalize==@@word_previous
+ %{\n<p class="concordance_word">#@word</p><p class="concordance_count">(#@freq)</p>\n\t<p class="concordance_object"> }
+ else n=@word.strip.gsub(/\s+/,'_') #also need to convert extended character set to html
+ %{\n<p class="concordance_word"><a name="#{n}">#@word</a></p><p class="concordance_count">(#@freq)</p>\n\t<p class="concordance_object"> }
+ end
+ @@word_previous=@word.capitalize
+ w
+ end
+ end
+ class Words
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Viz
+ include SiSU_Param
+ require SiSU_lib + '/html_format_css'
+ include SiSU_HTML_Format
+ require SiSU_lib + '/vocab'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Screen
+ include Wordlists
+ @@dp=nil
+ def initialize(md)
+ begin
+ @vz=SiSU_Env::Get_init.instance.skin
+ @md=md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @path="#{@env.path.output}/#{@md.fnb}"
+ @dal_array=SiSU_DAL::Source.new(@md).get # dal file drawn here
+ @freq=Hash.new(0)
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @rxp_to=Regexp.new("<~(\\d+);(?:[oh]|[0-6]:)\\d+;\\w\\d+><#@dp:#@dp>$")
+ @rxp_lv1=Regexp.new('^1~') #line start markers removed, ('^1~') for exceptions <!pn!>\n\n4{{{
+ @rxp_lv2=Regexp.new('^2~')
+ @rxp_lv3=Regexp.new('^3~')
+ @rxp_seg=Regexp.new('^4~(.+?)\s+')
+ @rxp_title=Regexp.new('^0~title\s*(.+?)\s*$')
+ @rxp_t1=Regexp.new('^T1')
+ @rxp_t2=Regexp.new('^T2')
+ @rxp_t3=Regexp.new('^T3')
+ @rxp_excluded1=Regexp.new(/(?:https?|ftp):\/\/\S+/mi)
+ @rxp_excluded0=Regexp.new(/^(?:to\d+|\d+| \s*|&nbsp;|EOF|thumb_\S+|snap_\S+|_+|-+|\S+?_\S+|[\d_]+\w\S+|[\w\d]{1,2}|\d{1,3}\w?|ii|iii|iv|vi|vii|viii|ix|xi|xii|xiii|xiv|xv|xvi|xvii|xviii|xix|xx|#@dp|[0-9a-f]{24,64}|\d{2,3}x\d{2,3}|\S{0,2}sha\d|\S{0,3}\d{4}w\d\d|\b\w\d+|\d_all\b|e\.?g\.?)$/mi)
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ end
+ end
+ def songsheet
+ begin
+ File.mkpath(@path) unless FileTest.directory?(@path)
+ @file_index_all=File.open("#@path/#{@md.fn[:concordance]}",'w')
+ map_para
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ @file_index_all.close
+ end
+ end
+ protected
+ def location_scroll(wordlocation,show)
+ @wordlocation=wordlocation
+ %{<a href="#{@md.fnl[:pre]}doc#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}\##@wordlocation">#@wordlocation</a>; }
+ end
+ def location_seg(wordlocation,show)
+ @wordlocation,@show=wordlocation,show
+ @sfx='.html' #used for hardlinks, previous setting @sfx='', web server takes care of suffix
+ @word_location_seg=wordlocation.gsub(/(.+?)\#(\d+)/,"#{@md.fnl[:pre]}\\1#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}#\\2") unless wordlocation.nil?
+ case @wordlocation
+ when @rxp_t1
+ %{[<a href="#{@md.fnl[:pre]}doc#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}##@show">H</a>]#@show, }
+ when @rxp_t2
+ %{[<a href="#{@md.fnl[:pre]}doc#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}##@show">H</a>]#@show, }
+ when @rxp_t3
+ %{[<a href="#{@md.fnl[:pre]}doc#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}##@show">H</a>]#@show, }
+ else %{<a href="#@word_location_seg">#@show</a>, }
+ end
+ end
+ def map_para
+ @seg,toy=nil,nil
+ @word_map={}
+ wordlist=Wordlists::Lists.new
+ lesser,greater,scanlist,special=wordlist.lesser,wordlist.greater,wordlist.scanlist,wordlist.special
+ #lesser,greater,scanlist=wordlist.lesser,wordlist.greater,wordlist.scanlist
+ @dal_array.each do |line|
+ if line !~/<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/ # lines to ignore: # are added but not part of authors substantive text; 0 are mostly machine generated
+ if line =~/^0~vocabulary\s+(.+)/
+ vocab=$1
+ unless vocab =~/none/
+ load SiSU_lib + "/vocab_#{vocab}.rb"
+ lesser,greater,scanlist=wordlist.lesser,wordlist.greater,wordlist.scanlist
+ #special=wordlist.special ##KEEP did two loops
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"\tloaded vocabulary: #{vocab}")
+ tell.puts_grey unless @md.cmd =~/q/ #check
+ end
+ end
+ if line =~@rxp_seg; @seg=line[@rxp_seg,1]
+ end
+ if line =~@rxp_to; toy=line[@rxp_to,1]
+ end
+ if toy =~/\d+/ and toy !~/^0$/
+ for word in line.scan(scanlist) #%take in word or other match
+ #for word in line.scan(special) #%take in word or other match #KEEP was second loop
+ word=nil if word =~@rxp_excluded0 #watch
+ word=nil if word =~@rxp_excluded1 #watch
+ if word
+ #word.gsub!(/<\/?[i]>/,'')
+ word.gsub!(/<\/?\S+?>/,'')
+ word.strip!
+ word.gsub!(/[\.,;:"]$/,'')
+ word.gsub!(/["]/,'')
+ word.gsub!(/^\s*[\(]/,'')
+ word.gsub!(/[\(]\s*$/,'')
+ word.gsub!(/^(?:See|e\.?g\.?).+/,'')
+ word.gsub!(/^\s*[.,;:]\s*/,'')
+ word.strip!
+ word.gsub!(/^\d+(st|nd|rd|th)$/,'')
+ word.gsub!(/^(\d+\.?)+$/, '')
+ word = nil if word =~/^\s*$/ #watch
+ if word
+ word.capitalize! unless word =~/[A-Z][A-Z]/ or word =~/\w+\s\w+/
+ #word.downcase! if word =~lesser
+ #word.capitalize! if word =~greater
+ @freq[word] +=1
+ @word_map[word] ||= []
+ if line !~@rxp_lv1 and line !~@rxp_lv2 and line !~@rxp_lv3
+ @word_map[word] << location_seg("#@seg\##{toy}",toy)
+ else
+ @word_map[word] << case line
+ when @rxp_lv1; location_seg('T1',toy)
+ when @rxp_lv2; location_seg('T2',toy)
+ when @rxp_lv3; location_seg('T3',toy)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ scr='<font size="1" color="#777777" face=times new roman><img border="0" height="15" width="15" src="../_sisu/image/b_doc.png" alt="Full Text">&nbsp;scroll:&nbsp;</font><font size="1" color="#222222" face=times new roman>doc#&nbsp;</font> '
+ seg=''
+ @file_index_all << SiSU_Concordance::Source::Doc_title.new('toc',@md).create
+ for word in @freq.keys.sort! {|a,b| a.downcase<=>b.downcase}
+ keyword=SiSU_Concordance::Source::Word.new(word,@freq[word]).html
+ if keyword !~ @rxp_excluded0
+ if @word_map[word][0] =~ /\d+/
+ wm=[]
+ @file_index_all << %{#{keyword}#{seg}#{@word_map[word].uniq.compact}}
+ end
+ @file_index_all << '</p>'
+ end
+ # special cases endnotes and header levels 1 - 3
+ end
+ credits=@vz.credits_splash
+ @file_index_all << "#{credits}</body>\n</html>" # footer
+ tell=SiSU_Screen::Ansi.new(@md.cmd,@md.fns,"#{@env.path.output_tell}/#{@md.fn[:concordance]}")
+ tell.flow if @md.cmd =~/[MV]/
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/conf.rb b/lib/sisu/0.52/conf.rb
new file mode 100644
index 00000000..192ffe2f
--- /dev/null
+++ b/lib/sisu/0.52/conf.rb
@@ -0,0 +1,245 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: configuration
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Initialize
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Screen
+ require SiSU_lib + '/relaxng'
+ include SiSU_relaxng
+ require SiSU_lib + '/css'
+ include SiSU_Style
+ class Source
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ SiSU_Config.new(@opt).make_homepage
+ SiSU_Config.new(@opt).css
+ SiSU_Config.new(@opt).dtd
+ SiSU_Config.new(@opt).cp_local_images
+ SiSU_Config.new(@opt).cp_external_images
+ SiSU_Config.new(@opt).cp_webserver_images if @opt.mod.inspect =~/--init(?:ialize)?=site/
+ end
+ end
+ class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier
+ require 'fileutils'
+ require SiSU_lib + '/sysenv'
+ include FileUtils #::Verbose
+ def initialize(opt)
+ @opt=opt
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @suffix,@path={},{}
+ @suffix[:rnc]='rnc'
+ @suffix[:rng]='rng'
+ @suffix[:xsd]='xsd'
+ @path[:xml]= @env.path.output + '/_sisu/xml'
+ @path[:xsd]= @env.path.output + '/_sisu/xml/xsd'
+ @path[:rnc]= @env.path.output + '/_sisu/xml/rnc'
+ @path[:rng]= @env.path.output + '/_sisu/xml/rng'
+ #@path_dtd= @env.path.output + '/_sisu/dtd'
+ @pwd,@home=Dir.pwd,@env.path.home
+ end
+ def make_homepage
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Make homepage','')
+ tell.colorize unless @opt.cmd =~/q/
+ SiSU_Env::Create_site.new(@opt.cmd).homepage
+ end
+ def cp_local_images
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy images','')
+ tell.colorize unless @opt.cmd =~/q/
+ SiSU_Env::Create_site.new(@opt.cmd).cp_local_images
+ SiSU_Env::Create_site.new(@opt.cmd).cp_base_images #base images (nav etc.) used by all html
+ end
+ def cp_external_images
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy external images','')
+ tell.colorize if @opt.cmd =~/V/
+ SiSU_Env::Create_site.new(@opt.cmd).cp_external_images
+ end
+ def cp_webserver_images
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy webserver/output file images','')
+ tell.colorize unless @opt.cmd =~/q/
+ SiSU_Env::Create_site.new(@opt.cmd).cp_webserver_images
+ end
+ def css
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring CSSs','')
+ tell.colorize unless @opt.cmd =~/q/
+ SiSU_Env::Create_site.new(@opt.cmd).cp_css
+ end
+ def dtd
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring DTDs','')
+ tell.colorize unless @opt.cmd =~/q/
+ @rxng=SiSU_relaxng::RelaxNG.new
+ @path.each { |d| File.mkpath(d[1]) unless FileTest.directory?(d[1]) }
+ #ugly code, sort later
+ if @rxng.methods.join =~/[^_]dtd_sax\b/
+ if @rxng.dtd_sax.length > 200
+ dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.output_sax}",'w')
+ dtd << @rxng.dtd_sax
+ dtd.close
+ else trang_rnc_model_output_sax
+ end
+ else trang_rnc_model_output_sax
+ end
+ if @rxng.methods.join =~/[^_]dtd_dom\b/
+ if @rxng.dtd_dom.length > 200
+ dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.output_dom}",'w')
+ dtd << @rxng.dtd_dom
+ dtd.close
+ else trang_rnc_model_output_dom
+ end
+ else trang_rnc_model_output_dom
+ end
+ if @rxng.methods.join =~/[^_]dtd_node\b/
+ if @rxng.dtd_node.length > 200
+ dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.input_node}",'w')
+ dtd << @rxng.dtd_node
+ dtd.close
+ else trang_rnc_model_input_node
+ end
+ else trang_rnc_model_input_node
+ end
+ if @rxng.methods.join =~/[^_]dtd_xhtml\b/
+ if @rxng.dtd_xhtml.length > 200
+ #use dtd
+ dtd=File.new("#{@env.path.output}/#{@env.path.style}/#{@rxng.rng_name.output_xhtml}",'w')
+ dtd << @rxng.dtd_xhtml
+ dtd.close
+ else trang_rnc_model_output_xhtml
+ end
+ else trang_rnc_model_output_xhtml
+ end
+ end
+ def trang_rnc_model_output_sax
+ s=@suffix
+ rnc_src=@env.path.dal + '/sax.' + s[:rnc]
+ rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_sax
+ rng_file=@path[:rng] + '/' + @rxng.rng_name.output_sax
+ xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_sax
+ rnc=File.new(rnc_src,'w')
+ rnc << @rxng.rnc_model_output_sax
+ rnc.close
+ #xsd
+ schema=SiSU_Env::System_call.new(rnc_src,xsd_file)
+ schema.relaxng(@opt.cmd)
+ #rng
+ schema=SiSU_Env::System_call.new(rnc_src,rng_file)
+ schema.relaxng(@opt.cmd)
+ #rnc
+ cp(rnc_src,rnc_file)
+ chmod(0644,rnc_file)
+ end
+ def trang_rnc_model_output_dom
+ s=@suffix
+ rnc_src=@env.path.dal + '/dom.' + s[:rnc]
+ rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_dom
+ rng_file=@path[:rng] + '/' + @rxng.rng_name.output_dom
+ xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_dom
+ rnc=File.new(rnc_src,'w')
+ rnc << @rxng.rnc_model_output_dom
+ rnc.close
+ #xsd
+ schema=SiSU_Env::System_call.new(rnc_src,xsd_file)
+ schema.relaxng(@opt.cmd)
+ #rng
+ schema=SiSU_Env::System_call.new(rnc_src,rng_file)
+ schema.relaxng(@opt.cmd)
+ #rnc
+ cp(rnc_src,rnc_file)
+ chmod(0644,rnc_file)
+ end
+ def trang_rnc_model_output_xhtml
+ s=@suffix
+ rnc_src=@env.path.dal + '/xhtml.' + s[:rnc]
+ rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_xhtml
+ rng_file=@path[:rng] + '/' + @rxng.rng_name.output_xhtml
+ xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_xhtml
+ rnc=File.new(rnc_src,'w')
+ rnc << @rxng.rnc_model_output_xhtml
+ rnc.close
+ #xsd
+ schema=SiSU_Env::System_call.new(rnc_src,xsd_file)
+ schema.relaxng(@opt.cmd)
+ #rng
+ schema=SiSU_Env::System_call.new(rnc_src,rng_file)
+ schema.relaxng(@opt.cmd)
+ #rnc
+ cp(rnc_src,rnc_file)
+ chmod(0644,rnc_file)
+ end
+ def trang_rnc_model_input_sax
+ rnc_file=@env.path.dal + '/sax.rnc'
+ dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_sax
+ rnc=File.new(rnc_file,'w')
+ rnc << @rxng.rnc_model_output_sax
+ rnc.close
+ schema=SiSU_Env::System_call.new(rnc_file,dtd_file)
+ schema.relaxng(@opt.cmd)
+ end
+ def trang_rnc_model_input_dom
+ rnc_file=@env.path.dal + '/dom.rnc'
+ dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_dom
+ rnc=File.new(rnc_file,'w')
+ rnc << @rxng.rnc_model_output_dom
+ rnc.close
+ schema=SiSU_Env::System_call.new(rnc_file,dtd_file)
+ schema.relaxng(@opt.cmd)
+ end
+ def trang_rnc_model_input_node
+ rnc_file=@env.path.dal + '/node.rnc'
+ rng_file=@env.path.dal + '/node.rng'
+ dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_node
+ rnc=File.new(rnc_file,'w')
+ rnc << @rxng.rnc_model_input_node
+ rnc.close
+ schema=SiSU_Env::System_call.new(rnc_file,dtd_file)
+ schema.relaxng(@opt.cmd)
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/css.rb b/lib/sisu/0.52/css.rb
new file mode 100644
index 00000000..47f7e375
--- /dev/null
+++ b/lib/sisu/0.52/css.rb
@@ -0,0 +1,1939 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: css stylesheets
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Style
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/defaults'
+ class CSS
+ def initialize
+ @vz=SiSU_Env::Get_init.instance.skin
+ #@vz=SiSU_Viz::Skin.new
+ end
+ def fonts
+ @vz.font_fonts
+ end
+ def html_tables #stylesheet for css table_pages
+<<WOK
+/* SiSU table output stylesheet */
+ body {
+ color: black;
+ background: #{@vz.color_white};
+ }
+ p {
+ display: block;
+ line-height: 1.5;
+ font-family: #{fonts};
+ }
+ a:link {
+ color: #{@vz.color_blue_ink};
+ text-decoration: none;
+ }
+ a:visited {
+ color: #{@vz.color_blue_ink};
+ text-decoration: none;
+ /* background-color: #{@vz.color_blue_tinge}; */
+ }
+ a:hover {
+ color: #{@vz.color_black};
+ text-decoration: underline;
+ background-color: #{@vz.color_yellow_light};
+ }
+ a:active {
+ color: #{@vz.color_blue_ink};
+ text-decoration: underline;
+ }
+WOK
+ end
+ def html #stylesheet for css html pages == html.css
+<<WOK
+/* SiSU css default stylesheet */
+ body {
+ color: black;
+ background: #{@vz.color_white};
+ }
+/*
+ table {
+ margin-left: 5%;
+ display: block;
+ }
+ tr {
+ display: block;
+ }
+ th, td {
+ display: inline;
+ }
+*/
+ a:link {
+ color: #{@vz.color_blue_ink};
+ text-decoration: none;
+ }
+ a:visited {
+ color: #{@vz.color_blue_ink};
+ text-decoration: none;
+ }
+/*
+ a:hover {
+ color: #{@vz.color_black};
+ border-bottom: 2px solid #777777;
+ background-color: #{@vz.color_yellow_light};
+ }
+*/
+ a:hover img {
+ background-color: #{@vz.color_white};
+ }
+ a:active {
+ color: #{@vz.color_blue_ink};
+ text-decoration: underline;
+ }
+ div {
+ margin-left: 0;
+ margin-right: 0;
+ }
+ div.p {
+ margin-left: 5%;
+ margin-right: 1%;
+ }
+ #top_band {
+ position: absolute;
+ top: 0;
+ bottom: 80px;
+ width: 100%;
+ }
+ #top_band_search {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ margin-left: 75%;
+ width: 20%;
+ }
+ #column_left {
+ position: absolute;
+ top: 80px;
+ left: 0;
+ margin-left: 0;
+ width: 20%;
+ }
+ #column_center {
+ position: absolute;
+ top: 80px;
+ margin-left: 20%;
+ width: 55%;
+ }
+ #column_right {
+ position: absolute;
+ top: 80px;
+ right: 0px;
+ margin-left: 75%;
+ width: 25%;
+ }
+ #pane_major {
+ position: absolute;
+ top: 0px;
+ left: 0;
+ margin-left: 0;
+ width: 80%;
+ }
+ #pane_minor {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ margin-left: 75%;
+ width: 20%;
+ }
+ p {
+ display: block;
+ font-family: #{fonts};
+ font-size: 100%;
+ font-weight: normal;
+ line-height: 150%;
+ text-align: left;
+ margin-left: 10mm;
+ text-indent: 0mm;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ margin-right: 5mm;
+ }
+ p.norm {
+ text-align: justify;
+ }
+ p.code {
+ font-family: monospace;
+ text-align: left;
+ }
+ p.caption {
+ text-align: left;
+ font-size: 80%;
+ display: inline;
+ }
+ p.endnote {
+ font-family: #{fonts};
+ font-size: 96%;
+ font-weight: normal;
+ line-height: 120%;
+ text-align: left;
+ margin-left: 10mm;
+ text-indent: 0mm;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ margin-right: 15mm;
+ }
+ p.endnote_indent {
+ font-family: #{fonts};
+ font-size: 96%;
+ font-weight: normal;
+ line-height: 120%;
+ text-align: left;
+ margin-left: 15mm;
+ text-indent: 0mm;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ margin-right: 15mm;
+ }
+ p.center {
+ text-align: center;
+ }
+ p.bold {
+ font-weight: bold;
+ }
+ p.centerbold {
+ text-align: center;
+ font-weight: bold;
+ }
+ p.em {
+ font-weight: bold;
+ font-style: normal;
+ background: #fff3b6;
+ }
+ p.ocn, p.paranum {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 5px;
+ color: #777777;
+ margin-right: 5px;
+ text-align: right;
+ }
+ p.ocn_off, p.no_paranum {
+ display: none;
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 5px;
+ color: #777777;
+ margin-right: 5px;
+ text-align: right;
+ }
+ p.small {
+ font-size: 80%;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-right: 6px;
+ text-align: left;
+ }
+ p.tiny {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ margin-right: 6px;
+ text-align: left;
+ }
+ p.tiny_left {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-align: left;
+ }
+ p.tiny_right {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ margin-right: 5mm;
+ text-align: right;
+ }
+ p.pane {
+ font-size: 80%;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-left: 2mm;
+ margin-right: 4px;
+ text-align: left;
+ }
+ p.pane_title {
+ font-weight: bold;
+ font-size: 80%;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-left: 2mm;
+ margin-right: 4px;
+ text-align: left;
+ }
+ p.pane_blurb {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-left: 2mm;
+ margin-right: 4px;
+ text-align: left;
+ }
+ p.pane_link {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-left: 4mm;
+ margin-right: 4px;
+ text-align: left;
+ }
+ p.pane_indent {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-left: 4mm;
+ margin-right: 4px;
+ text-align: left;
+ }
+ p.concordance_word {
+ line-height: 150%;
+ font-weight: bold;
+ display: inline;
+ margin-top: 4px;
+ margin-bottom: 1px;
+ }
+ p.concordance_count {
+ font-size: 80%;
+ color: #777777;
+ display: inline;
+ margin-left: 0mm;
+ text-indent: 0mm;
+ }
+ p.concordance_object {
+ font-size: 80%;
+ font-weight: normal;
+ line-height: 120%;
+ text-align: left;
+ margin-left: 15mm;
+ text-indent: 0mm;
+ margin-top: 1px;
+ margin-bottom: 3px;
+ }
+ p.quickref{
+ font-size: 10px;
+ font-style: italic;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ margin-right: 5px;
+ text-align: left;
+ }
+ p.bigref{
+ font-size: 11px;
+ font-weight: bold;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ margin-right: 5px;
+ text-align: center;
+ }
+ p.i1 {margin-left: 20mm;}
+ p.i2 {margin-left: 25mm;}
+ p.i3 {margin-left: 30mm;}
+ p.i4 {margin-left: 35mm;}
+ p.i5 {margin-left: 40mm;}
+ p.i6 {margin-left: 45mm;}
+
+ table { }
+ tr { }
+ th, td { }
+ p.left, th.left, td.left {
+ text-align: left;
+ }
+ p.right, th.right, td.right {
+ text-align: right;
+ }
+
+ h1, h2, h3, h4, h5, h6 {
+ display: block;
+ font-family: #{fonts};
+ font-weight: bold;
+ line-height: 120%;
+ margin-left: 10mm;
+ margin-right: 10mm;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ h1.center, h2.center, h3.center, h4.center, h5.center, h6.center {
+ text-align: center;
+ }
+ ul {
+ list-style: none;
+ }
+ ul.horizontal {
+ list-style: none;
+ }
+ ul.vertical {
+ list-style: none;
+ }
+ li {
+ background: url(../image/bullet_red.png) no-repeat 0px 6px;
+ padding-left: 20px;
+ display: block;
+ font-family: #{fonts};
+ /* font-size: 100%; */
+ font-weight: normal;
+ line-height: 100%;
+ text-align: left;
+ margin-left: 10mm;
+ text-indent: 0mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-right: 5mm;
+ }
+ li.bullet {
+ line-height: 150%;
+ margin-left: 0mm;
+ margin-right: 0mm;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ }
+ li.i1 {
+ margin-left: 20mm;
+ line-height: 150%;
+ margin-left: 5mm;
+ margin-right: 5mm;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ }
+ li.i2 {
+ margin-left: 30mm;
+ line-height: 150%;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ }
+ #horizontal_links {
+ background: #eeeeee;
+ margin-left: 5%;
+ margin-right: 5%;
+ }
+ #horizontal {
+ margin: 0;
+ padding: 0 0 0 10px;
+ border-top: 1px solid #000077;
+ border-bottom: 1px solid #000077;
+ }
+ #horizontal li {
+ margin: 0 0 0 0;
+ padding: 0 16px 0 0;
+ display: inline;
+ list-style-type: none;
+ text-align: left;
+ background: none;
+ }
+ #horizontal a {
+ /* font-weight: normal; */
+ /* float: left; */
+ line-height: 12px;
+ margin: 0 0 0 0;
+ text-decoration: none;
+ color: #000077;
+ }
+ #horizontal a.active, #horizontal a:hover {
+ border-bottom: 2px solid #777777;
+ padding-bottom: 2px;
+ /* font-weight: bold; */
+ color: #000077;
+ }
+ #horizontal a:hover {
+ color: #000077;
+ }
+ #document_versions {
+ position: absolute;
+ top: 10mm;
+ right: 2%;
+ width: 12%;
+ /* background: #ffffff; */
+ float: right;
+ }
+ #vertical_links {
+ position: absolute;
+ top: 10mm;
+ right: 0px;
+ width: 20%;
+ background: #dddddd;
+ float: right;
+ }
+ #vertical {
+ /* background: none; */
+ padding: 0 12px 0px 0px;
+ /* border-top: 2px solid #000077; */
+ /* border-bottom: 2px solid #000077; */
+ /* margin-left: 33%; */
+ margin-left: 2%;
+ margin-right: 2%;
+ }
+/*
+ #vertical {
+ padding: 0 12px 0px 0px;
+ border-top: 2px solid #000077;
+ border-bottom: 2px solid #000077;
+ margin-left: 33%;
+ margin-right: 33%;
+ } */
+ #vertical li {
+ display: block;
+ list-style-type: none;
+ }
+ #vertical a {
+ /* font-weight: normal; */
+ line-height: 12px;
+ text-decoration: none;
+ color: #000077;
+ }
+ #vertical a.active, #vertical a:hover {
+ border-bottom: 2px solid #777777;
+ padding-bottom: 2px;
+ /* font-weight: bold; */
+ color: #000077;
+ }
+ li.doc {
+ background: url(../image/bullet_doc.png) no-repeat 0 0;
+ padding-left: 16px;
+ margin-left: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-right: 0px;
+ font-size: 8px;
+ font-style: normal;
+ text-align: left;
+ }
+ li.ref {
+ background: none;
+ padding-left: 0;
+ margin-left: 0;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ font-size: 8px;
+ font-style: normal;
+ text-align: left;
+ }
+ li.refcenter {
+ /* background: url(../image/bullet_doc.png) no-repeat 0 0; */
+ background: none;
+ padding-left: 20px;
+ margin-left: 10%;
+ font-size: 9px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ text-align: center;
+ }
+ li.refbold {
+ background: url(../image/bullet_doc.png) no-repeat 0 0;
+ /* padding-left: 0px; */
+ padding-left: 16px;
+ margin-left: 0;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-right: 10mm;
+ font-size: 8px;
+ font-weight: bold;
+ text-align: left;
+ }
+ h1 {
+ font-size: 120%;
+ margin-top: 20px;
+ }
+ h2 {
+ font-size: 115%;
+ margin-top: 20px;
+ }
+ h3 {
+ font-size: 110%;
+ margin-top: 20px;
+ }
+ h4 {
+ font-size: 105%;
+ }
+ h5 {
+ font-size: 100%;
+ }
+ h6 {
+ font-size: 100%;
+ }
+ h1.norm, h2.norm, h3.norm {
+ font-size: 110%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ h1.top_band {
+ display: inline;
+ text-align: left;
+ margin-top: 0;
+ margin-left: 4mm;
+ text-indent: 0mm;
+ font-weight: bold;
+ font-size: 120%;
+ }
+ h2.top_band_tiny {
+ font-size: 10px;
+ font-weight: normal;
+ margin-top: 0px;
+ margin-left: 4mm;
+ text-indent: 0mm;
+ margin-bottom: 0px;
+ color: #777777;
+ margin-left: 140px;
+ margin-right: 0px;
+ text-align: left;
+ }
+ p.top_band {
+ display: inline;
+ text-align: left;
+ margin-top: 0;
+ margin-left: 140px;
+ text-indent: 0mm;
+ font-weight: bold;
+ font-size: 120%;
+ }
+ p.top_band_tiny {
+ font-size: 10px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ color: #777777;
+ margin-left: 140px;
+ margin-right: 0px;
+ text-align: left;
+ }
+ p.top_band_image {
+ float: left;
+ display: inline;
+ text-align: left;
+ margin-top: 0;
+ margin-left: 1mm;
+ text-indent: 0mm;
+ margin-right: 1mm;
+ }
+ h4.norm, h5.norm, h6.norm {
+ font-size: 100%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ text-align: left;
+ margin-top: 10px;
+ margin-bottom: 0px;
+ }
+ h1.i {margin-left: 10mm;}
+ h2.i {margin-left: 15mm;}
+ h3.i {margin-left: 20mm;}
+ h4.i {margin-left: 25mm;}
+ h5.i {margin-left: 30mm;}
+ h6.i {margin-left: 35mm;}
+ h1.banner {
+ font-weight: bold;
+ text-align: center;
+ font-size: 120%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ h1.subbanner {
+ font-weight: bold;
+ text-align: center;
+ font-size: 115%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ h2.banner {
+ font-weight: bold;
+ text-align: center;
+ font-size: 110%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ h3.banner {
+ font-weight: bold;
+ text-align: center;
+ color: #990000;
+ font-size: 105%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ h4.banner {
+ font-weight: bold;
+ text-align: center;
+ color: #ff0000;
+ font-size: 100%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ h5.banner {
+ font-weight: bold;
+ }
+ h6.banner {
+ font-weight: bold;
+ }
+ h1.toc {
+ margin-left: 0mm;
+ font-size: 115%;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ line-height: 150%;
+ }
+ h2.toc {
+ margin-left: 5mm;
+ font-size: 110%;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ line-height: 140%;
+ }
+ h3.toc {
+ margin-left: 10mm;
+ font-size: 105%;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ line-height: 120%;
+ }
+ h4.toc {
+ margin-left: 15mm;
+ font-weight: normal;
+ font-size: 100%;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ line-height: 120%;
+ }
+ h5.toc {
+ margin-left: 20mm;
+ font-weight: normal;
+ font-size: 95%;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ line-height: 110%;
+ }
+ h6.toc {
+ margin-left: 25mm;
+ font-weight: normal;
+ font-size: 90%;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ line-height: 110%;
+ }
+/* microtoc (for later) --> */
+ h1.microtoc {
+ margin-left: 0mm;
+ font-size: 115%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ }
+ h2.microtoc {
+ margin-left: 5mm;
+ font-size: 110%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ }
+ h3.microtoc {
+ margin-left: 10mm;
+ font-size: 105%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ }
+ h4.microtoc {
+ margin-left: 15mm;
+ font-weight: normal;
+ font-size: 100%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ }
+ h5.microtoc {
+ margin-left: 20mm;
+ font-weight: normal;
+ font-size: 95%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ }
+ h6.microtoc {
+ margin-left: 25mm;
+ font-weight: normal;
+ font-size: 90%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ }
+/* subtoc --> */
+ h5.subtoc {
+ margin-left: 20mm;
+ margin-right: 34%;
+ font-weight: normal;
+ font-size: 80%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ }
+ h6.subtoc {
+ margin-left: 25mm;
+ margin-right: 34%;
+ font-weight: normal;
+ font-size: 75%;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c {
+ text-align: center
+ }
+ h1.red, h2.red, h3.red, h4.red, h5.red, h6.red {
+ text-align: center;
+ color: #ff0000;
+ margin-left: 5mm;
+ text-indent: 5mm;
+ margin-top: 30px;
+ margin-bottom: 20px;
+ margin-right: 15mm;
+ }
+ h1.ruby, h2.ruby, h3.ruby, h4.ruby, h5.ruby, h6.ruby {
+ text-align: center;
+ color: #990000;
+ margin-left: 5mm;
+ text-indent: 5mm;
+ margin-top: 30px;
+ margin-bottom: 20px;
+ margin-right: 15mm;
+ }
+/*
+ table.hidden {
+ color: #ffffff;
+ text-decoration: none;
+ }
+ td.hidden {
+ color: #ffffff;
+ background-color: #000000;
+ }
+ td.hidden a.active, div.hidden a:hover {
+ color: #ffffff;
+ background-color: #000000;
+ }
+ td.hidden a:hover {
+ text-decoration: none;
+ }
+ div.hidden a {
+ line-height: 12px;
+ margin: 0 0 0 0;
+ text-decoration: none;
+ color: #000077;
+ }
+ div.hidden a.active, div.hidden a:hover {
+ text-decoration: none;
+ }
+ div.hidden a:hover {
+ text-decoration: none;
+ }
+*/
+WOK
+ end
+ def homepage #stylesheet for index, home page
+<<WOK
+ body {color: black; background: #{@vz.color_white}; margin:10px 10px 0px 10px; padding:0px;}
+ p { line-height: 1.5 }
+ a:link {color: #{@vz.color_blue_ink}; text-decoration: none; }
+ a:visited {color: #{@vz.color_blue_ink}; text-decoration: none; }
+ a:hover {color: #{@vz.color_black}; text-decoration: underline; background-color: #{@vz.color_yellow_light};}
+ a:active {color: #{@vz.color_blue_ink}; text-decoration: underline;}
+ #banner {
+ background:#{@vz.color_white};
+ }
+ #column_left {
+ width:25%;
+ float:left;
+ background:#b9d4dd;
+ padding-bottom:10px;
+ }
+ #column_center {
+ width:55%;
+ float:left;
+ background:#{@vz.color_white};
+ padding-bottom:10px;
+ }
+ #column_right {
+ width:20%;
+ float:left;
+ background:#b9d4dd;
+ padding-bottom:10px;
+ }
+ p,h1,pre {
+ font-family: #{fonts};
+ margin:0px 10px 10px 10px;
+ }
+ h1 {
+ font-size:14px;
+ padding-top:10px;
+ }
+ #column_right p { font-size:12px}
+ #banner h1 { margin:0px; padding:10px}
+WOK
+ end
+ def html_bk #stylesheet for html... check use
+<<WOK
+ document {
+ display: block;
+ margin-left: 0mm;
+ margin-right: 0mm;
+ }
+ head {
+ display: block;
+ margin-bottom: 20px;
+ background-color: #dddddd;
+ }
+ dc,keywords,copyright {
+ display: block;
+ font-family: #{fonts};
+ color: blue;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small%;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ keywords,copyright {
+ display: block;
+ font-family: #{fonts};
+ color: red;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small%;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ table {
+ margin-left: 5%;
+ display: block;
+ }
+ tr {
+ display: block;
+ }
+ th, td {
+ display: inline;
+ }
+ th.left {
+ text-align: left;
+ }
+ td.right {
+ text-align: right;
+ }
+ body {
+ color: black;
+ background: #ffffff;
+ }
+ a:link {
+ color: #003399;
+ text-decoration: none;
+ }
+ a:visited {
+ color: #003399;
+ text-decoration: none;
+ /* background-color: #e3ecef; */
+ }
+ a:hover {
+ color: #000000;
+ text-decoration: underline;
+ background-color: #fff3b6;
+ }
+ a:hover IMG {
+ background-color: #ffffff;
+ }
+ a:active {
+ color: #003399;
+ text-decoration: underline;
+ }
+ p {
+ display: block;
+ font-family: #{fonts};
+ font-weight: normal;
+ text-align: justify;
+ font-size: 100%;
+ line-height: 150%;
+ margin-left: 5%;
+ margin-right: 5%;
+ margin-top: 2px;
+ margin-bottom: 0px;
+ }
+ p.norm {
+ }
+ p.h1 {
+ font-family: #{fonts};
+ font-size: 120%;
+ font-weight: bold;
+ text-align: left;
+ line-height: 120%;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ p.h2 {
+ font-weight: bold;
+ font-size: 110%;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ p.h3 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ p.h4 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ p.h5 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ p.h6 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ p.toc1 {
+ font-weight: bold;
+ font-size: small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 5%;
+ margin-right: 5%;
+ margin-top: 10px;
+ margin-bottom: 5px;
+ }
+ p.toc2 {
+ font-weight: bold;
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 5%;
+ margin-right: 10%;
+ margin-top: 10px;
+ margin-bottom: 5px;
+ }
+ p.toc3 {
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 5%;
+ margin-right: 10%;
+ margin-top: 10px;
+ margin-bottom: 5px;
+ }
+ p.toc4 {
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 10%;
+ margin-right: 10%;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+ p.toc5 {
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 15%;
+ margin-right: 10%;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+ p.toc6 {
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 20%;
+ margin-right: 10%;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+/* microtoc for use later --> */
+/*
+
+*/
+/* subtoc --> */
+ p.subtoc4 {
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 10%;
+ margin-right: 10%;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+ p.subtoc5 {
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 15%;
+ margin-right: 10%;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+ p.subtoc6 {
+ font-size: x-small;
+ text-align: left;
+ line-height: 100%;
+ margin-left: 20%;
+ margin-right: 10%;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+ p.ocn {
+ display: block;
+ text-align: right;
+ vertical-align: super;
+ color: #999999;
+ font-size: xx-small;
+ margin-right: 0mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ p.note {
+ display: block;
+ font-size: small;
+ font-family: #{fonts};
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 10%;
+ margin-right: 5%;
+ margin-top: 4px;
+ margin-bottom: 0px;
+ }
+ en {
+ font-size: xx-small;
+ vertical-align: super;
+ }
+ i { font-style: italic; }
+ b { font-style: bold; }
+ u { text-decoration: underline; }
+ br { display: block; }
+WOK
+ end
+ def xhtml #stylesheet for xhtml
+<<WOK
+/* SiSU css xhtml & sax.xml default style */
+ document {
+ display: block;
+ margin-left: 0mm;
+ margin-right: 0mm;
+ }
+ head {
+ display: block;
+ margin-bottom: 20px;
+ background-color: #dddddd;
+ }
+ meta {
+ display: inline;
+ line-height: 1;
+ font-size: 10px;
+ color: #990000;
+ margin-right: 2mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+
+ }
+ title,subtitle,creator,author,translator,translated_by,illustrator,illustrated_by,prepared_by,digitized_by,type,subject,description,contributor,publisher,format,identifier,source,language,relation,coverage,rights,keywords,comment,comments,abastract,tags,catalogue,date,date_created,date_issued,date_available,date_modified,date_valid,structure,sc {
+ display: inline;
+ line-height: 1;
+ font-size: 10px;
+ color: #000099;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ source_control {
+ display: block;
+ }
+ dc {
+ display: block;
+ font-family: #{fonts};
+ color: blue;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ sc {
+ display: inline;
+ color: green;
+ }
+ keywords,copyright {
+ display: block;
+ font-family: #{fonts};
+ color: red;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ table {
+ margin-left: 5%;
+ display: block;
+ }
+ tr {
+ display: block;
+ }
+ th,td {
+ display: inline;
+ }
+ body {
+ color: black;
+ background: #ffffff;
+ }
+ a:link {
+ color: #003399;
+ text-decoration: none;
+ }
+ a:visited {
+ color: #003399;
+ text-decoration: none;
+ /* background-color: #e3ecef; */
+ }
+ a:hover {
+ color: #000000;
+ text-decoration: underline;
+ background-color: #fff3b6;
+ }
+ a:hover IMG {
+ background-color: #ffffff;
+ }
+ a:active {
+ color: #003399;
+ text-decoration: underline;
+ }
+ object {
+ display: block;
+ margin-left: 2mm;
+ margin-right: 2mm;
+ margin-top: 4px;
+ margin-bottom: 8px;
+ }
+ text,text[class|="norm"] {
+ display: block;
+ font-family: #{fonts};
+ text-align: justify;
+ font-weight: normal;
+ font-size: 100%;
+ line-height: 150%;
+ margin-left: 5%;
+ margin-right: 5%;
+ margin-top: 2px;
+ margin-bottom: 0px;
+ }
+ text[class|="h1"] {
+ font-size: 120%;
+ font-weight: bold;
+ text-align: left;
+ line-height: 120%;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ text[class|="h2"] {
+ font-weight: bold;
+ font-size: 110%;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ text[class|="h3"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="h4"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="h5"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="h6"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="indent1"] {
+ margin-left: 10%;
+ }
+ text[class|="indent2"] {
+ margin-left: 15%;
+ }
+ text[class|="verse"], text[class|="group"], text[class|="code"] {
+ text-align: left;
+ }
+ ocn {
+ display: block;
+ text-align: right;
+ vertical-align: super;
+ color: #990000;
+ font-size: xx-small;
+ margin-right: 0mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ endnote {
+ display: block;
+ font-size: small;
+ font-family: #{fonts};
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 10%;
+ margin-right: 5%;
+ margin-top: 4px;
+ margin-bottom: 0px;
+ }
+ endnote_indent {
+ display: block;
+ font-size: small;
+ font-family: #{fonts};
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 15%;
+ margin-right: 5%;
+ margin-top: 4px;
+ margin-bottom: 0px;
+ }
+ en {
+ font-size: xx-small;
+ vertical-align: super;
+ }
+ i { font-style: italic; }
+ b { font-style: bold; }
+ u { text-decoration: underline; }
+ br { display: block; }
+WOK
+ end
+ def xml_sax #stylesheet for xml sax
+ xhtml
+ end
+ def xml_dom #sylesheet for xml dom, work on, starts from copy of css_xhtml
+<<WOK
+/* SiSU css dom.xml default style */
+ document {
+ display: block;
+ margin-left: 0mm;
+ margin-right: 0mm;
+ }
+ head {
+ display: block;
+ margin-bottom: 20px;
+ background-color: #dddddd;
+ }
+ header {
+ display: block;
+ }
+ meta {
+ display: inline;
+ line-height: 1;
+ font-size: 10px;
+ color: #990000;
+ margin-right: 2mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+
+ }
+ title,subtitle,creator,author,translator,translated_by,illustrator,illustrated_by,prepared_by,digitized_by,type,subject,description,contributor,publisher,format,identifier,source,language,relation,coverage,rights,keywords,comment,comments,abastract,tags,catalogue,date,date_created,date_issued,date_available,date_modified,date_valid,structure,sc {
+ display: inline;
+ line-height: 1;
+ font-size: 10px;
+ color: #000099;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ source_control {
+ display: block;
+ }
+ dc {
+ display: block;
+ font-family: #{fonts};
+ color: blue;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ sc {
+ display: inline;
+ color: green;
+ }
+ keywords,copyright {
+ display: block;
+ font-family: #{fonts};
+ color: red;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ body {
+ color: black;
+ background: #ffffff;
+ }
+ a:link {
+ color: #003399;
+ text-decoration: none;
+ }
+ a:visited {
+ color: #003399;
+ text-decoration: none;
+ /* background-color: #e3ecef; */
+ }
+ a:hover {
+ color: #000000;
+ text-decoration: underline;
+ background-color: #fff3b6;
+ }
+ a:hover IMG {
+ background-color: #ffffff;
+ }
+ a:active {
+ color: #003399;
+ text-decoration: underline;
+ }
+ object {
+ display: block;
+ margin-left: 2mm;
+ margin-right: 2mm;
+ margin-top: 4px;
+ margin-bottom: 8px;
+ }
+ heading {
+ font-weight: bold;
+ }
+ contents {
+ font-weight: normal;
+ }
+ text {
+ display: block;
+ font-family: #{fonts};
+ text-align: justify;
+ font-size: 100%;
+ line-height: 150%;
+ margin-left: 5%;
+ margin-right: 5%;
+ margin-top: 2px;
+ margin-bottom: 0px;
+ }
+ text[class|="norm"] {
+ font-weight: normal;
+ }
+ text[class|="h1"] {
+ font-size: 120%;
+ font-weight: bold;
+ text-align: left;
+ line-height: 120%;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ text[class|="h2"] {
+ font-weight: bold;
+ font-size: 110%;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ text[class|="h3"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="h4"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="h5"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="h6"] {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ text[class|="indent1"] {
+ margin-left: 10%;
+ }
+ text[class|="indent2"] {
+ margin-left: 15%;
+ }
+ text[class|="verse"], text[class|="group"], text[class|="code"] {
+ text-align: left;
+ }
+ table {
+ margin-left: 5%;
+ display: block;
+ }
+ tr {
+ display: block;
+ }
+ th, td {
+ display: inline;
+ }
+ nametag {
+ display: none;
+ }
+ number {
+ padding-right: 4px;
+ }
+ ocn {
+ font-weight: normal;
+ display: block;
+ text-align: right;
+ vertical-align: super;
+ color: #990000;
+ font-size: xx-small;
+ margin-right: 0mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ endnote {
+ display: block;
+ font-size: small;
+ font-family: #{fonts};
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 10%;
+ margin-right: 5%;
+ margin-top: 4px;
+ margin-bottom: 0px;
+ }
+ endnote_indent {
+ display: block;
+ font-size: small;
+ font-family: #{fonts};
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 15%;
+ margin-right: 5%;
+ margin-top: 4px;
+ margin-bottom: 0px;
+ }
+ en {
+ font-size: xx-small;
+ vertical-align: super;
+ }
+ i { font-style: italic; }
+ b { font-style: bold; }
+ u { text-decoration: underline; }
+ br { display: block; }
+WOK
+ end
+ def docbook_xml #stylesheet for docbook
+<<WOK
+/* SiSU css docbook.xml default style */
+ book {
+ display: block;
+ margin-left: 0mm;
+ margin-right: 0mm;
+ }
+ bookinfo {
+ display: block;
+ margin-bottom: 20px;
+ background-color: #dddddd;
+ }
+ source_control {
+ display: block;
+ }
+ dc,sc {
+ display: block;
+ font-family: #{fonts};
+ color: blue;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ sc {
+ color: green;
+ }
+ keywords,copyright {
+ display: block;
+ font-family: #{fonts};
+ color: red;
+ background-color: #dddddd;
+ font-weight: normal;
+ text-align: justify;
+ font-size: xx-small;
+ line-height: 120%;
+ margin-left: 5%;
+ margin-right: 5mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ body {
+ color: black;
+ background: #ffffff;
+ }
+ a:link {
+ color: #003399;
+ text-decoration: none;
+ }
+ a:visited {
+ color: #003399;
+ text-decoration: none;
+ /* background-color: #e3ecef; */
+ }
+ a:hover {
+ color: #000000;
+ text-decoration: underline;
+ background-color: #fff3b6;
+ }
+ a:hover IMG {
+ background-color: #ffffff;
+ }
+ a:active {
+ color: #003399;
+ text-decoration: underline;
+ }
+ object {
+ display: block;
+ margin-left: 2mm;
+ margin-right: 2mm;
+ margin-top: 4px;
+ margin-bottom: 8px;
+ }
+ part {
+ display: block;
+ /* font-weight: bold; */
+ }
+ contents {
+ font-weight: normal;
+ }
+ para {
+ display: block;
+ font-family: #{fonts};
+ /* font-weight: normal; */
+ text-align: justify;
+ font-size: 100%;
+ line-height: 150%;
+ margin-left: 5%;
+ margin-right: 5%;
+ margin-top: 2px;
+ margin-bottom: 0px;
+ }
+ para.verse, para.group, para.code {
+ text-align: left;
+ }
+ para.norm {
+ font-family: #{fonts};
+ font-weight: normal;
+ }
+ para.h1, title {
+ display: block;
+ font-family: #{fonts};
+ font-size: 120%;
+ font-weight: bold;
+ text-align: left;
+ line-height: 120%;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ para.h2 {
+ font-weight: bold;
+ font-size: 110%;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ para.h3 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ para.h4 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ para.h5 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ para.h6 {
+ font-size: 110%;
+ font-weight: bold;
+ text-align: left;
+ }
+ table {
+ margin-left: 5%;
+ display: block;
+ }
+ tr {
+ display: block;
+ }
+ th, td {
+ display: inline;
+ }
+ nametag {
+ display: none;
+ }
+ number {
+ padding-right: 4px;
+ }
+ ocn {
+ font-weight: normal;
+ display: block;
+ text-align: right;
+ vertical-align: super;
+ color: #990000;
+ font-size: xx-small;
+ margin-right: 0mm;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ endnote {
+ display: block;
+ font-size: small;
+ font-family: #{fonts};
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 10%;
+ margin-right: 5%;
+ margin-top: 4px;
+ margin-bottom: 0px;
+ }
+ endnote_indent {
+ display: block;
+ font-size: small;
+ font-family: #{fonts};
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 15%;
+ margin-right: 5%;
+ margin-top: 4px;
+ margin-bottom: 0px;
+ }
+ en {
+ font-size: xx-small;
+ vertical-align: super;
+ }
+ i { font-style: italic; }
+ b { font-style: bold; }
+ u { text-decoration: underline; }
+ br { display: block; }
+WOK
+ end
+ def css_xhtml_p #stylesheet for ...
+<<WOK
+ body {
+ color: black;
+ background: #ffffff;
+ }
+ a:link {
+ color: #003399;
+ text-decoration: none;
+ }
+ a:visited {
+ color: #003399;
+ text-decoration: none;
+ /* background-color: #e3ecef; */
+ }
+ a:hover {
+ color: #000000;
+ text-decoration: underline;
+ background-color: #fff3b6;
+ }
+ a:hover IMG {
+ background-color: #ffffff;
+ }
+ a:active {
+ color: #003399;
+ text-decoration: underline;
+ }
+ object {
+ display: block;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ margin-right: 5mm;
+ }
+ p {
+ display: block;
+ font-family: #{fonts};
+ font-size: 100%;
+ font-weight: normal;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 10mm;
+ margin-top: 3px;
+ margin-bottom: 0px;
+ margin-right: 5mm
+ }
+ p.norm {
+ }
+ p.endnote {
+ font-size: 100%;
+ margin-left: 20%;
+ text-indent: 5%
+ }
+ p.endnote_indent {
+ font-size: 100%;
+ margin-left: 25%;
+ text-indent: 5%
+ }
+ p.h1 {
+ font-family: #{fonts};
+ font-weight: bold;
+ line-height: 120%;
+ margin-left: 10mm;
+ margin-right: 10mm;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ p.h2 {
+ font-weight: bold;
+ font-size: 110%;
+ margin-left: 10mm;
+ margin-right: 15mm;
+ text-align: left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ }
+ p.h3 {
+ font-size: 150%;
+ font-weight: bold;
+ text-align: left;
+ }
+ p.h4 {
+ font-size: 150%;
+ font-weight: bold;
+ text-align: left;
+ }
+ p.h5 {
+ font-size: 150%;
+ font-weight: bold;
+ text-align: left;
+ }
+ p.h6 {
+ font-size: 150%;
+ font-weight: bold;
+ text-align: left;
+ }
+ ocn {
+ display: block;
+ text-align: right;
+ vertical-align: super;
+ color: #990000;
+ font-size: xx-small;
+ margin-top: 0px;
+ margin-bottom: 6px;
+ }
+ en {
+ font-size: xx-small;
+ vertical-align: super;
+ }
+ i { font-style: italic; }
+ b { font-style: bold; }
+ u { text-decoration: underline; }
+ br { display: block; }
+WOK
+ end
+ end
+end
+
+__END__
+
diff --git a/lib/sisu/0.52/dal.rb b/lib/sisu/0.52/dal.rb
new file mode 100644
index 00000000..43a4f015
--- /dev/null
+++ b/lib/sisu/0.52/dal.rb
@@ -0,0 +1,1089 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: preprocessing, (document abstraction), data abstraction used in subsequent processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DAL
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/param'
+ require SiSU_lib + '/dal_syntax'
+ require SiSU_lib + '/dal_doc_str'
+ require SiSU_lib + '/i18n'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ include Syntax
+ class Instantiate < SiSU_Param::Parameters::Instructions
+ def initialize
+ @@flag_vocab=0
+ @@endnote={}
+ @@endnote_array=@@word_mode=[]
+ @@endnote_counter,@@endnote_counter_asterisk,@@endnote_counter_dag=1,1,1 #added
+ @@line_mode=''
+ end
+ end
+ class Source <Instantiate
+ @@dal_array=[]
+ @@fns=nil
+ def initialize(opt)
+ @opt=opt
+ @@fns||@opt.fns
+ @my_make_fns=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ @fnm=@my_make_fns.marshal_meta
+ SiSU_Env::Create_system_link.new.images
+ end
+ def read #creates dal
+ begin
+ dal=[]
+ @@dal_array=[]
+ @@fns=@opt.fns
+ create_dal
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ Instantiate.new
+ end
+ end
+ def get #reads dal, unless does not exist then creates first
+ begin
+ dal=[]
+ unless @@fns==@opt.fns
+ @@fns=@opt.fns
+ @@dal_array=[]
+ end
+ dal=if @@dal_array.empty?; read_fnm
+ else @@dal_array.dup #check
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ Instantiate.new
+ end
+ end
+ protected
+ def create_dal
+ dal_array=[]
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Document Abstraction')
+ tell.green_title_hi unless @opt.cmd =~/q/
+ file_array=IO.readlines(@opt.fns,'')
+ file_array.each do |l|
+ if l =~/\r\n/; l.gsub!(/\r\n/,"\n")
+ end
+ end
+ meta=file_array.dup
+ meta=meta.join.split("\n\n") #check whether can be eliminated, some of these are large objects to have twice
+ @md=SiSU_Param::Parameters::Instructions.new(meta,@opt).extract
+ meta=nil
+ dal=SiSU_DAL::Make.new(@md,file_array).song
+ SiSU_Screen::Ansi.new(@md.cmd,@md.fns,"~meta/#{@md.fns}.meta").output if @md.cmd =~/v/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"dal -> #{@my_make_fns.meta}") if @md.cmd =~/M/
+ tell.txt_grey unless @md.cmd =~/q/
+ dal.each{|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?}
+ dal_array
+ end
+ def read_fnm
+ dal=[]
+ dal=if FileTest.file?(@fnm); File.open(@fnm){ |f| dal=Marshal.load(f)}
+ else SiSU_DAL::Source.new(@opt).create_dal
+ end
+ end
+ end
+ class Output
+ def initialize(md,data)
+ @md,@data=md,data
+ @my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @hard="#{dir.path.dal}/#{@md.fns}.meta"
+ end
+ def hard_output
+ if @md.cmd =~/M/
+ filename_meta=@my_make.file_meta
+ @data.each {|s| filename_meta.puts s.strip + "\n\n" unless s.strip.empty?}
+ else File.unlink(@hard) if FileTest.file?(@hard)
+ end
+ end
+ def marshal
+ marshal_meta=@my_make.marshal_meta
+ File.open(marshal_meta,'w'){|f| Marshal.dump(@data.to_a,f)}
+ end
+ end
+ class Make
+ @@endnote={}
+ @@endnote_array=@@word_mode=[]
+ @@endnote_counter,@@endnote_counter_asterisk,@@endnote_counter_dag=1,1,1
+ @@comment='%'
+ @@dp=nil
+ def initialize(md,data)
+ @md,@data=md,data
+ @@word_mode=[]
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @skin=SiSU_Env::Info_skin.new(@md)
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns)
+ @language=l[:l]
+ @tr=SiSU_Translate::Source.new(@md,@language)
+ end
+ def reset
+ @@flag_vocab=0
+ @@endnote={}
+ @@endnote_array=@@word_mode=[]
+ @@endnote_counter,@@endnote_counter_asterisk,@@endnote_counter_dag=1,1,1
+ @@line_mode=''
+ end
+ def song
+ reset
+ data=@data
+ @metafile="#{@env.path.dal}/#{@md.fns}.meta"
+ my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ data=data.join.split("\n\n")
+ data=SiSU_document_structure::Code.new(@md,data).code
+ data_new=[]
+ data.each do |x|
+ data_new << if x =~ /\n\n/m; x.split(/\n\n+/)
+ else x
+ end
+ end
+ data=data_new.flatten
+ data=SiSU_DAL::Make.new(@md,data).substitutions_and_insertions?
+ data=Syntax::Markup.new(@md,data).songsheet
+ data=SiSU_DAL::Make.new(@md,data).character_check
+ data=SiSU_DAL::Make.new(@md,data).images
+ data=SiSU_document_structure::Tables.new(@md,data).tables
+ data=SiSU_DAL::Make.new(@md,data).numbering_song
+ data=SiSU_DAL::Make.new(@md,data).endnotes
+ data=SiSU_DAL::Make.new(@md,data).object_digest
+ meta=SiSU_DAL::Make.new(@md,data).metadata
+ outputdata=data + meta
+ if @md.cmd =~/[mM]/
+ SiSU_DAL::Output.new(@md,outputdata).hard_output
+ SiSU_DAL::Output.new(@md,outputdata).marshal
+ end
+ reset
+ outputdata
+ end
+ protected
+ def vocabulary
+ data=@data
+ vocab_insert,tuned_file=[],[]
+ data.each do |para|
+ if para =~/^1~/ and @@flag_vocab == 0
+ vocab_insert << '0~vocabulary lex' << "\n\n" << para #watch consider
+ tuned_file << vocab_insert unless para.nil?
+ @@flag_vocab=1
+ else tuned_file << para unless para.nil?
+ end
+ end
+ tuned_file
+ end
+ def character_check
+ require 'iconv'
+ reset
+ data=@data
+ @tuned_file=[]
+ endnote_no=1
+ data.each do |para|
+ para.strip!
+ para.gsub!(/^([12])~\?\s+/,'\1~ ') #conditional header for incorporated document 2004w12
+ para.gsub!(/^[{~}]\s*$/,'')
+ para.gsub!(/^#{@@comment}.*/,'') #remove comment and divider #%
+ para.gsub!(/<~#>|~#\s*/,'<~#>')
+ para.gsub!(/-#\s*/,'<-#><~#>')
+ #para.gsub!(/(#\{{3} arch-tag:|0\{{3}~cvs)\s+/, "0{{~rcs ") #KEEP ... ENABLE WIDER USE OF REVISION CONTROL
+ para.gsub!(/(~\{ )\s+/,'\1')
+ para.gsub!(/ \/\//,'<br />') #added 2004w29
+ para.gsub!(/<br>/,'<br />') #needed by xml, xhtml etc.
+ #para.gsub!(/<p>/,'<p />') #consider
+ para.gsub!(/`/,"'")
+ para.gsub!(/\342\200\231/,"'") #if para =~/’/ #Avoid #&lsquo; &rsquo; #&ldquo; &rdquo;
+ para.gsub!(/\t/,' ')
+ para.gsub!(/�/,' ') #watch, replace with char code
+ para.gsub!(/[“”]/,'""')
+ para.gsub!(/[­–—]/,'-') #— – chk
+ para.gsub!(/·/,'*')
+ para.gsub!(/\\copy(?:right)?\b/,'&#169;')
+ para.gsub!(/\\trademark\b|\\tm\b/,'&#174;')
+ #non_utf8(para)
+ para=para + "\n"
+ case para
+ when /\^~/ # endnotes
+ #% Note must do this first (earlier loop) and then enter gathered data into ~^\d+
+ sub_para=para.dup
+ @@endnote_array << sub_para.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/, %{~\{#{endnote_no} \\1 \}~}).strip
+ endnote_no+=1
+ para=nil if para =~/\^~ .+/ #removes 'binary' endnote now in endnote array for later insertion
+ end
+ @tuned_file << para unless para.nil?
+ end
+ @tuned_file
+ end
+ def images
+ data=@data
+ tuned_file=[]
+ @rmgk=false
+ if SiSU_Env::Info_settings.new.program?('rmagick'); @rmgk=SiSU_Env::Load.new('RMagick').prog
+ else tell=SiSU_Screen::Ansi.new(@md.cmd,'use of RMagick is not enabled in sisurc.yml')
+ tell.warn if @md.cmd =~/[vVM]/
+ end
+ data.each do |para|
+ para.strip!
+ if para =~/\{\s*\S+\.(?:png|jpg|gif)(?:\s*|\s+.+)?\}(?:(?:https?|ftp):\S+|image)/
+ if para !~/\{\s*\S+\.(?:png|jpg|gif)\s+\d+x\d+\s+/
+ m=/\{\s*(\S+\.(?:png|jpg|gif))/
+ if @rmgk
+ imgs=para.scan(m).flatten
+ images=imgs.each do |image|
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ path_image=[dir.path.image_source_local_tex,dir.path.image_source_remote_tex,dir.path.image_source_tex]
+ image_path=nil
+ path_image.each do |image_path|
+ break if FileTest.exists?("#{image_path}/#{image}")
+ end
+ if FileTest.exists?("#{image_path}/#{image}")
+ img=Magick::ImageList.new("#{image_path}/#{image}")
+ img_col,img_row=img.columns,img.rows
+ if img_col > img_row #landscape
+ if img_col> 640 #480
+ img_col=640 #480
+ img_row=((1.00*img_col/img.columns)*img.rows).round
+ end
+ else #portrait
+ if img_col> 640 #480
+ img_col=640 #480
+ img_row=((1.00*img_col/img.columns)*img.rows).round
+ end
+ if img_row > 640
+ img_row=640
+ img_col=((1.00*img_row/img.rows)*img.columns).round
+ end
+ end
+ para.gsub!(/(#{image})/,"#{image} #{img_col}x#{img_row}")
+ else para.gsub!(/\{\s*(\S+)\.(png|jpg|gif).+?\}((?:https?|ftp):\S+|image)/,'[ \1 (\2 missing) ]')
+ end
+ end
+ else
+ images=para.scan(m) do |image|
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'where image dimensions have not been provided RMagick is required',image)
+ tell.warn #unless @opt.cmd =~/q/
+ end
+ end
+ end
+ end
+ para.gsub!(/\{\s+(\S+\.(?:png|jpg|gif))\s+/i,'{\1 ') if para =~/\{\s+\S+\.(?:png|jpg|gif).+?\}(?:(?:https?|ftp):\S+|image)/
+ tuned_file << para unless para.nil?
+ end
+ tuned_file
+ end
+ def output_filetypes_in_cmd(cmd_shortcut,source=nil)
+ #make list of file types in shortcut command (as configured), e.g. when sisu -3 is used
+ cf_defaults=SiSU_Env::Info_processing_flag.new
+ cmd_list=case cmd_shortcut.to_s
+ when /0/; cf_defaults.cf_0
+ when /1/; cf_defaults.cf_1
+ when /2/; cf_defaults.cf_2
+ when /3/; cf_defaults.cf_3
+ when /4/; cf_defaults.cf_4
+ when /5/; cf_defaults.cf_5
+ end
+ file_type_names=[]
+ file_type_names <<= if cmd_list =~ /y/; 'sisu_manifest.html'
+ end
+ file_type_names <<= if cmd_list =~ /h/; ['toc.html', 'doc.html']
+ end
+ file_type_names <<= if cmd_list =~ /p/; ['landscape.pdf', 'portrait.pdf']
+ end
+ file_type_names <<= if cmd_list =~ /o/; 'opendocument.odt'
+ end
+ file_type_names <<= if cmd_list =~ /b/; 'scroll.xhtml'
+ end
+ file_type_names <<= if cmd_list =~ /x/; 'sax.xml'
+ end
+ file_type_names <<= if cmd_list =~ /X/; 'dom.xml'
+ end
+ file_type_names <<= if cmd_list =~ /a/; 'plain.txt'
+ end
+ file_type_names <<= if cmd_list =~ /g/; 'wiki.txt'
+ end
+ file_type_names <<= if cmd_list =~ /w/; 'concordance.html'
+ end
+ file_type_names <<= if cmd_list =~ /N/; 'digest.txt'
+ end
+ file_type_names <<= if source and cmd_shortcut =~ /s/; source
+ end
+ file_type_names <<= if cmd_shortcut =~ /S/; 'sisupod.zip'
+ end
+ file_type_names=file_type_names.flatten
+ end
+ def substitutions_and_insertions?
+ data=@data
+ tuned_file=[]
+ if data[0] =~ /^#!\s*(?:\/usr\/bin\/env sisu|\/usr\/bin\/sisu)/ # remove bang from top #! (however file is stripped, so will be removed provided no content preceeds it)
+ data[0].gsub!(/^#!\s*\/usr\/bin\/sisu/,'')
+ data[0].gsub!(/^#!\s*\/usr\/bin\/env sisu/,'')
+ end
+ if data[0] =~ /^(SiSU\s+[\d.]*|sisu-[\d.]+)$/ # SiSU identifier
+ data[0].gsub!(/^(SiSU\s*[\d.]*)$/,'% \1')
+ data[0].gsub!(/^(sisu-[\d.]+)$/,'% \1')
+ end
+ data.each do |para|
+ para=if @md.markup_version.to_f >= 0.38
+ SiSU_document_structure::Structure.new(@md,para).structure_markup_normalize
+ else para
+ end
+ #para.gsub!(/<url:(\S+?)>/,'\1') #consider, would permit use of text hyperlinks if desired, dal_syntax more appropriate?
+ para.gsub!(/^((?:[1-9]|:?[A-C])~\S*)\s*$/,'\1~ [Note: heading marker::required title missing]~#') #conditional header for incorporated document 2004w12
+ if para =~/^@\S+?:/
+ para.gsub!(/^@(\S+?):\s+/,'0~\1 ')
+ para.gsub!(/^@(\S+?):([+-])\s+/,'0~\1\2 ')
+ end
+ if para !~/^%+\s/ and
+ para =~/^(?:_\*\s+)?\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]+))\]\}(?:\.\.\/\S+?\/|\S+?\.(?:sst|ssm)\b)(?:\s+~\{.+?\}~)?(?:\s+\*~\S+)*\s*$/
+ txt,cmd,source,url_dir,note,manifest=nil,nil,nil,nil,nil,nil
+ url_and_stub=SiSU_Env::Info_env.new.url
+ if defined? url_and_stub.remote
+ @output_url="#{url_and_stub.remote}"
+ if para =~/\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm])(\s+~\{.+?\}~)?/
+ #syntax e.g.: { "Sphinx or Robot", Leena Krohn [3sS]}sphinx_or_robot.leena_krohn.1996.sst
+ txt,cmd,source,url_dir,note=$1,$2,$3,$4,$5
+ elsif para =~/\{(.+?)\s\[(\d[sS]*)\]\}\.\.\/(\S+?)\/(\s+~\{.+?\}~)?/
+ #syntax e.g.: { "Sphinx or Robot", Leena Krohn [3sS]}../sphinx_or_robot.leena_krohn.1996/
+ txt,cmd,url_dir,note=$1,$2,$3,$4
+ end
+ manifest="{#{txt} }#@output_url/#{url_dir}/toc.html#{note}\n\n"
+ else
+ puts "error, does currently support relative paths (reltive paths were removed, as had problems for citation, and was not suited to all output types should possibly reconsider) #{__FILE__} #{__LINE__}"
+ if para =~/\{(?:~\^\s+)?(.+?)\s\[(\d[sS]*)\]\}\.\.\/(\S+?)\/(\s+~\{.+?\}~)?/
+ txt,cmd,url_dir,note=$1,$2,$3,$4
+ manifest="{ #{txt} }../#{url_dir}/toc.html#{note}\n\n"
+ end
+ end
+ tuned_file << manifest
+ output_filetypes_in_cmd(cmd,source).each do |o_f|
+ describe = case o_f
+ when /sisu_manifest.html/; '~^ document manifest'
+ when /toc.html/; ' html, segmented text'
+ when /doc.html/; ' html, scroll, document in one'
+ when /landscape.pdf/; ' pdf, landscape'
+ when /portrait.pdf/; ' pdf, portrait'
+ when /opendocument.odt/; ' open document'
+ when /scroll.xhtml/; ' xhtml scroll'
+ when /sax.xml/; ' xml, sax'
+ when /dom.xml/; ' xml, dom'
+ when /plain.txt/; ' plain text utf-8'
+ when /wiki.txt/; ' wiki text'
+ when /concordance.html/; ' concordance'
+ when /digest.txt/; ' dcc, document content certificate (digests)'
+ when /#{source}/; ' markup source text'
+ when /sisupod.zip/; ' zipped markup source pod'
+ else nil
+ end
+ if describe
+ if @output_url
+ tuned_file << "_1 {#{describe} }#@output_url/#{url_dir}/#{o_f}\n\n" if describe
+ else
+ tuned_file << "_1 { #{describe} }../#{url_dir}/#{o_f}\n\n"
+ end
+ end
+ end
+ elsif para =~/<:insert\d+!?>/ and para !~/^%\s+/
+ @skin.select
+ ins=SiSU_Viz::Inserts.new
+ case para
+ when /^\s*<:insert1>\s*$/
+ para=[]
+ ins.insert1.split(/\n\n/).each{|x| para << x }
+ when /^\s*<:insert2>\s*$/
+ para=[]
+ ins.insert2.split(/\n\n/).each{|x| para << x }
+ when /^\s*<:insert3>\s*$/
+ para=[]
+ ins.insert3.split(/\n\n/).each{|x| para << x << "\n"}
+ para=ins.insert3
+ when /^\s*<:insert4>\s*$/
+ para=[]
+ ins.insert4.split(/\n\n/).each{|x| para << x << "\n"}
+ para=ins.insert4
+ when /^\s*<:insert5>\s*$/
+ para=[]
+ ins.insert5.split(/\n\n/).each{|x| para << x << "\n"}
+ when /^\s*<:insert6>\s*$/
+ para=[]
+ ins.insert6.split(/\n\n/).each{|x| para << x << "\n"}
+ when /^\s*<:insert7>\s*$/
+ para=[]
+ ins.insert7.split(/\n\n/).each{|x| para << x << "\n"}
+ end
+ para.each{|x| tuned_file << x }
+ else tuned_file << para
+ end
+ tuned_file.flatten!
+ tuned_file.compact!
+ end
+ tuned_file
+ end
+ def numbering_song
+ data=@data
+ data=SiSU_DAL::Make.new(@md,data).number_plaintext_para
+ data=SiSU_DAL::Make.new(@md,data).name_endnote_seg
+ data=SiSU_DAL::Make.new(@md,data).auto_number_heading_ie_title
+ data=SiSU_DAL::Make.new(@md,data).ocn unless @md.markup =~/not_to/
+ data=SiSU_DAL::Make.new(@md,data).minor_numbering #unless @md.markup =~/not_to/
+ data=SiSU_DAL::Make.new(@md,data).name_para_seg_filename
+ data=SiSU_DAL::Make.new(@md,data).set_heading_seg unless @md.set_heading_seg
+ data=SiSU_DAL::Make.new(@md,data).set_heading_top unless @md.set_heading_top
+ data=SiSU_DAL::Make.new(@md,data).set_header_title unless @md.set_header_title
+ data
+ end
+ def number_plaintext_para
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ para.gsub!(/(^|[^<][^v][^>])\n/,'\1 ') #messy, but idea is that tables should retain breaks
+ para.gsub!(/^/,"\n") unless para =~/¡/
+ para.gsub!(/^\s+|\s$/,"\n")
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ def name_endnote_seg
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ para.gsub!(/<:3>\s*<:ee>/,
+ "#{@@endnote['special_align']} <p /><br />\r " +
+ "#{@@endnote['seg_name_3']} <p /> " +
+ "#{@@endnote['special_align_close']}")
+ para.gsub!(/<:2>\s*<:ee>/,
+ "#{@@endnote['special_align']} <p /><br />\r " +
+ "#{@@endnote['seg_name_2']} <p />" +
+ "#{@@endnote['special_align_close']}")
+ para.gsub!(/<:1>\s*<:ee>/,
+ "#{@@endnote['special_align']} <p /><br />\r " +
+ "#{@@endnote['seg_name_1']} <p /> " +
+ "#{@@endnote['special_align_close']}")
+ @tuned_file << para
+ end
+ # debug 2003w46 adding revision control info
+ if @md.flag_auto_endnotes and @md.flag_separate_endnotes_make
+ @tuned_file << "\n4~endnotes Endnotes <~0;0:0;u0>" #prob numbering, revisit
+ end
+ @tuned_file << "\n<ENDNOTES>"
+ @tuned_file
+ end
+ def owner_details_seg
+ data << '4~owner.details Owner Details'
+ end
+ def number_sub_heading(para,num,title_no)
+ case para
+ when /#{num}~- /; para.gsub!(/#{num}~- /,"#{title_no} ")
+ when /^#{num}~#\s*/; para.gsub!(/^#{num}~#\s*/,"#{title_no} ")
+ when /^#{num}~[a-z_\.]+ /
+ para.gsub!(/^#{num}~([a-z_\.]+)\s+(.+)/i,%{#{num}~\\1 #{title_no} \\2 <:name##{title_no}>})
+ else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main
+ end
+ if @md.toc_lev_limit and @md.toc_lev_limit < num
+ para.gsub!(/^[5-8]~(?:~\S+)?\s*/,'!_ ')
+ end
+ para
+ end
+ def auto_number_heading_ie_title #also does some segment naming
+ data=@data
+ @tuned_file=[]
+ if @md.markup =~/num_top/ or @md.num_top # watch, 2003w23
+ input="#{@md.markup}"[/num_top\=([1-6])/,1] if @md.markup
+ input||=@md.num_top if @md.num_top !~/^$/
+ end
+ num_top=input.to_i
+ t_no1=t_no2=t_no3=t_no4=0
+ no1=num_top; no2=(num_top + 1); no3=(num_top + 2); no4=(num_top + 3)
+ t_not=0
+ data.each do |para| #@md.seg_names << [additions to segment names]
+ if (@md.markup =~/num_top/ or (@md.num_top and @md.num_top !~/^$/)) and para !~/^0~/
+ if (para =~/^(?:#{no1}|^#{no2}|^#{no3}#{no4})~#/ and para !~/^4~endnotes?/)
+ t_not+=1 #; t_no2=0; t_no3=0
+ para.gsub!(/^(#{no1})~#\s*/,"\\1~ps#{t_not} ")
+ para.gsub!(/^(#{no2})~#\s*/,"\\1~ps#{t_not} ")
+ para.gsub!(/^(#{no3})~#\s*/,"\\1~ps#{t_not} ")
+ para.gsub!(/^(#{no4})~#\s*/,"\\1~ps#{t_not} ")
+ end
+ if para =~/#{no1}~/
+ @subnumber=1
+ @subnumber=0 if para =~/#{no1}~/
+ end
+ if para =~/^[0-6]~[ \w-]/ and para !~ /(?:[0-6]~[\w-]+-|4~endnotes|^[0-6]~([a-z_\.]+)\s+[\d.]+)\s/ and para !~/<~#>|<-#>/
+ if para =~/^#{no1}~/
+ t_no1+=1; t_no2=0; t_no3=0
+ title_no="#{t_no1}"
+ if not @md.seg_names.nil? and not @md.seg_names.include?(title_no)
+ para.gsub!(/^#{no1}~\s+(\S+)#/,"#{no1}~#{title_no} \\1 #{title_no} ") #shift placement of auto-number to after first word, e.g. Article # not # Article, added on occasion of ABF (20040329)
+ para.gsub!(/^#{no1}\{\s+(Article|Clause|Section)\s+#/i,%{#{no1}~#{title_no} \\1 #{title_no}. })
+ unless para =~/^#{no1}~\s+[\d.]+\s/ #fix -> if the title starts with a numbering scheme, do not auto-number, review
+ para.gsub!(/^#{no1}~\s+/,"#{no1}~#{title_no} #{title_no}. ")
+ end
+ @md.seg_names << title_no
+ #else puts "warning segment name #{title_no} already exists"
+ end
+ unless para =~/^#{no1}~([a-z_\.]+)\s+[A-Z]\.?\s/ #bug -> tmp fix, excludes A. B. C. lettering, but not roman numerals, is arbitrary, review required
+ para.gsub!(/^#{no1}~([a-z_\.]+)\s+(.+)/i,%{#{no1}~\\1 #{title_no}. \\2 <:name##{title_no}>})
+ end
+ para.gsub!(/^#{no1}~#\s*/,"#{title_no}. ")
+ end
+ if para =~/^#{no2}~/
+ t_no2+=1; t_no3=0
+ title_no="#{t_no1}.#{t_no2}"
+ para=number_sub_heading(para,no2,title_no)
+ end
+ if para =~/^#{no3}~/
+ t_no3+=1
+ title_no="#{t_no1}.#{t_no2}.#{t_no3}"
+ para=number_sub_heading(para,no3,title_no)
+ end
+ elsif para =~ /^[0-6]~[\w-]+-/ # endnotes, watch2005
+ para.gsub!(/^#{no1}~([a-z_\.]+)- /,"#{no1}~\\1 ")
+ para.gsub!(/^#{no2}~([a-z_\.]+)- /,"#{no2}~\\1 ")
+ para.gsub!(/^#{no3}~([a-z_\.]+)- /,"#{no3}~\\1 ")
+ end
+ elsif @md.markup =~/num_extract/ #AS DANGEROUS force enable with document, note already does this type of numbering for cisg, locate and coordinate logic, is currently misplaced in code, chengwei inspired 2004w23/4
+ unless para =~ /^[0-6]~\S+/ #endnotes watch?
+ if para =~/^[1-6]~\s+([\d\.]+)/ #risky (must be unique) consider output to 4~~\d instead of 4~\d
+ name_num=$1
+ para.gsub!(/^([1-6]~)\s+/,"\\1#{name_num} ")
+ end
+ end
+ if @md.toc_lev_limit
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ def ocn #and auto segment numbering increment
+ data=@data
+ @tuned_file=[]
+ object_array=SiSU_document_structure::OCN.new(@md,data).ocn
+ object_array.each do |o|
+ @tuned_file <<= if o.ocn; "#{o.txt} <~#{o.ocn};#{o.lv};#{o.type}>"
+ else o.txt
+ end
+ end
+ @tuned_file
+ end
+ def minor_numbering #and auto segment numbering increment
+ data=@data
+ @tuned_file=[]
+ number_small,letter_small=0,0
+ letter=%w( a b c d e f g h i j k l m n o p q r s t u v w x y z )
+ data.each do |para|
+ if para =~/\w|\S|<|\(/
+ if para !~/^%% |^0~|^4~endnotes|^<\/center>|<:ee>|<:e[:_]>|^\^~ |<:e[:_]\d+?>|^<:p[bn]>|^<:\#|<:- |<[:!]!4|^(?:alt|code|group|poem|table)\{|^\}(?:alt|code|group|poem|table)|^\}table$|<table|<\/table>|<td|<\/td>|<th|<\/th>|<tr>|<\/tr>|<hr width|<:4-endnotes>|\[endnotes\]|<:zz>|<:isbn-|<:journal-|<:conference-|<ENDNOTES?>/i #ocn here #&nbsp; added with Tune.code #¡
+ if para=~/^[1-8]~/; number_small,letter_small=0,0 #% sub-number system, (baby numbering) reset with any change of major number (more obviously should be placed in number titles, but that is conditionally executed, check and move later)
+ end
+ if para =~/^#[ 1]/
+ letter_small=0
+ number_small=0 if para =~ /^#1/
+ number_small+=1
+ para.gsub!(/^#[ 1]/,"#{number_small}. ") #change 2004
+ end
+ if para =~/^_# /
+ para.gsub!(/^_# /,"<:i1> #{letter[letter_small]}. ") #change 2004
+ letter_small+=1
+ end
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ def name_para_seg_filename
+ # paragraph name/numbering rules
+ # manual naming overrides, manual naming may be
+ # alpha-numeric characters mixed,
+ # numeric only (a number), if
+ # all segments have been named,
+ # the numbers used are over 1000 or
+ # it is not minded that auto-numbering uses a funny scheme for naming segments (not yet implemented)
+ # [for now a warning is printed for such documents on use of maintenance or very-verbose flag]
+ # auto-naming takes the form of giving numbers to segments
+ # the rules for which are as follows
+ # if the title/heading text starts with a numeric, then that is used (1 3.1 3rd etc.)
+ # otherwise the level 4 segment number from the embedded document structure info is used
+ # if there is none a sequential number is designated, preceded by an underscore
+ data=@data
+ @tuned_file=[]
+ art_filename_auto=1
+ @counter=1
+ @unique_auto_name=[]
+ puts 'manual segment names, numbers used as names, risk warning (segmented html)' if not @md.seg_autoname_safe and @md.cmd =~/[MV]/
+ data.each do |para|
+ para=SiSU_document_structure::Structure.new(@md,para).structure_markup
+ if para !~/^0~/
+ if para =~/^[456]~ /
+ if para=~/^4/ and not @md.set_heading_seg
+ @md.set_heading_seg=true
+ end
+ if para =~/^[456]~(?:\s\S+)?\s+([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numerical construct, use that as name
+ pattern=$1
+ pattern.gsub!(/(?:[:,-]|\W)/,'.')
+ pattern.gsub!(/\.$/,'')
+ if not @md.seg_names.nil? and not @md.seg_names.include?(pattern)
+ para.gsub!(/^([456])~\s*/,"\\1~#{pattern} ")
+ @md.seg_names << pattern
+ else puts 'warn, there may be a conflicting numbering scheme' if @md.cmd =~/[VM]/
+ end
+ end
+ if para =~/^4~\s.+?;4:(\d+);/m #extract segment name from embedded document structure info
+ pattern=$1
+ pattern.gsub!(/(?:[:,-]|\W)/,'.')
+ pattern.gsub!(/\.$/,'')
+ if not @md.seg_names.nil? and not @md.seg_names.include?(pattern)
+ para.gsub!(/^(4)~\s*/,"\\1~#{pattern} ")
+ @md.seg_names << pattern
+ else
+ para.gsub!(/^(4)~\s*/,"\\1~~#{pattern} ")
+ @md.seg_names << "~#{pattern}"
+ end
+ end
+ if para =~/^4~\s+/ #if still not segment name, provide a numerical one
+ if not @md.seg_names.nil? and not @md.seg_names.include?(art_filename_auto)
+ para.gsub!(/^4~\s+/,%{4~_#{art_filename_auto} })
+ @md.seg_names << art_filename_auto
+ else puts 'segment name (numbering) error'
+ end
+ art_filename_auto+=1
+ end
+ end
+ end
+ @tuned_file << if para =~/^([1-6])~/m and (@md.pagenew or @md.pagebreak); m=$1 #watch ref~
+ para_tmp=[]
+ if @md.pagenew.to_s =~/#{m}/; para_tmp << "<:pn>\n" << para
+ end
+ if @md.pagebreak.to_s =~/#{m}/; para_tmp << "<:pb>\n" << para
+ end
+ para_result=unless para_tmp.length > 0; para
+ else para_tmp
+ end
+ else para
+ end
+ end
+ if @md.seg_names.length > 0
+ @md.set_heading_seg=true
+ end
+ @tuned_file=@tuned_file.flatten
+ end
+ def set_heading_top #% make sure no false positives
+ unless @md.set_heading_top
+ puts "\tdocument contains no top level heading, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ unless @md.set_heading_top
+ if para !~/^(?:@\S+:|0~\S+)\s/m and para !~/\A\s*\Z/m
+ @md.set_heading_top=true
+ head=if @md.title ; "1~ #{@md.title}"
+ else '1~ [no title provided]'
+ end
+ @tuned_file << head
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ end
+ def set_heading_seg #% make sure no false positives
+ unless @md.set_heading_seg
+ puts "\tdocument contains no segment level, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ unless @md.set_heading_seg
+ if para !~/^(?:@\S+:|0~\S+|[123]~)/m and para !~/\A\s*\Z/m and para !~/<:p[bn]>/
+ @md.set_heading_seg=true
+ head=if @md.title ; "4~seg [#{@md.title}]"
+ else '4~seg [segment]'
+ end
+ @tuned_file << head
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ end
+ def set_header_title #% make sure no false positives
+ unless @md.set_header_title
+ puts "\t no document title provided, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ unless @md.set_header_title
+ if para !~/^%{1,2}\s/m and para !~/\A\s*\Z/m
+ @tuned_file << "0~title #{@md.heading_seg_first}"
+ @md.title=@md.heading_seg_first
+ @md.set_header_title=true
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ end
+ def endnotes
+ data=@data
+ @tuned_file=[]
+ endnote_no,endnote_ref=1,1
+ #% endnote work zone
+ data.each do |para|
+ # manually numbered endnotes <!e(\d)!> <!e_(\d)!> -->
+ if @md.mod.inspect =~/--no-asterisk|--no-annotate/
+ para.gsub!(/~\[[*]\s.+?\]~/,'')
+ end
+ if @md.mod.inspect =~/--no-dagger|--no-annotate/
+ para.gsub!(/~\[[+]\s.+?\]~/,'')
+ end
+ case para
+ # auto-numbered endnotes <!e!> <!e_!> -->
+ when /~\{\s+.+?\}~|~\[[*+]\s+.+?\]~/
+ para.gsub!(/\s*(\}~|\]~)/,' \1') # required 2003w31
+ @word_mode=para.scan(/\S+/)
+ word_mode=SiSU_DAL::Make.new(@md,@word_mode).endnote_call_number
+ para=word_mode.join(' ')
+ endnote_ref+=1
+ when /~\^(?:\s|$)|<:e>/
+ #%Note inserts endnotes previously gathered from /^(<!e[:_]!>|[-~]\{{3})/ (in earlier loop)
+ word_mode=para.scan(/\S+/)
+ word_mode=SiSU_DAL::Make.new(@md,word_mode).endnote_call_number
+ para=word_mode.join(' ')
+ endnote_ref+=1
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ def endnote_call_number
+ data=@data
+ data.each do |word|
+ case word
+ when /~\{/
+ unless word =~/~\{[*+]+/
+ word.gsub!(/~\{/,"~\{#{@@endnote_counter} ")
+ @@endnote_counter+=1
+ end
+ when /~\[/
+ if word =~/~\[[+]/
+ word.gsub!(/~\[[+]/,"~\[\+#{@@endnote_counter_dag} ")
+ @@endnote_counter_dag+=1
+ else
+ word.gsub!(/~\[[*]?/,"~\[\*#{@@endnote_counter_asterisk} ")
+ @@endnote_counter_asterisk+=1
+ end
+ when /~\^|<:e>/
+ word.gsub!(/~\^|<:e>/,"#{@@endnote_array[@@endnote_counter-1]}")
+ @@endnote_counter+=1
+ end
+ end
+ end
+ def metadata
+ data=@data
+ meta,@dc,@rc,@cvs,dctitle,add=Array.new(6){[]}
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ base_html="#{dir.url.root}/#{@md.fnb}"
+ ocnm=ocnd=ocnv=0
+ ocnm+=1
+ header0='<:pn>'
+ header1="\n1~ Document Information <~0;0:0;m#{ocnm}>"
+ ocnm+=1
+ header4="\n4~metadata MetaData <~0;m#{ocnm};m#{ocnm}>"
+ ocnm+=1; ocnd+=1
+ head_no_dc="<~0;m#{ocnm};d#{ocnd}>"
+ ocnm+=1; ocnd+=1
+ head_no_dc_tag="<~0;m#{ocnm};d#{ocnd}>"
+ data.each do |para|
+ case para
+ when /^0~(title|creator|author|translator|translated_by|illustrator|illustrated_by|prepared_by|digitized_by|description|publisher|contributor|date\.created|date\.issued|date\.available|date\.valid|date\.modified|date|type|format|rights|identifier|source|language)/i
+ m=$1
+ ocnm+=1; ocnd+=1
+ @dc << case para
+ when /^0~title/
+ "\n#{@tr.dc_title}: <u>#{@md.dc_title}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~(?:creator|author)/
+ "\n#{@tr.creator}: <u>#{@md.dc_creator}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /0~(?:translator|translated_by)/
+ "\n#{@tr.translator}: <u>#{@md.translator}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~(?:illustrator|illustrated_by)/
+ "\n#{@tr.illustrator}: <u>#{@md.illustrator}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~prepared_by/
+ "\n#{@tr.prepared_by}: <u>#{@md.prepared_by}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~digitized_by/
+ "\n#{@tr.digitized_by}: <u>#{@md.digitized_by}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~description/
+ "\n#{@tr.description}: <u>#{@md.dc_description}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~subject/
+ "\n#{@tr.subject}: <u>#{@md.dc_subject}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~abstract/
+ "\n#{@tr.abstract}: <u>#{@md.dc_abstract}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~publisher/
+ "\n#{@tr.publisher}: <u>#{@md.dc_publisher}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~contributor/
+ "\n#{@tr.contributor}: <u>#{@md.dc_contributor}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~date.created/
+ "\n#{@tr.date_created}: <u>#{@md.dc_date_created}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~date.issued/
+ "\n#{@tr.date_issued}: <u>#{@md.dc_date_issued}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~date.available/
+ "\n#{@tr.date_available}: <u>#{@md.dc_date_available}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~date.modified/
+ "\n#{@tr.date_modified}: <u>#{@md.dc_date_modified}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~date.valid/
+ "\n#{@tr.date_valid}: <u>#{@md.dc_date_valid}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~date/
+ "\n#{@tr.date}: <u>#{@md.dc_date}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~type/
+ "\n#{@tr.type}: <u>#{@md.dc_type}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~format/
+ "\n#{@tr.format}: <u>#{@md.dc_format}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~rights/
+ "\n#{@tr.rights}: <u>#{@md.dc_rights}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~identifier/
+ "\n#{@tr.identifier}: <u>#{@md.dc_identifier}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~source/
+ "\n#{@tr.source}: <u>#{@md.dc_source}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~language/
+ "\n#{@tr.language}: <u>#{@md.dc_language}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~language.original/
+ "\n#{@tr.language_original}: <u>#{@md.language_original}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~relation/
+ "\n#{@tr.relation}: <u>#{@md.dc_relation}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~coverage/
+ "\n#{@tr.coverage}: <u>#{@md.dc_coverage}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~keywords/
+ "\n#{@tr.keywords}: <u>#{@md.keywords}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~comments/
+ "\n#{@tr.comments}: <u>#{@md.comments}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~cls_loc/
+ "\n#{@cls_dewey}: <u>#{@md.cls_dewey}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~cls_dewey/
+ "\n#{@tr.cls_dewey}: <u>#{@md.cls_dewey}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~cls_gutenberg|0~cls_pg/
+ "\n#{@tr.cls_gutenberg}: <u>#{@md.cls_gutenberg}</u> <~0;m#{ocnm};d#{ocnd}>"
+ #"\n#{@tr.cls_gutenberg}: <u>#{@md.cls_pg}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~cls_isbn/
+ "\n#{@tr.cls_isbn}: <u>#{@md.cls_isbn}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~prefix(?:_a)?/
+ "\n#{@tr.prefix_a}: <u>#{@md.prefix_a}</u> <~0;m#{ocnm};d#{ocnd}>"
+ when /^0~prefix_b/
+ "\n#{@tr.prefix_b}: <u>#{@md.prefix_b}</u> <~0;m#{ocnm};d#{ocnd}>"
+ else para.gsub(/^0~(#{m})\s+(.+)/m,"\n#{m.capitalize}: <u>\\2</u> <~0;m#{ocnm};d#{ocnd}>")
+ end
+ end
+ end
+ ocnm+=1; ocnv+=1
+ head_no_rc="<~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ head_no_rc_tag="<~0;m#{ocnm};v#{ocnv}>"
+ data.each do |para|
+ case para
+ when /^0~(?:cvs|rcs)\+\s+/ #note the + sign to turn on use of cvs id
+ ocnm+=1; ocnv+=1
+ @cvs << "#{@tr.sc_number}: <u>#{@md.sc_number}</u> <~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ @cvs << "#{@tr.sc_date}: <u>#{@md.sc_date}</u> <~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ @cvs << "CVS/RCS time: <u>#{@md.sc_time}</u> <~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ when /^0~cvs[+\s]/ #enable pattern above instead if you wish the default to be to include cvs tags from all documents KEEP
+ when /^0~cvs\s+/ #enable pattern above instead if you wish the default to be to include cvs tags from all documents KEEP
+ end
+ end
+ if true #default version information
+ ocnm+=1; ocnv+=1
+ if @md.sc_filename and @md.sc_filename.length > 3
+ @rc << "#{@tr.sourcefile}: <u>#{@md.sc_filename}</u> <~0;m#{ocnm};v#{ocnv}>"
+ else @rc << "#{@tr.sourcefile}: <u>#{@md.fns}</u> <~0;m#{ocnm};v#{ocnv}>"
+ end
+ ocnm+=1; ocnv+=1
+ if @md.file_encoding and @md.file_encoding.length > 3 #translate
+ @rc << "Filetype: <u>#{@md.file_encoding}</u> <~0;m#{ocnm};v#{ocnv}>"
+ end
+ ocnm+=1; ocnv+=1
+ if @md.dgst #change. enable by default
+ @rc << "#{@tr.sourcefile_digest}, #{@md.dgst[0]} <u>#{@md.dgst[1]}</u> <~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ end
+ if @md.dgst_skin #change. enable by default
+ @rc << "Skin_Digest: #{@md.dgst_skin[0]} <u>#{@md.dgst_skin[1]}</u> <~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ end
+ @rc << "<b>Generated</b> #{head_no_rc}" if @rc.length > 0
+ @rc << "#{@tr.last_generated}: <u>#{Time.now}</u> <~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ if @md.sisu_version[:version]
+ @rc << "#{@tr.sisu_version}: <u>#{@md.sisu_version[:project]}</u> <u>#{@md.sisu_version[:version]}</u> of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]}) <~0;m#{ocnm};v#{ocnv}>"
+ ocnm+=1; ocnv+=1
+ end
+ @rc << "#{@tr.ruby_version}: <u> #{@md.ruby_version}</u> <~0;m#{ocnm};v#{ocnv}>"
+ end
+ meta << header0
+ meta << header1
+ meta << header4
+ meta << "Document Manifest @\n #{base_html}/#{@md.fn[:manifest]} <~0;m#{ocnm};m#{ocnm}>"
+ meta << "<b>Dublin Core</b> (DC) #{head_no_dc}" if @dc.length > 0
+ meta << "<i>DC tags included with this document are provided here.</i> #{head_no_dc_tag}" if @dc.length > 0
+ @dc.each { |x| meta << x }
+ meta << "<b>Version Information</b> #{head_no_rc}" if @rc.length > 0
+ if @cvs.length > 0
+ meta << "<i>Note the version information provided here, is specific to the host site.</i> #{head_no_rc_tag}"
+ @cvs.each { |x| meta << x }
+ end
+ @rc.each { |x| meta << x }
+ ## ENDNOTE RELATED endnote related
+ meta << "\n<EOF>"
+ meta=SiSU_DAL::Make.new(@md,meta).object_digest
+ end
+ def stamped(para,hash_class)
+ @tuned=[]
+ para=strip_clean_extra_spaces(para)
+ digest_all=hash_class.hexdigest(para) # print "#{hash_class.name}: "; puts digest_all #length==32 or 64
+ stripped=strip_clean_of_markup(para)
+ digest_strip=hash_class.hexdigest(stripped)
+ case para
+ when /~\{[\d*+]+\s+.+?\}~|~\[[*+]\d+\s+.+?\]~/
+ en_and_para,en_and_para_digest=[],[]
+ para.gsub!(/\s*(\}~|\]~)/,' \1') #watch
+ para_plus_en=para.scan(/.*?~\{.+?\}~|.*?~\[.+?\]~/)
+ para_tail=if para =~/(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+([\s\S]+)/
+ /(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+(.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+>)/.match(para)[1]
+ else ''
+ end
+ para_plus_en << para_tail
+ para_plus_en.each {|e_p| en_and_para_digest << SiSU_DAL::Make.new(@md,e_p).endnote_digest }
+ para_new=en_and_para_digest.join(' ')
+ @tuned << para_new + '<' + digest_strip + ':' + digest_all + '>' unless para.nil?
+ else @tuned << para + '<' + digest_strip + ':' + digest_all + '>' unless para.nil?
+ end
+ @tuned.join
+ end
+ def object_digest
+ # 1. clean/stripped text without any markup, paragraph, headings etc. without endnotes
+ # 2. endnotes clean/stripped text digest only (there may be several endnotes within a paragraph)
+ # 3. whole object, text with markup and any endnotes, (question: with or without the endnote digests??? presumption better without, [however may be easier to check with?])
+ # [digests should not include other digests]
+ # vim==/<[0-9a-f]\{#{@@dl}\}\(:[0-9a-f]\{#{@@dl}\}\)\?>/
+ require 'digest/md5'
+ require 'digest/sha2'
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ if para=~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+>/
+ if @env.digest.type =~/sha256/
+ for hash_class in [ Digest::SHA256 ]
+ @tuned_file << stamped(para,hash_class)
+ end
+ else
+ for hash_class in [ Digest::MD5 ]
+ @tuned_file << stamped(para,hash_class)
+ end
+ end
+ else @tuned_file << para unless para.nil?
+ end
+ end
+ @tuned_file
+ #use md5 or to create hash of each dal object including ocn, & add into to each dal object
+ end
+ def endnote_digest
+ data=@data
+ para_bit=[]
+ data.each do |en_plus|
+ para_bit <<= case en_plus
+ when /~\{|~\[/
+ if en_plus =~/~\{.+?\}~|~\[.+?\]~/
+ para_txt,en_open,en_txt,en_close=/(.*?)(~\{|~\[)(.+?)(\}~|\]~)/m.match(en_plus)[1..4]
+ stripped_en=strip_clean_of_markup(en_txt)
+ if @env.digest.type =~/sha256/
+ digest_en_strip=Digest::SHA256.hexdigest(stripped_en)
+ else
+ digest_en_strip=Digest::MD5.hexdigest(stripped_en)
+ end
+ para_txt + en_open + en_txt + '<' + digest_en_strip + '>' + en_close
+ else puts "Error Exception - problem encountered with:\n#{en_plus}" #arbitrary exception, tidy up
+ end
+ else en_plus
+ end
+ end
+ para_bit.join
+ end
+ def strip_clean_extra_spaces(s) # dal output tuned
+ s=s.dup
+ s=s.gsub(/[ ]+([,.;:?](?:$|\s))/,'\1')
+ s=s.gsub(/ [ ]+/,' ')
+ s=s.gsub(/^ [ ]+/,'')
+ s=s.gsub(/ [ ]+$/,'')
+ s=s.gsub(/(<\/[bi]>')[ ]+(s )/,'\1\2')
+ end
+ def strip_clean_of_markup(s) # used for digest, define rules, make same as in db clean
+ #consider: <\/?[ib]>|<(?:\/ )?br>|<del>(.+?)<\/del>
+ s=s.dup
+ s=s.gsub(/(?:<\/?[ib]>|<~\d+;(?:\w|[0-6]:)\d+;\w\d+>|<#@dp:#@dp>|^[1-6]~\S+|~\{\d+\s.+?\}~)/,'') # markup and endnotes removed
+ #% same as db clean -->
+ s=s.gsub(/<del>(.+?)<\/del>/,'DELETED(\1)') # deletions
+ s=s.gsub(/<sup>(\d+)<\/sup>/,'[\1]')
+ s=s.gsub(/(?:&nbsp\\;)+/,' ')
+ #s=s.gsub(/<!T[h]?¡.+?!>/,"[TABLE]\n") # tables
+ #s=s.gsub(/<!¡¡\d+(.+?)!>/,'\1') # tables
+ #s=s.gsub(/¡¡\d+¡/,' ') # tables
+ #s=s.gsub(/¡/,' ') # tables tidy later
+ #s=s.gsub(/<.+?>/,'')
+ s=s.gsub(/\{.+?\.(?:png|jpg|gif).+?\}(?:https?|ftp)\\\:\S+ /,' [image] ') # else image names found in search
+ s=s.gsub(/\s\s+/,' ')
+ s=s.strip
+ end
+ end
+end
+__END__
+dal output, rules to simplify parsing
+nodes === objects === paragraphs === text blocks separated by \n\n
+
+dal output:
+:verse :group and :code have -end
+:table is not used
diff --git a/lib/sisu/0.52/dal_doc_str.rb b/lib/sisu/0.52/dal_doc_str.rb
new file mode 100644
index 00000000..b2b18ca8
--- /dev/null
+++ b/lib/sisu/0.52/dal_doc_str.rb
@@ -0,0 +1,220 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xml output (sax style) processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_document_structure
+ require SiSU_lib + '/dal_doc_str_tables'
+ require SiSU_lib + '/dal_doc_str_code'
+ class Structure
+ def initialize(md,para)
+ @md,@para=md,para
+ end
+ def structure
+ structure_markup_normalize
+ structure_markup
+ @para
+ end
+ def structure_markup
+ @para=unless @para =~/[0-6]~/
+ @para=case @para
+ when /^\s*#{@md.lv1}/; @para.sub!(/(?:<[:!]1!?>\s*)?(.+)/,'1~ \1') if @para !~/^1~/
+ when /^\s*#{@md.lv2}/; @para.sub!(/(?:<[:!]2!?>\s*)?(.+)/,'2~ \1') if @para !~/^2~/
+ when /^\s*#{@md.lv3}/; @para.sub!(/(?:<[:!]3!?>\s*)?(.+)/,'3~ \1') if @para !~/^3~/
+ when /^\s*#{@md.lv4}/; @para.sub!(/(?:<[:!]4!?>\s*)?(.+)/,'4~ \1') if @para !~/^4~/
+ when /^\s*#{@md.lv5}/; @para.sub!(/(?:<[:!]5!?>\s*)?(.+)/,'5~ \1') if @para !~/^5~/
+ when /^\s*#{@md.lv6}/; @para.sub!(/(?:<[:!]6!?>\s*)?(.+)/,'6~ \1') if @para !~/^6~/
+ else @para
+ end
+ else @para
+ end
+ end
+ def structure_markup_normalize
+ para=if @md.markup_version.to_f >= 0.38 #%convert internal representation, consider making 0.38 structure default ([A-C1-6] instead of [1-9]), requires downstream changes
+ #keep and implement, requires downstream changes:
+ #@para.gsub!(/^6~/,'9~')
+ #@para.gsub!(/^5~/,'8~')
+ #@para.gsub!(/^4~/,'7~')
+ @para.gsub!(/^[456]~/,'!_')
+ @para.gsub!(/^3~/,'6~')
+ @para.gsub!(/^2~/,'5~')
+ @para.gsub!(/^1~/,'4~')
+ @para.gsub!(/^:?C~/,'3~')
+ @para.gsub!(/^:?B~/,'2~')
+ @para.gsub!(/^:?A~/,'1~')
+ @para=if @para =~/^@(?:level|markup):\s/
+ @para.gsub!(/3/,'6')
+ @para.gsub!(/2/,'5')
+ @para.gsub!(/1/,'4')
+ @para.gsub!(/:?C/,'3')
+ @para.gsub!(/:?B/,'2')
+ @para.gsub!(/:?A/,'1')
+ @para
+ else @para
+ end
+ else @para
+ end
+ end
+ end
+ class Struct
+ def initialize(o)
+ @o=o
+ end
+ def structure
+ def txt
+ @o[:txt]
+ end
+ def node
+ @o[:node]
+ end
+ def ocn
+ @o[:ocn]
+ end
+ def lv
+ @o[:lv]
+ end
+ def type
+ @o[:type]
+ end
+ self
+ end
+ end
+ class OCN
+ def initialize(md,data)
+ @md,@data=md,data
+ end
+ def ocn #and auto segment numbering increment
+ data=@data
+ @o_array=[]
+ node=ocn=ocn_dv=ocn_sp=ocnh=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnm=ocnu=ocnk=0 # h heading, o other, t table, g group, i image
+ number_small,letter_small=0,0
+ letter=%w( a b c d e f g h i j k l m n o p q r s t u v w x y z )
+ node_count_flag=false
+ headings='' #where headings omitted an alternative form of ocn heading numbering is required for html and other linking...
+ #headings=if @md.ocn.inspect =~/skip=headings/; '^(?:[A-C]|[1-9])~\S* |'
+ #else ''
+ #end
+ regex_exclude_ocn_and_node = /#{headings}^%{1,4}\s|^@\S+?:\s|^0~|^4~endnotes|^<\/center>|<:ee>|<:e[:_]>|^\^~ |<:e[:_]\d+?>|^<:p[bn]>|^<:\#|<:- |<[:!]!4|<table|<\/table>|<td|<\/td>|<th|<\/th>|<tr>|<\/tr>|<hr width|<:4-endnotes>|\[endnotes\]|<:zz>|<:isbn-|<:journal-|<:conference-|<ENDNOTES?>/i #ocn here #&nbsp; added with Tune.code #¡
+ regex_exclude_ocn = /^(?:alt|code|group|poem|table)\{|^\}(?:alt|code|group|poem|table)|^\}table$/ #ocn here #&nbsp; added with Tune.code #¡
+ data.each do |para|
+ o={}
+ if para =~/\w|\S|<|\(/
+ if para !~ regex_exclude_ocn_and_node
+ if node_count_flag or para=~/^1~/
+ node_count_flag=true
+ end
+ node+=1 if node_count_flag
+ if para !~ regex_exclude_ocn # regex_exclude_large previously excluded
+ unless para=~/<:#>|~#|-#/ # |^\s*\*\s*\*\s*\*\s*$ <-consider leaving un-numbered
+ ocn+=1
+ if para=~/^[1-8]~(?:\s+|\S)/ or para =~@md.lv1 or para =~@md.lv2 or para =~@md.lv3 or para =~@md.lv4 or para =~@md.lv5 or para =~@md.lv6
+ ocnh+=1
+ if para=~/^1~(?:\s+|\S)/ or para =~@md.lv1; ocnh1+=1
+ ocn_dv,ocn_sp="1:#{ocnh1}","h#{ocnh}"
+ elsif para=~/^2~(?:\s+|\S)/ or para =~@md.lv2; ocnh2+=1
+ ocn_dv,ocn_sp="2:#{ocnh2}","h#{ocnh}"
+ elsif para=~/^3~(?:\s+|\S)/ or para =~@md.lv3; ocnh3+=1
+ ocn_dv,ocn_sp="3:#{ocnh3}","h#{ocnh}"
+ elsif para=~/^4~(?:\s+|\S)/ or para =~@md.lv4; ocnh4+=1
+ ocn_dv,ocn_sp="4:#{ocnh4}","h#{ocnh}"
+ elsif para=~/^5~(?:\s+|\S)/ or para =~@md.lv5; ocnh5+=1
+ ocn_dv,ocn_sp="5:#{ocnh5}","h#{ocnh}"
+ elsif para=~/^6~(?:\s+|\S)/ or para =~@md.lv6; ocnh6+=1
+ ocn_dv,ocn_sp="6:#{ocnh6}","h#{ocnh}"
+ end
+ else
+ ocno+=1
+ if para=~/<!TZ!>/; ocnt+=1 #tables
+ ocn_dv,ocn_sp="o#{ocno}","t#{ocnt}"
+ elsif para=~/^<:code>/; ocnc+=1
+ ocn_dv,ocn_sp="o#{ocno}","c#{ocnc}"
+ elsif para=~/^<:(?:group|alt|verse)>/; ocng+=1
+ ocn_dv,ocn_sp="o#{ocno}","g#{ocng}"
+ elsif para=~/\{\S+?\.(?:png|jpg|gif)\s+/m; ocni+=1
+ ocn_dv,ocn_sp="o#{ocno}","i#{ocni}"
+ else ocnp+=1
+ ocn_dv,ocn_sp="o#{ocno}","p#{ocnp}"
+ end
+ end
+ o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,ocn,ocn_dv,ocn_sp
+ else ocnu+=1
+ #if para=~/-#/ #if implemented would remove need to keep <-#>
+ # ocnk+=1
+ # ocn_dv,ocn_sp="k#{ocnk}","u#{ocnu}"
+ #else
+ # ocn_dv,ocn_sp="u#{ocnu}","u#{ocnu}"
+ #end
+ #para.gsub!(/<~#>|<-#>/,'') if para #get rid of need
+ para.gsub!(/<~#>/,'') if para
+ ocn_dv,ocn_sp="u#{ocnu}","u#{ocnu}"
+ o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,0,ocn_dv,ocn_sp
+ end
+ else o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,nil,nil,nil
+ end
+ else
+ para=if para !~/^%{1,4}\s/
+ o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,nil,nil,nil
+ else ''
+ end
+ end
+ end
+ para.gsub!(/\n\n/,"\n") if para =~/<:(?:code|verse|alt|group)>/ #newlines taken out
+ para.gsub!(/(<:(?:code-end)>)/,"\n\\1") if para =~/<:(?:code-end)>/ #newlines added check
+ if para =~/<!Th?¡/; para.gsub!(/(<!Th?¡.+?!)>/,"\\1~#{o[:ocn]};#{o[:lv]};#{o[:type]}>")
+ end
+ @o_array << Struct.new(o).structure if o
+ end
+ @o_array
+ end
+ end
+ class Code < SiSU_document_structure_code::Code
+ end
+ class Tables < SiSU_document_structure_tables::Tables
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/dal_doc_str_code.rb b/lib/sisu/0.52/dal_doc_str_code.rb
new file mode 100644
index 00000000..46a466b6
--- /dev/null
+++ b/lib/sisu/0.52/dal_doc_str_code.rb
@@ -0,0 +1,153 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xml output (sax style) processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_document_structure_code
+ class Instantiate < SiSU_Param::Parameters::Instructions
+ @@flag={} #Beware!!
+ def initialize
+ @@flag['table_to']=false
+ @@counter=@@column=@@columns=0
+ @@line_mode=''
+ end
+ end
+ class Code
+ @@flag={} #Beware!!
+ def initialize(md,data)
+ @md,@data=md,data
+ Instantiate.new
+ end
+ def code
+ data=@data
+ tuned_file=[]
+ @tuned_group=[]
+ @@counter=0
+ @verse_count=0
+ data.each do |para|
+ para.gsub!(/(<:(?:code|verse|alt|group)>)\s/,'\1') #double check
+ para.gsub!(/(?:\n\s*\n)+/m,"\n")
+ if para =~/^code\{/
+ @@flag['code']=true
+ @@counter=1
+ para.gsub!(/^code\{.*/,'<:code>')
+ elsif para =~/^(?:poem)\{/
+ @@flag['poem']=true
+ para.gsub!(/^(poem)\{.*/,'<:verse>')
+ elsif para =~/^(?:alt|group)\{/ #group not tested, stub 2005
+ @@flag['group']=true
+ para.gsub!(/^(alt|group)\{.*/,'<:\1>')
+ end
+ if @@flag['code']
+ if @@flag['code'] and para =~/^\}code/
+ para.gsub!(/^\}code.*/,'<:code-end>')
+ @@flag['code']=false
+ end
+ if @@flag['code'] #or para =~/<:code-end>/ #and para =~/\S/
+ sub_array=para.dup
+ @line_mode=sub_array.scan(/.+/)
+ SiSU_document_structure_code::Code.new(@md,@line_mode).code_lines('code')
+ para=@line_mode.join
+ end
+ elsif @@flag['poem'] or @@flag['group']
+ if @@flag['poem'] and para =~/^\}(?:poem)/
+ para.gsub!(/^\}(poem).*/,"\n<:verse-end>")
+ @@flag['poem']=false
+ elsif @@flag['group'] and para =~/^\}(?:alt|group)/
+ para.gsub!(/^\}(alt|group).*/,'<:\1-end>')
+ @@flag['group']=false
+ end
+ if @@flag['poem'] or @@flag['group'] and para =~/\S/ \
+ and para !~/<:(verse|code|alt|group)(-end)?>/
+ sub_array=para.dup
+ @line_mode=sub_array.scan(/.+/)
+ type=if @@flag['poem']; 'poem'
+ else 'group'
+ end
+ SiSU_document_structure_code::Code.new(@md,@line_mode).code_lines(type)
+ div=if @@flag['poem'] and @verse_count > 0
+ "\n" + '<:verse-end>' + "\n\n" + '<:verse>'
+ else ''
+ end
+ @verse_count+=1 if @@flag['poem']
+ para = div + @line_mode.join
+ else para
+ end
+ end
+ if @@flag['code'] or @@flag['poem'] or @@flag['group']
+ @tuned_group << para if para =~/\S+/
+ elsif para =~/<:(?:code|alt|group|verse)-end>/
+ @verse_count=0
+ @tuned_group << para
+ if para =~/<:group-end>/
+ tuned_file << @tuned_group.join("\n")
+ else
+ tuned_file << @tuned_group.join
+ end
+ @tuned_group=[]
+ else tuned_file << para
+ end
+ end
+ tuned_file
+ end
+ def code_lines(type='')
+ data=@data
+ data.each do |line|
+ if line =~/\S/ and line !~/^(?:alt|code|group|poem)\{|^\}(?:alt|code|group|poem)|<:(?:code|verse|alt|group).+/
+ line.gsub!(/\s\s/,'&nbsp;&nbsp;')
+ line.gsub!(/^/,'<:codeline>') if type=='code' # try sort for texpdf special case
+ line.gsub!(/$/,'<:br>') #unless type=='code'
+ if @@flag['code']; @@counter+=1
+ else
+ end
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/dal_doc_str_tables.rb b/lib/sisu/0.52/dal_doc_str_tables.rb
new file mode 100644
index 00000000..e70490e5
--- /dev/null
+++ b/lib/sisu/0.52/dal_doc_str_tables.rb
@@ -0,0 +1,180 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xml output (sax style) processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_document_structure_tables
+ class Instantiate < SiSU_Param::Parameters::Instructions
+ @@flag={}
+ def initialize
+ @@flag['table_to']=false
+ @@counter=@@column=@@columns=0
+ @@line_mode=''
+ end
+ end
+ class Tables
+ @@flag={}
+ def initialize(md,data)
+ @md,@data=md,data
+ Instantiate.new
+ end
+ def table_visual(para)
+ count=0
+ @row=[]
+ table=[]
+ @rows=para.split(/;;/)
+ @rows.compact! #(c\d+?;.+?)
+ @rows.each do |row|
+ count +=1
+ @row[count]=row.split(/\|/)
+ end
+ @row.compact!
+ widths=if @row[0].to_s =~/^\{(?:t|table)(?:~h)?\s+\d+;/
+ col_width=@row[0].to_s.scan(/\d+/)
+ rem=(100 - col_width[0].to_i)
+ col_w=rem/(@row[1].length - 1)
+ "#{col_width[0].to_s};" + ("#{col_w};" * (@row[1].length-1))
+ else
+ col_w=100/@row[1].length
+ "#{col_w};" * @row[1].length
+ end
+ @row.delete_if {|r| r[0] =~/\{(?:table|t)(?:~h)?(?:\s+c\d+;)?[\d; ]*\}/}
+ w=widths.split(/;/)
+ tuned_file=[]
+ tuned_file << if para =~/\{(?:t|table)~h(?:\sc\d+;)?[\d; ]*\}/
+ "<!Th¡ c#{@row[2].length}; #{widths}!>"
+ elsif para =~/\{(?:t|table)(?:\sc\d+;)?[\d; ]*\}/
+ "<!T¡ c#{@row[2].length}; #{widths}!>"
+ end
+ @row.each do |l|
+ l << '' if l.length == (@row[1].length - 1)
+ table=[]
+ if l.length == @row[1].length
+ table << '<!' #'<tr>'
+ n= -1
+ l.each do |c|
+ n +=1 #'<td>' + c + '</td>'
+ table << if c =~/\A(?:\n)?\s*\Z/
+ "¡¡#{w[n]}¡" + ' '
+ else
+ "¡¡#{w[n]}¡" + c.strip
+ end
+ end
+ table << '!>' #'</tr>'
+ tuned_file << table.join
+ end
+ end
+ tuned_file << '<!TZ!>' #'</table>'
+ tuned_file=tuned_file.compact.join("\n")
+ end
+ def tables
+ data=@data
+ count=0
+ @row,@tuned_file,@tuned_table=[],[],[]
+ data.each do |para|
+ para.gsub!(/\n\s+\n/,"\n")
+ para.gsub!(/\s+\n/,"\n")
+ para.gsub!(/<:hi>/,'<span style="background-color: rgb(255,240,196)">') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200)
+ para.gsub!(/<:\/hi>/,%{</span>})
+ table=[]
+ if para =~/^\{(?:t|table)(?:~h)?(?:\sc\d+;)?[\d; ]*\}/
+ @tuned_file << table_visual(para)
+ @tuned_file=@tuned_file.flatten
+ elsif @@flag['table_to'] or para[/table\{(?:~h)?/]
+ if para[/table\{(?:~h)?\s+c(\d+;.+)/]
+ instructions=$1
+ @@column=instructions.split(/;\s*/)
+ @@columns=@@column[0]
+ para.gsub!(/table\{~h\s+(c\d+?;.+?)$/,'<!Th¡ \1!>')
+ para.gsub!(/table\{\s+(c\d+?;.+?)$/,'<!T¡ \1!>')
+ @@flag['table_to']=true
+ end
+ if @@flag['table_to'] and para =~/\}table/
+ para.gsub!(/^\}table\s*$/,"<!TZ!>\n")
+ para.gsub!(/\n/,' ') #newlines taken out
+ para.strip!
+ @tuned_table << para
+ @tuned_table.delete('')
+ @tuned_file << @tuned_table.compact.join("\n") #@tuned_table.compact.join =~/\S+/ #would be preferable
+ para=''
+ @tuned_table=[]
+ @@flag['table_to']=false
+ end
+ if @@flag['table_to'] and para =~/\S/
+ @@counter=1
+ sub_array=para.dup
+ @@line_mode=sub_array.scan(/.+/)
+ Tables.new(@md,@@line_mode).tr_td
+ para=@@line_mode.join
+ para.gsub!(/(.*\S+.*)\Z/m,'<!\1!>') unless para =~/<!Th?¡/
+ end
+ para.gsub!(/\n/,' ')
+ para.strip!
+ @tuned_table << para
+ else
+ para.gsub!(/\n/,' ') unless para =~/<:(?:code|verse|alt|group)>/
+ para.strip!
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ @tuned_file
+ end
+ def tr_td
+ data=@data
+ data.each do |line|
+ if @@counter <= @@columns.to_i and line !~/(\}T\s*$|<:table[-_](close|end)>|<!TZ!>)/
+ line.gsub!(/(.+)/,"¡¡#{@@column[@@counter]}¡\\1") unless line =~/<!Th?¡/
+ @@counter+=1
+ end
+ end
+ data
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/dal_syntax.rb b/lib/sisu/0.52/dal_syntax.rb
new file mode 100644
index 00000000..53d55da2
--- /dev/null
+++ b/lib/sisu/0.52/dal_syntax.rb
@@ -0,0 +1,330 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: Syntax for markup, input markup syntaxes, determined here
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module Syntax
+ class Words
+ def initialize(line,md,mkp)
+ @line,@md,@mkp=line,md,mkp
+ end
+ end
+ class Markup
+ def initialize(md='',data='')
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @data_new=[]
+ @http_m='\{.+?\}http://\S+|http:\S+|\.\.\/\S+|\S+?\.png\b|[*]~\S+|^0~.+|<:(?:code|group|alt|verse)(?:-end)?>|<:br>'
+ @manmkp_ital='[i/]\\{.+?\\}[i/]'
+ tail_m_ital=%q{(?:\s|[.,;:?!'")]|~\^|~\\\{\s|$)}
+ tail_m_bold=%q{(?:(?:<\/i>)?(?:\s|[.,;:?!'")]|~\^|~\\\{\s|$))?}
+ bold_line=%q{^!_\s.+?(?:\n|$)}
+ @line_scan_ital=if defined? @md.make_italic[:str] and defined? @vz.markup_make_italic[:str]
+ /#@http_m|#{bold_line}|#@manmkp_ital#{tail_m_ital}|(?:#{@md.make_italic[:str]}|#{@vz.markup_make_italic[:str]})#{tail_m_ital}|\S+|\n/
+ elsif defined? @md.make_italic[:str]
+ /#@http_m|#{bold_line}|#@manmkp_ital#{tail_m_ital}|#{@md.make_italic[:str]}#{tail_m_ital}|\S+|\n/
+ elsif defined? @vz.markup_make_italic[:str]
+ /#@http_m|#{bold_line}|#@manmkp_ital#{tail_m_ital}|#{@vz.markup_make_italic[:str]}#{tail_m_ital}|\S+|\n/
+ end
+ @manmkp_bold='^!_\s.+?(?:\n|$)|[*!b]\\{.+?\\}[*!b]|[*!][a-zA-Z0-9\-_]+[*!]'
+ @line_scan_bold=if (defined? @md.make_bold[:str] and @md.make_bold[:str]) and (defined? @vz.markup_make_bold[:str] and @vz.markup_make_bold[:str])
+ /#@http_m|#{bold_line}|(?:#@manmkp_bold|#{@md.make_bold[:str]}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/
+ elsif defined? @md.make_bold[:str] and @md.make_bold[:str]
+ /#@http_m|#{bold_line}|(?:#@manmkp_bold|#{@md.make_bold[:str]})#{tail_m_bold}|\S+|\n/
+ elsif defined? @vz.markup_make_bold[:str] and @vz.markup_make_bold[:str]
+ /#@http_m|#{bold_line}|(?:#@manmkp_bold|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/
+ end
+ end
+ def songsheet
+ @data.each do |line|
+ line=pre(line)
+ line=wordlist_italics(line)
+ line=wordlist_bold(line)
+ line=bodymarkup(line)
+ @data_new << line
+ end
+ @data_new
+ end
+ def pre(line)
+ line=line.dup
+ if line =~/\{(?:t|table)(?:~h)?\s*c?[\d; ]*\}/; line.gsub!(/(\n)/,';;\1') #markup for alternative tables
+ end
+ line
+ end
+ def wordlist_italics(line)
+ line=line.dup
+ if (defined? @md.make_italic[:str] and @md.make_italic[:str]) \
+ or (defined? @vz.markup_make_italic[:str] and @vz.markup_make_italic[:str])
+ line= if line !~/^(0~|%{1,4}\s)/ #!~/^(?:[0-6]~|!_|%+\s)/
+ word=line.scan(@line_scan_ital)
+ word.flatten!
+ word.compact! #reinstated
+ line_array=[]
+ word.each do |w|
+ unless /#@manmkp_ital|#@http_m/.match(w)
+ if defined? @md.make_italic[:regx] and @md.make_italic[:regx]
+ w.gsub!(@md.make_italic[:regx],'<i>\1</i>')
+ elsif defined? @vz.markup_make_italic and @vz.markup_make_italic
+ w.gsub!(@vz.markup_make_italic,'<i>\1</i>')
+ end
+ end
+ line_array << w
+ end
+ line_array.join(' ')
+ else line
+ end
+ end
+ line
+ end
+ def embolden(given)
+ given.gsub!(/(?:^!_|^[789]~)\s+(.+?)\s+((?:[*]~\S+\s*)+)/,'<b>\1</b> \2')
+ given.gsub!(/(?:^!_|^[789]~)\s+(.+?)\s*([~-]#)$/,'<b>\1</b> \2')
+ given.gsub!(/(?:^!_\s+|^[789]~\s+)(.*)?\s*$/,'<b>\1</b>')
+ end
+ def wordlist_bold(line)
+ line=line.dup
+ if (defined? @md.make_bold[:str] and @md.make_bold[:str]) or (defined? @vz.markup_make_bold[:str] and @vz.markup_make_bold[:str])
+ line=if line !~/^(?:[0-9]~|%+\s)/
+ line_array=[]
+ word=line.scan(@line_scan_bold)
+ word.flatten!
+ word.compact!
+ word.each do |w|
+ unless /#@manmkp_bold|#@http_m/.match(w)
+ if defined? @md.make_bold[:regx] and @md.make_bold[:regx] #document header: 0~bold [bold word list]
+ w.gsub!(@md.make_bold[:regx],'<b>\1</b>')
+ elsif defined? @vz.markup_make_bold and @vz.markup_make_bold #defaults and skin adjusted bold word list
+ w.gsub!(@vz.markup_make_bold,'<b>\1</b>')
+ end
+ else
+ if w =~ /(?:^!_|^[789]~)\s+/; embolden(w) #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost!
+ end
+ end
+ line_array << w
+ end
+ line_array.join(' ')
+ else line
+ end
+ else
+ if line !~/^(?:[0-9]~|%+\s)/ and line =~ /(?:^!_|^[789]~)\s+/; embolden(line)
+ end
+ end
+ line
+ end
+ def bodymarkup(line)
+ # << http://www.jus.uio.no/sisu/sisu_markup_table/markup >>
+ # See: data/sisu/sample/document_samples_sisu_markup/
+ # !{emphasis}! e{emphasis}e <strong>emphasis</strong>
+ # *{bold text}* b{bold}b <b>bold text</b>
+ # _{underline}_ u{underline}u <u>underline</u>
+ # /{italics}/ i{italics}i <i>italics</i>
+ # "{citation}" c{citation}c <cite>citation</cite> #blockquote?
+ # ^{superscript}^ <sup>superscript</sup>
+ # ,{subscript}, <sub>subscript</sub>
+ # +{inserted text}+ <ins>inserted text</ins>
+ # -{deleted text}- <del>deleted text</del>
+ # {url address}:url
+ # {image.png}imageurl
+ # {image.png}png
+ # ~{endnote}~ <!e endnote !>
+ # !_ #bold/emphasise paragraph
+ # _" #blockquote paragraph
+ # _1 <!i1!> #indent paragraph 1 step
+ # _2 <!i2!> #indent paragraph 2 steps
+ # _* #bullet (list)
+ # _1* #bullet (list) indented
+ # _1* #bullet (list) indented
+ # # #numbered (list) level 1
+ # _# #numbered (list) level 2
+ line=line.dup
+ unless line =~/^0~|<:codeline>|<:code-end>/
+ #special characters: ~ { } < > - _ / also used : ^ ! #
+ line_array=[]
+ line.gsub!(/^%{1,4} .+/mi,'') #remove comments
+ word=line.scan(/\S+|\n/) unless line =~/^(?:0~\S|%+\s)/
+ if word
+ word.each do |w| # _ - / # | : ! ^ ~
+ unless w =~/^[0-9]~|~\{|\}~|~\[|\]~|^\^~|~\^|\*~\S+|~#|\{t?~|\{table/
+ w.gsub!(/\\~/,'&#126;') #escaped special character
+ w.gsub!(/~/,'&#126;')
+ end
+ w.gsub!(/^\<$/,'&lt;') #escaped special character
+ w.gsub!(/^\>$/,'&gt;') #escaped special character
+ line_array << w
+ end
+ line=line_array.join(' ')
+ line=line.strip
+ end
+ line.gsub!(/<(https?:\/\/\S+?)>/,'< \1 >') #catch problem markup
+ line.gsub!(/<:=(\S+?)>/,'{ c_\1.png 14x14 }http://www.jus.uio.no/sisu') #adjustment 2005w30
+ line.gsub!(/<!(\S+)!>/,'<:\1>') #escaped special character
+ line.gsub!(/\\~/,'&#126;') #escaped special character
+ line.gsub!(/\\\{/,'&#123;') #escaped special character
+ line.gsub!(/\\\}/,'&#125;') #escaped special character
+ line.gsub!(/\\\<</,'&lt;&lt;') #escaped special character
+ line.gsub!(/\\\>>/,'&gt;&gt;') #escaped special character
+ line.gsub!(/\\\</,'&lt;') #escaped special character
+ line.gsub!(/\\\>/,'&gt;') #escaped special character
+ line.gsub!(/\\\_/,'&#095;') #escaped special character
+ line.gsub!(/\\\-/,'&#045;') #escaped special character
+ line.gsub!(/\\\+/,'&#043;') #escaped special character
+ line.gsub!(/\\\//,'&#047;') #escaped special character
+ line.gsub!(/\\\#/,'&#035;') #escaped special character
+ line.gsub!(/\\\&/,'&#038;') #&amp; #escaped special character
+ line.gsub!(/\\\|/,'&#124;') #not really a sisu special character but made available as possibility
+ line.gsub!(/\\\:/,'&#058;') #not really a sisu special character but made available as possibility
+ line.gsub!(/\\\!/,'&#033;') #not really a sisu special character but made available as possibility
+ line.gsub!(/\\\^/,'&#094;') #not really a sisu special character but made available as possibility
+ line.gsub!(/\\\,/,'&#044;') #not really a sisu special character but made available as possibility
+ #ADD -->
+ line.gsub!(/\\\\/,'&#092;') #escaped special character
+ line.gsub!(/\\\*/,'&#042;') #escaped special character
+ line.gsub!(/\\\!/,'&#033;') #escaped special character
+ line.gsub!(/(?:^| )\*~([a-z0-9._-]+)/i,' <:name#\1>') #html name marker <a name="\\1"></a>
+ line.gsub!(/^([56]~)(\S+)(.+)/,'\1\2 \3 <:name#\2>') #html name marker <a name="\\1"></a>, however at present takes you to correct position within sub-toc, will nneed to clean from sub-toc leaving in main body only
+ line.gsub!(/(^| )\{~\^ (.+?)\s*\}((?:https?|ftp):\S+)\s+~\{(.+?)\}~/,'\1{ \2 }\3 ~{ \3 \4 }~') # watch
+ line.gsub!(/(^| )\{~\^ (.+?)\s*\}((?:https?|ftp):\S+?)(,?)?(?:\s|$)/,'\1{ \2 }\3\4 ~{ \3 }~ ') #text url endnote url shortcut {~^ [text] }http://url is { [text] }http://url ~{ http://url }~ [plus adjustment for commas]
+ line.gsub!(/<:?br>/,'<br />') #xml requires
+ # depreciated -->
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)e\{(.+?)\}e/,'\1<b>\2</b>') #emphasis
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)b\{(.+?)\}b/,'\1<b>\2</b>') #bold
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)u\{(.+?)\}u/,'\1<u>\2</u>') #underscore
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)c\{(.+?)\}c/,'\1<cite>\2</cite>') #cite /blockquote?
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)i\{(.+?)\}i/,'\1<i>\2</i>') #italics
+ # depreciated ^
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)!\{(.+?)\}!/,'\1<em>\2</em>') #emphasis
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)\*\{(.+?)\}\*/,'\1<b>\2</b>') #bold
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[\{]|\>)_\{(.+?)\}_/,'\1<u>\2</u>') #underscore
+ line.gsub!(/(^|\s+|['"]|&nbsp;|[\(\[]|\(|\>)\/\{(.+?)\}\//,'\1<i>\2</i>') #italics
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)\"\{(.+?)\}\"/,'\1<cite>\2</cite>') #cite /blockquote?
+ line.gsub!(/(^|[^\\])\^\{(.+?)\}\^/,'\1<sup>\2</sup>') #superscript
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>|\S)9\{(.+?)\}9/,'\1<sup>\2</sup>') #superscript
+ line.gsub!(/(^|[^\\]),\{(.+?)\},/,'\1<sub>\2</sub>') #subscript
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)6\{(.+?)\}6/,'\1<sub>\2</sub>') #subscript
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)\+\{(.+?)\}\+/,'\1<ins>\2</ins>') #inserted text
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)v\{(.+?)\}v/,'\1<ins>\2</ins>') #inserted text
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)-\{(.+?)\}-/,'\1<del>\2</del>') #strikethrough - deleted text
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)x\{(.+?)\}x/,'\1<del>\2</del>') #deleted text
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)\*(\S+?)\*/,'\1<b>\2</b>') #bold single word, watch
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)\!(\S+?)\!/,'\1<b>\2</b>') #bold single word, watch
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)\/([\(\)a-zA-Z0-9']+?)\/([^a-zA-Z0-9]|[ ,.;:'"~$]|$)/,'\1<i>\2</i>\3') #italics single word, watch
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>)_(\S+?)_/,'\1<u>\2</u>') #underscore single word, watch
+ line.gsub!(/(^|\s+)-([^{]\S+?)-( |$)/,'\1<del>\2</del>\3') #underscore single word, watch
+ line.gsub!(/(^|\s+|['"]|&nbsp;|\(|\>|\d+)\^(\S+?)\^/,'\1<sup>\2</sup>') #superscript single word, watch digit added
+ line.gsub!(/<[:e]\s+(.+?)!?>/,'~{ \1 }~') # not tested
+ line.gsub!(/^\s*_([12])(\*+)\s*/,'<:i\1> _* ') #bullets, shortcut
+ line.gsub!(/^\s*_([12])\s+/,'<:i\1> ') #indent
+ line.gsub!(/(?:<br>|<br \/>)\s*_[12]\s+/,'<br> ') #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ')
+ #line.gsub!(/^\s*_([12])\s+/,"<:i\\1> ")
+ #line.gsu!b!(/^\s*_([12])\s+/,"<!i\\1!> ") #indent line
+ line.gsub!(/<:?br>/,'<br />') #adjustment 2004w41, from # line.gsub!(/<br>/,'<br />')
+ ##added
+ #line.gsub!(/(?:^!_\s+|^[78]~\s+|<:b>)(.*)?([~-]#)$/i,"<b>\\1</b> \\2") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost!
+ #line.gsub!(/(?:^!_\s+|^[78]~\s+|<:b>)(.*)?\s*$/i,"<b>\\1</b>") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost!
+ #line.gsub!(/(?:(?:^| )!_ |^[78]~ |<:b>)(.*)\n/mi,"<b>\\1</b> ") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost!
+ #line.gsub!(/^_" (.*)\n/i,"<blockquote>\\1</blockquote> ") #blockquotes #introduce KEEP
+ line.gsub!(/<:hi>/,'<span style="background-color: rgb(255,240,196)">') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200)
+ line.gsub!(/<:\/hi>/,'</span>')
+ line.gsub!(/(<:verse>.+)/m,"\\1\n")
+ line.gsub!(/[ ]+($)/,'\1')
+ if line =~/(<:(?:verse|group)>)/; line.gsub!(/(<:(?:verse|group)>)/i,"\\1\n") #cosmetic
+ else line.gsub!(/(<br \/>)/i,"\\1\n")
+ end
+ else
+ line.gsub!(/<:codeline>/,"\n")
+ end
+ line
+ end
+ def tech #script markup planned to be more strict for technical documents
+ # !{emphasis}! e{emphasis}e <strong>emphasis</strong>
+ # *{bold text}* b{bold}b <b>bold text</b>
+ # _{underline}_ u{underline}u <u>underline</u>
+ # /{italics}/ i{italics}i <i>italics</i>
+ # "{citation}" c{citation}c <cite>citation</cite>
+ # ^{superscript}^ <sup>superscript</sup>
+ # ,{subscript}, <sub>subscript</sub>
+ # +{inserted text}+ <ins>inserted text</ins>
+ # -{deleted text}- <del>deleted text</del>
+ # {url address}:url
+ # {image.png}imageurl
+ # {image.png}png
+ # ~{endnote}~ <!e endnote !>
+ # +1 <!i1!>
+ # +2 <!i2!>
+ puts 'tech'
+ @data.each do |line|
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)e\{(.+?)\}e/,'\1<b>\2</b>') #emphasis
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)b\{(.+?)\}b/,'\1<b>\2</b>') #bold
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)u\{(.+?)\}u/,'\1<u>\2</u>') #underscore
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)c\{(.+?)\}c/,'\1<cite>\2</cite>') #cite
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)i\{(.+?)\}i/,'\1<i>\2</i>') #italics
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)!\{(.+?)\}!/,'\1<em>\2</em>') #emphasis
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)\*\{(.+?)\}\*/,'\1<b>\2</b>') #bold
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\>)_\{(.+?)\}_/,'\1<u>\2</u>') #underscore
+ line.gsub!(/(^|\s+|['"]|[\(\[]|\(|\>)\/\{(.+?)\}\//,'\1<i>\2</i>') #italics
+ line.gsub!(/(^|\s+|['"]|\(|\>)\"\{(.+?)\}\"/,'\1<cite>\2</cite>')
+ line.gsub!(/(^|\s+|['"]|\(|\>|\S)\^\{(.+?)\}\^/,'\1<sup>\2</sup>')
+ line.gsub!(/(^|\s+|['"]|\(|\>|\S)9\{(.+?)\}9/,'\1<sup>\2</sup>')
+ line.gsub!(/(^|\s+|['"]|\(|\>),\{(.+?)\},/,'\1<sub>\2</sub>')
+ line.gsub!(/(^|\s+|['"]|\(|\>)6\{(.+?)\}6/,'\1<sub>\2</sub>')
+ line.gsub!(/(^|\s+|['"]|\(|\>)\+\{(.+?)\}\+/,'\1<ins>\2</ins>')
+ line.gsub!(/(^|\s+|['"]|\(|\>)v\{(.+?)\}v/,'\1<ins>\2</ins>')
+ line.gsub!(/(^|\s+|['"]|\(|\>)-\{(.+?)\}-/,'\1<del>\2</del>')
+ line.gsub!(/(^|\s+|['"]|\(|\>)x\{(.+?)\}x/,'\1<del>\2</del>')
+ line.gsub!(/(^|\s+|['"]|\(|\>)\*(\S+?)\*/,'\1<b>\2</b>') #bold single word, watch
+ line.gsub!(/(^|\s+|['"]|\(|\>)\!(\S+?)\!/,'\1<b>\2</b>') #bold single word, watch
+ line.gsub!(/(^|\s+|['"]|\(|\>)\/([\(\)a-zA-Z0-9']+?)\/([ ,.;:'"~$]|[^a-zA-Z0-9])/,'\1<i>\2</i>\3') #italics single word, watch
+ line.gsub!(/(^|\s+|['"]|\(|\>)_(\S+?)_/,'\1<u>\2</u>') #underscore single word, watch
+ line.gsub!(/(^|\s+|['"]|\(|\>|\d+)\^(\S+?)\^/,'\1<sup>\2</sup>') #superscript single word, watch digit added
+ line.gsub!(/^\s*_([12])(\*+)\s*/,"<:i\\1> _* ") # bullets, shortcut
+ line.gsub!(/^\s*_([12])\s+/,'<:i\1> ')
+ line.gsub!(/<:?br>/,'<br />')
+ end
+ @data
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_columns.rb b/lib/sisu/0.52/db_columns.rb
new file mode 100644
index 00000000..295e1ae2
--- /dev/null
+++ b/lib/sisu/0.52/db_columns.rb
@@ -0,0 +1,209 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_columns
+ class Column_size
+ def lt_title
+ 320
+ end
+ def lt_subtitle
+ 320
+ end
+ def lt_creator
+ 200
+ end
+ def lt_illustrator
+ 200
+ end
+ def lt_translator
+ 200
+ end
+ def lt_prepared_by
+ 200
+ end
+ def lt_digitized_by
+ 200
+ end
+ def lt_subject
+ 400
+ end
+ def lt_date
+ 10
+ end
+ def lt_date_created
+ 10
+ end
+ def lt_date_issued
+ 10
+ end
+ def lt_date_available
+ 10
+ end
+ def lt_date_modified
+ 10
+ end
+ def lt_date_valid
+ 10
+ end
+ def lt_type
+ 100
+ end
+ def lt_description
+ 800
+ end
+ def lt_publisher
+ 120
+ end
+ def lt_contributor
+ 120
+ end
+ def lt_format
+ 100
+ end
+ def lt_identifier
+ 100
+ end
+ def lt_source
+ 100
+ end
+ def lt_language
+ 30
+ end
+ def lt_language_char
+ 3
+ end
+ def lt_language_original
+ 30
+ end
+ def lt_language_original_char
+ 3
+ end
+ def lt_relation
+ 100
+ end
+ def lt_coverage
+ 100
+ end
+ def lt_rights
+ 800
+ end
+ def lt_copyright
+ 200
+ end
+ def lt_owner
+ 100
+ end
+ def lt_keywords
+ 200
+ end
+ def lt_comment
+ 600
+ end
+ def lt_loc
+ 30
+ end
+ def lt_dewey
+ 30
+ end
+ def lt_isbn
+ 16
+ end
+ def lt_pg
+ 10
+ end
+ def lt_abstract
+ 600
+ end
+ def lt_skin
+ 100
+ end
+ def lt_markup
+ 100
+ end
+ def lt_links
+ 100
+ end
+ def lt_information
+ 100
+ end
+ def lt_contact
+ 100
+ end
+ def lt_suffix
+ 600
+ end
+ def lt_filename
+ 256
+ end
+ def lt_types
+ 1
+ end
+ def lt_subj
+ 64
+ end
+ def document_clean # restriction not necessary #12000 #2712
+ 60000
+ end
+ def document_body
+ 16000
+ end
+ def document_seg
+ 120
+ end
+ def document_seg_full
+ 120
+ end
+ def endnote_clean # restriction not necessary #12000 #2712
+ 60000
+ end
+ def endnote_body
+ 16000
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_create.rb b/lib/sisu/0.52/db_create.rb
new file mode 100644
index 00000000..d5fab27d
--- /dev/null
+++ b/lib/sisu/0.52/db_create.rb
@@ -0,0 +1,530 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_create
+ require SiSU_lib + '/db_columns'
+ class Create < SiSU_DB_columns::Column_size
+ require SiSU_lib + '/sysenv'
+ @@dl=nil
+ def initialize(opt,conn='',sql_type='pg')
+ @opt,@conn,@sql_type=opt,conn,sql_type
+ @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX
+ @comment=comment
+ @@dl ||=SiSU_Env::Info_env.new.digest.length
+ end
+ def available
+ DBI.available_drivers.each do |driver|
+ puts "Driver: #{driver}"
+ DBI.data_sources(driver).each do |dsn|
+ puts "\tDatasource: #{dsn}"
+ end
+ end
+ end
+ def create_db
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Create PG db:',%{"SiSU_#{@env.path.stub_pwd}"})
+ tell.colorize unless @opt.cmd =~/q/
+ SiSU_Env::System_call.new.create_pg_db(@env.path.stub_pwd) #watch use of path.stub_pwd instead of stub
+ end
+ def comment
+ @comment=Hash.new('')
+ case @sql_type
+ when /pg/
+ @comment['metadata'] =%{
+ COMMENT ON Table metadata
+ IS 'contains SiSU documents metadata with metadata';
+ COMMENT ON COLUMN metadata.tid
+ IS 'unique';
+ COMMENT ON COLUMN metadata.filename
+ IS 'document filename';
+ COMMENT ON COLUMN metadata.title
+ IS 'metadata title (dublin core element 1)';
+ COMMENT ON COLUMN metadata.subtitle
+ IS 'document subtitle';
+ COMMENT ON COLUMN metadata.creator
+ IS 'metadata creator (dublin core element 2)';
+ COMMENT ON COLUMN metadata.illustrator
+ IS 'metadata illustrator';
+ COMMENT ON COLUMN metadata.translator
+ IS 'metadata translator';
+ COMMENT ON COLUMN metadata.subject
+ IS 'metadata subject (dublin core element 3)';
+ COMMENT ON COLUMN metadata.date
+ IS 'metadata date (dublin core element 7)';
+ COMMENT ON COLUMN metadata.date_created
+ IS 'metadata date created (dublin core)';
+ COMMENT ON COLUMN metadata.date_issued
+ IS 'metadata date of issue (dublin core)';
+ COMMENT ON COLUMN metadata.date_available
+ IS 'metadata date available (dublin core)';
+ COMMENT ON COLUMN metadata.date_valid
+ IS 'metadata date valid (dublin core)';
+ COMMENT ON COLUMN metadata.date_modified
+ IS 'metadata date modified (dublin core)';
+ COMMENT ON COLUMN metadata.type
+ IS 'metadata type (dublin core element 8)';
+ COMMENT ON COLUMN metadata.description
+ IS 'metadata description (dublin core element 4)';
+ COMMENT ON COLUMN metadata.publisher
+ IS 'metadata publisher (dublin core element 5)';
+ COMMENT ON COLUMN metadata.contributor
+ IS 'metadata contributor (dublin core element 6)';
+ COMMENT ON COLUMN metadata.prepared_by
+ IS 'metadata markup prepared by';
+ COMMENT ON COLUMN metadata.digitized_by
+ IS 'metadata digitized by';
+ COMMENT ON COLUMN metadata.format
+ IS 'metadata format (dublin core element 9)';
+ COMMENT ON COLUMN metadata.identifier
+ IS 'metadata identifier (dublin core element 10)';
+ COMMENT ON COLUMN metadata.source
+ IS 'metadata source (dublin core element 11)';
+ COMMENT ON COLUMN metadata.language
+ IS 'metadata language (dublin core element 12)';
+ COMMENT ON COLUMN metadata.language_original
+ IS 'metadata original language';
+ COMMENT ON COLUMN metadata.relation
+ IS 'metadata (dublin core element 13)';
+ COMMENT ON COLUMN metadata.coverage
+ IS 'metadata coverage (dublin core element 14)';
+ COMMENT ON COLUMN metadata.rights
+ IS 'metadata rights / copyright / license (dublin core element 15)';
+ COMMENT ON COLUMN metadata.owner
+ IS 'metadata owner';
+ COMMENT ON COLUMN metadata.keywords
+ IS 'metadata keywords';
+ COMMENT ON COLUMN metadata.comment
+ IS 'metadata comment';
+ COMMENT ON COLUMN metadata.abstract
+ IS 'metadata abstract';
+ COMMENT ON COLUMN metadata.loc
+ IS 'metadata library of congress';
+ COMMENT ON COLUMN metadata.dewey
+ IS 'metadata dewey';
+ COMMENT ON COLUMN metadata.isbn
+ IS 'metadata isbn';
+ COMMENT ON COLUMN metadata.pg
+ IS 'metadata project gutenberg number';
+ COMMENT ON COLUMN metadata.prefix_a
+ IS 'metadata prefix';
+ COMMENT ON COLUMN metadata.prefix_b
+ IS 'metadata prefix';
+ COMMENT ON COLUMN metadata.skin
+ IS 'metadata sisu skin';
+ COMMENT ON COLUMN metadata.markup
+ IS 'metadata markup source';
+ COMMENT ON COLUMN metadata.links
+ IS 'metadata links';
+ COMMENT ON COLUMN metadata.information
+ IS 'metadata information';
+ COMMENT ON COLUMN metadata.contact
+ IS 'metadata contact';
+ COMMENT ON COLUMN metadata.suffix
+ IS 'metadata sisu suffix (output related)';
+ COMMENT ON COLUMN metadata.filename
+ IS 'metadata source filename';
+ COMMENT ON COLUMN metadata.types
+ IS 'document types scroll 1, seg 2, both 3';
+ COMMENT ON COLUMN metadata.subj
+ IS 'subject areas - no way to populate at present as not mapped';
+/*
+ CREATE FUNCTION fileremoval() RETURNS opaque AS '
+ BEGIN
+ DELETE FROM metadata WHERE tid=#@removetid;
+ DELETE FROM documents WHERE documents.metadata_tid=#@removetid;
+ DELETE FROM endnotes WHERE endnotes.metadata_tid=#@removetid;
+ DELETE FROM endnotes_asterisk WHERE endnotes_asterisk.metadata_tid=#@removetid;
+ DELETE FROM endnotes_plus WHERE endnotes_plus.metadata_tid=#@removetid;
+ DELETE FROM urls WHERE urls.metadata_tid=#@removetid;
+ END;
+ ' LANGUAGE 'plpgsql';
+ CREATE TRIGGER removefile AFTER INSERT
+ PROCEDURE fileremoval();
+*/
+ }
+ @comment['documents'] =%{
+ COMMENT ON Table documents
+ IS 'contains searchable text of SiSU documents';
+ COMMENT ON COLUMN documents.lid
+ IS 'unique';
+ COMMENT ON COLUMN documents.metadata_tid
+ IS 'tie to title in metadata';
+ COMMENT ON COLUMN documents.lev
+ IS 'doc level 1-6 \d\~';
+ COMMENT ON COLUMN documents.seg
+ IS 'segment name from level 4';
+ COMMENT ON COLUMN documents.ocn
+ IS 'object citation number';
+ COMMENT ON COLUMN documents.en_a
+ IS 'first endnote number in text object (eg. NULL or 34) (used with en_z to create range)';
+ COMMENT ON COLUMN documents.en_z
+ IS 'last endnote number within text object (eg. NULL, 34 or say 47) (used with en_a to create range)';
+ COMMENT ON COLUMN documents.en_a_asterisk
+ IS 'first endnote number in text object (eg. NULL or 34) (used with en_z_asterisk to create range)';
+ COMMENT ON COLUMN documents.en_z_asterisk
+ IS 'last endnote number within text object (eg. NULL, 34 or say 47) (used with en_a_asterisk to create range)';
+ COMMENT ON COLUMN documents.en_a_plus
+ IS 'first endnote number in text object (eg. NULL or 34) (used with en_z_plus to create range)';
+ COMMENT ON COLUMN documents.en_z_plus
+ IS 'last endnote number within text object (eg. NULL, 34 or say 47) (used with en_a_plus to create range)';
+ COMMENT ON COLUMN documents.types
+ IS 'document types seg scroll';
+ COMMENT ON COLUMN documents.clean
+ IS 'text object - substantive text: clean, stripped of markup';
+ COMMENT ON COLUMN documents.body
+ IS 'text object - substantive text: light html markup';
+ COMMENT ON COLUMN documents.lev1
+ IS 'document structure, level 1';
+ COMMENT ON COLUMN documents.lev2
+ IS 'document structure, level 2';
+ COMMENT ON COLUMN documents.lev3
+ IS 'document structure, level 3';
+ COMMENT ON COLUMN documents.lev4
+ IS 'document structure, level 4';
+ COMMENT ON COLUMN documents.lev5
+ IS 'document structure, level 5';
+ COMMENT ON COLUMN documents.lev6
+ IS 'document structure, level 6';
+ }
+ @comment['endnotes'] =%{
+ COMMENT ON Table endnotes
+ IS 'contains searchable text of SiSU documents endnotes';
+ COMMENT ON COLUMN endnotes.nid
+ IS 'unique';
+ COMMENT ON COLUMN endnotes.document_lid
+ IS 'ties to text block from which referenced';
+ COMMENT ON COLUMN endnotes.nr
+ IS 'endnote number <!e_(\d+)!>';
+ COMMENT ON COLUMN endnotes.clean
+ IS 'endnote substantive content, stripped of markup';
+ COMMENT ON COLUMN endnotes.body
+ IS 'endnote substantive content';
+ COMMENT ON COLUMN endnotes.ocn
+ IS 'object citation no# <\~(\d+)> from which endnote is referenced';
+ COMMENT ON COLUMN documents.metadata_tid
+ IS 'tie to title in metadata - unique for each document';
+ }
+ @comment['endnotes_asterisk'] =%{
+ COMMENT ON Table endnotes_asterisk
+ IS 'contains searchable text of SiSU documents endnotes asterisk';
+ COMMENT ON COLUMN endnotes_asterisk.nid
+ IS 'unique';
+ COMMENT ON COLUMN endnotes_asterisk.document_lid
+ IS 'ties to text block from which referenced';
+ COMMENT ON COLUMN endnotes_asterisk.nr
+ IS 'endnote number <!e_(\d+)!>';
+ COMMENT ON COLUMN endnotes_asterisk.clean
+ IS 'endnote substantive content, stripped of markup';
+ COMMENT ON COLUMN endnotes_asterisk.body
+ IS 'endnote substantive content';
+ COMMENT ON COLUMN endnotes_asterisk.ocn
+ IS 'object citation no# <\~(\d+)> from which endnote is referenced';
+ COMMENT ON COLUMN documents.metadata_tid
+ IS 'tie to title in metadata - unique for each document';
+ }
+ @comment['endnotes_plus'] =%{
+ COMMENT ON Table endnotes_plus
+ IS 'contains searchable text of SiSU documents endnotes';
+ COMMENT ON COLUMN endnotes_plus.nid
+ IS 'unique';
+ COMMENT ON COLUMN endnotes_plus.document_lid
+ IS 'ties to text block from which referenced';
+ COMMENT ON COLUMN endnotes_plus.nr
+ IS 'endnote number <!e_(\d+)!>';
+ COMMENT ON COLUMN endnotes_plus.clean
+ IS 'endnote substantive content, stripped of markup';
+ COMMENT ON COLUMN endnotes_plus.body
+ IS 'endnote substantive content';
+ COMMENT ON COLUMN endnotes_plus.ocn
+ IS 'object citation no# <\~(\d+)> from which endnote is referenced';
+ COMMENT ON COLUMN documents.metadata_tid
+ IS 'tie to title in metadata - unique for each document';
+ }
+ @comment['urls'] =%{
+ COMMENT ON Table urls
+ IS 'contains base url links to different SiSU output';
+ COMMENT ON COLUMN documents.metadata_tid
+ IS 'tie to title in metadata - unique for each document, the mapping of rows is one to one';
+ COMMENT ON COLUMN urls.plaintext
+ IS 'plaintext utf-8';
+ COMMENT ON COLUMN urls.html_toc
+ IS 'table of contents for segmented html document';
+ COMMENT ON COLUMN urls.html_doc
+ IS 'html document (scroll)';
+ COMMENT ON COLUMN urls.xhtml
+ IS 'xhtml document (scroll)';
+ COMMENT ON COLUMN urls.xml_sax
+ IS 'xml sax oriented document (scroll)';
+ COMMENT ON COLUMN urls.xml_dom
+ IS 'xml dom oriented document (scroll)';
+ COMMENT ON COLUMN urls.odf
+ IS 'opendocument format text';
+ COMMENT ON COLUMN urls.pdf_p
+ IS 'pdf portrait';
+ COMMENT ON COLUMN urls.pdf_l
+ IS 'pdf landscape';
+ COMMENT ON COLUMN urls.concordance
+ IS 'rudimentary document index linked to html';
+ COMMENT ON COLUMN urls.latex_p
+ IS 'latex portrait';
+ COMMENT ON COLUMN urls.latex_l
+ IS 'latex_landscape';
+ COMMENT ON COLUMN urls.markup
+ IS 'markup';
+ COMMENT ON COLUMN urls.sisupod
+ IS 'SiSU document format .tgz (all SiSU information on document)';
+ }
+ end
+ @comment
+ end
+ def output_dir?
+ dir=SiSU_Env::Info_env.new('')
+ if @opt.cmd =~/d/; dir.path.webserv_stub_ensure
+ end
+ end
+ def create_table_metadata
+ print %{
+ currently using sisu dbi module
+ to be populated from documents files
+ create tables metadata
+ data import through ruby transfer
+ } unless @opt.cmd =~/q/
+ @conn.execute(%{
+ CREATE TABLE metadata (
+ tid INT4 PRIMARY KEY,
+ title VARCHAR(#{lt_title}) NULL,
+ subtitle VARCHAR(#{lt_subtitle}) NULL,
+ creator VARCHAR(#{lt_creator}) NULL,
+ illustrator VARCHAR(#{lt_illustrator}) NULL,
+ translator VARCHAR(#{lt_translator}) NULL,
+ subject VARCHAR(#{lt_subject}) NULL,
+ date VARCHAR(#{lt_date}) NULL,
+ date_created VARCHAR(#{lt_date_created}) NULL,
+ date_issued VARCHAR(#{lt_date_issued}) NULL,
+ date_available VARCHAR(#{lt_date_available}) NULL,
+ date_valid VARCHAR(#{lt_date_valid}) NULL,
+ date_modified VARCHAR(#{lt_date_modified}) NULL,
+/* date DATE, */
+/* date_created DATE, */
+/* date_issued DATE, */
+/* date_available DATE, */
+/* date_valid DATE, */
+/* date_modified DATE, */
+ type VARCHAR(#{lt_type}) NULL,
+ description VARCHAR(#{lt_description}) NULL,
+ publisher VARCHAR(#{lt_publisher}) NULL,
+ contributor VARCHAR(#{lt_contributor}) NULL,
+ prepared_by VARCHAR(#{lt_prepared_by}) NULL,
+ digitized_by VARCHAR(#{lt_digitized_by}) NULL,
+ format VARCHAR(#{lt_format}) NULL,
+ identifier VARCHAR(#{lt_identifier}) NULL,
+ source VARCHAR(#{lt_source}) NULL,
+ language VARCHAR(#{lt_language}) NULL,
+ language_original VARCHAR(#{lt_language_original}) NULL,
+ relation VARCHAR(#{lt_relation}) NULL,
+ coverage VARCHAR(#{lt_coverage}) NULL,
+ rights VARCHAR(#{lt_rights}) NULL,
+ copyright VARCHAR(#{lt_copyright}) NULL,
+ owner VARCHAR(#{lt_owner}) NULL,
+ keywords VARCHAR(#{lt_keywords}) NULL,
+ comment VARCHAR(#{lt_comment}) NULL,
+ loc VARCHAR(#{lt_loc}) NULL,
+ dewey VARCHAR(#{lt_dewey}) NULL,
+ isbn VARCHAR(#{lt_isbn}) NULL,
+ pg VARCHAR(#{lt_pg}) NULL,
+ abstract VARCHAR(#{lt_abstract}) NULL,
+ prefix_a TEXT NULL,
+ prefix_b TEXT NULL,
+ skin VARCHAR(#{lt_skin}) NULL,
+ markup VARCHAR(#{lt_markup}) NULL,
+ links VARCHAR(#{lt_links}) NULL,
+ information VARCHAR(#{lt_information}) NULL,
+ contact VARCHAR(#{lt_contact}) NULL,
+ suffix VARCHAR(#{lt_suffix}) NULL,
+ filename VARCHAR(#{lt_filename}) NULL UNIQUE,
+ types CHAR(#{lt_types}) NULL,
+ subj VARCHAR(#{lt_subj}) NULL
+ );
+ #{@comment['metadata']}
+ })
+ end
+ def create_table # create documents base
+ print %{
+ to be populated from documents files
+ create tables documents document_trade document_env
+ data import through ruby transfer
+ } unless @opt.cmd =~/q/
+ @conn.execute(%{
+ CREATE TABLE documents (
+ lid INT4 PRIMARY KEY,
+ metadata_tid INT4 REFERENCES metadata,
+ ocn SMALLINT,
+ ocnd VARCHAR(6),
+ ocns VARCHAR(6),
+ clean TEXT NULL,
+ body TEXT NULL,
+ seg VARCHAR(#{document_seg}) NULL,
+ lev SMALLINT NULL,
+ lev1 SMALLINT,
+ lev2 SMALLINT,
+ lev3 SMALLINT,
+ lev4 SMALLINT,
+ lev5 SMALLINT,
+ lev6 SMALLINT,
+ en_a SMALLINT NULL,
+ en_z SMALLINT NULL,
+ en_a_asterisk SMALLINT NULL,
+ en_z_asterisk SMALLINT NULL,
+ en_a_plus SMALLINT NULL,
+ en_z_plus SMALLINT NULL,
+ digest_clean CHAR(#{@@dl}),
+ digest_all CHAR(#{@@dl}),
+ types CHAR(1) NULL
+ );
+ #{@comment['documents']}
+ })
+ end
+ def create_table_endnotes
+ print %{
+ to be populated from documents files
+ create tables endnotes
+ data import through ruby transfer
+ } unless @opt.cmd =~/q/
+ @conn.execute(%{
+ CREATE TABLE endnotes (
+ nid INT4 PRIMARY KEY,
+ document_lid INT4 REFERENCES documents,
+ nr SMALLINT,
+ clean TEXT NULL,
+ body TEXT NULL,
+ ocn SMALLINT,
+ ocnd VARCHAR(6),
+ ocns VARCHAR(6),
+ digest_clean CHAR(#{@@dl}),
+ metadata_tid INT4 REFERENCES metadata
+ );
+ #{@comment['endnotes']}
+ })
+ end
+ def create_table_endnotes_asterisk
+ print %{
+ to be populated from documents files
+ create tables endnotes_asterisk
+ data import through ruby transfer
+ } unless @opt.cmd =~/q/
+ @conn.execute(%{
+ CREATE TABLE endnotes_asterisk (
+ nid INT4 PRIMARY KEY,
+ document_lid INT4 REFERENCES documents,
+ nr SMALLINT,
+ clean TEXT NULL,
+ body TEXT NULL,
+ ocn SMALLINT,
+ ocnd VARCHAR(6),
+ ocns VARCHAR(6),
+ digest_clean CHAR(#{@@dl}),
+ metadata_tid INT4 REFERENCES metadata
+ );
+ #{@comment['endnotes_asterisk']}
+ })
+ end
+ def create_table_endnotes_plus
+ print %{
+ to be populated from documents files
+ create tables endnotes_plus
+ data import through ruby transfer
+ } unless @opt.cmd =~/q/
+ @conn.execute(%{
+ CREATE TABLE endnotes_plus (
+ nid INT4 PRIMARY KEY,
+ document_lid INT4 REFERENCES documents,
+ nr SMALLINT,
+ clean TEXT NULL,
+ body TEXT NULL,
+ ocn SMALLINT,
+ ocnd VARCHAR(6),
+ ocns VARCHAR(6),
+ digest_clean CHAR(#{@@dl}),
+ metadata_tid INT4 REFERENCES metadata
+ );
+ #{@comment['endnotes_plus']}
+ })
+ end
+ def create_table_urls # create documents file links mapping
+ print %{
+ currently using sisu dbi module
+ to be populated from documents files
+ create tables urls
+ data import through ruby transfer
+ } unless @opt.cmd =~/q/
+ @conn.execute(%{
+ CREATE TABLE urls (
+ metadata_tid INT4 REFERENCES metadata,
+ plaintext varchar(512),
+ html_toc varchar(512),
+ html_doc varchar(512),
+ xhtml varchar(512),
+ xml_sax varchar(512),
+ xml_dom varchar(512),
+ odf varchar(512),
+ pdf_p varchar(512),
+ pdf_l varchar(512),
+ concordance varchar(512),
+ latex_p varchar(512),
+ latex_l varchar(512),
+ digest varchar(512),
+ manifest varchar(512),
+ markup varchar(512),
+ sisupod varchar(512)
+ );
+ #{@comment['urls']}
+ })
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_drop.rb b/lib/sisu/0.52/db_drop.rb
new file mode 100644
index 00000000..44f31d2a
--- /dev/null
+++ b/lib/sisu/0.52/db_drop.rb
@@ -0,0 +1,124 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_drop
+ class Drop
+ def initialize(opt,conn='',sql_type='')
+ @opt,@conn,@sql_type=opt,conn,sql_type
+ end
+ def drop_tables #% drop all tables
+ begin
+ case @sql_type
+ when /sqlite/
+ cascade=''
+ commit=@conn.commit
+ else
+ cascade='CASCADE'
+ commit=''
+ end
+ @conn.do(%{
+ DROP TABLE metadata #{cascade};
+ DROP TABLE documents #{cascade};
+ DROP TABLE endnotes #{cascade};
+ DROP TABLE endnotes_asterisk #{cascade};
+ DROP TABLE endnotes_plus #{cascade};
+ DROP TABLE urls #{cascade};
+ })
+ commit
+ rescue
+ end
+ end
+ def drop_indexes #% drop all indexes
+ #@conn.do(%{
+ # DROP INDEX object_nr ON documents(ocn);
+ # DROP INDEX body ON documents(body);
+ # DROP INDEX clean ON documents(clean);
+ # DROP INDEX lev1 ON documents(lev1);
+ # DROP INDEX lev2 ON documents(lev2);
+ # DROP INDEX lev3 ON documents(lev3);
+ # DROP INDEX lev4 ON documents(lev4);
+ # DROP INDEX lev5 ON documents(lev5);
+ # DROP INDEX lev6 ON documents(lev6);
+ # DROP INDEX endnote_nr ON endnotes(nr);
+ # DROP INDEX endnote ON endnotes(body);
+ # DROP INDEX title ON metadata(title);
+ # DROP INDEX filename ON metadata(filename)
+ # /*
+ # DROP INDEX object_nr ON documents(ocn) CASCADE;
+ # DROP INDEX body ON documents(body) CASCADE;
+ # DROP INDEX clean ON documents(clean) CASCADE;
+ # DROP INDEX lev1 ON documents(lev1) CASCADE;
+ # DROP INDEX lev2 ON documents(lev2) CASCADE;
+ # DROP INDEX lev3 ON documents(lev3) CASCADE;
+ # DROP INDEX lev4 ON documents(lev4) CASCADE;
+ # DROP INDEX lev5 ON documents(lev5) CASCADE;
+ # DROP INDEX lev6 ON documents(lev6) CASCADE;
+ # DROP INDEX endnote_nr ON endnotes(nr) CASCADE;
+ # DROP INDEX endnote ON endnotes(body) CASCADE;
+ # DROP INDEX title ON metadata(title) CASCADE;
+ # DROP INDEX filename ON metadata(filename) CASCADE
+ # */
+ #})
+ end
+ def db_help #% help
+ puts %{
+ not yet implemented
+ init createall
+ createtable
+ recreate\t(destroy and create)
+ createlex\t()
+ createmetadata\t()
+ import\t(import data)
+ index\t(create index)
+ droptables\t(where tables made and content imported)
+ dropall\t(where tables made, content imported and tables indexed)
+ }
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_import.rb b/lib/sisu/0.52/db_import.rb
new file mode 100644
index 00000000..73161dc0
--- /dev/null
+++ b/lib/sisu/0.52/db_import.rb
@@ -0,0 +1,735 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_import
+ require SiSU_lib + '/db_columns'
+ require SiSU_lib + '/db_load_tuple'
+ require SiSU_lib + '/shared_html_lite'
+ class Import < SiSU_DB_columns::Column_size
+ include SiSU_Param
+ include SiSU_Screen
+ @@dl=nil
+ attr_accessor :tp
+ def initialize(opt,conn='',sql_type='pg')
+ @opt,@conn,@sql_type=opt,conn,sql_type
+ @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @dal="#{@env.path.dal}"
+ if @opt.fns.empty? or @opt.cmd.empty?; @fnb=''
+ else
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @fnb=@md.fnb
+ end
+ @suffix=@opt.fns[/(?:.+?)\.[_-]?sst/,1]
+ @fnm="#@dal/#{@opt.fns}.meta.rbm"
+ @@seg=''
+ @@seg_full='' #create? consider placing field just before clean text as opposed to seg which contains seg(.html) name info seg_full would contain seg info for levels 5 & 6 where available eg seg_full may be 7.3 (level 5) and 7.3.1 (level 6) where seg is 7
+ @col=Hash.new('')
+ @col[:ocn]=''
+ @counter={}
+ sql='SELECT MAX(lid) FROM documents'
+ @col[:lid]=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i }
+ @col[:lid] ||=0
+ sql='SELECT MAX(nid) FROM endnotes'
+ @id_n=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i }
+ @id_n ||=0
+ @col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=0
+ @db=SiSU_Env::Info_db.new
+ @@dl ||=SiSU_Env::Info_env.new.digest.length
+ end
+ def marshal_load
+ require SiSU_lib + '/dal'
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ #@dal_array.each { |x| puts x.inspect; sleep 1 }
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"#{@db.db_psql}::#{@opt.fns}")
+ tell.puts_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Marshal Load',@fnm)
+ tell.print_grey if @opt.cmd =~/v/
+ case @sql_type
+ when /sqlite/ #fix logic for sqlite !
+ import_db_metadata(@dal_array)
+ import_documents(@dal_array)
+ import_db_urls(@dal_array,@fnm) #import OID on/off
+ @conn.commit #sqlite watch
+ else
+ file_exist=@conn.select_one(%{ SELECT metadata.tid FROM metadata WHERE metadata.filename ~ '#{@opt.fns}'; })
+ unless file_exist
+ @conn.execute('BEGIN')
+ import_db_metadata(@dal_array)
+ import_documents(@dal_array)
+ import_db_urls(@dal_array,@fnm) #import OID on/off
+ @conn.execute('COMMIT')
+ else
+ @db=SiSU_Env::Info_db.new
+ puts "\n#{@cX.grey}file #{@cX.off} #{@cX.blue}#{@opt.fns}#{@cX.off} #{@cX.grey}already exists in database#{@cX.off} #{@cX.blue}#{@db.db_psql}#{@cX.off} #{@cX.brown}update instead?#{@cX.off}"
+ end
+ end
+ end
+ def special_character_escape(string)
+ string.gsub!(/'/,"''")
+ string.gsub!(/<:br>/,"<br />\n")
+ string.gsub!(/<:(?:code|alt|group|verse)(?:-end)?>/,'')
+ string.gsub!(/<:name#\S+?>/,'')
+ string.gsub!(/\{\s*(\S+?\.(?:png|jpg))(?:\s+\d+x\d+)?(.+?)\}\S+/,'[image: \1] \2')
+ string.gsub!(/\{\s*(.+?)\s*\}http:\/\/\S+?([.,!?]?(?:\s|$))/,'\1\2')
+ end
+ def unicode_special_character_escape(string)
+ #string.gsub!(/(["';:,])/, %{\\\\\\1})
+ end
+ def strip_markup(string) #define rules, make same as in dal clean
+ string.gsub!(/<sup>(\d+)<\/sup>/,'[\1]')
+ string.gsub!(/<:i[12]>/,'')
+ string.gsub!(/(?:&nbsp\\;)+/,' ')
+ string.gsub!(/<!T[h]?¡.+?!>/,"[TABLE]\n") #tables
+ string.gsub!(/<!¡¡\d+(.+?)!>/,'\1') #tables
+ string.gsub!(/¡¡\d+¡/,' ') #tables
+ string.gsub!(/¡/,' ') #tables tidy later
+ string.gsub!(/<.+?>/,'')
+ string.gsub!(/\{.+?\.(?:png|jpg|gif).+?\}(?:https?|ftp)\\\:\S+ /,' [image] ') # else image names found in search
+ string.gsub!(/\s\s+/,' ')
+ string.strip!
+ end
+ #% import into database tables
+ def import_db_metadata(dbi_unit) #% import documents - populate database
+ print %{ #{@cX.grey}import documents dbi_unit #{@cX.off} } unless @opt.cmd =~/q/
+ @tp={}
+ @md=SiSU_Param::Parameters.new(@opt).get
+ if @md.title; @tp[:title]=@md.title
+ special_character_escape(@tp[:title])
+ @tp[:title_f],@tp[:title_i]='title, ',"'#{@tp[:title]}', "
+ sql="SELECT MAX(tid) FROM metadata"
+ id_t=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i }
+ @@id_t=id_t if id_t
+ @@id_t ||=0
+ @@id_t+=1 #bug related, needs to be performed once at start of file, but consider moving, as, placed here it means program will fail if document header lacks 0~title
+ puts %{\n#{@cX.grey}Processing file number#{@cX.off}: #{@cX.green}#{@@id_t}#{@@cX.off}} unless @opt.cmd =~/q/
+ end
+ if @md.dc_title; @tp[:long_title]=@md.dc_title
+ #sql="SELECT MAX(tid) FROM metadata"
+ #id_t=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i }
+ #@@id_t=id_t if id_t
+ #@@id_t ||=0
+ #@@id_t+=1 #bug related, needs to be performed once at start of file, but consider moving, as, placed here it means program will fail if document header lacks 0~title
+ #puts %{\n#{@cX.grey}Processing file number#{@cX.off}: #{@cX.green}#{@@id_t}#{@@cX.off}}
+ end
+ if @md.subtitle; @tp[:subtitle]=@md.subtitle
+ special_character_escape(@tp[:subtitle])
+ @tp[:subtitle_f],@tp[:subtitle_i]='subtitle, ',"'#{@tp[:subtitle]}', "
+ end
+ if @md.dc_creator; @tp[:creator]=@md.dc_creator
+ special_character_escape(@tp[:creator])
+ @tp[:creator_f],@tp[:creator_i]='creator, ',"'#{@tp[:creator]}', "
+ end
+ if @md.dc_contributor; @tp[:contributor]=@md.dc_contributor
+ special_character_escape(@tp[:contributor])
+ @tp[:contributor_f],@tp[:contributor_i]='contributor, ',"'#{@tp[:contributor]}', "
+ end
+ if @md.translator; @tp[:translator]=@md.translator
+ special_character_escape(@tp[:translator])
+ @tp[:translator_f],@tp[:translator_i]='translator, ',"'#{@tp[:translator]}', "
+ end
+ if @md.illustrator; @tp[:illustrator]=@md.illustrator
+ special_character_escape(@tp[:illustrator])
+ @tp[:illustrator_f],@tp[:illustrator_i]='illustrator, ',"'#{@tp[:illustrator]}', "
+ end
+ if @md.dc_publisher; @tp[:publisher]=@md.dc_publisher
+ special_character_escape(@tp[:publisher])
+ @tp[:publisher_f],@tp[:publisher_i]='publisher, ',"'#{@tp[:publisher]}', "
+ end
+ if @md.prepared_by; @tp[:prepared_by]=@md.prepared_by
+ special_character_escape(@tp[:prepared_by])
+ @tp[:prepared_by_f],@tp[:prepared_by_i]='prepared_by, ',"'#{@tp[:prepared_by]}', "
+ end
+ if @md.digitized_by; @tp[:digitized_by]=@md.digitized_by
+ special_character_escape(@tp[:digitized_by])
+ @tp[:digitized_by_f],@tp[:digitized_by_i]='digitized_by, ',"'#{@tp[:digitized_by]}', "
+ end
+ if @md.dc_subject; @tp[:subject]=@md.dc_subject
+ special_character_escape(@tp[:subject])
+ @tp[:subject_f],@tp[:subject_i]='subject, ',"'#{@tp[:subject]}', "
+ end
+ if @md.dc_description; @tp[:description]=@md.dc_description
+ special_character_escape(@tp[:description])
+ @tp[:description_f],@tp[:description_i]='description, ',"'#{@tp[:description]}', "
+ end
+ if @md.abstract; @tp[:abstract]=@md.abstract
+ special_character_escape(@tp[:abstract])
+ @tp[:abstract_f],@tp[:abstract_i]='abstract, ',"'#{@tp[:abstract]}', "
+ end
+ if @md.dc_type; @tp[:type]=@md.dc_type
+ special_character_escape(@tp[:type])
+ @tp[:type_f],@tp[:type_i]='type, ',"'#{@tp[:type]}', "
+ end
+ #if @md.owner; @tp[:owner]=@md.owner
+ # special_character_escape(@tp[:owner])
+ # @tp[:owner_f],@tp[:owner_i]='owner, ',"'#{@tp[:owner}', "
+ #end
+ #if @md.copyright; @tp[:copyright]=@md.copyright
+ # special_character_escape(@tp[:copyright])
+ # @tp[:copyright_f],@tp[:copyright_i]='copyright, ',"'#{@tp[:copyright]}', "
+ #end
+ if @md.dc_rights; @tp[:rights]=@md.dc_rights
+ special_character_escape(@tp[:rights])
+ @tp[:rights_f],@tp[:rights_i]='rights, ',"'#{@tp[:rights]}', "
+ end
+ if @md.dc_date; @tp[:date]=@md.dc_date
+ special_character_escape(@tp[:date])
+ @tp[:date_f],@tp[:date_i]='date, ',"'#{@tp[:date]}', "
+ end
+ if @md.dc_date_created; @tp[:date_created]=@md.dc_date_created
+ special_character_escape(@tp[:date_created])
+ @tp[:date_created_f],@tp[:date_created_i]='date_created, ',"'#{@tp[:date_created]}', "
+ end
+ if @md.dc_date_issued; @tp[:date_issued]=@md.dc_date_issued
+ special_character_escape(@tp[:date_issued])
+ @tp[:date_issued_f],@tp[:date_issued_i]='date_issued, ',"'#{@tp[:date_issued]}', "
+ end
+ if @md.dc_date_available; @tp[:date_available]=@md.dc_date_available
+ special_character_escape(@tp[:date_available])
+ @tp[:date_available_f],@tp[:date_available_i]='date_available, ',"'#{@tp[:date_available]}', "
+ end
+ if @md.dc_date_modified; @tp[:date_modified]=@md.dc_date_modified
+ special_character_escape(@tp[:date_modified])
+ @tp[:date_modified_f],@tp[:date_modified_i]='date_modified, ',"'#{@tp[:date_modified]}', "
+ end
+ if @md.dc_date_valid; @tp[:date_valid]=@md.dc_date_valid
+ special_character_escape(@tp[:date_valid])
+ @tp[:date_valid_f],@tp[:date_valid_i]='date_valid, ',"'#{@tp[:date_valid]}', "
+ end
+ if @md.dc_language[:name]; @tp[:language]=@md.dc_language[:name]
+ special_character_escape(@tp[:language])
+ @tp[:language_f],@tp[:language_i]='language, ',"'#{@tp[:language]}', "
+ end
+ if @md.language_original[:name]; @tp[:language_original]=@md.language_original[:name]
+ special_character_escape(@tp[:language_original])
+ @tp[:language_original_f],@tp[:language_original_i]='language_original, ',"'#{@tp[:language_original]}', "
+ end
+ if @md.dc_format; @tp[:format]=@md.dc_format
+ special_character_escape(@tp[:format])
+ @tp[:format_f],@tp[:format_i]='format, ',"'#{@tp[:format]}', "
+ end
+ if @md.dc_identifier; @tp[:identifier]=@md.dc_identifier
+ special_character_escape(@tp[:identifier])
+ @tp[:identifier_f],@tp[:identifier_i]='identifier, ',"'#{@tp[:identifier]}', "
+ end
+ if @md.dc_source; @tp[:source]=@md.dc_source
+ special_character_escape(@tp[:source])
+ @tp[:source_f],@tp[:source_i]='source, ',"'#{@tp[:source]}', "
+ end
+ if @md.dc_relation; @tp[:relation]=@md.dc_relation
+ special_character_escape(@tp[:relation])
+ @tp[:relation_f],@tp[:relation_i]='relation, ',"'#{@tp[:relation]}', "
+ end
+ if @md.dc_coverage; @tp[:coverage]=@md.dc_coverage
+ special_character_escape(@tp[:coverage])
+ @tp[:coverage_f],@tp[:coverage_i]='coverage, ',"'#{@tp[:coverage]}', "
+ end
+ if @md.keywords; @tp[:keywords]=@md.keywords
+ special_character_escape(@tp[:keywords])
+ @tp[:keywords_f],@tp[:keywords_i]='keywords, ',"'#{@tp[:keywords]}', "
+ end
+ if @md.comments; @tp[:comments]=@md.comments
+ special_character_escape(@tp[:comments])
+ @tp[:comments_f],@tp[:comments_i]='comments, ',"'#{@tp[:comments]}', "
+ end
+ if @md.cls_loc; @tp[:cls_loc]=@md.cls_loc
+ special_character_escape(@tp[:cls_loc])
+ @tp[:cls_loc_f],@tp[:cls_loc_i]='cls_loc, ',"'#{@tp[:cls_loc]}', "
+ end
+ if @md.cls_dewey; @tp[:cls_dewey]=@md.cls_dewey
+ special_character_escape(@tp[:cls_dewey])
+ @tp[:cls_dewey_f],@tp[:cls_dewey_i]='cls_dewey, ',"'#{@tp[:cls_dewey]}', "
+ end
+ if @md.cls_pg; @tp[:cls_pg]=@md.cls_pg
+ special_character_escape(@tp[:cls_pg])
+ @tp[:cls_pg_f],@tp[:cls_pg_i]='cls_pg, ',"'#{@tp[:cls_pg]}', "
+ end
+ if @md.cls_isbn; @tp[:cls_isbn]=@md.cls_isbn
+ special_character_escape(@tp[:cls_isbn])
+ @tp[:cls_isbn_f],@tp[:cls_isbn_i]='cls_isbn, ',"'#{@tp[:cls_isbn]}', "
+ end
+ if @md.prefix_a; @tp[:prefix_a]=@md.prefix_a
+ special_character_escape(@tp[:prefix_a])
+ @tp[:prefix_a_f],@tp[:prefix_a_i]='prefix_a, ',"'#{@tp[:prefix_a]}', "
+ end
+ if @md.prefix_b; @tp[:prefix_b]=@md.prefix_b
+ special_character_escape(@tp[:prefix_b])
+ @tp[:prefix_b_f],@tp[:prefix_b_i]='prefix_b, ',"'#{@tp[:prefix_b]}', "
+ end
+ #if @md.suffix; @tp[:suffix]=@md.suffix
+ # special_character_escape(@tp[:suffix])
+ # @tp[:suffix_f],@tp[:suffix_i]='suffix, ',"'#{@tp[:suffix]}', "
+ #end
+ if @md.fns; @tp[:fns]=@md.fns
+ special_character_escape(@tp[:fns])
+ @tp[:fns_f],@tp[:fns_i]="filename, ","'#{@tp[:fns]}', "
+ end
+ #if @md.en[:mismatch] > 0
+ # id,info='WARNING document error in endnote markup, number mismatch',"endnotes: #{@md.en[:note]} != endnote reference marks: #{@md.en[:mark]} (difference = #{@md.en[:mismatch]})"
+ #end
+ if @md.wc_words; @tp[:wc_words]=@md.wc_words
+ @tp[:wc_words_f],@tp[:wc_words_i]='wc_words, ',"'#{@tp[:wc_words]}', "
+ end
+ if @md.dgst; @tp[:dgst]=@md.dgst
+ @tp[:dgst_f],@tp[:dgst_i]='dgst, ',"'#{@tp[:dgst]}', "
+ end
+ if @md.sc_number; @tp[:sc_number]=@md.sc_number
+ @tp[:sc_number_f],@tp[:sc_number_i]='sc_number, ',"'#{@tp[:sc_number]}', "
+ end
+ if @md.sc_date; @tp[:sc_date]=@md.sc_date
+ @tp[:sc_date_f],@tp[:sc_date_i]='sc_date, ',"'#{@tp[:sc_date]}', "
+ end
+ if @md.generated; @tp[:generated]=@md.generated
+ @tp[:generated_f],@tp[:generated_i]='generated, ',"'#{@tp[:generated]}', "
+ end
+ #if @md.sisu_version; special_character_escape(@md.sisu_version)
+ # #id,info='Generated by',"#{@md.sisu_version[:project]} #{@md.sisu_version[:version]} #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})"
+ #end
+ #if @md.ruby_version; special_character_escape(@md.ruby_version)
+ SiSU_DB::Test.new(self,@opt).verify #% import title names, filenames (tuple)
+ @conn.execute(%{
+ INSERT INTO metadata (#{@tp[:fns_f]} #{@tp[:suffix_f]} #{@tp[:title_f]} #{@tp[:subtitle_f]} #{@tp[:creator_f]} #{@tp[:illustrator_f]} #{@tp[:translator_f]} #{@tp[:subject_f]} #{@tp[:description_f]} #{@tp[:publisher_f]} #{@tp[:contributor_f]} #{@tp[:prepared_by_f]} #{@tp[:digitized_by_f]} #{@tp[:date_f]} #{@tp[:date_created_f]} #{@tp[:date_issued_f]} #{@tp[:date_valid_f]} #{@tp[:date_available_f]} #{@tp[:date_modified_f]} #{@tp[:type_f]} #{@tp[:format_f]} #{@tp[:identifier_f]} #{@tp[:source_f]} #{@tp[:language_f]} #{@tp[:language_original_f]} #{@tp[:relation_f]} #{@tp[:coverage_f]} #{@tp[:rights_f]} #{@tp[:copyright_f]} #{@tp[:owner_f]} #{@tp[:keywords_f]} #{@tp[:abstract_f]} #{@tp[:comment_f]} #{@tp[:loc_f]} #{@tp[:dewey_f]} #{@tp[:isbn_f]} #{@tp[:pg_f]} #{@tp[:prefix_a_f]} #{@tp[:prefix_b_f]} tid) VALUES (#{@tp[:fns_i]} #{@tp[:suffix_i]} #{@tp[:title_i]} #{@tp[:subtitle_i]} #{@tp[:creator_i]} #{@tp[:illustrator_i]} #{@tp[:translator_i]} #{@tp[:subject_i]} #{@tp[:description_i]} #{@tp[:publisher_i]} #{@tp[:contributor_i]} #{@tp[:prepared_by_i]} #{@tp[:digitized_by_i]} #{@tp[:date_i]} #{@tp[:date_created_i]} #{@tp[:date_issued_i]} #{@tp[:date_valid_i]} #{@tp[:date_available_i]} #{@tp[:date_modified_i]} #{@tp[:type_i]} #{@tp[:format_i]} #{@tp[:identifier_i]} #{@tp[:source_i]} #{@tp[:language_i]} #{@tp[:language_original_i]} #{@tp[:relation_i]} #{@tp[:coverage_i]} #{@tp[:rights_i]} #{@tp[:copyright_i]} #{@tp[:owner_i]} #{@tp[:keywords_i]} #{@tp[:abstract_i]} #{@tp[:comment_i]} #{@tp[:loc_i]} #{@tp[:dewey_i]} #{@tp[:isbn_i]} #{@tp[:pg_i]} #{@tp[:prefix_a_i]} #{@tp[:prefix_b_i]} #{@@id_t});
+ })
+ end
+ def import_documents(dbi_unit) #% import documents - populate main database table
+ #% import into substantive database tables (tuple)
+ begin
+ @col[:tid]=@@id_t
+ @en,@en_ast,@en_pls=[],[],[]
+ @col[:en_a]=nil
+ @col[:en_z]=nil
+ dbi_unit.each do |data|
+ #data.gsub!(/<[biu]>(.+?)<\/[biu]>/,'\1') # remove bold, italics, underscore
+ data.gsub!(/<b>(.+?)<\/b>/,'\1') # remove bold, italics, underscore
+ data.gsub!(/<i>(.+?)<\/i>/,'\1') # remove bold, italics, underscore
+ data.gsub!(/<u>(.+?)<\/u>/,'\1') # remove bold, italics, underscore
+ #data.gsub!(/<:name#\S+?>/,'')
+ @col[:seg]=@@seg
+ if data =~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m # regular text
+ notedata=data.dup
+ if data[/^([123])~\s+(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/]
+ @col[:lev],txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6,$7
+ @col[:lid]+=1
+ if txt =~/~\{.+?\}~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en << txt.scan(/~\{(\d+).+?\}~/)
+ txt.gsub!(/~\{(\d+).+?\}~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\*.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_ast << txt.scan(/~\[[*](\d+).+?\]~/)
+ txt.gsub!(/~\[([*]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\+.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_pls << txt.scan(/~\[[+](\d+).+?\]~/)
+ txt.gsub!(/~\[([+]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:lev]).lev4_minus
+ special_character_escape(@col[:body])
+ @col[:plaintext]=@col[:body].dup
+ strip_markup(@col[:plaintext])
+ if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last
+ end
+ if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last
+ end
+ if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last
+ end
+ t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)
+ t.tuple
+ case @col[:lev]
+ when /1/; @col[:lv1]+=1
+ when /2/; @col[:lv2]+=1
+ when /3/; @col[:lv3]+=1
+ end
+ @col[:lev]=@col[:plaintext]=@col[:body]=''
+ elsif data[/^4~(.+?)\s+(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/]
+ @@seg,txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6,$7
+ @col[:seg]=@@seg
+ @col[:lv4]+=1
+ @col[:lid]+=1
+ @col[:lev]=4
+ if txt =~ /~\{.+?\}~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en << txt.scan(/~\{(\d+).+?\}~/)
+ txt.gsub!(/~\{(\d+).+?\}~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\*.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_ast << txt.scan(/~\[[*](\d+).+?\]~/)
+ txt.gsub!(/~\[([*]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\+.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_pls << txt.scan(/~\[[+](\d+).+?\]~/)
+ txt.gsub!(/~\[([+]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:lev],@col[:seg]).lev4_plus
+ special_character_escape(@col[:body])
+ @col[:plaintext]=@col[:body].dup
+ strip_markup(@col[:plaintext])
+ if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last
+ end
+ if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last
+ end
+ if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last
+ end
+ t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)
+ t.tuple
+ @col[:lev]=@col[:plaintext]=@col[:body]=''
+ elsif data[/^5~(?:~\S+)?(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/] # header lev5 seg level
+ txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6
+ re=/^5~(.+?)\s+/
+ @@seg_full=re.match(data)[1] if data=~re #create?
+ @@seg ||='' #nil # watch
+ @col[:seg]=@@seg
+ @col[:lv5]+=1
+ @col[:lid]+=1
+ @col[:lev]=5
+ if txt =~ /~\{.+?\}~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en << txt.scan(/~\{(\d+).+?\}~/)
+ txt.gsub!(/~\{(\d+).+?\}~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\*.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_ast << txt.scan(/~\[[*](\d+).+?\]~/)
+ txt.gsub!(/~\[([*]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\+.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_pls << txt.scan(/~\[[+](\d+).+?\]~/)
+ txt.gsub!(/~\[([+]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:lev],@col[:seg]).lev4_plus
+ special_character_escape(@col[:body])
+ @col[:plaintext]=@col[:body].dup
+ strip_markup(@col[:plaintext])
+ if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last
+ end
+ if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last
+ end
+ if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last
+ end
+ t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)
+ t.tuple
+ @col[:lev]=@col[:plaintext]=@col[:body]=''
+ elsif data[/^6~(?:~\S+)?(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/] # header lev6 seg level
+ txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=$1,$2,$3,$4,$5,$6
+ re=/^6~(.+?)\s+/
+ @@seg_full=re.match(data)[1] if data=~re #create?
+ @@seg ||='' #nil # watch
+ @col[:seg]=@@seg
+ @col[:lv6]+=1
+ @col[:lid]+=1
+ @col[:lev]=6
+ if txt =~ /~\{.+?\}~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en << txt.scan(/~\{(\d+).+?\}~/)
+ txt.gsub!(/~\{(\d+).+?\}~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\*.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_ast << txt.scan(/~\[[*](\d+).+?\]~/)
+ txt.gsub!(/~\[([*]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\+.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_pls << txt.scan(/~\[[+](\d+).+?\]~/)
+ txt.gsub!(/~\[([+]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ @col[:body]=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:lev],@col[:seg]).lev4_plus
+ special_character_escape(@col[:body])
+ @col[:plaintext]=@col[:body].dup
+ strip_markup(@col[:plaintext])
+ if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last
+ end
+ if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last
+ end
+ if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last
+ end
+ t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)
+ t.tuple
+ @col[:lev]=@col[:plaintext]=@col[:body]=''
+ else #% regular text
+ @col[:lid]+=1
+ txt=''
+ txt,@col[:ocn],@col[:ocnd],@col[:ocns],@col[:digest_clean],@col[:digest_all]=(/(.+?)<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#{@@dl}}):([0-9a-f]{#{@@dl}})>/m).match(data).captures
+ if txt =~ /~\{.+?\}~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en << txt.scan(/~\{(\d+).+?\}~/)
+ txt.gsub!(/~\{(\d+).+?\}~/,'<sup>\1</sup>')
+ #txt.gsub!(/~\{(\d+).+?\}~/,'^[\1]') # remove endnote, keep endnote reference number, display as, e.g. [^1]
+ end
+ if txt =~/~\[\*.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_ast << txt.scan(/~\[[*](\d+).+?\]~/)
+ txt.gsub!(/~\[([*]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ if txt =~/~\[\+.+?\]~/
+ word_mode=txt.scan(/\S+/)
+ endnote_range(word_mode)
+ @en_pls << txt.scan(/~\[[+](\d+).+?\]~/)
+ txt.gsub!(/~\[([+]\d+).+?\]~/,'<sup>\1</sup>')
+ end
+ if @sql_type=~/pg/ and txt.size > (document_clean - 1) #% examine pg build & remove limitation
+ puts "\n\nTOO LARGE (TXT - see error log)\n\n"
+ open("#{Dir.pwd}/pg_documents_error_log",'a') do |error|
+ error.puts("\n#{@opt.fns}\nTEXT BODY\n#{@col[:body].size} object #{@col[:ocn]} -> #{@col[:body].slice(0..500)}")
+ end
+ txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n}
+ end
+ if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last
+ end
+ if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last
+ end
+ if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last
+ end
+ @col[:body]=if txt=~/<!T[h]?¡.+?!~\d+;\w\d+;\w\d+>/ #watch
+ SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).html_table
+ elsif txt=~/<:i1>/
+ SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).indent1
+ elsif txt=~/<:i2>/
+ SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).indent2
+ else
+ SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).norm
+ end
+ special_character_escape(@col[:body])
+ @col[:plaintext]=@col[:body].dup
+ strip_markup(@col[:plaintext])
+ t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)
+ t.tuple
+ @en,@en_ast,@en_pls=[],[],[]
+ @col[:en_a]=@col[:en_z]=nil
+ @col[:lev]=@col[:plaintext]=@col[:body]=''
+ end
+ if notedata =~ /~\{.+?\}~/ #% import into database endnotes tables
+ endnote_array=notedata.scan(/~\{.+?\}~/)
+ endnote_array.each do |inf|
+ if inf[/~\{\d+.+?<[0-9a-f]{#{@@dl}}>\}~/] # dal new endnotes 2003w31/1
+ if inf[/~\{(\d+)(.+?)<([0-9a-f]{#{@@dl}})>\}~/] # dal new endnotes 2003w31/1
+ en,txt,digest_clean=$1,$2,$3
+ end
+ @id_n+=1
+ body=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],en).endnote
+ special_character_escape(body)
+ special_character_escape(txt)
+ strip_markup(txt)
+ if txt.size > (endnote_clean - 1)
+ puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n"
+ open("#{Dir.pwd}/pg_documents_error_log",'a') do |error|
+ error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}")
+ end
+ txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n}
+ end
+ if txt
+ #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes
+ @conn.execute(%{
+ INSERT INTO endnotes (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}');
+ })
+ end
+ end
+ end
+ word_mode=notedata.scan(/\S+/)
+ end
+ if notedata =~ /~\[\*.+?\]~/ #% import into database endnotes tables
+ endnote_array=notedata.scan(/~\[\*.+?\]~/)
+ endnote_array.each do |inf|
+ if inf[/~\[\*\d+.+?<[0-9a-f]{#{@@dl}}>\]~/] # dal new endnotes 2003w31/1
+ if inf[/~\[[*](\d+)(.+?)<([0-9a-f]{#{@@dl}})>\]~/] # dal new endnotes 2003w31/1
+ en,txt,digest_clean=$1,$2,$3
+ end
+ @id_n+=1
+ body=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],en).endnote
+ special_character_escape(body)
+ special_character_escape(txt)
+ strip_markup(txt)
+ if txt.size > (endnote_clean - 1)
+ puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n"
+ open("#{Dir.pwd}/pg_documents_error_log",'a') do |error|
+ error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}")
+ end
+ txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n}
+ end
+ if txt
+ #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes
+ @conn.execute(%{
+ INSERT INTO endnotes_asterisk (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}');
+ })
+ end
+ end
+ end
+ word_mode=notedata.scan(/\S+/)
+ end
+ if notedata =~ /~\[\+.+?\]~/ #% import into database endnotes tables
+ endnote_array=notedata.scan(/~\[\+.+?\]~/)
+ endnote_array.each do |inf|
+ if inf[/~\[\+\d+.+?<[0-9a-f]{#{@@dl}}>\]~/] # dal new endnotes 2003w31/1
+ if inf[/~\[[+](\d+)(.+?)<([0-9a-f]{#{@@dl}})>\]~/] # dal new endnotes 2003w31/1
+ en,txt,digest_clean=$1,$2,$3
+ end
+ @id_n+=1
+ body=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],en).endnote
+ special_character_escape(body)
+ special_character_escape(txt)
+ strip_markup(txt)
+ if txt.size > (endnote_clean - 1)
+ puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n"
+ open("#{Dir.pwd}/pg_documents_error_log",'a') do |error|
+ error.puts("\n#{@opt.fns}\nENDNOTE\n#{txt.size} object #{@col[:ocn]},#{@col[:ocnd]},#{@col[:ocns]} -> #{txt.slice(0..500)}")
+ end
+ txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n}
+ end
+ if txt
+ #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes
+ @conn.execute(%{
+ INSERT INTO endnotes_plus (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}');
+ })
+ end
+ end
+ end
+ word_mode=notedata.scan(/\S+/)
+ end
+ end
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ def endnote_range(word_array)
+ @col[:en_a]=@col[:en_z]=nil
+ word_array.each do |w|
+ if w[/~[{\[][*+]?(\d+)\s+.+?[}\]]~/] # not tested since change 2003w31
+ @col[:en_a]=$1 unless @col[:en_a]
+ @col[:en_z]=@col[:en_a].dup unless @col[:en_a]
+ @col[:en_z]=$1 if @col[:en_a]
+ end
+ end
+ end
+ def import_db_urls(dbi_unit,meta) #% import documents OID - populate database
+ begin
+ @fnm=meta
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ base=@env.url.root
+ out=@env.path.output
+ markup,meta,latex,plaintext,html_toc,html_doc,xml_sax,xml_dom,pdf_p,pdf_l,concordance,sisupod='','','','','','','','','','','',''
+ markup_li,meta_li,latex_li,plaintext_li,html_li,xml_sax_li,xml_dom_li,pdf_p_li,pdf_l_li,concordance_li,sisupod_li='','','','','','','','','','',''
+ if @fnb.empty? or @fnb.nil?; p 'file output path error' #remove
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:plain]}")==true)
+ plaintext,plaintext_li='plaintext,', "'#{base}/#@fnb/#{@md.fn[:plain]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:toc]}")==true)
+ html_toc,html_toc_li='html_toc,', "'#{base}/#@fnb/#{@md.fn[:toc]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:doc]}")==true)
+ html_doc,html_doc_li='html_doc,', "'#{base}/#@fnb/#{@md.fn[:doc]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:xhtml]}")==true)
+ xhtml,xhtml_li='xhtml,', "'#{base}/#@fnb/#{@md.fn[:xhtml]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:sax]}")==true)
+ xml_sax,xml_sax_li='xml_sax,', "'#{base}/#@fnb/#{@md.fn[:sax]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:dom]}")==true)
+ xml_dom,xml_dom_li='xml_dom,', "'#{base}/#@fnb/#{@md.fn[:dom]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:odf]}")==true)
+ odf,odf_li='odf,', "'#{base}/#@fnb/#{@md.fn[:odf]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:pdf_p]}")==true)
+ pdf_p,pdf_p_li='pdf_p,', "'#{base}/#@fnb/#{@md.fn[:pdf_p]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:pdf_l]}")==true)
+ pdf_l,pdf_l_li='pdf_l,', "'#{base}/#@fnb/#{@md.fn[:pdf_l]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:concordance]}")==true)
+ concordance,concordance_li='concordance,', "'#{base}/#@fnb/#{@md.fn[:concordance]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.tex")==true)
+ latex_p,latex_p_li='latex_p,', "'#{base}/#@fnb/#{@opt.fns}.tex',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.landscape.tex")==true)
+ latex_l,latex_l_li='latex_l,', "'#{base}/#@fnb/#@opt.fns}.landscape.tex',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:digest]}")==true)
+ digest,digest_li='digest,', "'#{base}/#@fnb/#{@md.fn[:digest]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@md.fn[:manifest]}")==true) #revisit, was to be text, this is html
+ manifest,manifest_li='manifest,', "'#{base}/#@fnb/#{@md.fn[:manifest]}',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.meta")==true)
+ markup,markup_li='markup,', "'#{base}/#@fnb/#{@opt.fns}.meta',"
+ end
+ if @opt.cmd !~/e/ or (@opt.cmd=~/e/ and FileTest.file?("#{out}/#@fnb/#{@opt.fns}.tgz")==true)
+ sisupod,sisupod_li='sisupod,', "'#{base}/#@fnb/#{@opt.fns}.tgz',"
+ end
+ @conn.execute(%{
+ INSERT INTO urls (#{plaintext} #{html_toc} #{html_doc} #{xhtml} #{xml_sax} #{xml_dom} #{odf} #{pdf_p} #{pdf_l} #{concordance} #{latex_p} #{latex_l} #{manifest} #{digest} #{markup} #{sisupod} metadata_tid) VALUES (#{plaintext_li} #{html_toc_li} #{html_doc_li} #{xhtml_li} #{xml_sax_li} #{xml_dom_li} #{odf_li} #{pdf_p_li} #{pdf_l_li} #{concordance_li} #{latex_p_li} #{latex_l_li} #{manifest_li} #{digest_li} #{markup_li} #{sisupod_li} #{@@id_t});
+ })
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_indexes.rb b/lib/sisu/0.52/db_indexes.rb
new file mode 100644
index 00000000..cd9b6e87
--- /dev/null
+++ b/lib/sisu/0.52/db_indexes.rb
@@ -0,0 +1,95 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_index
+ class Index # create documents Indexes def initialize(opt,conn='',sql_type='')
+ def initialize(opt,conn='',sql_type='')
+ @opt,@conn,@sql_type=opt,conn,sql_type
+ end
+ def create_indexes # check added from pg not tested
+ def base
+ print '
+ create documents common indexes
+ ' unless @opt.cmd =~/q/
+ @conn.execute('
+ CREATE INDEX object_nr ON documents(ocn);
+ CREATE INDEX digest_clean ON documents(digest_clean);
+ CREATE INDEX digest_all ON documents(digest_all);
+ CREATE INDEX lev1 ON documents(lev1);
+ CREATE INDEX lev2 ON documents(lev2);
+ CREATE INDEX lev3 ON documents(lev3);
+ CREATE INDEX lev4 ON documents(lev4);
+ CREATE INDEX lev5 ON documents(lev5);
+ CREATE INDEX lev6 ON documents(lev6);
+ CREATE INDEX endnote_nr ON endnotes(nr);
+ CREATE INDEX digest_en ON endnotes(digest_clean);
+ CREATE INDEX endnote_nr_asterisk ON endnotes_asterisk(nr);
+ CREATE INDEX endnote_asterisk ON endnotes_asterisk(clean);
+ CREATE INDEX digest_en_asterisk ON endnotes_asterisk(digest_clean);
+ CREATE INDEX endnote_nr_plus ON endnotes_plus(nr);
+ CREATE INDEX endnote_plus ON endnotes_plus(clean);
+ CREATE INDEX digest_en_plus ON endnotes_plus(digest_clean);
+ CREATE INDEX title ON metadata(title);
+ CREATE INDEX filename ON metadata(filename)
+ ') unless @opt.cmd =~/q/
+ end
+ def text
+ print '
+ create documents text indexes
+ ' unless @opt.cmd =~/q/
+ @conn.execute('
+ CREATE INDEX clean ON documents(clean);
+ CREATE INDEX endnote ON endnotes(clean);
+ ') unless @opt.cmd =~/q/
+ end
+ base
+ @opt.cmd=~/D/ || @opt.mod=~/psql/ ? '' : text
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_load_tuple.rb b/lib/sisu/0.52/db_load_tuple.rb
new file mode 100644
index 00000000..1be35e5a
--- /dev/null
+++ b/lib/sisu/0.52/db_load_tuple.rb
@@ -0,0 +1,94 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_tuple
+ class Load_tuple #% main database populate
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ def initialize(conn,col,opt)
+ @conn,@col,@opt=conn,col,opt
+ @col[:lev]=@col[:lev].to_i
+ @col[:lev]=0 unless @col[:lev]=~/^[1-6]/ or @col[:lev]==1 or @col[:lev]==2 or @col[:lev]==3 or @col[:lev]==4 or @col[:lev]==5 or @col[:lev]==6 #changed from \d+ ??
+ @col[:ocn]=0 unless @col[:ocn]=~/\d+/
+ @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX
+ end
+ def tuple #% import line
+ begin
+ if @col[:en_a]
+ #puts.inspect "#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:en_a]}', '#{@col[:en_z]}'"
+ @conn.execute(%{
+ INSERT INTO documents (lid, metadata_tid, lev, clean, body, ocn, ocnd, ocns, seg, lev1, lev2, lev3, lev4, lev5, lev6, en_a, en_z, digest_clean, digest_all) VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:en_a]}', '#{@col[:en_z]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');
+ })
+ else
+ #puts.inspect "#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}'"
+ @conn.execute(%{
+ INSERT INTO documents (lid, metadata_tid, lev, clean, body, ocn, ocnd, ocns, seg, lev1, lev2, lev3, lev4, lev5, lev6, digest_clean, digest_all) VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');
+ })
+ end
+ if @opt.cmd =~/v/
+ if @col[:lev].to_s =~/[1235678]/
+ lev=case @col[:lev].to_s
+ when /1/; ':A'
+ when /2/; ':B'
+ when /3/; ':C'
+ when /5/; ' 2'
+ when /6/; ' 3'
+ end
+ puts %{#{lev}>\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}}
+ elsif @col[:lev].to_s =~/[4]/
+ puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}\t#{@col[:seg]}}
+ end
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ #@conn.execute("COMMIT")
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_remove.rb b/lib/sisu/0.52/db_remove.rb
new file mode 100644
index 00000000..81ec3643
--- /dev/null
+++ b/lib/sisu/0.52/db_remove.rb
@@ -0,0 +1,86 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_remove
+ class Remove
+ def initialize(opt,conn='' )
+ @opt,@conn=opt,conn
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @fnb=@md.fnb
+ @db=SiSU_Env::Info_db.new
+ end
+ def remove
+ del=@conn.select_one(%{ SELECT tid FROM metadata WHERE filename LIKE '#{@opt.fns}'; })
+ if del
+ del_id=del.join
+ #@conn.execute("BEGIN")
+ @conn.execute(%{
+ DELETE FROM endnotes WHERE metadata_tid LIKE '#{del_id}';
+ DELETE FROM endnotes_asterisk WHERE metadata_tid LIKE '#{del_id}';
+ DELETE FROM endnotes_plus WHERE metadata_tid LIKE '#{del_id}';
+ DELETE FROM documents WHERE metadata_tid LIKE '#{del_id}';
+ DELETE FROM urls WHERE metadata_tid LIKE '#{del_id}';
+ DELETE FROM metadata WHERE tid LIKE '#{del_id}';
+ /*
+ DELETE FROM documents WHERE documents.metadata_tid LIKE '#{del_id}';
+ DELETE FROM endnotes WHERE endnotes.metadata_tid LIKE '#{del_id}';
+ DELETE FROM endnotes_asterisk WHERE endnotes_asterisk.metadata_tid LIKE '#{del_id}';
+ DELETE FROM endnotes_plus WHERE endnotes_plus.metadata_tid LIKE '#{del_id}';
+ DELETE FROM urls WHERE urls.metadata_tid LIKE '#{del_id}';
+ DELETE FROM metadata WHERE metadata.tid LIKE '#{del_id}';
+ */
+ })
+ #@conn.execute("COMMIT")
+ else
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"no such file in database #{@db.db_psql}::#{@opt.fns}")
+ tell.puts_grey #if @opt.cmd.include? ?v
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_select.rb b/lib/sisu/0.52/db_select.rb
new file mode 100644
index 00000000..a6db4bfa
--- /dev/null
+++ b/lib/sisu/0.52/db_select.rb
@@ -0,0 +1,158 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_select
+ class Case
+ def initialize(opt,conn='',sql_type='pg')
+ @opt,@conn,@sql_type=opt,conn,sql_type
+ #@sdb=Create.new(@conn)
+ @sdb=SiSU_DB::Create.new(@opt,@conn,@sql_type)
+ @index=SiSU_DB::Index.new(@opt,@conn,@sql_type)
+ @sdb_no=SiSU_DB::Drop.new(@opt,@conn,@sql_type)
+ @sdb_import=SiSU_DB::Import.new(@opt,@conn,@sql_type) if @opt.mod.inspect =~/update|import/
+ @remove=SiSU_DB::Remove.new(@opt,@conn) if @opt.mod.inspect =~/update|remove/
+ @db=SiSU_Env::Info_db.new
+ end
+ def cases
+ @opt.mod.each do |mod|
+ case mod
+ when /^--createdb$/
+ @sdb.output_dir?
+ begin
+ @sdb.create_db
+ rescue; @sdb.output_dir?
+ end
+ when /^--(?:init(?:ialize)?|create(?:all)?)$/
+ @sdb.output_dir?
+ #@sdb.create_db
+ begin
+ @sdb.create_table_metadata
+ @sdb.create_table
+ @sdb.create_table_endnotes
+ @sdb.create_table_endnotes_asterisk
+ @sdb.create_table_endnotes_plus
+ @sdb.create_table_urls
+ @index.create_indexes
+ rescue; SiSU_Errors::Info_error.new($!,$@,'-D').error; @sdb.output_dir?
+ end
+ when /^--createtable(s)?$/
+ @sdb.output_dir?
+ begin
+ @sdb.create_table_metadata
+ @sdb.create_table
+ @sdb.create_table_endnotes
+ @sdb.create_table_endnotes_asterisk
+ @sdb.create_table_endnotes_plus
+ @sdb.create_table_urls
+ @index.create_indexes
+ rescue; @sdb.output_dir?
+ end
+ when /^--recreate$/
+ @sdb.output_dir?
+ begin
+ @sdb_no.drop_tables
+ @sdb.create_table_metadata
+ @sdb.create_table
+ @sdb.create_table_endnotes
+ @sdb.create_table_endnotes_asterisk
+ @sdb.create_table_endnotes_plus
+ @sdb.create_table_urls
+ @index.create_indexes
+ rescue; @sdb.output_dir?
+ end
+ when /^--cr(eate)?lex$/
+ @sdb.output_dir?
+ begin
+ @sdb.create_table
+ rescue; @sdb.output_dir?
+ end
+ when /^--cr(eate)?metadata$/
+ @sdb.output_dir?
+ begin
+ @sdb.create_table_metadata
+ rescue; @sdb.output_dir?
+ end
+ when /^--import$/
+ @sdb_import.marshal_load
+ tell=case @sql_type
+ when /sqlite/; SiSU_Screen::Ansi.new(@opt.cmd,"sqlite #{@db.db_sqlite} database?")
+ when /pg/; SiSU_Screen::Ansi.new(@opt.cmd,"pgaccess or psql #{@db.db_psql} database?")
+ else '???'
+ end
+ tell.puts_grey if @opt.cmd =~/v/
+ when /^--remove$/
+ @remove.remove
+ when /^--update$/
+ @remove.remove
+ @sdb_import.marshal_load
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"pgaccess or psql #{@db.db_psql} database?")
+ tell.puts_grey if @opt.cmd =~/v/
+ when /^--index$/
+ @index.create_indexes
+ when /^droptable(s)?$/
+ @sdb_no.drop_tables
+ when /^--dropindex(es)?$/
+ @sdb_no.drop_indexes
+ when /^--(?:dropall|drop)$/
+ @sdb_no.drop_tables
+ #@sdb_no.drop_indexes
+ when /^--(?:db=)?(?:(?:sq)?lite|pg(?:sql)?|my(?:sql)?)$/
+ else
+ help=SiSU_Help::Help.new
+ help.summary
+ help.commands
+ end
+ end
+ begin
+ @conn.commit if @sql_type =~/sqlite/
+ rescue; @sdb.output_dir?
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/db_tests.rb b/lib/sisu/0.52/db_tests.rb
new file mode 100644
index 00000000..8d6d7caf
--- /dev/null
+++ b/lib/sisu/0.52/db_tests.rb
@@ -0,0 +1,104 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB_tests
+ class Test
+ def initialize(info,opt)
+ @ck,@opt=info,opt
+ unless @opt.cmd =~/q/
+ puts @ck.tp[:fns]
+ puts @ck.tp[:title]
+ puts @ck.tp[:creator] if @ck.tp[:creator]
+ end
+ end
+ def verify
+ unless @opt.cmd =~/q/
+ puts @ck.tp[:fns].length.to_s + ' checklength ' + @ck.tp[:fns] if @ck.tp[:fns] and @ck.tp[:fns].length >@ck.lt_filename
+ puts @ck.tp[:title].length.to_s + ' checklength ' + @ck.tp[:title] if @ck.tp[:title] and @ck.tp[:title].length >@ck.lt_title
+ puts @ck.tp[:subtitle].length.to_s + ' checklength ' + @ck.tp[:subtitle] if @ck.tp[:subtitle] and @ck.tp[:subtitle].length >@ck.lt_subtitle
+ puts @ck.tp[:creator].length.to_s + ' checklength ' + @ck.tp[:creator] if @ck.tp[:creator] and @ck.tp[:creator].length >@ck.lt_creator
+ puts @ck.tp[:illustrator].length.to_s + ' checklength ' + @ck.tp[:illustrator] if @ck.tp[:illustrator] and @ck.tp[:illustrator].length >@ck.lt_illustrator
+ puts @ck.tp[:translator].length.to_s + ' checklength ' + @ck.tp[:translator] if @ck.tp[:translator] and @ck.tp[:translator].length >@ck.lt_translator
+ puts @ck.tp[:prepared_by].length.to_s + ' checklength ' + @ck.tp[:prepared_by] if @ck.tp[:prepared_by] and @ck.tp[:prepared_by].length >@ck.lt_prepared_by
+ puts @ck.tp[:digitized_by].length.to_s + ' checklength ' + @ck.tp[:digitized_by] if @ck.tp[:digitized_by] and @ck.tp[:digitized_by].length >@ck.lt_digitized_by
+ puts @ck.tp[:subject].length.to_s + ' checklength ' + @ck.tp[:subject] if @ck.tp[:subject] and @ck.tp[:subject].length >@ck.lt_subject
+ puts @ck.tp[:description].length.to_s + ' checklength ' + @ck.tp[:description] if @ck.tp[:description] and @ck.tp[:description].length >@ck.lt_description
+ puts @ck.tp[:publisher].length.to_s + ' checklength ' + @ck.tp[:publisher] if @ck.tp[:publisher] and @ck.tp[:publisher].length >@ck.lt_publisher
+ puts @ck.tp[:contributor].length.to_s + ' checklength ' + @ck.tp[:contributor] if @ck.tp[:contributor] and @ck.tp[:contributor].length >@ck.lt_contributor
+ puts @ck.tp[:date].length.to_s + ' checklength ' + @ck.tp[:date] if @ck.tp[:date] and @ck.tp[:date].length >@ck.lt_date
+ puts @ck.tp[:date_created].length.to_s + ' checklength ' + @ck.tp[:date_created] if @ck.tp[:date_created] and @ck.tp[:date_created].length >@ck.lt_date_created
+ puts @ck.tp[:date_issued].length.to_s + ' checklength ' + @ck.tp[:date_issued] if @ck.tp[:date_issued] and @ck.tp[:date_issued].length >@ck.lt_date_issued
+ puts @ck.tp[:date_valid].length.to_s + ' checklength ' + @ck.tp[:date_valid] if @ck.tp[:date_valid] and @ck.tp[:date_valid].length >@ck.lt_date_valid
+ puts @ck.tp[:date_available].length.to_s + ' checklength ' + @ck.tp[:date_available] if @ck.tp[:date_available] and @ck.tp[:date_available].length >@ck.lt_date_available
+ puts @ck.tp[:date_modified].length.to_s + ' checklength ' + @ck.tp[:date_modified] if @ck.tp[:date_modified] and @ck.tp[:date_modified].length >@ck.lt_date_modified
+ puts @ck.tp[:type].length.to_s + ' checklength ' + @ck.tp[:type] if @ck.tp[:type] and @ck.tp[:type].length >@ck.lt_type
+ puts @ck.tp[:format].length.to_s + ' checklength ' + @ck.tp[:format] if @ck.tp[:format] and @ck.tp[:format].length >@ck.lt_format
+ puts @ck.tp[:identifier].length.to_s + ' checklength ' + @ck.tp[:identifier] if @ck.tp[:identifier] and @ck.tp[:identifier].length >@ck.lt_identifier
+ puts @ck.tp[:source].length.to_s + ' checklength ' + @ck.tp[:source] if @ck.tp[:source] and @ck.tp[:source].length >@ck.lt_source
+ puts @ck.tp[:language].length.to_s + ' checklength ' + @ck.tp[:language] if @ck.tp[:language] and @ck.tp[:language].length >@ck.lt_language
+ puts @ck.tp[:language_original].length.to_s + ' checklength ' + @ck.tp[:language_original] if @ck.tp[:language_original] and @ck.tp[:language_original].length >@ck.lt_language_original
+ #puts @ck.tp[:language_char].length.to_s + ' checklength ' + @ck.tp[:language_char] if @ck.tp[:language_char] and @ck.tp[:language_char].length >@ck.lt_language_char
+ #puts @ck.tp[:language_original_char].length.to_s + ' checklength ' + @ck.tp[:language_original_char] if @ck.tp[:language_original_char] and @ck.tp[:language_original_char].length >@ck.lt_language_original_char
+ puts @ck.tp[:relation].length.to_s + ' checklength ' + @ck.tp[:relation] if @ck.tp[:relation] and @ck.tp[:relation].length >@ck.lt_relation
+ puts @ck.tp[:coverage].length.to_s + ' checklength ' + @ck.tp[:coverage] if @ck.tp[:coverage] and @ck.tp[:coverage].length >@ck.lt_coverage
+ puts @ck.tp[:rights].length.to_s + ' checklength ' + @ck.tp[:rights] if @ck.tp[:rights] and @ck.tp[:rights].length >@ck.lt_rights
+ puts @ck.tp[:copyright].length.to_s + ' checklength ' + @ck.tp[:copyright] if @ck.tp[:copyright] and @ck.tp[:copyright].length >@ck.lt_copyright
+ puts @ck.tp[:owner].length.to_s + ' checklength ' + @ck.tp[:owner] if @ck.tp[:owner] and @ck.tp[:owner].length >@ck.lt_owner
+ puts @ck.tp[:keywords].length.to_s + ' checklength ' + @ck.tp[:keywords] if @ck.tp[:keywords] and @ck.tp[:keywords].length >@ck.lt_keywords
+ puts @ck.tp[:abstract].length.to_s + ' checklength ' + @ck.tp[:abstract] if @ck.tp[:abstract] and @ck.tp[:abstract].length >@ck.lt_abstract
+ puts @ck.tp[:comment].length.to_s + ' checklength ' + @ck.tp[:comment] if @ck.tp[:comment] and @ck.tp[:comment].length >@ck.lt_comment
+ puts @ck.tp[:loc].length.to_s + ' checklength ' + @ck.tp[:loc] if @ck.tp[:loc] and @ck.tp[:loc].length >@ck.lt_loc
+ puts @ck.tp[:dewey].length.to_s + ' checklength ' + @ck.tp[:dewey] if @ck.tp[:dewey] and @ck.tp[:dewey].length >@ck.lt_dewey
+ puts @ck.tp[:isbn].length.to_s + ' checklength ' + @ck.tp[:isbn] if @ck.tp[:isbn] and @ck.tp[:isbn].length >@ck.lt_isbn
+ puts @ck.tp[:pg].length.to_s + ' checklength ' + @ck.tp[:pg] if @ck.tp[:pg] and @ck.tp[:pg].length >@ck.lt_pg
+ puts @ck.tp[:date] if @ck.tp[:date] !~/\d\d-\d\d-\d\d/
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/dbi.rb b/lib/sisu/0.52/dbi.rb
new file mode 100644
index 00000000..6c1b8adf
--- /dev/null
+++ b/lib/sisu/0.52/dbi.rb
@@ -0,0 +1,119 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: postgresql module, dbi import frame
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DBI #% database building
+ require SiSU_lib + '/help'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Screen
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ require SiSU_lib + '/shared_db'
+ include SiSU_DB
+ require SiSU_lib + '/shared_html_lite'
+ include SiSU_Format_Shared
+ class SiSU_SQL
+ def initialize(opt)
+ SiSU_Env::Load.new('dbi',true).prog
+ @opt=opt
+ @db=SiSU_Env::Info_db.new
+ if @opt.cmd =~/d/i or @opt.mod.inspect =~/--pg(?:sql)?|(?:sq)?lite/
+ @sql_type=if @opt.cmd=~/D/ or @opt.mod.inspect =~/--pg(?:sql)?/; 'pg'
+ elsif @opt.cmd =~/d/ and @opt.mod.inspect =~/--(?:db[=-])?pg(?:sql)?/; 'pg'
+ elsif @opt.mod.inspect =~/--(?:sq)?lite/; 'sqlite'
+ elsif @opt.cmd =~/d/ and @opt.mod.inspect =~/--(?:db[=-])?(?:sq)?lite/; 'sqlite'
+ #elsif @opt.cmd =~/d/ and @opt.mod.select =~/--my(?:sql)?/; 'mysql'
+ else 'sqlite'
+ end
+ end
+ end
+ def read_psql
+ begin
+ db,user,dbi=@db.db_psql,@db.user,@db.dbi_psql
+ @conn=DBI.connect(dbi,user,db)
+ rescue
+ if @opt.mod.inspect=~/--(createall|create)/
+ puts %{manually create the database: "#{db}" if it does not yet exist}
+ #sudo su -p postgres; createdb #{db}; #[createuser?]
+ end
+ SiSU_DB::Case.new(@opt,@conn,@sql_type).cases
+ @conn=DBI.connect(dbi,user,db)
+ ensure
+ end
+ end
+ def read_sqlite
+ begin
+ sql_type='sqlite'
+ dbi=@db.dbi_sqlite
+ @conn=DBI.connect(dbi)
+ rescue
+ ensure
+ end
+ end
+ def connect
+ case @sql_type
+ when /pg/; read_psql
+ when /sqlite/; read_sqlite
+ end
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"DBI (#@sql_type) #{@opt.mod}")
+ tell.dbi_title unless @opt.cmd =~/q/
+ begin
+ SiSU_DB::Case.new(@opt,@conn,@sql_type).cases
+ rescue; SiSU_Errors::Info_error.new($!,$@,@cf,@opt.fns).error
+ ensure
+ end
+ begin
+ @conn.disconnect if @sql_type =~/sqlite/
+ rescue
+ connect
+ end
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/defaults.rb b/lib/sisu/0.52/defaults.rb
new file mode 100644
index 00000000..29027b7b
--- /dev/null
+++ b/lib/sisu/0.52/defaults.rb
@@ -0,0 +1,2045 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: Default values (reset by skins)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+$latex_run=nil
+module SiSU_Viz
+ require 'uri'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/css'
+ include SiSU_Style
+ class Skin
+ #attr_accessor :glyph,:html,:php,:javascript,:path,:text,:url,:color,:icon,:font,:markup,:paragraph,:table,:table_do,:indent,:margin,:png,:nav_txt,:nav_png,:banner,:widget
+ def initialize
+ #@css=SiSU_Env::CSS_default.new
+ @fonts='verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman' # 'verdana, arial, georgia, tahoma, sans-serif, helvetica, "times new roman", times, roman'
+ @dir=SiSU_Env::Info_env.new
+ @date=SiSU_Env::Info_date.new
+ end
+ #% glyph
+ def glyph_bullet # &bullet;
+ '&#149;&nbsp;' # [&#149; flagged]
+ end
+ #% html
+ def html_hardspace
+ '&nbsp;'
+ end
+ #% php
+ def php_persist
+ end
+ #% javascript #kxjs knxjs
+ def js_home
+ end
+ def js_infobox
+ end
+ def js_knxjs
+ end
+ def js_head
+ end
+ def js_top
+ end
+ def js_sisu
+ end
+ def js_home
+ end
+ def js_sponsor
+ end
+ def js_books
+ end
+ def js_journals
+ end
+ def js_conferences
+ end
+ def js_services
+ end
+ def js_catalogue
+ end
+ def js_doc
+ end
+ def js_toc
+ end
+ def js_seg
+ end
+ def js_mail
+ end
+ def js_manifest
+ end
+ def js_status
+ end
+ def js_next
+ end
+ def js_prev
+ end
+ def js_portrait
+ end
+ def js_landscape
+ end
+ def js_pdf
+ end
+ def js_odf
+ end
+ def js_concordance
+ end
+ def js_instruments
+ end
+ def js_external
+ end
+ def js_gopher
+ end
+ def js_ftp
+ end
+ def js_law
+ end
+ def js_disclaimer
+ end
+ def js_old
+ end
+ #% path
+ def path_stylesheet_home
+ %{ <link rel="stylesheet" href="./#{@dir.path.style}/index.css" type="text/css" />}
+ end
+ #% text #changed from txt to avoid naming conflicts #FOLLOW
+ def txt_generator
+ v=SiSU_Env::Info_version.new.get_version
+ %{ <meta name="generator" content="#{v[:project]} #{v[:version]} of #{v[:date_stamp]} (#{v[:date]}) (n*x and Ruby!)" />
+ <link rel="generator" href="http://www.jus.uio.no/sisu" />}
+ end
+ def txt_generator_comment
+ v=SiSU_Env::Info_version.new.get_version
+ %{ <!- #{v[:project]} #{v[:version]} of #{v[:date_stamp]} (#{v[:date]}) (n*x and Ruby!)" http://www.jus.uio.no/sisu ->}
+ end
+ def txt_hp
+ '&nbsp;SiSU'
+ end
+ def txt_hp_alias
+ 'SiSU'
+ end
+ def txt_home
+ 'SiSU'
+ end
+ def txt_signature # used in latex/pdf footer
+ 'SiSU'
+ end
+ #% url
+ def url_urify(uri)
+ URI.parse(uri)
+ end
+ def url_sisu
+ 'http://www.jus.uio.no/sisu'
+ end
+ def url_root
+ '/sisu' #watch
+ end
+ def url_root_http
+ 'http://www.jus.uio.no/sisu' #watch
+ end
+ def url_home
+ 'http://www.jus.uio.no/sisu' # used in pdf header
+ end
+ def url_site #used as stub... where there are subdirectories and is different from home
+ url_home
+ #'http://www.jus.uio.no/sisu' # used in pdf header
+ end
+ def url_txt
+ 'www.jus.uio.no/sisu'
+ end
+ def url_path_image_base #used for html image display
+ '../_sisu/image_local'
+ end
+ def url_path_image #used for html image display
+ '../_sisu/image'
+ end
+ def url_path_ebook_dir
+ './ebook'
+ end
+ def url_path_ebook_images
+ '.'
+ end
+ def url_promo
+ ''
+ end
+ def url_promo_home
+ ''
+ end
+ #% color
+ def color_shadow
+ '"4"'
+ end
+ def color_body
+ %{<body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">}
+ end
+ def color_white
+ '"#ffffff"'
+ end
+ def color_black
+ '#000000'
+ end
+ def color_shadow #hmmm
+ '"4"'
+ end
+ def color_blue_dark
+ '#000099'
+ end
+ def color_blue
+ 'blue'
+ end
+ def color_blue_base
+ '#b9d4dd'
+ #'#eff6ff' #light
+ #'#c0d9d9' #light
+ #'#0044cc' #pale
+ #'#c0d9d9' #sky
+ end
+ def color_blue_ink
+ '#003399'
+ end
+ def color_blue_tinge
+ '#e3ecef'
+ #'#d7dddd'
+ #'#f2f5f7'
+ end
+ def color_blue_grey
+ '#8faebf'
+ end
+ def color_blue_murky
+ '#437389'
+ end
+ #def color_brown
+ # '#423a27'
+ #end
+ def color_beige
+ '#f1e8de'
+ #'#fff3b6'#custard
+ end
+ def color_subtleglow
+ '#dddccc'
+ end
+ def color_glow
+ '#fff0c3'
+ end
+ def color_rose
+ '#ffdec9'
+ end
+ def color_turquoise
+ '#1c869b'
+ end
+ def color_grey_pale
+ '#eeeeee'
+ # '#dddddd' #light
+ end
+ def color_grey_medium
+ '#cccccc'
+ end
+ def color_grey
+ '#999999'
+ end
+ def color_yellow_light
+ '#fff3b6'
+ end
+ def color_yellow
+ '#ffde14'
+ end
+ def color_yellow_dark
+ '#ffcc00'
+ end
+ def color_green_light
+ '#b7d398' # #e2efd5 #b7d398 #b1c999 # '#aed19e'
+ end
+ def color_green
+ '#0a8400'
+ end
+ def color_green_dark
+ '#086800'
+ end
+ def color_ruby
+ '#a00000'
+ end
+ def color_maroon
+ '#800000'
+ end
+ def color_paper
+ %{"#{color_white}"}
+ end
+ def color_band1
+ %{"#{color_white}"}
+ #'"#777777"'
+ end
+ def color_band2
+ %{"#{color_white}"}
+ #'"#cccccc"'
+ end
+ def color_body
+ %{\n<body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">\n}
+ end
+ def color_font_face #was font WATCH
+ "#{color_black}"
+ end
+ def color_surround
+ %{"#{color_white}"}
+ end
+ def color_band
+ %{"#{color_white}"}
+ end
+ def color_table1
+ 'ffffcc'
+ end
+ def color_table2
+ 'c0d0f0'
+ end
+ def color_band1
+ '"#ffffff"'
+ end
+ def color_band2
+ '"#ffffff"'
+ end
+ #% icon
+ def icon_ico
+ 'rb7.ico'
+ end
+ def icon_sisu
+ 'sisu.png'
+ end
+ def icon_manifest
+ 'bullet_red.png'
+ end
+ def icon_doc
+ 'b_doc.png'
+ end
+ def icon_toc
+ 'b_toc.png'
+ end
+ def icon_wmp
+ 'b_wmp.png'
+ end
+ def icon_odf
+ 'b_odf.png'
+ end
+ def icon_pdf
+ 'b_pdf.png'
+ end
+ def icon_pdf_portrait
+ 'b_pdf.png'
+ end
+ def icon_pdf_landscape
+ 'b_pdf.png'
+ end
+ def icon_status
+ 'b_status.png'
+ end
+ def icon_external
+ 'b_ext.png'
+ end
+ def icon_external_toc
+ 'b_ext_toc.png'
+ end
+ def icon_seg_toc
+ 'b_bluebell.png'
+ end
+ def icon_crosslink_toc
+ 'b_amber.png'
+ end
+ def icon_mail
+ 'b_mail.png'
+ end
+ def icon_para
+ 'b_para.png'
+ end
+ def icon_pdf
+ 'b_pdf.png'
+ end
+ def icon_ftp
+ 'b_ftp.png'
+ end
+ def icon_gopher
+ 'b_gopher.png'
+ end
+ def icon_choice
+ 'b_choice.png'
+ end
+ def icon_new
+ 'b_new.png'
+ end
+ def icon_book
+ 'b_amber.png'
+ # b_book.png
+ end
+ def icon_dot_clear
+ 'dot_clear.png'
+ end
+ def icon_dot_white
+ 'dot_white.png'
+ end
+ def icon_dot
+ icon_dot_white
+ end
+ def icon_amber
+ 'b_amber.png'
+ end
+ def icon_rose
+ 'b_rose.png'
+ end
+ def icon_bluebell
+ 'b_bluebell.png'
+ end
+ def icon_home_button
+ 'sisu.png'
+ end
+ def icon_home_banner
+ 'sisu.png'
+ end
+ def icon_site
+ 'b_home.png'
+ end
+ def icon_bluedot
+ 'blueband.png'
+ end
+ def icon_next
+ 'arrow_next_red.png'
+ end
+ def icon_previous
+ 'arrow_prev_red.png'
+ end
+ def icon_up
+ 'arrow_up_red.png'
+ end
+ #% font
+ def font_fonts
+ @fonts
+ end
+ def font_face
+ %{face="#{font_fonts}"}
+ end
+ def font_lmtoc_face
+ %{face="#{font_fonts}"}
+ end
+ def font_ebook_face
+ %{face="#{font_fonts}"}
+ end
+ def font_face_lmtoc
+ %{face="#{font_fonts}"}
+ end
+ def font_color
+ 'color="#000000"'
+ end
+ def font_size
+ 'size="4"'
+ end
+ def font_size_txt
+ 'size="4"'
+ end
+ def font_size_txt_00
+ 'size="3"'
+ end
+ def font_size_endnote
+ 'size="3"'
+ end
+ def font_small
+ 'size="3"'
+ end
+ def font_tiny
+ 'size="2"'
+ end
+ #% markup
+ def markup_italics_list #regular expression of words to be italised
+ end
+ def markup_bold_list #regular expression of words to be made bold
+ 'SiSU'
+ end
+ def markup_make_italic
+ if defined? italics_list and italics_list
+ #make=italics_list.split(/;\s+/).join('|').strip
+ make={}
+ if italics_list
+ r=italics_list.dup
+ x=case r
+ when /\/i$/; 'i'
+ else ''
+ end
+ r.gsub!(/^\/(.+?)\/i?/,'\1')
+ r.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided
+ m='\b(' + r + ')\b'
+ make[:str]
+ make[:regx]=if x =~/i/; /#{m}/i
+ else /#{m}/
+ end
+ else nil
+ end
+ end
+ end
+ def markup_make_bold
+ if defined? bold_list and not bold_list.empty?
+ make={}
+ if bold_list
+ #make=bold_list.split(/;\s+/).join('|').strip
+ r=bold_list.dup
+ x=case r
+ when /\/i$/; 'i'
+ else ''
+ end
+ r.gsub!(/^\/(.+?)\/i?/,'\1')
+ r.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided
+ m='\b(' + r + ')\b'
+ make[:str]
+ make[:regx]=if x =~/i/; /#{m}/i
+ else /#{m}/
+ end
+ else nil
+ end
+ make
+ end
+ end
+ #% paragraph
+ def paragraph_txt
+ %{<p class="normal">}
+ end
+ def paragraph_txt_00
+ %{<p class="justify">}
+ end
+ def paragraph_font_citation
+ %{<font #{font_size_txt} #{font_face}>}
+ end
+ def paragraph_endnote
+ %{<p class="endnote">}
+ end
+ def paragraph_table
+ %{<p align="left"><font #{font_small} #{font_color} #{font_face}>}
+ end
+ def paragraph_table_xml
+ end
+ def paragraph_tiny
+ %{<p class="tiny">}
+ end
+ def paragraph_small
+ %{<p class="small">} # keep but not used?
+ end
+ def paragraph_font_tiny
+ %{<font #{font_tiny} #{font_face}>}
+ end
+ def paragraph_font_small
+ %{<font #{font_small} #{font_face}>}
+ end
+ def paragraph_heading_1
+ %{<h1>}
+ end
+ def paragraph_heading_1_center
+ %{<h1 class="center">}
+ end
+ #% table
+ def table_close
+ '</td></tr>
+</table>'
+ end
+ def table_close_centered_table
+ end
+ def table_align_A
+ end
+ def table_align_B
+ end
+ def table_align_C
+ end
+ def table_width_1
+ '"100%"'
+ end
+ def table_width_2
+ '"99%"'
+ end
+ def table_width_3
+ '"94%"'
+ end
+ def table_width_4
+ '"90%"'
+ end
+ def table_width_txt
+ '"94%"'
+ end
+ def table_width_txt_avgo
+ '"100%"'
+ end
+ def table_width_txt_r
+ '"96%"'
+ end
+ def table_cellpad_small_paper_margins
+ '"6"'
+ end
+ def table_cellpad_paper_margins
+ '"36"'
+ end
+ def table_cellpad_A
+ '"0"'
+ end
+ def table_cellpad_B
+ '"20"'
+ end
+ def table_cellpad_shadow
+ '"4"'
+ end
+ def table_cellpad_band
+ '"16"'
+ end
+ def table_cellpad_box
+ '"20"'
+ end
+ def table_table_align_A
+ '<center>'
+ end
+ def table_table_align_B
+ '<center>'
+ end
+ def table_table_align_C
+ ' '
+ end
+ #% table_do
+ def table_do_table_paper
+ %{#{table_align_C} <table summary="table paper" width=#{table_width_2} border="0" cellpadding=#{table_cellpad_paper_margins} bgcolor=#{color_paper} align="Justify"><tr><td>\n<font color="#000000"><p />\n}
+ end
+ def table_do_table_surround
+ %{<table summary="table surround" width="100%" border="0" cellpadding="0" bgcolor="#ffffff" align="center"><tr><td>\n}
+ end
+ #% indent
+ def indent_level_0
+ '"1%"'
+ end
+ def indent_level_1
+ '"4%"'
+ end
+ def indent_level_2
+ '"6%"'
+ end
+ def indent_level_3
+ '"8%"'
+ end
+ def indent_level_4
+ '"10%"'
+ end
+ #% margin
+ def margin_num
+ '</p> </td><td width="4%" align="right" valign="top">'
+ end
+ def margin_numless
+ '</td><td width="4%" align="right" valign="top">'
+ end
+ def margin_num_css
+ '</td>
+<td width="2%" align="right" valign="top"> '
+ end
+ def margin_num_header
+ '</td>
+<td width="4%" align="right" valign="top">'
+ end
+ def margin_txt_00_1
+ %{<table summary="" width=#{table_width_txt} border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td width=#{indent_level_1} align="right">
+</td>
+<td valign="top" align="left" width=#{indent_level_1_c2w100}>}
+ end
+ def margin_txt_w1
+ %{<table summary="" width=#{table_width_txt_r} border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td width="6%" align="right">&nbsp;</td>
+<td width="90%" valign="top" align="justify">}
+ end
+ def margin_txt_w2
+ %{<table summary="" width=#{table_width_txt_r} border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td width="10%" align="right">&nbsp;</td>
+<td width="86%" valign="top" align="justify">}
+ end
+ def margin_txt_0
+ %{<table summary="" width=#{table_width_txt} border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td width=#{indent_level_0} align="right">
+</td><td valign="top" align="justify">}
+ end
+ def margin_txt_1
+ %{<table summary="" width=#{table_width_txt} border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td width=#{indent_level_1} align="right"></td><td valign="top" align="justify">}
+ end
+ def margin_txt_2
+ %{<table summary="" width=#{table_width_txt} border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td width=#{indent_level_2} align="right">
+</td>
+<td valign="top" align="justify">}
+ end
+ def margin_txt_3
+ %{<table summary="" width=#{table_width_txt} border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td width=#{indent_level_3} align="right">
+</td>
+<td valign="top" align="justify">}
+ end
+ def margin_css
+ '<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><td valign="top" align="justify"> '
+ end
+ #% png
+ def png_ico
+ %{ <link rel="shortcut icon" href="../_sisu/image/#{icon_ico}" />}
+ end
+ def png_sisu #check url path
+ %{ <a href="#{@url.sisu}">
+ <img border="0" width="160" height="60" src="#{url_path_image}/#{icon_sisu}" alt="SiSU" />
+ </a>}
+ end
+ def png_hp
+ dir=SiSU_Env::Info_env.new #(@fns)
+ %{ <a href="#{url.site}">
+ <img border="0" width="160" height="60" src="#{@dir.url.images_local}/#{icon_home_banner}" alt="#{txt_home}" />
+ </a>}
+ end
+ def png_site
+ #dir=SiSU_Env::Info_env.new #(@fns)
+ %{<img src="#{url_path_image}/#{icon_site}" alt="@" border="0" />}
+ end
+ def png_homepage
+ png_site
+ end
+ def png_nav
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_bluebell}" alt="Contents" />}
+ end
+ def png_manifest
+ %{<img border="0" height="12" width="12" src="#{url_path_image}/#{icon_manifest}" alt="Document Manifest" />}
+ end
+ def png_doc
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_doc}" alt="Full Text" />}
+ end
+ def png_toc
+ %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_toc}" alt="TOC linked" />}
+ end
+ def png_odf
+ %{<img border="0" height="18" width="18" src="#{url_path_image}/#{icon_odf}" alt="ODF/ODT" />}
+ end
+ def png_pdf
+ %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_pdf}" alt="PDF" />}
+ end
+ def png_pdf_portrait
+ %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_pdf}" alt="PDF portrait" />}
+ end
+ def png_pdf_landscape
+ %{<img border="0" height="15" width="18" src="#{url_path_image}/#{icon_pdf}" alt="PDF landscape" />}
+ end
+ def png_wmp
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_wmp}" alt="Concordance" />}
+ end
+ def png_para
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_para}" alt="Segment" />}
+ end
+ def png_status
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_status}" alt="Membership status" />}
+ end
+ def png_mark
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_rose}" alt="*" />}
+ end
+ def png_doc_tiny
+ %{<img border="0" height="8" width="8" src="#{url_path_image}/#{icon_doc}" alt="Doc" />}
+ end
+ def png_toc_tiny
+ %{<img border="0" height="8" width="8" src="#{url_path_image}/#{icon_toc}" alt="TOC" />}
+ end
+ def png_status_tiny
+ %{<img border="0" height="8" width="8" src="#{url_path_image}/#{icon_status}" alt="Status, Member States" />}
+ end
+ def png_ftp
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_ftp}" alt="FTP" />}
+ end
+ def png_gopher
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_gopher}" alt="Gopher" />}
+ end
+ def png_crosslink
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_crosslink_toc}" alt="lateral hop" />}
+ end
+ def png_crosslink_ext
+ %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_external_toc}" alt="lateral hop" />}
+ end
+ def png_home
+ dir=SiSU_Env::Info_env.new #(@fns)
+ %{<img border="0" src="#{dir.url.images_local}/#{icon_home_button}" alt="#{txt_home} --&gt;" />}
+ end
+ def png_home_button
+ #dir=SiSU_Env::Info_env.new #(@fns)
+ %{<img border="0" src="#{url_path_image_base}/#{icon_home_button}" alt="#{txt_home} --&gt;" />}
+ end
+ def png_book
+ %{<img border="2" height="15" width="15" src="#{url_path_image}/#{icon_book}" alt="Cameron May Books" />}
+ end
+ #% png_nav
+ def png_nav_home
+ end
+ def png_nav_toc
+ %{<img border="0" width="22" height="22" src="#{url_path_image}/#{icon_up}" alt="TOC" />}
+ end
+ def png_nav_doc
+ end
+ def png_nav_previous
+ %{<img border="0" width="22" height="22" src="#{url_path_image}/#{icon_previous}" alt="&lt;&lt;&nbsp;previous" />}
+ end
+ def png_nav_next
+ %{<img border="0" width="22" height="22" src="#{url_path_image}/#{icon_next}" alt="next&nbsp;&gt;&gt;" />}
+ end
+ def png_nav_pre
+ png_nav_previous
+ end
+ def png_nav_nxt
+ png_nav_next
+ end
+ def png_nav_pdf
+ %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_pdf}" alt="PDF" />}
+ end
+ def png_nav_pdf_portrait
+ %{<img border="0" width="15" height="18" src="#{url_path_image}/#{icon_pdf}" alt="pdf portrait" />}
+ end
+ def png_nav_pdf_landscape
+ %{<img border="0" width="18" height="15" src="#{url_path_image}/#{icon_pdf}" alt="pdf landscape" />}
+ end
+ def png_nav_dot_toc
+ %{<img border="0" width="100%" height="20" src="#{url_path_image}/#{icon_dot}" alt="&#094;" />}
+ end
+ def png_nav_dot_previous
+ %{<img border="0" width="100%" height="20" src="#{url_path_image}/#{icon_dot}" alt="&lt;" />}
+ end
+ def png_nav_dot_next
+ %{<img border="0" width="100%" height="20" src="#{url_path_image}/#{icon_dot}" alt="&gt;" />}
+ end
+ def png_nav_dot_pre
+ png_nav_dot_previous
+ end
+ def png_nav_dot_nxt
+ png_nav_dot_next
+ end
+ #% nav_txt
+ def nav_txt_home
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_site}&nbsp;
+ </font> }
+ end
+ def nav_txt_home_button
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_home_button}&nbsp;
+ </font> }
+ end
+ def nav_txt_homepage
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_site}&nbsp;homepage&nbsp;
+ </font> }
+ end
+ def nav_txt_toc_link
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_toc}&nbsp;&nbsp;toc&nbsp;
+ </font> }
+ end
+ def nav_txt_toc_link_verbose
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_toc}&nbsp;&nbsp;segments'&nbsp;toc&nbsp;
+ </font> }
+ end
+ def nav_txt_doc_link
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_doc}&nbsp;&nbsp;scroll&nbsp;
+ </font> }
+ end
+ def nav_txt_manifest
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_manifest}&nbsp;&nbsp;?&nbsp;
+ </font> }
+ end
+ def nav_txt_concordance
+ %{ <font face="#{font_fonts}" size="2">
+ &nbsp;&nbsp;A-Z&nbsp;
+ </font> }
+ end
+ def nav_txt_previous
+ ' <font face="" size="2">
+ &nbsp;&nbsp;<b>&lt;&lt;</b>&nbsp;Previous&nbsp;&nbsp;
+ </font>
+ Full&nbsp;Text&nbsp;'
+ end
+ def nav_txt_next
+ %{ <font face="#{font_fonts}" size="2">
+ &nbsp;&nbsp;Next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>&gt;&gt;</b>&nbsp;&nbsp;
+ </font> }
+ end
+ def nav_txt_odf
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_odf}&nbsp;&nbsp;odt&nbsp;
+ </font> }
+ end
+ def nav_txt_pdfs
+ %{ <font face="#{font_fonts}" size="2">
+ pdfs&nbsp;&nbsp;
+ </font> }
+ end
+ def nav_txt_pdf_portrait
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_pdf_portrait}
+ &nbsp;&nbsp;pdf&nbsp;
+ </font> }
+ end
+ def nav_txt_pdf_landscape
+ %{ <font face="#{font_fonts}" size="2">
+ #{png_pdf_landscape}
+ &nbsp;&nbsp;pdf&nbsp;
+ </font> }
+ end
+ #% banner
+ def banner_home
+ %{ <center>
+ <a href="#{url_site}/" target="_top" #{js_home}>
+ #{png_site}
+ </a>
+ <br />
+ <font size="2" color="#444444">
+ an
+ <br />
+ (&nbsp;international&nbsp;|&nbsp;transnational&nbsp;)
+ <br />
+ commercial&nbsp;law&nbsp;&&nbsp;e-commerce
+ <br />
+ infrastructure monitor</font></center>}
+ end
+ def banner_home_guide
+ %{ <br />
+ <a href="#{url_site}/" target="_top" #{js_home}>
+ #{png_doc} LM toc
+ </a>
+ <a href="../treaties.and.organisations/lm.chronological" target="_top" #{js_instruments}>
+ #{png_doc} LM 20**
+ </a>
+ <br />}
+ end
+ def banner_home_button_only
+ %{<a href="#{url_site}/" #{js_home}>
+ #{png_home_button}
+ </a>}
+ end
+ def banner_home_button #yellow_dark now white
+ %{<table summary="home button" width="100%" border="0" cellpadding="3" bgcolor= "#ffffff" align="center">
+<tr><td align="left" valign="middle" bgcolor="#{color_white}" width="10%">
+ <a href="#{url_site}/" #{js_home}>
+ #{png_home_button}
+ </a>
+</td>
+<td width="90%">
+#{table_close}}
+ end
+ def banner_home_and_index_buttons #yellow_dark now white
+ %{<table summary="home and index buttons" bgcolor=#{color_band1}>
+<tr><td width="20%">
+<table summary="home button" width="100%" border="0" cellpadding="3" align="center">
+<tr><td align="center" valign="middle" bgcolor="#{color_white}">
+ <a href="#{url_site}/" target="_top" #{js_home}>
+ #{png_home}
+ </a>
+</td></tr>
+</table>
+</td>
+<td width="60%">
+<table summary="other contents buttons" border="0" cellpadding="3" cellspacing="0">
+<tr><td align="center" bgcolor=#{color_band2}>
+ <font face="arial" size="2">
+ <a href="toc" target="_top" #{js_toc}>
+ &nbsp;This&nbsp;text's&nbsp;sub-&nbsp;
+ <br />
+ &nbsp;Table&nbsp;of&nbsp;Contents&nbsp;
+ </a>
+ </font>
+</td></tr>
+</table>
+</td>
+<td width="20%">
+ &nbsp;
+#{table_close}}
+ end
+ def banner_url_txt_sisu
+ %{<a href="#{url_sisu}/sisu" target="_top" #{js_home}>SiSU</a>}
+ end
+ def banner_band #yellow_dark now white
+ %{<table summary="home button" width="100%" border="0" cellpadding="3" bgcolor= "#ffffff" align="center">
+<tr><td align="left" valign="middle" bgcolor="#{color_white}">
+ <a href="#{url_site}/" target="_top" #{js_home}>
+ #{png_home}
+ </a>
+</td>
+<td width="90%">
+#{table_close}}
+ end
+ def banner_credit_band
+ %{<table summary="credits table yellow" width="80%" border="1" cellpadding="0" bgcolor="#{color_yellow_dark}" align="center">
+<tr><td align="center">
+<table summary="salmon" width="100%" border="0" cellpadding="0" bgcolor="#ffdec9">
+<tr><td align="center">
+<table summary="credits white background" width="100%" border="0" cellpadding="6" bgcolor="#ffffff">
+<tr><td align="center">}
+ end
+ def banner_instrument_cover_band_scr
+ '<table summary="scroll instrument cover band" width="100%" border="0" cellpadding="8" bgcolor="#ffffff" align="center">
+<tr><td align="center">'
+ end
+ def banner_instrument_cover_band_seg
+ '<table summary="segment instrument cover band, title, author, location" width="100%" border="0" cellpadding="8" bgcolor="#ffffff" align="center">
+<tr><td align="center">'
+ end
+ #% widget
+ def widget_promo # Array used to build promo from list.yml and promo.yml
+ # ['sisu_icon','sisu','sisu_search_libre','open_society','fsf','ruby']
+ end
+ def widget_browsers
+<<WOK
+<tr align="center"><td align="center">
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+ <p>
+ <font color="#666666" size="2">
+ If you have problems viewing pages on this site please update your browser:
+ </font>
+ </p>
+#{table_close}
+<table summary="browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.gnome.org/projects/epiphany/" target="external">
+ &nbsp;Epiphany
+ </a>
+ <sup>&reg;</sup>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://galeon.sourceforge.net/" target="external">
+ &nbsp;Galeon
+ </a>
+ <sup>&reg;</sup>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.microsoft.com/windows/ie/default.asp" target="external">
+ I-Explorer
+ </a>
+ <sup>&reg;</sup>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://kazehakase.sourceforge.jp/" target="external">
+ Kazehakase</a>
+ <sup>&reg;</sup>&nbsp;|</font></p></td>
+<td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.konqueror.org/" target="external">
+ Konqueror</a>
+ <sup>&reg;</sup>&nbsp;|</font></p></td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.mozilla.org/" target="external">
+ Mozilla
+ </a>
+ <a href="http://www.mozilla.org/products/firefox/" target="external">
+ <b>Firefox</b>
+ </a>
+ <sup>&reg;</sup>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://home.netscape.com/comprod/mirror/client_download.html" target="external">
+ Netscape
+ </a>
+ <sup>&reg;</sup>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.opera.com/" target="external">
+ Opera
+ </a>
+ <sup>&reg;</sup>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.apple.com/safari/" target="external">
+ Safari
+ </a>
+ <sup>&reg;</sup>
+ </font>
+ </p>
+#{table_close}
+<table summary="lightweight browser and text browser suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+ <p>
+ <font color="#666666" size="1">
+ for console/text viewing:
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://elinks.or.cz/" target="external">
+ <b>elinks</b>
+ </a>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links" target="external">
+ <b>links2</b>
+ </a>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://w3m.sourceforge.net/" target="external">
+ <b>w3m</b>
+ </a>
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ for lightweight gui (X) viewing try:
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.dillo.org/" target="external">
+ Dillo
+ </a>
+ &nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://www.gnome.org/projects/epiphany/" target="external">
+ &nbsp;Epiphany
+ </a>
+ <sup>&reg;</sup>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://galeon.sourceforge.net/" target="external">
+ &nbsp;Galeon
+ </a>&nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p>
+ <font color="#666666" size="1">
+ <a href="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links" target="external">
+ <b>links2 -g</b>
+ </a>
+ </font>
+ </p>
+#{table_close}
+</td></tr>
+WOK
+ end
+ def widget_pdfviewers
+<<WOK
+<tr align="center"><td align="center">
+<table summary="pdf viewer suggestions" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+ <p class="center">
+ <font color="#666666" size="1">
+ &amp; for
+ <a href="http://www.adobe.com/products/acrobat/adobepdf.html" target="external">
+ pdf
+ </a>
+ viewings of this site we recommend stand alone viewers
+ <br />
+ (rather than web browser plugins):
+ </font>
+ </p>
+#{table_close}
+<table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
+<tr align="center"><td align="center">
+ <p class="center">
+ <font color="#666666" size="1">
+ <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="external">
+ Acrobat Reader
+ </a>
+ <sup>&reg;</sup>
+ &nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p class="center">
+ <font color="#666666" size="1">
+ <a href="http://www.gnome.org/projects/evince/" target="external">
+ <b>Evince</b>
+ </a>
+ <sup>&reg;</sup>
+ </font>
+ </p>
+</td>
+<td>
+ <p class="center"><font color="#666666" size="1">
+ <a href="http://www.cs.wisc.edu/~ghost/gv/" target="external">
+ &nbsp;GhostView<sup>&reg;</sup>&nbsp;</a>,
+ <a href="http://wwwthep.physik.uni-mainz.de/~plass/gv/" target="external">
+ GV<sup>&reg;</sup>
+ </a>
+ &amp;
+ <a href="http://www.cs.wisc.edu/~ghost/gsview/" target="external">
+ GSview<sup>&reg;</sup>
+ </a>
+ &nbsp;|
+ </font>
+ </p>
+</td>
+<td>
+ <p class="center">
+ <font color="#666666" size="1">
+ <a href="http://www.foolabs.com/xpdf/" target="external">
+ &nbsp;Xpdf
+ </a>
+ <sup>&reg;</sup>
+ </font>
+ </p>
+#{table_close}
+WOK
+ end
+ def widget_googlegroups
+<<WOK
+<table style="border:1px solid #aa0033; font-size:small" align=center>
+<tr><td rowspan=3>
+ <img src="http://groups-beta.google.com/groups/img/groups_medium.gif" height=58 width=150 alt="Google Groups" />
+</td>
+<td colspan=2 align=center>
+ <b>Subscribe to SiSU e-docs</b>
+</td>
+</tr>
+<form action="http://groups-beta.google.com/group/SiSU_e-docs/boxsubscribe">
+ <tr><td>
+ Email:
+ <input type=text name=email>
+ </td>
+ <td>
+ <table style="background-color:#ffcc33;padding:2px;border:2px outset #ffcc33;">
+ <tr><td>
+ <input type=submit name="sub" value="Subscribe">
+ </td></tr>
+ </table>
+ </td></tr>
+</form>
+<tr><td colspan=2 align=center>
+ <a href="http://groups-beta.google.com/group/SiSU_e-docs">
+ Browse Archives
+ </a> at
+ <a href="http://groups-beta.google.com/">
+ groups-beta.google.com</a>
+ </td></tr>
+</table>
+WOK
+ end
+ def widget_sisu
+ v=SiSU_Env::Info_version.new.get_version
+<<WOK
+<table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
+<tr align="center"><td align="center">
+ <p class="center">
+ <font color="#666666" size="2">
+ presentations' look and feel
+ <br />
+ generated by
+ <br />
+ <a href="#{url_sisu}" #{js_sisu}>
+ <img border="0" src="../_sisu/image/sisu.png" alt="SiSU" width="120" height="39" />
+ </a>
+ <br />
+ <a href="#{url_sisu}" #{js_sisu}>
+ #{v[:project]}
+ </a>
+ <br />
+ version #{v[:version]}
+ <br />
+ #{v[:date_stamp]} (#{v[:date]})
+ <br />
+ </font>
+ </p>
+<table summary="SiSU rights" bgcolor="#ffffff" cellpadding="4" border="0" align="center" width="40%">
+<tr align="center"><td align="left">
+ <p class="left">
+ <font color="#666666" size="2">
+ Generated by
+ <a href="#{url_sisu}" #{js_sisu}>
+ SiSU
+ </a>
+ <br />
+ #{v[:project]} #{v[:version]} #{v[:date_stamp]}
+ <br />
+ <a href="#{url_sisu}" #{js_sisu}>
+ www.jus.uio.no/sisu
+ </a>
+ <br />
+ 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 #{@date.year}.
+ <br />
+ All Rights Reserved.
+ <br />
+ SiSU is the result of several years of research and development in electronic
+ publishing, commenced in 1993 and under active development since 1997.
+ <br />
+ <b>SiSU is released under
+ <a href="http://www.gnu.org/copyleft/gpl.html">
+ GPL 2
+ </a>
+ or later</b>
+ <a href="http://www.gnu.org/copyleft/gpl.html">
+ http://www.gnu.org/copyleft/gpl.html
+ </a>
+ <br />
+ (SiSU's first public release on January 4<sup>th</sup> 2005)
+ <br />
+ </font>
+ </p>
+ <p class="center">
+ <font color="#666666" size="3">
+ <sup>&copy;</sup> Ralph Amissah
+ <br />
+ 1993, current #{@date.year}
+ <br />
+ All Rights Reserved
+ <br />
+ <i>w3 since October 3 1993</i>
+ <br />
+ <a href="mailto://ralph@amissah.com" #{js_mail}>
+ ralph@amissah.com
+ </a>
+ <br />
+ </font>
+ </p>
+WOK
+ end
+ def widget_way_better
+ <<WOK
+ <p class="center">
+ <font color="#666666" size="2">
+ Developed
+ <br />
+ using
+ <a href="http://www.ruby-lang.org/en/">
+ Ruby
+ </a>
+ <br />
+ on
+ <a href="http://www.debian.org/">
+ Debian/Gnu/Linux
+ </a>
+ software infrastructure,
+ <br />
+ &amp; with the usual GPL (or OSS) suspects.
+ <br />
+ Better - "performance, reliability, scalability, security
+ <br />
+ &amp; total cost of ownership"
+ <br />
+ [not to mention flexibility &amp; choice]
+ <br />
+ <br />
+ Get With the Future
+ <br />
+ <a href="http://www.jus.uio.no/sisu/">
+ Way Better!
+ </a>
+ </font>
+ </p>
+#{table_close}
+#{table_close}
+WOK
+ end
+ def widget_wayBetter
+ widget_way_better
+ end
+ #% credits
+ def credits_itl_cover_band
+ %{<table summary="itl cover band" width="88%" border="0" cellpadding="0" bgcolor="blue">
+<tr><td>
+<table summary="" width="100%" border="0" cellpadding="8" bgcolor="#000099">
+<tr><td>
+<table summary="" width="99%" border="1" cellpadding="0" bgcolor="#ffcc00">
+<tr><td>
+<table summary="" width="100%" border="1" cellpadding="0" bgcolor="#ffffff">
+<tr><td align="center">
+ <font #{font_face}>
+ <br />
+ \@
+ <br />
+ #{txt_home}
+ <br />
+ #{banner_url_txt_sisu}
+ <br />
+ </font>
+#{table_close*4}}
+ end
+ def credits_splash
+ %{ <center>
+<table align="center"bgcolor="#ffffff">
+<tr><td>
+ #{widget_sisu}#{widget_way_better}#{widget_browsers}#{widget_pdfviewers}
+</td></tr>
+</table>
+</center>}
+ end
+ #% bottom
+ def bottom_surround
+ %{</td>
+<td align="center" valign="bottom">#{table_close}<table summary="" border="0" width="100%" valign="top">
+<tr><td valign="top" width="20%"><table summary="" width="100%" border="0" cellpadding="0" bgcolor="#e3ecef" align="center">
+<tr><td valign="top">
+#{table_close}
+</td>
+<td align="center" valign="top">
+ #{banner_band}
+#{table_close}
+<table summary="" border="0" width="100%" valign="top">
+<tr><td valign="top" width="20%">
+<table summary="" width="100%" border="0" cellpadding="0" bgcolor="#e3ecef" align="center">
+<tr><td valign="top">
+ #{table_close}
+</td>
+<td align="center" valign="top">
+ #{credits_splash}
+#{table_close}
+</body>
+</html>}
+ end
+ end
+ class Home < Skin
+ def initialize
+ @v=SiSU_Env::Info_version.new.get_version
+ @dir=SiSU_Env::Info_env.new
+ end
+ def redirect
+ <<WOK
+<html><head>
+<title>SiSU</title>
+<meta http-equiv="refresh" content="0, url=http://www.jus.uio.no/sisu/SiSU/">
+</head>
+<body>
+SiSU informtion provided at <a href="http://www.jus.uio.no/sisu/SiSU/">www.jus.uio.no/sisu/SiSU</a><p />
+If your browser supports redirection, you will be escorted there shortly.
+</body>
+</html>
+WOK
+ end
+ def index
+ <<WOK
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>SiSU information Structuring Universe - Structured
+information, Serialized Units - software for electronic texts,
+documents, books, digital libraries in plaintext, html, XHTML, XML,
+ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite), and
+for search</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="dc.title" content=
+"SiSU information Structuring Universe, Structured information Serialised Units, 2007" />
+<meta name="dc.creator" content="Ralph Amissah" />
+<meta name="dc.subject" content=
+"document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" />
+<meta name="dc.publisher" content=
+"SiSU http://www.jus.uio.no/sisu" />
+<meta name="dc.language" content="en" />
+<meta name="dc.rights" content="Copyright Ralph Amissah" />
+<meta name="generator" content="#{@v[:project]} #{@v[:version]} of #{@v[:date_stamp]} (#{@v[:date]}) (n*x and Ruby!)" />
+<link rel="generator" href="http://www.jus.uio.no/sisu/SiSU" />
+<link rel="stylesheet" href="./#{@dir.path.style}/html.css" type="text/css" />
+<link rel="shortcut icon" href="./_sisu/image/rb7.ico" />
+</head>
+<body>
+<div id="top_band">
+<p class="top_band_image">
+ <a href="http://www.jus.uio.no/sisu/SiSU" target="_top" >
+ <img border="0" src="./_sisu/image/sisu.png" alt="SiSU &gt;&gt;">
+ </a>
+</p>
+<h1 class="top_band">
+ SiSU information Structuring Universe
+</h1>
+<h2 class="top_band_tiny">
+ Structured information, Serialized Units
+</h2>
+<h2 class="top_band_tiny">
+software for electronic texts, document collections, books, digital libraries, and search
+</h2>
+<h2 class="top_band_tiny">
+ with "atomic search" and text positioning system (shared text citation numbering: "<i>ocn</i>")
+</h2>
+<h2 class="top_band_tiny">
+outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite)
+</h2>
+</div>
+<div id="top_band_search">
+<!-- Search SiSU -->
+<a name="search"></a><form method="get" action="http://search.sisudoc.org" target="_top">
+<input type="text" name="s1" size="24" maxlength="255" />
+<br />
+<input type="submit" name="ignore" value="search" />
+<input type="hidden" name="db" value="SiSU_sisu" />
+<input type="hidden" name="a" value="1" />
+<input type="radio" name="view" value="index" checked="checked" /> idx
+<input type="radio" name="view" value="text" /> txt
+</form>
+<!-- Search SiSU -->
+</div>
+<div id="column_left">
+<p class="bold">
+ <a href="http://www.jus.uio.no/sisu/SiSU" target="_top" >
+ SiSU
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/1.html#summary" target="_top" >
+ What does SiSU do? Summary
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/2.html" target="_top" >
+ Book Samples and Markup Examples
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/1.html#ocn" target="_top" >
+ Object Citation Numbering - <i>ocn</i>
+ </a>
+</p>
+<p class="tiny">(a text positioning system)</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/1.html#search" target="_top" >
+ Search - "<i>granular</i>"
+ </a>
+<p class="tiny">
+ Of interest is the ease of streaming documents to a relational database, at an object (roughly paragraph) level and the potential for increased precision in the presentation of matches that results thereby. The ability to serialise html, LaTeX, XML, SQL, (whatever) is also inherent in / incidental to the design. For a description see the
+ <a href="http://www.jus.uio.no/sisu/sisu_provisional_patent_application_200408" target="_top" >
+ abandoned U.S. provisional patent application
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/download.html" target="_top" >
+ <b>Download</b>
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/changelog.html" target="_top" >
+ Changelog
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU/license.html" target="_top" >
+ License
+ </a>
+</p>
+<p class="tiny">
+ Gnu / Linux / Unix
+</p>
+<p class="tiny">
+ =============
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/man" target="_top" >
+ sisu man pages
+ </a>
+</p>
+<p class="tiny">
+ ---
+</p>
+<p class="tiny">
+ document preparation can be on any platform, in any editor:
+ (syntax highlight support currently for: vim, kate, write, gedit, diakonos)
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/syntax_highlight" target="_top" >
+ Syntax highlighting
+ </a>
+</p>
+<p class="tiny">
+ =============
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/SiSU" target="_top" >
+ * Composite document
+ </a>
+</p>
+<p class="tiny">
+ the composite document is a superset of the following documents:
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_description" target="_top" >
+ SiSU description
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_examples" target="_top" >
+ SiSU examples
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_chronology" target="_top" >
+ SiSU chronology
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_technical_info" target="_top" >
+ SiSU technical
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_faq" target="_top" >
+ SiSU FAQ
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_download" target="_top" >
+ SiSU download
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_changelog" target="_top" >
+ SiSU changelog
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_license" target="_top" >
+ SiSU license
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_standard" target="_top" >
+ SiSU standard
+ </a>
+</p>
+<p class="small">
+ <a href="http://www.jus.uio.no/sisu/sisu_provisional_patent_application_200408" target="_top" >
+ SiSU abandoned provisional patent
+ </a>
+</p>
+<p class="tiny">
+ Note: the placement of SiSU documents on the Net predate the release of SiSU.
+</p>
+</div>
+<div id="column_center">
+<p class="bold">
+ For less markup than the most elementary HTML you can have more.
+</p>
+<p><a href="http://www.jus.uio.no/sisu/SiSU" target="_top" ><b>SiSU</b> - Structured information, Serialized Units</a> for electronic documents, is an information structuring, transforming, publishing and search framework with the following features:</p>
+<p>
+<b>(i)</b> markup syntax:
+<b>(a)</b>
+simpler than html,
+<b>(b)</b>
+mnemonic, influenced by mail/messaging/wiki markup practices,
+<b>(c)</b> human readable, and easily writable,</p>
+<p><b>(ii)</b>
+<b>(a)</b>
+minimal markup requirement,
+<b>(b)</b>
+single file marked up for multiple outputs,</p>
+<p><b>
+notes
+</b></p>
+<p class="small">
+<b>*</b>
+documents are prepared in a single UTF-8 file using a minimalistic mnemonic syntax. Typical literature, documents like "War and Peace" require almost no markup, and most of the headers are optional.
+</p>
+<p class="small">
+<b>*</b>
+markup is easily readable/parsed by the human eye, (basic markup is simpler and more sparse than the most basic html), [this may also be converted to XML representations of the same input/source document].
+</p>
+<p class="small">
+<b>*</b>
+markup defines document structure (this may be done once in a header pattern-match description, or for heading levels individually); basic text attributes (bold, italics, underscore, strike-through etc.) as required; and semantic information related to the document (header information, extended beyond the Dublin core and easily further extended as required); the headers may also contain processing instructions.
+</p>
+<p><b>(iii)</b>
+<b>(a)</b>
+multiple outputs primarily industry established and institutionally accepted open standard formats, include amongst others: plaintext (UTF-8); html; (structured) XML; ODF (Open Document text)l; LaTeX; PDF (via LaTeX); SQL type databases (currently PostgreSQL and SQLite). Also produces: concordance files; document content certificates (md5 or sha256 digests of headings, paragraphs, images etc.) and html manifests (and sitemaps of content).
+
+<b>(b)
+</b>
+takes advantage of the strengths implicit in these very different output types, (e.g. PDFs produced using typesetting of LaTeX, databases populated with documents at an individual object/paragraph level, making possible granular search (and related possibilities))</p>
+<p><b>(iv)</b>
+outputs share a common numbering system (dubbed "object citation numbering" (ocn)) that is meaningful (to man and machine) across various digital outputs whether paper, screen, or database oriented, (PDF, html, XML, sqlite, postgresql), this numbering system can be used to reference content.</p>
+<p>
+<b>(v)</b>
+SQL databases are populated at an object level (roughly headings, paragraphs, verse, tables) and become searchable with that degree of granularity, the output information provides the object/paragraph numbers which are relevant across all generated outputs; it is also possible to look at just the matching paragraphs of the documents in the database; [output indexing also work well with search indexing tools like hyperesteier].</p>
+<p>
+<b>(vi)</b>
+ use of semantic meta-tags in headers permit the addition of semantic information on documents, (the available fields are easily extended)</p>
+<p>
+<b>(vii)</b>
+creates organised directory/file structure for (file-system) output, easily mapped with its clearly defined structure, with all text objects numbered, you know in advance where in each document output type, a bit of text will be found (e.g. from an SQL search, you know where to go to find the prepared html output or PDF etc.)... there is more; easy directory management and document associations, the document preparation (sub-)directory may be used to determine output (sub-)directory, the skin used, and the SQL database used,</p>
+<p>
+<b>(viii)</b>
+"Concordance file" wordmap, consisting of all the words in a document and their (text/ object) locations within the text, (and the possibility of adding vocabularies),</p>
+<p>
+<b>(ix)</b>
+document content certification and comparison considerations:
+<b>(a)</b>
+the document and each object within it stamped with an md5 hash making it possible to easily check or guarantee that the substantive content of a document is unchanged,
+<b>(b)</b>
+version control, documents integrated with time based source control system, default RCS or CVS with use of $Id$ tag, which SiSU checks
+<p>
+<b>(x)</b>
+SiSU's minimalist markup makes for meaningful "diffing" of the substantive content of markup-files,</p>
+<p>
+<b>(xi)</b>
+easily skinnable, document appearance on a project/site wide, directory wide, or document instance level easily controlled/changed,</p>
+<p>
+<b>(xii)</b>
+in many cases a regular expression may be used (once in the document header) to define all or part of a documents structure obviating or reducing the need to provide structural markup within the document,</p>
+<p>
+<b>(xiii)</b>
+prepared files may be batch process, documents produced are static files so this needs to be done only once but may be repeated for various reasons as desired (updated content, addition of new output formats, updated technology document presentations/representations)</p>
+<p>
+<b>(xiv)</b>
+possible to pre-process, which permits: the easy creation of standard form documents, and templates/term-sheets, or; building of composite documents (master documents) from other sisu marked up documents, or marked up parts, i.e. import documents or parts of text into a main document should this be desired</p>
+<p>
+there is a considerable degree of future-proofing, output representations are "upgradeable", and new document formats may be added.
+</p>
+<p>
+<b>(xv)</b>
+there is a considerable degree of future-proofing, output representations are "upgradeable", and new document formats may be added:
+<b>(a)</b>
+modular, (thanks in no small part to Ruby) another output format required, write another module....
+<b>(b)</b> easy to update output formats (eg html, XHTML, LaTeX/PDF produced can be updated in program and run against whole document set),
+<b>(c)</b> easy to add, modify, or have alternative syntax rules for input, should you need to,</p>
+<p>
+<b>(xvi)</b>
+scalability, dependent on your file-system (ext3, Reiserfs, XFS, whatever) and on the relational database used (currently Postgresql and SQLite), and your hardware,</p>
+<p>
+<b>(xvii)</b>
+only marked up files need be backed up, to secure the larger document set produced,</p>
+<p>
+<b>(xviii)</b>
+document management,</p>
+<p>
+<b>(xix)</b>
+Syntax highlighting for SiSU markup is available for a number of text editors.</p>
+<p><b>(xx)</b> remote operations:
+<b>(a)</b>
+run SiSU on a remote server, (having prepared sisu markup documents locally or on that server, i.e. this solution where sisu is installed on the remote server, would work whatever type of machine you chose to prepare your markup documents on),
+<b>(b)</b>
+generated document outputs may be posted by sisu to remote sites (using rsync/scp)
+<b>(c)</b>
+document source (plaintext utf-8) if shared on the net may be identified by its url and processed locally to produce the different document outputs.</p>
+<p>
+<b>(xxi)</b>
+document source may be bundled together (automatically) with associated documents (multiple language versions or master document with inclusions) and images and sent as a zip file called a sisupod, if shared on the net these too may be processed locally to produce the desired document outputs, these may be downloaded, shared as email attachments, or processed by running sisu against them, either using a url or the filename.
+</p>
+<p>
+<b>(xxii)</b>
+for basic document generation, the only software dependency is Ruby, and a few standard Unix tools (this covers plaintext, html, XML, ODF, LaTeX). To use a database you of course need that, and to convert the LaTeX generated to PDF, a LaTeX processor like tetex or texlive.
+</p>
+<p>
+as a developers tool it is flexible and extensible
+</p>
+<br />
+<p class="small">
+More information on <a href="http://www.jus.uio.no/sisu/SiSU/"><b>SiSU</b></a> provided at <a href="http://www.jus.uio.no/sisu/SiSU/">www.jus.uio.no/sisu/SiSU</a></p>
+</div>
+<div id="column_right">
+<p class="tiny">
+SiSU ("SiSU information Structuring Universe" or "Structured information, Serialized Units"),<sup>1</sup> is a Unix command line oriented framework for document structuring, publishing and search. Featuring minimalistic markup, multiple standard outputs, a common citation system, and granular search.
+</p>
+<p class="tiny">
+ Using markup applied to a document, SiSU can produce plain text, HTML, XHTML, XML, OpenDocument, LaTeX or PDF files, and populate an SQL database with objects<sup>2</sup> (equating generally to paragraph-sized chunks) so searches may be performed and matches returned with that degree of granularity (e.g. your search criteria is met by these documents and at these locations within each document). Document output formats share a common object numbering system for locating content. This is particularly suitable for "published" works (finalized texts as opposed to works that are frequently changed or updated) for which it provides a fixed means of reference of content.
+</p>
+
+<p class="small">
+How it works
+</p>
+<p class="tiny">
+SiSU markup is fairly minimalistic, it consists of: a (largely optional) document header, made up of information about the document (such as when it was published, who authored it, and granting what rights) and any processing instructions; and markup within text which is related to document structure and typeface. SiSU must be able to discern the structure of a document, (text headings and their levels in relation to each other), either from information provided in the instruction header or from markup within the text (or from a combination of both). Processing is done against an abstraction of the document comprising of information on the document's structure and its objects,<sup>2</sup> which the program serializes (providing the object numbers) and which are assigned hash sum values based on their content. This abstraction of information about document structure, objects, (and hash sums), provides considerable flexibility in representing documents different ways and for different purposes (e.g. search, document layout, publishing, content certification, concordance etc.), and makes it possible to take advantage of some of the strengths of established ways of representing documents, (or indeed to create new ones).</p>
+<p class="tiny">
+<sup>1.</sup> also chosen for the meaning of the Finnish term "sisu".
+</p>
+<p class="tiny">
+<sup>2</sup> objects include: headings, paragraphs, verse, tables, images, but not footnotes/endnotes which are numbered separately and tied to the object from which they are referenced.</p>
+<p class="small">
+ More information on <a href="http://www.jus.uio.no/sisu/SiSU/"><b>SiSU</b></a> provided at:
+ <a href="http://www.jus.uio.no/sisu/SiSU/">
+ www.jus.uio.no/sisu/SiSU
+ </a>
+<p class="tiny">
+SiSU was developed in relation to legal documents, and is strong across a wide variety of texts (law, literature...(humanities, law and part of the social sciences)). SiSU handles images but is not suitable for formulae/ statistics, or for technical writing at this time.</p>
+<p class="tiny">
+SiSU has been developed and has been in use for several years. Requirements to cover a wide range of documents within its use domain have been explored.</p>
+<p class="small">
+<a href="mailto://ralph@amissah.com">
+ralph@amissah.com
+</a>
+</p>
+<p class="small">
+<a href="mailto://ralph.amissah@gmail.com">
+ralph.amissah@gmail.com
+</a>
+</p>
+<p class="small">
+2007
+</p>
+<p class="tiny">
+w3 since October 3 1993
+</p>
+</div>
+</body>
+</html>
+WOK
+ end
+ def home_toc
+ ' '
+ end
+ end
+ class Inserts
+ end
+ class TeX < Skin
+ def initialize(papersize='')
+ @papersize=papersize
+ #@vz=SiSU_Env::Get_init.instance.skin #used within skins, however pulls in much that is not otherwise needed
+ end
+ def a4
+ def portrait
+ def w
+ 160
+ end
+ def h
+ 228
+ end
+ def img_px
+ 450
+ end
+ self
+ end
+ def landscape
+ def w
+ 262
+ end
+ def h
+ 168
+ end
+ def img_px
+ 348
+ end
+ self
+ end
+ self
+ end
+ def letter
+ def portrait
+ def w
+ 166
+ end
+ def h
+ 216
+ end
+ def img_px
+ 468
+ end
+ self
+ end
+ def landscape
+ def w
+ 234
+ end
+ def h
+ 166
+ end
+ def img_px
+ 310
+ end
+ self
+ end
+ self
+ end
+ def legal
+ def portrait
+ def w
+ 168
+ end
+ def h
+ 294
+ end
+ def img_px
+ 474
+ end
+ self
+ end
+ def landscape
+ def w
+ 314
+ end
+ def h
+ 166
+ end
+ def img_px
+ 420
+ end
+ self
+ end
+ self
+ end
+ def b5
+ def portrait
+ def w
+ 126
+ end
+ def h
+ 180
+ end
+ def img_px
+ 356
+ end
+ self
+ end
+ def landscape
+ def w
+ 216
+ end
+ def h
+ 136
+ end
+ def img_px
+ 280
+ end
+ self
+ end
+ self
+ end
+ def a5
+ def portrait
+ def w
+ 100
+ end
+ def h
+ 144
+ end
+ def img_px
+ 280
+ end
+ self
+ end
+ def landscape
+ def w
+ 176
+ end
+ def h
+ 110
+ end
+ def img_px
+ 230
+ end
+ self
+ end
+ self
+ end
+ def dimensions
+ d=case @papersize
+ when /a4/; a4
+ when /letter/; letter
+ when /legal/; legal
+ when /b5/; b5
+ when /a5/; a5
+ else a4
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/digests.rb b/lib/sisu/0.52/digests.rb
new file mode 100644
index 00000000..8aedbc62
--- /dev/null
+++ b/lib/sisu/0.52/digests.rb
@@ -0,0 +1,364 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: document digests (md5|sha256) and structure processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Digest_view
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/i18n'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ pwd=Dir.pwd
+ class Source
+ @@dg=nil
+ def initialize(opt)
+ @opt=opt
+ @fnb=@opt.fnb
+ @@endnotes_para=[]
+ @@dg=nil
+ @dg=@@dg ||=SiSU_Env::Info_env.new.digest.type
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ tool=if @opt.cmd =~/[MVv]/; "#{@env.program.text_editor} #{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:digest]}"
+ else ''
+ end
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Document #@dg Digests",tool)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:digest]}")
+ tell.flow if @opt.cmd =~/[MV]/
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_Digest_view::Source::Scroll.new(@dal_array,@md).songsheet
+ SiSU_Env::Info_skin.new(@md).select
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ private
+ class Scroll <Source
+ @@dl=nil
+ @@description,@@digests,@@dal_structure1,@@dal_structure2,@@sc_info=[],[],[],[],[]
+ def initialize(data='',md='')
+ @data,@md=data,md
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ @@dg ||=SiSU_Env::Info_env.new.digest.type
+ @@dl ||=SiSU_Env::Info_env.new.digest.length
+ @dg,@dl=@@dg,@@dl
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns)
+ @language=l[:l]
+ @tr=SiSU_Translate::Source.new(@md,@language)
+ end
+ def songsheet
+ #source parser, based on dal creation - dal parser ...
+ @@description,@@digests,@@dal_structure1,@@dal_structure2,@@sc_info=[],[],[],[],[]
+ message_digest
+ dal_structure
+ supplementary
+ output
+ end
+ def description(f,e='')
+ puts f + e.to_s if @md.cmd =~/V/
+ @@description << f << e
+ end
+ def digests(f,e='')
+ puts f + e.to_s if @md.cmd =~/V/
+ @@digests << f << e
+ end
+ def dal_structure1(f,e='')
+ puts f + e.to_s if @md.cmd =~/V/
+ @@dal_structure1 << f << e
+ end
+ def dal_structure2(f,e='')
+ puts f + e.to_s if @md.cmd =~/V/
+ @@dal_structure2 << f << e
+ end
+ def rcinfo(f,e='')
+ puts f + e.to_s if @md.cmd =~/V/
+ @@sc_info << f << e
+ end
+ def output
+ filename_digest=SiSU_Env::SiSU_file.new(@md,@md.fn[:digest]).mkfile
+ filename_digest << @@description << @@digests << @@dal_structure1 << @@dal_structure2 << @@sc_info
+ end
+ def rgx_txt(txt)
+ txt=txt.gsub(/([()])/,"\\\\\\1")
+ end
+ def message_digest
+ #there will be a docbook mapping header, fairly complex variations
+ data=@data
+ sys=SiSU_Env::System_call.new
+ l=Hash.new(0)
+ @p=[]
+ @g,@v,@r='','',''
+ data.each do |para|
+ x=nil
+ y,para_endnotes=[],[]
+ if para =~/<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)><([0-9a-f]{#@dl}):([0-9a-f]{#@dl})>/
+ ocn,h1,h2,d_clean,d_all=$1,$2,$3,$4,$5
+ @ocn=ocn unless ocn.to_i == 0
+ if para=~/~\{[\d*+]+.+?<[0-9a-f]{#@dl}>\}~/
+ para_endnotes << para.scan(/~[{\[]([\d*+]+).+?<([0-9a-f]{#@dl})>[}\]]~/)
+ end
+ ima=[]
+ if para =~/\{(\S+\.(png|jpg|gif))\s.+?\}(?:(?:https?|ftp):\/\/\S+|image)/
+ images=para.scan(/\{(\S+\.(?:png|jpg|gif))\s.+?\}(?:(?:https?|ftp):\/\/\S+|image)/).flatten
+ else image=nil
+ end
+ x=case para
+ when /^0~title/
+ "\n" + ' '*0 +'@' + ' '*9
+ when /^0~subtitle/
+ "\n" + ' '*1 +'@' + ' '*8
+ when /^1~/
+ "\n" + ' '*2 +':A ' + ' '*6 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all
+ when /^2~/
+ "\n" + ' '*3 +':B ' + ' '*5 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all
+ when /^3~/
+ "\n" + ' '*4 +':C ' + ' '*4 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all
+ when /^4~/
+ "\n" + ' '*5 +'1' + ' '*4 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all
+ when /^5~/
+ "\n" + ' '*6 +'2' + ' '*3 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all
+ when /^6~/
+ "\n" + ' '*7 +'3' + ' '*2 +'- ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all
+ else
+ if para =~/MD5\(\S+?\.sst\)=\s*<u>([0-9a-f]{#@dl})<\/u>/ #watch
+ @n,@s=/MD5\((\S+?\.sst)\)=\s*<u>([0-9a-f]{#@dl})<\/u>/.match(para)[1,2]
+ end
+ x=unless ocn =~ /^0$/
+ if images and images.length > 0 # then get path of image & produce digest
+ @image_name,@image_dgst,@img=[],[],[]
+ images.each do |i|
+ image_source=if FileTest.file?("#{@env.path.image_source_local_tex}/#{i}")
+ @env.path.image_source_local_tex
+ elsif FileTest.file?("#{@env.path.image_source_remote_tex}/#{i}")
+ @env.path.image_source_remote_tex
+ elsif FileTest.file?("#{@env.path.image_source_tex}/#{i}")
+ @env.path.image_source_tex
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_local_tex}, #{@env.path.image_source_remote_tex} and #{@env.path.image_source_tex}")
+ tell.error2 unless @md.cmd =~/q/
+ nil
+ end
+ @img << /\S+\.(png|jpg|gif)/.match(i)[1]
+ not_found_msg='image not found'
+ if image_source
+ para_image = image_source + '/' + i
+ @image_name << i
+ @image_dgst << if @dg =~/^sha(?:2|256)$/; sys.sha256(para_image)
+ else sys.md5(para_image)
+ end
+ else
+ @image_name << ' '*16 + i + ' [image missing]'
+ @image_dgst << ''
+ @image_dgst[1]=not_found_msg + ' '*(32-not_found_msg.length)
+ end
+ end
+ line= "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all + "\n"
+ line_image=[]
+ c=0
+ @image_name.each do |ok|
+ line_image << %{ #{@img[c]} #{@image_dgst[c][1]} #{@image_name[c]}}
+ c +=1
+ end
+ line=line + line_image.join("\n")
+ else "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all
+ end
+ else
+ prefix=''
+ metad=[@tr.dc_title,@tr.creator,@tr.translator,@tr.illustrator,@tr.prepared_by,@tr.digitized_by,@tr.description,@tr.subject,@tr.abstract,@tr.publisher,@tr.contributor,@tr.date_created,@tr.date_issued,@tr.date_available,@tr.date_modified,@tr.date_valid,@tr.date,@tr.type,@tr.format,@tr.rights,@tr.identifier,@tr.source,@tr.language,@tr.language_original,@tr.relation,@tr.coverage,@tr.keywords,@tr.comments,@tr.cls_loc,@tr.cls_dewey,@tr.cls_gutenberg,@tr.cls_isbn,@tr.prefix_a,@tr.prefix_b,@tr.sourcefile,@tr.sourcefile_digest,@tr.last_generated,@tr.sisu_version,@tr.ruby_version,@tr.sc_number,@tr.sc_date,'Skin_Digest: ','Generated by: ','Ruby version: ']
+ metad.each do |n|
+ m=rgx_txt(n)
+ if m=~/\S+/ and para=~/^#{m}:/
+ x,o=0,18
+ while x < 2; o = o + 2
+ x=o - n.length
+ end
+ space=' '*x
+ prefix="#{n.downcase}#{space}"
+ break
+ else prefix=' '*9
+ end
+ end
+ m_dc_title=rgx_txt(@tr.dc_title)
+ m_creator=rgx_txt(@tr.creator)
+ m_sourcefile_digest=rgx_txt(@tr.sourcefile_digest)
+ m_sisu_version=rgx_txt(@tr.sisu_version)
+ m_last_generated=rgx_txt(@tr.last_generated)
+ m_ruby_version=rgx_txt(@tr.ruby_version)
+ case para
+ when /#{m_dc_title}: /
+ @t=/#{m_dc_title}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip
+ when /#{m_creator}: /
+ @c=/#{m_creator}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip
+ when /#{m_sourcefile_digest}.+?<u>/ #watch
+ dgst_extra="\n" + ' '*21 +'source' +' '*4 + @md.dgst[1] + ' '*34 + @md.fns
+ when /Skin_Digest: /
+ dgst_extra="\n" + ' '*21 + 'skin' +' '*6 + @md.dgst_skin[1] + ' '*34 + /(skin_\S+?\.rb)/.match(@md.dgst_skin[0])[1]
+ when /#{m_sisu_version}: /
+ @v=/#{m_sisu_version}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip
+ when /#{m_last_generated}: /
+ @g=/#{m_last_generated}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip
+ # 'doc last generated'
+ when /#{m_ruby_version}: /
+ @r=/#{m_ruby_version}: (.+?)<~\d;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/.match(para)[1].gsub(/<\/?u>/,'').strip
+ end
+ dgst_extra ||=''
+ "\n" + prefix +' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all + dgst_extra + "\n"
+ end
+ end
+ para_endnotes[0].each { |e| y << "\n" + ' '*(28-e[0].length) + "[#{e[0].to_s}] #{e[1].to_s}" } if para_endnotes[0]
+ if y; digests(x,y)
+ else digests(x)
+ end
+ end
+ end
+ manifest="#{@env.url.root}/#{@md.fnb}/sisu_manifest.html"
+ a=%{level (if any), ocn: digest clean (no markup/notes), digest all (includes markup & endnotes)\n [endnote number] endnote digest clean\n}
+ description("#@t\n")
+ description("#@c\n")
+ description("#{@md.fns}\n")
+ description("----------------------------------------------\n")
+ description("SiSU Document Content Certificate (Digest/DCC)\n")
+ description("----------------------------------------------\n")
+ description(" #@dg digests\n")
+ description("------------\n")
+ description("Sourcefile digest: #@s\n")
+ description(" source filename: #@n\n")
+ description("available outputs: #{manifest}\n")
+ description(" time generated: #@g\n")
+ description(" SiSU version used: #@v\n")
+ description(" Ruby version used: #@r\n")
+ description("------------\n")
+ description("Document Digest Tree (from dal):\n")
+ description(a)
+ #digests("------------\n")
+ #digests("#@v\n")
+ #digests("#@g\n")
+ #digests("#@r\n")
+ end
+ def dal_structure
+ #there will be a docubook mapping header, fairly complex variations
+ data=@data
+ l=Hash.new(0)
+ dal_structure1("------------\n")
+ dal_structure1("document structure[*]\n")
+ ocn,endnotes=nil,nil
+ data.each do |para|
+ x=case para
+ when /^0~/; l[0] +=1
+ if para =~/^0~title/; '' #' '*0 +'@ == headers' + "\n" + ' '*0 +'headings:'
+ end
+ when /^1~/; l[1] +=1
+ ' '*0 +':A'
+ when /^2~/; l[2] +=1
+ ' '*1 +':B'
+ when /^3~/; l[3] +=1
+ ' '*2 +':C'
+ when /^4~/; l[4] +=1
+ ' '*3 +'1'
+ when /^5~/; l[5] +=1
+ ' '*4 +'2'
+ when /^6~/; l[6] +=1
+ ' '*5 +'3'
+ else nil
+ end
+ if para =~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#@dl}:[0-9a-f]{#@dl}>/
+ ocn=$1 unless $1.to_i == 0
+ end
+ if para =~/~[{\[]([\d*+]+).+?<[0-9a-f]{#@dl}>[}\]]~/
+ endnotes=$1 unless $1.to_i == 0
+ end
+ dal_structure1("#{x}\n") if x and not x.empty?
+ end
+ dal_structure1(" [*] heading levels\n")
+ dal_structure2("------------\n")
+ dal_structure2("document structure[*]\n")
+ [0,1,2,3,4,5,6].each do |y|
+ v=case y.to_s
+ when /0/; '@ '
+ when /1/; ':A'
+ when /2/; ':B'
+ when /3/; ':C'
+ when /4/; '1 '
+ when /5/; '2 '
+ when /6/; '3 '
+ end
+ dal_structure2("#{v} = #{l[y]}\n") if l[y] > 0
+ end
+ dal_structure2("objects (ocn) = #{ocn}\n")
+ dal_structure2("endnotes = #{endnotes}\n")
+ dal_structure2(" [*] number of headers (@) and of each heading level (:A to :C and 1 to 3)\n")
+ end
+ def supplementary
+ if defined? @md.sc_number and @md.sc_number
+ rcinfo("------------\n")
+ rcinfo("source control information\n")
+ rcinfo(" (the following information while not important for document content certification\n may help the publisher in locating the version referred to)\n")
+ rcinfo(" rcs version number: #{@md.sc_number}\n")
+ if defined? @md.sc_date and @md.sc_date
+ rcinfo(" rcs date: #{@md.sc_date}\n")
+ end
+ if defined? @md.sc_time and @md.sc_time
+ rcinfo(" rcs time: #{@md.sc_time}\n")
+ end
+ end
+ rcinfo("------------\n")
+ rcinfo("Note: the time generated related fields (text and digests) will vary between otherwise identical document outputs\n")
+ end
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/docbook.rb b/lib/sisu/0.52/docbook.rb
new file mode 100644
index 00000000..a58eb17d
--- /dev/null
+++ b/lib/sisu/0.52/docbook.rb
@@ -0,0 +1,561 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xml (dom style) output processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml dom.xml >> index.tidy
+=end
+module SiSU_Docbook
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/shared_xml'
+ require SiSU_lib + '/xml_format'
+ include SiSU_XML_format
+ include SiSU_XML_munge
+ require SiSU_lib + '/rexml'
+ include SiSU_Rexml
+ @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0
+ @@tablefoot=''
+ class Source
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:docbook]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:docbook]}"
+ elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:docbook]}"
+ else ''
+ end
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',tool)
+ tell.colorize unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:docbook]}")
+ tell.flow if @opt.cmd =~/[MV]/
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_Docbook::Source::Songsheet.new(@dal_array,@md,@env).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure #file closed in songsheet
+ end
+ end
+ private
+ class Songsheet
+ def initialize(data,md='',dir='')
+ @data,@md,@env=data,md,dir
+ end
+ def songsheet
+ begin
+ SiSU_Docbook::Source::Scroll.new(@data,@md).songsheet
+ SiSU_Docbook::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/i # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:docbook]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ class Scroll
+ Heading,Heading_close,Contents=[],[],[]
+ Heading[0]='part'
+ Heading[1]='part level="1"'
+ Heading[2]='part level="2"'
+ Heading[3]='part level="3"'
+ Heading_close[1]=Heading[0]
+ Heading_close[2]=Heading[0]
+ Heading_close[3]=Heading[0]
+ #Contents[0]='preface'
+ Contents[1]='chapter'
+ Contents[2]='sect1'
+ Contents[3]='sect2'
+ @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=[] }
+ @@dp=nil
+ require SiSU_lib + '/shared_txt'
+ include SiSU_text_utils
+ def initialize(data='',md='')
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ @tab="\t"
+ @trans=SiSU_XML_munge::Trans.new(@md)
+ @sys=SiSU_Env::System_call.new
+ end
+ def songsheet
+ pre
+ markup
+ post
+ publish
+ end
+ protected
+ def xml_markup(para='')
+ para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,
+ '<footnote><para>\1 \2</para></footnote> ')
+ end
+ def xml_head(meta)
+ txt=meta.text
+ txt.gsub!(/<br(?: \/)?>/,'')
+ txt.gsub!(/ & /,' and ')
+ @@xml[:head] <<=if meta.type == 'meta'
+ <<WOK
+#{@tab}<#{meta.el}>
+#{@tab*2}#{txt}
+#{@tab}</#{meta.el}>
+WOK
+ else ''
+ end
+ end
+ def xml_sc(md='')
+ sc=if @md.sc_info
+ <<WOK
+ <source_control>
+ <sc class="sourcefile">
+ #{@md.sc_filename}
+ </sc>
+ <sc class="number">
+ #{@md.sc_number}
+ </sc>
+ <sc class="date">
+ #{@md.sc_date}
+ </sc>
+ </source_control>
+WOK
+ else ''
+ end
+ @@xml[:sc]=sc
+ end
+ def xml_element(lv='',ocn='',para='',hname='',tag='',xml_element='')
+ lv=lv.to_i
+ n=lv - 1
+ n1=lv
+ n2=lv + 1
+ n3=lv + 2
+ v=lv - 3
+ tag=''
+ tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname
+ @@xml[:body] <<<<WOK
+#{@tab*n}#{xml_element}
+#{@tab*n1}<title>#{para[@regx, 2]}</title>
+WOK
+ if lv == 4
+ @copen[1]=true
+ @copen[2]=@copen[3]=false
+ elsif lv == 5
+ @copen[2]=true
+ @copen[3]=false
+ elsif lv == 6
+ @copen[3]=true
+ end
+ end
+ def xml_structure(lv='',ocn='',para='',hname='' )
+ lv=lv.to_i
+ n=lv - 1
+ n1=lv
+ n2=lv + 1
+ n3=lv + 2
+ v=lv - 3
+ tag=''
+ tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname !=nil
+ #if para[@regx]
+ # paragraph="#{para[@regx, 2]}"
+ # util=SiSU_text_utils::Paragraph.new(paragraph, 70)
+ # wrapped=util.line_wrap
+ #end
+ case lv
+ when 1..3
+ xml_element="<#{Heading[lv]}>"
+ 3.downto(lv) do |x|
+ y=x - 1
+ @cont[1]=false if @cont[1]
+ @cont[2]=false if @cont[2]
+ @cont[3]=false if @cont[3]
+ ####### attempt to close contents
+ if @copen[3] # 6~
+ [3,2,1].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ @copen[1]=@copen[2]=@copen[3]=false
+ elsif @copen[2] # 5~
+ [2,1].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ @copen[1]=@copen[2]=@copen[3]=false
+ elsif @copen[1] # 4~
+ [1].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ @copen[1]=@copen[2]=@copen[3]=false
+ end
+ @@xml[:body] << "#{@tab*y}</#{Heading_close[x]}>\n" if @level[x]
+ @level[x]=false
+ end
+ when 4..6
+ 6.downto(lv) do |x|
+ y=x - 1
+ if @level[x] == true
+ u=x - 3;
+ @xml_contents_close[x]=''
+ end
+ end
+ cv=lv - 3
+ if para =~/^4~\S+/
+ m=/^4~(\S+)/.match(para)[1]
+ id=if m =~/^\d+$/; 'ch' + m
+ else 'ch_' + m
+ end
+ elsif para =~/^5~\S+/
+ m=/^5~(\S+)/.match(para)[1]
+ id= 'sec_' + m
+ elsif para =~/^6~\S+/
+ m=/^6~(\S+)/.match(para)[1]
+ id= 'subsec_' + m
+ else ''
+ end
+ xml_element=%{<#{Contents[cv]} id="#{id}">} #hmmm gsub were it possible
+ case lv
+ when 4
+ if @copen[3] == true # 6~
+ [3,2,1].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ elsif @copen[2] == true # 5~
+ [2,1].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ elsif @copen[1] == true # 4~
+ [1].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ end
+ @cont[1]=true
+ when 5
+ if @copen[3] == true #6~
+ [3,2].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ elsif @copen[2] == true #5~
+ [2].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
+ end
+ end
+ @cont[2]=true
+ when 6
+ [3].each do |v|
+ @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n" if @copen[3] #watch should possibly be outside...
+ end
+ @cont[3]=true
+ end
+ end
+ xml_element(lv,ocn,para,hname,tag,xml_element)
+ @level[lv]=true
+ ((lv+1)..6).each { |x| @level[x]=false }
+ end
+ def group_structure(para='',ocn='')
+ para.gsub!(/<:group(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*7}<para class="group">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</para>\n}
+ end
+ def poem_structure(para='',ocn='')
+ para.gsub!(/<:verse(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*7}<para class="verse">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</para>\n}
+ end
+ def code_structure(para='',ocn='')
+ para.gsub!(/<:code(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*7}<para class="code">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</para>\n}
+ end
+ #def table_structure(table='',ocn='') #tables
+ # @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP #{ocn}
+ # @endnotes=[]
+ #end
+ def tidywords(wordlist)
+ wordlist.each do |x|
+ x.gsub!(/&/,'&amp;') unless x =~/&\S+;/
+ end
+ end
+ def markup
+ data=@data
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ xml_sc(@md)
+ @rcdc=false
+ @level,@cont,@copen,@xml_contents_close=[],[],[],[]
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @xml_contents_close[x]='' }
+ data.each do |para|
+ wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
+ para=tidywords(wordlist).join(' ').strip
+ para.gsub!(/<[-~]#>/,'')
+ para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'')
+ para.gsub!(/<:pb>\s*/,'')
+ para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,
+ %{<imagedata fileref="#{dir.url.images_local}\/\\1"/>})
+ #para.gsub!(/\{(\S+?\.png) \d+x\d+ \".+?\" \}(?:http:\/\/\S+|image)/,'<image>\1</image>')
+ para.gsub!(/&nbsp;/,' ')
+ @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
+ if para =~/^0~(\S+)\s+(.+?)\Z/m # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; xml_head(d_meta)
+ end
+ end
+ @rcdc=true if @rcdc ==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/)
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ paranum=para[@regx, 3]
+ @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum)
+ end
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para_ocn
+ ### problem in scroll, it appears tables are getting paragraph numbers
+ unless @rcdc
+ m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body1
+ when /^(2)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body2
+ when /^(3)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)/ # work on see SiSU_text_parts::Split_text_object
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body4
+ when /^(5)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body5
+ when /^(6)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body6
+ #when /^(i1)$/
+ # #format_scroll.gsubBody
+ # #para=@sto.lev_para_ocn.scrIndent1
+ #when /^(i2)$/
+ # format_scroll.gsubBody
+ # para=@sto.lev_para_ocn.scrIndent2
+ #when /^(center)$/
+ # para.gsub!(/(.+)/,
+ # %{<center>(\\1)</center>})
+ # para=@sto.lev_para_ocn.scrPara
+ #when /^(b|bold)$/
+ # para.gsub!(/(.+)/,
+ # %{<b>(\\1)</b>})
+ # para=@sto.lev_para_ocn.scrPara
+ #when /null/ # see whether u can improve
+ # if (para !~/#{@margin.txt_0}|#{@margin.txt_1}|#{@margin.txt_2}/)
+ # #format_scroll.gsubBody
+ # #para=@sto.lev_para_ocn.scrPara
+ # end
+ else
+ matched=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/mi.match(para)
+ stamp,ocn=matched[0],matched[1]
+ if para =~ /<:verse>/
+ para.gsub!(/#{stamp}/,'')
+ poem_structure(para,ocn)
+ elsif para =~ /<:group>/
+ para.gsub!(/#{stamp}/,'')
+ group_structure(para,ocn)
+ elsif para =~ /<:code>/
+ para.gsub!(/#{stamp}/,'')
+ code_structure(para,ocn)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para,ocn)
+ para=table.table_split
+ @@xml[:body] << para
+ #@@xml[:body] << table_structure(para,ocn)
+ else #xml_structure(para, nil, nil, nil)
+ xml_markup(para)
+ @@xml[:body] << "#{@tab*7}<para>#{para[@regx, 2]}</para>\n" if para[@regx, 2] # main text, contents, body KEEP ocn = #{para[@regx, 3]} == #{ocn}
+ end
+ end
+ elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ #format_scroll=MonoSiSU.new('<br /><a name="notes">Note</a>')
+ #para=format_scroll.boldPara
+ elsif para =~/(MetaData)/ and para =~/<~\d+;[m]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info
+ format_scroll=Format_scroll.new(@md,'<br /><a name="metadata">MetaData</a>')
+ para=format_scroll.bold_para
+ elsif para =~/(Owner Details)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_scroll=Format_scroll.new(@md,'<br /><a name="owner.details">Owner Details</a>')
+ @@xml[:owner_details]=format_scroll.bold_para
+ para=''
+ elsif para =~/(.*)<:#>(.*)/
+ one, two=$1,$2
+ format_text=Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ if para =~/.*<:#>.*$/
+ para=case para
+ when /<:i1>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ when /<:i2>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ end
+ if para =~/<:center>/
+ one, two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one, two)
+ para=format_text.center
+ end
+ else
+ end
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+!>/,' ')
+ end
+ end
+ @content_flag=true
+ 6.downto(4) do |x|
+ y=x - 1; v=x - 3
+ if @level[x] == true #2004w36 bug fix? watch/test previous logic broke on free.for.all @coontent_flag introduced
+ if @content_flag==true
+ @@xml[:body] << "\n#{@tab*y}</#{Contents[v]}>\n"
+ @content_flag=false
+ else
+ @@xml[:body] << "\n#{@tab*y}</#{Contents[v]}>\n"
+ end
+ end
+ end
+ 3.downto(1) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*y}</#{Heading_close[x]}>\n" if @level[x] == true
+ end
+ end
+ def pre
+ rdf=SiSU_XML_tags::RDF.new(@md)
+ dir=SiSU_Env::Info_env.new
+ css=SiSU_Env::CSS_select.new(@md).docbook_xml
+ encoding='<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V5.0//EN"
+ "http://www.oasis-open.org/docbook/xml/5.0/docbook.dtd">'
+ #encoding='<?xml version="1.0" encoding="utf-8"?>'
+ @@xml[:open] =<<WOK
+#{encoding}
+<?xml-stylesheet type="text/css" href="../#{dir.path.style}/#{css}"?>
+#{rdf.comment_xml}
+<book>
+WOK
+ @@xml[:head] << "<bookinfo>\n"
+ end
+ def post
+ @@xml[:head] << @@xml[:sc]
+ @@xml[:head] << "</bookinfo>\n"
+ @@xml[:close] = "</book>\n"
+ end
+ def publish
+ content=[]
+ data=@data
+ content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
+ content << @@xml[:owner_details] if @md.stmp =~/\w\w/
+ content << @@xml[:tail] << @@xml[:close]
+ Output.new(content.to_s,@md).xml
+ @@xml[:head],@@xml[:body],@@xml[:tail]=[],[],[]
+ end
+ end
+ class Output
+ include SiSU_Param
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def xml
+ @sisu=[]
+ @data.each do |para|
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+?!>/,'')
+ para="#{para}\n" unless para.empty?
+ @sisu << para
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.scan(/.+/)
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:docbook]).mkfile
+ @sisu.each {|para| filename_xml.puts para}
+ filename_xml.close
+ end
+ end
+ class Tidy
+ def initialize(md,dir)
+ @md,@env=md,dir
+ @prog=SiSU_Env::Info_program.new
+ end
+ def xml
+ if @prog.tidy !=false
+ if @md.cmd =~/[VM]/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
+ tell.colorize unless @md.cmd =~/q/
+ tell.grey_open unless @md.cmd =~/q/
+ tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
+ tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:docbook]}",tidyfile)
+ tidy.well_formed?
+ tell.p_off unless @md.cmd =~/q/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/errors.rb b/lib/sisu/0.52/errors.rb
new file mode 100644
index 00000000..a6646c8a
--- /dev/null
+++ b/lib/sisu/0.52/errors.rb
@@ -0,0 +1,72 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: system environment, error screen reporting
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Errors
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Screen
+ class Info_error <Create_file
+ def initialize(error,errorlist,cmd,fns='')
+ @fns,@cmd,@error,@errorlist=fns,cmd,error,errorlist
+ @cmd=if cmd and cmd =~/c/; 'Vc'
+ else 'V'
+ end
+ end
+ def error #creates file errorlog.sisu in pwd of last error reported
+ file=if @fns; SiSU_Env::Create_file.new(@cmd,@fns).file_error
+ else File.new('/tmp/errorlog.sisu','w+')
+ end
+ file << @fns << "\n" << @error << "\n" << @errorlist
+ file.close
+ if @cmd=~/[vVM]/; STDERR.puts SiSU_Screen::Ansi.new('',$!,$@).rescue
+ else SiSU_Screen::Ansi.new('',"rescued, exception reaised, silenced").puts_grey
+ end
+ end
+ end
+end
+
diff --git a/lib/sisu/0.52/help.rb b/lib/sisu/0.52/help.rb
new file mode 100644
index 00000000..a8f1a5ce
--- /dev/null
+++ b/lib/sisu/0.52/help.rb
@@ -0,0 +1,1906 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: online help
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Help
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/param'
+ include SiSU_Screen
+ class Help
+ def initialize(request='',color='')
+ @request,@color=request,color
+ if color =~/color_off/; @cX=SiSU_Screen::Ansi.new('k').cX
+ else @cX=SiSU_Screen::Ansi.new('yes').cX
+ end
+ fns='dummy_file_ref.sst'
+ @env=SiSU_Env::Info_env.new(fns)
+ @db=SiSU_Env::Info_db.new
+ m=/.+\/(\S+)/m
+ @output_stub=Dir.pwd[m,1]
+ end
+ def help_request
+ begin
+ gotten=nil
+ regx=/^(list|com(?:mands)?|mod(?:ifiers)|markup|syntax|example(?:37|38)?|head(?:ers?)?|(?:heading|title|level|structure)s?|endnotes|footnotes|tables?|customise|skin|dir(?:ectories)?|paths?|lang(?:uage)?|modules|setup|conf(?:ig(?:ure)?)?|standards?|li[cs]en[sc]e|scratch|install|termsheet|dublin(?:core)?|dc|customise|styles?|appearance|theme|env(ironment)?|dir(?:ector(?:y|ies))?|metaverse|abstract|features|summary|(?:short)?cuts?|sisu|about|ext(?:ernal)?(?:_?prog(?:rams)?)?)|utf-?8|plaintext|html|xml|xhtml|odf|odt|opendocument|css|pdf|latex|tex|(?:tex)?info|search|(?:hyper)?est(?:raier)?|searchform|cgi|sql|db|postgresql|pg?sql|sqlite|convert|php|webrick|sitemaps?|ya?ml|ansi|colors|-[AabcDdEeFHhIMmNnopqrRSstUuVvwXxyZz0-9]|-[Ddcv]|-[CcFLSVvW]/
+ help_info=%{#{@cX.blue_hi}SiSU help#{@cX.off} #{@cX.ruby}~#{@cX.off} #{@request}}
+ help_list=%{#{@cX.blue}sisu --help#{@cX.off} #{@cX.cyan}type keyword else "enter" to exit help:\n\tkeywords include:#{@cX.off} #{@cX.brown}list, (com)mands, short(cuts), (mod)ifiers, (env)ironment, markup, syntax, headers, headings, endnotes, tables, example, customise, skin, (dir)ectories, path, (lang)uage, db, install, setup, (conf)igure, convert, external_programs, dublincore, termsheet, search, sql, hyper(est)raier, features, external_programs, license#{@cX.off} \n}
+ help_prompt=%{#{@cX.fuschia}exit, [or carriage return to exit help] #{@cX.off}\n#{@cX.blue_hi}SiSU help#{@cX.off} #{@cX.ruby}~#{@cX.off} }
+ until gotten =~/exit|quit|bye|q|^\s*$/ and ( @request.nil? or @request.empty? )
+ @help=Help.new(@request,@color)
+ if @request
+ puts help_info
+ gotten=@request
+ @request=nil
+ end
+ case gotten
+ when /h((?:elp)| )|~/i
+ @help.summary
+ help_@request
+ when /list/; @help.summary
+ when /com(mands)?/; @help.commands
+ when /mod(ifiers)?/; @help.modifiers
+ when /markup|syntax/; @help.markup
+ when /example\b/; @help.example
+ when /example37/; @help.example37
+ when /example38/; @help.example38
+ when /(?:heading|title|level)s?|structure/; @help.headings
+ when /head(ers?)?/; @help.headers
+ when /dublin(core)?|dc/; @help.dublin_core
+ when /(?:foot|end)notes/; @help.endnotes
+ when /tables?/; @help.tables
+ when /customise|skin/; @help.customise
+ when /modules/; @help.modules
+ when /env(ironment)?/; @help.environment
+ when /dir(ector(y|ies))?/; @help.directories
+ when /paths?/; @help.path
+ when /setup/; @help.setup
+ when /conf(?:ig(?:ure)?)?/; @help.configure
+ when /standards?/; @help.standards
+ when /lang(?:uage)?/; @help.languages
+ when /li[cs]en[sc]e/; @help.license
+ when /scratch/; @help.scratch
+ when /install/; @help.install
+ when /termsheet/; @help.termsheet
+ when /customise|styles?|appearance|theme/; @help.customise
+ when /metaverse/; @help.dal
+ when /plaintext|ascii|-[aAeE]/; @help.plaintext
+ when /utf-?8/i; @help.utf8
+ when /html|-[hH]/; @help.html
+ when /css/; @help.css
+ when /xhtml|-b/; @help.xhtml
+ when /xml|-[xX]/; @help.xml
+ when /odf|odt|opendocument|-o/; @help.odf
+ when /php/; @help.php
+ when /pdf|-p/; @help.pdf
+ when /latex|tex/; @help.latex
+ when /(tex)?info/; @help.texinfo
+ when /lout/; @help.lout
+ when /concordance|index|-w/; @help.concordance
+ when /search\b/; @help.help_search
+ when /(?:hyper)?est(?:raier)?/; @help.hyperestraier
+ when /db|database|sql|postgresql|sqlite|pg?sql|-[dD]/; @help.sql
+ when /searchform|cgi/; @help.cgi
+ when /convert/; @help.convert
+ when /webrick|-W/; @help.webrick
+ when /abstract|features|summary|about|sisu/; @help.abstract
+ when /ext(?:ernal)?(?:_?prog(?:rams)?)?/; @help.external_programs
+ when /ya?ml/; @help.yaml
+ when /sitemaps?/; @help.sitemap
+ when /(?:short)?cuts?/; @help.shortcuts
+ when /ansi|colors?/; SiSU_Screen::Ansi.new('c').colors
+ else @help.summary
+ end
+ print help_list
+ print help_prompt
+ gotten=nil
+ gotten=gets
+ end
+ rescue
+ #STDERR.puts Ansi.new($!, $@).rescue
+ # dies silently... for now, silence of use in connection with "sisu ~ commands" etc.
+ ensure
+ end
+ end
+ def summary
+ print <<WOK
+if you have not done so, typing sisu on its own or "sisu --help", should give you this sisu help summary and the sisu (interactive help mode) help promt, from which help on each keyword can be obtained.
+
+alternatively typing #{@cX.orange}sisu --help#{@cX.off} #{@cX.green}[keyword]#{@cX.off} at the command prompt will provide the sisu help page requested and return to the command prompt (if nothing is found it will print this page and return to the command prompt)
+
+ Keywords (related to using SiSU)
+ #{@cX.green}help#{@cX.off} or #{@cX.green}list#{@cX.off} this sisu help summary
+ #{@cX.green}commands#{@cX.off} sisu --help commands
+ #{@cX.green}environment#{@cX.off} sisu --help env
+ ------------------------------------------
+ Preparing Documents for SiSU
+ #{@cX.green}markup#{@cX.off} sisu --help markup (an incomplete overview)
+ #{@cX.green}headers#{@cX.off} sisu --help headers (document-wide instructions, meta-data)
+ #{@cX.green}structure#{@cX.off} sisu --help structure (document structure, headings, tables of contents)
+ #{@cX.green}endnotes#{@cX.off} sisu --help endnotes
+ #{@cX.green}tables#{@cX.off} sisu --help tables
+ #{@cX.green}example 0.37#{@cX.off} sisu --help example37
+ #{@cX.green}example 0.38#{@cX.off} sisu --help example
+ ------------------------------------------
+ #{@cX.green}search#{@cX.off} sisu --help search
+ ------------------------------------------
+ #{@cX.green}customise#{@cX.off} sisu --help customise
+ ------------------------------------------
+ SiSU's License
+ #{@cX.green}license#{@cX.off} sisu --help license
+WOK
+ # #{@cX.cyan}sisu_convert#{@cX.off} program for initial (very basic and partial) conversion to sisu file format (html and word97 supported)
+ end
+ def abstract
+ print <<WOK
+Features:
+#{@cX.cyan}(i)#{@cX.off} minimal markup requirement
+#{@cX.cyan}(ii)#{@cX.off} single file marked up for multiple outputs
+#{@cX.cyan}(iii)#{@cX.off} markup is simpler than html
+#{@cX.cyan}(iv)#{@cX.off} the simple syntax is mnemonic, influenced by mail/messaging/wiki markup practices
+#{@cX.cyan}(v)#{@cX.off} human readable, and easily writable
+#{@cX.cyan}(vi)#{@cX.off} multiple outputs include amongst others: html; pdf via LaTeX; (structured) XML; sql - currently PostgreSQL and sqlite; plaintext, (also texinfo)
+#{@cX.cyan}(vii)#{@cX.off} all text objects (headings and paragraphs) are numbered identically, for citation purposes, in all outputs (html, pdf, sql etc.)
+#{@cX.cyan}(viii)#{@cX.off} creates organised directory/file structure for output
+#{@cX.cyan}(ix)#{@cX.off} easily mapped with its clearly defined structure, with all text objects numbered, you know in advance where in each document output type, a bit of text will be found (eg. from an sql search, you know where to go to find the prepared html output or pdf etc.)... there is more
+#{@cX.cyan}(x)#{@cX.off} use of Dublin Core and other meta-tags to permit the addition of some semantic information on documents, and making easy integration of rdf/rss feeds etc.
+#{@cX.cyan}(xi)#{@cX.off} very easily skinnable, document appearance on a project/site wide, or document instance level easily controlled/changed
+#{@cX.cyan}(xii)#{@cX.off} in many cases a regular expression may be used (once in the document header) to define all or part of a documents structure obviating or reducing the need to provide structural markup within the document
+#{@cX.cyan}(xiii)#{@cX.off} is a batch processor for handling large document sets, ... though once generated they need not be re-generated, unless changes are made to the desired presentation of a particular output type
+#{@cX.cyan}(xiv)#{@cX.off} possible to pre-process, which permits the easy creation of standard form documents, and templates/term-sheets
+#{@cX.cyan}(xv)#{@cX.off} extremely modular, (thanks in no small part to Ruby) another output format required, write another module....
+#{@cX.cyan}(xvi)#{@cX.off} easy to update output formats (eg html, xhtml, latex/pdf produced can be updated in program and run against whole document set)
+#{@cX.cyan}(xvii)#{@cX.off} easy to add, modify, or have alternative syntax rules for input, should you need to
+#{@cX.cyan}(xviii)#{@cX.off} "Concordance" wordmap, consisting of all the words in a document and their (text object) locations within the text
+#{@cX.cyan}(xix)#{@cX.off} tied to revision control system, only code and marked up file need be backed up, to be sure of the much larger document set
+#{@cX.cyan}(xx)#{@cX.off} syntax highlighting files for markup, primarily (g)vim so far.
+
+SiSU was developed in relation to legal documents, and so is strong across a wide variety of texts (law, literature...), though weak on formulae/statistics, it does handle images. An assumption has been document sets that are to be preserved and maintained over time (also a result of the legal text origin). SiSU has been developed and used over a number of years, and the requirements to cover a wide range of documents have been thoroughly explored.
+
+There is more detailed information available on it from:
+ #{@cX.blue}http://www.jus.uio.no/sisu#{@cX.off}
+ * plaintext
+ * html
+ * XML (structured)
+ * LaTeX/pdf
+ * texinfo
+ * sql (at present postgresql & sqlite)
+
+A couple of sample inputs and outputs:
+
+The markup for "War and Peace" (chosen because it is a large text & to test the use of SiSU on Project Gutenberg's plaintext), this is the markup, very little after the headers (there is an insert of their legal notices). Took no time at all, it is a particularly simple text to markup though
+A simple document and a more demanding document
+ #{@cX.blue}http://www.jus.uio.no/sisu/sample/war.and.peace.leo.tolstoy.er20 http://www.jus.uio.no/sisu/sample/autonomy.markup1.er30#{@cX.off}
+Some resulting outputs:
+ html #{@cX.blue}http://www.jus.uio.no/sisu/war.and.peace.leo.tolstoy/ http://www.jus.uio.no/sisu/autonomy.markup1/#{@cX.off}
+ #{@cX.blue}http://www.jus.uio.no/sisu/autonomy.markup1/doc#{@cX.off}
+ pdf #{@cX.blue}http://www.jus.uio.no/sisu/war.and.peace.leo.tolstoy/portrait http://www.jus.uio.no/sisu/autonomy.markup1/portrait
+ #{@cX.blue}http://www.jus.uio.no/sisu/war.and.peace.leo.tolstoy/landscape http://www.jus.uio.no/sisu/autonomy.markup1/landscape#{@cX.off}
+ plaintext #{@cX.blue}http://www.jus.uio.no/sisu/war.and.peace.leo.tolstoy/doc.txt http://www.jus.uio.no/sisu/autonomy.markup1/doc.txt#{@cX.off}
+WOK
+ end
+ def commands
+ print <<WOK
+
+ #{@cX.ruby}-A#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces plaintext with dos linefeeds. Without markup, (object numbers are omitted), has footnotes at end of each para‐ graph that contains them [ -a for equivalent Unix (ascii) output file] [see -E for endnotes]
+
+ #{@cX.ruby}-a#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces plaintext with Unix linefeeds. Without markup, (object numbers are omitted), has footnotes at end of each para‐ graph that contains them [ -A for equivalent dos (ascii) output file] [see -e for endnotes]
+
+ #{@cX.ruby}-b#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces xhtml/XML output for browser viewing (sax parsing)
+
+ #{@cX.ruby}-C#{@cX.off} initialise shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used) #{@cX.ruby}-C --init=site#{@cX.off} configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files are updated if this modifier is used. in a new markup document working directory should initialise the corresponding output directory, though SiSU will automatically do this, the first time it is run (for processing) in a given directory.
+
+ #{@cX.ruby}-c#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} screen toggle ansi screen colour on or off depending on default set (unless -c flag is used: if sisurc colour default is set to ´true´, output to screen will be with colour, if sisurc colour default is set to ´false´ or is undefined screen output will be without colour)
+
+ #{@cX.ruby}-D#{@cX.off} #{@cX.green}[instruction]#{@cX.off} #{@cX.green}[filename]#{@cX.off} database instruction, see database section below
+
+ #{@cX.ruby}-d#{@cX.off} #{@cX.green}[instruction]#{@cX.off} #{@cX.green}[filename]#{@cX.off} database instruction, see database section below [only -D currently available]
+
+ #{@cX.ruby}-E#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces plaintext with dos linefeeds, and without markup, endnotes follow the main text (in -a endnotes follow the paragraphs that contain them). There are no object numbers [see -e for Unix (ascii) output file] [see -A for footnotes]
+
+ #{@cX.ruby}-e#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces plaintext with Unix linefeeds, and without markup, endnotes follow the main text. Object numbers are omitted. [ -E for equivalent dos (ascii) output file] [ -a for footnotes]
+
+ #{@cX.ruby}-F#{@cX.off} generate examples of (naive) cgi search form for sqlite and pgsql depends on your already having used sisu to populate an sqlite and/or pgsql database, (the sqlite version scans the output directories for existing sisu_sqlite databases, so it is first necessary to create them, before generating the search form) see -d -D and the database section below. If the optional parameter webrick is passed, the cgi examples created will be set up to use the default port set for use by the webrick server, (otherwise the port is left blank and the system setting used, usually 80). The samples are dumped in the present work directory which must be writable, (with screen instructions given that they be copied to the cgi-bin directory).
+
+ #{@cX.ruby}-H#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces html (css version) (creates html (using css)), with url link suffixes (.html .pdf etc.) omitted ("Hide"). For web servers that are confireud so as not to require file extensions to locate and serve files. [behaviour switched see -h]
+
+ #{@cX.ruby}-h#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces html (hardlinks i.e. with name suffixes in links/local urls). html, with internal document links that include the document suffix, ie whether it is .html or .pdf (required for browsing directly off a file system, and works with most web servers). [behaviour switched see -H]
+
+ #{@cX.ruby}-I#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces texinfo file with its myriad of possibilities
+
+ #{@cX.ruby}-L#{@cX.off} prints license information
+
+ #{@cX.ruby}-M#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} maintenance mode, files created for processing are not deleted, and their locations are indicated (also see -V)
+
+ #{@cX.ruby}-m#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} create (new)metaVerse (used in all subsequent processing). Produce a meta file, the first step in processing, and the file all subsequent processing utilize. (Should usually be run together with other commands to ensure that the lated version of markup source document is used, i.e. add -m flag to other flags required).
+
+ #{@cX.ruby}-N#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} document content certificate as md5 digest tree of document produced (as digest.txt), the digest for the document, and digests for each object contained within the document (together with information on software versions that produced it). Try -mNV for verbose digest output to screen
+
+ #{@cX.ruby}-n#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} skip meta-markup (building of "metaverse"), this skips the equivalent of -m
+
+ #{@cX.ruby}-p#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces LaTeX pdf (portrait & landscape). Default paper size is set in config file, or document header, or provided with additional command line parameter, e.g. --papersize='a4' preset sizes include: 'A4', U.S. 'letter' and 'legal' and book sizes 'A5' and 'B5' (system defaults to A4).
+
+ #{@cX.ruby}-q#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} quiet, less output to screen
+
+ #{@cX.ruby}-r#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} copies sisu output files to remote host using scp (default). This requires that sisurc.yml has been provided with information on hostname and user name, and that you have your "keys" and ssh agent in place.
+
+ #{@cX.ruby}-S#{@cX.off} #produces a sisupod, a zipped sisu directory of markup files including sisu markup source files and the directories local configuration file, images and skins. Note: this only includes the configuration files or skins contained in ./_sisu not those in ~/.sisu The resulting tar gzip file has a .zip suffix added to the markup source directory name. To tar and gzip individual files see the -Z [filename/wildcard] option. Note: (this option is tested only with zsh)
+
+ #{@cX.ruby}-S#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces a sisupod a zipped sisu of the content assocated with the specified sisu markup documnt, i.e. including sisu markup source file, (and associated documents if a master file, or available in multilingual versions), together with related images and skin. The resulting zipped file has a .zip suffix added to the markup source file name by default, though a .ssp suffix is also recognised. The directory structure of the unzipped file is understood by sisu, and sisu commands can be run within it. SiSU commands can be run against a sisupod contained in a local directory, or provided as a url on a remote site. As there is a security issue with skins provided by other users, they are not applied unless the flag --trust or --trusted is added to the command instruction, it is recommended that file that are not your own are treated as untrusted. This provides a convenient way of packing documents files for sending Note: if you wish to send multiple files, it quickly becomes more space efficient to tar and gzip the sisu markup directory, (without the _sisu_processing subdirectory) rather than the individual files for sending). See the -S option without [filename/wildcard]
+
+ #{@cX.ruby}-t#{@cX.off} #{@cX.green}[filename/wildcard (*.termsheet.rb)]#{@cX.off} standard form document builder, preprocessing feature
+
+ #{@cX.ruby}-U#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} prints url list/map for the available processing flags options and resulting files that could be requested, (can be used to get a list of processing options in relation to a file, together with information on the output that would be produced), -u provides url mapping for those flags requested for processing. The default assumes sisu_webrick is running and provides webrick url mappings where appropriate, but these can be switched to file system paths in sisurc.yml
+
+ #{@cX.ruby}-u#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} provides url mapping of output files for the flags requested for processing, also see -U
+
+ #{@cX.ruby}-V#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} on its own provides SiSU version and environment information (sisu --help env)
+
+ #{@cX.ruby}-V#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} even more verbose than -v the -V flag provides some additional information, also see -M
+
+ #{@cX.ruby}-v#{@cX.off} on its own, provides SiSU version information.
+
+ #{@cX.ruby}-v#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} provides more verbose output of what is being built, where it is being built (and error messages if any), as with -u flag provides a url mapping of files created for each of the processing flag requests
+
+ #{@cX.ruby}-X#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces XML output with deep document structure, in the nature of dom
+
+ #{@cX.ruby}-x#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces XML output (sax parsing)
+
+ #{@cX.ruby}-W#{@cX.off} #{@cX.green}[port]#{@cX.off} starts ruby´s webrick webserver, points at sisu output directories (default port is set)
+
+ #{@cX.ruby}-w#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces concordance, a rudimentary index of all the words in a document
+
+ #{@cX.ruby}-Z#{@cX.off} Zap, if used with other processing flags #{@cX.green}deletes output files#{@cX.off} of the type about to be processed, prior to processing. If -Z is used as the lone processing related flag (or in conjunction with a combination of -[mMvVq]), will remove the related document output directory.
+
+ #{@cX.ruby}-z#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces php (zend) [feature disabled, depreciated]
+
+ #{@cX.ruby}-0#{@cX.off} [with -h or -H or -p] turn display of text object numbering off (implemented for html (css) and LaTeX/pdf output) [digit not uppercase o]
+
+ #{@cX.ruby}databases#{@cX.off}
+
+ #{@cX.ruby}dbi - database interface -D or --pgsql set for postgresql -d or --sqlite set for sqlite#{@cX.off}
+
+ #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--create#{@cX.off} creates empty postgresql db and required tables & indexes (rb.dbi) [#{@cX.ruby}-d --create#{@cX.off} sqlite equivalent] it may be necessary to first run sisu #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--createdb#{@cX.off}
+
+ #{@cX.ruby}-Di#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} or #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--import#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} imports data specified to postgresql db (rb.dbi) [#{@cX.ruby}-d --import#{@cX.off} sqlite equivalent]
+
+ #{@cX.ruby}-Du#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} or #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--update#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} updates/imports specified data to postgresql db (rb.dbi) [#{@cX.ruby}-d --update#{@cX.off} sqlite equivalent]
+
+ #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--remove#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} removes specified data to postgresql db (rb.dbi) [#{@cX.ruby}-d --remove#{@cX.off} sqlite equivalent]
+
+ #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--dropall#{@cX.off} kills data" and drops (postgresql) db, tables & indexes [#{@cX.ruby}-d --dropall#{@cX.off} sqlite equivalent]
+
+ #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--recreate#{@cX.off} kills data" and drops (postgresql or sqlite) db, tables & indexes, then creates an empty db with tables and indexes [#{@cX.ruby}-d --recreate#{@cX.off} sqlite equivalent]
+
+ also see command #{@cX.green}shortcuts#{@cX.off}, and shorthand mappings for multiple flags
+WOK
+ end
+ def shortcuts
+ cf_defaults=SiSU_Env::Info_processing_flag.new
+ print <<WOK
+
+ #{@cX.ruby}Shorthand for multiple flags#{@cX.off}
+
+ #{@cX.ruby}--update#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} Checks existing file output and runs the flags required to update this output. This means that if only html and pdf output was requested on previous runs, only the -hp files will be applied, and only these will be generated this time, together with the summary. This can be very convenient, if you offer different outputs of different files, and just want to do the same again.
+
+ #{@cX.ruby}-1#{@cX.off} to #{@cX.ruby}-5#{@cX.off} #{@cX.green}[filename or wildcard]#{@cX.off}
+ #{@cX.green}Default shorthand mappings#{@cX.off} (note that the defaults can be changed in the #{@cX.green}sisurc.yml#{@cX.off} file):
+
+ (these can be turned off if unavailable in sisurc.yml under program_set:)
+ #{@cX.green}processing shortcut defaults set to:#{@cX.off}
+ color defaut set (on==true) #{@cX.blue}#{cf_defaults.color}#{@cX.off}
+ sisu -1 #{@cX.blue}#{cf_defaults.cf_1}#{@cX.off}
+ sisu -2 #{@cX.blue}#{cf_defaults.cf_2}#{@cX.off}
+ sisu -3 #{@cX.blue}#{cf_defaults.cf_3}#{@cX.off}
+ sisu -4 #{@cX.blue}#{cf_defaults.cf_4}#{@cX.off}
+ sisu -5 #{@cX.blue}#{cf_defaults.cf_5}#{@cX.off}
+ defaults may be changed in active sisurc.yml file under 'flag:'
+
+ add -v for verbose mode and -c (color toggle), e.g.
+ sisu -2vc [filename or wildcard]
+WOK
+ end
+ def modifiers
+ print <<WOK
+
+ #{@cX.ruby}Command flag modifiers#{@cX.off}
+
+ #{@cX.ruby}--no-ocn#{@cX.off} [with -h -H or -p] switches off object citation numbering. Produce output without identifying numbers in margins of html or LaTeX/pdf output.
+
+ #{@cX.ruby}--no-annotate#{@cX.off} strips output text of editor endnotes~[* square brackets ]~ denoted by asterisk or dagger/plus sign
+
+ #{@cX.ruby}--no-asterisk#{@cX.off} strips output text of editor endnotes~[* square brackets ]~ denoted by asterisk
+
+ #{@cX.ruby}--no-dagger#{@cX.off} strips output text of editor endnotes~[+ square brackets ]~ denoted by dagger/plus sign
+
+WOK
+ end
+ def misccom
+ <<WOK
+ #{@cX.cyan}misc#{@cX.off}
+ #{@cX.green}-s#{@cX.off} [filename or wildcard] #{@cX.green}spellcheck#{@cX.off} (aspell previously ispell
+ \t#{@cX.green}mailer examples#{@cX.off}
+ from vim mail.er10 (not gvim) issue command
+ \t:! ruby -S mailer.rb instruction/landscape|a4l|portrait|a4p/ email@address/alias subject line
+ \t:! ruby -S mailer.rb a4l ralph@amissah.com testing continues
+ from vim mail.er10 use your vim alias \\mail or \\mutt (modify command line as required)
+ #{@cX.green}feeds rss/rdf#{@cX.off}
+ #{@cX.blue}-R #{@cX.off} (yaml|rss) extraction of semantic data into yaml file for auto build of xml feeds (rss, rdf) #{@cX.fuschia}[work area]#{@cX.off}
+ #{@cX.green}-R #{@cX.off} yaml extraction of semantic data into yaml file for auto build of xml feeds (rss, rdf)
+ #{@cX.green}-R #{@cX.off} rss creates rss2.0 feed
+WOK
+ end
+ def markup
+ print <<WOK
+sisu
+ Note: files for SiSU should be in UTF-8 character encoding.
+
+ #{@cX.cyan}Data text markup#{@cX.off} (alternative to available html subset)
+ #{@cX.green}% SiSU 0.38#{@cX.off} [statement on first line of document, declared file-type identifier, SiSU markup document, markup used is version 0.38]
+ #{@cX.green}:A~#{@cX.off} heading/title [levels :A to :C available (and beneath that 1 to 6)]
+ #{@cX.green}1~#{@cX.off}filename heading [segmentation level, levels 1 to 6 available]
+ #{@cX.green}!{#{@cX.off}emphasis#{@cX.green}}!#{@cX.off}
+ #{@cX.green}*{#{@cX.off}bold text#{@cX.green}}*#{@cX.off}
+ #{@cX.green}_{#{@cX.off}underscore#{@cX.green}}_#{@cX.off}
+ #{@cX.green}/{#{@cX.off}italics#{@cX.green}}/#{@cX.off}
+ #{@cX.green}"{#{@cX.off}citation#{@cX.green}}"#{@cX.off}
+ #{@cX.green}^{#{@cX.off}superscript#{@cX.green}}^#{@cX.off}
+ #{@cX.green},{#{@cX.off}subscript#{@cX.green}},#{@cX.off}
+ #{@cX.green}+{#{@cX.off}inserted text#{@cX.green}}+#{@cX.off}
+ #{@cX.green}-{#{@cX.off}strikethrough#{@cX.green}}-#{@cX.off}
+ ------------------------------------------
+ #{@cX.cyan}Indentation and bullets#{@cX.off}
+ #{@cX.green}_1#{@cX.off} indent paragraph one level
+ #{@cX.green}_2#{@cX.off} indent paragraph two steps
+ #{@cX.green}_*#{@cX.off} bullet text
+ #{@cX.green}_1*#{@cX.off} bullet text, first indent
+ ------------------------------------------
+ #{@cX.cyan}Numbered List#{@cX.off} (not to be confused with headings/titles, (document structure))
+ #{@cX.green}##{@cX.off} numbered list numbered list 1., 2., 3, etc.
+ #{@cX.green}_##{@cX.off} numbered list numbered list indented second level a., b., c., d., etc.
+ ------------------------------------------
+ #{@cX.cyan}Endnotes#{@cX.off}
+ #{@cX.green}~{#{@cX.off}footnote/endnote#{@cX.green}}~#{@cX.off} endnote#{@cX.green}~{#{@cX.off}self contained endnote marker & endnote in one#{@cX.green}}~#{@cX.off}
+ #{@cX.green}~{*#{@cX.off}asterisk footnote/endnote#{@cX.green}}~#{@cX.off}
+ editor's annotations, square bracket notes
+ #{@cX.green}~[*#{@cX.off}numbered asterisk footnote/endnote series#{@cX.green}]~#{@cX.off}
+ #{@cX.green}~[+#{@cX.off}numbered dagger/plus sign footnote/endnote series#{@cX.green}]~#{@cX.off}
+ ---
+ alternative endnote pair notation
+ #{@cX.green}~^#{@cX.off} endnote marker
+ #{@cX.green}^~#{@cX.off} endnote text following the paragraph in which the marker occurs
+ ------------------------------------------
+ #{@cX.cyan}Links#{@cX.off}
+ http://url.org on its own would be automatically marked up and hyperlinked to itself
+ #{@cX.green}{#{@cX.off} [text to link] #{@cX.green}}#{@cX.off}http://url.org
+ #{@cX.green}{#{@cX.off}image.png#{@cX.green}}#{@cX.off}http://url.org
+ #{@cX.green}{#{@cX.off}image.png#{@cX.green}}#{@cX.off}image #{@cX.green}{#{@cX.off}tux.png 64#{@cX.green}x#{@cX.off}80#{@cX.green}}#{@cX.off}image
+ Linked image example
+ #{@cX.green}{#{@cX.off} SiSU Geek Writer #{@cX.green}}#{@cX.off}http://www.jus.uio.no/sisu/ url example
+ #{@cX.green}{#{@cX.off}tux.png 64#{@cX.green}x#{@cX.off}80 "a better way" #{@cX.green}}#{@cX.off}http://www.jus.uio.no/sisu/ image example with all options (width x height)
+ Note: png and jpg support only (no gif support)
+
+ shortcut - hyper-linked text with endnote providing the url information
+ #{@cX.green}{~^#{@cX.off} [text to link] #{@cX.green}}#{@cX.off}http://url.org maps to #{@cX.green}{#{@cX.off} [text to link] #{@cX.green}}#{@cX.off}http://url.org #{@cX.green}~{#{@cX.off} http://url.org #{@cX.green}}~#{@cX.off}
+ produces hyper-linked text within a document/paragraph, with an endnote providing the url for the text location used in the hyperlink
+
+ shortcut:
+ #{@cX.green}{#{@cX.off} [text to link] #{@cX.green}[3sS]}#{@cX.off}markup_source_filename.sst
+ if a server host name has been provided/configured, will provide a list of available output types that would be generated using the shortcut command and the markup file provided, i.e. output generated using the command (as configured):
+ "sisu -3sS markup_source_filename.sst"
+ using server host, directory stub, filename to compose the link.
+ ------------------------------------------
+ adding fixed names in html, manual location marker/tagging
+ #{@cX.green}*~[name]#{@cX.off} <a name="[name]">
+ ------------------------------------------
+ #{@cX.green}~##{@cX.off} unnumbered paragraph (place marker at end of paragraph)
+ #{@cX.green}-##{@cX.off} unnumbered paragraph, delete when not required (place marker at end of paragraph) [used in dummy headings, eg. for segmented html]
+ ------------------------------------------
+ manual page breaks (LaTeX/pdf)
+ #{@cX.green}<:pb>#{@cX.off} page break, which breaks a page, starting a new page in single column text and a new column in double column text
+ #{@cX.green}<:pn>#{@cX.off} page new, which starts a new page, in both single and double column text (leaving an empty column in double column text if necessary).
+ Note: page breaks are usually introduced to pdfs either as header instructions, indicating that pages should break at given levels
+ ------------------------------------------
+ #{@cX.cyan}Composite documents#{@cX.off}
+ It is possible to build a document by requiring other documents. The documents required may complete documents that could be generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other documents), by convention it should be named with the suffix .ssc or .ssm The documents called if complete documents would have the suffix .sst, [.ssf, or .ssd], and if markup snippets .ssi. A temporary file of the composite document is built prior to processing with the same prefix and the suffix ._sst There are a number of alternative syntaxes for requiring external documents in order to permit use of ascii hypertext linking available in the vim editor. They are as follows (place at start of line):
+
+ #{@cX.cyan}#basic sisu markup alternatives#{@cX.off}
+ #{@cX.green}{#{@cX.off}filename.si#{@cX.green}}require#{@cX.off}
+ #{@cX.green}<< {#{@cX.off}filename.si#{@cX.green}}#{@cX.off}
+
+ #{@cX.cyan}#using textlink alternatives#{@cX.off}
+ #{@cX.green}|#{@cX.off}filename.si#{@cX.green}|@|^|require#{@cX.off}
+ #{@cX.green}<< |#{@cX.off}filename.si#{@cX.green}|@|^|#{@cX.off}
+
+ #{@cX.cyan}#using thlnk alternatives#{@cX.off}
+ #{@cX.green}<url:#{@cX.off}filename.si#{@cX.green}>require#{@cX.off}
+ #{@cX.green}<< <url:#{@cX.off}filename.si#{@cX.green}>#{@cX.off}
+
+ #{@cX.cyan}Composite documents - remote parts#{@cX.off}
+ Composite documents may be built from remote parts, by using the composite document syntax with a url. This makes sense using either sisu regular syntax (which is just a convenient way of marking up), or thlnk syntax, which also recognises remote urls, and permits hyperlinking ascii to the url location.
+
+ #{@cX.cyan}Remote documents#{@cX.off}
+ SiSU will download and process remote locations if a url is provided instead of a filename. [this at present works only for sisu markup files without images]
+
+ ------------------------------------------
+ #{@cX.green}%#{@cX.off}#{@cX.off} add a comment to text, that will be removed prior to processing (place marker at beginning of line)
+ #{@cX.green}\\#{@cX.off}#{@cX.off} escape a sepcial character, whether general: { } < > or contextual special characters, (in combination with other characters) ~ - _ / % ^ and occasionally ! # + ,
+ #{@cX.green}%%#{@cX.off}#{@cX.off} same as above but recognised by vim folds for placing fold in document text, in addition to headers and headings
+ ------------------------------------------
+
+ #{@cX.ruby}More HELP on Markup#{@cX.off} markup help is available on:
+ document wide instructions: headers (document structure)
+ general text markup: headings; endnotes; tables (which also includes a note on preformatted text)
+ configuration and customisation
+ document or site wide customisation: customise; skin
+WOK
+ help_markup
+# {../_sisu/image/tux.png http://www.jus.uio.no/sisu/ w=64 c=\"a better way\" }:image depreciated image eg
+# <!image http://www.jus.uio.no/sisu/ ../_sisu/image/tux.png width=\"64\" height=\"80\" !> old form
+ end
+ def example
+ help_markup
+ end
+ def example37
+ print <<WOK
+% SiSU 0.16 - 0.37
+
+0~title Working Sample Document
+
+0~subtitle Demonstrating markup
+
+0~creator Ralph Amissah
+
+0~date
+
+0~markup num_top=4
+
+0~bold [regular expression of words/phrases to be made bold]
+
+0~italics [regular expression of words/phrases to italicise]
+
+0~links { SiSU }http://www.jus.uio.no/sisu { FSF }http://www.fsf.org
+
+1~ A Sample Document
+
+2~ just for fun
+
+4~ This is Chapter One or Article One
+
+Ordinary Text follows here. The Title would be a Chapter or Article depending on the type of document you were working to produce.
+
+4~ This would be Chapter Two or Article Two
+
+And so on.
+
+Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .sst if saved as example.sst, by typing sisu -mhwxp example.sst while in the directory in which the file is saved.
+
+_1 -m initial processing, -h html (css based), -w concordance for html, -x xml, -p pdf output, generated via latex, there are of course additional options
+
+_1 for a listing type: sisu ~ commands
+
+_1 for an outline of sisu markup type: sisu ~ markup
+
+The example ends here.
+WOK
+ help_markup
+ end
+ def example38
+ print <<WOK
+% SiSU 0.38
+
+@title: Working Sample Document
+
+@subtitle: Demonstrating markup
+
+@creator: Ralph Amissah
+
+@date:
+
+@markup: num_top=4
+
+@bold: [regular expression of words/phrases to be made bold]
+
+@italics: [regular expression of words/phrases to italicise]
+
+@links: { SiSU }http://www.jus.uio.no/sisu { FSF }http://www.fsf.org
+
+:A~ A Sample Document
+
+:B~ just for fun
+
+1~ This is Chapter One or Article One
+
+Ordinary Text follows here. The Title would be a Chapter or Article depending on the type of document you were working to produce.
+
+1~ This would be Chapter Two or Article Two
+
+And so on.
+
+Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .sst if saved as example.sst, by typing sisu -mhwxp example.sst while in the directory in which the file is saved.
+
+_1 -m initial processing, -h html (css based), -w concordance for html, -x xml, -p pdf output, generated via latex, there are of course additional options
+
+_1 for a listing type: sisu ~ commands
+
+_1 for an outline of sisu markup type: sisu ~ markup
+
+The example ends here.
+WOK
+ help_markup
+ end
+ def headers
+ print <<WOK
+Header tags appear at the beginning of a document and provide meta information on the document (such as the Dublin Core), or information as to how the document as a whole is to be processed.
+All header instructions take either the form #{@cX.green}@headername:#{@cX.off} or #{@cX.green}0~headername#{@cX.off}. All Dublin Core meta tags are available
+#{@cX.green}@indentifier:#{@cX.off} information or instructions
+or
+#{@cX.green}0~indentifier#{@cX.off} information or instructions
+where the #{@cX.green}"identifier"#{@cX.off} is a tag recognised by the program, and the #{@cX.green}"information"#{@cX.off} or #{@cX.green}"instructions"#{@cX.off} belong to the tag/indentifier specified
+ Note: a header where used should only be used once; all headers apart from 0~title are optional; the @structure: or 0~toc header is used to describe document structure, and can be useful to know.
+This is a sample header (#{@cX.fuschia}Dublin Core in fuschia,#{@cX.off} #{@cX.cyan}other information headers in cyan,#{@cX.off} #{@cX.ruby}markup instructions in red#{@cX.off}):
+
+#{@cX.fuschia}@title:#{@cX.off} My Title - This is now the Title of the Document and used as such
+
+#{@cX.cyan}@subtitle:#{@cX.off} The Subtitle if any
+
+#{@cX.fuschia}@creator:#{@cX.off} [or ~author] Ralph Amissah
+
+#{@cX.fuschia}@subject:#{@cX.off} (whatever your subject)
+
+#{@cX.fuschia}@description:#{@cX.off}
+
+#{@cX.fuschia}@publisher:#{@cX.off}
+
+#{@cX.fuschia}@contributor:#{@cX.off}
+
+#{@cX.fuschia}@translator:#{@cX.off} [or ~translated_by]
+
+#{@cX.fuschia}@illustrator:#{@cX.off} [or ~illustrated_by]
+
+#{@cX.fuschia}@prepared_by:#{@cX.off} [or ~digitized_by]
+
+#{@cX.fuschia}@date:#{@cX.off} 2000-08-27
+\t[ also #{@cX.fuschia}@date.created:#{@cX.off} #{@cX.fuschia}@date.issued:#{@cX.off} #{@cX.fuschia}@date.available:#{@cX.off} #{@cX.fuschia}@date.valid:#{@cX.off} #{@cX.fuschia}@date.modified:#{@cX.off} ]
+
+#{@cX.fuschia}@type:#{@cX.off} article
+
+#{@cX.fuschia}@format:#{@cX.off}
+
+#{@cX.fuschia}@identifier:#{@cX.off}
+
+#{@cX.fuschia}@source:#{@cX.off}
+
+#{@cX.fuschia}@language:#{@cX.off} [country code for language if available, or language, English, en is the default setting] (en - English, fr - French, de - German, it - Italian, es - Spanish, pt - Portuguese, sv - Swedish, da - Danish, fi - Finnish, no - Norwegian, is - Icelandic, nl - Dutch, et - Estonian, hu - Hungarian, pl - Polish, ro - Romanian, ru - Russian, el - Greek, uk - Ukranian, tr - Turkish, sk - Slovak, sl - Slovenian, hr - Croatian, cs - Czech, bg - Bul garian ) [however, encodings are not available for all of the languages listed.]
+
+#{@cX.fuschia}@relation:#{@cX.off}
+
+#{@cX.fuschia}@coverage:#{@cX.off}
+
+#{@cX.fuschia}@rights:#{@cX.off} copyright, all rights reserved, public domain, copyleft, creative commons variant, etc.
+
+#{@cX.cyan}@owner:#{@cX.off}
+
+#{@cX.cyan}@keywords:#{@cX.off} text document generation processing management latex pdf structured xml citation [your keywords here, used for example by rss feeds, and in sql searches]
+
+#{@cX.cyan}@abstract:#{@cX.off} [paper abstract, placed after table of contents]
+
+#{@cX.cyan}@comment:#{@cX.off} [...]
+
+#{@cX.cyan}@catalogue:#{@cX.off} #{@cX.green}loc=#{@cX.off}[Library of Congress classification]; #{@cX.green}dewey=#{@cX.off}[Dewey classification]; #{@cX.green}isbn=#{@cX.off}[ISBN]; #{@cX.green}pg=#{@cX.off}[Project Gutenberg text number]
+
+#{@cX.cyan}@classify_loc:#{@cX.off} [Library of Congress classification]
+
+#{@cX.cyan}@classify_dewey:#{@cX.off} [Dewey classification]
+
+#{@cX.cyan}@classify_isbn:#{@cX.off} [ISBN]
+
+#{@cX.cyan}@classify_pg:#{@cX.off} [Project Gutenberg text number]
+
+#{@cX.cyan}@prefix_a:#{@cX.off} [prefix is placed just before table of contents - not implemented]
+
+#{@cX.cyan}@prefix_b:#{@cX.off} or #{@cX.cyan}@prefix:#{@cX.off} [prefix is placed just after table of contents]
+
+#{@cX.cyan}@rcs:#{@cX.off} $Id$ [used by rcs or cvs to embed version (revision control) information into document, rcs or cvs can usefully provide a history of updates to a document ]
+
+#{@cX.ruby}@structure:#{@cX.off} PART; CHAPTER; SECTION; ARTICLE; none; none;
+ structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^)
+ can be used within text instead, without this header tag, and may be used to suppliment the instructions provided in this header tag if provided
+
+#{@cX.ruby}@level:#{@cX.off} newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage]
+
+#{@cX.ruby}@markup:#{@cX.off} num_top=4 [various markup instructions, eg: num_top=4 headings tobe numbered, starting at heading level 4... the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level]
+
+#{@cX.ruby}@bold:#{@cX.off} [list of words to make bold with semi colon separator]
+
+#{@cX.ruby}@italics:#{@cX.off} [list of words to italize with semi colon separator]
+
+#{@cX.ruby}@vocabulary:#{@cX.off} name of taxonomy/vocabulary/wordlist to use against document
+
+#{@cX.ruby}@skin:#{@cX.off} skin_doc_[name_of_desired_document_skin]
+
+#{@cX.ruby}@links:#{@cX.off} http://google.com; Google;
+
+#{@cX.ruby}@@promo:#{@cX.off} sisu, ruby, search_libre_docs, open_society [places content in right pane in html, makes use of list.yml and promo.yml, commented out sample in document sample: free_as_in_freedom.richard_stallman_cru‐ sade_for_free_software.sam_williams.sst]
+
+#{@cX.grey}% header ends here, NB only @title: is mandatory [this would be a comment]#{@cX.off}
+#{@cX.grey}% NOTE: headings/levels below refer to 0.38 expermental markup
+ (a conversion script provided in sisu-examples, modify.rb makes conversion between 0.37 and 0.38 markup simple)#{@cX.off}
+
+#{@cX.blue}:A~#{@cX.off} Top level heading [this is usually the same as the title @title: ]
+
+#{@cX.blue}:B~#{@cX.off} Second level heading [this is a heading level divider]
+
+#{@cX.blue}:C~#{@cX.off} Third level heading [this is a heading level divider]
+
+#{@cX.blue}1~#{@cX.off} Top level heading preceding substantive text of document or sub-heading 5, the heading level that would normally be marked 1. or 2. or 3. etc. in a document
+
+#{@cX.blue}2~#{@cX.off} Second level heading preceding substantive text of document or sub-heading 6, the heading level that would normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc in a document
+
+#{@cX.blue}3~#{@cX.off} Third level heading preceding substantive text of document, that would normally be marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document
+
+WOK
+ help_markup
+ end
+ def headers37
+ print <<WOK
+Header tags appear at the beginning of a document and provide meta information on the document (such as the Dublin Core), or information as to how the document as a whole is to be processed.
+All header instructions take either the form #{@cX.green}@headername:#{@cX.off} or #{@cX.green}0~headername#{@cX.off}. All Dublin Core meta tags are available
+#{@cX.green}@indentifier:#{@cX.off} information or instructions
+or
+#{@cX.green}0~indentifier#{@cX.off} information or instructions
+where the #{@cX.green}"identifier"#{@cX.off} is a tag recognised by the program, and the #{@cX.green}"information"#{@cX.off} or #{@cX.green}"instructions"#{@cX.off} belong to the tag/indentifier specified
+ Note: a header where used should only be used once; all headers apart from 0~title are optional; the 0~toc header is used to describe document structure, and can be useful to know.
+This is a sample header (#{@cX.fuschia}Dublin Core in fuschia,#{@cX.off} #{@cX.cyan}other information headers in cyan,#{@cX.off} #{@cX.ruby}markup instructions in red#{@cX.off}):
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}title#{@cX.off} My Title - This is now the Title of the Document and used as such
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}subtitle#{@cX.off} The Subtitle if any
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}creator#{@cX.off} [or ~author] Ralph Amissah
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}subject#{@cX.off} (whatever your subject)
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}description#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}publisher#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}contributor#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}translator#{@cX.off} [or ~translated_by]
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}illustrator#{@cX.off} [or ~illustrated_by]
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}prepared_by#{@cX.off} [or ~digitized_by]
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}date#{@cX.off} 2000-08-27
+\t[ also #{@cX.green}0~#{@cX.off}#{@cX.fuschia}date.created#{@cX.off} #{@cX.green}0~#{@cX.off}#{@cX.fuschia}date.issued#{@cX.off} #{@cX.green}0~#{@cX.off}#{@cX.fuschia}date.available#{@cX.off} #{@cX.green}0~#{@cX.off}#{@cX.fuschia}date.valid#{@cX.off} #{@cX.green}0~#{@cX.off}#{@cX.fuschia}date.modified#{@cX.off} ]
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}type#{@cX.off} article
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}format#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}identifier#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}source#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}language#{@cX.off} [country code for language if available, or language, English, en is the default setting] (en - English, fr - French, de - German, it - Italian, es - Spanish, pt - Portuguese, sv - Swedish, da - Danish, fi - Finnish, no - Norwegian, is - Icelandic, nl - Dutch, et - Estonian, hu - Hungarian, pl - Polish, ro - Romanian, ru - Russian, el - Greek, uk - Ukranian, tr - Turkish, sk - Slovak, sl - Slovenian, hr - Croatian, cs - Czech, bg - Bul garian ) [however, encodings are not available for all of the languages listed.]
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}relation#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}coverage#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.fuschia}rights#{@cX.off} copyright, all rights reserved, public domain, copyleft, creative commons variant, etc.
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}owner#{@cX.off}
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}keywords#{@cX.off} text document generation processing management latex pdf structured xml citation [your keywords here, used for example by rss feeds, and in sql searches]
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}abstract#{@cX.off} [paper abstract, placed after table of contents]
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}comment#{@cX.off} [...]
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}classify_loc#{@cX.off} Library of Congress classification
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}classify_dewey#{@cX.off} Dewey classification system
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}classify_isbn#{@cX.off} ISBN
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}classify_pg#{@cX.off} Project Gutenberg text number
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}prefix_a#{@cX.off} [prefix is placed just before table of contents - not implemented]
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}prefix_b#{@cX.off} or #{@cX.green}0~#{@cX.off}#{@cX.cyan}prefix#{@cX.off} [prefix is placed just after table of contents]
+
+#{@cX.green}0~#{@cX.off}#{@cX.cyan}rcs#{@cX.off} $Id$ [used by rcs or cvs to embed version (revision control) information into document, rcs or cvs can usefully provide a history of updates to a document ]
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}toc#{@cX.off} PART; CHAPTER; SECTION; ARTICLE; none; none;
+optional, where document structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^)
+default markers 1~ to 6~ can be used within text instead, without this header tag, and may be used to suppliment the instructions provided in this header tag if provided
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}level#{@cX.off} newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage]
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}markup#{@cX.off} num_top=4 [various markup instructions, eg: num_top=4 headings tobe numbered, starting at heading level 4... the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level]
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}bold#{@cX.off} [list of words to make bold with semi colon separator]
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}italics#{@cX.off} [list of words to italize with semi colon separator]
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}vocabulary#{@cX.off} name of taxonomy/vocabulary/wordlist to use against document
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}skin#{@cX.off} skin_doc_[name_of_desired_document_skin]
+
+#{@cX.green}0~#{@cX.off}#{@cX.ruby}links#{@cX.off} http://google.com; Google;
+
+#{@cX.grey}% header ends here, NB only 0~title is mandatory [this would be a comment]#{@cX.off}
+
+#{@cX.blue}1~#{@cX.off} Top level heading [this is usually the same as the title 0~title ]
+
+#{@cX.blue}2~#{@cX.off} Second level heading [this is a heading level divider]
+
+#{@cX.blue}3~#{@cX.off} Third level heading [this is a heading level divider]
+
+#{@cX.blue}4~#{@cX.off} Top level heading preceding substantive text of document or sub-heading 5, the heading level that would normally be marked 1. or 2. or 3. etc. in a document
+
+#{@cX.blue}5~#{@cX.off} Second level heading preceding substantive text of document or sub-heading 6, the heading level that would normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc in a document
+
+#{@cX.blue}6~#{@cX.off} Third level heading preceding substantive text of document, that would normally be marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document
+
+WOK
+ help_markup
+ end
+ def customise
+ print <<WOK
+ There are a number of files that control the appearance of a site or a document i.e.
+
+ #{@cX.blue}(i)#{@cX.off} files that control #{@cX.green}site-wide appearance#{@cX.off}:
+
+ #{@cX.green}defaults.rb#{@cX.off} initial values used by program, not necessary to change
+
+ skins are placed in a configuration directory beneath the markup directory ./_sisu/skin/doc or in ~/.sisu/skin/doc
+ if a skin is also to be used for a directory or site wide presentations, rather than being called for a single document then a softlink is placed from ~/.sisu/skin/dir or ~/.sisu/skin/site respectively to the relevant skin within ~/.sisu/skin/doc
+
+ rules for skin loading are in #{@cX.green}sysenv.rb#{@cX.off}
+ the skin loading heuristics / hierarchy is currently as follows:
+
+ a. if there is a skin requested within a document, thent that skin is used
+ 0~skin skin_lm (would load skin ~/.sisu/skin/doc/skin_lm.rb)
+
+ b. use it if there is a "dir" skin with the same name as the source directory "stub" i.e.
+ if working in a directory called /home/myhome/workdir/lm
+ then if ~/.sisu/skin/dir/skin_lm.rb were found it would be used and skin_lm.rb would be a softlink to the relevant skin in the document skin directory (where all the actual skins are kept)
+
+ x. [additionally though discouraged a special rule can be set up in sysenv AddSkin.select (which could override b if desired)]
+
+ #{@cX.green}skin_site_#{@cX.off}#{@cX.cyan}[name of site skin in use]#{@cX.off}#{@cX.green}.rb#{@cX.off} this file is called by skin.rb
+ if there are several such files, site appearance may be changed by
+ requesting the skin_site desired from skin.rb
+ and
+
+ #{@cX.blue}(ii)#{@cX.off} presentation maintenance:
+ if you have a body of documents the easiest way to give them a particular appearance/skin, is to associate that directory with a skin, all files in that directory take on the specified appearance, changing appearance of documents once directories are set up is as simple as copying the files from one directory to another (or renaming the directory); or associating the directory with a different skin.
+
+ see also directories
+WOK
+ end
+ def configure
+ print <<WOK
+ see the following topics
+ install
+ setup
+ and note for initial configuration it is necessary to run:
+ sisu -C
+ (this places the default CSS files and DTDs in place)
+WOK
+ end
+ def path
+ help_env
+ puts <<WOK
+
+If you have problems check permissions (and if in home directory ownership).
+
+#{@cX.green}directory paths as currently set#{@cX.off}:
+ output docs: #{@cX.blue}#{@env.path.webserv}#{@cX.off}
+ cgi scripts: #{@cX.blue}#{@env.path.cgi}#{@cX.off}
+ processing: #{@cX.blue}#{@env.path.processing}#{@cX.off}
+ sisu meta markup: #{@cX.blue}#{@env.path.dal}#{@cX.off}
+ html tuning: #{@cX.blue}#{@env.path.tune}#{@cX.off}
+ latex: #{@cX.blue}#{@env.path.tex}#{@cX.off}
+ texinfo: #{@cX.blue}#{@env.path.texi}#{@cX.off}
+ images:
+ source: #{@cX.blue}#{@env.path.image_source}#{@cX.off}
+ latex source: #{@cX.blue}#{@env.path.image_source_tex}#{@cX.off}
+ note images are also sourced from within your pwd - #{@cX.blue}#{Dir.pwd}/_sisu/sisu/image_local#{@cX.off} if it exists
+ #{@cX.grey}[ texinfo: #{@env.path.texinfo} - check duplication ]#{@cX.off}
+
+ #{@cX.green}resource configuraton files#{@cX.off} to change the paths specified above, are searched for in the following order:
+ under the current SiSU markup data directory: #{@cX.blue}#{Dir.pwd}/_sisu/sisurc.yml#{@cX.off}
+ under the home directory ~/.sisu: #{@cX.blue}#{@env.path.home}/.sisu/sisurc.yml#{@cX.off}
+ in the "/etc" directory: #{@cX.blue}#{@env.path.etc}/sisurc.yml#{@cX.off}
+ default file paths are set by the program SiSU
+
+ #{@cX.green}skins#{@cX.off} for document appearances on a site, directory or per document basis are located in subdirectories #{@cX.blue}doc/#{@cX.off} #{@cX.blue}dir/#{@cX.off} and #{@cX.blue}site/#{@cX.off} within:
+ #{@cX.blue}#{Dir.pwd}/_sisu/skin#{@cX.off}
+ #{@cX.blue}#{@env.path.home}/.sisu/skin#{@cX.off}
+ #{@cX.blue}#{@env.path.etc}/skin#{@cX.off}
+ default appearances are set by the program SiSU in the absence of skins
+
+ #{@cX.green}Note on subdirectories for output documents#{@cX.off}
+ The last part of the name of the directory you choose to work from is used as the major sub-directory in which output files are placed,
+ i.e. if you are working in a directory called #{@cX.blue}#{@env.path.home}/ebook#{@cX.off}
+ the output files will be placed in a sub-directory named after the processed text within #{@cX.blue}#{@env.path.webserv}/ebook#{@cX.off}
+ ( Within this major sub-directory, a sub-directory is made with the name of each document processed, into which output files - html, pdf, xml, plaintext etc. are placed (texinfo being an exception at present) )
+
+ #{@cX.green}sisu -C#{@cX.off} [#{@cX.green}--init=site#{@cX.off}] configure/initialise shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used). -C --init=site configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files are updated if this modifier is used. in a new markup document working directory should initialise the corresponding output directory, though SiSU will automatically do this, the first time it is run (for processing) in a given directory.
+
+ There are additional details, ... this should get you started.
+
+ See also
+ sisu --help directory
+WOK
+ help_env
+ end
+ def directories
+ help_env
+ print <<WOK
+
+ the directory structure used by sisu is controlled by the configuration files #{@cX.blue}sisurc.yml#{@cX.off}
+
+ there are separate directories for the following:
+
+ (a) #{@cX.green}data directories#{@cX.off}
+ the directories in which you place the SiSU marked-up data files that are to be processed
+ there may be as many directories and files as you choose to have,
+ you are currently in: #{@cX.blue}#{Dir.pwd}#{@cX.off}
+
+ (b) #{@cX.green}output directory#{@cX.off}
+ by default files in the data directory are output to
+ a sub-directory within the output directory (usually the web document directory), or to an sql database
+ of the same name as the stub or last portion of the data directory name
+ by way of example
+ you are currently in: #{@cX.blue}#{Dir.pwd}#{@cX.off}
+ the document output directory is set to: #{@cX.blue}#{@env.path.webserv}#{@cX.off}
+ documents from your current directory will be placed in: #{@cX.blue}#{@env.path.output}#{@cX.off}
+
+ the final output is placed in subdirectories either as configured by default in the program or as modified by SiSU configuration files
+ subdirectories are created within the main output directory, based on the name of the data directory
+ subsubdirectories are created the sub-directory contained in the main output directory based on the name of the file
+ (subdirectories are created in this (output) sub-directory named after the data file)
+ for this reason it is a convention to give descriptive names to the data file.
+ The default output directory is #{@cX.green}~/sisu_www#{@cX.off}
+ The output directory is currently set to:
+ #{@cX.blue}#{@env.path.webserv}#{@cX.off}
+ Output files, are currently set to be produced in:
+ processed document output: #{@cX.blue}#{@env.path.output}#{@cX.off}
+ a document in the current directory #{@cX.blue}#{Dir.pwd}#{@cX.off}
+ will have its output placed in: #{@cX.blue}#{@env.path.output}/#@output_stub#{@cX.off}
+
+ NB: the verbose flag v included in the generate command string, should
+ result in a list of output filenames together with their paths.
+ The flag U on its own (e.g. sisu -U gpl2.fsf.sst) should provide a list
+ of output files that could be generated together with their paths.
+
+ (c) #{@cX.green}configuration files#{@cX.off}
+ SiSU program defaults are set within the program, and may be adjusted in the yml file #{@cX.blue}sisurc.yml#{@cX.off} which is searched for in the following paths, which are prioritized as listed (the first one found is loaded):
+###
+ under the current SiSU markup data directory: #{@cX.blue}#{@env.path.pwd}/_sisu/sisurc.yml#{@cX.off}
+ under the home directory ~/.sisu: #{@cX.blue}#{@env.path.home}/.sisu/sisurc.yml#{@cX.off}
+ in the "/etc" directory: #{@cX.blue}#{@env.path.etc}/sisurc.yml#{@cX.off}
+
+ (d) #{@cX.green}processing directories#{@cX.off} sisu creates a number of processing directories,
+ where these should be located can be modified in #{@cX.green}~/.sisu/sisurc.yml#{@cX.off}
+ work directories include the following:
+ root working directory #{@cX.blue}#{@env.path.processing}#{@cX.off}
+ metaverse intermediate markup #{@cX.blue}#{@env.path.dal}#{@cX.off}
+ tune html (for special html/navigation pages) #{@cX.blue}#{@env.path.tune}#{@cX.off}
+ tex for latex and pdf #{@cX.blue}#{@env.path.tex}#{@cX.off}
+ texinfo for texinfo and info files #{@cX.blue}#{@env.path.texi}#{@cX.off}
+
+ These files are usually used only for processing and removed. There is a maintenance flag to keep them.
+
+ (e) #{@cX.green}images#{@cX.off}
+ there are a number of categories of images,
+ NB the document markup directory is initialised by issuing the command
+ sisu -C --init=site
+ this creates the output sub-directory, and makes necessary image links, and
+ copies images specific to the markup directory if there are any.
+
+ general images for the sisu program that come with the package,
+ that are the defaults used by sisu, these are installed with the program
+
+ images that the author wishes to include within documents,
+ these should be placed in a sub-directory
+ within the current document markup directory called #{@cX.green}_sisu/sisu/image_local#{@cX.off}
+
+ if an instruction is given to process a remote document which contains
+ downloadable images, they are included in a sub-directory of the current
+ markup directory #{@cX.green}_sisu/sisu/image_external#{@cX.off} that is created
+ if necessary for the purpose.
+
+ finally skins may specify/indicate other image directories. see sisu --help skin
+ any site images required by the skin instruction must be copied in to the
+ site image directory (it may be necessary to do manual configuration depending
+ on what you are trying to achieve).
+
+ (f) #{@cX.green}program directories#{@cX.off}
+ sisu --help install
+ sisu ~ install
+
+ See also
+ sisu --help path
+WOK
+ help_env
+ end
+ def program_found?(program)
+ rc=if SiSU_Env::Info_settings.new.program?(program)
+ "rc: #{SiSU_Env::Info_settings.new.program?(program)} "
+ else ''
+ end
+ bin=if SiSU_Env::System_call.new.program_found?(program)
+ "bin: #{SiSU_Env::System_call.new.program_found?(program)}"
+ else ''
+ end
+ "#{@cX.brown}#{rc}#{bin}#{@cX.off}"
+ end
+ def environment
+ cf_defaults=SiSU_Env::Info_processing_flag.new
+ x =<<WOK
+ #{@cX.green}current and output directories#{@cX.off}
+ user: #{@cX.blue}#{@env.user}#{@cX.off}
+ home: #{@cX.blue}#{@env.path.home}#{@cX.off}
+ remote set [remote user]@[remote host]: #{@cX.blue}#{SiSU_Env::Info_remote_host.new.remote_host[:name]}#{@cX.off}
+ (remote settings user and host set in sisurc.yml under remote:)
+ locale (encoding, UTF-8 desired): #{@cX.blue}#{@env.locale}#{@cX.off}
+ current directory: #{@cX.blue}#{@env.path.pwd}#{@cX.off}
+ document output root directory set to: #{@cX.blue}#{@env.path.webserv}#{@cX.off}
+ documents from current directory placed in: #{@cX.blue}#{@env.path.output}#{@cX.off}
+ sisurc.yml used: #{@cX.blue}#{@env.path.yamlrc}#{@cX.off}
+ webrick url: #{@cX.blue}#{@env.url.webserv_base_cgi}#{@cX.off}
+ (to start webrick server 'sisu -W')
+ sqlite db for present directory: #{@cX.blue}sqlite #{@env.path.output}/sisu_sqlite.db#{@cX.off}
+ postgresql port set to: #{@cX.blue}#{@db.port_psql}#{@cX.off}
+ postgresql db for present directory: #{@cX.blue}#{@db.db_psql}#{@cX.off}
+ [first create manually if necessary: 'createdb #{@db.db_psql}']
+
+ [generated sqlite cgi search form]: #{@cX.blue}#{@env.url.webserv_base_cgi}/cgi-bin/sisu_sqlite.cgi#{@cX.off}
+ [generated postgresql cgi search form]: #{@cX.blue}#{@env.url.webserv_base_cgi}/cgi-bin/sisu_pgsql.cgi#{@cX.off}
+ (to generate 'sisu -F' or 'sisu -F webrick')
+ #{@cX.green}configuration files#{@cX.off}
+ sisurc.yml used: #{@cX.blue}#{@env.path.yamlrc}#{@cX.off}
+ configuration information search path: #{@cX.blue}#{@env.path.rc.join(', ')}#{@cX.off}
+ (directory also relevant for skins and images)
+ digest (md5 or sha256): #{@cX.blue}#{@env.digest.type}#{@cX.off}
+ papersize set (LaTeX/pdf): #{@cX.blue}#{@env.papersize}#{@cX.off}
+ (digest and papersize can be changed in sisurc.yml under default:)
+ #{@cX.green}intermediate processing#{@cX.off}
+ processing directory: #{@cX.blue}#{@env.path.processing}#{@cX.off}
+ (to keep processing output, use -M flag)
+ #{@cX.green}programs selected for viewing output#{@cX.off}
+ text editor: #{@cX.blue}#{@env.program.text_editor}#{@cX.off}
+ web browser: #{@cX.blue}#{@env.program.web_browser}#{@cX.off}
+ console web browser: #{@cX.blue}#{@env.program.console_web_browser}#{@cX.off}
+ pdf viewer: #{@cX.blue}#{@env.program.pdf_viewer}#{@cX.off}
+ xml viewer: #{@cX.blue}#{@env.program.xml_editor}#{@cX.off}
+ odf viewer: #{@cX.blue}#{@env.program.odf_viewer}#{@cX.off}
+ (default selections can be changed in sisurc.yml under program_select:)
+ #{@cX.green}programs used if available#{@cX.off}
+ word count: #{@cX.blue}#{@env.program.wc}#{@cX.off} #{program_found?(@env.program.wc)}
+ imagemagick/rmagick: #{program_found?('rmagick')}
+ tidy: #{@cX.blue}#{@env.program.tidy}#{@cX.off} #{program_found?(@env.program.tidy)}
+ rexml: #{@cX.blue}#{@env.program.rexml}#{@cX.off} #{program_found?(@env.program.rexml)}
+ latex to pdf: #{@cX.blue}#{@env.program.pdflatex}#{@cX.off} #{program_found?(@env.program.pdflatex)}
+ postgresql: #{@cX.blue}#{@env.program.postgresql}#{@cX.off} #{program_found?(@env.program.postgresql)}
+ sqlite: #{@cX.blue}#{@env.program.sqlite}#{@cX.off} #{program_found?(@env.program.sqlite)}
+ (these can be turned off if unavailable in sisurc.yaml under program_set:)
+ #{@cX.green}processing shortcut defaults set to:#{@cX.off}
+ color defaut set (on==true) #{@cX.blue}#{cf_defaults.color}#{@cX.off}
+ sisu -0 #{@cX.blue}#{cf_defaults.cf_0}#{@cX.off} [default]
+ sisu -1 #{@cX.blue}#{cf_defaults.cf_1}#{@cX.off}
+ sisu -2 #{@cX.blue}#{cf_defaults.cf_2}#{@cX.off}
+ sisu -3 #{@cX.blue}#{cf_defaults.cf_3}#{@cX.off}
+ sisu -4 #{@cX.blue}#{cf_defaults.cf_4}#{@cX.off}
+ sisu -5 #{@cX.blue}#{cf_defaults.cf_5}#{@cX.off}
+ (defaults may be changed in active sisurc.yml file under flag:)
+ #{@cX.green}special powers, risky operations set:#{@cX.off}
+ zap (delete output directories) #{@cX.blue}#{SiSU_Env::Info_settings.new.permission?('zap')}#{@cX.off}
+ css copy (copy over css files) #{@cX.blue}#{SiSU_Env::Info_settings.new.permission?('css_modify')}#{@cX.off}
+ (true/false defaults may be changed in active sisurc.yml file under permissions_set:)
+WOK
+print x
+ end
+ def dublin_core
+ print <<WOK
+@title:
+
+@subtitle: [is added to title for purposes of Dublin Core description]
+
+@creator:
+
+@type:
+
+@subject:
+
+@date: [ccyy-mm-dd]
+
+@date.created:
+
+@date.issued:
+
+@date.available:
+
+@date.valid:
+
+@date.modified:
+
+@source:
+
+@language: en
+
+@papersize: A4
+
+@relation:
+
+@coverage:
+
+@rights:
+
+WOK
+ end
+ def headings
+ print <<WOK
+These are not required, a header is quicker to prepare if a documents structure can be defined by matching words or a regular expression, see headers).
+
+@structure: PART; CHAPTER; SECTION; ARTICLE; none; none;
+
+structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^)
+
+The following heading or level (structuring) defaults are available (for use instead of or together with @structure: header):
+
+ 1~ 2~ 3~ 4~ 5~ 6~
+
+or, [0.38]
+
+ :A~ :B~ :C~ 1~ 2~ 3~
+
+Heading tags take either of the forms above, ranging from 1-6
+
+They appear at the beginning of the line on which a heading appears,
+the number indicates the level of the heading with level 1 being a title,
+
+segments (in html output) are by default created on level 4
+(segmented text is split/segmented on level 4, and
+assigned a file name automatically according to the title number,
+unless you explicitly specify otherwise)
+
+eg.
+
+% SiSU 0.16 - 0.37
+
+1~ Document Title
+
+2~ Document Subtitle whatever it is
+
+3~ Part
+
+4~ Chapter
+
+5~ Heading
+
+6~ sub-heading
+
+in the 0.38 notation this maps to:
+
+% SiSU 0.38
+
+:A~ Document Title
+
+:B~ Document Subtitle whatever it is
+
+:C~ Part
+
+1~ Chapter
+
+2~ Heading
+
+3~ sub-heading
+
+(a conversion script provided in sisu-examples, modify.rb makes conversion between 0.37 and 0.38 markup simple)
+
+Normal text would follow each heading level as appropriate, though it is most usual to start with ordinary writing beneath level 4 as it is at this level that segments are created.
+
+Automatic numbering of paragraphs is usually set to start at level 4 trough level 6 and takes the form 1. then 1.1 then 1.1.1 this being given as a Header tag 0~ There may be up to 6 levels in a document,
+
+If auto-numbering is on, then for html output the segments created (on level 4 headings) are automatically assigned the name of the title number.
+However, you may indicate an alternative set of key/title words, with one of the following instructions:
+4~filename This is a Section or Subject Heading
+
+If there is a strictly discernable word appearing at the beginning of the line in a document that identifies the level,
+the words can be used to identify the levels in a header tag:
+0~toc Part; Chapter; Section; Article; none; none
+instead of providing individual heading tags
+
+sisu structure, (0.38) alternative notation, A,B,C,1,2,3 mapping to 1,2,3,4,5,6
+
+ SiSU has in effect two sets of levels to be considered
+
+ 1-3 headings/levels, (A-C [0.38]) pre-ordinary paragraphs /pre-substantive text, and
+
+ 4-6 headings/levels, (1-3 [0.38]) levels which are followed by ordinary text.
+
+ This may be conceptualised as levels A,B,C, 1,2,3, and using such letter number notation, in effect:
+
+ A must exist, optional B and C follow in the sequence
+
+ 1 must exist, optional 2 and 3 follow in the sequence
+
+ i.e. there are two independent heading level sequences A,B,C and 1,2,3 or using the standard notation 1,2,3 and 4,5,6
+
+on the positive side: (a) the A,B,C,1,2,3 alternative makes explicit an aspect of structuring documents in SiSU that is not otherwise obvious to the newcomer (though it appears more complicated, is more in your face and likely to be understood fairly quickly); (b) the substantive text follows levels 1,2,3 and it is 'nice' to do most work in those levels
+
+
+WOK
+ end
+ def languages
+ puts <<WOK
+
+ Multi-language Document File Naming and Directory Mapping
+
+ If the same document exists in different language versions, and it is desired that the published language versions should reside in the same output directory, the following filenaming convention should be observed, using Spannish as the sample language code (es) [it is very likley the use of country codes as language codes will be changed or extended in future] [filename]~[language code].sst
+
+ filename~es.sst
+
+ within sisurc.yml under the heading
+ default:
+ language file: [at 1, 2 or 3]
+
+ determines the output filenaming convention used, as follows:
+
+ (1) [output directory path]/filename/es.index.html
+
+ (2) [output directory path]/filename/index.es.html
+
+ (3) [output directory path]/filename/index.html.es (which Apache for example can be configured to use to automatically serve each users preference)
+
+ filename~fr.sst
+ filename~de.sst
+
+ etc. would be placed in the same directory using the same convention as indeed would:
+ filename.sst
+ using the default convention mapping convention.
+
+ Selecting this form of filename will overide other language settings including the language header within a document.
+
+WOK
+ end
+ def endnotes
+ print <<WOK
+
+(1) Footnote/endnotes tags take a number of possible forms, the simplest being to embed an endnote within your text~{ this would appear as an endnote, and would have an automatically assigned number }~ Embedded endnotes~{this is an endnote}~ and at the end of the paragraph~{* an asterisk marked note }~ writing the endnote:~{another endnote}~
+
+ ------------------------------------------
+#{@cX.ruby}All you need to know about endnotes appears above this line...#{@cX.off} apart from the fact that you cannot mix endnote markup styles
+
+(2) The other ways of inserting an endnote involve placing a tag within the text as to where the endnote reference number should appear like so~^ and at the end of the paragraph writing the endnote:~^
+
+^~ like so, this is an endnote
+
+^~ another endnote
+
+WOK
+ end
+ def tables
+ print <<WOK
+
+#{@cX.green}table{ [number of columns] [column width %];[column width %]#{@cX.off}
+
+[table content, line breaks are important see example below]
+
+#{@cX.green}}table#{@cX.off}
+#{@cX.grey}----#{@cX.off}
+This is a sample table:
+-----------------------
+
+#{@cX.green}table{ c3; 40; 30; 30;#{@cX.off}
+
+This is a table
+this would become column two of row one
+column three of row one is here
+
+And here begins another row
+column two of row two
+column three of row two, and so on
+
+#{@cX.green}}table#{@cX.off}
+
+there is an alternative way to markup tables, a sample document is provided in the file
+#{@cX.green}sisu_output_overview.sst#{@cX.off} located in
+#{@cX.green}/usr/share/doc/sisu#{@cX.off} or equivalent directory
+
+preformatted text
+-----------------
+
+#{@cX.green}poem{#{@cX.off}
+
+ [Text here]
+
+#{@cX.green}}poem#{@cX.off}
+#{@cX.grey}----#{@cX.off}
+
+#{@cX.green}group{#{@cX.off}
+
+ [Text here]
+
+#{@cX.green}}group#{@cX.off}
+#{@cX.grey}----#{@cX.off}
+
+#{@cX.green}code{#{@cX.off}
+
+ [Text here]
+
+#{@cX.green}}code#{@cX.off}
+
+WOK
+ end
+ def modules
+ print <<WOK
+
+ #{@cX.ruby}IGNORE#{@cX.off}
+
+WOK
+ end
+ def modules_old
+ print <<WOK
+
+ #{@cX.ruby}DATED NOT CURRENT - IGNORE#{@cX.off}
+
+ This file is to contain some information the different programs that form sisu:
+
+ their inter-relationship (for which see sisu-chart.pdf)
+
+ and
+
+ what they do
+
+ sisu\ttui/command line program that when run with flags against files produces requested output
+
+ ~/.sisu\tconfiguration directory, contains sisu configuration, and skins for alternative appearances
+ param\tgathers parameters from the sourcefile, when called by metaverse parameters are saved to pstore file
+ sysenv\tgets system information, and builds directory structure
+
+ init\tintialised defaults for appearance
+ skin\tsite wide skin
+ format\tformatting instructions assosciated with and used by calling module
+
+ metaverse\tinitial processing stage, preliminary file on which subsequent processing is done is created [-m]
+
+ plaintext\tplaintext creating module [-a]
+ html\thtml creating modules [-h]
+ texpdf\tlatex and pdf creating modules [-p]
+ xml & xml_dom\txml creating modules [-x -X]
+ concordance\tword map creating module [-w]
+
+ termsheet\tcreation of documents from termsheet and standard forms [-t]
+
+ dbi\tdbi database build and populating module, default postgresql [-D]
+ dbi_sqlite\tdbi database build and populating module, for sqlite [-d]
+
+ #{@cX.ruby}DATED NOT CURRENT - IGNORE#{@cX.off}
+
+WOK
+ end
+ def install
+ #% system configuration
+ print <<WOK
+ #{@cX.green}Install SiSU#{@cX.off}
+
+ SiSU does require setup, the file sisu is placed in the equivalent of #{@cX.blue}/usr/bin#{@cX.off} or #{@cX.blue}/usr/local/bin#{@cX.off} and the REWRITE files where ruby libraries are kept, on my debian system #{@cX.blue}/usr/local/lib/site_ruby/1.8#{@cX.off}
+
+ For information on download and installation, see #{@cX.blue}http://www.jus.uio.no/sisu/sisu_download/download#{@cX.off} or #{@cX.blue}http://www.jus.uio.no/sisu/SiSU/download#{@cX.off}
+
+ For post installation help it is best you refer to '#{@cX.blue}man 8 sisu#{@cX.off}'
+
+ Host
+ host: #{@cX.blue}#{@env.hostname}#{@cX.off}
+ arch: #{@cX.blue}#{@env.arch}#{@cX.off}
+
+ Directories for installation
+ bin: #{@cX.blue}[FIX]#{@cX.off}
+ lib (site-ruby): #{@cX.blue}#{Config::CONFIG['sitelibdir']}/#{SiSU_lib}#{@cX.off}
+ conf [etc]: #{@cX.blue}#{@env.path.etc}/sisu{@cX.off}
+ data (document samples, images, README): #{@cX.blue}#{@env.path.sample_data}/sisu#{@cX.off} and #{@cX.blue}#{@env.path.sample_data}/doc/sisu#{@cX.off}
+ man (manual pages): #{@cX.blue}#{@env.path.man}#{@cX.off}
+ processing: #{@cX.blue}#{@env.path.processing}#{@cX.off}
+ output www: #{@cX.blue}#{@env.path.output}#{@cX.off}
+
+ Output files, are currently set to be produced in:
+ processed document output: #{@cX.blue}#{@env.path.output}#{@cX.off}
+ a document in the current directory #{@cX.blue}#{Dir.pwd}#{@cX.off}
+ will have its output placed in: #{@cX.blue}#{@env.path.output}/#@output_stub#{@cX.off}
+
+ Install any additional programs of interest (that SiSU makes use of, that are not already on your system)
+
+ Programs SiSU makes use of include:
+ LaTeX
+ texinfo
+ pdfetex aka. pdflatex
+ sqlite
+ postgresql
+
+ Again, refer to '#{@cX.blue}man 8 sisu#{@cX.off}'
+
+ For additional help on using SiSU once installed type:
+
+ sisu --help
+
+WOK
+ end
+ def setup
+ print <<WOK
+
+ [provide some setup information]
+
+ also see http://www.jus.uio.no/sisu/SiSU
+
+WOK
+ end
+ def termsheet
+ print <<WOK
+
+ #{@cX.green}sisu -t [termsheetname].termsheet.rb#{@cX.off}
+ will produce the collection of documents associated with [termsheetname.termsheet.rb]
+
+ #{@cX.green}termsheet.rb#{@cX.off} files:
+ (i) are named after the facility
+ (ii) contain instructions as to which standard forms to use for the agreement (standard_form.rb)
+ there may be several, eg. the termsheet, and the resulting:
+ main agreement; collection account charge; and deed of assignment
+ (iii) contain the variable terms of the agreement, borrower, interest etc.
+
+ for a new loan agreement fill out a new termsheet specifying
+ what standard forms are to be used,
+ and the terms of the agreement.
+
+ #{@cX.green}standard_form.rb#{@cX.off} files:
+ contain the standard terms of the agreement
+ there is a standard form for each variation of agreement
+ (so eg. there are as many facility agreements as there are variations in standard facility)
+ these may be prepared for any agreement that is to be reused.
+ (preparation takes the form of formating and
+ placing variable holders for the variables that are to be provided by the termsheet.rb file)
+
+ it is necessary to purge the directory ~facilityData when old files are removed
+
+WOK
+ end
+ def help_commands
+ print <<WOK
+
+ also see:
+ sisu --help commands
+ man sisu
+WOK
+ end
+ def help_env
+ print <<WOK
+
+ for sisu environment information see:
+ sisu --help env
+WOK
+ end
+ def help_general
+ help_env
+ help_commands
+ end
+ def help_markup
+ print <<WOK
+
+ for help with sisu markup see:
+ sisu --help markup
+ sisu --help header
+ sisu --help structure [sisu --help heading]
+
+ for older standard markup:
+ sisu --help example37
+
+ for markup:
+ sisu --help example38
+
+ sisu-0.38 is provided with 0.38 markup samples
+
+ sample marked up documents are provided in directory:
+ #{@cX.green}sisu-exampless/sample/document_samples_sisu_markup/#{@cX.off}
+ and online
+ #{@cX.green}www.jus.uio.no/sisu#{@cX.off}
+WOK
+ end
+ def convert
+ print <<WOK
+
+ for information on the markup version used within a sisu markup file:
+ sisu --inspect [filename]
+
+ to convert between sst markup versions 0.37 and 0.38:
+ sisu --to-current
+ sisu --to-38 [filename/wildcard]
+ sisu --to-37 [filename/wildcard]
+
+ convert an sst file with footnotes following text to (preferred) inline footnotes
+ sisu --convert-footnotes [filename/wildcard]
+
+ to convert from sst to simple xml representations (sax, dom and node):
+ sisu --to-sax [filename/wildcard]
+ sisu --to-sxs [filename/wildcard]
+
+ sisu --to-dom [filename/wildcard]
+ sisu --to-sxd [filename/wildcard]
+
+ sisu --to-node [filename/wildcard]
+ sisu --to-sxn [filename/wildcard]
+
+ to convert to sst from simple xml representations (sax, dom and node):
+ sisu --from-xml2sst [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]]
+ sisu --from-sxml [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]]
+
+ to attempt to convert a kdissert (.kdi) file to sisu markup:
+ sisu --to-kdi [kdissert filename]
+ (very basic and experimental)
+WOK
+ end
+ def dal
+ print <<WOK
+
+ sisu -m [filename/wildcard] creates the metaverse, used by all other modules for downstream processing
+WOK
+ help_commands
+ end
+ def utf8
+ print <<WOK
+
+ documents prepared for sisu processing should be stored in utf8
+WOK
+ end
+ def plaintext
+ print <<WOK
+
+ sisu -A [filename/wildcard] plaintext with dos linefeeds (footnotes follow paragraphs)
+ sisu -a [filename/wildcard] plaintext with Unix linefeeds (footnotes follow paragraphs)
+
+ sisu -E [filename/wildcard] plaintext with dos linefeeds (endnotes follow document)
+ sisu -e [filename/wildcard] plaintext with Unix linefeeds (endnotes follow document)
+
+ sisu -ho [filename/wildcard] exclude ocn, object numbers
+WOK
+ help_commands
+ end
+ def html
+ print <<WOK
+
+ sisu -h [filename/wildcard] html document type suffixes included
+ sisu -H [filename/wildcard] html without document type suffixes
+
+ sisu -ho [filename/wildcard] exclude ocn, object numbers
+WOK
+ help_commands
+ end
+ def xhtml
+ print <<WOK
+
+ sisu -b [filename/wildcard] xhtml document
+WOK
+ help_commands
+ end
+ def xml
+ print <<WOK
+
+ sisu -x [filename/wildcard] xml document (sax type parsing)
+ sisu -X [filename/wildcard] xml document (dom type parsing)
+
+ sisu -o [filename/wildcard] odt document, (odf open document format)
+WOK
+ help_commands
+ end
+ def odf
+ print <<WOK
+
+ sisu -o [filename/wildcard] odt document, (odf open document format)
+WOK
+ help_commands
+ end
+ def php
+ print <<WOK
+
+ not supported
+ [php output has been removed]
+WOK
+ help_commands
+ end
+ def pdf
+ print <<WOK
+
+ sisu -p [filename/wildcard] produces pdf files from LaTeX output
+WOK
+ help_commands
+ end
+ def latex
+ print <<WOK
+
+ sisu -p [filename/wildcard] produces pdf files from LaTeX output
+WOK
+ help_commands
+ end
+ def texinfo
+ print <<WOK
+
+ sisu -i [filename] produces texinfo and info files
+
+ info and texinfo files are currently left in a separate work/output directory... have not decided what to do with them
+
+ on my system info works fine point at file with info command
+
+ pinfo, requires you to be within the work/output directory
+ cd [work/output directory]
+
+ and then to point at the file using
+ pinfo ./[filename]
+WOK
+ help_commands
+ end
+ def lout
+ print <<WOK
+
+ sisu -l [filename/wildcard]
+
+ not currently supported, revisit someday?
+WOK
+ help_commands
+ end
+ def concordance
+ print <<WOK
+
+ sisu -W starts the sisu webrick server, default port 8081
+WOK
+ help_commands
+ end
+ def help_search
+ print <<WOK
+
+ SiSU searches,
+ depending on how you wish to implement search,
+ the following may bre of interest:
+ sisu --help sql
+ sisu --help searchform (or 'sisu --help cgi')
+ sisu --help hyperestraier (or 'sisu --help est')
+ sisu --help webrick
+WOK
+ end
+ def cgi
+ print <<WOK
+
+ sisu -F generates a sample search form
+
+ sisu -F --webserv=webrick generates a sample search form for use with the webrick server
+ sisu -Fv as above, and provides some information on setting up hyperestraier
+ sisu -W starts the webrick server
+
+ the generated search form must be copied to the webserver directory as instructed
+WOK
+ help_search
+ help_general
+ end
+ def sql
+ print <<WOK
+
+ Mappings to two databases are provided by default,
+ postgresql and sqlite,
+ the same commands are used within sisu to construct and populate databases
+ however -d (lowercase) denotes sqlite and -D (uppercase) denotes postgresql
+ the examples here will used -d (lowercase)
+ alternatively --sqlite or --pgsql may be used
+
+ sisu -d --createdb creates database where no database existed before
+ sisu -d --create creates database tables where no database tables existed before
+ sisu -d --dropall destroys database (including all its content)!!
+ sisu -d --recreate destroys existing database and builds a new empty database structure
+
+ sisu -d --import [filename/wildcard] populates database with the contents of the file
+ sisu -d --update [filename/wildcard] updates file contents in database
+
+ sisu -F --webserv=webrick builds a cgi web search frontend for the database created
+
+ Postgresql
+ user: #{@cX.blue}#{@db.user}#{@cX.off}
+ current db set: #{@cX.blue}#{@db.db_psql}#{@cX.off}
+ port: #{@cX.blue}#{@db.port_psql}#{@cX.off}
+ dbi connect: #{@cX.blue}#{@db.dbi_psql}#{@cX.off}
+
+ sqlite
+ current db set: #{@cX.blue}#{@db.db_sqlite}#{@cX.off}
+ dbi connect #{@cX.blue}#{@db.dbi_sqlite} #{@cX.off}
+
+ Note on databases built
+ By default, [unless otherwise specified] databases are built on a directory basis, from collections of documents within that directory.
+ The name of the directory you choose to work from is used as the database name,
+ i.e. if you are working in a directory called #{@cX.blue}#{@env.path.home}/ebook#{@cX.off} the database #{@cX.blue}ebook#{@cX.off} is used. [otherwise a manual mapping for the collection is necessary]
+WOK
+ help_search
+ help_general
+ end
+ def webrick
+ print <<WOK
+
+ sisu -W starts the sisu webrick server, default port 8081
+WOK
+ help_commands
+ end
+ def hyperestraier
+ out_dir='(' + `ls #{@env.path.webserv}`.split("\n").join('|') + ')'
+ print <<WOK
+ See the documentation for hyperestraier
+ #{@cX.blue}
+ http://hyperestraier.sourceforge.net/
+ http://hyperestraier.sourceforge.net/intro-en.html
+ http://hyperestraier.sourceforge.net/uguide-en.html
+ http://hyperestraier.sourceforge.net/pguide-en.html
+
+ file:///usr/share/doc/hyperestraier/index.html
+ #{@cX.off} #{@cX.orange}
+ man estcmd
+ #{@cX.off}
+ (A) to generate the index
+ within the webserver directory to be indexed:
+ #{@cX.orange}estcmd gather -sd [index name] [directory path to index]#{@cX.off}
+ the following are examples that will need to be tailored according to your needs:
+ #{@cX.green}
+ cd #{@env.path.webserv}
+ estcmd gather -sd casket #{@env.path.webserv}
+ #{@cX.off}
+ you may use the 'find' command together with 'egrep' to limit
+ indexing to particular document collection directories within
+ the web server directory:#{@cX.green}
+
+ find /home/ralph/sisu_www -type f | egrep '#{@env.path.output}/.+?\.html$' |estcmd gather -sd casket - #{@cX.off}
+
+ check which directories in the webserver/output directory #{@cX.green}#{@env.path.webserv}#{@cX.off}
+ you wish to include in the search index, these appear to be:
+
+ #{@env.path.webserv}/#{@cX.green}#{out_dir}#{@cX.off}
+
+ as sisu duplicates output in multiple file formats,
+ it it is probably preferable to limit the estraier index
+ to html output, and as it may also be desireable to
+ exclude files 'doc.html' and 'concordance.html', as these
+ duplicate information held in other html output e.g. #{@cX.green}
+
+ find /home/ralph/sisu_www -type f | egrep '/sisu_www/(sisu|bookmarks)/.+?\.html$' | egrep -v '(doc|concordance)\.html$' |estcmd gather -sd casket - #{@cX.off}
+
+ from your current document preperation/markup directory, you would construct a rune along the following lines: #{@cX.green}
+
+ find /home/ralph/sisu_www -type f | egrep '#{@env.path.webserv}/([specify first directory for inclusion]|[specify second directory for inclusion]|[another directory for inclusion? ...])/.+?\.html$' | egrep -v '(doc|concordance)\.html$' |estcmd gather -sd #{@env.path.webserv}/casket - #{@cX.off}
+
+ (B) to set up the search form
+ (i) copy #{@cX.green}estseek.cgi#{@cX.off} to your cgi directory and set file permissions to 755: #{@cX.green}
+
+ sudo cp -vi /usr/lib/estraier/estseek.cgi /usr/lib/cgi-bin
+ sudo chmod -v 755 /usr/lib/cgi-bin/estseek.cgi
+ sudo cp -v /usr/share/hyperestraier/estseek.* /usr/lib/cgi-bin #{@cX.off}
+ [see estraier documentation for paths]
+
+ (ii) edit #{@cX.green}estseek.conf#{@cX.off}, with attention to the lines starting 'indexname:' and 'replace:': #{@cX.green}
+
+ indexname: #{@env.path.webserv}/casket
+ replace: ^file://#{@env.path.webserv}{{!}}#{@env.url.webrick_base}
+ replace: /index\.html?${{!}}/ #{@cX.off}
+
+ (C) to test using webrick, start webrick: #{@cX.green}
+ sisu -W #{@cX.off}
+
+ and try open the url: #{@cX.blue}
+ #{@env.url.webrick_base}/cgi-bin/estseek.cgi #{@cX.off}
+
+WOK
+ end
+ def yaml
+ print <<WOK
+ Yaml sisurc files may be used to configure sisu, these are searched for in the following locations:
+
+ under the current SiSU markup data directory: #{@cX.blue}#{Dir.pwd}/_sisu/sisurc.yml#{@cX.off}
+ under the home directory ~/.sisu: #{@cX.blue}#{@env.path.home}/.sisu/sisurc.yml#{@cX.off}
+ in the "/etc" directory: #{@cX.blue}#{@env.path.etc}/sisurc.yml#{@cX.off}
+
+ The Yaml files #{@cX.blue}promo.yml#{@cX.off} and #{@cX.blue}list.yml#{@cX.off} may be used to build a minor right pane in html, they may be placed in the following locations:
+
+ under the current SiSU markup data directory: #{@cX.blue}#{Dir.pwd}/_sisu/skin/yml/#{@cX.off}
+ under the home directory ~/.sisu: #{@cX.blue}#{@env.path.home}/.sisu/skin/yml/#{@cX.off}
+ in the "/etc" directory: #{@cX.blue}#{@env.path.etc}/skin/yml/#{@cX.off}
+
+ these may be called by the sisurc.yml, skins for document, directory or site, or from individual document headers in the header @@promo: [a commented out example header may be found in document sample: free_as_in_freedom.richard_stallman_cru‐ sade_for_free_software.sam_williams.sst, it calls for the specified lists in list.yml, which in turn calls the widgets named in promo.yml which are used to build content in the right pane of html output]
+
+WOK
+ end
+ def sitemap
+ print <<WOK
+
+ SiSU sitemaps,
+ an experimental feature (following g,y,m announcement to use them this week)
+ sisu -Y [filename/wildcard]
+ it may be necessary run -m first (generate the the metaverse)
+ sisu -mY [filename/wildcard]
+
+ to generate/update the index of sitemaps
+ sisu --sitemaps
+WOK
+ end
+ def license
+
+ print <<WOK
+
+* License: GPL 2 or later
+
+ #{@cX.ruby}GPL2 summary#{@cX.off}:
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License
+ #{@cX.blue}http://www.gnu.org/copyleft/gpl.html#{@cX.off}
+ as published by the Free Software Foundation;
+ #{@cX.blue}http://www.gnu.org/fsf/fsf.html#{@cX.off}
+ either version 2 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:
+ #{@cX.blue}http://www.fsf.org/licenses/gpl.html#{@cX.off}
+ #{@cX.blue}http://www.gnu.org/copyleft/gpl.html#{@cX.off}
+ #{@cX.blue}http://www.jus.uio.no/sisu/gpl2.fsf#{@cX.off}
+
+* see also the "SiSU Standard" section
+
+* Ralph Amissah ralph@amissah.com
+ Ralph Amissah ralph.amissah@gmail.com
+
+WOK
+ end
+ def standards
+ print <<WOK
+
+SiSU uses:
+
+* Standard SiSU markup syntax,
+* Standard SiSU meta-markup syntax, and the
+* Standard SiSU object citation numbering and system
+
+© Ralph Amissah 1997, current 2005.
+All Rights Reserved.
+
+Information on these may be obtained from:
+ http://www.jus.uio.no/sisu
+
+More information to be provided later.
+
+* however note also the License section
+
+* Ralph Amissah ralph@amissah.com
+ Ralph Amissah ralph.amissah@gmail.com
+
+WOK
+ end
+ def conversion
+ print <<WOK
+sisu_convert does the initial conversion from a couple of file formats to SiSU file format, currently only html and word97
+ #{@cX.cyan}sisu_convert#{@cX.off} [keyword]
+ sisu [keyword]
+ #{@cX.green}--html#{@cX.off} convert from html
+ #{@cX.green}--pace#{@cX.off} convert from html does some initial headers...
+ ------------------------------------------
+ Preparing Documents for SiSU
+ #{@cX.green}--word97#{@cX.off} sisu --help markup (an incomplete overview)
+WOK
+ end
+ def external_programs
+ puts <<WOK
+
+ external ruby programs
+
+ external programs
+ #{@cX.cyan}pdf output - tex/latex#{@cX.off}
+ #{@cX.orange}required#{@cX.off}
+ tex-base/latex
+ pdfetex aka. pdflatex
+ #{@cX.brown}suggested/recommended#{@cX.off}
+ #{@cX.cyan}db/sql output#{@cX.off}
+ #{@cX.orange}required#{@cX.off}
+ postgresql
+ #{@cX.brown}suggested/recommended#{@cX.off}
+ sqlite
+ #{@cX.cyan}xml/xhtml/html output#{@cX.off}
+ #{@cX.orange}required#{@cX.off}
+ #{@cX.brown}suggested/recommended#{@cX.off}
+ tidy (xml, xhtml well formed check)
+ trang (relaxng, rnc to dtd conversion)
+WOK
+ end
+ def scratch
+ print <<WOK
+Types of tag,
+
+then there are various tags which occur within the document.
+Structural tags, which consist of:
+ heading tags that identify headings within text, and;
+ footnote/endnote tags ...
+
+Markup instructions: giving information as to what is to be done to the presentation of the text
+
+Markup tags
+
+These have been kept to a minimum. A number of text html markup tags can be used <b>to bold</b> <i>to indent</i> <sup>for superscript</sup> <sub>for subscript text</sub>
+
+_1 at the beginning of a line indents the paragraph
+
+_2 at the beginning of a line double indents the paragraph
+
+Others include
+
+Other things to note:
+
+By default paragraphs are automatically numbered... and is the same across all output formats
+This makes citation a lot easier... regardless of the form of output that is being looked at
+It also permits the building of various addons, like the concordance feature which identifies each word and the paragraphs in which the word appears with links to the paragraph...
+
+Urls are automatically turned to live links in the html and pdf files created...
+WOK
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/html.rb b/lib/sisu/0.52/html.rb
new file mode 100644
index 00000000..cb6718d3
--- /dev/null
+++ b/lib/sisu/0.52/html.rb
@@ -0,0 +1,719 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: html generation, processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML
+ require 'pstore'
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/html_table'
+ require SiSU_lib + '/html_format_css'
+ require SiSU_lib + '/html_segments'
+ require SiSU_lib + '/html_scroll'
+ require SiSU_lib + '/html_promo'
+ include SiSU_HTML_seg
+ include SiSU_HTML_Format_type
+ include SiSU_HTML_promo
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/html_tune'
+ include SiSU_Tune
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/shared_xml'
+ class Source
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ songsheet
+ end
+ def songsheet
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @fnb=@md.fnb
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/z/; "#{@env.program.web_browser} #{loc}/#@fnb/#{@md.fn[:index]}"
+ elsif @opt.cmd =~/[MVv]/; "#{@env.program.web_browser} #{loc}/#@fnb/#{@md.fn[:index]}"
+ else ''
+ end
+ SiSU_Screen::Ansi.new(@opt.cmd,'HTML',tool).green_hi_blue unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#@fnb/#{@md.fn[:index]}").flow if @opt.cmd =~/[MV]/
+ SiSU_Env::Info_skin.new(@md).select
+ data=nil
+ unless @md.markup =~/url_png/
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns,@md) #Beware #FIX opt and md, both not necessary
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ @tuned_file_array=SiSU_HTML::Source::Html_environment.new(@md).tuned_file_instructions
+ data=@tuned_file_array
+ else
+ data=IO.readlines(@opt.fns,'') #wasteful, not really necessary?
+ SiSU_HTML_nav_tune::Tune.new(data,@md).songsheet
+ @tuned_file_array=data #watch may not be what you want
+ end
+ scr_endnotes=SiSU_HTML::Source::Endnotes.new(data,@md).scroll unless @md.markup =~/url_png/
+ toc=SiSU_HTML::Source::Toc.new(data,@md).songsheet
+ doc_ver=SiSU_HTML::Source::Links_guide.new(data,@md).doc_versions
+ links_guide=SiSU_HTML::Source::Links_guide.new(data,@md).toc
+ data=@tuned_file_array
+ scr_toc=SiSU_HTML::Source::Scroll_head_and_segtoc.new(data,@md,toc,links_guide,doc_ver).in_common
+ SiSU_HTML::Source::Seg.new(data,@md).songsheet #if not_scroll_only
+ data=@tuned_file_array
+ scr=SiSU_HTML::Source::Scroll.new(data,@md).songsheet
+ scroll=SiSU_HTML::Source::Scroll_output.new(scr_toc,scr[:body],scr_endnotes,scr[:metadata],scr[:owner_details],scr[:tails],@md).publish
+ SiSU_HTML::Source::Output.new(scroll,@md).scroll
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ unless @opt.cmd =~/[MV]/ #check maintenance flag
+ texfiles = Dir["#{@env.path.tune}/#{@opt.fns}*"]
+ texfiles.each do |f|
+ if FileTest.file?(f)
+ File.unlink(f)
+ end
+ end
+ end
+ SiSU_Env::Create_file.new(@opt.cmd,@opt.fns).param_instantiate
+ @@flag,@@scr,@@seg,@@seg_endnotes,@@seg_subtoc,@@seg_ad={},{},{},{},{},{}
+ @@seg_total,@@tracker,@@loop_count,@@tablehead,@@number_of_cols=0,0,0,0,0
+ @@seg_name,@@seg_name_html,@@seg_name_php,@@seg_subtoc_array,@@seg_endnotes_array,@@segtocband,@@tablefoot=Array.new(7){[]}
+ @@filename_seg,@@seg_url,@@filename_segphp,@@fn,@@to_lev4,@@get_hash_to,@@get_hash_fn='','','','','','',''
+ @@is4=@@is3=@@is2=@@is1=@@header1=@@header2=@@header3=@@header4=0
+ end
+ end
+ private
+ class Html_environment
+ def initialize(md)
+ @md=md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @env,@css,@symlnk=SiSU_Env::Info_env.new(@md.fns),SiSU_Style::CSS.new,SiSU_Env::Create_system_link.new #home
+ end
+ def suffix_linkname #not used at present
+ sfx=if @md.cmd =~/h/; '.html'
+ else ''
+ end
+ end
+ def link_images
+ @symlnk.images
+ end
+ def directories
+ my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ @path={ :root=>my_make.html_root }
+ title=File.basename(@md.fns,'.rb')
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ end
+ def tuned_file_instructions
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @tell=SiSU_Screen::Ansi.new(@md.cmd)
+ if @md
+ @md.sfx=''
+ @md.file_type='php' if @md.cmd =~/z/
+ @md.sfx='' if @md.cmd =~/z/
+ if @md.cmd =~/h/ or @md.fns =~/\~[a-z]{2,3}\.s?/ #multilingual document protection is a bit arbitrary, (needed by existing server configuration), add configuration overide...
+ if @md.cmd =~/H/ and @md.fns =~/\~[a-z]{2,3}\.s?/
+ SiSU_Screen::Ansi.new(@md.cmd,
+ 'multilingual document, creating internal url links with filetype suffix',
+ "\n\t\t(overriding -H request, using -h mode instead)"
+ ).warn unless @md.cmd =~/q/
+ end
+ @md.sfx='.html'
+ @md.pdf='.pdf'
+ end
+ end
+ @md.cmd=@md.cmd.gsub(/H/,'h')
+ @md.file_type='html' if @md.cmd =~/[hon]/
+ directories
+ newfilename=%{#{@env.path.output}/#{@md.fnb}/#{@md.fn[:index]}} if @md.file_type =~/html/
+ my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ @fnm=my_make_source_file.marshal_meta
+ @tune_verse_marshal=my_make_source_file.marshal_tune
+ if @md.markup !~/url_png/ and @md.cmd =~/[hozn]/
+ dal_array=SiSU_DAL::Source.new(@md).get # dal file drawn here
+ @tuned_file_array=SiSU_Tune::Tune.new(dal_array,@md).songsheet
+ else
+ SiSU_HTML_nav_tune::Tune.new(@file_array,@md).songsheet #no doc passed originally... 2004w35, revist changes in conditional 2006
+ end
+ require SiSU_lib + '/param'
+ @tuned_file_array
+ end
+ end
+ class Split_text_object
+ include SiSU_Viz
+ include SiSU_HTML_Format_type
+ @@dp=nil
+ attr_reader :format,:text,:ocn,:scroll_lev_para_ocn,:seg_lev_para_ocn
+ def initialize(md,para)
+ @md,@para=md,para
+ @format,@ocn='null','null'
+ #@format,@ocn=nil,nil
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def lev_segname_para_ocn #needs work 2003w29
+ if @para =~/^\d~.+?<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if @para[/^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]
+ @format,segname,@text,@ocn=$1,$2,$3,$4
+ @format="#@format~#{segname}" #
+ elsif @para[/^([1-6]~)\s+(\S.+?)<~(\d+);(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]
+ @format,@text,@ocn=$1,$2,$3 #,$4
+ end
+ else
+ if @para[/^(?:_1\*|<:i[12]>\s*_\*)\s+(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]
+ @format,@text,@ocn='_1*',$1,$2,$3
+ elsif @para[/^(_\*)\s+(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]
+ @format,@text,@ocn=$1,$2,$3
+ elsif @para[/<:(i[12])>\s*(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]
+ @format,@text,@ocn=$1,$2,$3
+ elsif @para[/<:(code|alt|verse|group)>(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]
+ @format,@text,@ocn=$1,$2,$3
+ elsif @para[/(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]
+ @text,@ocn=$1,$2 #,$3
+ end
+ if @para !~/<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06
+ @text=@para[/(.+?)/m,1]
+ end
+ if @para[/^(\d)~\S*\s+(.+)/m]
+ @format,@text=$1,$2
+ end
+ end
+ @seg_lev_para_ocn=if @para[/.+<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/]
+ SiSU_HTML_Format_type::Format_seg.new(@md,@format,@text,@ocn)
+ end
+ @scroll_lev_para_ocn=if @para[/.+<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/]
+ SiSU_HTML_Format_type::Format_scroll.new(@md,@format,@text,@ocn)
+ end
+ self
+ end
+ end
+ class Links_guide
+ @links_guide_toc=[]
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def doc_versions
+ format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md)
+ @doc_versions_toc=format_head_toc.document_versions_toc
+ end
+ def toc
+ @links_guide_toc=[]
+ format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md)
+ guide_type='horzontal' #values: horizontal or vertical
+ @links_guide_toc << format_head_toc.links_guide_open(guide_type)
+ if defined? @md.lnk and @md.lnk
+ @md.lnk.each do |l|
+ if defined? l[:say]
+ target=if l[:url] !~/^\.(\.)?\//; 'external'
+ else '_top'
+ end
+ s_lnk_url,s_lnk_lnk=l[:url],l[:say]
+ lev_para_ocn=SiSU_HTML_Format_type::Format_toc.new(@md,s_lnk_url,s_lnk_lnk,target)
+#p lev_para_ocn.links_guide if s_lnk_lnk
+ @links_guide_toc << lev_para_ocn.links_guide if s_lnk_lnk
+ end
+ end
+ end
+ format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md)
+ @links_guide_toc << format_head_toc.links_guide_close #(guide_type)
+ @links_guide_toc
+ end
+ end
+ class Endnotes
+ include SiSU_Param
+ include SiSU_HTML_Format_type
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def scroll
+ @scr_endnotes=[]
+ format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md)
+ @scr_endnotes << format_head_scroll.title_endnote
+ @data.each do |para|
+ pg=para.dup
+ if pg =~/~[{\[][\d*+]+ <a name="_[\d*+]+"/
+ endnote_array=[]
+ if pg=~/~\{[\d*+].+?\}\~/m
+ endnote_array << pg.scan(/~\{[\d*+]+(.+?)\}\~/m)
+ end
+ if pg=~/~\[[\d*]+\s.+?\]\~/m
+ endnote_array << pg.scan(/~\[[\d*]+(.+?)\]\~/m)
+ end
+ if pg=~/~\[[\d+]+\s.+?\]\~/m
+ endnote_array << pg.scan(/~\[[\d+]+(.+?)\]\~/m)
+ end
+ endnote_array.flatten.each do |note|
+ format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,note)
+ @scr_endnotes << format_scroll.endnote_body
+ end
+ end
+ end
+ @scr_endnotes
+ end
+ end
+ class Toc <Links_guide
+ @@toc={ :seg=>[],:scr=>[] }
+ @@seg_url=''
+ @@dp,@@firstseg=nil,nil
+ def initialize(data='',md=nil)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @pat_heading=/^(?:[1-6]~\S*)?(.*)<~(\d+);(?:[hm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ @pat_strip_heading_name=/<a name="h?\d.*?">(.+?)<\/a>/
+ @tell=SiSU_Screen::Ansi.new(@md.cmd)
+ end
+ def songsheet #extracts toc for scroll & seg
+ SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey unless @md.cmd =~/q/
+ toc=nil
+ @@firstseg=nil
+ @data.each do |para|
+ if para =~/^([1-6]~|4~!)/
+ para_toc=para.dup
+ para_toc.gsub!(/&nbsp;<a name="-[\d*+]+" href="#_[\d*+]+">&nbsp;<sup>[\d*+]+<\/sup>&nbsp;<\/a>\s+~[{\[].+?[}\]]~/m,'') #remove endnotes from toc
+ toc=case para_toc
+ when /^\s*1~(\S+)?/; Toc.new(para_toc,@md).level_1
+ when /^\s*2~(\S+)?/; Toc.new(para_toc,@md).level_2
+ when /^\s*3~(\S+)?/; Toc.new(para_toc,@md).level_3
+ when /^\s*4~(\S+)?/; Toc.new(para_toc,@md).level_4
+ when /^\s*5~(\S+)?/; Toc.new(para_toc,@md).level_5
+ when /^\s*6~(\S+)?/; Toc.new(para_toc,@md).level_6
+ when /^\s*4~!/; Toc.new(para_toc).level_crosslink
+ else
+ end
+ if @@firstseg.nil? and para=~/^4~\S+?/
+ @@firstseg=/^4~(\S+)?/.match(para)[1]
+ end
+ if toc
+ begin
+ @@toc[:seg] << toc[:seg] if toc[:seg]
+ @@toc[:scr] << toc[:scr] if toc[:scr]
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ end
+ end
+ end
+ end
+ @md.firstseg=@@firstseg
+ @@toc
+ end
+ protected
+ def rss #sort all wrong, disabled but kept
+ @@toc[:seg] <<<<WOK
+<center>
+<table><tr><td>
+<p><font color="#222222" #{@font.face} size="2">
+(relatively static) RSS feeds for DOCUMENTS:<br />
+<a href="../rssfeed/documents.xml"><img border="0" height="14" width="36" src="../_sisu/image/rss.png" alt="RSS feed"></a>&nbsp;http://www.jus.uio.no/lm/rssfeed/documents.xml<br />
+<a href="../rssfeed/tradelaw.xml"><img border="0" height="14" width="36" src="../_sisu/image/rss.png" alt="RSS feed"></a>&nbsp;http://www.jus.uio.no/lm/rssfeed/tradelaw.xml<br />
+<a href="../rssfeed/environmental.xml"><img border="0" height="14" width="36" src="../_sisu/image/rss.png" alt="RSS feed"></a>&nbsp;http://www.jus.uio.no/lm/rssfeed/environmental.xml<br />
+<center><a href="mailto:info@address.com" target="_top">info@address.com</a></center>
+</font></p>
+</td></tr></table>
+WOK
+ end
+ def level_doc_owner_details
+ if @md.stmp =~/\w\w/
+ format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md)
+ @@toc[:scr] << format_head_scroll.toc_owner_details
+ end
+ end
+ def level_endnotes
+ if @md.flag_endnotes
+ format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md)
+ @@toc[:scr] << format_head_scroll.toc_endnote
+ end
+ end
+ def level_metadata
+ format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md)
+ @@toc[:scr] << format_head_toc.metadata
+ @@toc[:seg] << format_head_toc.seg_metadata
+ end
+ def level_word_index
+ format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@d0c)
+ @@toc[:scr] << format_head_toc.concordance
+ @@toc[:seg] << format_head_toc.concordance
+ end
+ def level_1
+ para=@data
+ unless para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ para.gsub!(@pat_strip_heading_name,'\1')
+ end
+ para[@pat_heading]
+ linkname,link=$1,$2 if $&
+ p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/ #% keep eye on link
+ title=unless para =~/Document Information/; linkname
+ else
+ link='metadata'
+ %{<b><a href="#{@md.fnl[:pre]}#{link}#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}">#{linkname}</a></b>}
+ end
+ toc={}
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
+ toc[:seg]=format_toc.lev1
+ title=if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/
+ m=/#{$1}/
+ para.gsub!(m,'')
+ linkname
+ else #if para =~/Document Information/
+ @@toc[:scr] << '<br />'
+ link='docinfo'
+ %{<b><a href="##{link}">#{linkname}</a></b>}
+ end
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
+ toc[:scr]=format_toc.lev1
+ toc
+ end
+ def level_2
+ para=@data
+ unless para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ para.gsub!(@pat_strip_heading_name,'\1')
+ end
+ para[@pat_heading]
+ linkname,link=$1,$2 if $&
+ p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,linkname)
+ toc={}
+ toc[:seg]=format_toc.lev2
+ if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/
+ m=/#{$1}/
+ para.gsub!(m,'')
+ title=linkname
+ else title=%{#{p_num.goto}#{linkname}</a>}
+ end
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
+ toc[:scr]=format_toc.lev2
+ toc
+ end
+ def level_3
+ para=@data
+ para.gsub!(@pat_strip_heading_name,'\1')
+ para.gsub(/(.*?)<a name="(\d+)"><\/a>(.*)/,'\1') #2002w42 altered gsub! - problematic? - suspect
+ para[@pat_heading]
+ linkname,link=$1,$2 if $&
+ p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,linkname)
+ toc={}
+ toc[:seg]=format_toc.lev3
+ if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/
+ m=/#{$1}/
+ para.gsub!(m,'')
+ title=linkname
+ else title=%{#{p_num.goto}#{linkname}</a>}
+ end
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
+ toc[:scr]=format_toc.lev3
+ toc
+ end
+ def level_4
+ para=@data
+ unless para =~/~metadata/
+ unless para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ para.gsub!(@pat_strip_heading_name,'\1')
+ para[@pat_heading]
+ linkname,link=$1,$2 if $&
+ p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link
+ end
+ para.gsub!(/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'')
+ if para =~/^4~/
+ seg_link=para.gsub(/^\s*4~(\S+)\s+(.+?)$/,
+ %{ <a href="#{@md.fnl[:pre]}\\1#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}" target="_top">
+ \\2
+ </a> })
+ @@seg_url=para[/^4~(\S+).+?$/,1]
+ elsif para =~/\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+/
+ seg_link=para.gsub(/^\s*(#{@md.lv4}\s+)\s*(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/,
+ %{<a href="#{@md.fnl[:pre]}\\2#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}" } +
+ %{target="_top">\\1 \\2 \\3</a> })
+ end
+ p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,seg_link)
+ toc={}
+ toc[:seg]=format_toc.lev4
+ if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ m=/#{$1}/
+ para.gsub!(m,'')
+ title=linkname
+ else title=%{#{p_num.goto}#{linkname}</a>} if p_num
+ end
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
+ toc[:scr]=format_toc.lev4
+ toc
+ end
+ end
+ def level_5
+ para=@data
+ if para !~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ para.gsub!(@pat_strip_heading_name,'\1')
+ end
+ para[@pat_heading]
+ linkname,link=$1,$2 if $&
+ p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/
+ toc={}
+ if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ m=/#{$1}/
+ para.gsub!(m,'')
+ title=linkname
+ else
+ lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}##{link}">
+ #{linkname}
+ </a>}
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt)
+ toc[:seg]=format_toc.lev5
+ title=%{#{p_num.goto}#{linkname}</a>}
+ end
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
+ toc[:scr]=format_toc.lev5
+ toc
+ end
+ def level_6
+ para=@data
+ if para !~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ para.gsub!(@pat_strip_heading_name,'\1')
+ end
+ para[@pat_heading]
+ linkname,link=$1,$2 if $&
+ p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link and link !~/#/
+ toc={}
+ if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ m=/#{$1}/
+ para.gsub!(m,'')
+ title=linkname
+ else
+ lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}##{link}">
+ #{linkname}
+ </a>}
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt)
+ toc[:seg]=format_toc.lev6
+ title=%{#{p_num.goto}#{linkname}</a>}
+ end
+ format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title)
+ toc[:scr]=format_toc.lev6
+ toc
+ end
+ def level_crosslink
+ para=@data
+ if para !~/^4~!/
+ para.gsub!(/^4~!\s+(\S+)\s+(.+)/,
+ %{<table><tr><td width =\"80\"></td>
+ <td><a href="http://\\1" target="_top">
+ #{@png.crosslink_ext}
+ &nbsp;&nbsp;\\2
+ <\/a>
+ </td></tr></table>
+})
+ else
+ para.gsub!(/^4~!\s+(\S+)\s+(.+)/,
+ %{<table><tr><td width ="80">
+ </td><td>
+ <a href="\\1" target="_top">
+ #{@png.crosslink}
+ &nbsp;&nbsp;\\2
+ <\/a>
+ </td></tr></table>
+})
+ end
+ end
+ end
+ class Scroll_head_and_segtoc < Toc
+ def initialize(data,md='',toc='',links_guide_toc='',doc_versions_toc='')
+ @data,@md,@toc,@links_guide_toc,@doc_versions_toc=data,md,toc,links_guide_toc,doc_versions_toc
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def in_common
+ toc_shared=[]
+ @segtoc=[]
+ SiSU_Screen::Ansi.new(@md.cmd,'Scroll & Segtoc').txt_grey unless @md.cmd =~/q/
+ format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md)
+ dochead=format_head_toc.head
+ dochead.gsub!(/toc\.(html|php)/,'doc.\1') #kludge
+ ads=SiSU_HTML_promo::Ad.new(@md)
+ toc_shared << dochead << ads.div.major
+ @segtoc << format_head_toc.head << ads.div.major
+ toc_shared << format_head_toc.toc_head_escript if SiSU_HTML_Format_type::Head_toc.method_defined? :toc_head_escript
+ @segtoc << format_head_toc.toc_head_escript if SiSU_HTML_Format_type::Head_toc.method_defined? :toc_head_escript
+ toc_shared << format_head_toc.scroll_head_navigation_band
+ if @md.dc_rights
+ rights=format_head_toc.rights
+ rights=SiSU_Tune::Clean_html.new(rights).clean
+ end
+ if @md.prefix_b
+ prefix_b=format_head_toc.prefix_b
+ prefix_b=SiSU_Tune::Clean_html.new(prefix_b).clean
+ end
+ @seg_toc_band=format_head_toc.seg_head_navigation_band('pdf') #bug, vary depending on type of doc !! examine
+ @segtoc << @seg_toc_band
+ toc_shared << format_head_toc.scroll_head_title_banner_open
+ @segtoc << format_head_toc.seg_head_title_banner_open
+ tmp_head=nil
+ doc_title_endnote=@md.title.gsub(/(\*+)/,'<sup><a href="#endnotes">\1</a></sup>')
+ tmp_head=doc_title_endnote + "\n"
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head)
+ toc_shared << format_txt_obj.center_bold
+ @segtoc << format_txt_obj.center_bold
+ if not @md.subtitle.nil? and not @md.subtitle.empty?
+ tmp_head=@md.subtitle + "\n"
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head)
+ toc_shared << format_txt_obj.center_bold
+ @segtoc << format_txt_obj.center_bold
+ end
+ if @md.dc_creator
+ creator_endnote=@md.dc_creator.gsub(/(\*+)/,%{&nbsp;<sup><a href="#notes">\\1</a></sup>})
+ creator_endnote=%{<sup>&copy;</sup> #{creator_endnote}} if creator_endnote =~/\S/
+ tmp_head=creator_endnote + "\n"
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head)
+ toc_shared << format_txt_obj.center_bold
+ @segtoc << format_txt_obj.center_bold
+ end
+ toc_shared << format_head_toc.copyat
+ @segtoc << format_head_toc.copyat
+ toc_shared << "#{@vz.table_close*1}\n"
+ @segtoc << "#{@vz.table_close*1}\n"
+ tmp_head=nil
+ if @md.prefix_a
+ tmp_head ||= %{<p />#{@md.prefix_a}\n}
+ toc_shared << tmp_head.dup
+ @segtoc << tmp_head.dup
+ end
+ tmp_head=nil
+ toc_shared << @doc_versions_toc
+ toc_shared << @links_guide_toc
+ toc_shared << rights if @md.dc_rights
+ toc_shared << prefix_b if @md.prefix_b
+ #Table of Contents added/appended here
+ toc_shared << @toc[:scr]
+ @segtoc << @doc_versions_toc
+ @segtoc << @links_guide_toc
+ @segtoc << @toc[:seg]
+ @segtoc << rights if @md.dc_rights
+ @segtoc << prefix_b if @md.prefix_b
+ #Segtoc tail added here
+ @segtoc << "</p>\n" #bugfix sort later DEBUGNOW
+ @segtoc << @seg_toc_band
+ ads=SiSU_HTML_promo::Ad.new(@md)
+ @segtoc << format_head_toc.seg_navigation_tail << ads.div.close << ads.display << format_head_toc.html_close
+ Output.new(@segtoc.to_s,@md).segtoc
+ @segtoc=[]
+ @toc[:scr],@toc[:seg]=[],[]
+ toc_shared
+ end
+ end
+ class Table < SiSU_HTML_table::Table
+ end
+ class Scroll < SiSU_HTML_scroll::Scroll
+ end
+ class Scroll_output
+ def initialize(scr_toc,scr_body,scr_endnotes,scr_metadata,scr_owner_details,scr_tails,md)
+ @scr_toc,@scr_body,@scr_endnotes,@scr_metadata,@scr_owner_details,@scr_tails,@md=scr_toc,scr_body,scr_endnotes,scr_metadata,scr_owner_details,scr_tails,md
+ end
+ def publish
+ scroll=[]
+ scroll << @scr_toc << @scr_body << @scr_endnotes << @scr_metadata << @scr_owner_details << @scr_tails
+ scroll.to_s
+ end
+ end
+ class Seg < SiSU_HTML_seg::Seg
+ end
+ class Output
+ include SiSU_Param
+ @@dp=nil
+ def initialize(data='',md='')
+ @data,@md=data,md
+ @my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns,@md)
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def scroll
+ begin
+ @sisu=[]
+ @data.each do |para|
+ para.strip!
+ para.gsub!(/<:.+?>/,'')
+ unless para =~/^\s*$/
+ para="#{para}\n"
+ @sisu << para
+ end
+ end
+ @filename_html_scroll=@my_make.file_html_scroll(@md)
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.split(/\n\n/)
+ @sisu.each {|para| @filename_html_scroll.puts para,"\n"}
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ end
+ end
+ def segtoc
+ begin
+ @sisu=[]
+ @data.each do |para|
+ para.strip!
+ para.gsub!(/<!.+?!>|<~\d+;(?:[ohm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'')
+ unless para =~/^\s*$/
+ para="#{para}\n"
+ @sisu << para
+ end
+ end
+ new_file_data=@sisu.to_s
+ @filename_html_segtoc=@my_make.file_html_segtoc(@md)
+ @filename_html_index=@my_make.file_html_index(@md)
+ @sisu=new_file_data.split(/\n\n/)
+ @sisu.each {|para| @filename_html_segtoc.puts para,"\n"}
+ @sisu.each {|para| @filename_html_index.puts para,"\n"}
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ end
+ end
+ def seg
+ begin
+ @sisu=[]
+ @data.each do |para|
+ para.strip!
+ unless para =~/^\s*$/; @sisu << para
+ end
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.split(/\n\n/)
+ @sisu.each {|para| @newfile.puts para,"\n"}
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/html_format.rb b/lib/sisu/0.52/html_format.rb
new file mode 100644
index 00000000..780b3253
--- /dev/null
+++ b/lib/sisu/0.52/html_format.rb
@@ -0,0 +1,1056 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: base formatting template for html generation
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML_Format
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ class Paragraph_number
+ def initialize(md,paranum)
+ @md=md
+ @paranum=paranum[/(\d+)/m,1]
+ @paranum ||=''
+ @paranum='' if @md.mod.inspect =~/--no-ocn/
+ end
+ def ocn_display
+ ocn_class=if @md.mod.inspect =~/--no-ocn/; 'ocn_off'
+ else 'ocn'
+ end
+ @paranum.gsub(/^(\d+|)$/,
+ %{ <p class="#{ocn_class}">
+ &nbsp;&nbsp;\\1
+ </p>})
+ end
+ def name
+ %{<a name="#@paranum" />}
+ end
+ def id #w3c? "tidy" complains about numbers as identifiers ! annoying
+ %{id="o#@paranum"}
+ end
+ def goto
+ %{<a href="##@paranum">}
+ end
+ end
+ class Paragraph_id_ocn #used by table version #work area 2003w48
+ attr_accessor :paranum,:font,:p_num
+ def initialize(md,paranum)
+ @paranum,@vz,@p_num=paranum,SiSU_Env::Get_init.instance.skin,SiSU_HTML_Format::Paragraph_number.new(md,paranum) #font
+ end
+ def txt
+ %{ <p #{@p_num.id} align="justify">#{@p_num.name}
+ <font #{@vz.font_size_txt} #{@vz.font_color} #{@vz.font_face}>}
+ end
+ def txt_00
+ %{ <p #{@p_num.id} align="justify">#{@p_num.name}
+ <font #{@vz.font_size_txt_00} #{@vz.font_color} #{@vz.font_face}>}
+ end
+ def font_citation
+ %{<font #{@vz.font_size_txt} #{@vz.font_face}>}
+ end
+ def endnote
+ %{ <p #{@p_num.id} align="justify">#{@p_num.name}
+ <font #{@vz.font_size_endnote} #{@vz.font_color} #{@vz.font_face}>}
+ end
+ def table
+ %{ <p #{@p_num.id} align="left">#{@p_num.name}
+ <font #{@vz.font_small} #{@vz.font_color} #{@vz.font_face}>}
+ end
+ def tiny
+ %{ <p #{@p_num.id} align="justify">#{@p_num.name}
+ <font #{@vz.font_tiny} #{@vz.font_color} #{@vz.font_face}>}
+ end
+ def small
+ %{ <p #{@p_num.id} align="justify">#{@p_num.name}
+ <font #{@vz.font_small} #{@vz.font_color} #{@vz.font_face}>} # keep but not used?
+ end
+ def font_tiny
+ %{<font #{@vz.font_tiny} #{@vz.font_face}>}
+ end
+ def font_small
+ %{<font #{@vz.font_small} #{@vz.font_face}>}
+ end
+ def header_
+ %{ <p #{@p_num.id} align="center">#{@p_num.name}
+ <font #@vz.font color="#@color" #{@vz.font_face}>}
+ end
+ end
+ class Head_information
+ include SiSU_Viz
+ include SiSU_HTML_Format
+ include SiSU_Env
+ attr_reader :md,:sfx,:pdf,:rdf,:vz
+ def initialize(md='')
+ @md=md
+ @sfx,@pdf=@md.sfx,@md.pdf
+ @rdf=SiSU_XML_tags::RDF.new(md)
+ # DublinCore 1 - title
+ @vz=SiSU_Env::Get_init.instance.skin
+ @css=SiSU_Env::CSS_stylesheet.new(md)
+ @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || [])
+ @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || [])
+ case @md.file_type
+ when /php/; @index='index' # @index="index.php"
+ else @index='index'
+ end
+ @metalink='#metadata'
+ @tocband_scroll,@tocband_segtoc=nil,nil
+ end
+ def doc_type
+ %{<!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">\n}
+ end
+ def toc_head_escript #embedded script in this case PHP
+ # %{<p>PHP or other embedded script for object persistence may go HERE</p>}
+ end
+ def seg_head_escript #embedded script in this case PHP
+ # %{<p>PHP or other embedded script for object persistence may go HERE</p>}
+ end
+ def table_close
+ %{ </font>
+#{@vz.table_close}}
+ end
+ def buttons_home
+ %{<!- home and index buttons -!>
+ #{@vz.banner_home_and_index_buttons}
+<!- home and index buttons -!>}
+ end
+ def copyat
+ %{#{@vz.paragraph_heading_1_center}copy @
+ <a href="#{@vz.url_home}" #{@vz.js_home}>
+ #{@vz.txt_home}
+ </a></h1>}
+ end
+ end
+ class Widget < Head_information
+ def initialize(md)
+ super(md)
+ @md=md
+ @cf_defaults=SiSU_Env::Info_processing_flag.new
+ end
+ def home
+ %{<td align="center" bgcolor=#{@vz.color_band2}>
+ <a href="../index.html" target="_top">
+ #{@vz.png_homepage}</a>
+</td>
+}
+ end
+ def scroll(text)
+ if @md.fns =~ /\.[_-]?sst$/
+ scroll=%{<td align="center" bgcolor=#{@vz.color_band2}>
+ <a href="#{@md.fn[:doc]}" target="_top" #{@vz.js_doc}>
+ #{text}
+ </a>
+</td>
+}
+ end
+ end
+ def seg(text)
+ %{<td align="center" bgcolor="#99CC66">
+ <a href="#{@md.fn[:toc]}" target="_top" #{@vz.js_doc}>
+ #{text}
+ </a>
+</td>
+}
+ end
+ def search
+ env=SiSU_Env::Info_env.new(@md.fns,@md)
+ env.widget.search_form
+ end
+ def manifest
+ %{<td align="center" bgcolor=#{@vz.color_band2}>
+ <a href="#{@md.fn[:manifest]}" target="_top" #{@vz.js_manifest}>
+ #{@vz.nav_txt_manifest}
+ </a>
+</td>}
+ end
+ def pdf
+ pdf=if @md.programs[:pdf] and @cf_defaults.cf_0 =~/p/
+ %{
+<td align="center" bgcolor=#{@vz.color_band2} border="0">
+ <a href="#{@md.fn[:pdf_p]}" target="_top" #{@vz.js_portrait}>
+ #{@vz.nav_txt_pdf_portrait}
+ </a>
+</td>
+<td align="center" bgcolor=#{@vz.color_band2} border="0">
+ <a href="#{@md.fn[:pdf_l]}" target="_top" #{@vz.js_landscape}>
+ #{@vz.nav_txt_pdf_landscape}
+ </a>
+</td>
+}
+ else ''
+ end
+ end
+ def odf
+ odf=if @cf_defaults.cf_0 =~/o/
+ %{
+<td align="center" bgcolor=#{@vz.color_band2}>
+ <a href="#{@md.fn[:odf]}" target="_top" #{@vz.js_odf}>
+ #{@vz.nav_txt_odf}
+ </a>
+</td>}
+ else ''
+ end
+ end
+ def concordance(text)
+ if @md.concord_make or @cf_defaults.cf_0 =~/w/
+ %{<td align="center" bgcolor=#{@vz.color_band2} border="0">
+ <a href="#{@md.fn[:concordance]}" target="_top" #{@vz.js_concordance}>
+ #{text}
+ </a>
+ </td>}
+ else ''
+ end
+ end
+ end
+ class Head_toc < Head_information
+ def initialize(md)
+ super(md)
+ @md=md
+ @tocband_scroll,@tocband_segtoc=make_scroll,make_seg
+ end
+ def scroll_head_navigation_band
+ pdf=if @md.programs[:pdf]
+ <<WOK
+<td align="center" width="60%">
+ #{make_seg_scroll_pdf}
+</td>
+WOK
+ else ''
+ end
+ %{<table summary="table of contents scroll navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
+<tr><td width="20%">
+ #{@vz.banner_band}
+</td>#{pdf}
+<td width="20%">
+ &nbsp;
+#{@vz.table_close}
+<p />}
+ end
+ def seg_head_navigation_band(type='')
+ if type=~/pdf/
+ @tocband_segtoc=make_scroll_seg_pdf
+ end
+ firstseg=%{<a href="#{@md.fnl[:pre]}#{@md.firstseg}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" alt="-&gt;">
+ #{@vz.png_nav_nxt}
+ </a>} if @md.firstseg =~/\S+/
+ %{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
+<tr><td width="20%">
+ #{@vz.banner_band}
+</td>
+<td width="60%" align="center">
+ #@tocband_segtoc
+</td>
+<td width="20%" align="right">
+ &nbsp;#{firstseg}&nbsp;
+#{@vz.table_close}
+<p />}
+ end
+ def manifest_link(text)
+ %{<font size=2>
+ <a href="#{@md.fn[:manifest]}" target="_top" #{@vz.js_manifest}>#{text}</a>
+ </font>}
+ end
+ def concordance_link(text)
+ if @md.concord_make
+ %{<font size=2>
+ <a href="#{@md.fn[:concordance]}" target="_top" #{@vz.js_concordance}>
+ #{text}
+ </a>
+ </font>}
+ else ''
+ end
+ end
+ def make_seg_scroll_pdf
+ wgt=Widget.new(@md)
+ scroll=%{<td align="center" bgcolor=#{@vz.color_band2} border="0">
+ #{@vz.nav_txt_doc_link}
+</td>
+}
+ %{<table summary="toc segment and scroll with pdf" border="0" cellpadding="3" cellspacing="0">
+<tr>
+ #{scroll}
+ #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.pdf}#{wgt.odf}
+ #{wgt.concordance(@vz.nav_txt_concordance)}
+ #{wgt.manifest}
+ #{wgt.search}
+ #{wgt.home}
+</tr></table>}
+ end
+ def make_scroll_seg_pdf
+ manifest=scroll=seg=''
+ wgt=Widget.new(@md)
+ seg=%{<td align="center" bgcolor=#{@vz.color_band2}>
+ #{@vz.nav_txt_toc_link}
+</td>
+}
+ %{<table summary="toc scroll and segment with pdf" border="0" cellpadding="3" cellspacing="0">
+<tr>
+ #{seg}
+ #{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf}
+<td align="center" bgcolor=#{@vz.color_band2}>
+ #{wgt.concordance(@vz.nav_txt_concordance)}
+ #{wgt.manifest}
+ #{wgt.search}
+ #{wgt.home}
+</tr></table>}
+ end
+ def head
+ %{#{doc_type}
+<head>
+ <title>
+ #{@md.html_title}
+ </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ #{@rdf.rdftoc}
+ #{@rdf.metatag_html}
+ #{@vz.font_css_table_file}
+</head>
+#{@vz.color_body}
+ <a name="top" id="top"></a>
+ <a name="up" id="up"></a>
+ <a name="start" id="start"></a>
+ #{@vz.js_top}}
+ end
+ def document_versions_toc
+ #document_version_hold
+ end
+ def links_guide_vertical_open #???
+ url=(defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/ ? @vz.url_hp : @vz.url_home
+ %{<div id="vertical_links">
+ <ul id="vertical">
+ <li class="refbold">
+ <a href="#{url}" #{@vz.js_home}>
+ #{@vz.txt_hp}
+ </a>
+ </li>
+ <li class="ref">
+ Quick Ref.:
+ </li>
+ <li class="ref">
+ <a href="#{@md.fn[:manifest]}" alt="Document Manifest" target="_top">
+ Manifest
+ </a>
+ </li>
+<!- quick ref -!>}
+ end
+ def links_guide_horizontal_open #???
+ url=(defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/ ? @vz.url_hp : @vz.url_home
+ %{<div id="horizontal_links">
+ <ul id="horizontal">
+ <li class="refbold">
+ <a href="#{url}" #{@vz.js_home}>
+ #{@vz.txt_hp}
+ </a>
+ </li>
+ <li class="ref">
+ Quick Ref.:
+ </li>
+ <li class="ref">
+ <a href="#{@md.fn[:manifest]}" alt="Document Manifest" target="_top">
+ Manifest
+ </a>
+ </li>
+<!- quick ref -!>}
+ end
+ def links_guide_open(type='horizontal')
+ if type=='vertical'; links_guide_vertical_open
+ else links_guide_horizontal_open
+ end
+ end
+ def links_guide_close #(type='horizontal')
+ insert=''
+ insert=@vz.banner_home_guide if @md.sfx_src =~/lm?/
+ #insert=@vz.banner_home_guide if @md.sfx_src =~/s?/
+ insert=if @md.sfx_src =~/s?/
+ link='http://www.jus.uio.no/sisu' #get from defaults
+ url='www.jus.uio.no/sisu'
+ name='SiSU electronic documents' #get from defaults
+ #name='SiSU electronic documents/books' #get from defaults
+ insert= %{ <li class="refbold">
+ <a href="#{link}" alt="#{name}" target="_top">
+ #{name}
+ </a>
+ </li>
+ <li class="ref">
+ <a href="#{link}" alt="#{name}" target="_top">
+ #{url}
+ </a>
+ </li>
+ </ul>
+</div>}
+ end
+ %{ #{insert}
+<!- quick ref -!>}
+ end
+ def prefix_a
+ end
+ def rights
+ rights=@md.dc_rights.gsub(/^\s*Copyright\s+/,'<sup>&copy;</sup>&nbsp;')
+ %{<p class="left">#{rights}</p>
+<p />}
+ end
+ def prefix_b
+ %{<table summary="prefix">
+<tr>
+<td width=10%>&nbsp;</td>
+<td width=80%>
+ #{@md.prefix_b}
+#{@vz.table_close}
+<p />}
+ end
+ def scroll_head_title_banner_open
+ %{<center>
+#{@md.icon}
+</center>
+#{@vz.banner_instrument_cover_band_scr}}
+ end
+ def seg_head_title_banner_open
+ %{<center>
+ #{@md.icon}
+</center>
+#{@vz.banner_instrument_cover_band_seg}}
+ end
+ def make_scroll
+ concord=concordance_link(@vz.nav_txt_concordance)
+ %{<table summary="toc scroll" border="0" cellpadding="3" cellspacing="0">
+<tr><td align="center" bgcolor="white" border="0">
+ #{@vz.nav_txt_doc_link}
+</td>
+<td align="center" bgcolor="white">
+ #{concord}
+#{@vz.table_close}}
+ end
+ def make_seg
+ concord=concordance_link(@vz.nav_txt_concordance)
+ %{<table summary="toc segment" border="0" cellpadding="3" cellspacing="0">
+<tr><td align="center" bgcolor="white">
+ #{@vz.nav_txt_toc_link}
+</td>
+<td align="center" bgcolor="white">
+ <font size=2>
+ #{concord}
+#{@vz.table_close}}
+ end
+ def manifest #check structure
+ manifest=manifest_link(@vz.nav_txt_manifest)
+ %{#{@vz.margin_txt_3}
+ #{@vz.paragraph_font_small}
+ #{manifest}
+ </font>
+#{@vz.table_close}}
+ end
+ def concordance #check structure
+ concord=concordance_link(@vz.nav_txt_concordance)
+ %{#{@vz.margin_txt_3}
+ #{@vz.paragraph_font_small}
+ #{concord}
+ </font>
+#{@vz.table_close}}
+ end
+ def metadata
+ %{#{@vz.margin_txt_3}
+#{@vz.paragraph_font_small}
+ <a href="#@metalink" #{@vz.js_metalink}>
+ <i>MetaData</i>
+ <font size="1" color="#777777">
+ &nbsp;&nbsp;&nbsp;
+ </font>
+ </a>
+ </font>
+#{@vz.table_close}}
+ end
+ def seg_metadata
+ @metalink=%{./#{@md.fn[:metadata]}}
+ metadata
+ end
+ def seg_tail
+ %{<p>&nbsp;<p>
+<table summary="toc segment tail" bgcolor=#{@vz.color_band1}>
+<tr><td width="20%">
+ #{@vz.banner_band}
+</td>
+<td width="60%">
+ <center>
+ #{@tocband_segtoc}
+ </center>
+</td></tr>
+</table>
+<p>&nbsp;</p>
+#{@vz.credits_splash}
+<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"></a>}
+ end
+ def scroll_tail
+ nav=scroll_head_navigation_band
+ %{#{nav}
+#{@vz.credits_splash}
+<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"></a>}
+ end
+ def seg_navigation_tail #this is a bug area, look up and "tidy"
+ #nav=scroll_head_navigation_band
+ %{<p>&nbsp;</p>
+#{@vz.credits_splash}
+<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"></a>}
+ end
+ end
+ def html_close
+ %{</body>
+</html>}
+ end
+ class Head_scroll < Head_toc
+ def initialize(md)
+ super(md)
+ end
+ def toc_owner_details
+ %{#{@vz.margin_txt_3}
+#{@vz.paragraph_font_small}
+ <a href="#owner.details">
+ Owner Details
+ <font size="1" color="#777777">
+ &nbsp;&nbsp;&nbsp;
+ </font>
+ </a>
+ </font>
+#{@vz.table_close}}
+ end
+ def table
+ %{<table summary="scroll table" width=#{@vz.table_width_1} border="0" bgcolor="white" cellpadding="0">
+<tr><th width=#{@@indent['level_1']} align="right">
+</th>
+<td valign="top">
+#{@vz.paragraph_txt}}
+ end
+ def table1
+ %{<table summary="scroll table1" width=#{@vz.table_width_1} border="0" cellpadding=#{@vz.table_cellpad_box} #{@vz.color_color_table1} align="justify">
+<tr><td valign="top">
+#{@vz.paragraph_txt}}
+ end
+ def table2
+ %{<table summary="scroll table2" width=#{@vz.table_width_1} border="0" cellpadding=#{@vz.table_cellpad_box} #{@vz.color_color_table2} align="justify">
+<tr><td valign="top">
+#{@vz.paragraph_txt}}
+ end
+ def toc_endnote
+ %{#{@vz.margin_txt_3}
+#{@vz.paragraph_font_small}
+ <a href="#endnotes">
+ Endnotes
+ </a>
+#{@vz.table_close}}
+ end
+ def title_endnote
+ %{#{@vz.margin_txt_0}
+ #{@vz.paragraph_txt}
+ <br />
+ <a name="endnotes" id="endnotes"></a>
+ <b>Endnotes</b>
+#{@vz.margin_num}
+ &nbsp;
+#{@vz.table_close}}
+ end
+ def tail
+ %{<br />
+#{@vz.margin_txt_0}
+<table summary="scroll tail" bgcolor="#777777">
+<tr><td width="20%">
+#{@vz.banner_band}
+</td>
+<td width="60%">
+<center>#@tocband_scroll</center>
+</td></tr>
+</table>
+<br />
+#{@vz.paragraph_txt}
+ <center>
+ #{@vz.credits_splash}
+ </center>
+#{@vz.margin_num}
+#{@vz.table_close}
+<a name="bottom id="finish"></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>
+<font color="white" size="0">
+ #{@md.title*10}
+</font>
+</body>
+</html>}
+ end
+ end
+ class Head_seg < Head_information
+ def initialize(md)
+ super(md)
+ end
+ def head
+ %{#{doc_type}
+<head>
+ <title>
+ #{@seg_name_html[@seg_name_html_tracker]} -
+ #{@md.html_title}
+ </title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+#{@rdf.rdfseg}
+#{@rdf.metatag_html}
+#{@vz.font_css_table_file}
+</head>
+#{@vz.color_body}
+<a name="top" id="top"></a>
+<a name="up" id="up"></a>
+<a name="start" id="start"></a>
+#{@vz.js_top}}
+ end
+ def title_banner(title,subtitle,creator)
+ end
+ def dot_control_pre_next
+ %{<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center">
+<tr><td align="left">
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker-1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_prev}>
+ #{@vz.png_nav_dot_pre}
+ </a>
+</td>
+<td align="center">
+ <a href="#{@md.fnl[:pre]}#@index#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_toc}>
+ #{@vz.png_nav_dot_toc}
+ </a>
+</td>
+<td align="right">
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_next}>
+ #{@vz.png_nav_dot_nxt}
+ </a>
+#{@vz.table_close}}
+ end
+ def dot_control_pre
+ %{<table summary="segment hidden control pre" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center">
+<tr><td align="left">
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker-2]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_prev}>
+ #{@vz.png_nav_dot_pre}
+ </a>
+</td>
+<td align="center">
+ <a href="#{@md.fnl[:pre]}#@index#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_toc}>
+ #{@vz.png_nav_dot_toc}
+ </a>
+</td>
+<td align="right">
+ <a href="#{@md.fn[:toc]}" target="_top" #{@vz.js_next}>
+ #{@vz.png_nav_dot_nxt}
+ </a>
+#{@vz.table_close}}
+ end
+ def toc_nav(f_pre=false,f_nxt=false,use=1)
+ pre=nxt=''
+ toc=%{<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#@index#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_toc}>
+ #{@vz.png_nav_toc}
+ </a>
+</td>}
+ pre=%{<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker-use]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_prev}>
+ #{@vz.png_nav_pre}
+ </a>
+</td>} if f_pre==true
+ nxt=%{<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_next}>
+ #{@vz.png_nav_nxt}
+ </a>
+</td>} if f_nxt==true
+ %{<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
+<tr>
+#{pre}
+#{toc}
+#{nxt}
+<td>
+#{@vz.table_close}}
+ end
+ def toc_next2
+ pre,nxt=false,true
+ toc_nav(false,true).dup
+ end
+ def toc_pre_next2
+ toc_nav(true,true).dup
+ end
+ def toc_pre2
+ toc_nav(true,false,2).dup
+ end
+ def manifest_link(text)
+ %{<font size=2>
+ <a href="#{@md.fn[:manifest]}" target="_top" #{@vz.js_manifest}>
+ #{text}
+ </a>
+ </font>}
+ end
+ def concordance_link(text)
+ if @md.concord_make
+ %{<font size=2>
+ <a href="#{@md.fn[:concordance]}" target="_top" #{@vz.js_concordance}>
+ #{text}
+ </a>
+ </font>}
+ else ''
+ end
+ end
+ def doc_types #used in seg_nav_band ###
+ scroll=seg=''
+ wgt=Widget.new(@md)
+ #dir=SiSU_Env::Info_env.new(@md.fns)
+ %{
+<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
+<tr>
+ #{wgt.seg(@vz.nav_txt_toc_link)}
+ #{wgt.scroll(@vz.nav_txt_doc_link)}
+ #{wgt.pdf}#{wgt.odf}
+<td align="center" bgcolor=#{@vz.color_band2}>
+ #{wgt.concordance(@vz.nav_txt_concordance)}
+ #{wgt.manifest}
+ #{wgt.search}
+ #{wgt.home}
+</tr></table>}
+ end
+ def toc_pre_next3 #used with seg_doc_types in seg_nav_band #with pdf & other doc types #knxjs
+ %{<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
+<tr><td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker-1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_prev}>
+ #{@vz.png_nav_previous}
+ </a>
+</td>
+<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#@index#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_toc}>
+ #{@vz.png_nav_toc}
+ </a>
+</td>
+<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_next}>
+ #{@vz.png_nav_next}
+ </a>
+#{@vz.table_close}}
+ end
+ def toc_next3 #used with seg_doc_types in seg_nav_band #with pdf & other doc types #knxjs
+ %{<table summary="segment navigation next" border="0" cellpadding="3" cellspacing="0">
+<tr>
+<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#@index#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_toc}>
+ #{@vz.png_nav_toc}
+ </a>
+</td>
+<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_next}>
+ #{@vz.png_nav_next}
+ </a>
+#{@vz.table_close}}
+ end
+ def toc_pre3 #used with seg_doc_types in seg_nav_band #with pdf and other doc types #knxjs
+ # note endnotes is now two back, with insertion between end of text and metadata, but what happens where no endnote?
+ %{<table summary="segment navigation pre" border="0" cellpadding="3" cellspacing="0">
+<tr><td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker-2]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_prev}>
+ #{@vz.png_nav_previous}
+ </a></td>
+<td align="center" bgcolor=#{@vz.color_band1}>
+ <a href="#{@md.fnl[:pre]}#@index#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_toc}>
+ #{@vz.png_nav_toc}
+ </a>
+#{@vz.table_close}}
+ end
+ def toc_endnote
+ end
+ def title_endnote(title,subtitle,creator,table_top_control)
+ %{#{@vz.banner_instrument_cover_band_seg}
+ <h1 class="banner">
+ #{title}
+ </h1>
+ <h1 class="subbanner">
+ #{subtitle}
+ </h1>
+ <h1 class="subbanner">
+ #{creator}
+ </h1>
+ <h4 class="banner">
+ Endnotes
+ </h4>
+#{@vz.table_close}
+#{table_top_control}
+<h1>Endnotes</h1>}
+ end
+ def navigation_table
+ %{<table summary="navigation segment table" width=#{@vz.table_width_1} border="0" bgcolor="white" cellpadding="0">
+<tr><th width="#{@@indent['leve_1']}" align="right">
+</td>
+<td valign="top">
+ <font size=2>}
+ end
+ def navigation_table1
+ %{<table summary="navigation segment table1" width=#{@vz.table_width_1} border="0" cellpadding=#{@vz.table_cellpad_box} bgcolor=#{@vz.color_table1} align="left">
+<tr><td valign="top">
+ <font size="2">}
+ end
+ def navigation_table2
+ %{<table summary="navigation segment table2" width=#{@vz.table_width_2} border="0" cellpadding=#{@vz.table_cellpad_box} bgcolor=#{@vz.color_table2} align="left">
+<tr><td valign="top">
+ <font size="2">}
+ end
+ def header_advert_local_1
+ dir=SiSU_Env::Info_env.new(@fns)
+ %{ <center>
+<table summary="image" border="0" cellpadding="3" cellspacing="0" align="center">
+<tr><td align="center" bgcolor="white">
+ <a href="http://#{@md.ad_url}#@sfx" target="_top">
+ <img border="0" src="#{dir.url.images_local}/#{@md.ad_png}" alt="#{@md.ad_alt}">
+ </a>
+ <p />
+#{@vz.table_close}
+</center>}
+ end
+ def header_advert_local_2
+ dir=SiSU_Env::Info_env.new(@fns)
+ %{ <center>
+<table summary="image" border="0" cellpadding="3" cellspacing="0" align="center">
+<tr><td align="center" bgcolor="white">
+ <a href="#{@md.ad_url}#@sfx" target="_top">
+ <img border="0" src="#{dir.url.images_local}/#{@md.ad_png}" alt="#{@md.ad_alt}">
+ </a>
+ <p />
+#{@vz.table_close}
+</center>}
+ end
+ def header_advert_external
+ dir=SiSU_Env::Info_env.new(@fns)
+ %{ <center>
+<table summary="image" border="0" cellpadding="3" cellspacing="0" align="center">
+<tr><td align="center" bgcolor="white">
+ <a href="#{@md.ad_url}#@sfx" target="external">
+ <img border="0" src="#{dir.url.images_local}/#{@md.ad_png}" alt="#{@md.ad_alt}">
+ </a>
+ <p />
+#{@vz.table_close}
+</center>}
+ end
+ def credit
+ %{<br/>
+#{@vz.credits_splash}
+<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>}
+ end
+ def navigation_band(segtocband,seg_table_top_control)
+ %{<table summary="segment navigation band" bgcolor=#{@vz.color_band1} width="100%"><tr>
+<td width="20%" align="left">
+#{@vz.banner_band}
+</td>
+<td width="60%" align="center">
+ #{doc_types}
+</td>
+<td width="20%" align="right">
+ #{segtocband}
+</td></tr>
+</table>
+#{seg_table_top_control}}
+ end
+ def endnote_mark
+%{<p class="center" id="endnotes">
+<a href="#top">^</a></p>}
+ end
+ end
+ class Format_text_object
+ @vz=SiSU_Env::Get_init.instance.skin
+ @@dp=nil
+ attr_accessor :md,:one,:two,:three,:parablock,:table,:link,:linkname,:format,:paranum,:p_num,:para_id,:headname,:margin,:paragraph,:table,:banner,:url,:icon,:font,:one_stripped
+ def initialize(md='',*txt)
+ #txt[0].gsub!(/\.(html|pdf|php)/,'') if txt[0] =~/\.\.\/\S+/
+ @md,@one,@two,@three=md,txt[0],txt[1],txt[2]
+ rgx=/^[1-6-]~/
+ @one_stripped=@one.gsub(rgx,'') if @one =~rgx
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ rgx=/~[{\[][\d*+]+\s+(.+?)<#@dp>[}\]]~/ #problem introduced
+ @one_stripped=@one.gsub(rgx,'\1') if @one =~rgx #problem introduced
+ @link,@linkname=txt[0],txt[1]
+ @format,parablock=txt[0],txt[1]
+ @parablock=parablock
+ ##speed hit does not justify action:
+ #@parablock=if parablock=~/\S+/ and parablock !~/<!Th?¡ /m
+ # wrap=SiSU_text_utils::Wrap.new(parablock,70,4)
+ # wrap.line_wrap
+ #else parablock
+ #end
+ if txt[2]=~/\d+/
+ @paranum=txt[2][/(\d+)/m,1] # unless paranum =~/#/
+ @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,@paranum)
+ @para_id=Paragraph_id_ocn.new(@md,@paranum) #used by table version
+ end
+ @headname=''
+ if @format =~ /\d~(\S+)/
+ headname=$1 #format[/\d~(\S+)/m,1]
+ @headname=if headname =~/^[a-zA-Z]/; %{<a name="#{headname}" id="#{headname}"></a>} #consider: h_#{headname}
+ else %{<a name="h#{headname}" id="h#{headname}"></a>}
+ end
+ end
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def para_form # regular paragraphs shaped here
+ ul=ulc=''
+ ul,ulc="<ul>\n ","\n </ul>" if @tag =~/li/
+ %{#{@vz.margin_css}
+ #{ul}<#@tag class="#@class" #{@p_num.id}>#{@p_num.name}
+ #@parablock
+ </#@tag>#{ulc}
+#{@vz.margin_num_css}
+ #{@p_num.ocn_display}
+#{@vz.table_close}
+}
+ end
+ def para
+ @tag,@class='p','norm'
+ para_form
+ end
+ def code
+ @tag,@class='p','code'
+ para_form
+ end
+ def center
+ @tag,@class='p','center'
+ para_form
+ end
+ def bold
+ @tag,@class='p','bold'
+ para_form
+ end
+ def bullet
+ @tag,@class='li','bullet'
+ para_form
+ end
+ def bullet_indent1
+ @tag,@class='li','i1'
+ para_form
+ end
+ def bullet_indent2
+ @tag,@class='li','i2'
+ para_form
+ end
+ def indent1
+ @tag,@class='p','i1'
+ para_form
+ end
+ def indent2
+ @tag,@class='p','i2'
+ para_form
+ end
+ def dl
+ "<dl><b>#@one</b> #@two</dl>"
+ end
+ def table_end #<!TZ!>
+ %{</table>
+ #{@vz.margin_num_css.strip}
+ #{@p_num.ocn_display}
+ #{@vz.table_close}}
+ end
+ def no_paranum
+ %{#{@vz.margin_css}
+#{@vz.paragraph_txt}
+ #@one #@two
+#{@vz.margin_num}
+#{@vz.table_close}}
+ end
+ def gsub_body
+ case @one
+ when /^(?:<:i[12]>\s*)?\((i+|iv|v|vi+|ix|x|xi+)\)/
+ @one.gsub!(/^\((i+|iv|v|vi+|ix|x|xi+)\)/,'<b>(\1)</b>')
+ @one.gsub!(/^(<:i[12]>)\s*\((i+|iv|v|vi+|ix|x|xi+)\)/,'\1<b>(\2)</b>')
+ when /^(?:<:i[12]>\s*)?\(?(\d|[a-z])+\)/
+ @one.gsub!(/^\((\d+|[a-z])+\)/,'<b>(\1)</b>')
+ @one.gsub!(/^(<:i[12]>)\s*\((\d+|[a-z])+\)/,'\1<b>(\2)</b>')
+ when /^\s*\d{1,3}\.\s/
+ @one.gsub!(/^\s*(\d+\.)/,'<b>\1</b>')
+ when /^\s*[A-Z]\.\s/
+ @one.gsub!(/^\s*([A-Z]\.)/,'<b>\1</b>')
+ end
+ end
+ def bold_para
+ %{#{@vz.margin_txt_0}
+ <p class="bold">
+ #@one
+ </p>
+#{@vz.margin_num_css}
+ &nbsp;&nbsp;&nbsp;
+#{@vz.table_close}}
+ end
+ def toc_head_copy_at
+ %{<p class="center">#@one</p>\n}
+ end
+ def center
+ %{<p class="center">#@one</p>\n}
+ end
+ def bold
+ %{<p class="bold">#@one</p>\n}
+ end
+ def center_bold
+ %{<p class="centerbold">#@one</p>\n}
+ end
+ end
+ class XML
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/html_format_css.rb b/lib/sisu/0.52/html_format_css.rb
new file mode 100644
index 00000000..4e519a41
--- /dev/null
+++ b/lib/sisu/0.52/html_format_css.rb
@@ -0,0 +1,473 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: html formating, css template
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML_Format_type
+ require SiSU_lib + '/html_format'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ include SiSU_HTML_Format
+ class Head_toc < SiSU_HTML_Format::Head_toc
+ def initialize(md='')
+ super(md)
+ end
+ def head
+ %{#{doc_type}
+<head>
+ <title>
+ #{@md.html_title}
+ </title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+#{@rdf.rdftoc}
+#{@rdf.metatag_html}
+#{@css.html}
+</head>
+#{@vz.color_body}
+<a name="top" id="top"></a>
+<a name="up" id="up"></a>
+<a name="start" id="start"></a>
+#{@vz.js_top}}
+ end
+ def concordance
+ if @md.concord_make
+ %{#{@vz.margin_css}
+ <h4 class="toc">
+ <a href="./#{@md.fn[:concordance]}" #{@vz.js_concordance}>
+ <i>Concordance</i>
+ </a>
+ </h4>
+#{@vz.table_close}}
+ else
+ %{#{@vz.margin_css}
+#{@vz.table_close}}
+ end
+ end
+ def metadata
+ %{#{@vz.margin_css}
+ <h4 class="toc">
+ <a href="#@metalink" #{@vz.js_metalink}>
+ <i>MetaData</i>
+ </a>
+ </h4>
+#{@vz.table_close}}
+ end
+ end
+ class Head_seg < SiSU_HTML_Format::Head_seg
+ def initialize(md='')
+ super(md)
+ end
+ def head
+ %{#{doc_type}
+<head>
+ <title>
+ #{@seg_name_html[@seg_name_html_tracker]} -
+ #{@md.html_title}
+ </title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+#{@rdf.rdfseg}
+#{@rdf.metatag_html}
+#{@css.html}
+</head>
+#{@vz.color_body}
+<a name="top" id="top"></a>
+<a name="up" id="up"></a>
+<a name="start" id="start"></a>
+#{@vz.js_top}}
+ end
+ def toc_metadata
+ @metalink=%{./#{@md.fn[:meatadata]}}
+ toc_metadata
+ end
+ def title_banner(title,subtitle,creator)
+ %{<p class="tiny">
+ #{title}
+ </p>
+ <p class="tiny">
+ #{subtitle}
+ </p>
+ <p class="tiny">
+ #{creator}
+ </p>
+ <p class="tiny">
+ copy @
+ <a href="#{@vz.url_home}">
+ #{@vz.txt_home}
+ </a>
+ </p>}
+ end
+ end
+ class Head_scroll < SiSU_HTML_Format::Head_scroll
+ def initialize(md='')
+ super(md)
+ end
+ def toc_endnote
+ %{#{@vz.margin_css}
+ <h4 class="toc">
+ <a href="#endnotes">
+ Endnotes
+ </a>
+ </h4>
+#{@vz.table_close}}
+ end
+ end
+ class Format_scroll < SiSU_HTML_Format::Format_text_object
+ def initialize(md='',*txt)
+ super(md,*txt)
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def indent_one_no_paranum
+ %{#{@vz.margin_txt_1}
+#{@paragraph.txt}
+ #@one
+#{@vz.margin_num}
+#{@vz.table_close}}
+ end
+ def indent_two_no_paranum
+ %{#{@vz.margin_txt_1}
+#{@paragraph.txt}
+ #@one
+#{@vz.margin_num}
+#{@vz.table_close}}
+ end
+ def endnote_body
+ %{#{@vz.margin_css}
+ <p class="endnote">
+ #@one
+ </p>
+#{@vz.margin_num_css}
+ &nbsp;
+#{@vz.table_close}}
+ end
+ def header_normal
+ %{#{@vz.margin_css}
+ <#@tag class="#@class" #{@p_num.id}>#{@p_num.name}
+ #@headname
+ #@parablock
+ </#@tag>
+#{@vz.margin_num_css}
+ #{@p_num.ocn_display}
+#{@vz.table_close}}
+ end
+ def heading_body
+ @tag,@class='p','norm'
+ header_normal
+ end
+ def heading_body1
+ @tag,@class='h1','norm'
+ header_normal
+ end
+ def heading_body2
+ @tag,@class='h2','norm'
+ header_normal
+ end
+ def heading_body3
+ @tag,@class='h3','norm'
+ header_normal
+ end
+ def heading_body4
+ @tag,@class='h4','norm'
+ header_normal
+ end
+ def heading_body5
+ @tag,@class='h5','norm'
+ header_normal
+ end
+ def heading_body6
+ @tag,@class='h6','norm'
+ header_normal
+ end
+ end
+ class Format_seg < SiSU_HTML_Format::Format_text_object
+ def initialize(md='',*txt)
+ super(md,*txt)
+ end
+ def navigation_para
+ %{#{@vz.margin_css}
+#{@paragraph.txt}
+ #@one
+</p>
+#{@vz.table_close}}
+ end
+ def navigation_toc_lev1_advert
+ %{#{@banner.home_button}\n
+<center>
+#@one
+#@two
+</a></center><p />}
+ end
+ def navigation_toc_lev1
+ %{#{@banner.nav_toc}}
+ end
+ def navigation_toc_lev2 #change bold use css
+ %{<p />
+<table summary="navigation segment level 2">
+<tr><td width ="20">
+</td>
+<td>
+ <font size="3" #{@vz.font_face}>
+ <b>#@one</b>
+ </font>
+ </p>
+#{@vz.table_close}}
+ end
+ def navigation_toc_lev3 #change bold use css
+ %{<p />
+<table summary="navigation segment level 3">
+<tr><td width ="20">
+</td>
+<td>
+ <font size="3" #{@vz.font_face}>
+ <b>#@one</b>
+ </font>
+ </p>
+#{@vz.table_close}}
+ end
+ def navigation_toc_lev4
+ %{<table summary="navigation segment level 4">
+<tr><td width ="80">
+</td>
+<td>
+<p>
+ #@one
+</p>
+#{@vz.table_close}}
+ end
+ def navigation_toc_lev5
+ end
+ def navigation_toc_lev6
+ end
+ def endnote_body_seg_tail
+ %{#{@vz.margin_css}
+ <p class="endnote">
+ #@one
+ </p>
+#{@vz.margin_num_css}&nbsp;
+#{@vz.table_close}}
+ end
+ def endnote_body_seg_tail_indent
+ %{#{@vz.margin_css}
+ <p class="endnote_indent">
+ #@one
+ </p>
+#{@vz.margin_num_css}&nbsp;
+#{@vz.table_close}}
+ end
+ def endnote_seg_body(fn='') #url construction keep within single line... BUG WATCH 200408
+ fn='doc' if fn.empty? #you may wish to reconsider, sends to 'doc' where no segment info
+ %{#{@vz.margin_css}
+ <p class="endnote">
+ #@one#{@md.fnl[:pre]}#{fn}#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}#@two#@three
+ </p>
+#{@vz.margin_num_css}&nbsp;
+#{@vz.table_close}}
+ end
+ def title_header
+ %{#{@vz.margin_css}
+ <#@tag class="#@class">
+ #@one
+ </#@tag>
+#{@vz.margin_num_css}&nbsp;
+#@two
+#{@vz.table_close}}
+ end
+ def title_header1
+ @tag,@class='h1','banner'
+ title_header
+ end
+ def title_header2
+ @tag,@class='h2','banner'
+ title_header
+ end
+ def title_header3
+ @tag,@class='h3','banner'
+ title_header
+ end
+ def title_header4
+ %{#{@vz.margin_css}
+ <h4 class="banner">
+ #@one
+ </h4>
+#{@vz.margin_num_css}&nbsp;
+#{@vz.table_close}}
+ end
+ def subtoc_lev
+ one=if @one and @one =~/<\/?i>|<a\s+name="\S+?">/mi
+ @one.gsub(/<\/?i>|<a\s+name="\S+?">/mi,'') #removes name markers from subtoc, go directly to substantive text
+ else @one
+ end
+ note=''
+ if one =~/(~[{\[].+?[}\]]~\s*)/m #this is a clumsy fix, revisit and address upstream
+ note=$1
+ note.gsub!(/[\n\s]+/m,' ')
+ one.gsub!(/~[{\[].+?[}\]]~\s*/m,' ')
+ one.gsub!(/<a[\n\s]+name="-\d+"[\n\s]+href="#_\d+">&nbsp;<sup>\d+<\/sup>&nbsp;/m,'')
+ end
+ %{<#@tag class="#@class">
+ <a href="##@two">
+ <i>#{one}</i>
+ </a> #{note}
+ </#@tag>}
+ end
+ def subtoc_lev5
+ @tag,@class='h5','subtoc'
+ subtoc_lev if @one
+ end
+ def subtoc_lev6
+ @tag,@class='h6','subtoc'
+ subtoc_lev if @one
+ end
+ #% para sisu
+ def header4
+ %{#@format
+#{@vz.margin_css}
+ <h1 class="norm" #{@p_num.id}>#{@p_num.name}
+ #@format
+ #@parablock
+ </h1>
+#{@vz.margin_num_css}
+#{@p_num.ocn_display}
+#{@vz.table_close}}
+ end
+ def header_sub
+ @parablock.gsub!(/~[{\[].+?[}\]]~\s*/m,' ')
+ %{#{@vz.margin_css}
+#{@headname}
+ <#@tag class="#@class" #{@p_num.id}>#{@p_num.name}
+ #{@parablock}
+ </#@tag>
+#{@vz.margin_num_css}
+#{@p_num.ocn_display}
+#{@vz.table_close}}
+ end
+ def header5
+ @tag,@class='p','bold'
+ header_sub
+ end
+ def header6
+ @tag,@class='p','bold'
+ header_sub
+ end
+ def navigation_header4
+ %{<table summary="navigation segment header 4" width=100% bgcolor="#08163f" border="0">
+<tr><td align="center">
+<p class="bold">
+ #@parablock
+</p>
+#{@vz.table_close}}
+ end
+ def navigation_header5
+ %{<p class="bold">
+ #@parablock
+</p>}
+ end
+ def navigation_header6
+ %{<p class="bold">
+ #@parablock
+</p>}
+ end
+ def navigation_indent1
+ %{#{@vz.margin_txt_00_1}
+#{@paragraph.txt_00}
+ #@parablock
+ </font>
+ </p>
+#{@vz.margin_num_css}&nbsp;
+#{@vz.table_close}}
+ end
+ def navigation_indent2
+ end
+ def navigation_center
+ "<center>#@parablock</center>"
+ end
+ end
+ class Format_toc < SiSU_HTML_Format::Format_text_object
+ def initialize(md='',*txt)
+ super(md,*txt)
+ end
+ def links_guide
+ #@three distinguishes between _top and external, can be used e.g. for different colour scheme
+ %{ <li class="doc">
+ <a href="#@link" target="_top">
+ #@linkname
+ </a>
+ </li>
+}
+ end
+ def lev
+ %{<#@tag class="#@class">
+ #@one
+ </#@tag>
+}
+ end
+ def lev1
+ @tag,@class='h1','toc'
+ lev
+ end
+ def lev2
+ @tag,@class='h2','toc'
+ lev
+ end
+ def lev3
+ @tag,@class='h3','toc'
+ lev
+ end
+ def lev4
+ @tag,@class='h4','toc'
+ lev
+ end
+ def lev5
+ @tag,@class='h5','toc'
+ lev
+ end
+ def lev6
+ @tag,@class='h6','toc'
+ lev
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/html_promo.rb b/lib/sisu/0.52/html_promo.rb
new file mode 100644
index 00000000..b41b1ffa
--- /dev/null
+++ b/lib/sisu/0.52/html_promo.rb
@@ -0,0 +1,382 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: html advertising component, build here, mockup
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML_promo
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ class Ad
+ def initialize(md)
+ @md=md
+ @env=SiSU_Env::Info_env.new(@md.fns,@md)
+ @rc=SiSU_Env::Get_init.instance.yamlrc
+ @ad=SiSU_Env::Get_init.instance.ads
+ @vz=SiSU_Env::Get_init.instance.skin
+ @flag=@env.widget.promo?
+ end
+ def div
+ def major
+ @flag[:ad] ? '<div id="pane_major">' : ''
+ end
+ def minor
+ @flag[:ad] ? '<div id="pane_minor">' : ''
+ end
+ def close
+ @flag[:ad] ? '</div>' : ''
+ end
+ self
+ end
+ def display #(type=nil,id=nil)
+ ads_array,promo_array=[],[]
+ if @flag[:ad]
+ ads=if @md.promo && @md.promo.length > 0 #promo set in document
+ promo_array=@md.promo
+ elsif @flag[:sk] #promo set in associated skin
+ promo_array=@vz.widget_promo
+ elsif @flag[:rc] #promo set in rc file
+ promo_array=if @rc['promo'].class == String
+ @rc['promo'].split(/[,;]\s*/)
+ else @rc['promo']
+ end
+ else advert_extract_all
+ end
+ ads=if promo_array.length > 0
+ promo_array.each do |x|
+ ads_array << advert_extract_subject(x)
+ end
+ ads_array
+ end
+ adverts(ads)
+ #else no_adverts
+ end
+ end
+ def cell(prod,id)
+ @prod,@id=prod,id
+ def title
+ @prod['title'] ? %{<b>#{@prod['title']}</b>} : ''
+ end
+ def subtitle
+ @prod['subtitle'] ? %{ - #{@prod['subtitle']}} : ''
+ end
+ def author
+ @prod['author'] ? %{<p class="pane">#{@prod['author']}</p>} : ''
+ end
+ def editor
+ @prod['editor'] ? %{<p class="pane">#{@prod['editor']}</p>} : ''
+ end
+ def year
+ @prod['year'] ? %{<p class="pane">#{@prod['year']}</p>} : ''
+ end
+ def date
+ @prod['date'] ? %{<p class="pane">On: #{@prod['date']}</p>} : ''
+ end
+ def location
+ @prod['at'] ? %{<p class="pane">At: #{@prod['at']}</p>} : ''
+ end
+ def pages
+ @prod['pages'] ? %{<p class="pane">Pages: #{@prod['pages']} pages</p>} : ''
+ end
+ def form
+ @prod['form'] ? %{<p class="pane">#{@prod['form']}</p>} : ''
+ end
+ def nick
+ @prod['nick'] ? %{(#{@prod['nick']})<br />} : ''
+ end
+ def update
+ @prod['update'] ? %{<p class="pane">Updated: #{@prod['update']}</p>} : ''
+ end
+ def issn
+ @prod['issn'] ? %{<p class="pane">issn: #{@prod['issn']}</p>} : ''
+ end
+ def blurb
+ @prod['blurb'] ? %{<p class="pane_blurb">#{@prod['blurb']}</p>} : ''
+ end
+ def search_form
+ db=if @prod['db']=~/\S+/
+ @prod['db']=~/^SiSU_\S+/ ? @prod['db'] : "SiSU_#{@prod['db']}"
+ elsif defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ @rc['search']['db']=~/^SiSU_\S+/ ? @prod['search']['db'] : "SiSU_#{@prod['db']}"
+ else nil
+ end
+ #target=@prod['target']=~/^\S+/ ? @prod['target'] : '_top'
+ action=if @prod['action']=~/^http:\/\//
+ @prod['action']
+ elsif defined? @rc['search']['action'] and @rc['search']['action'] =~/^http:\/\//
+ @rc['search']['action']
+ else nil
+ end
+ form=if action and db
+ '<br />' + @env.widget.search_form(action,db)
+ else ''
+ end
+ end
+ def links
+ if @prod['links'] #and @prod['links'] == Array
+ links_a=[]
+ @prod['links'].each do |x|
+ if x and x['url'] and x['title']
+ subtitle=x['subtitle'] ? %{ - #{x['subtitle']}} : ''
+ url_=x['url'] =~/http:/ ? x['url'] : "../#{x['url']}"
+ #url_=x['url'] =~/http:/ ? x['url'] : "#{@env.url.root}/#{x['url']}"
+ links_a << %{<p class="pane_link"><a href="#{url_}">#{x['title']}#{subtitle}</a></p>\n}
+ end
+ end
+ links_a.to_s
+ else ''
+ end
+ end
+ def image
+ @prod['image'] ? %{<img border="0" src="../_sisu/image_local/#{@prod['image']}" /><br />} : ''
+ end
+ def url_link
+ @url_=if @prod['url'] =~/http:/
+ "#{@prod['url']}"
+ else "../#{@prod['url']}" # "#{@env.url.root}/#{@prod['url']}"
+ end
+ def show
+ @prod['url'] ? %{<p class="pane_link"><a href="#@url_">#@url_</a></p>} : ''
+ end
+ def url
+ @prod['url'] ? %{<a href="#@url_">} : ''
+ end
+ def url_relative
+ @prod['url'] ? %{<a href="../#{@prod['url']}/toc.html">} : ''
+ end
+ self
+ end
+ def flyer
+ if @prod['flyer']
+ %{<p class="pane"><a href="../man/pdf/#@id.pdf"><img border="0" height="18" width="15" src="../_sisu/image/b_pdf.png">&nbsp;PDF&nbsp;flyer</a></p>}
+ else ''
+ end
+ end
+ def price
+ def gbp
+ if defined? @prod['price']['gbp'] and @prod['price']['gbp']
+ " &nbsp;&pound;&nbsp;#{@prod['price']['gbp']}&nbsp;(GBP)&nbsp;"
+ else ''
+ end
+ end
+ def euro
+ if defined? @prod['price']['euro'] and @prod['price']['euro']
+ " &nbsp;&euro;&nbsp;#{@prod['price']['euro']}&nbsp;(Euro)&nbsp;"
+ else ''
+ end
+ end
+ def usd
+ if defined? @prod['price']['usd'] and @prod['price']['usd']
+ " &nbsp;$&nbsp;#{@prod['price']['usd']}&nbsp;(USD)&nbsp;"
+ else ''
+ end
+ end
+ %{<p class="pane">Price:#{gbp}#{euro}#{usd}</p>}
+ end
+ def site_link #Work area
+ if url_link.url
+ <<WOK
+<p class="pane">
+#{url_link.url}
+#{image}
+#{title}
+#{subtitle}
+</a>#{nick}</p>
+WOK
+ else
+ <<WOK
+<p class="pane">
+#{image}
+#{title}
+#{subtitle}
+</p>
+WOK
+ end
+ end
+ self
+ end
+ def output_form_sponsor(type,id)
+ cell=cell(@ad[:promo][type][id],prod_id)
+ prod_type=id=~/id_(?:[0-9x]){10,13}/i ? 'isbn' : 'id'
+ id_detail = %{<p class="pane">#{prod_type}: #{prod_id}</p>}
+ <<WOK
+<br />
+#{cell.site_link}
+#{cell.blurb}
+#{cell.links}
+WOK
+ end
+ def output_form_link(type,id)
+ prod_id=id.gsub(/id_/,'')
+ cell=cell(@ad[:promo][type][id],prod_id)
+ <<WOK
+<br />
+#{cell.site_link}
+#{cell.author}
+#{cell.year}
+#{cell.blurb}
+#{cell.links}
+WOK
+ end
+ def output_form_search(type,id)
+ prod_id=id.gsub(/id_/,'')
+ cell=cell(@ad[:promo][type][id],prod_id)
+ cell.search_form
+ end
+ def output_form_book(type,id)
+ prod_id=id.gsub(/id_/,'')
+ cell=cell(@ad[:promo][type][id],prod_id)
+ prod_type=id=~/id_(?:[0-9x]){10,13}/i ? 'isbn' : 'id'
+ id_detail = %{<p class="pane">#{prod_type}: #{prod_id}</p>}
+ <<WOK
+<br />
+#{cell.site_link}
+#{cell.author}
+#{cell.year}
+#{id_detail}
+#{cell.pages}#{cell.form}
+#{cell.price}
+#{cell.flyer}
+#{cell.blurb}
+#{cell.links}
+WOK
+ end
+ def output_form_journal(type,id)
+ prod_id=id.gsub(/id_/,'')
+ cell=cell(@ad[:promo][type][id],prod_id)
+ <<WOK
+<br />
+#{cell.site_link}
+#{cell.editor}
+#{cell.issn}
+#{cell.update}
+#{cell.form}
+#{cell.price.gsub(/Price:/,'Subscription:')}
+#{cell.flyer}
+#{cell.blurb}
+#{cell.links}
+WOK
+ end
+ def output_form_conference(type,id)
+ prod_id=id.gsub(/id_/,'')
+ cell=cell(@ad[:promo][type][id],prod_id)
+#translate date (dd month yyyy) from 2007-03-04 and ruby conversion
+ <<WOK
+<br />
+#{cell.site_link}
+#{cell.date}
+#{cell.location}
+#{cell.price}
+#{cell.flyer}
+#{cell.blurb}
+#{cell.links}
+WOK
+ end
+ def output_form_select(type,id)
+ case type
+ when /site/
+ output_form_link(type,id)
+ when /sponsor/
+ output_form_sponsor(type,id)
+ when /search/
+ output_form_search(type,id)
+ when /book/
+ output_form_book(type,id)
+ when /journal/
+ output_form_journal(type,id)
+ when /conference/
+ output_form_conference(type,id)
+ end
+ end
+ def advert_extract_single(type,id) #extracts single item of type with id
+ #type === book,journal,conference,sponsor
+ id=id.to_s.gsub(/^(\d)/,'id_\1')
+ if defined? @ad[:promo][type][id] and @ad[:promo][type][id]
+ output_form_select(type,id)
+ end
+ end
+ def advert_extract_subject(category) #extracts products from category/subject list
+ adverts=[]
+ if defined? @ad[:promo_list][category] and @ad[:promo_list][category]
+ @ad[:promo_list][category].keys.each do |type|
+ @ad[:promo_list][category][type].each do |i|
+ if i
+ id=i.to_s =~/^\d/ ? "id_#{i.to_s.strip}" : i.to_s.strip
+ gbp=usd=euro=nil
+ if defined? @ad[:promo][type][id] and not @ad[:promo][type][id].nil?
+ adverts << output_form_select(type,id)
+ end
+ end
+ end
+ end
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"category not found: #{category}")
+ tell.warn unless @md.cmd =~/q/
+ end
+ adverts.to_s
+ end
+ def advert_extract_all #extracts all products from list (which is broken down into categories)
+ adverts=[]
+ @ad[:promo_list].keys.each do |category|
+ adverts << advert_extract_subject(category)
+ end
+ adverts.flatten
+ end
+ def adverts(ads)
+ <<WOK
+#{div.minor}
+#{ads}
+#{div.close}
+WOK
+ end
+ def no_adverts
+ <<WOK
+#{div.minor}
+#{div.close}
+WOK
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/html_scroll.rb b/lib/sisu/0.52/html_scroll.rb
new file mode 100644
index 00000000..51a7a6c8
--- /dev/null
+++ b/lib/sisu/0.52/html_scroll.rb
@@ -0,0 +1,231 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: html scroll generation, processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML_scroll
+ require SiSU_lib + '/shared_html'
+ require SiSU_lib + '/html'
+ require SiSU_lib + '/html_promo'
+ class Scroll
+ @@dp=nil
+ def initialize(data='',md='')
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def songsheet
+ begin
+ scr=Scroll.new(@data,@md).markup
+ scr[:tails]=Scroll.new('',@md).tails
+ scr
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ protected
+ def markup
+ data=@data
+ @rcdc=false
+ @scr={ :body=>[],:metadata=>[],:owner_details=>[] }
+ data.each do |para|
+ if para =~/Document Information/
+ para.gsub!(/(Document Information)/,'\1<a name="docinfo"></a>')
+ end
+ if para =~/MetaData/
+ para.gsub!(/(MetaData)/,'\1<a name="metadata"></a>')
+ end
+ @rcdc=true if @rcdc==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/)
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ para.gsub!(/~[{\[].+?[}\]]~\s+/m,' ')
+ if para =~/.+?<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ paranum=para[/.+?<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,1]
+ @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum)
+ end
+ @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).lev_segname_para_ocn
+ unless @rcdc
+ m=/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,@sto.text) if @sto.format =~/[12]|_1?\*|<!i[12]!>\s*_\*|null/
+ case @sto.format
+ when /^1~\S*/; para=@sto.scroll_lev_para_ocn.heading_body1
+ when /^2~\S*/; para=@sto.scroll_lev_para_ocn.heading_body2
+ when /^3~\S*/; para=@sto.scroll_lev_para_ocn.heading_body3
+ when /^4~\S+/; para=@sto.scroll_lev_para_ocn.heading_body4 # work on see Split_text_object4
+ when /^5~\S*/; para=@sto.scroll_lev_para_ocn.heading_body5
+ when /^6~\S*/; para=@sto.scroll_lev_para_ocn.heading_body6
+ when /^_\*$/; para=@sto.scroll_lev_para_ocn.bullet
+ when /^_1\*$/
+ format_txt_obj.gsub_body
+ para=@sto.scroll_lev_para_ocn.bullet_indent1
+ when /^_2\*$/
+ format_txt_obj.gsub_body
+ para=@sto.scroll_lev_para_ocn.bullet_indent2
+ when /^i1$/
+ format_txt_obj.gsub_body
+ para=@sto.scroll_lev_para_ocn.indent1
+ when /^i2$/
+ format_txt_obj.gsub_body
+ para=@sto.scroll_lev_para_ocn.indent2
+ when /^center$/; para=@sto.scroll_lev_para_ocn.center
+ when /^(?:b|bold)$/; para=@sto.scroll_lev_para_ocn.bold
+ when /^(?:verse|group|alt)$/; para=@sto.scroll_lev_para_ocn.para
+ when /^code$/; para=@sto.scroll_lev_para_ocn.code
+ when /null/ # see whether u can improve
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ format_txt_obj.gsub_body
+ para=@sto.scroll_lev_para_ocn.para
+ if para =~/<!Th?.+/ # tables come as single block
+ table=SiSU_HTML_shared::Table.new(para)
+ para=table.table_split
+ end
+ end
+ end
+ elsif para =~/Endnotes?/ and para !~/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,'<br /><a name="notes">Note</a>')
+ para=format_txt_obj.bold_para
+ elsif para =~/Owner Details/ and para !~/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,'<br /><a name="owner.details">Owner Details</a>')
+ @scr[:owner_details]=format_txt_obj.bold_para
+ para=''
+ elsif para =~/(.*)<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/ #watch
+ one,two=$1,$2
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two)
+ para=format_seg.no_paranum
+ end
+ #para=para.gsub(/ [2-6]~\S+ /,'') #and @md.cmd =~/[VM]/ #arbitrary, watch problematic as too general
+ para='' if (para =~/<a name="n\d+">/ and para =~/^(?:\^~\d+\s|<!e[:_]\d+!>)/) # hmmm re-adjusted 200507, for alt endnote which should again be matched ^~ ... not in response to problem though
+ if para =~/<:center>/ #rules changed now a <p class="center" problems may arise 2005w11 !
+ one,two=/(.*)<:center>(.*)/.match(para).captures
+ format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,one,two)
+ end
+ else # this is crazy rethink and redo later with some form of inject
+ m=/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,@sto.text) if @sto.format =~/[12]|null/
+ meta=case @sto.format
+ when /^1~/; @sto.scroll_lev_para_ocn.heading_body1
+ when /^2~/; @sto.scroll_lev_para_ocn.heading_body2
+ when /^3~/; @sto.scroll_lev_para_ocn.heading_body3
+ when /^4~\S+/; @sto.scroll_lev_para_ocn.heading_body4 # work on see Split_text_object
+ when /^5~/; @sto.scroll_lev_para_ocn.heading_body5
+ when /^6~/; @sto.scroll_lev_para_ocn.heading_body6
+ when /^i1$/
+ format_txt_obj.gsub_body
+ @sto.scroll_lev_para_ocn.indent1
+ when /^i2$/
+ format_txt_obj.gsub_body
+ @sto.scroll_lev_para_ocn.indent2
+ when /^center$/; @sto.scroll_lev_para_ocn.center
+ when /^(b|bold)$/; @sto.scroll_lev_para_ocn.bold
+ when /null/ # see whether u can improve
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ format_txt_obj.gsub_body
+ @sto.scroll_lev_para_ocn.para
+ if para =~/<!Th?.+/ # tables come as single block
+ table=Table.new(para)
+ para=table.table_split
+ end
+ end
+ end
+ elsif para =~/(Endnotes?)/ and para !~/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,'<br /><a name="notes">Note</a>')
+ meta=format_txt_obj.bold_para
+ elsif para =~/MetaData/ and para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,'<br /><a name="metadata">MetaData</a>')
+ meta=format_txt_obj.bold_para
+ elsif para =~/Owner Details/ and para !~/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,'<br /><a name="owner.details">Owner Details</a>')
+ @scr[:owner_details]=format_txt_obj.bold_para
+ meta=''
+ elsif para =~/(¡|<!Th?)/
+ table=Table.new(para)
+ para=table.table
+ elsif para =~/(.*)<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/ #ok - bug in equiv for seg 2004w46
+ one,two=$1,$2
+ format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,one,two) #watch #fix
+ meta=format_scroll.no_paranum
+ end
+ meta='' if para =~/<a name="n\d+">/ and para =~/^(\^~\d+ |<!e[:_]\d+!>)/ # -endnote
+ if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ case para
+ when /<:i1>/
+ gsub(/<:i1>/,'')
+ format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,para)
+ meta=format_scroll.indent_one_no_paranum
+ when /<:i2>/
+ gsub(/<:i2>/,'')
+ format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,para)
+ meta=format_scroll.indent_one_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para).captures
+ format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,one,two)
+ end
+ end
+ para.gsub!(/<!.+!>/,' ')
+ para.gsub!(/^<:\S?>/,'')
+ para.gsub!(/<:\S?>/,' ')
+ unless meta; @scr[:body] << para
+ else @scr[:metadata] << meta
+ end
+ end
+ end
+ @scr
+ end
+ def tails
+ scr_tail=[]
+ format_head_scroll=SiSU_HTML_Format_type::Head_toc.new(@md)
+ ads = SiSU_HTML_promo::Ad.new(@md)
+ scr_tail << format_head_scroll.scroll_tail << ads.div.close << ads.display << format_head_scroll.html_close
+ scr_tail
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/html_segments.rb b/lib/sisu/0.52/html_segments.rb
new file mode 100644
index 00000000..765c012e
--- /dev/null
+++ b/lib/sisu/0.52/html_segments.rb
@@ -0,0 +1,471 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: html segment generation, processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML_seg
+ require SiSU_lib + '/shared_html'
+ require SiSU_lib + '/html'
+ require SiSU_lib + '/html_promo'
+ class Seg
+ @@seg,@@seg_subtoc,@@seg_endnotes,@@seg_ad={},{},{},{}
+ @@seg_name,@@seg_name_html,@@seg_name_php,@@segtocband=[],[],[],[]
+ @@filename_seg=@@filename_segphp=@@seg_url=@@fn=@@to_lev4=@@get_hash_to=@@get_hash_fn=''
+ @@loop_count=@@seg_total=@@tracker=0
+ @@is4=@@is3=@@is2=@@is1=0
+ @@header1=@@header2=@@header3=@@header4=0
+ @@seg[:dot_nav],@@seg[:tocband],@@seg[:title],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@heading_endnotes_array,@@seg[:endnote_all]=Array.new(11){[]}
+ @@seg[:header_endnotes]=''
+ @@tablehead,@@number_of_cols=0,0
+ @@flag_group=false
+ @@dp=nil
+ attr_reader :seg_name_html,:seg_name_html_tracker
+ def initialize(data='',md='')
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @seg_name_html=@@seg_name_html || nil
+ @seg_name_html_tracker=@@tracker || nil
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def songsheet
+ begin
+ Seg.new(@data,@md).get_subtoc_endnotes
+ Seg.new(@data,@md).articles
+ Seg.new.cleanup # (((( added ))))
+ #### (((( END )))) ####
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ @@seg_name=[]
+ end
+ end
+ protected
+ def articles
+ data=@data
+ track,tracking,newfile=0,0,0
+ @@is4=@@is3=@@is2=@@is1=0
+ printed_endnote_seg='n'
+ @h_sfx='.php' if @md.file_type =~/php/
+ @h_sfx=@md.sfx if @md.file_type =~/html/
+ @h_sfx='.html' if @md.file_type =~/html/ #used in creating file, not to be omitted.
+ data.each do |para|
+ if para =~/^4~/
+ @@seg_name << para[/^4~(\S+)/,1]
+ seg_name=para[/^4~(\S+)/,1]
+ @@seg_ad[seg_name]=para[/.+?<:\d\s+(.+)\s*?>/,1] #watch
+ end
+ end
+ @@seg_name_html=@@seg_name
+ @@seg_total=@@seg_name.length
+ testforartnum=@@seg_name_html
+ tell=SiSU_Screen::Ansi.new(@md.cmd,@@seg_name.length)
+ tell.segmented unless @md.cmd =~/q/
+ flagend='y'
+ data.each do |para|
+ if para =~/^4~.+/ #watch
+ if para =~/<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ @@header4=para.to_s[/^4~(?:\S+\s+)?(.+?)<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,1]
+ else @@header4=para.to_s[/^4~(?:\S+\s+)?(.+)/,1]
+ end
+ @@is4=newfile=1
+ end
+ if para =~/^3~.+/
+ @@header3=para.to_s[/^3~(?:~\S+\s+)?(.+)/,1]
+ @@is4,@@is3=0,1
+ end
+ if para =~/^2~.+/
+ @@header2=para.to_s[/^2~(?:~\S+\s+)?(.+)/,1]
+ @@is4,@@is3,@@is2=0,0,1
+ end
+ if para =~/^1~.+/
+ @@header1=para.to_s[/^1~(?:~\S+\s+)?(.+)/,1]
+ @@is4,@@is3,@@is2,@@is1=0,0,0,1
+ end
+ if (@@is1 && !@@is2 && !@@is3 && !@@is4)
+ unless para =~/^1~/; head1=$_ #;
+ end
+ end
+ if @@is4 == 1 or para =~/^<ENDNOTES>|^<EOF>/
+ if newfile == 1 or para =~/^<ENDNOTES>|^<EOF>/
+ newfile=0
+ if para =~/^4~\S+/ or para =~/^<ENDNOTES>|^<EOF>/ # @@level4
+ if tracking != 0
+ File.mkpath(@md.dir_out) unless FileTest.directory?(@md.dir_out) #bug - added specifically for nav! not needed by regular seg, check !!!
+ Seg.new('',@md).tail
+ segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking-1]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}"
+ @@filename_seg=File.new(segfilename,'w') if @@seg_name_html[tracking-1]
+ unless (@@seg_name_html[tracking-1] =~/endnotes/)
+ Seg.new.output
+ else Seg.new.output('endnotes')
+ end
+ Seg.new.reinitialise
+ Seg.new(para,@md).header_art
+ Seg.new(para,@md).head
+ if @@seg_name_html[tracking] =~/metadata/ # this is for metadata
+ segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}"
+ @@filename_seg=File.new(segfilename,'w')
+ Seg.new.reinitialise
+ flagend="x"
+ @@filename_seg.close #%(((( EOF )))) -->
+ end
+ end
+ if tracking == 0
+ Seg.new(para,@md).header_art
+ Seg.new(para,@md).head
+ end
+ end
+ tracking=tracking + 1
+ end
+ m=para[/.+?<a name="(\d+)">.*/]; @@get_hash_to=$1 if m # changed 2002w42, again w44 ! & again 2003w16
+ m=para[/^4~(\S+)/]; @@get_hash_fn=$1 if m
+ if testforartnum[tracking-1] !~/endnote/
+ Seg.new(para,@md).markup
+ Seg.new(para,@md).txt
+ else
+ Seg.new(para,@md).markup
+ Seg.new(para,@md).txt
+ if printed_endnote_seg == 'n'
+ Seg.new(para,@md).endnote
+ printed_endnote_seg='y'
+ end
+ end
+ end
+ end
+ end
+ def header_art
+ @data.each do |para|
+ format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md)
+ if para =~/^[0-6]~/ #2004w27/5
+ if @@tracker < @@seg_total-1; @@seg[:dot_nav] << format_head_seg.dot_control_pre_next
+ else @@seg[:dot_nav] << format_head_seg.dot_control_pre
+ end
+ end
+ ads=SiSU_HTML_promo::Ad.new(@md)
+ @@seg[:title]=format_head_seg.head << ads.div.major
+ end
+ end
+ def head
+ data=@data
+ clean=/<!.*?!>|<:.*?>|<~\d+;(?:[ohum]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md)
+ unless @md.flag_pdf
+ if @@tracker < @@seg_total-1
+ if @@tracker == 0; @@segtocband << format_head_seg.toc_next3
+ else @@segtocband << format_head_seg.toc_pre_next3
+ end
+ elsif @@tracker == @@seg_total
+ @@segtocband << format_head_seg.toc_pre3
+ end
+ else # identical code without .pdf
+ if @@tracker < @@seg_total-1
+ if @@tracker == 0; @@segtocband << format_head_seg.toc_next2
+ else @@segtocband << format_head_seg.toc_pre_next2
+ end
+ else @@segtocband << format_head_seg.toc_pre2
+ end
+ end
+ @p_num ||= ''
+ if @@is1 == 1
+ @dc_creator=%{<b><sup>&copy;</sup>&nbsp;#{@md.dc_creator}</b>\n} if @md.dc_creator.to_s =~/\S/
+ @@seg[:tocband] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav])
+ @@seg[:headers] << format_head_seg.seg_head_escript if SiSU_HTML_Format_type::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug
+ @@seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'')
+ paranum=if @@header1[/.+?<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/]; $1
+ else ''
+ end
+ @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum)
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,@@header1,@p_num.ocn_display)
+ @@seg[:headers] << format_seg.title_header1.gsub(clean,'')
+ @@header1.gsub!(/&nbsp;<a name="-[\d*+]+" href="#_[\d*+]+">&nbsp;<sup>[\d*+]+<\/sup>&nbsp;<\/a>/,'')
+ end
+ if @@is2 == 1
+ header2=@@header2
+ paranum=if header2[/.+?<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/]; $1
+ else ''
+ end
+ @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum)
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,header2,@p_num.ocn_display)
+ @@seg[:headers] << format_seg.title_header2.gsub(clean,'')
+ @@header2.gsub!(/&nbsp;<a name="-[\d*+]+" href="#_[\d*+]+">&nbsp;<sup>[\d*+]+<\/sup>&nbsp;<\/a>/,'')
+ end
+ if @@is3 == 1
+ header3=@@header3
+ paranum=if header3[/.+?<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/]; $1
+ else ''
+ end
+ @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum)
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,header3,@p_num.ocn_display)
+ @@seg[:headers] << format_seg.title_header3.gsub(clean,'')
+ @@header3.gsub!(/&nbsp;<a name="-[\d*+]+" href="#_[\d*+]+">&nbsp;<sup>[\d*+]+<\/sup>&nbsp;<\/a>/,'')
+ end
+ if @@is4 == 1
+ header4=@@header4
+ paranum=if header4[/.+?<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/]; $1
+ else ''
+ end
+ @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum)
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,header4,@p_num.ocn_display)
+ @@seg[:headers] << format_seg.title_header4.gsub(clean,'')
+ end
+ @@seg[:header_endnotes]=format_head_seg.title_endnote(@md.title,@md.subtitle,@dc_creator,@@seg[:dot_nav])
+ @@tracker=@@tracker+1
+ end
+ def markup
+ @debug=[]
+ data=@data.dup #bugwatch tied
+ @group_collect=[]
+ data.each do |para|
+ format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md)
+ if para !~/^0~/
+ m=para[/.+?<~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/]
+ if m
+ paranum=m[1].to_s
+ @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum)
+ end
+ if para =~/<:(?:code|alt|verse|group)>/ or @@flag_group==true
+ if para =~/<:(?:code|alt|verse|group)>/
+ @group_collect << @vz.margin_txt_0 + para
+ @@flag_group=true
+ elsif @@flag_group==true
+ unless para =~/<:(?:code|alt|verse|group)-end>/ # neither ideal nor necessary sort later
+ @group_collect << para
+ else @group_collect << para.gsub(/<:(?:code|alt|verse|group)-end>/,'')
+ end
+ end
+ if para =~/<:(?:code|alt|verse|group)-end>/
+ para = @group_collect.join
+ @@flag_group=false
+ @group_collect=[]
+ end
+ end
+ if para !~/^[0-9]~/
+ if para =~/(.*)<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/
+ one,two=$1,$2
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two)
+ para=format_seg.no_paranum
+ end
+ end
+ if para[/<~(\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp)>$/]
+ @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).lev_segname_para_ocn
+ format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[12]|_1?\*|<:i[12]>\s*_\*|null/
+ para=case @sto.format # work area 2003w29 ||@|def lev_segname_para_ocn|
+ when /^4~\S+/; @sto.seg_lev_para_ocn.header4 # work on see Split_text_object
+ when /^5~(?:~\S+)?/; @sto.seg_lev_para_ocn.header5
+ when /^6~(?:~\S+)?/; @sto.seg_lev_para_ocn.header6
+ when /^_\*$/; @sto.seg_lev_para_ocn.bullet
+ when /^_1\*$/
+ format_txt_obj.gsub_body
+ @sto.seg_lev_para_ocn.bullet_indent1
+ when /^i1$/
+ format_txt_obj.gsub_body
+ @sto.seg_lev_para_ocn.indent1
+ when /^i2$/
+ format_txt_obj.gsub_body
+ @sto.seg_lev_para_ocn.indent2
+ when /^(?:verse|group|alt)$/
+ @sto.seg_lev_para_ocn.para
+ when /^code$/
+ @sto.seg_lev_para_ocn.code
+ when /null/
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ and para !~/^<!TZ!>/
+ format_txt_obj.gsub_body
+ @sto.seg_lev_para_ocn.para
+ elsif para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ and para =~/^<!TZ!>/
+ format_txt_obj.gsub_body
+ @sto.seg_lev_para_ocn.table_end
+ else para
+ end
+ else para
+ end
+ elsif para =~/¡|<!T[hZ]?/
+ table=SiSU_HTML_shared::Table.new(para)
+ para=table.table
+ end
+ if @md.flag_separate_endnotes
+ para.gsub!(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{@md.sfx}#_\\1">}) #endnote- twice #removed file type
+ end
+ if para !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/
+ if para[/(.*)<~0;(?:u|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/] #% watch u & m?
+ one,two=$1,$2
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two)
+ para=format_seg.seg_no_paranum #% undefined
+ end
+ para.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with <!e_!> #?? workpoint
+ if para =~/<a name="_\d+" href="#-\d+">&nbsp;<sup>/ #endnote- note-
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,para)
+ para=format_seg.no_paranum
+ end
+ end
+ if para =~/^4~\S+|4~!/
+ para.gsub!(/4~\S+|<:[-_\w\d]?(-.+?-)?>|4~!.+/,'') #sort seg headers
+ @@seg[:main] << para
+ @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc
+ else
+ para.gsub!(/<:[-_\w\d]?(-.+?-)?>|4~!.+/,'')
+ @@seg[:main] << para unless @@flag_group==true
+ end
+ end
+ end
+ end
+ def txt
+ end
+ def endnote
+ end
+ def tail
+ format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md)
+ if @md.flag_auto_endnotes
+ @@seg[:tail] << format_head_seg.endnote_mark
+ @@seg[:tail] << @@seg_endnotes[@@get_hash_fn] #endnotes deposited at end of individual segments||@|EXTRACTION OF ENDNOTES|
+ end
+ @@seg[:tail] << '<table summary="whitespace"><tr><td>&nbsp;</td></tr></table>'
+ ads = SiSU_HTML_promo::Ad.new(@md)
+ @@seg[:credits] << format_head_seg.credit << ads.div.close << ads.display << format_head_seg.html_close
+ end
+ def output(type='')
+ if @@seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or...
+ @@filename_seg << @@seg[:title]
+ #@@filename_seg << @@seg[:dot_nav] #places dot control at very top of segment
+ @@filename_seg << @@seg[:tocband]
+ if type !~/endnote/
+ @@filename_seg << @@seg[:headers]
+ @@filename_seg << @@seg[:main]
+ else
+ @@filename_seg << @@seg[:header_endnotes]
+ @@filename_seg << @@seg[:endnote_all]
+ end
+ @@filename_seg << @@seg[:tail]
+ @@filename_seg << @@seg[:tocband]
+ @@filename_seg << @@seg[:credits]
+ @@filename_seg.close
+ end
+ end
+ def reinitialise
+ @@seg[:title],@@seg[:dot_nav],@@segtocband,@@seg[:tocband],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(8){[]}
+ end
+ def cleanup
+ reinitialise
+ @@seg_total,@@tracker=0,0
+ @@seg_endnotes,@@seg_subtoc={},{}
+ @@seg_endnotes_array,@@seg_subtoc_array,@@heading_endnotes_array=[],[],[]
+ @@seg[:endnote_all]=[]
+ end
+ def get_subtoc_endnotes #get endnotes & sub-table of contents subtoc
+ @data.each do |para|
+ para.gsub!(/<a name=\"h\d.*?\">(.+?)<\/a>/mi,'\1')
+ if @md.flag_auto_endnotes
+ if para =~/^[1234]~/ and not @@fn.empty?
+ @@seg_endnotes[@@fn] = []
+ @@seg_endnotes[@@fn] << @@seg_endnotes_array
+ @@seg_endnotes_array=[] if para=~/^4~/
+ end
+ end
+ if para =~/^4~/ #% EXTRACTION OF SUB-TOCs
+ @@seg_subtoc[@@fn]=@@seg_subtoc_array
+ @@seg_subtoc_array=[]
+ end
+ if para =~/^4~/ #% SEGMENT NAME, after EXTRACTION OF ENDNOTES & SUB-TOCs
+ m=para[/^4~(\S+).+?<~(\d+);(?:[oh]|4:)\d+;\w\d+><#@dp:#@dp>$/]
+ if m; @@fn,@@to_lev4=$1,$2 if m # changed 2004w07 #endnotes and sub-tocs
+ else
+ m=para[/^4~(\S+)/]
+ @@fn,@@to_lev4=$1,'nonum' if m # changed 2005w13
+ end
+ end
+ if para =~/^[56]~\S*\s+(.+)?<~(\d+);(?:h|[56]:)\d+;\w\d+><#@dp:#@dp>$/
+ para.gsub!(/&nbsp;<\/a>/,'&nbsp;')
+ case para # series changed 2002w42
+ when /^5~\S*\s+(.+)?<~(\d+);(?:h|[56]:)\d+;\w\d+><#@dp:#@dp>$/ #remove [u]? req by pg texts, revist
+ one,two=$1,$2
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two)
+ para=format_seg.subtoc_lev5
+ when /^6~\S*\s+(.+)?<~(\d+);(?:h|[56]:)\d+;\w\d+><#@dp:#@dp>$/
+ one,two=$1,$2
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two)
+ para=format_seg.subtoc_lev6
+ end
+ @@seg_subtoc_array << para
+ end
+ if @md.flag_auto_endnotes
+ if para =~/~[{\[][\d*+]+ <a name="_[\d*+]+"/ # endnote-
+ endnote_array=[]
+ if para=~/~\{.+?\}\~/m
+ endnote_array << para.scan(/~\{.+?\}\~/m)
+ end
+ if para=~/~\[[*]\d+\s.+?\]\~/m
+ endnote_array << para.scan(/~\[[*]\d+\s.+?\]\~/m)
+ end
+ if para=~/~\[[+]\d+\s.+?\]\~/m
+ endnote_array << para.scan(/~\[[+]\d+\s.+?\]\~/m)
+ end
+ endnote_array.flatten.each do |note|
+ note_match=note.dup
+ note_match_seg=note.dup
+ e_n=note_match_seg[/(?:~\{[\d*+]+|~\[[*+]\d+)\s+(.+?)[}\]]~/m,1]
+ try=e_n.split(/<br \/>/)
+ try.each do |e|
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,e)
+ note_match=if e =~/<:i[12]>/
+ format_seg.endnote_body_seg_tail_indent
+ else format_seg.endnote_body_seg_tail
+ end
+ @@seg_endnotes_array << note_match
+ end
+ try.join('<br \/>')
+ #% creation of separate end segment/page of all endnotes referenced back to reference segment
+ m=/(?:~\{[\d*+]+|~\[[*+]\d+)\s+(.+?href=")(#-[\d*+]+".+)[}\]]~/mi
+ one=note_match_seg[m,1] #note~ [a name]
+ two=note_match_seg[m,2] #note-
+ format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two)
+ note_match_all_seg=format_seg.endnote_seg_body(@@fn) #BUG WATCH 200408
+ @@seg[:endnote_all] << note_match_all_seg
+ end
+ para.gsub!(/~[{\[].+?[}\]]~\s*/m,' ')
+ end
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/html_table.rb b/lib/sisu/0.52/html_table.rb
new file mode 100644
index 00000000..ade762eb
--- /dev/null
+++ b/lib/sisu/0.52/html_table.rb
@@ -0,0 +1,141 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: shared html parts
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML_table
+ require SiSU_lib + '/defaults'
+ class Table
+ @@tablehead=0
+ @@tablefoot=[] #watch
+ def initialize(one)
+ @one,@parablock,@vz=one,one,SiSU_Env::Get_init.instance.skin
+ end
+ def table_head(inf)
+ %{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+ <tr>
+ <td valign="top" align="justify">
+ <p class="norm" id="o#{inf}"><a name="#{inf}"></a></p>
+ </td>
+ <td>
+<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">}
+ end
+ def table_end(tablefoot='')
+ %{</table>#{@vz.margin_num}#{@vz.margin_num}&nbsp;#{@vz.table_close}
+#{tablefoot}}
+ end
+ def table_row(inf,h=false)
+ bold=if h; '<b>'
+ else ''
+ end
+ %{
+<tr>
+ <td width="#{inf}%" valign="top">#{@vz.paragraph_table}#{bold}}
+ end
+ def table_cell(inf,h=false)
+ if h; %{</b></font></td><td width="#{inf}%" valign="top">#{@vz.paragraph_table}<b>}
+ else %{</font></td><td width="#{inf}%" valign="top">#{@vz.paragraph_table}}
+ end
+ end
+ def table_row_close(h=false)
+ bold_close=if h; '</b>'
+ else ''
+ end
+ "#{bold_close}</font></td></tr>"
+ end
+ def table
+ m=@parablock[/<!f(.+?)!>/,1]
+ @@tablefoot << m if m
+ @parablock.gsub!(/<!f.+?!>/,'')
+ @@tablehead=1 if @parablock =~/<!Th¡/
+ if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/; @parablock=table_head($1)
+ end
+ if @parablock =~/<!TZ!>/
+ tablefoot=[]
+ @@tablefoot.each {|x| tablefoot << ''}
+ @@tablefoot=[]
+ if @parablock =~/<!TZ!>/; @parablock=table_end
+ end
+ end
+ if @@tablehead == 1
+ if @parablock =~/¡¡/
+ if @parablock =~/<!¡¡(\d+?)¡/
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))
+ end
+ if @parablock =~/¡¡(\d+?)¡/
+ @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))
+ end
+ if @parablock =~/!>/
+ @parablock.gsub!(/!>/,table_row_close(true))
+ end
+ @@tablehead=0
+ end
+ @parablock
+ else
+ if @parablock =~/<!¡¡(\d+?)¡/
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1))
+ end
+ if @parablock =~/¡¡(\d+?)¡/
+ @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1))
+ end
+ if @parablock =~/!>/
+ @parablock.gsub!(/!>/,table_row_close)
+ end
+ @parablock
+ end
+ @parablock
+ end
+ def table_split
+ @new_content=[]
+ @one.split(/\n/).each do |parablock|
+ table=Table.new("#{parablock}\n")
+ @new_content << table.table
+ end
+ @new_content.join
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/html_tune.rb b/lib/sisu/0.52/html_tune.rb
new file mode 100644
index 00000000..1043f310
--- /dev/null
+++ b/lib/sisu/0.52/html_tune.rb
@@ -0,0 +1,376 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: html generation, html pre-processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+require SiSU_lib + '/param'
+module SiSU_Tune
+ #require SiSU_lib + '/defaults'
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/param'
+ require SiSU_lib + '/html_format' #watch
+ include SiSU_Env
+ include SiSU_Screen
+ @@line_mode=''
+ @@endnote_array=[]
+ @@endnote_call_counter=1
+ @@table_align='<table summary='' width="96%" border="0" bgcolor="white" cellpadding="0" col="3">
+<tr ...><td width="2%" align="right">
+&nbsp\;</td>
+<td width="94%" valign="top" align="justify">'
+ @@table_align_close='</td>
+<td width="4%" align="right" valign="top">
+<font size="1" color="#777777">
+&nbsp;&nbsp;&nbsp;</font> </td></tr></table>'
+ @@counter,@@column,@columns=0,0,0
+ class Output
+ def initialize(data,md)
+ @data,@md=data,md
+ @cX=SiSU_Screen::Ansi.new(@md.cmd).cX
+ end
+ def hard_output
+ my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ @filename_tune=my_make.file_tune
+ data=[]
+ @data.each{|x| x.strip; data << x if not x.empty?} #1.9 array?
+ data.each do |para|
+ @filename_tune.puts para, "\n" #if para !~/¡/
+ end
+ end
+ def marshal
+ my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ @marshal_tune=my_make.marshal_tune
+ File.open(@marshal_tune,'w') {|f| Marshal.dump(@data.to_a,f)}
+ end
+ end
+ class Clean_html
+ def initialize(html='')
+ @html=html
+ end
+ def clean
+ @html.gsub!(/¢/,'&cent;') # &#162;
+ @html.gsub!(/£/,'&pound;') # &#163;
+ @html.gsub!(/¥/,'&yen;') # &#165;
+ @html.gsub!(/§/,'&sect;') # &#167;
+ @html.gsub!(/©/,'&copy;') # &#169;
+ @html.gsub!(/ª/,'&ordf;') # &#170;
+ @html.gsub!(/«/,'&laquo;') # &#171;
+ @html.gsub!(/®/,'&reg;') # &#174;
+ @html.gsub!(/°/,'&deg;') # &#176;
+ @html.gsub!(/±/,'&plusmn;') # &#177;
+ @html.gsub!(/²/,'&sup2;') # &#178;
+ @html.gsub!(/³/,'&sup3;') # &#179;
+ @html.gsub!(/µ/,'&micro;') # &#181;
+ @html.gsub!(/¶/,'&para;') # &#182;
+ @html.gsub!(/¹/,'&sup1;') # &#185;
+ @html.gsub!(/º/,'&ordm;') # &#186;
+ @html.gsub!(/»/,'&raquo;') # &#187;
+ @html.gsub!(/¼/,'&frac14;') # &#188;
+ @html.gsub!(/½/,'&frac12;') # &#189;
+ @html.gsub!(/¾/,'&frac34;') # &#190;
+ @html.gsub!(/×/,'&times;') # &#215;
+ @html.gsub!(/÷/,'&divide;') # &#247;
+ @html.gsub!(/¿/,'&iquest;') # &#191;
+ @html.gsub!(/À/,'&Agrave;') # &#192;
+ @html.gsub!(/Á/,'&Aacute;') # &#193;
+ @html.gsub!(/Â/,'&Acirc;') # &#194;
+ @html.gsub!(/Ã/,'&Atilde;') # &#195;
+ @html.gsub!(/Ä/,'&Auml;') # &#196;
+ @html.gsub!(/Å/,'&Aring;') # &#197;
+ @html.gsub!(/Æ/,'&AElig;') # &#198;
+ @html.gsub!(/Ç/,'&Ccedil;') # &#199;
+ @html.gsub!(/È/,'&Egrave;') # &#200;
+ @html.gsub!(/É/,'&Eacute;') # &#201;
+ @html.gsub!(/Ê/,'&Ecirc;') # &#202;
+ @html.gsub!(/Ë/,'&Euml;') # &#203;
+ @html.gsub!(/Ì/,'&Igrave;') # &#204;
+ @html.gsub!(/Í/,'&Iacute;') # &#205;
+ @html.gsub!(/Î/,'&Icirc;') # &#206;
+ @html.gsub!(/Ï/,'&Iuml;') # &#207;
+ @html.gsub!(/Ð/,'&ETH;') # &#208;
+ @html.gsub!(/Ñ/,'&Ntilde;') # &#209;
+ @html.gsub!(/Ò/,'&Ograve;') # &#210;
+ @html.gsub!(/Ó/,'&Oacute;') # &#211;
+ @html.gsub!(/Ô/,'&Ocirc;') # &#212;
+ @html.gsub!(/Õ/,'&Otilde;') # &#213;
+ @html.gsub!(/Ö/,'&Ouml;') # &#214;
+ @html.gsub!(/Ø/,'&Oslash;') # &#216;
+ @html.gsub!(/Ù/,'&Ugrave;') # &#217;
+ @html.gsub!(/Ú/,'&Uacute;') # &#218;
+ @html.gsub!(/Û/,'&Ucirc;') # &#219;
+ @html.gsub!(/Ü/,'&Uuml;') # &#220;
+ @html.gsub!(/Ý/,'&Yacute;') # &#221;
+ @html.gsub!(/Þ/,'&THORN;') # &#222;
+ @html.gsub!(/ß/,'&szlig;') # &#223;
+ @html.gsub!(/à/,'&agrave;') # &#224;
+ @html.gsub!(/á/,'&aacute;') # &#225;
+ @html.gsub!(/â/,'&acirc;') # &#226;
+ @html.gsub!(/ã/,'&atilde;') # &#227;
+ @html.gsub!(/ä/,'&auml;') # &#228;
+ @html.gsub!(/å/,'&aring;') # &#229;
+ @html.gsub!(/æ/,'&aelig;') # &#230;
+ @html.gsub!(/ç/,'&ccedil;') # &#231;
+ @html.gsub!(/è/,'&egrave;') # &#232;
+ @html.gsub!(/é/,'&eacute;') # &#233;
+ @html.gsub!(/ê/,'&ecirc;') # &#234;
+ @html.gsub!(/ë/,'&euml;') # &#235;
+ @html.gsub!(/ì/,'&igrave;') # &#236;
+ @html.gsub!(/í/,'&iacute;') # &#237;
+ @html.gsub!(/î/,'&icirc;') # &#238;
+ @html.gsub!(/ï/,'&iuml;') # &#239;
+ @html.gsub!(/ð/,'&eth;') # &#240;
+ @html.gsub!(/ñ/,'&ntilde;') # &#241;
+ @html.gsub!(/ò/,'&ograve;') # &#242;
+ @html.gsub!(/ó/,'&oacute;') # &#243;
+ @html.gsub!(/ô/,'&ocirc;') # &#244;
+ @html.gsub!(/õ/,'&otilde;') # &#245;
+ @html.gsub!(/ö/,'&ouml;') # &#246;
+ @html.gsub!(/ø/,'&oslash;') # &#248;
+ @html.gsub!(/ù/,'&ugrave;') # &#250;
+ @html.gsub!(/ú/,'&uacute;') # &#251;
+ @html.gsub!(/û/,'&ucirc;') # &#252;
+ @html.gsub!(/ü/,'&uuml;') # &#253;
+ @html.gsub!(/þ/,'&thorn;') # &#254;
+ @html.gsub!(/ÿ/,'&yuml;') # &#255;
+ @html.gsub!(/ý/,'&yacute;')
+ @html
+ end
+ end
+ class Tune
+ @@dp=nil
+ def initialize(data,md)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @sys=SiSU_Env::System_call.new
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ #@utf8=SiSU_character_encode::UTF8 #.new
+ end
+ def songsheet
+ begin
+ @cX=SiSU_Screen::Ansi.new(@md.cmd).cX
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'Tune')
+ tell.txt_grey unless @md.cmd =~/q/
+ data=Tune.new(@data,@md).endnotes_html
+ data=Tune.new(data,@md).url_markup
+ if @sys.locale =~/utf-?8/i
+ data=Tune.new(data,@md).utf8_markup
+ end
+ if @md.cmd =~/M/ #Hard Output Tune Optional on/off here
+ data=Output.new(data,@md).hard_output
+ Output.new(data,@md).marshal
+ end
+ tuned=Tune.new(@data,@md).output
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ def para_numbers
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ para.gsub!(/(\d~(\S+))/,'\1<a name="H#\2">#\2.</a>&nbsp;')
+ @tuned_file << para
+ end
+ end
+ def utf8_markup
+ @tuned_file=[]
+ @data.each do |para|
+ #@utf8.new(para).html
+ #@utf8.html(@para)
+ if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn
+ #¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûü
+ #¢£¥§©ª«®°±²³µ¶¹º»¼½¾×÷
+ ##para.gsub!(//, '&#;')
+ ##para.gsub!(//, '&;')
+ para=SiSU_Tune::Clean_html.new(para).clean
+ end
+ @tuned_file << para
+ end
+ end
+ def url_markup
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ para.gsub!(/<:name\#(\S+?)>/,'<a name="\1"></a>')
+ para.gsub!(/<-#>/,'')
+ para.gsub!(/<:p[bn]>/,'')
+ para.gsub!(/<(p|br)>/,'<\1 />')
+ para.gsub!(/<:br>/,'<br />')
+ if para =~/<::\s+/ #watch
+ para.gsub!(/<::\s+(\S+?)\s+!>/,
+ %{<img src="#{@env.url.images}/c_\\1.png" alt="\\1" width="14" height="14" align="bottom" border="0">})
+ end
+ if para =~/<:image\s+/
+ para.gsub!(/<:image\s+(http\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+>/,
+ %{<a href="\\1"><img src="#{@env.url.images_local}/\\2" \\3 \\4 naturalsizeflag="0" align="bottom" border="0"></a>})
+ para.gsub!(/<:image\s+(http\S+)\s+(\S+)\s+>/,
+ %{<a href="\\1"><img src="#{@env.url.images_local}/\\2" naturalsizeflag="0" align="bottom" border="0"></a>})
+ para.gsub!(/<:image\s+(\S+)\s+(\S+)\s+(\S+)\s+>/,
+ %{<img src="#{@env.url.images_local}/\\1" \\2 \\3 naturalsizeflag="0" align="bottom" border="0">})
+ para.gsub!(/<:image\s+(\S+)\s+>/,
+ %{<img src="#{@env.url.images_local}/\\1" naturalsizeflag="0" align="bottom" border="0">})
+ end
+ if para =~/\{.+?\}((?:http|ftp)\S+|image)/
+ @word_mode=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/)
+ word_mode=SiSU_Tune::Tune_urls.new(@word_mode,@md).urls
+ words=word_mode.join(' ')
+ para.gsub!(/.+/,words)
+ end
+ if (para !~/^0~/)
+ para.gsub!(/\\copyright/i,%{<sup>&copy;</sup>})
+ if (para !~/\<:ad\s+\.\.\//)
+ para.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*!\>/,
+ %{\n<center><a href="http:\/\/\\1" target="external"><img src="#{@env.url.images_local}/\\2" alt="\\3"></a></center>\n})
+ else
+ para.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/,
+ %{\n<center><a href="\\1" target="_top"><img src="#{@env.url.images_local}/\\2" alt="\\3"></a></center>\n})
+ end
+ para.gsub!(/!pick/, %{<img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_choice}" alt="stellar">})
+ para.gsub!(/!new/, %{&nbsp;<img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_new}" alt="new">})
+ para.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>')
+ para.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to&nbsp;{&nbsp;\1&nbsp;}</a> ')
+ if (para =~/\b\S+\@\S+?\.\S+/ and para !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/)
+ para.gsub!(/\b(\S+\@\S+?\.\S+)(\s)/,'<a href="mailto:\1">\1</a>\\2')
+ end
+ if (para !~/(\"\w+:\/\/\S+?\"|>\s*\w+:\/\/\w+?\S*<)/) #url markup http etc.
+ if para=~/\w+:\/\/\S+?\.\S+?[.,] /
+ para.gsub!(/(\w+:\/\/\S+?\.\S+?)([.,] )/,'<a href="\1" target="_top">\1</a>\2') #full stops ! have been a bother
+ else
+ para.gsub!(/(\w+:\/\/\S+?\.\S+)/, '<a href="\1" target="_top">\1</a>')
+ end
+ end
+ if (para =~/[ ^](?:https?|ftp):\/\/\S+/) #url markup http leftovers watch carefully may accept too much 2004w46
+ if para=~/([ ^])((?:https?|ftp):\/\/\S+?)([\.,] )/
+ para.gsub!(/([ ^])((?:https?|ftp):\/\/\S+?)([\.,] )/,'\1<a href="\2" target="_top">\2</a>\3') #full stops ! have been a bother
+ else
+ para.gsub!(/([ ^])((?:https?|ftp):\/\/\S+)/,'\1<a href="\2" target="_top">\2</a>')
+ end
+ end
+ if (para =~/..\/\S+/ and para !~/(\"..\/\S+?\"|>\s*..\/\S+<)/)
+ para.gsub!(/(\.\.\/\S+)/,'<a href="\1">\1</a>')
+ end
+ para.gsub!(/<a href="\.\.\//,%{<a href="#{@vz.url_site}/})
+ end
+ @tuned_file << para
+ end
+ end
+ def endnotes_html
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ para.gsub!(/(~[{])(\d+) (.+?) <#@dp>([}]~)/,
+ '&nbsp;<a name="-\2" href="#_\2">&nbsp;<sup>\2</sup>&nbsp;</a> ' + #note- endnote-
+ '\1\2 <a name="_\2" href="#-\2">&nbsp;<sup>\2.</sup></a> \3 \4') #endnote- note- (careful may have switched)
+ para.gsub!(/(~\[)([*+]\d+) (.+?) <#@dp>(\]~)/,
+ '&nbsp;<a name="-\2" href="#_\2">&nbsp;<sup>\2</sup>&nbsp;</a> ' + #note- endnote-
+ '\1\2 <a name="_\2" href="#-\2">&nbsp;<sup>\2.</sup></a> \3 \4') #endnote- note- (careful may have switched)
+ para.gsub!(/(~\{)([*+]+) (.+?) <#@dp>(\}~)/,
+ '&nbsp;<a name="-\2" href="#_\2">&nbsp;<sup>\2</sup>&nbsp;</a> ' + #note- endnote-
+ '\1\2 <a name="_\2" href="#-\2">&nbsp;<sup>\2</sup></a> \3 \4') #endnote- note- (careful may have switched)
+ @tuned_file << para
+ end
+ end
+ def output
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ para.strip!
+ para.chomp!
+ @tuned_file << para
+ end
+ @tuned_file << "\n<EOF>" if (@md.fns =~/\.sst0/) #remove
+ @tuned_file
+ end
+ end
+ class Tune_urls
+ def initialize(data,md)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ end
+ def urls
+ @words=[]
+ @data.each do |word|
+ @words << if word=~/\{(.+?)\}((?:https?|ftp)\S+|image)/
+ if word =~/\{(.+?)\}((?:https?|ftp)\S+|image)([.,](?:\s|$))/
+ m,u,d=/\{(.+?)\}((?:https?|ftp)\S+|image)([.,](?:\s|$))/.match(word).captures
+ else m,u=/\{(.+?)\}((?:https?|ftp)\S+|image)/.match(word).captures
+ d=''
+ end
+ case m
+ when /\.png|\.jpg|\.gif|c=|\d+x\d+/
+ w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/
+ w=%{width="#{w}"} if w
+ h=%{height="#{h}"} if h
+ c=m[/"(.+?)"/m,1]
+ caption=%{<br /><p class="caption">#{c}</p>} if c
+ png=m.scan(/\S+/)[0]
+ image_path=if @md.fns =~/\.-ss[tm]$/; @env.url.images_external
+ else @env.url.images_local
+ end
+ ins=if u and u.strip !~/^image$/
+ %{<a href="#{u}"><img src="#{image_path}/#{png}" #{w} #{h} naturalsizeflag="0" align="bottom" border="0"></a>#{caption}}
+ else %{<img src="#{image_path}/#{png}" #{w} #{h} naturalsizeflag="0" align="bottom" border="0">#{caption}}
+ end
+ word.gsub!(/\{.+?\}((?:https?|ftp)\S+|image)/,ins)
+ else
+ link=m[/(.+)/m]
+ png=m.scan(/\S+/)[0].strip
+ link=link.strip
+ ins=%{<a href="#{u}">#{link}</a>#{d}}
+ word.gsub!(/\{.+?\}(?:https?|ftp)\S+/,ins)
+ end
+ word
+ else word
+ end
+ word
+ end
+ @words
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/hub.rb b/lib/sisu/0.52/hub.rb
new file mode 100644
index 00000000..939b70a5
--- /dev/null
+++ b/lib/sisu/0.52/hub.rb
@@ -0,0 +1,573 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: SiSU information Structuring Universe, processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU
+ require SiSU_lib + '/sysenv'
+ include SiSU_Screen
+ @@pwd=Dir.pwd
+ class Remote_download
+ def initialize(requested_file)
+ @requested_file=requested_file
+ end
+ def pod
+ re_p_div=/http:\/\/([^\/]+)(\/\S+?)\/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/
+ re_p=/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/
+ if @requested_file =~ re_p_div
+ @site,@pth,@pod= re_p_div.match(@requested_file).captures
+ elsif @requested_file =~ re_p
+ @pod= re_p.match(@requested_file).captures
+ end
+ def site
+ @site
+ end
+ def path
+ @pth
+ end
+ def dir_stub
+ re_p_stub=/.+?([^\/]+)$/
+ pod_stub= re_p_stub.match(path).captures.join if path
+ end
+ def name_source
+ @pod
+ end
+ def name
+ pod_download_as=if name_source=~/(?:sisupod\.(?:zip|ssp))/; dir_stub + '.ssp'
+ else name_source
+ end
+ end
+ self
+ end
+ end
+ class Op
+ @@env=SiSU_Env::Info_env.new
+ def initialize(opt,req,message)
+ @opt,@req,@message=opt,req,message
+ @n_do=0
+ end
+ def pod_output(fns_pod)
+ dir_pwd=@@env.path.pwd
+ dir_pod=@@env.sisupod_gen(fns_pod)
+ Dir.chdir(dir_pod)
+ content=Dir.glob("*.ss[mt]").join(' ')
+ if content =~/\.ss[mt]/
+ Dir.chdir(dir_pwd)
+ @opt.fns=content #check
+ system("cd #{dir_pod}
+ sisu -CC #{@opt.cmd} #{@opt.mod.join(' ')} #{content}
+ cd -
+ ")
+ end
+ @pwd=`pwd`.strip
+ Dir.chdir(@pwd)
+ end
+ def select
+ require SiSU_lib + "/#@req"
+ if @req =~/^conf$/; SiSU_Initialize::Source.new(@opt).read # -C
+ end
+ if not @opt.files.empty?
+ @opt.files.each do |fns|
+ if fns =~ /(?:sisupod(?:\.zip)?|\.ssp)$/
+ pod_name=Remote_download.new(fns).pod.name
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,pod_name)
+ tell.puts_blue unless @opt.cmd =~/q/
+ @opt.files.shift
+ pod_output(pod_name)
+ break
+ else
+ put=fns.gsub(/(.+)?\._sst$/,'\1.ssm')
+ @opt.fns=fns
+ if @req !~/(?:urls|remote_put)$/
+ if FileTest.file?(@opt.fns)
+ case @opt.fns
+ when /\.(?:[_-]?sst|ssm)$/
+ case @req
+ when /^dal$/
+ if fns =~ /\.ssm$/; require SiSU_lib + '/composite' #pre-processing
+ SiSU_Assemble::Composite.new(@opt).read
+ @opt.fns=fns.gsub(/\.ssm$/,'._sst')
+ end
+ SiSU_DAL::Source.new(@opt).read # -m
+ when /^concordance$/; SiSU_Concordance::Source.new(@opt).read # -w
+ when /^share_src$/; SiSU_Markup::Source.new(@opt).read # -s
+ when /^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S
+ when /^source_kdissert$/; SiSU_Kdi_source::Source.new(@opt).read ## -S
+ when /^digests$/; SiSU_Digest_view::Source.new(@opt).read # -N
+ when /^plaintext$/; SiSU_Plaintext::Source.new(@opt).read # -a -A -e -E -f
+ when /^wikispeak$/; SiSU_Wikispeak::Source.new(@opt).read # -g
+ when /^odf$/; SiSU_ODF::Source.new(@opt).read # -o
+ when /^texpdf$/; SiSU_TeX::Source.new(@opt).read # -p
+ when /^texinfo$/; SiSU_TexInfo::Source.new(@opt).read # -I
+ when /^docbook$/; SiSU_Docbook::Source.new(@opt).read # -B
+ when /^html$/; SiSU_HTML::Source.new(@opt).read # -h -H
+ when /^xml$/; SiSU_XML_SAX::Source.new(@opt).read # -x
+ when /^xml_dom$/; SiSU_XML_DOM::Source.new(@opt).read # -X
+ when /^xhtml$/; SiSU_XHTML::Source.new(@opt).read # -b
+ when /^manifest$/; SiSU_Manifest::Source.new(@opt).read # -y
+ when /^sitemaps$/; SiSU_Sitemaps::Source.new(@opt).read # -Y
+ when /^zap$/; SiSU_Zap::Source.new(@opt).read # -Z
+ when /^dbi$/; SiSU_DBI::SiSU_SQL.new(@opt).connect # -D -d
+ end
+ @n_do=@n_do+1
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@n_do,"#{@req.upcase} processed")
+ tell.files_processed unless @opt.cmd =~/q/
+ ObjectSpace.garbage_collect
+ else #print "not processed --> ", fns, "\n"
+ end
+ else Operations.new(@opt).not_found
+ end
+ elsif FileTest.file?(put)
+ case @req
+ when /^urls$/; SiSU_urls::Source.new(@opt).read # -u -v -V -M
+ when /^remote_put$/
+ case @message
+ when /scp/; SiSU_Remote::Put.new(@opt).scp # -r
+ when /rsync/; SiSU_Remote::Put.new(@opt).rsync # -R
+ else #SiSU_Remote::Put.new(put,@opt.cmd).scp
+ end
+ end
+ else Operations.new(@opt).not_found
+ end
+ end
+ end
+ elsif @req =~/^dbi$/; SiSU_DBI::SiSU_SQL.new(@opt).connect # -D -d
+ elsif @req=~/^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S
+ end
+ Operations.new.counter
+ end
+ end
+ class Operations
+ @@n_do=0
+ def initialize(opt='')
+ @opt=opt
+ @cX=SiSU_Screen::Ansi.new(@opt).cX
+ end
+ def counter
+ @@n_do=0
+ end
+ def remote_put_base_site_rsync # -CR
+p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
+ require SiSU_lib + '/remote_put'
+ SiSU_Remote::Put.new(@opt).rsync_base
+ end
+ def remote_put_base_site_rsync_match # -CCRZ
+p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
+ require SiSU_lib + '/remote_put'
+ SiSU_Remote::Put.new(@opt).rsync_base_sync
+ end
+ def remote_put_base_site # -Cr
+p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
+ require SiSU_lib + '/remote_put'
+ SiSU_Remote::Put.new(@opt).scp_base
+ end
+ def remote_put_base_site_all # -CCr
+p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
+ require SiSU_lib + '/remote_put'
+ SiSU_Remote::Put.new(@opt).scp_base_all
+ end
+ def cgi # -F
+ require SiSU_lib + '/cgi'
+ SiSU_CGI::SiSU_search.new(@opt).read
+ end
+ def encoding # -K build character encoding db (uses KirbyBase)
+ require SiSU_lib + '/character_encoding'
+ SiSU_character_encode::Create.new.db
+ end
+ def termsheet # -t
+ system("sisu_termsheet #{@opt.cmd} #{@opt.fns}\n")
+ @@n_do=@@n_do+1
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@@n_do,'Termsheet(s) processed')
+ tell.term_sheet_title unless @opt.cmd =~/q/
+ end
+ def webrick # -W
+ port=prt=@fns
+ prt=if prt !~/\d+/; 'webrick default (sysenv)'
+ else "webrick port set to #{prt}"
+ end
+ puts %{#{@cX.blue}<<#{@cX.off}#{@cX.green}Start Webrick web server on port: #{prt}#{@cX.off}#{@cX.blue}>> #{@cX.off*2} }
+ system("sisu_webrick #{port}&\n")
+ end
+ def semantics
+ end
+ def not_found
+ puts "\n#{@cX.fuschia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.cmd} processing skipped\n"
+ end
+ def convert_name_message(fns,type,i,o,rune)
+ %{\nIn filename: "#{@cX.fuschia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuschia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.cmd} processing skipped\n}
+ end
+ def not_recognised
+ case @opt.fns
+ when /(\.s[123])$/
+ type=@opt.fns.gsub(/\S+?(#{$1})/,'\1')
+ rune=%q{rename 's/\.s[123]$/\.sst/' *.s{1,2,3}}
+ puts convert_name_message(@opt.fns,type,'.s1 .s2 and .s3','.sst',rune)
+ when /(\.r[123])$/
+ type=@opt.fns.gsub(/\S+?(#{$1})/,'\1')
+ rune=%q{rename 's/\.r[123]$/\.ssm/' *.r{1,2,3}}
+ puts convert_name_message(@opt.fns,type,'.r1 .r2 and .r3','.sst',rune)
+ puts %{\n\tNote also that you will need to change the names of the files called/required\n\twithin the document text to build the composite document\n\t\t.s1 .s2 .s3 should be .sst \n\t\t.si should be .ssi\n\trequested #{@opt.cmd} processing skipped\n}
+ when /(\.ssi)$/
+ puts "\n#{@cX.fuschia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.cmd} processing skipped\n"
+ else
+ puts "\n#{@cX.fuschia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.cmd} processing skipped\n"
+ end
+ end
+ end
+ class Processing
+ require 'fileutils'
+ include FileUtils
+ @@env=SiSU_Env::Info_env.new
+ attr_accessor :op
+ def initialize(opt)
+ @opt=opt
+ @msg,@msgs='',nil
+ @tell=lambda { SiSU_Screen::Ansi.new(@opt.cmd,@msg,"#{@msgs.inspect if @msgs}") }
+ end
+ def op(req,msg)
+ Op.new(@opt,req,msg).select if req and msg
+ end
+ def actions
+ if @opt.mod.inspect =~/--convert|--to|--from/; require SiSU_lib + '/sst_convert_markup'
+ end
+ if @opt.cmd =~/([AabCcDdEeFfgGHhIiLMmNnoprRSsTtQqUuVvwWXxYyZ_0-9])/ and
+ @opt.cmd =~/^-/ and
+ @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ or
+ @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ #and
+ @@tell=SiSU_Screen::Ansi.new(@opt.cmd)
+ @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX
+ flag=SiSU_Env::Info_processing_flag.new
+ extra=''
+ if @opt.cmd !~/[mn]/
+ extra+=if @opt.cmd =~/[abBeghHhINoptwXxz]/ and @opt.cmd !~/[mn]/; 'm' #% add dal
+ elsif ((@opt.cmd =~/[Dd]/ or (@opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/)) \
+ and @opt.mod.inspect !~/(?:remove|(?:(?:re)?create(?:all)?|dropall|drop)$)/) \
+ and @opt.cmd !~/[mn]/
+ 'm' #% add dal
+ else ''
+ end
+ end
+ if @opt.cmd !~/y/
+ extra+=if @opt.cmd =~/[abehHhINopsSstwXxz]/ and @opt.cmd !~/y/; 'y' #% add manifest
+ elsif (@opt.cmd =~/[Dd]/ or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/) and @opt.files[0] !~/^remove$/ and @opt.cmd !~/y/; 'y' #% add manifest
+ else ''
+ end
+ end
+ @opt.cmd=@opt.cmd + extra
+ if @opt.cmd =~/[vVM]/ #% version information
+ version=SiSU_Env::Info_version.new.get_version
+ rb_ver=SiSU_Env::Info_version.new.rbversion
+ if version[:version]
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,version[:project],version[:version],version[:date_stamp],version[:date],rb_ver)
+ tell.version
+ SiSU_Help::Help.new('env',@opt).environment if @opt.cmd =~/V/ and @opt.files.empty? #% environment
+ else puts 'SiSU version information not available'
+ end
+ end
+ if @opt.cmd =~/^-L$/; SiSU_Help::Help.new('license',@opt).help_request #% version information
+ end
+ if @opt.cmd =~/m/i #% -m for -C
+ path={}
+ path[:css]=@@env.path.output + '/_sisu/css'
+ path[:xml]=@@env.path.output + '/_sisu/xml'
+ path[:xsd]=path[:xml] + '/xsd'
+ path[:xsd]=path[:xml] + '/rnc'
+ path[:xsd]=path[:xml] + '/rng'
+ #path_dtd="#{@@env.path.output}/_sisu/xml/dtd"
+ re_p=/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/
+ unless @opt.files.join(',') =~ re_p #do not mix pods with source markup files in command line
+ unless ( FileTest.directory?(path[:css]) and FileTest.directory?(path[:xsd]) )
+ @opt.cmd=@opt.cmd +='C' unless @opt.cmd =~/C/ #FIX
+ end
+ if @opt.cmd =~/M/; $VERBOSE=false #debug $VERBOSE=true
+ # -M test other expected directories including images
+ end
+ end
+ end
+ if @opt.cmd =~/C/ #% -C initialize/configure
+ op('conf','configure site')
+ if @opt.cmd =~/R/
+ if @opt.mod.inspect =~/--init(?:ialize)?=site/ and
+ @opt.cmd =~/RZ/
+ Operations.new(@opt).remote_put_base_site_rsync_match
+ else Operations.new(@opt).remote_put_base_site_rsync
+ end
+ elsif @opt.cmd =~/r/
+ if @opt.mod.inspect =~/--init(?:ialize)?=site/ and
+ @opt.cmd =~/CCr/
+ Operations.new(@opt).remote_put_base_site_all
+ else Operations.new(@opt).remote_put_base_site
+ end
+ end
+ end
+ if @opt.cmd =~/F/ #% -F cgi sample search form
+ Operations.new(@opt).cgi
+ end
+ if @opt.cmd =~/W/; Operations.new(@opt).webrick #% -W webrick #@argv==port
+ end
+ if @opt.cmd =~/k/ #% -k dummy, build character encoding table
+ #Operations.new(@opt.cmd).encoding
+ end
+ if @opt.cmd =~/Z/; op('zap','Zap, deletions') #% -Z wipe previous output clean
+ end
+ if @opt.cmd =~/s/; op('share_src','SiSU markup source') #% -s sisu source
+ end
+ if @opt.cmd =~/m/ #% -m is remote url requested? (download if)
+ @retry_count= -1
+ begin
+ path_image='./_sisu/processing/external_document/image'
+ path_skin='./_sisu/processing/external_document/skin/doc'
+ @get_s,@get_p=[],[]
+ re_s=/(http:\/\/\S+?\.sst)/
+ re_p=/(http:\/\/\S+?(?:\/sisupod(?:\.zip)?|\.ssp))/
+ @opt.files.each do |fns|
+ if fns =~re_s
+ @get_s << re_s.match(fns)[1] if re_s
+ end
+ if fns =~re_p
+ @get_p << re_p.match(fns)[1] if re_p
+ end
+ end
+ if @get_s.length > 0 #% remote markup file .sst
+ require 'open-uri'
+ require 'pp'
+ require SiSU_lib + '/composite'
+ @rgx_image=/\{\s*(\S+?\.(?:png|jpg|gif))/
+ @rgx_skin=/^0~skin\s+(\S+)/
+ threads = []
+ for requested_page in @get_s
+ threads << Thread.new(requested_page) do |url|
+ open(url) do |f|
+ raise "#{url} not found" unless f
+ re_fnb=/(http:\/\/[^\/ ]+?\/[^\/ ]+?)\/\S+?\/([^\/]+?)\.ss(t)/ #revisit and remove DO
+ base_uri,fnb,instr=re_fnb.match(url)[1..3] if re_fnb
+ imagedir = base_uri + '/_sisu/image_local' #check on
+ doc_skin_dir = /(http:\/\/\S+?)\/[^\/]+?\.sst$/.match(url).captures.join + '/_sisu/skin/doc'
+ #"Got file, and ready to process: #{fnb}.t#{instr}"
+ downloaded_file=File.new("#{fnb}.-sst",'w+')
+ images=SiSU_Assemble::Remote_image.new.image(imagedir)
+ skin=SiSU_Assemble::Remote_image.new.image(doc_skin_dir)
+ f.collect.each do |r| # work area
+ skin << r.scan(@rgx_skin).uniq if r =~@rgx_skin
+ images << r.scan(@rgx_image).uniq if r =~@rgx_image
+ downloaded_file << r
+ end
+ if skin and skin.length > 0
+ SiSU_Assemble::Remote_image.new.download_doc_skin(skin)
+ end
+ if images and images.length > 1
+ images.flatten!.uniq!
+ @msg,@msgs='downloading images:', [ images.join(',') ]
+ @tell.call.warn unless @opt.cmd =~/q/
+ SiSU_Assemble::Remote_image.new.download_images(images)
+ @msg,@msgs='downloading done',nil
+ @tell.call.warn unless @opt.cmd =~/q/
+ end
+ downloaded_file.close
+ end
+ end
+ end
+ Operations.new.counter
+ end
+ threads.each {|thr| thr.join} if threads #and threads.length > 0
+ if @get_p.length > 0 #% remote sisupod
+ require 'net/http'
+ for requested_pod in @get_p
+ pod_info=Remote_download.new(requested_pod)
+ @opt.fns=pod_info.pod.name
+ Net::HTTP.start(pod_info.pod.site) do |http|
+ resp = http.get("#{pod_info.pod.path}/#{pod_info.pod.name_source}")
+ open(pod_info.pod.name,'wb') do |file|
+ file.write(resp.body)
+ end
+ end
+ end
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt,@fns).error #ok
+ @retry_count +=1
+ retry unless @retry_count > 1
+ ensure
+ end
+ @opt.files=@opt.files.collect {|x| x=x.gsub(/http:\/\/\S+\/(\S+)\.sst/,'\1.-sst') }
+ end
+ if @opt.cmd=~/m/; op('dal','dal') #% -m dal
+ end
+ @opt.files=@opt.files.collect {|x| x=x.gsub(/\.ssm$/,'._sst') }
+ if @opt.cmd =~/S/
+ op('sisupod_make','sisupod (zip)') #% -S make sisupod
+ if @opt.fns=~/\.kdi._sst/
+ op('share_src_kdissert','kdissert (kdi)') #% -S share kdissert source
+ end
+ end
+ if @opt.cmd =~/N/; op('digests','digests') #% -N digest tree
+ end
+ if @opt.cmd =~/[hHz]/; op('html','html') #% -h -H -z html css
+ end
+ if @opt.cmd =~/[aAfeE]/; op('plaintext','plaintext') #% -a -A -f -e -E plaintext -a creates ms-dos type; -A creates unix type, plaintext file
+ end
+ if @opt.cmd =~/g/; op('wikispeak','wikispeak') #% -g wiki
+ end
+ if @opt.cmd =~/o/; op('odf','OpenDocument') #% -o opendocument
+ end
+ if @opt.cmd =~/x/; op('xml','xml sax') #% -x xml sax type
+ end
+ if @opt.cmd =~/X/; op('xml_dom','xml dom') #% -X xml dom type
+ end
+ if @opt.cmd =~/b/; op('xhtml','xhtml sax') #% -b xhtml sax type
+ end
+ if @opt.cmd =~/B/; op('docbook','docbook xml') #% -B docbook xml
+ end
+ if @opt.cmd =~/w/; op('concordance','Concordance') #% -w concordance
+ end
+ if @opt.cmd =~/t/ #% -t termsheet/standard form
+ SiSU_Help::Help.new('termsheet').help_request
+ @opt.files.each do |fns|
+ if FileTest.file?(fns)
+ @opt.fns=fns
+ case @opt.fns
+ when /\.(termsheet.rb)$/; Operations.new(@opt).termsheet
+ else #print "not processed --> ", fns, "\n"
+ end
+ else Operations.new(@opt).not_found
+ end
+ end
+ Operations.new.counter
+ end
+ if @opt.cmd =~/p/; op('texpdf','LaTeX pdf') #% -p latex/ texpdf
+ end
+ if @opt.cmd =~/I/; op('texinfo','TeX Info') #% -I texinfo (i taken by db import)
+ end
+ if @opt.cmd =~/D/ or @opt.mod.inspect =~/--pgsql/; op('dbi','postgresql') #% -D DB postgresql
+ end
+ if @opt.cmd =~/d/ or @opt.mod.inspect =~/--sqlite/; op('dbi','sqlite') #% -d DB sqlite
+ end
+ if @opt.cmd =~/G/; Operations.new(@opt).cgi #% -G cgi - used to make dbi intecface
+ end
+ if @opt.cmd =~/y/; op('manifest','Manifest') #% -y manifest
+ end
+ if @opt.cmd =~/Y/; op('sitemaps','Sitemap') #% -Y sitemap
+ end
+ if @opt.cmd =~/r/; op('remote_put','scp') #% -r copy to remote server
+ end
+ if @opt.cmd =~/R/; op('remote_put','rsync') #% -R copy to remote server
+ end
+ if @opt.cmd =~/[QuUvVM]/; op('urls','urls') #% -Q -u -v -V -M urls
+ end
+ @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil
+ @tell.call.print_brown if @opt.cmd =~/[uUvVM]/ unless @opt.files.join.empty?
+ if defined? @@env.path.processing and FileTest.directory?(@@env.path.processing) and @@env.path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area
+ cd(@@env.path.processing_base_tmp) do
+ rm_rf(@@env.user) unless @opt.cmd =~/M/
+ end
+ end
+ elsif @opt.mod.inspect =~/--query/
+ require SiSU_lib + '/sst_identify_markup'
+ puts SiSU_Markup::Markup_history.new(@opt).query
+ elsif @opt.mod.inspect =~/--identify/
+ require SiSU_lib + '/sst_identify_markup'
+ markup_version=SiSU_Markup::Markup_identify.new(@opt).markup_version?
+ elsif @opt.mod.inspect =~/--about/ #% help instructions
+ if @opt.mod.inspect =~/--about/ and not @opt.what.empty?; SiSU_Help::Help.new(@opt.what,'color_off').help_request
+ else SiSU_Help::Help.new('list','color_off').help_request
+ end
+ elsif @opt.mod.inspect =~/--sitemaps/ #% sitemaps
+ require SiSU_lib + '/sitemaps'
+ SiSU_Sitemaps::Source.new(@opt).read
+ if @opt.cmd =~/R/
+ require SiSU_lib + '/remote_put'
+ SiSU_Remote::Put.new(@opt).rsync_sitemaps
+ end
+ else #% help instructions
+ unless @opt.mod.inspect =~/--convert|--to|--from/
+ if @opt.mod.inspect =~/--help/ and not @opt.what.empty?; SiSU_Help::Help.new(@opt.what).help_request
+ else SiSU_Help::Help.new('list').help_request
+ end
+ end
+ end
+ @opt.files.each do |fns|
+ if FileTest.file?(fns)
+ @opt.fns=fns
+ unless @opt.fns =~ /(?:\.(?:[_-]?sst|ssp|sx[sdn]\.xml|termsheet.rb)|sisupod(?:\.zip)?)$/
+ if @opt.fns=~/\.kdi$/ and @opt.mod.inspect =~/--(?:convert(?:-from)?|from)[=-]kdi/
+ elsif @opt.fns=~/\.sx[sdn]\.xml$/ and @opt.mod.inspect =~/--(?:(?:convert(?:-from)?|from)[=-])?(?:xml2sst|sxml)/
+ elsif @opt.fns=~/\.ssi$/ and @opt.mod.inspect =~/--identify/
+ else Operations.new(@opt).not_recognised
+ end
+ end
+ if @opt.fns =~/\._sst$/ and @opt.cmd !~/[S_M]/ # rework necessry, revist, the _ flag is a hack, to keep ._sst files
+ @msg,@msgs='temporary file removed',nil
+ @tell.call.warn unless @opt.cmd =~/V/
+ File.unlink(@opt.fns) if File.exists?(@opt.fns) #CONSIDER
+ end
+ else #Operations.new(fns,'html').not_found
+ end
+ end
+ end
+ end
+ begin #% select what to do
+ require 'jcode'
+ $KCODE='UTF8'
+ require SiSU_lib + '/options'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Screen
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ require SiSU_lib + '/defaults'
+ include SiSU_Viz
+ require SiSU_lib + '/help'
+ include SiSU_Help
+ require 'uri'
+ home=ENV['HOME']
+ argv=$*
+ @opt=SiSU_commandline::Options.new(argv)
+ Processing.new(@opt).actions
+ rescue; STDERR.puts SiSU_Screen::Ansi.new(@opt,$!,$@,nil).rescue #fix
+ ensure
+ Dir.chdir(@@pwd)
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/i18n.rb b/lib/sisu/0.52/i18n.rb
new file mode 100644
index 00000000..311b90ee
--- /dev/null
+++ b/lib/sisu/0.52/i18n.rb
@@ -0,0 +1,1528 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: document summary processing, available outputs and metadata
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Translate
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Param
+ class Source
+ def initialize(md,doc_lang,trans_str='')
+ @md,@doc_lang,@trans_str=md,doc_lang,trans_str
+ @lang_class=case @doc_lang
+ when /American/i; English.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2
+ when /English/i; English.new(md,doc_lang,trans_str)
+ when /French/i; French.new(md,doc_lang,trans_str)
+ when /German/i; German.new(md,doc_lang,trans_str)
+ when /Italian/i; Italian.new(md,doc_lang,trans_str)
+ when /Spanish/i; Spanish.new(md,doc_lang,trans_str)
+ when /Brazilian(?: Portuguese)?/i; Portuguese.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2
+ when /Portuguese/i; Portuguese.new(md,doc_lang,trans_str)
+ when /Swedish/i; Swedish.new(md,doc_lang,trans_str)
+ when /Danish/i; Danish.new(md,doc_lang,trans_str)
+ when /Finnish/i; Finnish.new(md,doc_lang,trans_str)
+ when /Norwegian/i; Norwegian.new(md,doc_lang,trans_str)
+ when /Icelandic/i; Icelandic.new(md,doc_lang,trans_str)
+ when /Dutch/i; Dutch.new(md,doc_lang,trans_str)
+ when /Estonian/i; Estonian.new(md,doc_lang,trans_str)
+ when /Hungarian/i; Hungarian.new(md,doc_lang,trans_str)
+ when /Polish/i; Polish.new(md,doc_lang,trans_str)
+ when /Romanian/i; Romanian.new(md,doc_lang,trans_str)
+ when /Russian/i; Russian.new(md,doc_lang,trans_str)
+ when /Greek/i; Greek.new(md,doc_lang,trans_str)
+ when /Ukranian/i; Ukranian.new(md,doc_lang,trans_str)
+ when /Turkish/i; Turkish.new(md,doc_lang,trans_str)
+ when /Slovenian/i; Slovenian.new(md,doc_lang,trans_str)
+ when /Croatian/i; Croatian.new(md,doc_lang,trans_str)
+ when /Slovak(?:ian)?/i; Slovak.new(md,doc_lang,trans_str)
+ when /Czech/i; Czech.new(md,doc_lang,trans_str)
+ when /Bulgarian/i; Bulgarian.new(md,doc_lang,trans_str)
+ else English.new(md,doc_lang,trans_str)
+ end
+ end
+ def filename
+ @lang_class.filename
+ end
+ def description
+ @lang_class.description
+ end
+ def metadata
+ @lang_class.metadata
+ end
+ def file_size
+ @lang_class.file_size
+ end
+ def sourcefile
+ @lang_class.sourcefile
+ end
+ def sourcefile_digest
+ @lang_class.sourcefile_digest
+ end
+ def dc_title
+ @lang_class.dc_title
+ end
+ def title
+ @lang_class.title
+ end
+ def subtitle
+ @lang_class.subtitle
+ end
+ def creator
+ @lang_class.creator
+ end
+ def contributor
+ @lang_class.contributor
+ end
+ def translator
+ @lang_class.translator
+ end
+ def illustrator
+ @lang_class.illustrator
+ end
+ def publisher
+ @lang_class.publisher
+ end
+ def prepared_by
+ @lang_class.prepared_by
+ end
+ def digitized_by
+ @lang_class.digitized_by
+ end
+ def subject
+ @lang_class.subject
+ end
+ def dc_description
+ @lang_class.dc_description
+ end
+ def abstract
+ @lang_class.abstract
+ end
+ def type
+ @lang_class.type
+ end
+ def rights
+ @lang_class.rights
+ end
+ def digitized_by
+ @lang_class.digitized_by
+ end
+ def date
+ @lang_class.date
+ end
+ def date_created
+ @lang_class.date_created
+ end
+ def date_available
+ @lang_class.date_available
+ end
+ def date_valid
+ @lang_class.date_valid
+ end
+ def date_modified
+ @lang_class.date_modified
+ end
+ def date_issued
+ @lang_class.date_issued
+ end
+ def language
+ @lang_class.language
+ end
+ def language_original
+ @lang_class.language_original
+ end
+ def format
+ @lang_class.format
+ end
+ def identifier
+ @lang_class.identifier
+ end
+ def source
+ @lang_class.source
+ end
+ def relation
+ @lang_class.relation
+ end
+ def coverage
+ @lang_class.coverage
+ end
+ def keywords
+ @lang_class.keywords
+ end
+ def comments
+ @lang_class.comments
+ end
+ def cls_loc
+ @lang_class.cls_loc
+ end
+ def cls_dewey
+ @lang_class.cls_dewey
+ end
+ def cls_gutenberg
+ @lang_class.cls_gutenberg
+ end
+ def cls_isbn
+ @lang_class.cls_isbn
+ end
+ def prefix_a
+ @lang_class.prefix_a
+ end
+ def prefix_b
+ @lang_class.prefix_b
+ end
+ def fns
+ @lang_class.fns
+ end
+ def word_count
+ @lang_class.word_count
+ end
+ def dgst
+ @lang_class.dgst
+ end
+ def sc_number
+ @lang_class.sc_number
+ end
+ def sc_date
+ @lang_class.sc_date
+ end
+ def last_generated
+ @lang_class.last_generated
+ end
+ def sisu_version
+ @lang_class.sisu_version
+ end
+ def ruby_version
+ @lang_class.ruby_version
+ end
+ def suggested_links
+ @lang_class.suggested_links
+ end
+ def language_version_list
+ @lang_class.language_version_list
+ end
+ def language
+ @lang_class.language
+ end
+ def manifest_description_output
+ @lang_class.manifest_description_output
+ end
+ def manifest_description_metadata
+ @lang_class.manifest_description_metadata
+ end
+ def language_list_translated
+ @lang_class.language_list
+ end
+ def language_list
+ lang=case @trans_str
+ when /American/i; 'American English' # tag depreciated, see iso 639-2
+ when /English/i; 'English'
+ when /French/i; 'français'
+ when /German/i; 'Deutsch'
+ when /Italian/i; 'Italiano'
+ when /Spanish/i; 'español'
+ when /Brazilian(?: Portuguese)?/i; 'Brazilian Português' # tag depreciated, see iso 639-2
+ when /Portuguese/i; 'Português'
+ when /Swedish/i; 'svenska'
+ when /Danish/i; 'dansk'
+ when /Finnish/i; 'suomi'
+ when /Norwegian/i; 'norsk'
+ when /Icelandic/i; 'Icelandic'
+ when /Dutch/i; 'Nederlands'
+ when /Estonian/i; 'Estonian'
+ when /Hungarian/i; 'Hungarian'
+ when /Polish/i; 'polski'
+ when /Romanian/i; 'română'
+ when /Russian/i; 'Русский (Russkij)'
+ when /Greek/i; 'Ελληνικά (Ellinika)'
+ when /Ukranian/i; 'українська (ukrajins\'ka)'
+ when /Turkish/i; 'Türkçe'
+ when /Slovenian/i; 'Slovenian'
+ when /Croatian/i; 'Croatian'
+ when /Slovak(?:ian)?/i; 'slovensky' #slovensky ?
+ when /Czech/i; 'česky'
+ when /Bulgarian/i; 'Български (Bəlgarski)'
+ when /Japanese/i; '日本語 (Nihongo)'
+ when /Korean/i; '한국어 (Hangul)'
+ #when /Catalan/i; 'català'
+ else 'English'
+ end
+ #check on 中文 and عربي
+ end
+ end
+ class English
+ def initialize(md,doc_lang,trans_str)
+ @md,@doc_lang,@trans_str=md,doc_lang,trans_str
+ end
+ def filename
+ 'filename'
+ end
+ def description
+ 'description'
+ end
+ def metadata
+ 'metadata'
+ end
+ def file_size
+ 'file size'
+ end
+ def dc_title
+ 'DC Title'
+ end
+ def title
+ 'Title'
+ end
+ def subtitle
+ 'Subtitle'
+ end
+ def creator
+ 'DC Creator'
+ end
+ def contributor
+ 'DC Contributor'
+ end
+ def translator
+ 'Translator'
+ end
+ def illustrator
+ 'Illustrator'
+ end
+ def publisher
+ 'DC Publisher'
+ end
+ def prepared_by
+ 'Prepared by'
+ end
+ def digitized_by
+ 'Digitized by'
+ end
+ def subject
+ 'DC Subject'
+ end
+ def dc_description
+ 'DC Description'
+ end
+ def abstract
+ 'DC Abstract'
+ end
+ def type
+ 'DC Type'
+ end
+ def rights
+ 'DC Rights'
+ end
+ def date
+ 'DC Date'
+ end
+ def date_created
+ 'DC Date created'
+ end
+ def date_issued
+ 'DC Date issued'
+ end
+ def date_available
+ 'DC Date available'
+ end
+ def date_modified
+ 'DC Date modified'
+ end
+ def date_valid
+ 'DC Date valid'
+ end
+ def language
+ 'DC Language'
+ end
+ def language_original
+ 'Original Language'
+ end
+ def format
+ 'DC Format'
+ end
+ def identifier
+ 'DC Identifier'
+ end
+ def source
+ 'DC Source'
+ end
+ def relation
+ 'DC Relation'
+ end
+ def coverage
+ 'DC Coverage'
+ end
+ def keywords
+ 'Keywords'
+ end
+ def comments
+ 'Comments'
+ end
+ def cls_loc
+ 'Classify Library of Congress'
+ end
+ def cls_dewey
+ 'Classify Dewey'
+ end
+ def cls_gutenberg
+ 'Classify Project Gutenberg'
+ end
+ def cls_isbn
+ 'Classify ISBN'
+ end
+ def prefix_a
+ 'Prefix (a)'
+ end
+ def prefix_b
+ 'Prefix (b)'
+ end
+ def sourcefile
+ 'Sourcefile'
+ end
+ def word_count
+ 'Word Count approximate'
+ end
+ def sourcefile_digest
+ 'Sourcefile Digest'
+ end
+ def digest_md5
+ 'Sourcefile Digest (md5)'
+ end
+ def digest_sha256
+ 'Sourcefile Digest (sha256)'
+ end
+ def sc_number
+ 'Document (RCS/CVS) number'
+ end
+ def sc_date
+ 'Document (RCS/CVS) number'
+ end
+ def last_generated
+ 'Document (metaverse) last generated'
+ end
+ def sisu_version
+ 'Generated by'
+ end
+ def ruby_version
+ 'Ruby version'
+ end
+ def suggested_links
+ 'metadata suggested links'
+ end
+ def language_version_list
+ 'Document Language Versions, manifests'
+ end
+ def manifest_description_output
+ 'SiSU manifest of generated output'
+ end
+ def manifest_description_metadata
+ 'SiSU manifest of document metadata'
+ end
+ def language_list_translated
+ lang=case @trans_str
+ when /American/i; 'American English' # tag depreciated, see iso 639-2
+ when /English/i; 'English'
+ when /French/i; 'French'
+ when /German/i; 'German'
+ when /Italian/i; 'Italian'
+ when /Spanish/i; 'Spanish'
+ when /Brazilian(?: Portuguese)?/i; 'Brazilian Portuguese' # tag depreciated, see iso 639-2
+ when /Portuguese/i; 'Portuguese'
+ when /Swedish/i; 'Swedish'
+ when /Danish/i; 'Danish'
+ when /Finnish/i; 'Finnish'
+ when /Norwegian/i; 'Norwegian'
+ when /Icelandic/i; 'Icelandic'
+ when /Dutch/i; 'Dutch'
+ when /Estonian/i; 'Estonian'
+ when /Hungarian/i; 'Hungarian'
+ when /Polish/i; 'Polish'
+ when /Romanian/i; 'Romanian'
+ when /Russian/i; 'Russian'
+ when /Greek/i; 'Greek'
+ when /Ukranian/i; 'Ukranian'
+ when /Turkish/i; 'Turkish'
+ when /Slovenian/i; 'Slovenian'
+ when /Croatian/i; 'Croatian'
+ when /Slovak(?:ian)?/i; 'Slovakian'
+ when /Czech/i; 'Czech'
+ when /Bulgarian/i; 'Bulgarian'
+ else @trans_str
+ end
+ end
+ end
+ class French
+ def initialize(md,doc_lang,trans_str)
+ @md,@doc_lang,@trans_str=md,doc_lang,trans_str
+ end
+ def filename
+ 'nom de fichier'
+ end
+ def description
+ 'description'
+ end
+ def metadata
+ 'metadonnées'
+ end
+ def file_size
+ 'taille'
+ end
+ def dc_title
+ 'Titre (DC)'
+ end
+ def title
+ 'Titre'
+ end
+ def subtitle
+ 'Sous titre'
+ end
+ def creator
+ 'Auteur (DC)'
+ end
+ def contributor
+ 'Contributeur (DC)'
+ end
+ def translator
+ 'Traducteur'
+ end
+ def illustrator
+ 'Illustrateur'
+ end
+ def publisher
+ 'Éditeur (DC)'
+ end
+ def prepared_by
+ 'Préparé par'
+ end
+ def digitized_by
+ 'Numérisé par'
+ end
+ def subject
+ 'Sujet (DC)'
+ end
+ def dc_description
+ 'Description (DC)'
+ end
+ def abstract
+ 'Résumé (DC)'
+ end
+ def type
+ 'Type (DC)'
+ end
+ def rights
+ 'Droits relatifs à la ressource (DC)'
+ end
+ def date
+ 'Date (DC)'
+ end
+ def date_created
+ 'Date de création (DC)'
+ end
+ def date_issued
+ 'Date de publication (DC)'
+ end
+ def date_available
+ 'Date de mise à disposition (DC)'
+ end
+ def date_modified
+ 'Date de modification (DC)'
+ end
+ def date_valid
+ 'Date de validité (DC)'
+ end
+ def language
+ 'Langue (DC)'
+ end
+ def language_original
+ 'Langue originale'
+ end
+ def format
+ 'Format (DC)'
+ end
+ def identifier
+ 'Identifiant (DC)'
+ end
+ def source
+ 'Source (DC)'
+ end
+ def relation
+ 'Lien (DC)'
+ end
+ def coverage
+ 'Portée du document (DC)'
+ end
+ def keywords
+ 'Mots clef'
+ end
+ def comments
+ 'Commentaires'
+ end
+ def cls_loc
+ 'Classification de la bibliothèque du congres'
+ end
+ def cls_dewey
+ 'Classification Dewey'
+ end
+ def cls_gutenberg
+ 'Classification du project Gutenberg'
+ end
+ def cls_isbn
+ 'Classification ISBN'
+ end
+ def prefix_a
+ 'Préfixe (a)'
+ end
+ def prefix_b
+ 'Préfixe (b)'
+ end
+ def sourcefile
+ 'Fichier source'
+ end
+ def word_count
+ 'Nombre approximatif de mots'
+ end
+ def sourcefile_digest
+ 'Condensé du fichier source'
+ end
+ def digest_md5
+ 'Condensé du fichier source (md5)'
+ end
+ def digest_sha256
+ 'Condensé du fichier source (sha256)'
+ end
+ def sc_number
+ 'Numéro (RCS/CVS) du document'
+ end
+ def sc_date
+ 'Numéro (RCS/CVS) du document'
+ end
+ def last_generated
+ 'Dernière production du document (metaverse)'
+ end
+ def sisu_version
+ 'Généré par'
+ end
+ def ruby_version
+ 'Version de Ruby'
+ end
+ def suggested_links
+ 'Liens suggérés'
+ end
+ def language_version_list
+ 'Versions des langues du document, manifestes'
+ end
+ def manifest_description_output
+ 'Manifeste SiSU du document généré'
+ end
+ def manifest_description_metadata
+ 'Manifeste SiSU des métadonnées du document'
+ end
+ def language_list_translated
+ lang=case @trans_str
+ when /American/i; 'Anglais americain' # tag depreciated, see iso 639-2
+ when /English/i; 'Anglais'
+ when /French/i; 'Français'
+ when /German/i; 'Allemand'
+ when /Italian/i; 'Italien'
+ when /Spanish/i; 'Espagnol'
+ when /Brazilian(?: Portuguese)?/i; 'Portugais brésilien' # tag depreciated, see iso 639-2
+ when /Portuguese/i; 'Portugais'
+ when /Swedish/i; 'Suédois'
+ when /Danish/i; 'Danois'
+ when /Finnish/i; 'Finnois'
+ when /Norwegian/i; 'Norvégien'
+ when /Icelandic/i; 'Islandais'
+ when /Dutch/i; 'Néerlandais'
+ when /Estonian/i; 'Estonien'
+ when /Hungarian/i; 'Hongrois'
+ when /Polish/i; 'Polonais'
+ when /Romanian/i; 'Roumain'
+ when /Russian/i; 'Russe'
+ when /Greek/i; 'Grec'
+ when /Ukranian/i; 'Ukrainien'
+ when /Turkish/i; 'Turc'
+ when /Slovenian/i; 'Slovène'
+ when /Croatian/i; 'Croate'
+ when /Slovak(?:ian)?/i; 'Slovaque'
+ when /Czech/i; 'Tcheque'
+ when /Bulgarian/i; 'Bulgare'
+ else @trans_str
+ end
+ end
+ end
+ class German
+ def initialize(md,doc_lang,trans_str)
+ @md,@doc_lang,@trans_str=md,doc_lang,trans_str
+ end
+ def filename
+ 'Dateiname'
+ end
+ def description
+ 'Beschreibung'
+ end
+ def metadata
+ 'Metadata'
+ end
+ def file_size
+ 'Dateigrösse'
+ end
+ def dc_title
+ 'DC Titel'
+ end
+ def title
+ 'Titel'
+ end
+ def subtitle
+ 'Untertitel'
+ end
+ def creator
+ 'Autor'
+ end
+ def contributor
+ 'DC Mitautor'
+ end
+ def translator
+ 'Übersetzung'
+ end
+ def illustrator
+ 'Illustrator'
+ end
+ def publisher
+ 'Herausgeber'
+ end
+ def prepared_by
+ 'gesetzt von'
+ end
+ def digitized_by
+ 'digitalisiert von'
+ end
+ def subject
+ 'Titel'
+ end
+ def dc_description
+ 'Beschreibung'
+ end
+ def abstract
+ 'DC Abstract'
+ end
+ def type
+ 'Typ'
+ end
+ def rights
+ 'Rechte'
+ end
+ def date
+ 'Datum'
+ end
+ def date_created
+ 'Erstellung'
+ end
+ def date_issued
+ 'Herausgabe'
+ end
+ def date_available
+ 'Veröffentlichung'
+ end
+ def date_modified
+ 'Modifikation'
+ end
+ def date_valid
+ 'Gültigkeit'
+ end
+ def language
+ 'Sprache'
+ end
+ def language_original
+ 'Ursprungssprache'
+ end
+ def format
+ 'DC Format'
+ end
+ def identifier
+ 'DC Bezeichnung'
+ end
+ def source
+ 'DC Quelle'
+ end
+ def relation
+ 'DC Beziehung'
+ end
+ def coverage
+ 'DC Eingrenzung'
+ end
+ def keywords
+ 'Schlüsselwörter'
+ end
+ def comments
+ 'Kommentare'
+ end
+ def cls_loc
+ 'Klassifikation nach Library of Congress'
+ end
+ def cls_dewey
+ 'Klassifikation nach Dewey'
+ end
+ def cls_gutenberg
+ 'Klassifikation nach Projekt Gutenberg'
+ end
+ def cls_isbn
+ 'Klassifikation nach ISBN'
+ end
+ def prefix_a
+ 'Präfix (a)'
+ end
+ def prefix_b
+ 'Präfix (b)'
+ end
+ def sourcefile
+ 'Quelldatei'
+ end
+ def word_count
+ 'Anzahl Wörter'
+ end
+ def sourcefile_digest
+ 'Quelldatei Digest'
+ end
+ def digest_md5
+ 'Prüfsumme der Quelldatei (MD5)'
+ end
+ def digest_sha256
+ 'Prüfsumme der Quelldatei (SHA256)'
+ end
+ def sc_number
+ 'Dokumentversion (RCS/CVS)'
+ end
+ def sc_date
+ 'Dokumentdatum (RCS/CVS)'
+ end
+ def last_generated
+ 'Letzte Erstellung (metaverse)'
+ end
+ def sisu_version
+ 'erstellt bei'
+ end
+ def ruby_version
+ 'Ruby Version'
+ end
+ def suggested_links
+ 'empfohlene Links'
+ end
+ def language_version_list
+ 'verfügbare Sprachen'
+ end
+ def manifest_description_output
+ 'SiSU Zusammenfassung des Dokumentes'
+ end
+ def manifest_description_metadata
+ 'SiSU Zusammenfassung der Metadaten'
+ end
+ def language_list_translated
+ lang=case @trans_str
+ when /American/i; 'Amerikanisch-Englisch' # tag depreciated, see iso 639-2
+ when /English/i; 'Englisch'
+ when /French/i; 'Französisch'
+ when /German/i; 'Deutsch'
+ when /Italian/i; 'Italienisch'
+ when /Spanish/i; 'Spanisch'
+ when /Brazilian(?: Portuguese)?/i; 'Brasilianisch-Portugiesisch' # tag depreciated, see iso 639-2
+ when /Portuguese/i; 'Portugiesisch'
+ when /Swedish/i; 'Schwedisch'
+ when /Danish/i; 'Dänisch'
+ when /Finnish/i; 'Finnisch'
+ when /Norwegian/i; 'Norwegisch'
+ when /Icelandic/i; 'Isländisch'
+ when /Dutch/i; 'Niederländisch'
+ when /Estonian/i; 'Estnisch'
+ when /Hungarian/i; 'Ungarisch'
+ when /Polish/i; 'Polnisch'
+ when /Romanian/i; 'Rumänisch'
+ when /Russian/i; 'Russisch'
+ when /Greek/i; 'Griechisch'
+ when /Ukranian/i; 'Ukrainisch'
+ when /Turkish/i; 'Türkisch'
+ when /Slovenian/i; 'Slovenisch'
+ when /Croatian/i; 'Kroatisch'
+ when /Slovak(?:ian)?/i; 'Slovakisch'
+ when /Czech/i; 'Tschechisch'
+ when /Bulgarian/i; 'Bulgarisch'
+ else @trans_str
+ end
+ end
+ end
+ class Spanish
+ def initialize(md,doc_lang,trans_str)
+ @md,@doc_lang,@trans_str=md,doc_lang,trans_str
+ end
+ def filename
+ 'nombre del fichero'
+ end
+ def description
+ 'descripción'
+ end
+ def metadata
+ 'metadatos'
+ end
+ def file_size
+ 'tamaño del fichero'
+ end
+ def dc_title
+ 'Título DC'
+ end
+ def title
+ 'Título'
+ end
+ def subtitle
+ 'Subtítulo'
+ end
+ def creator
+ 'Creador DC'
+ end
+ def contributor
+ 'Contribuidor DC'
+ end
+ def translator
+ 'Traductor'
+ end
+ def illustrator
+ 'Ilustrador'
+ end
+ def publisher
+ 'Editor DC'
+ end
+ def prepared_by
+ 'Preparado por'
+ end
+ def digitized_by
+ 'Digitalizado por'
+ end
+ def subject
+ 'Asunto DC'
+ end
+ def dc_description
+ 'Descripción DC'
+ end
+ def abstract
+ 'Resumen DC'
+ end
+ def type
+ 'Tipo DC'
+ end
+ def rights
+ 'Derechos DC'
+ end
+ def date
+ 'Fecha DC'
+ end
+ def date_created
+ 'Fecha de creación DC'
+ end
+ def date_issued
+ 'Fecha de publicación DC'
+ end
+ def date_available
+ 'Fecha de disponibilidad DC'
+ end
+ def date_modified
+ 'Fecha de modificación DC'
+ end
+ def date_valid
+ 'Fecha de valided DC'
+ end
+ def language
+ 'Idioma DC'
+ end
+ def language_original
+ 'Lenguaje original'
+ end
+ def format
+ 'Formato DC'
+ end
+ def identifier
+ 'Identificador DC'
+ end
+ def source
+ 'Fuente DC'
+ end
+ def relation
+ 'Relación DC'
+ end
+ def coverage
+ 'Cobertura DC'
+ end
+ def keywords
+ 'Palabras claves'
+ end
+ def comments
+ 'Comentarios'
+ end
+ def cls_loc
+ 'Clasificación Biblioteca del Congreso'
+ end
+ def cls_dewey
+ 'Clasificación Dewey'
+ end
+ def cls_gutenberg
+ 'Clasificación Proyecto Gutenberg'
+ end
+ def cls_isbn
+ 'Clasificación ISBN'
+ end
+ def prefix_a
+ 'Prefijo (a)'
+ end
+ def prefix_b
+ 'Prefijo (b)'
+ end
+ def sourcefile
+ 'Fichero fuente'
+ end
+ def word_count
+ 'Número de palabras apróximado'
+ end
+ def sourcefile_digest
+ 'Resumen del fichero fuente'
+ end
+ def digest_md5
+ 'Resumen del fichero fuente (md5)'
+ end
+ def digest_sha256
+ 'Resumen del fichero fuente (sha256)'
+ end
+ def sc_number
+ 'Versión (RCS/CVS) del documento'
+ end
+ def sc_date
+ 'Versión (RCS/CVS) del documento'
+ end
+ def last_generated
+ 'Última generación (metaverse) del documento'
+ end
+ def sisu_version
+ 'Generado por'
+ end
+ def ruby_version
+ 'Versión de Ruby'
+ end
+ def suggested_links
+ 'enlaces sugeridos de metadatos'
+ end
+ def language_version_list
+ 'Document Language Versions, manifests'
+ end
+ def manifest_description_output
+ 'Manifiesto SiSU de salida generada'
+ end
+ def manifest_description_metadata
+ 'Manifiesto SiSU de metadatos de documento'
+ end
+ def language_list_translated
+ lang=case @trans_str
+ when /American/i; 'Inglés Americano' # tag depreciated, see iso 639-2
+ when /English/i; 'Inglés'
+ when /French/i; 'Francés'
+ when /German/i; 'Alemán'
+ when /Italian/i; 'Italiano'
+ when /Spanish/i; 'Español'
+ when /Brazilian(?: Portuguese)?/i; 'Portugués de Brasil' # tag depreciated, see iso 639-2
+ when /Portuguese/i; 'Portugués'
+ when /Swedish/i; 'Sueco'
+ when /Danish/i; 'Danés'
+ when /Finnish/i; 'Finés'
+ when /Norwegian/i; 'Noruego'
+ when /Icelandic/i; 'Islandés'
+ when /Dutch/i; 'Holandés'
+ when /Estonian/i; 'Estonio'
+ when /Hungarian/i; 'Húngaro'
+ when /Polish/i; 'Polaco'
+ when /Romanian/i; 'Rumano'
+ when /Russian/i; 'Ruso'
+ when /Greek/i; 'Griego'
+ when /Ukranian/i; 'Ucraniano'
+ when /Turkish/i; 'Turco'
+ when /Slovenian/i; 'Eslovaco'
+ when /Croatian/i; 'Croata'
+ when /Slovak(?:ian)?/i; 'Eslovaco'
+ when /Czech/i; 'Checo'
+ when /Bulgarian/i; 'Búlgaro'
+ else @trans_str
+ end
+ end
+ end
+ class Italian
+ def initialize(md,doc_lang,trans_str)
+ @md,@doc_lang,@trans_str=md,doc_lang,trans_str
+ end
+ def filename
+ 'nome del file'
+ end
+ def description
+ 'descrizione'
+ end
+ def metadata
+ 'metadati'
+ end
+ def file_size
+ 'dimensione'
+ end
+ def dc_title
+ 'Titolo (DC)'
+ end
+ def title
+ 'Titolo'
+ end
+ def subtitle
+ 'Sottotitolo'
+ end
+ def creator
+ 'Autore (DC)'
+ end
+ def contributor
+ 'Contributore (DC)'
+ end
+ def translator
+ 'Traduttore'
+ end
+ def illustrator
+ 'Illustratore'
+ end
+ def publisher
+ 'Casa editrice (DC)'
+ end
+ def prepared_by
+ 'Preparato da'
+ end
+ def digitized_by
+ 'Convertito in digitale da'
+ end
+ def subject
+ 'Oggetto (DC)'
+ end
+ def dc_description
+ 'Descrizione (DC)'
+ end
+ def abstract
+ 'Abstract (DC)'
+ end
+ def type
+ 'Tipo (DC)'
+ end
+ def rights
+ 'Diritti del lettore (DC)'
+ end
+ def date
+ 'Data (DC)'
+ end
+ def date_created
+ 'Data di creazione (DC)'
+ end
+ def date_issued
+ 'Data di pubblicazione (DC)'
+ end
+ def date_available
+ 'Data di effettiva disponibilità (DC)'
+ end
+ def date_modified
+ 'Data di ultima modifica (DC)'
+ end
+ def date_valid
+ 'Data di inizo validità (DC)'
+ end
+ def language
+ 'Lingua (DC)'
+ end
+ def language_original
+ 'Lingua originale'
+ end
+ def format
+ 'Formato (DC)'
+ end
+ def identifier
+ 'Indentificatore (DC)'
+ end
+ def source
+ 'Fonte (DC)'
+ end
+ def relation
+ 'Collegamento (DC)'
+ end
+ def coverage
+ 'Ambito (DC)'
+ end
+ def keywords
+ 'Parole chiave'
+ end
+ def comments
+ 'Commenti'
+ end
+ def cls_loc
+ 'Classificazione della Library of Congress'
+ end
+ def cls_dewey
+ 'Classificazione Dewey'
+ end
+ def cls_gutenberg
+ 'Classificazione del Progetto Gutenberg'
+ end
+ def cls_isbn
+ 'Numero ISBN'
+ end
+ def prefix_a
+ 'Premessa (a)'
+ end
+ def prefix_b
+ 'Premessa (b)'
+ end
+ def sourcefile
+ 'Sorgente'
+ end
+ def word_count
+ 'Numero approssimativo di parole'
+ end
+ def sourcefile_digest
+ 'Checksum file sorgente'
+ end
+ def digest_md5
+ 'Checksum file sorgente (md5)'
+ end
+ def digest_sha256
+ 'Checksum file sorgente (sha256)'
+ end
+ def sc_number
+ 'Numero di revisione (RCS/CVS)'
+ end
+ def sc_date
+ 'Numero di revisione (RCS/CVS)'
+ end
+ def last_generated
+ 'Data di ultima generazione (dal metaverse)'
+ end
+ def sisu_version
+ 'Generato da'
+ end
+ def ruby_version
+ 'Ruby versione'
+ end
+ def suggested_links
+ 'Link suggeriti'
+ end
+ def language_version_list
+ 'Traduzioni disponibili'
+ end
+ def manifest_description_output
+ 'Inventario SiSU dell\'output generato'
+ end
+ def manifest_description_metadata
+ 'Inventario SiSU dei metadati'
+ end
+ def language_list_translated
+ lang=case @trans_str
+ when /American/i; 'Inglese USA' # tag depreciated, see iso 639-2
+ when /English/i; 'Inglese'
+ when /French/i; 'Francese'
+ when /German/i; 'Tedesco'
+ when /Italian/i; 'Italiano'
+ when /Spanish/i; 'Spagnolo'
+ when /Brazilian(?: Portuguese)?/i; 'Portoguese (Brasile)' # tag depreciated, see iso 639-2
+ when /Portuguese/i; 'Portoguese'
+ when /Swedish/i; 'Svedese'
+ when /Danish/i; 'Danese'
+ when /Finnish/i; 'Finlandese'
+ when /Norwegian/i; 'Norvegese'
+ when /Icelandic/i; 'Islandese'
+ when /Dutch/i; 'Olandese'
+ when /Estonian/i; 'Estone'
+ when /Hungarian/i; 'Ungherese'
+ when /Polish/i; 'Polacco'
+ when /Romanian/i; 'Romeno'
+ when /Russian/i; 'Russo'
+ when /Greek/i; 'Greco'
+ when /Ukranian/i; 'Ucraino'
+ when /Turkish/i; 'Turco'
+ when /Slovenian/i; 'Sloveno'
+ when /Croatian/i; 'Croato'
+ when /Slovak(?:ian)?/i; 'Slovacco'
+ when /Czech/i; 'Ceco'
+ when /Bulgarian/i; 'Bulgaro'
+ else @trans_str
+ end
+ end
+ end
+ class Finnish
+ def initialize(md,doc_lang,trans_str)
+ @md,@doc_lang,@trans_str=md,doc_lang,trans_str
+ end
+ def filename
+ 'tiedostonimi'
+ end
+ def description
+ 'kuvaus'
+ end
+ def metadata
+ 'metadata'
+ end
+ def file_size
+ 'tiedoston koko'
+ end
+ def dc_title
+ 'DC-otsikko'
+ end
+ def title
+ 'Otsikko'
+ end
+ def subtitle
+ 'Alaotsikko'
+ end
+ def creator
+ 'DC-tekijä'
+ end
+ def contributor
+ 'DC-osallistuja'
+ end
+ def translator
+ 'Kääntäjä'
+ end
+ def illustrator
+ 'Kuvittaja'
+ end
+ def publisher
+ 'DC-julkaisija'
+ end
+ def prepared_by
+ 'Valmistaja'
+ end
+ def digitized_by
+ 'Digitalisoinut'
+ end
+ def subject
+ 'DC-aihe'
+ end
+ def dc_description
+ 'DC-kuvaus'
+ end
+ def abstract
+ 'DC-tiivistelmä'
+ end
+ def type
+ 'DC-tyyppi'
+ end
+ def rights
+ 'DC-oikeudet'
+ end
+ def date
+ 'DC-päiväys'
+ end
+ def date_created
+ 'DC-luontipäivä'
+ end
+ def date_issued
+ 'DC-julkaisupäivä'
+ end
+ def date_available
+ 'DC-saantipäivä'
+ end
+ def date_modified
+ 'DC-muokkauspäivä'
+ end
+ def date_valid
+ 'DC-kelpoisuuspäivä'
+ end
+ def language
+ 'DC-kieli'
+ end
+ def language_original
+ 'Alkuperäiskieli'
+ end
+ def format
+ 'DC-muoto'
+ end
+ def identifier
+ 'DC-tunnus'
+ end
+ def source
+ 'DC-lähde'
+ end
+ def relation
+ 'DC-suhde'
+ end
+ def coverage
+ 'DC-kattavuus'
+ end
+ def keywords
+ 'Avainsanat'
+ end
+ def comments
+ 'Kommentit'
+ end
+ def cls_loc
+ 'Classify Library of Congress'
+ end
+ def cls_dewey
+ 'Classify Dewey'
+ end
+ def cls_gutenberg
+ 'Classify Project Gutenberg'
+ end
+ def cls_isbn
+ 'Classify ISBN'
+ end
+ def prefix_a
+ 'Prefix (a)'
+ end
+ def prefix_b
+ 'Prefix (b)'
+ end
+ def sourcefile
+ 'Lähdetiedosto'
+ end
+ def word_count
+ 'Arvioitu sanamäärä'
+ end
+ def sourcefile_digest
+ 'Lähdetiedoston tiiviste'
+ end
+ def digest_md5
+ 'Lähdetiedoston tiiviste (md5)'
+ end
+ def digest_sha256
+ 'Lähdetiedoston tiiviste (sha256)'
+ end
+ def sc_number
+ 'Dokumentin RCS/CVS-numero'
+ end
+ def sc_date
+ 'Dokumentin RCS/CVS-päiväys'
+ end
+ def last_generated
+ 'Viimeksi tuotettu dokumentti (metaverse)'
+ end
+ def sisu_version
+ 'Generoinut'
+ end
+ def ruby_version
+ 'Ruby-versio'
+ end
+ def suggested_links
+ 'metadatan ehdottamat linkit'
+ end
+ def language_version_list
+ 'Dokumentin kieliversiot, manifestit'
+ end
+ def manifest_description_output
+ 'Tuotetun tuloksen SISU-manifesti'
+ end
+ def manifest_description_metadata
+ 'Dokumenttimetadatan SISU-manifesti'
+ end
+ def language_list_translated
+ lang=case @trans_str
+ when /American/i; 'Amerikanenglanti' # tag depreciated, see iso 639-2
+ when /English/i; 'Englanti'
+ when /French/i; 'Ranska'
+ when /German/i; 'Saksa'
+ when /Italian/i; 'Italia'
+ when /Spanish/i; 'Espanja'
+ when /Brazilian(?: Portuguese)?/i; 'Brasilian portugali' # tag depreciated, see iso 639-2
+ when /Portuguese/i; 'Portugali'
+ when /Swedish/i; 'Ruotsi'
+ when /Danish/i; 'Tanska'
+ when /Finnish/i; 'Suomi'
+ when /Norwegian/i; 'Norja'
+ when /Icelandic/i; 'Islanti'
+ when /Dutch/i; 'Hollanti'
+ when /Estonian/i; 'Viro'
+ when /Hungarian/i; 'Unkari'
+ when /Polish/i; 'Puola'
+ when /Romanian/i; 'Romania'
+ when /Russian/i; 'Venäjä'
+ when /Greek/i; 'Kreikka'
+ when /Ukranian/i; 'Ukraina'
+ when /Turkish/i; 'Turkki'
+ when /Slovenian/i; 'Slovenia'
+ when /Croatian/i; 'Kroatia'
+ when /Slovak(?:ian)?/i; 'Slovakki'
+ when /Czech/i; 'Tsekki'
+ when /Bulgarian/i; 'Bulgaria'
+ else @trans_str
+ end
+ end
+ end
+ class Porguguese < English
+ end
+ class Swedish < English
+ end
+ class Danish < English
+ end
+ class Norwegian < English
+ end
+ class Icelandic < English
+ end
+ class Dutch < English
+ end
+ class Estonian < English
+ end
+ class Hungarian < English
+ end
+ class Polish < English
+ end
+ class Romanian < English
+ end
+ class Russian < English
+ end
+ class Greek < English
+ end
+ class Ukranian < English
+ end
+ class Turkish < English
+ end
+ class Croatian < English
+ end
+ class Slovakian < English
+ end
+ class Czech < English
+ end
+ class Bulgarian < English
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/manifest.rb b/lib/sisu/0.52/manifest.rb
new file mode 100644
index 00000000..3bc04235
--- /dev/null
+++ b/lib/sisu/0.52/manifest.rb
@@ -0,0 +1,528 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: document summary processing, available outputs and metadata
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Manifest
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/i18n'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ class Source
+ def initialize(opt)
+ @opt=opt
+ l=SiSU_Env::Standardise_language.new.file_to_language(@opt.fns)
+ @doc_language=l[:l]
+ end
+ def read
+ begin
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @md=SiSU_Param::Parameters.new(@opt).get
+ SiSU_Env::Info_skin.new(@md).select
+ xbrowser=@env.program.web_browser
+ browser=@env.program.console_web_browser
+ webserv_url=@env.path.url.output_tell
+ url_html="#{webserv_url}/#{@md.fnb}/#{@md.fn[:manifest]}"
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Manifest',"#{xbrowser} #{url_html}")
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"#{browser} #{url_html}")
+ tell.grey_tab if @opt.cmd =~/v/i
+ Output_Info.new(@md).check_output
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ private
+ class Output_Info <Source
+ def initialize(md)
+ @manifest={ :txt=>[],:html=>[] }
+ @md,@fns=md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @fnb=@md.fnb
+ out=@env.path.output
+ @base_url="#{@env.url.root}/#@fnb"
+ @base_path="#{out}/#@fnb"
+ @@dg ||=SiSU_Env::Info_env.new.digest.type
+ @dg=@@dg
+ l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns)
+ @language=l[:l]
+ @translate=SiSU_Translate::Source.new(@md,@language)
+ end
+ def output
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ manifest=SiSU_Env::SiSU_file.new(@md,@md.fn[:manifest]).mkfile
+ @manifest[:html].each do |x|
+ manifest << x
+ end
+ end
+ def summarize(id,file)
+ size=(File.size("#{@base_path}/#{file}")/1024.00).to_s
+ kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
+ @manifest[:txt] << "#{file} #{id} #{kb}\n"
+ @manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{file}">#{file}</a></p></th><td><p class="norm">#{id}</p><p class="tiny"><a href="#@base_url/#{file}">#@base_url/#{file}</a></p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
+ end
+ def summarize_source(id,file)
+ sys=SiSU_Env::System_call.new
+ dgst =if @dg =~/^sha(?:2|256)$/; sys.sha256("#{@base_path}/#{file}")
+ else sys.md5("#{@base_path}/#{file}")
+ end
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"#{dgst[1]} #{file}")
+ tell.warn if @md.cmd =~/[vVM]/
+ size=(File.size("#{@base_path}/#{file}")/1024.00).to_s
+ kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
+ @manifest[:txt] << "#{file} #{id} #{kb}\n"
+ @manifest[:html] << %{<tr><th class="left"><p class="tiny">#{id}:</p> <p class="norm"><a href="#{file}">#{file}</a></p><p class="tiny"><a href="#@base_url/#{file}">#@base_url/#{file}</a></p></th><td class="right"><p class="tiny">#{dgst[1]}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n}
+ end
+ def languages(id,file)
+ flv=@env.published_manifests?(@base_path)
+ @manifest[:html] << %{<tr><th class="left"><div id="horizontal_links"><ul id="horizontal">\n}
+ flv.each do |l|
+ lang=SiSU_Translate::Source.new(@md,@language,l[:l]).language_list
+ @manifest[:txt] << "#{l[:m]} #{lang}\n"
+ @manifest[:html] << %{<li class="norm"><a href="#{l[:m]}">#{lang}</a>&nbsp;&nbsp;&nbsp;</li>}
+ end
+ @manifest[:html] << %{</ul></div></th></tr>\n}
+ end
+ def published_languages(id,file)
+ flv=@env.published_manifests?(@base_path)
+ flv.each do |l|
+ lang=SiSU_Translate::Source.new(@md,@language,l[:l]).language_list
+ @manifest[:txt] << "#{l[:m]} #{lang}\n"
+ @manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:m]}">#{lang}</a></p></th><td><p class="norm">#{lang}</p><p class="tiny"><a href="#@base_url/#{l[:m]}">#@base_url/#{l[:m]}</a></p></td><td class="right"><p class="right">&nbsp;</p></td></tr>\n}
+ end
+ end
+ def metadata(id,info)
+ @manifest[:html] << %{<tr><th class="left"><p class="bold">#{id}:</p></th><td><p class="left">#{info}</p></td></tr>\n}
+ end
+ def links(url,lnk,target)
+ static=if url =~/^\.\//; url.gsub(/^\.(\.)?/,@base_url)
+ elsif url =~/^\.\.\//; url.gsub(/^\.(\.)?/,@env.url.root)
+ else url
+ end
+ @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny"><a href="#{static}">#{static}</a></p></th></tr>\n}
+ end
+ def output_tests
+ if FileTest.file?("#@base_path/#{@md.fn[:toc]}")==true
+ id,file='HTML table of contents (linked to segmented text)',@md.fn[:toc]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:doc]}")==true
+ id,file='HTML document (scroll)',@md.fn[:doc]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:xhtml]}")==true
+ id,file='XHTML',@md.fn[:xhtml]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:sax]}")==true
+ id,file='XML (SAX)',@md.fn[:sax]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:dom]}")==true
+ id,file='XML (DOM)',@md.fn[:dom]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:odf]}")==true
+ id,file='ODF:ODT (Open Document Format)',@md.fn[:odf]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:pdf_p]}")==true
+ id,file='PDF (portrait) - print bias',@md.fn[:pdf_p]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:pdf_l]}")==true
+ id,file='PDF (landscape) - screen view bias (colored links)',@md.fn[:pdf_l]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:plain]}")==true
+ if @md.cmd =~/a/; id,file='plaintext Unix (UTF-8) (footnotes)',@md.fn[:plain]
+ elsif @md.cmd =~/e/; id,file='plaintext Unix (UTF-8) (endnotes)',@md.fn[:plain]
+ elsif @md.cmd =~/A/; id,file='plaintext dos (UTF-8) (footnotes)',@md.fn[:plain]
+ elsif @md.cmd =~/E/; id,file='plaintext dos (UTF-8) (endnotes)',@md.fn[:plain]
+ else id,file='plaintext (UTF-8)',@md.fn[:plain]
+ end
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:concordance]}")==true
+ id,file='Concordance (wordmap)',@md.fn[:concordance]
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fns}.tex")==true
+ id,file='LaTeX (portrait)',"#{@md.fns}.tex"
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fns}.tex")==true
+ id,file='LaTeX (landscape)',"#{@md.fns}.landscape.tex"
+ summarize(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:digest]}")==true
+ id,file="Digest/DCC - Document Content Certificate (#@dg)",@md.fn[:digest]
+ summarize(id,file)
+ end
+ end
+ def published_versions
+ if FileTest.file?("#@base_path/sisu_manifest.html")==true
+ id,file='Markup (SiSU source)',@md.fns
+ languages(id,file)
+ end
+ end
+ def language_versions
+ if FileTest.file?("#@base_path/sisu_manifest.html")==true
+ id,file='Markup (SiSU source)',@md.fns
+ published_languages(id,file)
+ end
+ end
+ def source_tests
+ if @md.fns =~/\._sst$/ #% decide whether to extract and include requested/required documents
+ req=@md.fns.gsub(/(.+)?\._sst$/,'\1.composite.sst') #watch strange
+ if FileTest.file?("#@base_path/#{req}")==true
+ id,file='Markup Composite File (SiSU source)',req
+ summarize_source(id,file)
+ end
+ end
+ if FileTest.file?("#@base_path/#{@md.fns}")==true
+ id,file='Markup (SiSU source)',@md.fns
+ summarize_source(id,file)
+ end
+ if FileTest.file?("#@base_path/sisupod.zip")==true
+ id,file='SiSU doc (zip)','sisupod.zip'
+ summarize_source(id,file)
+ end
+ if FileTest.file?("#@base_path/#{@md.fnb}")==true and @md.fnb =~/\.kdi$/
+ id,file='Kdissert (.kdi source)',@md.fnb
+ summarize_source(id,file)
+ end
+ end
+ def metadata_tests
+ if @md.dc_title
+ id,info=@translate.dc_title,@md.dc_title
+ metadata(id,info)
+ end
+ if @md.title
+ id,info=@translate.title,@md.title
+ metadata(id,info)
+ end
+ if @md.subtitle
+ id,info=@translate.subtitle,@md.subtitle
+ metadata(id,info)
+ end
+ if @md.dc_creator
+ id,info=@translate.creator,@md.dc_creator
+ metadata(id,info)
+ end
+ if @md.dc_contributor
+ id,info=@translate.contributor,@md.dc_contributor
+ metadata(id,info)
+ end
+ if @md.translator
+ id,info=@translate.translator,@md.translator
+ metadata(id,info)
+ end
+ if @md.illustrator
+ id,info=@translate.illustrator,@md.illustrator
+ metadata(id,info)
+ end
+ if @md.dc_publisher
+ id,info=@translate.publisher,@md.dc_publisher
+ metadata(id,info)
+ end
+ if @md.prepared_by
+ id,info=@translate.prepared_by,@md.prepared_by
+ metadata(id,info)
+ end
+ if @md.digitized_by
+ id,info=@translate.digitized_by,@md.digitized_by
+ metadata(id,info)
+ end
+ if @md.dc_subject
+ id,info=@translate.subject,@md.dc_subject
+ metadata(id,info)
+ end
+ if @md.dc_description
+ id,info=@translate.dc_description,@md.dc_description
+ metadata(id,info)
+ end
+ if @md.abstract
+ id,info=@translate.abstract,@md.abstract
+ metadata(id,info)
+ end
+ if @md.dc_type
+ id,info=@translate.type,@md.dc_type
+ metadata(id,info)
+ end
+ if @md.dc_rights
+ id,info=@translate.rights,@md.dc_rights
+ metadata(id,info)
+ end
+ if @md.dc_date
+ id,info=@translate.date,@md.dc_date
+ metadata(id,info)
+ end
+ if @md.dc_date_created
+ id,info=@translate.date_created,@md.dc_date_created
+ metadata(id,info)
+ end
+ if @md.dc_date_issued
+ id,info=@translate.date_issued,@md.dc_date_issued
+ metadata(id,info)
+ end
+ if @md.dc_date_available
+ id,info=@translate.date_available,@md.dc_date_available
+ metadata(id,info)
+ end
+ if @md.dc_date_modified
+ id,info=@translate.date_modified,@md.dc_date_modified
+ metadata(id,info)
+ end
+ if @md.dc_date_valid
+ id,info=@translate.date_valid,@md.dc_date_valid
+ metadata(id,info)
+ end
+ if @md.dc_language and @md.dc_language[:name]
+ id,info=@translate.language,@md.dc_language[:name]
+ metadata(id,info)
+ end
+ if @md.language_original and @md.language_original[:name]
+ id,info=@translate.language_original,@md.language_original[:name]
+ metadata(id,info)
+ end
+ if @md.dc_format
+ id,info=@transate.format,@md.dc_format
+ metadata(id,info)
+ end
+ if @md.dc_identifier
+ id,info=@translate.identifier,@md.dc_identifier
+ metadata(id,info)
+ end
+ if @md.dc_source
+ id,info=@translate.source,@md.dc_source
+ metadata(id,info)
+ end
+ if @md.dc_relation
+ id,info=@translate.relation,@md.dc_relation
+ metadata(id,info)
+ end
+ if @md.dc_coverage
+ id,info=@translate.coverage,@md.dc_coverage
+ metadata(id,info)
+ end
+ if @md.keywords
+ id,info=@translate.keywords,@md.keywords
+ metadata(id,info)
+ end
+ if @md.comments
+ id,info=@translate.comments,@md.comments
+ metadata(id,info)
+ end
+ if @md.cls_loc
+ id,info=@translate.cls_loc,@md.cls_loc
+ metadata(id,info)
+ end
+ if @md.cls_dewey
+ id,info=@translate.cls_dewey,@md.cls_dewey
+ metadata(id,info)
+ end
+ if @md.cls_pg
+ id,info=@translate.cls_gutenberg,@md.cls_pg
+ metadata(id,info)
+ end
+ if @md.cls_isbn
+ id,info=@translate.cls_isbn,@md.cls_isbn
+ metadata(id,info)
+ end
+ if @md.prefix_a
+ id,info=@translate.prefix_a,@md.prefix_a
+ metadata(id,info)
+ end
+ if @md.prefix_b
+ id,info=@translate.prefix_b,@md.prefix_b
+ metadata(id,info)
+ end
+ if @md.fns
+ id,info=@translate.sourcefile,@md.fns
+ metadata(id,info)
+ end
+ if @md.en[:mismatch] > 0
+ id,info='WARNING document error in endnote markup, number mismatch',"endnotes: #{@md.en[:note]} != endnote reference marks: #{@md.en[:mark]} (difference = #{@md.en[:mismatch]})"
+ metadata(id,info)
+ end
+ if @md.wc_words
+ id,info=@translate.word_count,@md.wc_words
+ metadata(id,info)
+ end
+ if @md.dgst
+ id,info="#{@translate.sourcefile_digest} (#@dg)",@md.dgst[1]
+ metadata(id,info)
+ end
+ if @md.sc_number
+ id,info=@translate.sc_number,@md.sc_number
+ metadata(id,info)
+ end
+ if @md.sc_date
+ id,info=@translate.sc_date,"#{@md.sc_date} at #{@md.sc_time}"
+ metadata(id,info)
+ end
+ if @md.generated
+ id,info=@translate.last_generated,@md.generated
+ metadata(id,info)
+ end
+ if @md.sisu_version
+ id,info=@translate.sisu_version,"#{@md.sisu_version[:project]} #{@md.sisu_version[:version]} #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})"
+ metadata(id,info)
+ end
+ if @md.ruby_version
+ id,info=@translate.ruby_version,@md.ruby_version
+ metadata(id,info)
+ end
+ end
+ def links_tests
+ if defined? @md.lnk and @md.lnk
+ @md.lnk.each do |l|
+ if defined? l[:say]
+ target=if l[:url] !~/^\.(\.)?\//; 'external'
+ else '_top'
+ end
+ url,lnk=l[:url],l[:say]
+ unless url.nil? or url.empty?; links(url,lnk,target)
+ end
+ end
+ end
+ end
+ end
+ def check_output
+ begin
+ id,file='',''
+ vz=SiSU_Env::Get_init.instance.skin
+ #vz=SiSU_Viz::Skin.new
+ banner_table=if vz.banner_home_button_only !~ /http:\/\/www\.jus\.uio\.no\/sisu/ and vz.banner_home_button_only !~ /sisu\.home\.png/
+<<WOK
+<table summary="band" width="100%" border="0" cellpadding="3" cellspacing="0">
+<tr><td align="left" bgcolor="#ffffff">#{vz.banner_home_button}</td><td width="60%"><p class="tiny"><a href="#@base_url/#{file}"><img border="0" height="12" width="12" src="#{vz.url_path_image}/bullet_red.png" alt="TOC linked" />&nbsp;#@base_url/#{file}</a></p></td><td width="20%">#{@env.widget_static.search_form}</td><td><a href="http://www.jus.uio.no/sisu/" target="_top"><img border="0" src="#{vz.url_path_image}/sisu.png" alt="SiSU --&gt;" /></a></td></tr>
+</table>
+WOK
+ else
+<<WOK
+<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="#{vz.url_path_image}/sisu.png" alt="SiSU --&gt;" /></a></td><td><p class="tiny"><a href="#@base_url/#{file}"><img border="0" height="12" width="12" src="#{vz.url_path_image}/bullet_red.png" alt="TOC linked" />&nbsp;#@base_url/#{file}</a></p></td><td>#{@env.widget_static.search_form}</td></tr>
+</table>
+WOK
+ end
+ @manifest[:html] <<<<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 manifest: #{@md.title}
+</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="sourcefile" content="#{@md.fns}" />
+<link rel="generator" href="http://www.jus.uio.no/sisu" />
+<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
+<link rel="stylesheet" href="../#{@env.path.style}/html.css" type="text/css" />
+</head>
+<body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">
+#{banner_table}
+<h1 class="small">#{@md.dc_title}</h1>
+<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+WOK
+ published_versions
+ @manifest[:html] << '</table>'
+ @manifest[:html] <<<<WOK
+<h2 class="small"><a name="output">#{@translate.manifest_description_output}</a></h2>
+<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+<tr> <th class="left"><p class="bold">#{@translate.filename}</p></th><th class="left"><p class="bold">#{@translate.description}</p></th><th class="right"><p class="right"><b>#{@translate.file_size}</b></p><p class="tiny_right">(kB)</p></th></tr>
+
+WOK
+ output_tests
+ @manifest[:html] << '</table>'
+ @manifest[:html] <<<<WOK
+<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+WOK
+ source_tests
+ @manifest[:html] << '</table>'
+ @manifest[:html] <<<<WOK
+<h2 class="small"><a name="metadata">#{@translate.manifest_description_metadata}</a></h2>
+<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+<tr> <th class="left"><p class="bold">#{@translate.metadata}</p></th><th class="left"><p class="bold">#{@translate.description}</p></th></tr>
+WOK
+ metadata_tests
+ @manifest[:html] <<<<WOK
+</table>
+WOK
+ @manifest[:html] <<<<WOK
+<table summary="normal text css" width="90%" border="0" bgcolor="white" cellpadding="2" align="center">
+<tr><th class="left"><p class="bold"><a name="links">#{@translate.suggested_links}:</a></p></th></tr>
+WOK
+ links_tests
+ @manifest[:html] <<<<WOK
+</table>
+WOK
+ @manifest[:html] <<<<WOK
+<h2 class="small"><a name="languages">#{@translate.language_version_list}</a></h2>
+<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+<tr> <th class="left"><p class="bold">#{@translate.filename}</p></th><th class="left"><p class="bold">#{@translate.description}</p></th><th class="right"><p class="right">&nbsp;</p></th></tr>
+
+WOK
+ language_versions
+ @manifest[:html] <<<<WOK
+</table>
+#{vz.credits_splash}
+</body>
+</html>
+WOK
+ output
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/odf.rb b/lib/sisu/0.52/odf.rb
new file mode 100644
index 00000000..bfa6d716
--- /dev/null
+++ b/lib/sisu/0.52/odf.rb
@@ -0,0 +1,725 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: opendocument text generation
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_ODF
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/odf_format'
+ include OD_format
+ require SiSU_lib + '/shared_txt'
+ @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0
+ class Source
+ require 'zlib'
+ require 'find'
+ require 'fileutils'
+ include FileUtils
+ def initialize(opt)
+ @opt=opt
+ @@endnotes_para=[]
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @env.odf_structure
+ opendoc=@md.fn[:odf]
+ path=@env.path.output_tell
+ tool=if @opt.cmd =~/[MVv]/; "#{@env.program.odf_viewer} #{path}/#{@md.fnb}/#{opendoc}"
+ else ''
+ end
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Opendocument (ODF:ODT)',tool)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{opendoc}")
+ tell.flow if @opt.cmd =~/[MV]/
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_ODF::Source::Scroll.new(@dal_array,@md).songsheet
+ SiSU_Env::Info_skin.new(@md).select
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ private
+ class Split_text_object <Source
+ require SiSU_lib + '/odf_format'
+ include SiSU_Viz
+ include OD_format
+ @@dp=nil
+ @@alt_id_count=0
+ attr_reader :format,:lev,:text,:ocn,:lev_para_ocn
+ def initialize(para)
+ @para=para
+ @format,@ocn='null','null'
+ #@format,@ocn=nil,nil
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def lev_segname_para_ocn
+ @text=nil
+ if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,$5
+ elsif /^(([1-6])~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@lev,@text,@ocn=$1,$2,$3,$4
+ elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@text,@ocn=$1,$2,$3,$4
+ elsif /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;[um]\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,"x#{@@alt_id_count}"
+ elsif /^(([1-6])~)\s+(\S.+?)<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,@lev,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}"
+ end
+ else
+ if /(.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @text,@ocn=$1,$2
+ end
+ if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/
+ @text=/(.+?)/im.match(@para)[1]
+ end
+ if /^((\d)~(?:~\S+)?)\s+(.+)/m.match(@para)
+ @format,@lev,@text=$1,$2,$3
+ end
+ end
+ format=@format.dup
+ @lev_para_ocn=if @para =~/.+<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ OD_format::Format_text_object.new(format,@text,@ocn)
+ else
+ OD_format::Format_text_object.new(format,@text,"<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>")
+ end
+ self
+ end
+ end
+ class Scroll <Source
+ require SiSU_lib + '/shared_txt'
+ @@img_count=0
+ @@odf={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] }
+ @@docstart=true
+ @@fns,@@dp=nil,nil
+ def initialize(data='',md='')
+ @data,@md=data,md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ @serial=/\s*<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>\s*/
+ @tab="\t"
+ @br=if @md.cmd =~/M/; "\n"
+ else ''
+ end
+ end
+ def songsheet
+ pre
+ @data=markup
+ post
+ publish
+ end
+ # Used for extraction of endnotes from paragraphs
+ def extract_endnotes(para='')
+ notes=para.scan(/~\{(\d+\s+.+?)\s*<#@dp>\}~/)
+ @n=[]
+ notes.each do |n| #high cost to deal with <br> appropriately within odf, consider
+ n=n.dup.to_s
+ if n =~/<br(?: \/)?>/
+ fix=n.split(/<br(?: \/)?>/) #watch #added
+ fix.each do |x|
+ if x =~/\S+/; @n << x
+ end
+ end
+ else @n << n
+ end
+ end
+ end
+ def odf_metadata(meta)
+ #meta.el,meta.txt,meta.type,meta.attrib
+ end
+ def odf_tail
+ generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version]
+ lastdone="Last Generated on: #{Time.now}"
+ rubyv="Ruby version: #{@md.ruby_version}"
+ sc=if @md.sc_info
+ "Source file: #{@md.sc_filename}\nVersion number: #{@md.sc_number}\nVersion date: #{@md.sc_date}\n"
+ else ''
+ end
+ @@odf[:tail] << "\n</office:text></office:body></office:document-content>"
+ end
+ def heading(para,no)
+ para.gsub!(@serial,'')
+ para.gsub!(/<:name#\S+?>/,'')
+ para.gsub!(/^([1-6])~\S*\s/,'')
+ m=/#{$1}/
+ breakpage=''
+ if @md.fns and @md.fns != '' and @md.fns !=@@fns
+ @@docstart=true
+ @@fns=@md.fns
+ end
+ unless @@docstart
+ breakpage=if (@md.pagenew or @md.pagebreak) and (@md.pagenew =~ m or @md.pagebreak =~m); '<text:p text:style-name="P9"> </text:p>'
+ else ''
+ end
+ end
+ @@docstart=false
+ %{#{breakpage}<text:h text:style-name="Heading_20_#{no}" text:outline-level="#{no}">#{para}</text:h>}
+ end
+ def image_src(i)
+ image_source=if @md.fns =~/\._?ss[tm]$/ and FileTest.file?("#{@env.path.image_source_local_tex}/#{i}")
+ @env.path.image_source_local_tex
+ elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{@env.path.image_source_remote_tex}/#{i}")
+ @env.path.image_source_remote_tex
+ elsif FileTest.file?("#{@env.path.image_source_tex}/#{i}")
+ @env.path.image_source_tex
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_local_tex},#{@env.path.image_source_remote_tex} and #{@env.path.image_source_tex}")
+ tell.error2 unless @md.cmd =~/q/
+ nil
+ end
+ end
+ def image_odf(img)
+ # copy image to od image directory (unless exists)
+ # divide pixel dimension by 37.79485 and retain 3 decimal places
+ # x=str.scan(/(aa[^a]+)/)
+ m,u=img[1],img[2]
+ i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures if m =~/^(\S+?\.(?:png|jpg|gif))/
+ c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/
+ w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/
+ w=(w.to_i/37.79485).to_s
+ h=(h.to_i/37.79485).to_s
+ h=/([0-9]+\.\d{0,3})/.match(h).captures
+ w=/([0-9]+\.\d{0,3})/.match(w).captures
+ image_source=image_src(i)
+ pwd=Dir.pwd
+ cp("#{image_source}/#{i}","#{@env.path.odf}/Pictures/#{i}") if image_source
+ img=if i.to_s =~/jpg|png|gif/ and h.to_s =~/\d/ and w.to_s =~/\d/
+ @@img_count +=1
+ %{<draw:frame draw:style-name="fr1" draw:name="graphics#{@@img_count}" text:anchor-type="as-char" svg:width="#{w}cm" svg:height="#{h}cm" draw:z-index="2"><draw:image xlink:href="Pictures/#{i}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>#{c}} #anchor-type: as-char or paragraph or char or ...
+ else %{<text:p text:style-name="P1">[image omitted]</text:p>}
+ end
+ end
+ def image(para)
+ para.gsub!(@serial,'')
+ m=para.scan(/(\{\s*(.+?)\}((?:https?|ftp)\S+|image))/)
+ if m; m.each do |i|
+ cont,url=i[1],i[2]
+ cont.gsub!(/([)(\]\[])/,"\\\\\\1")
+ cont.gsub!(/([+?])/,"\\\\\\1") # incorrect handling of +
+ url.gsub!(/([+?])/,"\\\\\\1")
+ para.sub!(/\{\s*#{cont}\}#{url}/m,image_odf(i)) #watch
+ para.gsub!(/\\([)(\]\[?])/,'\1') #clumsy fix
+ end
+ m=nil
+ end
+ para
+ end
+ def text_link_odf(txt,url)
+ txt.gsub!(/(\\\+)/,'+') #this is convoluted, and risky :-(
+ url.gsub!(/(\\\+)/,'+') #this is convoluted, and risky :-(
+ %{<text:a xlink:type="simple" xlink:href="#{url}">#{txt}</text:a>}
+ end
+ def text_link(para)
+ para.gsub!(@serial,'')
+ m=para.scan(/(\{([^}]+?)\}((?:https?|ftp)\S+))/) #sort
+ if m
+ m.each do |i|
+ txt,url=i[1],i[2]
+ txt.gsub!(/([)(\]\[])/,"\\\\\\1")
+ txt.gsub!(/([+?])/,"\\\\\\1") # problems with +
+ url.gsub!(/([+?])/,"\\\\\\1") # problems with +
+ para.gsub!(/\{\s*#{txt}\}#{url}/m,text_link_odf(txt,url))
+ para.gsub!(/\\([)(\]\[?])/,'\1') #clumsy fix
+ end
+ m=nil
+ end
+ para
+ end
+ def normal(para) #P1 - P3
+ para.gsub!(@serial,'')
+ para.gsub!(/(^|\s)(https?:\/\/[^'">< ]+)/,'\1<text:a xlink:type="simple" xlink:href="\2">\2</text:a>')
+ para.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,'<text:a xlink:type="simple" xlink:href="mailto:\1">\1</text:a>')
+ par=case para
+ when /^<:i1>\s/m; para.gsub!(/^<:i1>\s/m,'')
+ %{<text:p text:style-name="P2">#{para}</text:p>}
+ when /^<:i2>\s/m; para.gsub!(/^<:i2>\s/m,'')
+ %{<text:p text:style-name="P3">#{para}</text:p>}
+ else %{<text:p text:style-name="P1">#{para}</text:p>} #%{<text:p text:style-name="Standard">#{para}</text:p>}
+ end
+ para=par #+ %{<text:p text:style-name="Standard"/>}
+ end
+ def fontface(para)
+ #para=para.gsub(/<b>(.+?)<\/b>/,%{<text:span text:style-name="T1">\\1</text:span>})
+ #para=para.gsub(/<i>(.+?)<\/i>/,%{<text:span text:style-name="T2">\\1</text:span>})
+ end
+ def footnote(para)
+ @astx||=10000
+ para.gsub!(/<#@dp>([}\]]~)/,'\1')
+ para.gsub!(/<br \/><:i1>/,'<br />')
+ if para =~/~\{\d+\s+/
+ para=para.gsub(/~\{(\d+)\s+(.+?)\}~/,'<text:note text:id="ftn\1" text:note-class="footnote"><text:note-citation>\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>')
+ end
+ if para=~/~\[[*+]\d+\s/ #editor notes, squre bracket series
+ asterisk=para.scan(/~\[([*+]\d+)\s+(.+?)\]~/)
+ asterisk.each do |x|
+ a=x[0].gsub(/([*+])/,"\\\\\\1")
+ para=para.gsub(/~\[(#{a})\s+(.+?)\]~/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})
+ @astx+=1
+ end
+ end
+ if para=~/~\{[*+]+\s/
+ asterisk=para.scan(/~\{([*+]+)\s+(.+?)\}~/)
+ asterisk.each do |x|
+ a=x[0].gsub(/([*+])/,"\\\\\\1")
+ para=para.gsub(/~\{(#{a})\s+(.+?)\}~/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})
+ @astx+=1
+ end
+ end
+ para
+ end
+ def group_clean(para)
+ para.gsub!(/&amp;nbsp;|&nbsp;/,'&#160;')
+ para.gsub!(/</,'&lt;')
+ para.gsub!(/>/,'&gt;')
+ #para.gsub!(/<br(?:\s+\/)?>/,'<br />')
+ para.gsub!(/&lt;br(?:\s+\/)?&gt;/,'<br />')
+ #para.gsub!(/\s\s/,'&#160;&#160;')
+ para
+ end
+ def poem(para) #P4 #same as group
+ para.gsub!(@serial,'')
+ para.gsub!(/<:verse(?:-end)?>\s*/m,'')
+ para=group_clean(para)
+ parray=[]
+ para.split(/<br(?: \/)?>/).each do |parablock|
+ parray << %{<text:p text:style-name="P4">#{parablock}</text:p>} if parablock =~/\S+/
+ end
+ para=parray.join + '<text:p text:style-name="Standard"/>'
+ end
+ def group(para) #P4 #same as verse
+ para.gsub!(@serial,'')
+ para.gsub!(/<:group(?:-end)?>\s*/m,'')
+ para=group_clean(para)
+ parray=[]
+ para.split(/<br(?: \/)?>/).each do |parablock|
+ parray << %{<text:p text:style-name="P4">#{parablock}</text:p>} if parablock =~/\S+/
+ end
+ para=parray.join + '<text:p text:style-name="Standard"/>'
+ end
+ def code(para) #P5
+ para.gsub!(@serial,'')
+ para.gsub!(/<:code(?:-end)?>\s*/m,'')
+ para=group_clean(para)
+ para.gsub!(/\s\s/,'&#160;&#160;')
+ parray=[]
+ para.split(/<:br>/).each do |parablock|
+ parray << %{<text:p text:style-name="P5">#{parablock}</text:p>} if parablock =~/\S+/
+ end
+ para=parray.join + '<text:p text:style-name="Standard"/>'
+ end
+ def table(para) #
+ if para =~/<!Th?.+/ # tables come as single block
+ table=OD_format::Table.new(@md,para)
+ para=table.table_split
+ end
+ end
+ def odf_structure(para='',lv='',ocn='',hname='') #% Used to extract the structure of a document
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ #extract_endnotes(para)
+ #para=fontface(para)
+ para=if para =~/\{\s*\S+?\.(?:png|jpg|gif)\s.+?\}(?:(?:https?|ftp):\S+|image)/; image(para)
+ elsif para =~/\{.+?\}(?:(?:https?|ftp):\S+|image)/; text_link(para)
+ else para
+ end
+ para=footnote(para)
+ if lv
+ @@odf[:body] << case lv
+ when 1; heading(para,'1') << @br*2
+ when 2; heading(para,'2') << @br*2
+ when 3; heading(para,'3') << @br*2
+ when 4; heading(para,'4') << @br*2
+ when 5; heading(para,'5') << @br*2
+ when 6; heading(para,'6') << @br*2
+ end
+ elsif para =~ /<:verse(?:-end)?>/
+ @@odf[:body] << poem(para)
+ @@odf[:body] << @br*2
+ elsif para =~ /<:group(?:-end)?>/
+ @@odf[:body] << group(para)
+ @@odf[:body] << @br*2
+ elsif para =~ /<:code(?:-end)?>/
+ @@odf[:body] << code(para)
+ @@odf[:body] << @br*2
+ elsif para =~ /<!Th?/ #elsif para =~ /<!Th?¡/
+ @@odf[:body] << table(para)
+ @@odf[:body] << @br*2
+ else
+ @@odf[:body] << normal(para) # main text, contents, body KEEP
+ @@odf[:body] << @br*2
+ end
+ @@endnotes_para=[]
+ end
+ # Used to clean words
+ def tidywords(wordlist)
+ #wordlist.each do |x|
+ # #x.gsub!(/&/,'&amp;') unless x =~/&\S+;/
+ #end
+ wordlist
+ end
+ def markup # Used for major markup instructions
+ data=@data
+ safe_characters=/[^a-zA-Z0-9}{\/?,."';:)(><\-_&!@%~#\]\[*=$| \n+`¡]/
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @data_mod,@endnotes,@level,@cont,@copen,@odf_contents_close=Array.new(6){[]}
+ @rcdc=false
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @odf_contents_close[x]='' }
+ odf_tail #($1,$2)
+ fix=[]
+ bullet=image_src('bullet_red.png')
+ cp("#{bullet}/bullet_red.png","#{@env.path.odf}/Pictures/.") #if image_src('bullet_red.png')
+ data.each do |para|
+ #p para if para =~safe_characters and @md.cmd =~/V/ #KEEP
+ #para.gsub!(/&lt;(~\d+;(?:\w|[0-6]:)\d+;\w\d+)&gt;&lt;(#@dp:#@dp)&gt;/,'<\1><\2>')
+ para_array=[]
+ word=para.scan(/\S+|\n/)
+ if word
+ word.each do |w| # _ - / # | : ! ^ ~
+ unless para =~/^(?:0~|%+ )/m
+ w.gsub!(/&#(?:126|152);/,'~') #126 usual
+ if w !~/&\S{1,7};/ or w =~/&nbsp;/; w.gsub!(/&/,'&amp;') #watch &nbsp;
+ end
+ end
+ para_array << w
+ end
+ para=para_array.join(' ')
+ para=para.strip
+ end
+ para.gsub!(/^(<:i[12]>\s+)?_\*\s+/,'\\1<draw:frame draw:style-name="gr1" text:anchor-type="as-char" svg:width="0.25cm" svg:height="0.25cm" draw:z-index="2"><draw:image xlink:href="Pictures/bullet_red.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame> ') # bullet_red.png
+ #para.gsub!(/^_\*\s+/,'<text:span text:style-name="T6">·</text:span> ') #bullet
+ para.gsub!(/^(<:i[12]>)\s+_\*\s+/,'\1 <text:span text:style-name="T6">·</text:span> ') #bullet
+ para.gsub!(/<br>/,'<br />')
+ para.gsub!(/<:p[bn]>/,'<text:p text:style-name="P8"> </text:p>')
+ para.gsub!(/&#169;/,'©') #too arbitrary
+ para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
+ #para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down
+ para.gsub!(/<b>(.+?)<\/b>/,'<text:span text:style-name="T1">\1</text:span>')
+ para.gsub!(/<i>(.+?)<\/i>/,'<text:span text:style-name="T2">\1</text:span>')
+ para.gsub!(/<u>(.+?)<\/u>/,'<text:span text:style-name="T3">\1</text:span>')
+ para.gsub!(/<sup>(.+?)<\/sup>/,'<text:span text:style-name="T4">\1</text:span>')
+ para.gsub!(/<sub>(.+?)<\/sub>/,'<text:span text:style-name="T5">\1</text:span>')
+ para.gsub!(/`/,"'")
+ para.gsub!(/­/,'-')
+ para.gsub!(/·/,'*')
+ para.gsub!(/[“”]/,'""')
+ para.gsub!(/[­–—]/,'-') #— – chk
+ para.gsub!(/ < /i,'&#060;')
+ para.gsub!(/\\copy(?:right)?\b/,'&#169;')
+ para.gsub!(/\\trademark\b|\\tm\b/,'&#174;')
+ #para.gsub!(/\43/,'&#35;') ## watch
+ #para.gsub!(/$/,'&#36;') #$ watch
+ para.gsub!(/\44/,'&#36;') #$ watch
+ #para.gsub!(/^·/,'_*') #$ watch
+ #para.gsub!(/·/,'*') #$ watch
+ para.gsub!(/<:p[bn]>/,'') # remove page breaks
+ para.gsub!(/^\s*<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'') # remove empty lines
+ para.gsub!(/<a href=".+?">(.+?)<\/a>/,'\1')
+ para.gsub!(/<:name#\S+?>/,'') # remove name links
+# para.gsub!(/<a href=".+?">(.+?)<\/a>/im,'\1')
+ #para.gsub!(/&nbsp;/,' ') # decide on
+ #para.gsub!(/\{(\S+?\.(?:png|jpg)) .+?\}(?:http:\/\/\S+|image)/," [ \\1 ]") #"[ #{@env.url.images_local}\/\\1 ]")
+ #para.gsub!(/<!TZ.+/,'')
+ #para.gsub!(/^<!T.+/,"#@br[table: ] <~#>");
+ #p para if para =~safe_characters and @md.cmd =~/M/ #KEEP
+ #para.gsub!(/^(\{\S+?\.(?:png|jpg)\s+.+?"(.*?)"\s*\}\S+)/,"\\1 \n [image: \"\\2\"]")
+ wordlist=para.scan(/\S+/)
+ para=tidywords(wordlist).join(' ').strip
+ if para =~/^0~(\S+)\s+(.+?)\Z/m # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; odf_metadata(d_meta)
+ end
+ end
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/)
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ if para =~@regx #/.+?<~\d+;\w\d+;\w\d+>.*/ #watch change
+ paranum=para[@regx,3]
+ @p_num=OD_format::Paragraph_number.new(paranum)
+ end
+ @sto=Split_text_object.new(para).lev_segname_para_ocn
+ #<office:annotation><dc:date>yyyy-mm-ddT00:00:00</dc:date><text:p>#{ocn}</text:p></office:annotation> #followed immediately by paragraph closure
+ ### problem in scroll, it appears tables are getting paragraph numbers
+ unless @rcdc
+ m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m and para=~/\S+/
+ para=case @sto.format
+ when /^(1)~(?:(\S+))?/; odf_structure(para,$1,@sto.ocn,$2)
+ para
+ when /^(2)~(?:(\S+))?/; odf_structure(para,$1,@sto.ocn,$2)
+ para
+ when /^(3)~(?:(\S+))?/; odf_structure(para,$1,@sto.ocn,$2)
+ para
+ when /^(4)~(\S+)/; odf_structure(para,$1,@sto.ocn,$2)
+ # work on see SiSU_text_parts::Split_text_object
+ para
+ when /^(5)~(?:(\S+))?/; odf_structure(para,$1,@sto.ocn,$2)
+ para
+ when /^(6)~(?:(\S+))?/; odf_structure(para,$1,@sto.ocn,$2)
+ para
+ #@sto.lev_para_ocn.heading_body6
+ #when /^(i1)$/
+ # #formatMono.gsubBody
+ # #para=@sto[:lev_para_ocn].scrIndent1
+ #when /^(i2)$/
+ # formatMono.gsubBody
+ # para=@sto[:lev_para_ocn].scrIndent2
+ #when /^(center)$/
+ # para.gsub!(/(.+)/,
+ # %{<center>(\\1)</center>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /^(b|bold)$/
+ # para.gsub!(/(.+)/,
+ # %{<b>(\\1)</b>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /null/ # see whether u can improve
+ # if (para !~/#{@margin.txt_0}|#{@margin.txt_1}|#{@margin.txt_2}/)
+ # #formatMono.gsubBody
+ # #para=@sto[:lev_para_ocn].scrPara
+ # end
+ else odf_structure(para,nil,nil,nil) #watch may be problematic
+ para
+ end
+ elsif para =~/(.*)<!#!>(.*)/
+ one,two=$1,$2
+ format_text=OD_format::Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ case para #remove
+ when /<:i1>/
+ if para =~/.*<:#>.*$/
+ format_text=OD_format::Format_text_object.new(para,'')
+ para=format_text.scr_indent_one_no_paranum
+ end
+ when /<:i2>/
+ if para =~/.*<:#>.*$/
+ format_text=OD_format::Format_text_object.new(para,'')
+ para=format_text.scr_indent_one_no_paranum
+ end
+ end
+ if (para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/)
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=OD_format::Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ else
+ if para =~ /^(4)~(\S+)/
+ odf_structure(para,$1,@sto.ocn,$2)
+ para
+ elsif para =~/<~(\d+);m\d+;[mdv]\d+><#@dp:#@dp>$/
+ odf_structure(para,nil,nil,nil) #watch may be problematic
+ para
+ end
+ end
+ para.gsub!(/<!.+!>/,' ') if para ## Clean Prepared Text
+ para.gsub!(/<:\S+>/,' ') if para ## Clean Prepared Text
+ end
+ end
+ end
+ def pre
+ table=if @md.flag_tables
+ %{<style:style style:name="Table1" style:family="table"><style:table-properties style:width="16.999cm" table:align="margins"/></style:style>#@br} +
+ %{<style:style style:name="Table1.A" style:family="table-column"><style:table-column-properties style:column-width="16.999cm" style:rel-column-width="65535*"/></style:style>#@br} +
+ %{<style:style style:name="Table1.B" style:family="table-column"><style:table-column-properties style:column-width="8.499cm" style:rel-column-width="32767*"/></style:style>#@br} +
+ %{<style:style style:name="Table1.C" style:family="table-column"><style:table-column-properties style:column-width="5.666cm" style:rel-column-width="21845*"/></style:style>#@br} +
+ %{<style:style style:name="Table1.D" style:family="table-column"><style:table-column-properties style:column-width="4.349cm" style:rel-column-width="16383*"/></style:style>#@br} +
+ %{<style:style style:name="Table1.E" style:family="table-column"><style:table-column-properties style:column-width="3.399cm" style:rel-column-width="13107*"/></style:style>#@br} +
+ %{<style:style style:name="Table1.F" style:family="table-column"><style:table-column-properties style:column-width="2.833cm" style:rel-column-width="10922*"/></style:style>#@br} +
+ %{<style:style style:name="Table1.G" style:family="table-column"><style:table-column-properties style:column-width="2.428cm" style:rel-column-width="9362*"/></style:style>#@br} +
+ %{<style:style style:name="Table1.H" style:family="table-column"><style:table-column-properties style:column-width="2.124cm" style:rel-column-width="8191*"/></style:style>#@br} +
+ %{<style:style style:name="Table2" style:family="table"><style:table-properties style:width="16.999cm" table:align="margins"/></style:style>#@br} +
+ %{<style:style style:name="Table2.A" style:family="table-column"><style:table-column-properties style:column-width="16.999cm" style:rel-column-width="65535*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.B" style:family="table-column"><style:table-column-properties style:column-width="8.499cm" style:rel-column-width="32767*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.C" style:family="table-column"><style:table-column-properties style:column-width="5.666cm" style:rel-column-width="21845*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.D" style:family="table-column"><style:table-column-properties style:column-width="4.349cm" style:rel-column-width="16383*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.E" style:family="table-column"><style:table-column-properties style:column-width="3.999cm" style:rel-column-width="13107*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.F" style:family="table-column"><style:table-column-properties style:column-width="2.833cm" style:rel-column-width="10922*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.G" style:family="table-column"><style:table-column-properties style:column-width="2.428cm" style:rel-column-width="9362*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.H" style:family="table-column"><style:table-column-properties style:column-width="2.124cm" style:rel-column-width="8191*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.I" style:family="table-column"><style:table-column-properties style:column-width="1.8887cm" style:rel-column-width="7281*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.J" style:family="table-column"><style:table-column-properties style:column-width="1.6999cm" style:rel-column-width="6553*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.K" style:family="table-column"><style:table-column-properties style:column-width="1.5453cm" style:rel-column-width="5957*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.L" style:family="table-column"><style:table-column-properties style:column-width="1.416cm" style:rel-column-width="5461*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.M" style:family="table-column"><style:table-column-properties style:column-width="1.307" style:rel-column-width="5041*"/></style:style>#@br} +
+ %{<style:style style:name="Table2.N" style:family="table-column"><style:table-column-properties style:column-width="1.214cm" style:rel-column-width="4681*"/></style:style>#@br}
+ else ''
+ end
+ breakpage=if @md.pagenew or @md.pagebreak; ' fo:break-before="page"'
+ else ''
+ end
+ @@odf[:head]<<%{<?xml version="1.0" encoding="UTF-8"?>#@br} +
+ %{<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0"><office:scripts/>#@br} +
+ %{<office:font-face-decls><style:font-face style:name="HG Mincho Light J" svg:font-family="&apos;HG Mincho Light J&apos;, &apos;MS Mincho&apos;, &apos;HG Mincho J&apos;, &apos;HG Mincho L&apos;, &apos;HG Mincho&apos;, Mincho, &apos;MS PMincho&apos;, &apos;HG Mincho Light J&apos;, &apos;MS Gothic&apos;, &apos;HG Gothic J&apos;, &apos;HG Gothic B&apos;, &apos;HG Gothic&apos;, Gothic, &apos;MS PGothic&apos;, &apos;Andale Sans UI&apos;, &apos;Arial Unicode MS&apos;, &apos;Lucida Sans Unicode&apos;, Tahoma" style:font-pitch="variable"/><style:font-face style:name="Nimbus Sans L" svg:font-family="&apos;Nimbus Sans L&apos;" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma, Lucidasans, &apos;Lucida Sans&apos;, &apos;Arial Unicode MS&apos;" style:font-pitch="variable"/><style:font-face style:name="Nimbus Roman No9 L" svg:font-family="&apos;Nimbus Roman No9 L&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Bitstream Vera Sans" svg:font-family="&apos;Bitstream Vera Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-face-decls>#@br} +
+ %{<office:automatic-styles>#@br} +
+ %{#{table}#@br} +
+ %{<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style>#@br} +
+ %{<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="1cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style>#@br} +
+ %{<style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="2cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style>#@br} +
+ %{<style:style style:name="P4" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="justify" style:justify-single-word="false"/></style:style>#@br} +
+ %{<style:style style:name="P5" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="start" style:justify-single-word="false"/></style:style>#@br} +
+ %{<style:style style:name="P6" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-before="page"/></style:style>#@br} +
+ %{<style:style style:name="P7" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/></style:style>#@br} +
+ %{<style:style style:name="P8" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-before="page"/></style:style>#@br} +
+ %{<style:style style:name="P9" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:break-after="page"/></style:style>#@br} +
+ %{<style:style style:name="T1" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style>#@br} +
+ %{<style:style style:name="T2" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/></style:style>#@br} +
+ %{<style:style style:name="T3" style:family="text"><style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color"/></style:style>#@br} +
+ %{<style:style style:name="T4" style:family="text"><style:text-properties style:text-position="super 58%"/></style:style>#@br} +
+ %{<style:style style:name="T5" style:family="text"><style:text-properties style:text-position="sub 58%"/></style:style>#@br} +
+ %{<style:style style:name="T6" style:family="text"><style:text-properties style:font-name="Courier 10 Pitch" fo:font-size="12pt"/></style:style>#@br} +
+ %{<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"><style:graphic-properties style:wrap="none" style:horizontal-pos="left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/></style:style>#@br} +
+ %{<style:style style:name="gr1" style:family="graphic"><style:graphic-properties draw:stroke="none" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:color-mode="standard" draw:luminance="0%" draw:contrast="0%" draw:gamma="100%" draw:red="0%" draw:green="0%" draw:blue="0%" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:image-opacity="100%" style:mirror="none" style:run-through="background" style:wrap="none" style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" style:flow-with-text="false"/></style:style>#@br} +
+ %{<style:style style:name="gr2" style:family="graphic"><style:graphic-properties draw:stroke="none" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:color-mode="standard" draw:luminance="0%" draw:contrast="0%" draw:gamma="100%" draw:red="0%" draw:green="0%" draw:blue="0%" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:image-opacity="100%" style:mirror="none" style:run-through="background" style:wrap="none" style:vertical-pos="middle" style:vertical-rel="baseline" style:horizontal-pos="left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" style:flow-with-text="false"/></style:style>#@br} +
+ %{</office:automatic-styles>#@br} +
+ %{<office:body>#@br} +
+ %{<office:text><office:forms form:automatic-focus="false" form:apply-design-mode="false"/>#@br} +
+ %{<text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls>}
+ end
+ def post
+ end
+ def publish
+ divider='='
+ content=[]
+ data=@data
+ content << @@odf[:open]
+ content << @@odf[:head]
+ content << @@odf[:body]
+ content << @@odf[:metadata]
+ content << @@odf[:owner_details] if @md.stmp =~/\w+/ #not used?
+ content << @@odf[:tail]
+ Output.new(content.to_s,@md).odf
+ @@odf[:head],@@odf[:body],@@odf[:tail],@@odf[:metadata]=[],[],[],[]
+ end
+ end
+ class Output <Source
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(content,md)
+ @content,@md=content,md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ end
+ def odf #%odf output
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ #filename_odf=SiSU_Env::SiSU_file.new(@md,'content.xml').mkfile
+ filename="#{@env.path.odf}/content.xml"
+ od=File.new(filename,'w+')
+ @sisu=[]
+ @content.each do |para| # this is a hack
+ if para =~/^\S/
+ if para !~/^([*=-]|\.){5}/; od.puts para #unix odf
+ else od.puts para #unix odf
+ end
+ else od.puts para # if para =~/^\s/
+ end
+ end
+ od.close
+ opendoc=@md.fn[:odf]
+ system("
+ cd #{@env.path.odf}
+ zip -qr #{opendoc} *
+ mv #{opendoc} #{@env.path.output}/#{@md.fnb}/.
+ cd #{Dir.pwd}
+ ")
+ end
+ end
+ end
+end
+__END__
+todo:
+* table of contents
+* page header/footer?
+
+done:
+headings *
+footnotes *
+bold underscore italics strikethrough *
+superscript subscript *
+extended ascii set *
+indents *
+ [autonomy_markup0.sst] *
+groups
+ poem *
+ code *
+ tables
+images
+bullet
+line break
+page break
+
+notes?? [you could add a note number for every object/paragraph!]
+
+ cd(@env.path.odf)
+ structure=[]
+ Find.find(@env.path.odf) do |f|
+ structure << puts f
+ end
+ open(opendoc,'wb') do |f|
+ zip=Zlib::ZipWriter.new(f)
+ structure.each |z| do
+ zip << z
+ end
+ zip.close
+ end
+ #zip -qr #{opendoc} *
+ mv(opendoc,"#{@env.path.output}/#{@md.fnb}/.")
+ cd(Dir.pwd)
diff --git a/lib/sisu/0.52/odf_format.rb b/lib/sisu/0.52/odf_format.rb
new file mode 100644
index 00000000..edb202d8
--- /dev/null
+++ b/lib/sisu/0.52/odf_format.rb
@@ -0,0 +1,225 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: opendocument formatting, default opendocument template
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module OD_format
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ class Paragraph_number
+ def initialize(paranum)
+ @paranum=/(\d+)/m.match(paranum)[1]
+ end
+ def display
+ @paranum.gsub(/(\d+)/,'<font size="1" color="#777777">&nbsp;&nbsp;\1</font>')
+ end
+ def name
+ @paranum.gsub(/(\d+)/,'<a name="\1"></a>')
+ end
+ def goto
+ @paranum.gsub(/(\d+)/,'<a href="#\1">')
+ end
+ end
+ class Format_text_object
+ @@dp=nil
+ def initialize(one,two,three)
+ one.gsub!(/\.(html|pdf|php)/,'') if one =~/\.\.\/\S+/
+ @one,@two,@three=one,two,three
+ rgx=/^[1-6-]~/
+ @one.gsub!(rgx,'') if @one =~rgx
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ rgx=/~\{\d+\s+(.+?)<#@dp>\}~/
+ @one.gsub!(rgx,'\1') if @one =~rgx
+ @link,@linkname=one,two
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def scr_endnote_body
+ "<endnote>#@one</endnote> "
+ end
+ def heading_body1
+ #%{<text:h text:style-name="Heading_20_1" text:outline-level="1">#@two</text:h>}
+ end
+ def heading_body2
+ #%{<text:h text:style-name="Heading_20_2" text:outline-level="2">#@two</text:h>}
+ end
+ def heading_body3
+ #%{<text:h text:style-name="Heading_20_3" text:outline-level="3">#@two</text:h>}
+ end
+ def heading_body4
+ #%{<text:h text:style-name="Heading_20_4" text:outline-level="4">#@two</text:h>}
+ end
+ def heading_body5
+ #%{<text:h text:style-name="Heading_20_5" text:outline-level="5">#@two</text:h>}
+ end
+ def heading_body6
+ #%{<text:h text:style-name="Heading_20_6" text:outline-level="6">#@two</text:h>}
+ end
+ end
+ class Table
+ @@tablehead,@@table_counter=0,0 #reinitialise on new file
+ @@tablefoot=[] #watch
+ @@fns=''
+ @@dp=nil
+ def initialize(md,one)
+ @md,@one,@parablock,@vz=md,one,one,SiSU_Env::Get_init.instance.skin
+ if @md.fns != @@fns
+ @@table_counter=0
+ @@fns=@md.fns
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ end
+ def table_head(count,col,h=false)
+ type=if h; 1
+ else 2
+ end
+ alpha=case col.to_i
+ when 1; 'A'
+ when 2; 'B'
+ when 3; 'C'
+ when 4; 'D'
+ when 5; 'E'
+ when 6; 'F'
+ when 7; 'G'
+ when 8; 'H'
+ when 9; 'I'
+ when 10; 'J'
+ when 11; 'K'
+ when 12; 'L'
+ when 13; 'M'
+ when 14; 'N'
+ else 'D'
+ end
+ %{<table:table table:name="Table#{count}" table:style-name="Table#{type}">#@br} +
+ %{<table:table-column table:style-name="Table#{type}.#{alpha}" table:number-columns-repeated="#{col}"/>#@br}
+ end
+ def table_end(tablefoot='')
+ '</table:table>'
+ end
+ def table_row(inf,h=false)
+ if h; %{<table:table-row>#@br} +
+ %{<table:table-cell office:value-type="string">#@br} +
+ %{<text:p text:style-name="Table_20_Heading">#@br}
+ else %{<table:table-row>#@br} +
+ %{<table:table-cell office:value-type="string">#@br} +
+ %{<text:p text:style-name="P7">#@br}
+ end
+ end
+ def table_cell(inf,h=false)
+ if h; %{</text:p>#@br} +
+ %{</table:table-cell>#@br} +
+ %{<table:table-cell office:value-type="string">#@br} +
+ %{<text:p text:style-name="Table_20_Heading">#@br}
+ else %{</text:p>#@br} +
+ %{</table:table-cell>#@br} +
+ %{<table:table-cell office:value-type="string">#@br} +
+ %{<text:p text:style-name="P7">#@br}
+ end
+ end
+ def table_row_close(h=false)
+ %{</text:p>#@br} +
+ %{</table:table-cell>#@br} +
+ %{</table:table-row>#@br}
+ end
+ def table
+ @parablock='' if @parablock =~/^<!$/
+ @parablock.gsub!(/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'')
+ m=@parablock[/<!f(.+?)!>/,1]
+ @@tablefoot << m if m
+ @parablock.gsub!(/<!f.+?!>/,'')
+ @@tablehead=1 if @parablock =~/<!Th¡/
+ @@table_counter+=1 if @parablock =~/<!Th?¡/
+ if @parablock =~/<!Th¡\s+c(\d+).+?!~\d+;\w\d+;\w\d+>/; @parablock=table_head(@@table_counter,$1,true)
+ elsif @parablock =~/<!T¡\s+c(\d+).+?!~\d+;\w\d+;\w\d+>/; @parablock=table_head(@@table_counter,$1)
+ end
+ if @parablock =~/<!TZ!>/
+ tablefoot=[]
+ @@tablefoot.each {|x| tablefoot << ''}
+ @@tablefoot=[]
+ if @parablock =~/<!TZ!>/; @parablock=table_end
+ end
+ end
+ if @@tablehead == 1
+ if @parablock =~/¡¡/
+ if @parablock =~/<!¡¡(\d+?)¡/
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))
+ end
+ if @parablock =~/¡¡(\d+?)¡/
+ @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))
+ end
+ if @parablock =~/!>/
+ @parablock.gsub!(/!>/,table_row_close(true))
+ end
+ @@tablehead=0
+ end
+ @parablock
+ else
+ if @parablock =~/<!¡¡(\d+?)¡/
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1))
+ end
+ if @parablock =~/¡¡(\d+?)¡/
+ @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1))
+ end
+ if @parablock =~/!>/
+ @parablock.gsub!(/!>/,table_row_close)
+ end
+ @parablock
+ end
+ @parablock
+ end
+ def table_split
+ @new_content=[]
+ @one.split(/\s*<!/).each do |parablock|
+ table=Table.new(@md,"<!#{parablock}")
+ @new_content << table.table
+ end
+ @new_content.join
+ end
+ end
+ class XML
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/options.rb b/lib/sisu/0.52/options.rb
new file mode 100644
index 00000000..b253aab1
--- /dev/null
+++ b/lib/sisu/0.52/options.rb
@@ -0,0 +1,168 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: SiSU information Structuring Universe, command line options parsing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+=end
+module SiSU_commandline
+ require SiSU_lib + '/sysenv'
+ class Options
+ attr_accessor :cmd,:mod,:files,:fns,:fnb,:what
+ def initialize(a)
+ @cmd,@files,@fns,@fnb,@what,c,w,s='','','','','','','','',''
+ @files,@mod,m,f,z,ca=[],[],[],[],[],[]
+ @env=SiSU_Env::Info_env.new
+ shortcut=SiSU_Env::Info_processing_flag.new
+ a.each do |x|
+ y=case x
+ when /0/
+ if x=~/^-1\S+/; x.gsub(/^-0(\S+)/,shortcut.cf_0 + ' -\1')
+ else x.gsub(/^-0/,shortcut.cf_0 + ' ')
+ end
+ when /1/
+ if x=~/^-1\S+/; x.gsub(/^-1(\S+)/,shortcut.cf_1 + ' -\1')
+ else x.gsub(/^-1/,shortcut.cf_1 + ' ')
+ end
+ when /2/
+ if x=~/^-2\S+/; x.gsub(/^-2(\S+)/,shortcut.cf_2 + ' -\1')
+ else x.gsub(/^-2/,shortcut.cf_2 + ' ')
+ end
+ when /3/
+ if x=~/^-3\S+/; x.gsub(/^-3(\S+)/,shortcut.cf_3 + ' -\1')
+ else x.gsub(/^-3/,shortcut.cf_3 + ' ')
+ end
+ when /4/
+ if x=~/^-4\S+/; x.gsub(/^-4(\S+)/,shortcut.cf_4 + ' -\1')
+ else x.gsub(/^-4/,shortcut.cf_4 + ' ')
+ end
+ when /5/
+ if x=~/^-5\S+/; x.gsub(/^-5(\S+)/,shortcut.cf_5 + ' -\1')
+ else x.gsub(/^-5/,shortcut.cf_5 + ' ')
+ end
+ else x
+ end
+ s << " #{y}" unless y.empty?
+ end
+ s.strip!
+ a=s.split(/\s+/)
+ a.each do |x|
+ if x =~/^-[a-z0-5]+/i or x =~/^--\S+/
+ if x =~/^-([a-z0-5]+)/i; c << $1
+ end
+ if x =~/^--\S+/; m << x
+ end
+ elsif x =~ /(?:\.(?:[_-]?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|sisupod(?:\.zip)?)$/
+ if x =~/^http:\/\/\S+/; f << x
+ elsif FileTest.file?(x); f << x
+ else puts "file not found: #{x}"
+ end
+ elsif x =~ /\.termsheet\.rb$/
+ if FileTest.file?(x); f << x
+ else puts "file not found: #{x}"
+ end
+ else w=x
+ puts "#{x} in #{a.join(' ')}?"
+ end
+ end
+ unless m.empty?
+ m.each do |m|
+ case m
+ when /--maintenance/
+ c=c+'M'
+ when /--verbose[=-]3/
+ c=c+'VM'
+ when /--verbose[=-]2|--Verbose|--VERBOSE/
+ c=c+'V'
+ when /--verbose(?:[=-]1)?/
+ c=c+'v'
+ when /--verbose[=-]0|--quiet|--silent/
+ c=c+'q'
+ else @mod << m
+ end
+ end
+ end
+ unless c.empty?
+ c.gsub!(/-/,'')
+ c.scan(/./) {|x| ca << x}
+ @cmd= '-' + ca.uniq.join
+ end
+ unless w.empty? ; @what=w
+ end
+ @files << f
+ @files.flatten!
+ if @files.length > 0 and @cmd.empty? and @mod.length == 0 #% if no other action called on filename given, default is sisu -0 [filename(s)] configured as flag default
+ @cmd=shortcut.cf_0
+ end
+ tell=SiSU_Screen::Ansi.new(@cmd,"\tsisu " + @cmd + ' ' + @mod.join(' ') + ' ' + @files.join(' ') + "\n")
+ tell.print_brown if @cmd =~/[vVM]/
+ @files.uniq!
+ end
+ def cmd
+ @cmd
+ end
+ def mod
+ @mod
+ end
+ def fns
+ @fns
+ end
+ def what
+ @what
+ end
+ def fnb
+ unless fns.empty?
+ fns[/(.+?)\.(?:[_-]?sst|ssm)$/,1]
+ end
+ end
+ end
+end
+__END__
+note usually named @opt
+is carried in Param usually as @md
+@opt is a subset of @md
+where @md is passed, contents of @opt are available
+passing @opt as well is duplication
+check for fns & fnb
diff --git a/lib/sisu/0.52/param.rb b/lib/sisu/0.52/param.rb
new file mode 100644
index 00000000..eb99d15b
--- /dev/null
+++ b/lib/sisu/0.52/param.rb
@@ -0,0 +1,791 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: parameters extracted from input file(s) for program use
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Param
+ require 'uri'
+ require 'pstore'
+ require 'ftools'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/param_identify_markup'
+ require SiSU_lib + '/help'
+ include SiSU_Help
+ @@date=SiSU_Env::Info_date.new
+ @@symlnk=Create_system_link.new
+ @@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=nil
+ @doc={ :initialise=>nil,:markup=>'',:lnks=>'',:stmp=>'',:req=>{} }
+ @@yaml=@@yamladdr=nil
+ @@trigger=nil
+ @@lv,@@flag={},{}
+ @@tex_backslash="\\\\"
+ class Parameters
+ @@publisher='SiSU scribe'
+ @@md=@@fns=nil
+ def initialize(opt)
+ @cX||=SiSU_Screen::Ansi.new(opt.cmd)
+ @cmd,@mod=opt.cmd,opt.mod
+ @fns=opt.fns.gsub(/\.ssm$/,'._sst') #revisit
+ Instantiate.new.param_instantiate
+ @env=SiSU_Env::Info_env.new(@fns)
+ @pstorefile="#{@env.path.dal}/#@fns.pstore"
+ end
+ def get
+ unless @@fns==@fns
+ @@fns=@fns
+ @@md=nil
+ end
+ if @@md.nil? or @cmd =~/M/ #not particularly helpful, as current cycle is through output types, with files changing, only helpful if deal with a file all output types before going to next file
+ if File.exist?(@pstorefile)
+ param_msg='Parameters from pstore'
+ store=PStore.new(@pstorefile)
+ store.transaction do |s|
+ @md=s['md']
+ s.commit
+ end
+ else #if @fns =~/\.s[123]/
+ param_msg='Parameters extracted'
+ fns_array=IO.readlines(@fns,'')
+ @md=SiSU_Param::Instructions.new(fns_array,@fns,@cmd)
+ end
+ @@md=@md
+ else
+ @@md
+ end
+ tell=SiSU_Screen::Ansi.new(@cmd,param_msg,@@md.title)
+ tell.txt_grey if @cmd =~/[MV]/
+ @@md.cmd=@cmd
+ @@md
+ end
+ class Instructions
+ @doc={ :lv=>[] }
+ @doc[:fns],@doc[:fnb],@doc[:scr_suffix]='','',''
+ @@publisher='SiSU scribe'
+ attr_accessor :cmd,:mod,:env,:fn,:fns,:fnb,:fnn,:fnt,:fnl,:flv,:fnstex,:ocn,:sfx_src,:sfx,:pdf,:file_type,:dir_out,:dir_tex,:dir_lout,:txt_path,:site_skin,:sisu,:sisu_version,:ruby_version,:title,:dc_title,:html_title,:subtitle,:subtitle_tex,:creator_home,:dc_creator,:translator,:illustrator,:prepared_by,:digitized_by,:dc_subject,:dc_description,:dc_publisher,:dc_contributor,:dc_date,:dc_date_created,:dc_date_issued,:dc_date_available,:dc_date_valid,:dc_date_modified,:date_scheme,:date_created_scheme,:date_issued_scheme,:date_available_scheme,:date_valid_scheme,:date_modified_scheme,:dc_type,:dc_format,:dc_identifier,:dc_source,:dc_language,:language_original,:dc_relation,:dc_coverage,:dc_rights,:keywords,:comments,:abstract,:cls_loc,:cls_dewey,:cls_pg,:cls_isbn,:papersize,:toc,:lv1,:lv2,:lv3,:lv4,:lv5,:lv6,:pagenew,:pagebreak,:num_top,:toc_lev_limit,:flag_endnotes,:flag_auto_endnotes,:flag_separate_endnotes,:flag_separate_endnotes_make,:flag_auto_heading_num,:markup,:markup_instruction,:markup_version,:markup_declared,:make_bold,:make_italic,:flag_pdf,:flag_tables,:vocabulary,:doc_skin,:doc_css,:yaml,:lnk,:prefix_a,:prefix_b,:suffix,:information,:contact,:icon,:image,:ad_url,:ad_png,:ad_alt,:ad_began,:flag_promo,:promo,:ad_home,:stmp,:stmpd,:sc_filename,:sc_number,:sc_date,:sc_time,:sc_info,:yamladdr,:locale,:wc_lines,:wc_words,:wc_bytes,:file_encoding,:file_size,:user,:home,:hostname,:pwd,:firstseg,:programs,:creator_copymark,:lang,:en,:dgst,:dgst_skin,:generated,:tags,:tag_array,:concord_make,:seg_names,:seg_autoname_safe,:set_header_title,:set_heading_top,:set_heading_seg,:heading_seg_first,:heading_seg_first_flag,:base_program
+ def initialize(fns_array,opt)
+ @env=@fn=@fns=@fnb=@fnn=@fnt=@fnl=@flv=@fnstex=@ocn=@sfx_src=@sfx=@pdf=@file_type=@dir_out=@dir_tex=@dir_lout=@txt_path=@flag_endnotes=@flag_auto_endnotes=@flag_separate_endnotes=@flag_separate_endnotes_make=@site_skin=@sisu=@sisu_version=@ruby_version=@title=@dc_title=@html_title=@subtitle=@subtitle_tex=@creator_home=@dc_creator=@translator=@illustrator=@prepared_by=@digitized_by=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_date_created=@dc_date_issued=@dc_date_available=@dc_date_valid=@dc_date_modified=@date_scheme=@date_created_scheme=@date_issued_scheme=@date_available_scheme=@date_valid_scheme=@date_modified_scheme=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@language_original=@dc_relation=@dc_coverage=@dc_rights=@keywords=@comments=@abstract=@cls_loc=@cls_dewey=@cls_pg=@cls_isbn=@papersize=@toc=@lv1=@lv2=@lv3=@lv4=@lv5=@lv6=@pagenew=@pagebreak=@num_top=@toc_lev_limit=@flag_auto_heading_num=@make_bold=@make_italic=@flag_pdf=@flag_tables=@vocabulary=@doc_skin=@doc_css=@yaml=@lnk=@prefix_a=@prefix_b=@suffix=@information=@contact=@icon=@ad_url=@ad_png=@ad_alt=@ad_began=@promo=@ad_home=@stmp=@stmpd=@sc_filename=@sc_number=@sc_date=@sc_time=@sc_info=@yamladdr=@locale=@wc_lines=@wc_words=@wc_bytes=@file_encoding=@file_size=@firstseg=@programs=@creator_copymark=@lang=@en=@dgst=@dgst_skin=@generated=@heading_seg_first=@base_program=nil
+ @data,@fns,@cmd,@mod,@opt=fns_array,opt.fns,opt.cmd,opt.mod,opt #@data used as data
+ @flag_tables,@set_header_title,@set_heading_top,@set_heading_seg,@heading_seg_first_flag,@flag_promo=false,false,false,false,false,false
+ @seg_autoname_safe=true
+ @markup_instruction,@markup_declared,@image='','','' #check which other values should be set to empty rather than nil
+ @markup=@markup_instruction #use @markup_instruction
+ @flv,@lang,@seg_names,@tags,@tag_array,@tag_a=Array.new(6){[]}
+ @doc,@fn,@make_italic,@make_bold,@tag_hash={},{},{},{},{},{}
+ begin
+ rescue; SiSU_Errors::Info_error.new($!,$@,@cmd,@fns).error
+ ensure
+ end
+ end
+ protected
+ def determine_papersize(l)
+ l=case l
+ when /eu|europe|uk/i; 'A4' #European default, SiSU default
+ when /(?:us-)?legal|legal/i; 'US_legal' #U.S. alternative
+ when /(?:us-)?letter|u.s.|us/i; 'US_letter' #U.S. default
+ when /book_a5|a5/i; 'book_a5'
+ when /book_b5|b5|book/i; 'book_b5' #book default - larger
+ else 'A4'
+ end
+ end
+ def extract
+ @user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD']
+ @programs,@wc,@dc_language,@language_original={},{},{},{}
+ @en={ :sum=>0,:mark=>0,:note=>0,:mismatch=>0 }
+ @prog=SiSU_Env::Info_settings.new
+ @sys=SiSU_Env::System_call.new
+ @env=SiSU_Env::Info_env.new(@fns) #watch
+ if @prog.wc and @sys.wc
+ wc=%x{wc #{fns}}
+ wca=wc.scan(/\d+/)
+ @wc_lines,@wc_words,@wc_bytes=wca[0].to_i,wca[1].to_i,wca[2].to_i
+ else
+ fns_a=@data.dup
+ tmp=fns_a.join
+ fns_a=tmp.scan(/\S+/)
+ @wc_words=fns_a.length
+ fns_a=tmp=nil
+ end
+ @concord_make=if @wc_words > @env.concord_max; false
+ else true
+ end
+ @locale=@sys.locale
+ @file_encoding=@sys.file_encoding(fns,@cmd)
+ # programs set here for things that affect output appearance only
+ @programs[:pdf]=SiSU_Env::System_call.new.program_found?('pdflatex')
+ if @env.i18n.multilingual
+ m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst)$/ #watch added match for sss
+ @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3]
+ @flv=@env.document_language_versions_found[:f]
+ else m=/(.+?)\.([_-]?sst)$/
+ @fnb=@fnn=@fns[m,1]
+ @fnt=@fns[m,2]
+ @flv<<@fns
+ end
+ @papersize=@env.papersize #'A4' #default size #get first from SiSU_Env:: # @env is probably no longer most appropriate name! as default info is more general
+ @sfx_src=@fns[m,2]
+ @sfx=nil
+ @flag_pdf=true #watch
+ @flag_auto_heading_num=false
+#watch
+ if @fns =~ /[_-]?sst$/ #watch
+ @env_out_root=@env.path.output
+ @dir_out="#{@env.path.output}/#@fnb"
+ @dir_tex=@env.path.tex
+ @dir_lout=@env.path.lout
+ @@publisher='SiSU http://www.jus.uio.no/sisu'
+ end
+ @txt_path=@txt_path ||= @env.path.output
+ @stmp=%{#@fns}[/^(.+?)\..*/m,1]
+ @fnstex=@fns.gsub(/_/,'\_')
+ @flag_separate_endnotes=false
+ @flag_separate_endnotes_make=true
+ regx_date=/^\d{4}(?:-(?:[0][0-9]|1[0-2])(-(?:[0-2][0-9]|3[01]))?)?$/
+ ver=SiSU_Env::Info_version.new
+ @sisu_version=ver.get_version
+ @ruby_version=ver.rbversion
+ @generated=Time.now
+ fns_array=@data.dup
+ skip unless fns_array # consider
+ @markup_version=SiSU_Markup::Markup_identify.new(fns_array,@opt).markup_version? #% determine markup version
+ if fns_array[0] =~ /^(?:% )?(?:SiSU\s+[\d.]*|sisu-[\d.]+)$/ #check markup and markup version
+ if fns_array[0] =~ /^(?:% )?(?:SiSU\s+|sisu-)[\d.]+$/ #check markup and markup version
+ @markup_version_declared=fns_array[0].match(/^(?:% )?(?:SiSU\s+|sisu-)([\d.]+)$/)[1]
+ sm_a,sm_b,sm_c=fns_array[0].match(/^(?:% )?(?:SiSU\s+|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3]
+ sm_c ||=0
+ sv=if @cmd =~/[VMv]/; "SiSU version (#{@sisu_version[:version]})"
+ else ''
+ end
+ s_a,s_b,s_c=@sisu_version[:version].match(/^([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3]
+ tell=if @markup_version_declared.to_f == @markup_version.to_f
+ SiSU_Screen::Ansi.new(@cmd,"Markup version (#@markup_version)",sv)
+ else
+ SiSU_Screen::Ansi.new(@cmd,"Markup version declared (#@markup_version_declared), determined (#@markup_version)",sv)
+ end
+ ok=if s_a.to_i > sm_a.to_i
+ true
+ elsif s_a.to_i == sm_a.to_i and s_b.to_i >= sm_b.to_i
+ true
+ elsif s_a.to_i == sm_a.to_i and s_b.to_i == sm_b.to_i and s_c.to_i >= sm_c.to_i
+ true
+ else false
+ end
+ if ok
+ tell.txt_green if @cmd =~/[vVM]/
+ else
+ tell=SiSU_Screen::Ansi.new(@cmd,"Warning: markup version determined (#@markup_version) or markup version declared (#@markup_version_declared) is newer than SiSU version (#{@sisu_version[:version]})")
+ tell.warn unless @cmd =~/q/
+ end
+ else
+ tell=SiSU_Screen::Ansi.new(@cmd,'No SiSU markup version provided')
+ tell.warn if @cmd =~/[VM]/
+ end
+ else
+ tell=SiSU_Screen::Ansi.new(@cmd,'SiSU filetype indicator not provided')
+ tell.warn unless @cmd =~/q/
+ end
+ fns_array.each do |par| #% Scan document
+ para=par.gsub(/\n/,' ')
+ if para !~/^\%+\s/ and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included
+ raise "Old markup style in file #@fns, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n"
+ end
+ regx_header=/^(?:0~|@\S+?:[+-]?\s)/
+ if para =~regx_header #or para=~/^(?:1|:?A)~/
+ case para
+ when /^(?:0~ocn|@ocn:)\s+(.+?)$/m; @ocn=$1 #% processing
+ when /^(?:0~title|@title:)\s+(.+?)$/m #% metainfo DC
+ @title=$1.strip
+ @dc_title=@title.dup
+ @html_title=@title.gsub(/(<p>|<p \/>|<br>|<br \/>)/,'')
+ @set_header_title=true
+ @title.chomp!(' ')
+ @html_title.chomp!(' ')
+ tell=SiSU_Screen::Ansi.new(@cmd,'Parameters',@html_title)
+ tell.txt_grey unless @cmd =~/q/
+ when /^(?:0~subtitle|@subtitle:)\s+(.+?)$/m #% metainfo
+ @subtitle=$1.strip
+ @dc_title="#{@title} - #{@subtitle}"
+ @subtitle_tex=@subtitle
+ when /^(?:0~(creator|author)-?|@(creator|author)-?:)\s+/ #% metainfo DC
+ if para[/(?:0~|@)(?:creator|author):?\s+((?:https?|ftp)\S+)\s+(.+?)$/m]
+ @creator_home, @dc_creator=$1,$2
+ else @dc_creator=/(?:0~|@)(?:creator|author)-?:?\s+(.+?)$/m.match(para)[1]
+ end
+ @creator_copymark=if para=~/(?:0~|@)(?:creator|author)-:?/; false
+ else true
+ end
+ @dc_creator.strip!
+ when /^(?:0~(?:translator|translated_by)|@(?:translator|translated_by):)\s+(.+?)$/m #% metainfo
+ @translator=$1
+ when /^(?:0~(?:illustrator|illustrated_by)|@(?:illustrator|illustrated_by):)\s+(.+?)$/m #% metainfo
+ @illustrator=$1
+ when /^(?:0~prepared_by|@prepared_by:)\s+(.+?)$/m #% metainfo
+ @prepared_by=$1
+ when /^(?:0~digitized_by|@digitized_by:)\s+(.+?)$/m #% metainfo DC
+ @digitized_by=$1
+ when /^(?:0~subject|@subject:)\s+(.+?)$/m #% metainfo DC
+ @dc_subject=$1
+ when /^(?:0~description|@description:)\s+(.+?)$/m #% metainfo DC & rss feed
+ @dc_description=$1
+ when /^(?:0~contributor|@contributor:)\s+(.+?)$/m #% metainfo DC
+ @dc_contributor=$1
+ when /^(?:0~publisher|@publisher:)\s+(.+?)$/m #% metainfo DC
+ @dc_publisher=$1
+ when /^(?:0~|@)date.+?$/m #% metainfo DC
+ if para =~/(?:0~date|@date:)\s+(.+?)$/m
+ @dc_date=$1.strip
+ if @dc_date !~regx_date and not @dc_date.empty?
+ tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',@dc_date)
+ tell.instruct if @cmd =~/v/
+ end
+ @date_scheme='scheme="ISO-8601"' if @dc_date =~/\d{4}-\d{2}-\d{2}/
+ end
+ if para =~/(?:0~date\.created|@date\.created:)\s*(.+?)$/m
+ date=$1.strip
+ if date !~regx_date and not date.empty?
+ tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date)
+ tell.instruct if @cmd =~/v/
+ end
+ @dc_date_created=date
+ @date_created_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/
+ end
+ if para =~/(?:0~date\.issued|@date\.issued:)\s*(.+?)$/m
+ date=$1.strip
+ if date !~regx_date and not date.empty?
+ tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date)
+ tell.instruct if @cmd =~/v/
+ end
+ @dc_date_issued=date
+ @date_issued_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/
+ end
+ if para =~/(?:0~date\.available|@date\.available:)\s*(.+?)$/m
+ date=$1.strip
+ if date !~regx_date and not date.empty?
+ tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date)
+ tell.instruct if @cmd =~/v/
+ end
+ @dc_date_available=date
+ @date_available_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/
+ end
+ if para =~/^(?:0~date\.valid|@date\.valid:)\s*(.+?)$/m
+ date=$1.strip
+ if date !~regx_date and not date.empty?
+ tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date)
+ tell.instruct if @cmd =~/v/
+ end
+ @dc_date_valid=date
+ @date_valid_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/
+ end
+ if para =~/^(?:0~date\.modified|@date\.modified:)\s*(.+?)$/m #% of interest rss feed & sitemap
+ date=$1.strip
+ if date !~regx_date and not date.empty?
+ tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date)
+ tell.instruct if @cmd =~/v/
+ end
+ @dc_date_modified=date
+ @date_modified_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/
+ end
+ when /^(?:0~type|@type:)\s+(.+?)$/m; @dc_type=$1 #% metainfo DC
+ when /^(?:0~format|@format:)\s+(.+?)$/m; @dc_format=$1 #% metainfo DC
+ when /^(?:0~identifier|@identifier:)\s+(.+?)$/m; @dc_identifier=$1 #% metainfo DC
+ when /^(?:0~source|@source:)\s+(.+?)$/m; @dc_source=$1 #% metainfo DC
+ when /^(?:0~language(?:\.document)?|@language(?:\.document)?:)\s+(.+?)$/m #% metainfo DC
+ x=$1.strip
+ lang=SiSU_Env::Standardise_language.new(x.dup)
+ @dc_language[:code]=lang.code
+ @dc_language[:name]=lang.title
+ when /^(?:0~language\.original|@language\.original:)\s+(.+?)$/m #% metainfo DC
+ x=$1.strip
+ lang=SiSU_Env::Standardise_language.new(x.dup)
+ @language_original[:name]=lang.title
+ when /^(?:0~relation|@relation:)\s+(.+?)$/m; @dc_relation=$1 #% metainfo DC
+ when /^(?:0~coverage|@coverage:)\s+(.+?)$/m; @dc_coverage=$1 #% metainfo DC
+ when /^(?:0~rights|@rights:)\s+(.+?)$/m; @dc_rights=$1 #% metainfo DC copyright, public domain, copyleft, creative commons, etc.
+ when /^(?:0~papersize|@papersize:)\s+(.+?)$/m #% metainfo DC
+ l=$1
+ if @mod.inspect !~/--papersize[=-]\S+/
+ l=determine_papersize(l.dup)
+ @papersize=l
+ end
+ when /^(?:0~keywords?|@keywords?:?)\s+(.+?)$/m; @keywords=$1 #% metainfo DC
+ when /^(?:0~comments?|@comments?:?)\s+(.+?)$/m; @comments=$1 #% metainfo DC
+ when /^(?:0~abstract|@abstract)\s+(.+?)$/m; @abstract=$1 #% metainfo DC
+ when /^(?:0~tags?|@tags?:)\s+\S/m #% metainfo
+ tags=par.match(/^(?:0~tags?|@tags?:)\s+(.+)$/m)[1]
+ tags.split(/,|$/).each do |tag|
+ tag.strip!
+ @tags << tag
+ @tag_array << tag.split(/:/)
+ tag_a = tag.downcase.gsub(/\s+/,'_').gsub(/(.+)/,'[\1]')
+ tag_a=tag_a.split(/:/).join('][')
+ @tag_a << tag_a
+ end
+ when /^(?:0~catalogue|@catalogue:)\s+(.+)?$/m #% metainfo
+ m=$1
+ m.split(/;?\s+/) #spaces within a catalogue category not permitted, e.g. isbn
+ #tags=par.match(/^(?:0~tags?|@tags?:)\s+(.+)$/im)[1]
+ m.each do |c|
+ case c
+ when /pg=/; @cls_pg=c.match(/pg=(\S+)/)[1]
+ when /isbn=/; @cls_isbn=c.match(/isbn=(\S+)/)[1]
+ when /dewey=/; @cls_dewey=c.match(/dewey=(\S+)/)[1]
+ when /loc=/; @cls_loc=c.match(/loc=(\S+)/)[1]
+ end
+ end
+ when /^(?:0~class(?:ify)?_loc|@class(?:ify)?_loc:)\s+(.+?)$/m; @cls_loc=$1 #% metainfo
+ when /^(?:0~class(?:ify)?_dewey|@class(?:ify)?_dewey:)\s+(.+?)$/m; @cls_dewey=$1 #% metainfo
+ when /^(?:0~class(?:ify)?_pg|@class(?:ify)?_pg)\s+(.+?)$/m; @cls_pg=$1 #% metainfo
+ when /^(?:0~(?:class(?:ify)?_)?isbn|@(?:class(?:ify)?_)?isbn)\s+(\S+?)$/m; @cls_isbn=$1 #% metainfo
+ when /^(?:0~images?|@images?:)\s+(.+?)$/m; @image=$1 #% processing
+ when /^(?:0~(?:toc|structure)|@(?:toc|structure):)\s+(.+?)$/m #% processing
+ doc_toc_str=$1
+ @toc=doc_toc_str.split(/;\s*/)
+ #@toc.each {|x| x.gsub!(/\{/,'\{') } #FIX~
+ lv1=@toc[0] ||='1~ ' #some arbitrary changes made
+ @lv1=/^#{lv1}\b/
+ lv2=@toc[1] ||='2~ '
+ @lv2=/^#{lv2}\b/
+ lv3=@toc[2] ||='3~ '
+ @lv3=/^#{lv3}\b/
+ lv4=@toc[3] ||='4~ '
+ @lv4=/^#{lv4}\b/
+ lv5=@toc[4] ||='5~ '
+ @lv5=/^#{lv5}\b/
+ lv6=@toc[5] ||='6~ '
+ @lv6=/^#{lv6}\b/
+ when /^(?:0~(?:level|page|markup)|@(?:level|page|markup):)\s+(.+?)$/m #% processing revisit..., use syntax 0~level new=1,2,3; break=4
+ if para =~/(?:0~|@)(?:markup|level|page):?\s+(.+?)$/m
+ page_break_str=$1
+ pagebreaks=page_break_str.split(/;\s*/)
+ page_new,page_break,num_top=toc_lev_limit=nil
+ pagebreaks.each do |x|
+ page_new = x[/(:?[\dA-C],?)+/] if x=~/new|clear/
+ page_break = x[/(:?[\dA-C],?)+/] if x =~/break/
+ num_top = x[/:?[\dA-C]/].to_i if x =~/num_top/
+ toc_lev_limit = x[/:?[\dA-C]/].to_i if x =~/toc_limit/
+ end
+ @pagenew=page_new if page_new
+ @pagebreak=page_break if page_break
+ @num_top=num_top if num_top
+ @toc_lev_limit=toc_lev_limit if toc_lev_limit
+ @flag_auto_heading_num=true if para =~/num_top/
+ end
+ if para =~/^(?:0~markup|@markup:)\s+(.+?)$/m #%use of markup depreciated for num_top
+ @markup=$1
+ @flag_auto_heading_num=true if para =~/num_top/
+ @flag_pdf=false if para =~/pdf_no/ or para =~/url_png/
+ end
+ when /^(?:0~bold|@bold:)\s+(.+?)$/m #% processing
+ m=$1.strip
+ x=case m
+ when /\/i$/; 'i'
+ else ''
+ end
+ m.gsub!(/^\/(.+?)\/i?/,'\1')
+ m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided
+ rgx='\b(' + m + ')\b'
+ @make_bold[:str]='\b(?:' + m + ')\b'
+ @make_bold[:regx]=if x =~/i/; /#{rgx}/i
+ else /#{rgx}/
+ end
+ @make_bold
+ when /^(?:0~(?:italics?|itali[sz]e)|@(?:italics?|itali[sz]e):)\s+(.+?)$/m #% processing Dublin Core - dublin core within
+ m=$1.strip
+ x=case m
+ when /\/i$/; 'i'
+ else ''
+ end
+ m.gsub!(/^\/(.+?)\/i?/,'\1')
+ m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided
+ rgx='\b(' + m + ')\b'
+ @make_italic[:str]='\b(?:' + m + ')\b'
+ @make_italic[:regx]=if x =~/i/; /#{rgx}/i
+ else /#{rgx}/
+ end
+ @make_italic
+ when /^(?:0~(?:vocabulary|wordlist)|@(?:vocabulary|wordlist):)\s+(.+?)$/m #% processing
+ @vocabulary=$1 #not actually used by concordance
+ when /^(?:0~skin|@skin:)\s+(.+?)$/; @doc_skin=$1.strip #% processing
+ when /^(?:0~(?:css|stylesheet)|@(?:css|stylesheet):)\s+(.+?)$/; @doc_css=$1.strip #% processing
+ when /^(?:0~links|@links:)\s+(.+?)$/m #% processing
+ doc_links_str=$1
+ @lnk=[]
+ if doc_links_str=~/\{.+?\}(?:(?:https?|ftp):\/|\.\.)\/\S+(?:\s|$)/
+ doc_links=doc_links_str.scan(/\{.+?\}(?:(?:https?|ftp):\/|\.\.)\/\S+/)
+ count=1
+ doc_links.each do |x|
+ @lnk[count]={}
+ @lnk[count][:say],@lnk[count][:url]=/\{\s*(.+?)\s*\}((?:(?:https?|ftp):\/|\.\.)\/\S+)/im.match(x)[1,2]
+ count +=1
+ end
+ else
+ lnks=doc_links_str.split(/;\s+/)
+ count=1
+ lnks.each do |x|
+ @lnk[count]={}
+ if x =~/^\s*(?:(?:https?|ftp):\/\/|\.\.\/)/; @lnk[count][:url]=x
+ else
+ @lnk[count][:say]=x
+ count +=1
+ end
+ end
+ end
+ when /^(?:0~prefix(?:_[ab])?|@prefix(?:_[ab])?:)\s/ #% metainfo
+ if para =~/prefix_a:?\s+/
+ @prefix_a=para[/(?:0~prefix_a|@prefix_a:)\s+(.+?)$/im,1]
+ end
+ if para =~/prefix(?:_b)?:?\s+/
+ @prefix_b=para[/(?:0~prefix(?:_b)?|@prefix(?:_b)?:)\s+(.+?)$/im,1]
+ end
+ when /^(?:0~suffix|@suffix:)\s+(.+?)$/m; @suffix=$1 #% metainfo
+ when /^(?:0~information|@information:)\s+(.+?)$/m; @information=$1 #% metainfo
+ when /^(?:0~contact|@contact:)\s+(.+?)$/m; @contact=$1 #% metainfo
+ when /^(?:0~icon|@icon:)\s+(.+?)$/m; @icon=$1 #% processing
+ when /^(?:0~promo|@promo:)\s+(.+?)$/m
+ @flag_promo=true
+ @promo=$1.split(/[,;]\s*/)
+ when /^(?:0~ad|@ad:)\s+(\S+)?\s+(\S+\.png)?\s+(.+?!)\s+(\d+)\s*$/m #% processing
+ @ad_url,@ad_png,@ad_alt,@ad_began=$1,$2,$3,$4
+ when /0~ad\.home\s+(.+)?\s*$/m #% processing
+ ad_home_str=$1
+ @ad_home=ad_home_str.split(/\s+!/)
+ when /^(?:0~sta?mp(?:ed)?|@sta?mp(?:ed)?:)\s+(.+?)$/m; @stmp= $1.downcase! #% processing
+ when /^(?:0~(?:rcs|cvs)|@(?:rcs|cvs):)\+?\s+/ #% processing
+ m=/(?:0~(?:rcs|cvs)|@(?:rcs|cvs):)\+?\s+/ #note the + sign to turn on use of rcs or cvs id
+ ver=para[/#{m}(.+)/,1] #RCS or CVS ID tag # eg. # $Id$
+ contains=/[\$]Id:\s+(\S+),v\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+Exp\s+(?:\S+\s+)?[\$]/ # reason for [$] which is apparently unnecessary is that rcs or cvs will otherwise expand id!
+ if contains.match(ver)
+ filename,vnumber,date,time,operator=contains.match(ver).captures
+ @sc_filename,@sc_number,@sc_date,@sc_time=filename,vnumber,date,time
+ end
+ @sc_info=true if para[/(?:0~(?:rcs|cvs)|@(?:rcs|cvs):)\+/]
+ when /^@base_program:\s+(.+?)$/; @base_program=$1 #% processing
+ #% break - break, not necessary to process headers further :-) but necessary to extract endnotes etc. ;-(
+ end
+ @lv1 ||=/^1~/
+ @lv2 ||=/^2~/
+ @lv3 ||=/^3~/
+ @lv4 ||=/^4~/
+ @lv5 ||=/^5~/
+ @lv6 ||=/^6~/
+ if @dc_creator
+ @dc_rights ||=if @dc_date =~/([12][890]\d{2})/ #matches years 1800 through 20\d\d 2004w19
+ ('Copyright ' + @dc_creator) + ' ' + $1
+ else 'Copyright ' + @dc_creator
+ end
+ end
+ else #%
+ if para =~ /^(?:1|:?A)~/ #% processing
+ if para=~/^:?A~/
+ if @markup.nil? or @markup.empty?; @markup=@markup_version.to_s
+ elsif @markup !~/0\.38/; @markup=@markup.strip + "; #@markup_version"
+ end
+ end
+ if (para=~/^:?A~/ and @markup_version >= 0.38) or (para=~/^1~/ and @markup_version < 0.38)
+ if @title.nil?
+ @title=para[/^:?[A1]~\S*(.+)$/m,1]
+ @html_title=@title.gsub(/(<p>|<p \/>|<br>|<br \/>)/,'')
+ @title.chomp!("\n")
+ @html_title.chomp!("\n")
+ tell=SiSU_Screen::Ansi.new(@cmd,'Parameters',@html_title)
+ tell.txt_grey if @cmd =~/v/
+ end
+ end
+ end
+ case para
+ when /~\{\s+.+?\}~/ #% processing
+ en=para.scan(/~\{.+?\}~/)
+ en.each { |e| @en[:sum] +=1 }
+ when /~\^(?:\s|$)/ #% processing
+ mk=para.scan(/~\^(?:\s|$)/)
+ mk.each { |e| @en[:mark] +=1 }
+ when /^\^~\s+\S/; @en[:note] +=1 #% processing
+ end
+ if para =~/~\{|\^~ |~\^|<:ee>/; @flag_auto_endnotes,@flag_endnotes=true,true
+ end
+ unless @flag_auto_endnotes
+ if para =~/^(4~endnotes\b|<:ee>)/
+ @flag_separate_endnotes=true
+ @flag_endnotes=true
+ end
+ end
+ if para =~/^(?:4~endnotes|<:ee>)/; @flag_separate_endnotes_make=false
+ end
+ if para =~/<!!e[#0-9]+?!>\s*.+/; @flag_endnotes=true
+ end
+ if para =~/table\{|<!tableh?\s+c\d+;.+?!>/i; @flag_tables=true
+ end
+ end
+ if (@markup_version >= 0.38 and para =~/^:?A~/) or (@markup_version < 0.38 and para =~/^1~/)
+ @set_heading_top=true
+ end
+ if (@markup_version >= 0.38 and para =~/^1~/) or (@markup_version < 0.38 and para =~/^4~/)
+ m=nil
+ if @markup_version >= 0.38 and para =~/^1~(\S+)\s+(.+)$/; m,t=$1,$2
+ elsif @markup_version < 0.38 and para =~/^4~(\S+)\s+(.+)$/; m,t=$1,$2
+ elsif @markup_version >= 0.38 and para =~/^1~\s+(.+)$/; t=$1
+ elsif @markup_version < 0.38 and para =~/^4~\s+(.+)$/; t=$1
+ end
+ unless @heading_seg_first_flag # extract first segment name
+ @heading_seg_first=t
+ @heading_seg_first_flag=true
+ end
+ if m # list all segment names
+ @seg_names << m
+ @set_heading_seg=true
+ @seg_autoname_safe=false if m=~/^\d{1,3}/ and m !~/^0/
+ end
+ end
+ end #% here endeth the document loop
+ if @markup_version.to_f >= 0.38 #convert values in headers to internal representation
+ translated=[]
+ translate_list=[@pagenew,@pagebreak,@num_top,@toc_lev_limit]
+ translate_list.each do |t|
+ translate = t.to_s if t
+ translated << if translate
+ #translate.gsub!(/6/,'9')
+ #translate.gsub!(/5/,'8')
+ #translate.gsub!(/4/,'7')
+ translate.gsub!(/3/,'6')
+ translate.gsub!(/2/,'5')
+ translate.gsub!(/1/,'4')
+ translate.gsub!(/:?C/,'3')
+ translate.gsub!(/:?B/,'2')
+ translate.gsub!(/:?A/,'1')
+ translate=if translate =~/^\d+$/; translate.to_i
+ else translate
+ end
+ else nil
+ end
+ end
+ @pagenew,@pagebreak,@num_top,@toc_lev_limit=translated
+ @markup.gsub!(/page_new\s*=\s*([\dA-C])/,"page_new=#@pagenew")
+ @markup.gsub!(/page_break\s*=\s*([\dA-C])/,"page_break=#@pagebreak")
+ @markup.gsub!(/num_top\s*=\s*([\dA-C])/,"num_top=#@num_top")
+ @markup.gsub!(/toc_lev_limit\s*=\s*([\dA-C])/,"toc_lev_limit=#@toc_lev_limit")
+ end
+ if @mod.inspect =~/--papersize[=-]\S+|--pdf[=-]\S+/ or @mod.inspect =~/--(?:a4|letter|legal|book|a5|b5)\b/i #command line config/header override
+ @papersize=determine_papersize(@mod.inspect)
+ end
+ if @sys.openssl !=false
+ skin=if @doc_skin; SiSU_Env::Info_skin.new(@opt,@doc_skin).select
+ else SiSU_Env::Info_skin.new(@opt).select
+ end
+ @dgst,@dgst_skin=[],[]
+ if @env.digest.type =~/sha256/
+ @dgst=@sys.sha256(@fns)
+ @dgst_skin=if skin; @sys.sha256(skin)
+ else nil
+ end
+ else
+ @dgst=@sys.md5(@fns)
+ @dgst_skin=if skin; @sys.md5(skin)
+ else nil
+ end
+ end
+ end
+ @dc_publisher ||= "#@@publisher (this copy)"
+ fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@fns)
+ unless @dc_language[:code] and @dc_language[:name]
+ lang=@env.i18n.language #default language settings for directory by name, or in sysrc.yml
+ @dc_language[:code] ||= lang.code
+ @dc_language[:name] ||= lang.title
+ end
+ unless fn_set_lang[:d]==true #decide, naming convention overrides other settings, within document, etc.
+ @dc_language[:code]=fn_set_lang[:c]
+ @dc_language[:name]=fn_set_lang[:l]
+ end
+ @fnl=@env.i18n.lang_filename(fn_set_lang[:c])
+ @flv.each do |l|
+ lang=SiSU_Env::Standardise_language.new.file_to_language(l)
+ c={ :a=>'',:b=>'',:c=>'' }
+ if @fnl[:pre] =~/\S/; c[:a]="#{lang[:c]}."
+ elsif @fnl[:mid] =~/\S/; c[:b]=".#{lang[:c]}"
+ elsif @fnl[:post] =~/\S/; c[:c]=".#{lang[:c]}"
+ end
+ @lang << [lang[:l],"#{c[:a]}sisu_manifest#{c[:b]}.html#{c[:c]}"]
+ end if @flv
+ @lang.uniq!
+ @fn=SiSU_Env::Env_call.new(@fns).lang(fn_set_lang[:c])
+ if @en[:note] > 0 and @en[:sum] > 0
+ if @en[:sum] > 0
+ else tell=SiSU_Screen::Ansi.new(@cmd,'both endnote styles used',"~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}")
+ tell.warn if @cmd !~/q/
+ end
+ end
+ if @en[:mark] != @en[:note] and @en[:note] > 0
+ @en[:mismatch]=@en[:note] - @en[:mark]
+ SiSU_Screen::Ansi.new(@cmd,'endnote number mismatch',"endnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})").warn if @cmd !~/q/
+ footnote_conversion_errors=File.new("#{Dir.pwd}/footnote_conversion_errors.txt",'a')
+ footnote_conversion_errors << "#@fns:\n\tendnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})\n"
+ end
+ if @title !~/[\S]/
+ tell=SiSU_Screen::Ansi.new(@cmd,'Document Title Missing','please provide it')
+ tell.warn if @cmd =~/v/
+ end
+ if @dc_creator !~/[\S]/
+ tell=SiSU_Screen::Ansi.new(@cmd,'Document Creator/Author Missing','please provide it')
+ tell.warn if @cmd =~/v/
+ end
+ # Elementary Document Structure Analysis - adds complexity may remove - need to develop - appears to work, proof of concept
+ if @title.nil?
+ title_trigger=nil
+ fns_array.each do |para|
+ if para !~/0~|@\S+:[+-]?\s/ and para =~/\S/ and title_trigger.nil?
+ @title=para[/(\S.+)/m,1]
+ @html_title=@title.gsub(/(<p>|<p \/>|<br>|<br \/>)/,'')
+ @title.chomp!("\n")
+ @html_title.chomp!("\n")
+ title_trigger=1
+ tell=SiSU_Screen::Ansi.new(@cmd,@html_title)
+ tell.txt_cyan unless @cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@cmd,'Parameters')
+ tell.txt_grey unless @cmd =~/q/
+ end
+ end
+ end
+ @struct={}
+ doc_struct=Hash.new(0)
+ if @lv1.nil?
+ fns_array.each do |para|
+ if para =~/^(Part|Chapter|Section|Article)\b/i
+ case para
+ when /^(Part|PART)\b/
+ @struct[:part]=doc_struct[:part]
+ doc_struct[:part]=doc_struct[:part] + 1
+ when /^(Chapter|CHAPTER)\b/
+ @struct[:chapter]=doc_struct[:chapter]
+ doc_struct[:chapter]=doc_struct[:chapter] + 1
+ when /^(Section|SECTION)\b/
+ @struct[:section]=doc_struct[:section]
+ doc_struct[:section]=doc_struct[:section] + 1
+ when /^(Article|ARTICLE)\b/
+ @struct[:article]=doc_struct[:article]
+ doc_struct[:article]=doc_struct[:article] + 1
+ when /^(Clause|CLAUSE)\b/
+ @struct[:clause]=doc_struct[:clause]
+ doc_struct[:clause]=doc_struct[:clause] + 1
+ when /^\d\..*[^\.]$/
+ @struct[:number]=doc_struct[:number]
+ doc_struct[:number]=doc_struct[:number] + 1
+ end
+ end
+ end
+ if doc_struct[:article] > 2 #%~level 4
+ @lv4=/^(?:Article|ARTICLE)\b/
+ elsif doc_struct[:chapter] > 2 and doc_struct[:article] and doc_struct[:article] < 3
+ @lv4=/^(?:Chapter|CHAPTER)\b/
+ elsif doc_struct[:clause] > 2
+ @lv4=/^(?:Clause|CLAUSE)\b/
+ elsif doc_struct[:number] > 2
+ @lv4="^\d\..*[^\.]$"
+ end
+ if doc_struct[:section] > 2 #%~level 3
+ @lv3=/^(?:Section|SECTION)\b/
+ end
+ if doc_struct[:chapter] > 2 and doc_struct[:article] and doc_struct[:article] > 2
+ @lv2=/^(?:Chapter|CHAPTER)\b/
+ end
+ if doc_struct[:part] > 2 and @lv[2].nil?
+ @lv2=/^(?:Part|PART)\b/
+ end
+ if doc_struct[:part] > 2 and @lv[2].to_s !~/Part/ and @lv[1].nil?
+ @lv1=/^(Part|PART)\b/
+ end
+ end
+ @lnk=@lnk.compact if @lnk
+ @lv1 ||=/^1~/
+ @lv2 ||=/^2~/
+ @lv3 ||=/^3~/
+ @lv4 ||=/^4~/
+ @lv5 ||=/^5~/
+ @lv6 ||=/^6~/
+ if @doc_skin
+ tell=SiSU_Screen::Ansi.new(@cmd,"doc_skin <- #@doc_skin")
+ tell.txt_grey if @cmd =~/v/
+ end
+ @data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually
+ Store.new(self,@env).store #% pstore
+ self
+ end
+ private
+ class Store
+ def initialize(md,dir)
+ @md=md
+ @pstorefile="#{dir.path.dal}/#{md.fns}.pstore"
+ end
+ def store
+ File.unlink(@pstorefile) if FileTest.file?(@pstorefile)
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"PStore -> #@pstorefile")
+ tell.txt_grey if @md.cmd =~/v/
+ store=PStore.new(@pstorefile)
+ store.transaction do |s|
+ s['md']=@md
+ #doc.each{|x,y| puts "#{x}, #{y}; "}
+ s.commit
+ end
+ @@md=@md=nil
+ end
+ end
+ end
+ end
+ class Instantiate
+ def param_instantiate
+ @@date=SiSU_Env::Info_date.new
+ @@symlnk=SiSU_Env::Create_system_link.new
+ @@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=nil
+ @doc={
+ :initialise=>nil,
+ :markup=>'',:lnks=>'',:stmp=>'',:prefix_a=>'',:prefix_b=>'',
+ :req=>{}
+ }
+ @@yaml=@@yamladdr=nil
+ @@flag={}
+ @@publisher='SiSU scribe'
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/param_identify_markup.rb b/lib/sisu/0.52/param_identify_markup.rb
new file mode 100644
index 00000000..cba6d39d
--- /dev/null
+++ b/lib/sisu/0.52/param_identify_markup.rb
@@ -0,0 +1,87 @@
+=begin
+ * Name: modify.rb
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: A conversion script for canned substitutions,
+ a fairly generic simple tool that can be used to store other canned conversions,
+ used here for altering SiSU markup
+
+ * 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, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Markup
+ class Markup_identify
+ @@fns,@@version_determined,@@version_declared,@@declared_doc_type='','','','[text?]'
+ attr_accessor :version_determined,:version_declared,:declared_doc_type
+ def initialize(content,opt)
+ @cont,@opt=content,opt
+ end
+ def identify
+ @version_determined,@version_declared,@declared_doc_type=@@version_determined,@@version_declared,@@declared_doc_type
+ if @opt.fns != @@fns
+ if @cont[0] =~ /^(?:%\s+)?SiSU\s+(text|master|insert)\s+([0-9](?:\.[0-9]+){1,2})/ or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/
+ @declared_doc_type,@version_declared=$1,$2
+ elsif @cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/
+ @version_declared=$1
+ end
+ @flag_38=false
+ @cont.each_with_index do |y,i|
+ if @flag_38 or y =~/^:?A~/
+ @version_determined=0.38
+ @flag_38=true
+ break if i >= 200
+ if y =~ /(?:~{\*+|~\[\*|~\[\+)\s/
+ @version_determined=0.42 #0.38 can safely be treated as 0.42
+ break
+ end
+ end
+ if y =~/^0~/ and not @flag_38
+ @version_determined=0.16
+ break
+ end
+ end
+ @@fns=@opt.fns
+ @@version_determined,@@version_declared,@@declared_doc_type=@version_determined,@version_declared,@declared_doc_type
+ end
+ self
+ end
+ def markup_version?
+ identify.version_determined.to_f
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/plaintext.rb b/lib/sisu/0.52/plaintext.rb
new file mode 100644
index 00000000..eb43dfa8
--- /dev/null
+++ b/lib/sisu/0.52/plaintext.rb
@@ -0,0 +1,473 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: plaintext text generation, stripped plaintext output (unix, linefeed)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Plaintext
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/plaintext_format'
+ include Format
+ require SiSU_lib + '/shared_txt'
+ pwd=Dir.pwd
+ @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0
+ @@tablefoot=''
+ class Source
+ def initialize(opt)
+ @opt=opt
+ if @opt.fns =~/(.+?)\.[_-]?sst$/
+ case @opt.cmd
+ when /[af]/; @@dostype='unix footnotes'
+ when /e/; @@dostype='unix endnotes'
+ when /[AF]/; @@dostype='msdos footnotes'
+ when /E/; @@dostype='msdos endnotes'
+ end
+ else puts "#{sf} not a processed file type"
+ end
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ tool=if @opt.cmd =~/[MVv]/; "#{@env.program.text_editor} #{path}/#{@md.fnb}/#{@md.fn[:plain]}"
+ else ''
+ end
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Plaintext',tool)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:plain]}")
+ tell.flow if @opt.cmd =~/[MV]/
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_Plaintext::Source::Scroll.new(@dal_array,@md).songsheet
+ SiSU_Env::Info_skin.new(@md).select #watch
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ private
+ class Split_text_object <Source
+ require SiSU_lib + '/plaintext_format'
+ include SiSU_Viz
+ include Format
+ @@alt_id_count=0
+ @@dp=nil
+ attr_reader :format,:lev,:text,:ocn,:lev_para_ocn
+ def initialize(para)
+ @para=para
+ @format,@ocn='null','null'
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def lev_segname_para_ocn
+ @text=nil
+ if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,$5
+ elsif /^(([1-6])~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@lev,@text,@ocn=$1,$2,$3,$4
+ elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@text,@ocn=$1,$2,$3,$4
+ elsif /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;[um]\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,"x#{@@alt_id_count}"
+ elsif /^(([1-6])~)\s+(\S.+?)<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,@lev,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}"
+ end
+ else
+ if /(.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @text,@ocn=$1,$2
+ end
+ if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06
+ @text=/(.+?)/m.match(@para)[1]
+ end
+ if /^((\d)~(?:~\S+)?)\s+(.+)/m.match(@para)
+ @format,@lev,@text=$1,$2,$3
+ end
+ end
+ format=@format.dup
+ @lev_para_ocn=if @para =~/.+<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ Format::Format_text_object.new(format,@text,@ocn)
+ else
+ Format::Format_text_object.new(format,@text,"<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>")
+ end
+ self
+ end
+ end
+ class Scroll <Source
+ require SiSU_lib + '/shared_txt'
+ include SiSU_text_utils
+ @@endnotes_para=[]
+ @@plaintext={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] }
+ @@dp=nil
+ def initialize(data,md)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #m # 2004w18 pb pn removal added
+ @tab="\t"
+ @br=case md.cmd
+ when /[af]/
+ @@dostype='unix footnotes'
+ "\n"
+ when /e/
+ @@dostype='unix endnotes'
+ "\n"
+ when /[AF]/
+ @@dostype='msdos footnotes'
+ "\r\n"
+ when /E/
+ @@dostype='msdos endnotes'
+ "\r\n"
+ else "\n"
+ end
+ end
+ def songsheet
+ markup
+ publish
+ #@data.each { |x| puts x.inspect if x =~/\[table/ }
+ end
+ # Used for extraction of endnotes from paragraphs
+ def extract_endnotes(para='')
+ notes=para.scan(/~[{\[]([\d*+]+\s+.+?)\s*<#@dp>[}\]]~/)
+ @n=[]
+ notes.each do |n| #high cost to deal with <br> appropriately within plaintext, consider
+ n=n.dup.to_s
+ if n =~/<br(?: \/)?>/
+ fix = n.split(/<br(?: \/)?>/) #watch #added
+ fix.each do |x|
+ unless x.empty?; @n << x
+ end
+ end
+ else @n << n
+ end
+ end
+ notes=@n.flatten
+ notes.each do |e|
+ util=if e.to_s =~/^\[[\d*+]+\]:/; SiSU_text_utils::Wrap.new(e.to_s,70,4,1)
+ else SiSU_text_utils::Wrap.new(e.to_s,70,1,1)
+ end
+ wrap=util.line_wrap
+ if wrap =~ /^\s*[\d*+]+\s+.+?\s*\Z/m
+ wrap.gsub!(/^(\s*)([\d*+]+)\s+(.+?)\s*\Z/m, <<GSUB
+
+\\1[\\2]: \\3
+GSUB
+ )
+ else
+ wrap.gsub!(/^(.+)\Z/m, <<GSUB
+\\1
+GSUB
+ )
+ end
+ @@plaintext[:endnotes] << wrap
+ @@endnotes_para << wrap
+ end
+ end
+ def plaintext_metadata(meta)
+ util=SiSU_text_utils::Wrap.new(meta.text,70,15,1)
+ txt=util.line_wrap
+ @@plaintext[:metadata] <<= if meta.type == 'meta'
+ <<WOK
+
+#{@tab}#{meta.el}: #{txt}
+WOK
+ else ''
+ end
+ end
+ def plaintext_tail
+ SiSU_Env::Info_skin.new(@md).select
+ vz=SiSU_Env::Get_init.instance.skin
+ generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version]
+ lastdone="Last Generated on: #{Time.now}"
+ rubyv="Ruby version: #{@md.ruby_version}"
+ sc=if @md.sc_info
+ "Source file: #{@md.sc_filename}#{@br}Version number: #{@md.sc_number}#{@br}Version date: #{@md.sc_date}#{@br}"
+ else ''
+ end
+ @@plaintext[:tail] <<<<WOK
+#@br
+Other versions of this document: #@br
+manifest:
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:manifest]}#@br
+html:
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:toc]}#@br
+pdf:
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:pdf_p]}
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:pdf_l]}#@br
+plaintext (plain text):
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:plain]}#@br
+at:
+ #{vz.url_site}#@br
+
+#{sc}
+* #{generator}
+* #{rubyv}
+* #{lastdone}
+* SiSU #{vz.url_sisu}
+WOK
+ end
+ def plaintext_structure(para='',lv='',ocn='',hname='') #% Used to extract the structure of a document
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ extract_endnotes(para)
+ para.gsub!(/~[{\[]([\d*+]+)\s+(?:.+?)[}\]]~/,'[^\1]') # endnote marker marked up
+ wrapped=if para[@regx]
+ paragraph=para[@regx,2]
+ if paragraph.include? '<:i1>'
+ paragraph.gsub!(/<:i1>/,'')
+ util=SiSU_text_utils::Wrap.new(paragraph,70,2)
+ else util=SiSU_text_utils::Wrap.new(paragraph,70,0)
+ end
+ util.line_wrap
+ end
+ if lv
+ times=wrapped.length
+ times=70 if times > 70
+ @@plaintext[:body] << case lv
+ when 1; wrapped.upcase << @br << '*'*times << @br
+ when 2..3; wrapped.upcase << @br << '='*times << @br
+ when 4; wrapped.upcase << @br << '-'*times << @br
+ when 5..6; wrapped.upcase << @br << '.'*times << @br
+ end
+ else
+ @@plaintext[:body] << wrapped << @br # main text, contents, body KEEP
+ end
+ if @@endnotes_para and @@dostype =~/footnote/ #edit out to switch off endnotes following paragraph to which they belong
+ @@plaintext[:body] << @br
+ @@endnotes_para.each {|e| @@plaintext[:body] << e << @br}
+ elsif @@endnotes_para and @@dostype =~/endnote/
+ @@plaintext[:body] << @br*2
+ end
+ @@endnotes_para=[]
+ end
+ def markup # Used for major markup instructions
+ data=@data
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @data_mod,@endnotes,@level,@cont,@copen,@plaintext_contents_close=Array.new(6){[]}
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @plaintext_contents_close[x]='' }
+ plaintext_tail #($1,$2)
+ table_message='[table omitted, see other document formats]'
+ fix=[]
+ #data.each do |para| #high cost to deal with <br> appropriately within plaintext, consider
+ # para=para.dup
+ # if para =~/<br(?: \/)?>/
+ # puts para
+ # fix = para.split(/<br(?: \/)?>/) #watch #added
+ # fix.each do |x|
+ # if x =~/\S+/; @data_mod << x
+ # end
+ # end
+ # else @data_mod << para
+ # end
+ #end
+ #data=@data_mod.flatten
+ data.each do |para|
+ para.gsub!(/<!Th?¡.+/m,"#@br#{table_message}")
+ para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
+ para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down
+ para.gsub!(/&#169;/,'©') # bullet markup, marked down
+ para.gsub!(/&amp;/,'&') # bullet markup, marked down
+ para.gsub!(/<sup>(.+?)<\/sup>/,'^\1^')
+ para.gsub!(/<sub>(.+?)<\/sub>/,'[\1]')
+ para.gsub!(/<i>(.+?)<\/i>/,'/\1/')
+ para.gsub!(/<b>(.+?)<\/b>/,'*\1*')
+ para.gsub!(/<u>(.+?)<\/u>/,'_\1_')
+ para.gsub!(/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/,'')
+ para.gsub!(/<:p[bn]>/,'') # remove page breaks
+ para.gsub!(/^\s*<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'') # remove empty lines - check
+ para.gsub!(/<a href=".+?">(.+?)<\/a>/m,'\1')
+ para.gsub!(/<:name#\S+?>/,'') # remove name links
+ para.gsub!(/&nbsp;/,' ') # decide on
+ para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,' [ \1 ]') #"[ #{dir.url.images_local}\/\\1 ]")
+ para.gsub!(/^\{\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"\s*\}\S+/,'[image: "\1"]')
+ wordlist=para.scan(/\S+/)
+ if para =~/^0~(\S+)\s+(.+?)\Z/m # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; plaintext_metadata(d_meta)
+ end
+ end
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ if para =~@regx #/.+?<~\d+;\w\d+;\w\d+>.*/ #watch change
+ paranum=para[@regx,3]
+ @p_num=Format::Paragraph_number.new(paranum)
+ end
+ @sto=Split_text_object.new(para).lev_segname_para_ocn
+ ### problem in scroll, it appears tables are getting paragraph numbers
+ m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m and para=~/\S+/
+ para=case @sto.format
+ when /^(1)~(?:(\S+))?/
+ plaintext_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body1
+ when /^(2)~(?:(\S+))?/
+ plaintext_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body2
+ when /^(3)~(?:(\S+))?/
+ plaintext_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)/ # work on see SiSU_text_parts::Split_text_object
+ plaintext_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body4
+ when /^(5)~(?:(\S+))?/
+ plaintext_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body5
+ when /^(6)~(?:(\S+))?/
+ plaintext_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body6
+ #when /^(i1)$/
+ # #formatMono.gsubBody
+ # #para=@sto[:lev_para_ocn].scrIndent1
+ #when /^(i2)$/
+ # formatMono.gsubBody
+ # para=@sto[:lev_para_ocn].scrIndent2
+ #when /^(center)$/
+ # para.gsub!(/(.+)/,
+ # %{<center>(\\1)</center>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /^(b|bold)$/
+ # para.gsub!(/(.+)/,
+ # %{<b>(\\1)</b>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /null/ # see whether u can improve
+ # if (para !~/#{@margin.txt_0}|#{@margin.txt_1}|#{@margin.txt_2}/)
+ # #formatMono.gsubBody
+ # #para=@sto[:lev_para_ocn].scrPara
+ # end
+ else
+ plaintext_structure(para,nil,nil,nil) #watch may be problematic
+ para
+ end
+ elsif para =~/#{table_message}/
+ @@plaintext[:body] << para << @br
+ elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ elsif para =~/(MetaData)/ and para =~/<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info ####suspect visit
+ #formatMono=MonoSiSU.new('<br /><a name="metadata">MetaData</a>')
+ #para=formatMono.bold_para
+ elsif para.include? 'Owner Details' and para !~/<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ #formatMono=MonoSiSU.new('<br /><a name="owner.details">Owner Details</a>')
+ #@@plaintext[:owner_details]=formatMono.bold_para
+ #para=''
+ elsif para =~/(¡|<!Th?)/ #tables !
+ elsif para =~/(.*)<!#!>(.*)/
+ one,two=$1,$2
+ format_text=Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if (para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/) # -endnote
+ case para
+ when /<:i1>/
+ if para =~/.*<:#>.*$/
+ format_text=Format_text_object.new(para,'')
+ para=format_text.scr_indent_one_no_paranum
+ end
+ when /<:i2>/
+ if para =~/.*<:#>.*$/
+ format_text=Format_text_object.new(para,'')
+ para=format_text.scr_indent_one_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ para.gsub!(/<!.+!>/,' ') if para ## Clean Prepared Text
+ para.gsub!(/<:\S+>/,' ') if para ## Clean Prepared Text
+ end
+ end
+ end
+ def publish
+ divider="="
+ content=[]
+ data=@data
+ content << @@plaintext[:open]
+ content << @@plaintext[:head]
+ content << @@plaintext[:body]
+ content << @@plaintext[:endnotes] if @@dostype =~/endnotes/
+ content << "#@br#{divider*70}#@br"
+ content << @@plaintext[:metadata]
+ content << "#@br#{divider*70}#@br" if @md.stmp =~/\w+/ #not used?
+ content << @@plaintext[:owner_details] if @md.stmp =~/\w+/ #not used?
+ content << @@plaintext[:tail]
+ Output.new(content.to_s,@md).plaintext
+ @@plaintext[:head],@@plaintext[:body],@@plaintext[:tail],@@plaintext[:metadata]=[],[],[],[]
+ end
+ end
+ class Output <Source
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(content,md)
+ @content,@md=content,md
+ end
+ def plaintext #%plaintext output
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_plaintext=SiSU_Env::SiSU_file.new(@md,@md.fn[:plain]).mkfile
+ @sisu=[]
+ @content.each do |para| # this is a hack
+ if para =~/^\S/
+ if para !~/^([*=-]|\.){5}/; filename_plaintext.puts para #unix plaintext
+ else filename_plaintext.puts para #unix plaintext
+ end
+ else filename_plaintext.puts para # if para =~/^\s/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/plaintext_format.rb b/lib/sisu/0.52/plaintext_format.rb
new file mode 100644
index 00000000..9ceb3867
--- /dev/null
+++ b/lib/sisu/0.52/plaintext_format.rb
@@ -0,0 +1,100 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: plaintext formatting template
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module Format
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ class Paragraph_number
+ def initialize(paranum)
+ @paranum=/(\d+)/m.match(paranum)[1]
+ end
+ def display
+ @paranum.gsub(/(\d+)/,'<font size="1" color="#777777">&nbsp;&nbsp;\1</font>')
+ end
+ def name
+ @paranum.gsub(/(\d+)/,'<a name="\1"></a>')
+ end
+ def goto
+ @paranum.gsub(/(\d+)/,'<a href="#\1">')
+ end
+ end
+ class Format_text_object
+ @@dp=nil
+ def initialize(one,two,three)
+ one.gsub!(/\.(html|pdf|php)/,'') if one =~/\.\.\/\S+/
+ @one,@two,@three=one,two,three
+ rgx=/^[1-6-]~/
+ @one.gsub!(rgx,'') if @one =~rgx
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ rgx=/~\{[\d*+]+\s+(.+?)<#@dp>\}~/
+ @one.gsub!(rgx,'\1') if @one =~rgx
+ @link,@linkname=one,two
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def scr_endnote_body
+ "<endnote>#@one</endnote> "
+ end
+ def heading_body1
+ end
+ def heading_body2
+ end
+ def heading_body3
+ end
+ def heading_body4
+ end
+ def heading_body5
+ end
+ def heading_body6
+ end
+ end
+ class XML
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/relaxng.rb b/lib/sisu/0.52/relaxng.rb
new file mode 100644
index 00000000..b68747a5
--- /dev/null
+++ b/lib/sisu/0.52/relaxng.rb
@@ -0,0 +1,1155 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: relaxng flow/logic
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_relaxng
+ require SiSU_lib + '/sysenv'
+ class RelaxNG
+ def gpl2_or_later
+ @gpl2_or_later =<<RELAXNG
+ # Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ # Author: Ralph Amissah
+ # http://www.jus.uio.no/sisu
+ # http://www.jus.uio.no/sisu/SiSU/download.html
+
+ # Description: sisu object models in relaxNG
+
+ # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ # License: GPL 2 or later
+
+ # Summary of GPL 2
+
+ # 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 2 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/gpl2.fsf
+
+ # SiSU was first released to the public on January 4th 2005
+
+ # SiSU uses:
+ #
+ # Standard SiSU markup syntax,
+ # Standard SiSU meta-markup syntax, and the
+ # Standard SiSU object citation numbering and system
+ #
+ # © Ralph Amissah 1997, current 2007.
+ # All Rights Reserved.
+
+ # Ralph Amissah: ralph@amissah.com
+ # ralph.amissah@gmail.com
+RELAXNG
+ end
+ def rnc_name
+ def output_sax
+ 'sisu_sax.rnc'
+ end
+ def output_dom
+ 'sisu_dom.rnc'
+ end
+ def output_xhtml
+ 'sisu_xhtml.rnc'
+ end
+ def input_sax
+ 'sisu_sax.rnc'
+ end
+ def input_dom
+ 'sisu_dom.rnc'
+ end
+ def input_node
+ 'sisu_node.rnc'
+ end
+ self
+ end
+ def rng_name
+ def output_sax
+ 'sisu_sax.rng'
+ end
+ def output_dom
+ 'sisu_dom.rng'
+ end
+ def output_xhtml
+ 'sisu_xhtml.rng'
+ end
+ def input_sax
+ 'sisu_sax.rng'
+ end
+ def input_dom
+ 'sisu_dom.rng'
+ end
+ def input_node
+ 'sisu_node.rng'
+ end
+ self
+ end
+ def xsd_name
+ def output_sax
+ 'sisu_sax.xsd'
+ end
+ def output_dom
+ 'sisu_dom.xsd'
+ end
+ def output_xhtml
+ 'sisu_xhtml.xsd'
+ end
+ def input_sax
+ 'sisu_sax.xsd'
+ end
+ def input_dom
+ 'sisu_dom.xsd'
+ end
+ def input_node
+ 'sisu_node.xsd'
+ end
+ self
+ end
+ #def fn_dtd_sax
+ # 'sisu_sax.dtd'
+ #end
+ #def fn_dtd_dom
+ # 'sisu_dom.dtd'
+ #end
+ #def fn_dtd_node
+ # 'sisu_node.dtd'
+ #end
+ #def fn_dtd_xhtml
+ # 'sisu_xhtml.dtd'
+ #end
+ def rnc_sisu_object_input
+ @relaxng =<<RELAXNG
+#%% sisu object model: input
+#{gpl2_or_later}
+#%% definitions
+# dublin core:
+element-semantic =
+ element semantic {
+ # dublin core:
+ element title { text }
+ & element creator { text }?
+ & element subject { text }?
+ & element description { text }?
+ & element publisher { text }?
+ & element contributor { text }?
+ & element date { text }?
+ & element date.created { text }?
+ & element date.issued { text }?
+ & element date.available { text }?
+ & element date.valid { text }?
+ & element date.modified { text }?
+ & element type { text }?
+ & element format { text }?
+ & element identifier { text }?
+ & element source { text }?
+ & element relation { text }?
+ & element coverage { text }?
+ & element rights { text }?
+ & element keywords { text }?
+ # extended semantic metadata:
+ & attribute subtitle { text }?
+ & attribute illustrator { text }?
+ & attribute translator { text }?
+ & attribute prepared_by { text }?
+ & attribute digitized_by { text }?
+ & attribute language { text }?
+ & attribute language.original { text }?
+ & attribute classify.pg { text }?
+ & attribute classify.isbn { text }?
+ & attribute classify.dewey { text }?
+ & attribute classify.loc { text }?
+ & attribute prefix.a { text }?
+ & attribute prefix.b { text }?
+ & attribute suffix { text }?
+ & attribute comments { text }?
+ & attribute abstract { text }?
+ # & attribute information { text }?
+ & attribute contact { text }?
+ & attribute links { text }?
+ }
+element-processing =
+ element processing {
+ attribute structure { text }?
+ & attribute level { text }?
+ & attribute markup { text }?
+ & attribute bold { text }?
+ & attribute italics { text }?
+ & attribute papersize { text }?
+ & attribute vocabulary { text }?
+ & element date_scheme { text }?
+ & element date.issued.scheme { text }?
+ & element date.available.scheme { text }?
+ & element date.valid.scheme { text }?
+ & element date.modified.scheme { text }?
+ }?
+element-head =
+ element head {
+ # processing instructions, and semantic data, distinguish?:
+ element metadata {
+ element title { text },
+ element file { text },
+ element generator { text },
+ element-semantic,
+ element-processing
+ }+
+ }
+# body text/contents
+# includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc.
+element-txt =
+ element txt {
+ text*
+ & element b { text }*
+ & element i { text }*
+ & element u { text }*
+ & element ins { text }*
+ & element del { text }*
+ }
+element-endnote =
+ element endnote {
+ element number { text },
+ element note { element-txt }+
+ }+
+element-para =
+ element para {
+ # attribute paragraph_format { text },
+ element-txt+
+ & element-endnote?
+ }
+element-external_space =
+ element external_space {
+ # ignored by sisu, provide program needs
+ element program {
+ # e.g. kdissert
+ element name { text },
+ element xpos { text },
+ element ypos { text },
+ element font { text },
+ element outline_color { text },
+ element text_color { text },
+ element comment { text }
+ }*
+ }*,
+#%% structure
+ element document {
+ # document head:
+ element-head,
+ # document body:
+ element body {
+ # object, a unit of text, usually a paragraph with any associated endnotes
+ element node {
+ element structure {
+ # structure document using either node:heading levels or node:heading relationships:
+ # (i) sisu default uses node:heading levels (1-6 or A-C,1-3) to build document structure
+ element level { text }?,
+ # (ii) sisu alternatively could use node:heading relationship information to build document structure
+ element node.id { text },
+ element node.parent { text },
+ element node.child { text }*
+ },
+ element node.objects {
+ element object.heading {
+ # nametag used only in headings, especially important for segmented html
+ element nametag { text },
+ element-para
+ },
+ element object.para {
+ element-para
+ }*
+ }+,
+ element-external_space
+ }+
+ }
+ }
+RELAXNG
+ end
+ def rnc_sisu_object_dal
+ @relaxng =<<RELAXNG
+#%% sisu object model: dal
+#{gpl2_or_later}
+#%% definitions
+# dublin core:
+element-semantic =
+ element semantic {
+ # dublin core:
+ element title { text }
+ & element creator { text }?
+ & element subject { text }?
+ & element description { text }?
+ & element publisher { text }?
+ & element contributor { text }?
+ & element date { text }?
+ & element date.created { text }?
+ & element date.issued { text }?
+ & element date.available { text }?
+ & element date.valid { text }?
+ & element date.modified { text }?
+ & element type { text }?
+ & element format { text }?
+ & element identifier { text }?
+ & element source { text }?
+ & element relation { text }?
+ & element coverage { text }?
+ & element rights { text }?
+ & element keywords { text }?
+ # extended semantic metadata:
+ & attribute subtitle { text }?
+ & attribute illustrator { text }?
+ & attribute translator { text }?
+ & attribute prepared_by { text }?
+ & attribute digitized_by { text }?
+ & attribute language { text }?
+ & attribute language.original { text }?
+ & attribute classify.pg { text }?
+ & attribute classify.isbn { text }?
+ & attribute classify.dewey { text }?
+ & attribute classify.loc { text }?
+ & attribute prefix.a { text }?
+ & attribute prefix.b { text }?
+ & attribute suffix { text }?
+ & attribute comments { text }?
+ & attribute abstract { text }?
+ # & attribute information { text }?
+ & attribute contact { text }?
+ & attribute links { text }?
+ }
+element-processing =
+ element processing {
+ attribute structure { text }?
+ & attribute level { text }?
+ & attribute markup { text }?
+ & attribute bold { text }?
+ & attribute italics { text }?
+ & attribute papersize { text }?
+ & attribute vocabulary { text }?
+ & element date_scheme { text }?
+ & element date.issued.scheme { text }?
+ & element date.available.scheme { text }?
+ & element date.valid.scheme { text }?
+ & element date.modified.scheme { text }?
+ }?
+element-head =
+ element head {
+ # processing instructions, and semantic data, distinguish?:
+ element metadata {
+ element title { text },
+ element file { text },
+ element generator { text },
+ element-semantic,
+ element-processing
+ }+
+ }
+# body text/contents
+# includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc.
+element-txt =
+ element txt {
+ text*
+ & element b { text }*
+ & element i { text }*
+ & element u { text }*
+ & element ins { text }*
+ & element del { text }*
+ }
+element-checksum.endnote = element checksum.clean { text }
+element-endnote =
+ element endnote {
+ element number { text },
+ element note { element-txt }+,
+ element-checksum.endnote
+ }+
+element-checksum.para =
+ element checksum.para {
+ element checksum.clean { text },
+ element checksum.marked { text }
+ }
+element-para =
+ element para {
+ # attribute paragraph_format { text },
+ element-txt+
+ & element-endnote?
+ }
+element-object =
+ element object {
+ element-para,
+ element-checksum.para
+ }
+# object citation number, unique sequential number for objects:
+element-ocn = element ocn { text }
+element-object_structure_summary =
+ element-ocn,
+ # type: heading level value 1 -6, or normal text
+ element type { text },
+ # type number: sequential number for designated type
+ element type_number { text },
+ # type category: sequential number for designated category, e.g. sequentially counting all headers
+ element category_number { text }
+element-external_space =
+ element external_space {
+ # ignored by sisu, provide program needs
+ element program {
+ # e.g. kdissert
+ element name { text },
+ element xpos { text },
+ element ypos { text },
+ element font { text },
+ element outline_color { text },
+ element text_color { text },
+ element comment { text }
+ }*
+ }*,
+#%% structure
+ element document {
+ # document head:
+ element-head,
+ # document body:
+ element body {
+ # object, a unit of text, usually a paragraph with any associated endnotes
+ element node {
+ element structure {
+ # structure document using either node:heading levels or node:heading relationships:
+ # (i) sisu default uses node:heading levels (1-6 or A-C,1-3) to build document structure
+ element level { text }?,
+ # (ii) sisu alternatively could use node:heading relationship information to build document structure
+ element node.id { text },
+ element node.parent { text },
+ element node.child { text }*
+ },
+ element node.objects {
+ element object.heading {
+ element-object_structure_summary,
+ # nametag used only in headings, especially important for segmented html
+ element nametag { text },
+ element-object
+ },
+ element object.para {
+ element-object_structure_summary,
+ element-object
+ }*
+ }+,
+ element-external_space
+ }+
+ }
+ }
+RELAXNG
+ end
+ def rnc_model_output_sax
+ @relaxng =<<RELAXNG
+#% sax output model, part of SiSU and distributed under the same license
+default namespace = ""
+namespace xlink = "http://www.w3.org/1999/xlink"
+start =
+ element document {
+ element head {
+ (br
+ | meta
+ | element creator {
+ attribute class { xsd:NCName },
+ (text
+ | element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ xsd:anyURI
+ })+
+ }
+ | element date {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_available {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_created {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_issued {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_modified {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_valid {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element keywords {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element language {
+ attribute class { xsd:NCName },
+ xsd:NCName
+ }
+ | element meta { xsd:NMTOKEN }
+ | element rights {
+ attribute class { xsd:NCName },
+ (text | link)+
+ }
+ | element source {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element structure {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element subject {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element title {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element type {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element source_control {
+ (br
+ | meta
+ | element sc {
+ attribute class { xsd:NCName },
+ text
+ })+
+ })+
+ },
+ element body {
+ element object {
+ attribute id { text },
+ element ocn {
+ text
+ },
+ element text {
+ attribute class { xsd:NCName },
+ (text
+ | b
+ | br
+ | del
+ | en
+ | i
+ | link
+ | sub
+ | sup
+ | u
+ | element image {
+ attribute alt { text }?,
+ attribute height { xsd:integer }?,
+ attribute width { xsd:integer }?,
+ attribute xlink:actuate { xsd:NCName },
+ attribute xlink:href { text },
+ attribute xlink:show { xsd:NCName },
+ attribute xlink:type { xsd:NCName }
+ })+
+ }?,
+ element table {
+ attribute align { xsd:NCName },
+ attribute bgcolor { xsd:NCName },
+ attribute border { xsd:integer },
+ attribute cellpadding { xsd:integer },
+ attribute summary { text },
+ attribute width { text },
+ element tr {
+ element td {
+ attribute valign { xsd:NCName },
+ attribute width { text },
+ (text | b | i)+
+ }+
+ }+
+ }?,
+ element endnote {
+ attribute notenumber { xsd:integer }?,
+ attribute symbol { text }?,
+ (element number { xsd:integer }
+ | element symbol { text }),
+ element note {
+ (text
+ | b
+ | br
+ | del
+ | i
+ | link
+ | sup
+ | u
+ | element em { xsd:NCName }
+ | element sub { xsd:NCName })+
+ }
+ }*
+ }+
+ }
+ }
+meta = element meta { text }
+br = element br { empty }
+b = element b { (text | en | i | link | sup)+ }
+i = element i { (text | b | br | sup)+ }
+en = element en { text }
+sub = element sub { xsd:NCName }
+sup = element sup { xsd:NCName }
+link =
+ element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ (xsd:anyURI | text | b | i | sup)+
+ }
+u = element u { (text | b | i)+ }
+del = element del { (text | b | i | link)+ }
+RELAXNG
+ end
+ def rnc_model_output_dom
+ @relaxng =<<RELAXNG
+#% dom output model, part of SiSU and distributed under the same license
+default namespace = ""
+namespace xlink = "http://www.w3.org/1999/xlink"
+start =
+ element document {
+ element head {
+ element header {
+ meta,
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date_available { xsd:NMTOKEN }
+ | element date_created { xsd:NMTOKEN }
+ | element date_issued { xsd:NMTOKEN }
+ | element date_modified { xsd:NMTOKEN }
+ | element date_valid { xsd:NMTOKEN }
+ | element keywords { text }
+ | element language { xsd:NCName }
+ | element rights { (text | link)+ }
+ | element source { text }
+ | element structure { text }
+ | element subject { text }
+ | element title { text }
+ | element type { text }
+ | element source_control {
+ (br
+ | meta
+ | element sc {
+ attribute class { xsd:NCName },
+ text
+ })+
+ })
+ }+
+ },
+ element body {
+ element heading1 {
+ heading,
+ contents1*,
+ element heading2 {
+ heading,
+ contents1*,
+ element heading3 {
+ heading,
+ element contents1 {
+ heading,
+ content,
+ element contents2 {
+ heading,
+ content,
+ element contents3 { heading, content }*
+ }*
+ }+
+ }*
+ }*
+ }+
+ }
+ }
+meta = element meta { text }
+br = element br { empty }
+heading = element heading { object }
+contents1 =
+ element contents1 {
+ heading,
+ content,
+ element contents2 {
+ heading,
+ content,
+ element contents3 { heading, content }*
+ }*
+ }
+content = element content { object* }
+object =
+ element object {
+ attribute id { xsd:integer },
+ element ocn { text },
+ element nametag { text }?,
+ (element table {
+ attribute align { xsd:NCName },
+ attribute bgcolor { xsd:NCName },
+ attribute border { xsd:integer },
+ attribute cellpadding { xsd:integer },
+ attribute summary { text },
+ attribute width { text },
+ element tr {
+ element td {
+ attribute valign { xsd:NCName },
+ attribute width { text },
+ (text | b | i)+
+ }+
+ }+
+ }
+ | element text {
+ attribute class { xsd:NCName }?,
+ (text
+ | b
+ | del
+ | endnote
+ | i
+ | link
+ | element br { empty }
+ | element endnote {
+ element number { xsd:integer },
+ element note { (text | i | link)+ }
+ }
+ | element image {
+ attribute height { xsd:integer },
+ attribute width { xsd:integer },
+ attribute xlink:actuate { xsd:NCName },
+ attribute xlink:href { text },
+ attribute xlink:show { xsd:NCName },
+ attribute xlink:type { xsd:NCName }
+ }
+ | element sub { text })+
+ })
+ }
+i = element i { text }
+b = element i { text }
+u = element u { (text | b | i)+ }
+sub = element sub { xsd:NCName }
+sup = element sup { xsd:NCName }
+del = element del { (text | b | i | link)+ }
+link =
+ element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ xsd:anyURI
+ }
+endnote =
+ element endnote {
+ (element number { xsd:integer }
+ | element symbol { text }),
+ element note {
+ (text
+ | b
+ | br
+ | del
+ | i
+ | link
+ | sub
+ | sup
+ | u
+ | element em { xsd:NCName }
+ | element sub { xsd:NCName })+
+ }
+ }
+RELAXNG
+ end
+ def rnc_model_output_xhtml #not done
+ @relaxng =<<RELAXNG
+#% xhtml output model, part of SiSU and distributed under the same license
+default namespace = ""
+namespace xlink = "http://www.w3.org/1999/xlink"
+start =
+ element document {
+ element head {
+ (br
+ | element creator {
+ attribute class { xsd:NCName },
+ (text
+ | element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ xsd:anyURI
+ })+
+ }
+ | element date {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_available {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_created {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_issued {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_modified {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element date_valid {
+ attribute class { xsd:NCName },
+ xsd:NMTOKEN
+ }
+ | element language {
+ attribute class { xsd:NCName },
+ xsd:NCName
+ }
+ | element keywords {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element meta {
+ attribute content { text }?,
+ attribute http-equiv { xsd:NCName }?,
+ text
+ }
+ | element rights {
+ attribute class { xsd:NCName },
+ (text | link)+
+ }
+ | element source {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element structure {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element subject {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element title {
+ attribute class { xsd:NCName },
+ text
+ }
+ | element type {
+ attribute class { xsd:NCName },
+ xsd:NCName
+ })+
+ },
+ element body {
+ element object {
+ attribute id { xsd:integer },
+ (element endnote {
+ attribute notenumber { xsd:integer }?,
+ attribute symbol { text }?,
+ (text
+ | b
+ | br
+ | del
+ | i
+ | link
+ | sup
+ | u
+ | element em { xsd:NCName }
+ | element sub { xsd:NCName })+
+ }
+ | element ocn { text }
+ | element text {
+ attribute class { xsd:NCName },
+ (text
+ | b
+ | br
+ | del
+ | en
+ | i
+ | link
+ | sup
+ | u
+ | element image {
+ attribute alt { text }?,
+ attribute height { xsd:integer }?,
+ attribute width { xsd:integer }?,
+ attribute xlink:actuate { xsd:NCName },
+ attribute xlink:href { text },
+ attribute xlink:show { xsd:NCName },
+ attribute xlink:type { xsd:NCName }
+ }
+ | element sub { text })+
+ })+,
+ element table {
+ attribute align { xsd:NCName },
+ attribute bgcolor { xsd:NCName },
+ attribute border { xsd:integer },
+ attribute cellpadding { xsd:integer },
+ attribute summary { text },
+ attribute width { text },
+ element tr {
+ element td {
+ attribute valign { xsd:NCName },
+ attribute width { text },
+ (text | b | i)+
+ }+
+ }+
+ }?
+ }+
+ }
+ }
+br = element br { empty }
+en = element en { text }
+sup = element sup { xsd:NCName }
+i = element i { (text | b | br | sup)+ }
+link =
+ element link {
+ attribute xlink:href { xsd:anyURI },
+ attribute xlink:type { xsd:NCName },
+ (text | b | i | sup)+
+ }
+b = element b { (text | en | i | link | sup)+ }
+u = element u { (text | b | i)+ }
+del = element del { (text | b | i | link)+ }
+RELAXNG
+ end
+ def rnc_model_input_sax
+ @relaxng =<<RELAXNG
+#% sax input model, part of SiSU and distributed under the same license
+default namespace = ""
+start =
+ element document {
+ element head {
+ element header {
+ attribute class { xsd:NCName },
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date.available { xsd:NMTOKEN }
+ | element date.created { xsd:NMTOKEN }
+ | element date.issued { xsd:NMTOKEN }
+ | element date.modified { xsd:NMTOKEN }
+ | element date.valid { xsd:NMTOKEN }
+ | element italicize { text }
+ | element language { xsd:NCName }
+ | element links { text }
+ | element markup { text }
+ | element rights { text }
+ | element skin { xsd:NCName }
+ | element subject { text }
+ | element title { text }
+ | element type { xsd:NCName }
+ | element vocabulary { xsd:NCName })
+ }+
+ },
+ element body {
+ element object {
+ element text {
+ attribute class { xsd:NCName },
+ (text
+ | b
+ | i
+ | element endnote {
+ attribute symbol { xsd:NCName },
+ (text
+ | i
+ | element br { empty })+
+ }
+ | element u { i }
+ | element image.path { text })+
+ }?
+ }+
+ }
+ }
+i = element i { text }
+b = element b { text }
+RELAXNG
+ end
+ def rnc_model_input_dom
+ @relaxng =<<RELAXNG
+#% dom input model, part of SiSU and distributed under the same license
+default namespace = ""
+start =
+ element document {
+ element head {
+ element header {
+ attribute class { xsd:NCName },
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date.available { xsd:NMTOKEN }
+ | element date.created { xsd:NMTOKEN }
+ | element date.issued { xsd:NMTOKEN }
+ | element date.modified { xsd:NMTOKEN }
+ | element date.valid { xsd:NMTOKEN }
+ | element italicize { text }
+ | element language { xsd:NCName }
+ | element links { text }
+ | element markup { text }
+ | element rights { text }
+ | element skin { xsd:NCName }
+ | element subject { text }
+ | element title { text }
+ | element type { xsd:NCName }
+ | element vocabulary { xsd:NCName })
+ }+
+ },
+ element body {
+ element heading1 {
+ heading,
+ element heading2 {
+ heading,
+ contents1+,
+ element heading3 { heading, contents1+ }+
+ }
+ }
+ }
+ }
+heading = element heading { object }
+contents1 =
+ element contents1 {
+ heading,
+ content,
+ element contents2 {
+ heading,
+ content,
+ element contents3 { heading, content }*
+ }*
+ }
+object =
+ element object {
+ element text {
+ (text
+ | italic
+ | element bold { xsd:NMTOKEN }
+ | element endnote {
+ element symbol { text }?,
+ element note {
+ (text
+ | italic
+ | element br { empty })+
+ }
+ }
+ | element underscore { italic }
+ | element image.path { text }
+ | element italic { text })+
+ }
+ }
+italic = element italic { text }
+content = element content { object+ }
+RELAXNG
+ end
+ def rnc_model_input_node
+ @relaxng =<<RELAXNG
+#% node input model, part of SiSU and distributed under the same license
+default namespace = ""
+start =
+ element document {
+ element head {
+ element header {
+ attribute class { xsd:NCName },
+ (element creator { text }
+ | element date { xsd:NMTOKEN }
+ | element date.available { xsd:NMTOKEN }
+ | element date.created { xsd:NMTOKEN }
+ | element date.issued { xsd:NMTOKEN }
+ | element date.modified { xsd:NMTOKEN }
+ | element date.valid { xsd:NMTOKEN }
+ | element italicize { (text | i)+ }
+ | element language { xsd:NCName }
+ | element links { text }
+ | element markup { text }
+ | element rights { text }
+ | element skin { xsd:NCName }
+ | element subject { text }
+ | element title { text }
+ | element type { xsd:NCName }
+ | element vocabulary { xsd:NCName })
+ }+
+ },
+ element body {
+ element object {
+ (element text {
+ attribute class { xsd:NCName },
+ (text
+ | b
+ | i
+ | element br { empty }
+ | element endnote {
+ attribute symbol { xsd:NCName },
+ (text | i)+
+ }
+ | element image.path { text }
+ | element sub { text })+
+ }
+ | (element ocn { empty },
+ element table {
+ attribute align { xsd:NCName },
+ attribute bgcolor { xsd:NCName },
+ attribute border { xsd:integer },
+ attribute cellpadding { xsd:integer },
+ attribute summary { text },
+ attribute width { text },
+ element tr {
+ element td {
+ attribute valign { xsd:NCName },
+ attribute width { text },
+ (text | b)+
+ }+
+ }+
+ })),
+ element node {
+ element id { xsd:integer },
+ element parent { xsd:integer },
+ element offspring { text }?
+ }
+ }+
+ }
+ }
+b = element b { text }
+i = element i { text }
+RELAXNG
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/remote_put.rb b/lib/sisu/0.52/remote_put.rb
new file mode 100644
index 00000000..19bfbe80
--- /dev/null
+++ b/lib/sisu/0.52/remote_put.rb
@@ -0,0 +1,103 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: remote put, copy output to remote server
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: this operation should probably be threaded & run at its own pace,
+ independent of rest of program
+ primary problem will be with notification of progress,
+ implement naively to start with
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Remote
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ pwd=Dir.pwd
+ class Put
+ def initialize(opt)
+ @opt=opt
+ @dir=SiSU_Env::Info_env.new(@opt.fns)
+ @put=unless @opt.fns =~/\._sst$/; @opt.fns
+ else @opt.fns.gsub(/(.+)?\._sst$/,'\1.ssm')
+ end
+ @remote=SiSU_Env::Info_remote.new(@opt)
+ end
+ def scp
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->',@put)
+ tell.dark_grey_title_hi unless @opt.cmd =~/q/
+ @remote.scp
+ end
+ def rsync
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->',@put)
+ tell.dark_grey_title_hi unless @opt.cmd =~/q/
+ @remote.rsync
+ end
+ def scp_base
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement of base site ->','excluding images')
+ tell.dark_grey_title_hi unless @opt.cmd =~/q/
+ @remote.scp_base
+ end
+ def scp_base_all
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->','complete')
+ tell.dark_grey_title_hi unless @opt.cmd =~/q/
+ @remote.scp_base_all
+ end
+ def rsync_base
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->','rsync')
+ tell.dark_grey_title_hi unless @opt.cmd =~/q/
+ @remote.rsync_base
+ end
+ def rsync_base_sync
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->','rsync and sync')
+ tell.dark_grey_title_hi unless @opt.cmd =~/q/
+ @remote.rsync_base_sync
+ end
+ def rsync_sitemaps
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement sitemaps ->','rsync')
+ tell.dark_grey_title_hi unless @opt.cmd =~/q/
+ @remote.rsync_sitemaps
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/response.rb b/lib/sisu/0.52/response.rb
new file mode 100644
index 00000000..7748343f
--- /dev/null
+++ b/lib/sisu/0.52/response.rb
@@ -0,0 +1,61 @@
+=begin
+ * Name: modify.rb
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: Request response
+
+ * 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, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Response
+ class Response
+ def response?(ask) #move to more appropriate directory later
+ response='redo'
+ print ask + " ['yes', 'no' or 'quit']: "
+ response=File.new('/dev/tty').gets.strip
+ #response=gets.strip
+ ans=if response == 'yes'; true
+ elsif response == 'no'; false
+ elsif response =~/^quit|exit$/; exit
+ else puts "[please type: 'yes', 'no' or 'quit']"
+ answer?(ask)
+ end
+ ans
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/rexml.rb b/lib/sisu/0.52/rexml.rb
new file mode 100644
index 00000000..cfedaed9
--- /dev/null
+++ b/lib/sisu/0.52/rexml.rb
@@ -0,0 +1,118 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: rexml testing of xml
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_Rexml
+ # load XML file for REXML parsing
+ require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ class Rexml
+ require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
+ def initialize(md,fno)
+ @md,@fno=md,fno
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @prog=SiSU_Env::Info_program.new #(md.fns) #if md
+ if File.file?"#{@env.path.output}/#{@md.fnb}/#@fno"
+ @fnap="#{@env.path.output}/#{@md.fnb}/#@fno" #index.xml causes problems with index.html in server config
+ elsif File.file?"#{Dir.pwd}/#@fno"
+ @fnap="#{Dir.pwd}/#@fno"
+ end
+ @e_head='/document/head'
+ @e_title='/document/head/title'
+ @e_object='/document/body/object'
+ @e_ocn='/document/body/object/ocn'
+ @e_text='/document/body/object/text'
+ @e_endnote='/document/body/object/endnote'
+ end
+ def xml
+ begin
+ if FileTest.file?(@fnap)
+ if @prog.rexml !=false and FileTest.directory?('/usr/lib/ruby/1.8/rexml/') #note values can be other than true
+ xmlfile=IO.readlines(@fnap,'').join
+ begin
+ @xmldoc=REXML::Document.new xmlfile
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','REXML',"XML document #@fnap loaded") #% tell
+ tell.colorize unless @md.cmd =~/q/
+ if @md.cmd =~ /v/i #% substantive text
+ @xmldoc.elements.each(@e_head) do |e|
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'brown',e)
+ tell.colorize unless @md.cmd =~/q/
+ end
+ end
+ rescue REXML::ParseException
+ puts 'broken XML'
+ end
+ end
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'fuschia',"File Not Found #{xmlfile}",'requested XML processing skipped')
+ tell.colorize unless @md.cmd =~/q/
+ exit
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+end
+__END__
+ misc
+e.each do |element|
+ element.each do |child|
+ if child.is_a?(REXML::Text)
+ puts "Text: #{child.to_s.inspect}"
+ else
+ puts "SubElement: #{child.name}"
+ end
+ end
+end
+
diff --git a/lib/sisu/0.52/screen_text_color.rb b/lib/sisu/0.52/screen_text_color.rb
new file mode 100644
index 00000000..7fe6b39d
--- /dev/null
+++ b/lib/sisu/0.52/screen_text_color.rb
@@ -0,0 +1,404 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: system environment, screen colors text
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Screen
+ class Color
+ attr_accessor :off,:marker,:bold,:underline,:invert,:darkgrey_hi,:grey_hi,:pink_hi,:fuschia_hi,:red_hi,:orange_hi,:yellow_hi,:brown_hi,:lightgreen_hi,:green_hi,:cyan_hi,:blue_hi,:navy_hi,:white,:grey,:pink,:fuschia,:ruby,:red,:orange,:yellow,:brown,:green,:darkgreen,:cyan,:blue,:navy,:black
+ def initialize(&block)
+ instance_eval &block
+ end
+ end
+ class Ansi < Color
+ attr_reader :cX
+ def initialize(cmd,*txt)
+ @cmd,@txt=cmd,txt
+ @color_instruct=txt[0]
+ flag=SiSU_Env::Info_processing_flag.new
+ if @cmd
+ if flag.color #set default colors on or off -c acts as toggle against this default, if default is off -c turns on, if default is on -c turns off
+ if @cmd =~/c/; @use_color=false
+ else @use_color=true
+ end
+ else
+ if @cmd =~/c/; @use_color=true
+ else @use_color=false
+ end
+ end
+ if @cmd =~/k/; @use_color=false
+ end
+ else @use_color=false
+ end
+ @cX=@@cX= unless @use_color
+ Color.new do
+ self.off=self.white=self.marker=self.bold=self.underline=self.invert=self.darkgrey_hi=self.grey_hi=self.pink_hi=self.fuschia_hi=self.red_hi=self.orange_hi=self.yellow_hi=self.brown_hi=self.lightgreen_hi=self.green_hi=self.cyan_hi=self.blue_hi=self.navy_hi=self.grey=self.pink=self.fuschia=self.ruby=self.red=self.orange=self.yellow=self.brown=self.green=self.darkgreen=self.cyan=self.blue=self.navy=self.black=''
+ end
+ else #default set to colors on
+ Color.new do
+ self.off = "\033[0m"
+ self.white = "\033[0m"
+ self.marker = "\033[42m"
+ self.bold = "\033[1m"
+ self.underline = "\033[4m"
+ self.invert = "\033[7m"
+ self.darkgrey_hi = "\033[100m"
+ self.grey_hi = "\033[47m"
+ self.pink_hi = "\033[105m"
+ self.fuschia_hi = "\033[45m"
+ self.red_hi = "\033[41m"
+ self.orange_hi = "\033[101m"
+ self.yellow_hi = "\033[103m"
+ self.brown_hi = "\033[43m"
+ self.lightgreen_hi = "\033[102m"
+ self.green_hi = "\033[42m"
+ self.cyan_hi = "\033[106m"
+ self.blue_hi = "\033[104m"
+ self.navy_hi = "\033[44m"
+ self.grey = "\033[90m"
+ self.pink = "\033[95m"
+ self.fuschia = "\033[35m"
+ self.ruby = "\033[31m"
+ self.red = "\033[91m" #check
+ self.orange = "\033[91m"
+ self.yellow = "\033[93m"
+ self.brown = "\033[33m"
+ self.green = "\033[92m"
+ self.darkgreen = "\033[32m"
+ self.cyan = "\033[36m"
+ self.blue = "\033[94m"
+ self.navy = "\033[34m"
+ self.black = "\033[30m"
+ end
+ end
+ end
+ def colors
+ 0.upto(109) {|i| print "\033[#{i}m 33[#{i}m \033[m"}
+ puts ''
+ end
+ def color
+ case @color_instruct
+ when /invert/; @cX.invert
+ when /darkgrey_hi/; @cX.darkgrey_hi
+ when /grey_hi/; @cX.grey_hi
+ when /pink_hi/; @cX.pink_hi
+ when /fuschia_hi/; @cX.fuschia_hi
+ when /red_hi/; @cX.red_hi
+ when /orange_hi/; @cX.orange_hi
+ when /yellow_hi/; @cX.yellow_hi
+ when /brown_hi/; @cX.brown_hi
+ when /lightgreen_hi/; @cX.lightgreen_hi
+ when /green_hi/; @cX.green_hi
+ when /cyan_hi/; @cX.cyan_hi
+ when /blue_hi/; @cX.blue_hi
+ when /navy_hi/; @cX.navy_hi
+ when /white/; @cX.white
+ when /grey/; @cX.grey
+ when /pink/; @cX.pink
+ when /fuschia/; @cX.fuschia
+ when /ruby/; @cX.ruby
+ when /red/; @cX.red
+ when /orange/; @cX.orange
+ when /yellow/; @cX.yellow
+ when /brown/; @cX.brown
+ when /green/; @cX.green
+ when /darkgreen/; @cX.darkgreen
+ when /cyan/; @cX.cyan
+ when /blue/; @cX.blue
+ when /navy/; @cX.navy
+ when /close/; @cX.off
+ when /off/; @cX.off
+ end
+ end
+ def colorize
+ case @color_instruct
+ when /invert/; puts "#{@cX.invert}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /darkgrey_hi/; puts "#{@cX.darkgrey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /grey_hi/; puts "#{@cX.grey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /pink_hi/; puts "#{@cX.pink_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /fuschia_hi/; puts "#{@cX.fuschia_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /red_hi/; puts "#{@cX.red_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /orange_hi/; puts "#{@cX.orange_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /yellow_hi/; puts "#{@cX.yellow_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /brown_hi/; puts "#{@cX.brown_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /lightgreen_hi/; puts "#{@cX.lightgreen_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /green_hi/; puts "#{@cX.green_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /cyan_hi/; puts "#{@cX.cyan_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /blue_hi/; puts "#{@cX.blue_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /navy_hi/; puts "#{@cX.navy_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}"
+ when /bold/; puts "#{@cX.bold}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /white/; puts "#{@cX.off}#{@txt[1]} #{@txt[2]}"
+ when /grey/; puts "#{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /pink/; puts "#{@cX.pink}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /fuschia/; puts "#{@cX.fuschia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /ruby/; puts "#{@cX.ruby}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /red/; puts "#{@cX.red}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /orange/; puts "#{@cX.orange}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /yellow/; puts "#{@cX.yellow}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /brown/; puts "#{@cX.brown}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /green/; puts "#{@cX.green}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /darkgreen/; puts "#{@cX.darkgreen}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /cyan/; puts "#{@cX.cyan}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /blue/; puts "#{@cX.blue}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ when /navy/; puts "#{@cX.navy}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ end
+ end
+ def sourcename(sourcefilename)
+ @sourcefilename=sourcefilename
+ end
+ def basename(sourcefilename)
+ @basename=sourcefilename.sub(/\.(?:[_-]?sst|ssm)$/,'')
+ end
+ def sisu
+ end
+ def rescue
+ %{\t #{@cX.orange}Rescued#{@cX.off} #{@cX.grey}An#{@cX.off} #{@cX.fuschia}ERROR#{@cX.off} #{@cX.grey}occurred, message:"#{@cX.off} #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.brown}#{@txt[2]}#{@cX.off}}
+ end
+ def warn
+ puts "\t #{@cX.brown}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"
+ end
+ def error
+ puts "\t #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off}"
+ end
+ def error2
+ puts "\t #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.fuschia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ end
+ def version
+ puts "#{@cX.blue_hi}#{@txt[0]} #{@txt[1]}#{@cX.off} #{@cX.grey} (#{@txt[3]} [#{@txt[2]}]) &#{@cX.off} #{@cX.ruby}Ruby#{@cX.off} #{@cX.grey}(#{@txt[4]})#{@cX.off}\n"
+ end
+ def html3numbers
+ puts %{\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.cyan}files processed#{@cX.off}. } +
+ %{#{@cX.grey}} +
+ %{scroll only: #{@txt[1]}, seg only: #{@txt[2]},} +
+ %{#{@cX.off} } +
+ %{#{@cX.cyan}joint scroll & seg: #{@txt[3]},#{@cX.off}} +
+ %{#{@cX.grey} } +
+ %{nav only: #{@txt[4]}} +
+ %{#{@cX.off}}
+ end
+ def html2numbers
+ puts %{\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.cyan}files processed#{@cX.off}. } +
+ %{#{@cX.grey}} +
+ %{scroll only: #{@txt[1]},} +
+ %{#{@cX.off} } +
+ %{#{@cX.cyan}seg only: #{@txt[2]},#{@cX.off}} +
+ %{#{@cX.grey} } +
+ %{joint scroll & seg: #{@txt[3]}, nav only: #@n_files_nav} +
+ %{#{@cX.off}}
+ end
+ def html1numbers
+ puts %{\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.cyan}files processed#{@cX.off}. } +
+ %{#{@cX.cyan}scroll only: #{@txt[1]},#{@cX.off}} +
+ %{#{@cX.grey} } +
+ %{seg only: #{@txt[2]}, } +
+ %{joint scroll & seg: #{@txt[3]}, nav only: #@n_files_nav} +
+ %{#{@cX.off}}
+ end
+ def html0_numbers
+ puts %{\t#{@cX.ruby}#{@txt[0]} files processed#{@cX.off}. } +
+ %{#{@cX.grey}} +
+ %{scroll only: #{@txt[1]}, seg only: #{@txt[2]}, joint scroll & seg: #{@txt[3]},} +
+ %{#{@cX.off} } +
+ %{#{@cX.cyan}nav only: #{@txt[4]}#{@cX.off}.}
+ end
+ def php_numbers
+ puts %{ #{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.cyan}files processed#{@cX.off}. } +
+ %{php_scr only: #{@txt[1]}, } +
+ %{#{@cX.cyan}php_seg only: #{@txt[2]}#{@cX.off}, } +
+ %{joint php scroll & seg: #{@txt[3]}, } +
+ %{php_nav only: #{@txt[4]}}
+ end
+ def txt_white
+ puts "\t#{@cX.white}#{@txt[0]}#{@cX.off} #{@cX.white}#{@txt[1]}#{@cX.off}"
+ end
+ def txt_grey
+ puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off}"
+ end
+ def txt_cyan
+ puts "\t#{@cX.cyan}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"
+ end
+ def txt_blue
+ puts "\t#{@cX.blue}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"
+ end
+ def txt_red
+ puts "\t#{@cX.red}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off}"
+ end
+ def txt_green
+ puts "\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"
+ end
+ def url #clean
+ blue
+ end
+ def result
+ puts "\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.blue}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ end
+ def maintenance
+ puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"
+ end
+ def instruct
+ puts %{\t #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off} #{@cX.cyan}#{@txt[3]}#{@cX.off} #{@cX.grey}#{@txt[4]}#{@cX.off} "#{@cX.brown}#@f#{@cX.off}"}
+ end
+ def grey_open
+ print @cX.grey
+ end
+ def p_off
+ print @cX.off
+ end
+ def p_close
+ print @cX.off
+ end
+ def flow
+ puts %{\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.ruby}->#{@cX.off}\n\t #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def output
+ puts %{\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.ruby}->#{@cX.off}\n\t #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def generic
+ puts %{\t#{@cX.navy}#{@txt[0]} #{@txt[1]}#{@cX.off}. }
+ end
+ def files_processed
+ puts %{\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}}
+ end
+ def print_blue
+ print "#{@cX.blue}#{@txt[0]} #{@txt[1]}#{@cX.off}"
+ end
+ def puts_blue
+ puts "#{@cX.blue}#{@txt[0]} #{@txt[1]}#{@cX.off}"
+ end
+ def print_brown
+ print "#{@cX.brown}#{@txt[0]}#{@cX.off}"
+ end
+ def blue_tab
+ print "\t#{@cX.blue}#{@txt[0]}#{@cX.off}\n"
+ end
+ def print_grey
+ print "#{@cX.grey}#{@txt[0]} #{@txt[1]}#{@cX.off}"
+ end
+ def puts_grey
+ puts "#{@cX.grey}#{@txt[0]} #{@txt[1]}#{@cX.off}"
+ end
+ def puts_brown
+ puts "#{@cX.brown}#{@txt[0]} #{@txt[1]}#{@cX.off}"
+ end
+ def grey_tab
+ print "\t#{@cX.grey}#{@txt[0]}#{@cX.off}\n"
+ end
+ def green_title
+ puts %{#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}}
+ end
+ def green_title_hi
+ puts %{#{@cX.green_hi}#{@cX.black}#{@txt[0]}#{@cX.off*2} #{@cX.grey}#{@txt[1]}#{@cX.off}}
+ end
+ def green_hi_blue
+ puts %{#{@cX.green_hi}#{@cX.black}#{@txt[0]}#{@cX.off*2} #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def grey_title_hi
+ puts %{#{@cX.grey_hi}#{@cX.black}#{@txt[0]}#{@cX.off*2} #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def dark_grey_title_hi
+ puts %{#{@cX.darkgrey_hi}#{@cX.black}#{@txt[0]}#{@cX.off*2} #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def cyan_title_hi
+ puts %{#{@cX.cyan_hi}#{@cX.black}#{@txt[0]}#{@cX.off*2} #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def dbi_title
+ puts %{#{@cX.blue_hi}#{@cX.black}#{@txt[0]}#{@cX.off*2} #{@cX.cyan}#{@cX.grey}#{@txt[1]}#{@cX.off*2} #{@cX.green}#{@txt[2]}#{@cX.off}}
+ end
+ def yellow_title_hi
+ puts %{#{@cX.yellow_hi}#{@cX.black}#{@txt[0]}#{@cX.off*2} #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def term_sheet_title
+ puts %{\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.red_hi}#{@cX.black}#{@txt[1]}.#{@cX.off*2} }
+ end
+ def generic_number
+ puts "#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"
+ end
+ def tex_numbers
+ puts %{ #{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.cyan}tex/pdf files processed#{@cX.off}.}
+ end
+ def tex_info_numbers
+ puts %{ #{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.cyan}texinfo files processed#{@cX.off}.}
+ end
+ def lout_numbers
+ puts %{ #{@cX.green}#@n_lout#{@cX.off} #{@cX.cyan}lout/pdf files processed#{@cX.off}.}
+ end
+ def parameters
+ end
+ def reserved
+ puts %{ #{@cX.grey_hi}#{@cX.black}reserved#{@cX.off*2}}
+ end
+ def meta_verse_title
+ puts %{#{@cX.green_hi}#{@cX.black}MetaVerse#{@cX.off*2} }
+ end
+ def meta_verse_title_v
+ b=sourcename(@txt[0])
+ puts %{#{@cX.green_hi}#{@cX.black}MetaVerse#{@cX.off*2} } +
+ %{#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.ruby}->#{@cX.off}\n\t #{@cX.blue}~meta/#{b}.meta#{@cX.off}}
+ end
+ def meta_verse
+ puts "\t#{@cX.grey}MetaVerse#{@cX.off}"
+ end
+ def meta_verse_skipped
+ puts %{\t#{@cX.grey}MetaVerse: MarshalLoad (creation of metaVerse skipped)#{@cX.off}}
+ end
+ def meta_verse_load
+ puts %{\t<<MetaVerse: MarshalLoad>>}
+ end
+ def html_title
+ puts %{#{@cX.green_hi}#{@cX.black}HTML#{@cX.off*2}}
+ end
+ def html_output
+ puts %{\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.ruby}->#{@cX.off}\n\t #{@cX.blue}#{@txt[1]}#{@cX.off}}
+ end
+ def php_title
+ puts %{\n#{@cX.green_hi}#{@cX.black}PHP#{@cX.off*2}}
+ end
+ def segmented
+ puts "\t#{@cX.grey}Seg#{@cX.off} #{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.grey}segments#{@cX.off}"
+ end
+ end
+end
+
diff --git a/lib/sisu/0.52/semantics.rb b/lib/sisu/0.52/semantics.rb
new file mode 100644
index 00000000..2d827f52
--- /dev/null
+++ b/lib/sisu/0.52/semantics.rb
@@ -0,0 +1,388 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: semantics
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module Semantic
+ require SiSU_lib + '/param'
+ class YamlInfoCreate
+ def initialize(file='')
+ @file=file
+ @sisu=[]
+ @@doc[:title],@@doc[:subtitle],@@doc[:creator],@@doc[:subject],@@doc[:keywords],@@doc[:description],@@doc[:publisher],@@doc[:contributor],@@doc[:date],@@doc[:date_created],@@doc[:date_issued],@@doc[:date_available],@@doc[:date_valid],@@doc[:date_modified],@@doc[:type],@@doc[:format],@@doc[:identifier],@@doc[:source],@@doc[:language],@@doc[:coverage],@@doc[:relation],@@doc[:rights]=nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil
+ end
+ def songsheet
+ param
+ yamlinfo
+ end
+ def param
+ file_array=IO.readlines(@file,'')
+ SiSU_Param(file_array,@file,'a') #problem not updated watch
+ end
+ def printscreen
+ puts "#{@@cX.fuschia}filename:#{@@cX.off} " + @file
+ puts "#{@@cX.fuschia}title:#{@@cX.off} " + @@doc[:title]
+ puts "#{@@cX.fuschia}subtitle:#{@@cX.off} " + @@doc[:subtitle] if @@doc[:subtitle]
+ puts "#{@@cX.fuschia}creator:#{@@cX.off} " + @@doc[:creator] if @@doc[:creator]
+ puts "#{@@cX.fuschia}subject:#{@@cX.off} " + @@doc[:subject] if @@doc[:subject]
+ puts "#{@@cX.fuschia}description:#{@@cX.off} " + @@doc[:description] if @@doc[:description]
+ puts "#{@@cX.fuschia}publisher:#{@@cX.off} " + @@doc[:publisher] if @@doc[:publisher]
+ puts "#{@@cX.fuschia}contributor:#{@@cX.off} " + @@doc[:contributor] if @@doc[:contributor]
+ puts "#{@@cX.fuschia}date:#{@@cX.off} " + @@doc[:date] if @@doc[:date]
+ puts "#{@@cX.fuschia}date created:#{@@cX.off} " + @@doc[:date_created] if @@doc[:date_created]
+ puts "#{@@cX.fuschia}date issued:#{@@cX.off} " + @@doc[:date_issued] if @@doc[:date_issued]
+ puts "#{@@cX.fuschia}date available:#{@@cX.off} " + @@doc[:date_available] if @@doc[:date_available]
+ puts "#{@@cX.fuschia}date valid:#{@@cX.off} " + @@doc[:date_valid] if @@doc[:date_valid]
+ puts "#{@@cX.fuschia}date modified:#{@@cX.off} " + @@doc[:date_modified] if @@doc[:date_modified]
+ puts "#{@@cX.fuschia}type:#{@@cX.off} " + @@doc[:type] if @@doc[:type]
+ puts "#{@@cX.fuschia}format:#{@@cX.off} " + @@doc[:format] if @@doc[:format]
+ puts "#{@@cX.fuschia}identifier:#{@@cX.off} " + @@doc[:identifier] if @@doc[:identifier]
+ puts "#{@@cX.fuschia}source:#{@@cX.off} " + @@doc[:source] if @@doc[:source]
+ puts "#{@@cX.fuschia}language:#{@@cX.off} " + @@doc[:language] if @@doc[:language]
+ puts "#{@@cX.fuschia}coverage:#{@@cX.off} " + @@doc[:coverage] if @@doc[:coverage]
+ puts "#{@@cX.fuschia}relation:#{@@cX.off} " + @@doc[:relation] if @@doc[:relation]
+ puts "#{@@cX.fuschia}rights:#{@@cX.off} " + @@doc[:rights] if @@doc[:rights]
+ puts "#{@@cX.fuschia}keywords:#{@@cX.off} " + @@doc[:keywords] if @@doc[:keywords]
+ puts '-----------------------'
+ end
+ def yamlinfo
+ uri=case @file
+ when /.+?\.[_-]?sst$/; @file.gsub(/(.+?)\.[_-]?sst$/,'http://localhost/reserved/\1/')
+ end
+ puts uri
+ @sisu << '-'
+ @sisu << ' filename: ' + uri
+ @sisu << ' title: ' + @@doc[:title].gsub(/:/, ' - ') if @@doc[:title]
+ @sisu << ' subtitle: ' + @@doc[:subtitle] if @@doc[:subtitle]
+ @sisu << ' creator: ' + @@doc[:creator] if @@doc[:creator]
+ @sisu << ' subject: ' + @@doc[:subject] if @@doc[:subject]
+ @sisu << ' keywords: ' + @@doc[:keywords] if @@doc[:keywords]
+ @sisu << ' description: ' + @@doc[:description] if @@doc[:description]
+ @sisu << ' publisher: ' + @@doc[:publisher] if @@doc[:publisher]
+ @sisu << ' contributor: ' + @@doc[:contributor] if @@doc[:contributor]
+ @sisu << ' date: ' + @@doc[:date] if @@doc[:date]
+ @sisu << ' date_created: ' + @@doc[:date_created] if @@doc[:date_created]
+ @sisu << ' date_issued: ' + @@doc[:date_issued] if @@doc[:date_issued]
+ @sisu << ' date_available: ' + @@doc[:dateavailable] if @@doc[:date_available]
+ @sisu << ' date_valid: ' + @@doc[:date_valid] if @@doc[:date_valid]
+ @sisu << ' date_modified: ' + @@doc[:date_modified] if @@doc[:date_modified]
+ @sisu << ' type: ' + @@doc[:type] if @@doc[:type]
+ @sisu << ' format: ' + @@doc[:format] if @@doc[:format]
+ @sisu << ' identifier: ' + @@doc[:identifier] if @@doc[:identifier]
+ @sisu << ' source: ' + @@doc[:source] if @@doc[:source]
+ @sisu << ' language: ' + @@doc[:language] if @@doc[:language]
+ @sisu << ' coverage: ' + @@doc[:coverage] if @@doc[:coverage]
+ @sisu << ' relation: ' + @@doc[:relation] if @@doc[:relation]
+ @sisu << ' rights: ' + @@doc[:rights] if @@doc[:rights]
+ #@sisu << ' copyright: ' + @@doc[:copyright] if @@doc[:copyright]
+ @sisu.each {|para| @@filename_semantic.puts para}
+ end
+ end
+ class Yaml_info_read
+ def initialize #(file='')
+ @pwd=Dir.pwd
+ @sisu=[]
+ end
+ def loadfile
+ if FileTest.file?("#@pwd/semantic.yml")
+ @yaml||=YAML::load(File::open("#@pwd/semantic.yml"))
+ end
+ end
+ def printscreen
+ @yaml.each do |y|
+ puts y['title'] if y['title']
+ puts y['subtitle'] if y['subtitle']
+ puts y['creator'] if y['creator']
+ puts y['subject'] if y['subject']
+ puts y['description'] if y['description']
+ puts y['publisher'] if y['publisher']
+ puts y['contributor'] if y['contributor']
+ puts y['date'] if y['date']
+ puts y['date_created'] if y['date_created']
+ puts y['date_issued'] if y['date_issued']
+ puts y['date_available'] if y['date_available']
+ puts y['date_valid'] if y['date_valid']
+ puts y['date_modified'] if y['date_modified']
+ puts y['type'] if y['type']
+ puts y['format'] if y['format']
+ puts y['identifier'] if y['identifier']
+ puts y['source'] if y['source']
+ puts y['language'] if y['language']
+ puts y['coverage'] if y['coverage']
+ puts y['relation'] if y['relation']
+ puts y['rights'] if y['rights']
+ puts y['copyright'] if y['copyright']
+ puts y['keywords'] if y['keywords']
+ puts '-----'
+ end
+ end
+ end
+ class RSS < Yaml_info_read
+ def songsheet
+ loadfile
+ rss_nav
+ debris
+ end
+ def rss(match=//,feedtitle='')
+ @sisu=[]
+ @sisu << %{<rss version="2.0">\n-\n <channel><title>#{feedtitle}</title>
+<link>http://www.jus.uio.no/lm/</link>
+<description>Semantic Information Structuring Unit</description>
+<language>en-us</language>
+-
+}
+ @yaml.each do |y|
+ if y['title'] and ((y['subject'] and "#{y['subject']}"[match]) or (y['keywords'] and "#{y['keywords']}"[match]))
+ puts y['subject']
+ @sisu << %{-
+ <item>
+ <title>#{y['title']}</title>
+ -
+ <guid>
+ #{y['filename']}
+ </guid>
+ -
+ }
+ @sisu << %{<description>}
+ @sisu << %{<h1 id="#{y['title'].gsub(/\s+/, '-')}">#{y['title']}</h1>}
+ @sisu << %{#{y['title']} } if y['title']
+ @sisu << %{#{y['subtitle']} } if y['subtitle']
+ @sisu << %{#{y['creator'] }} if y['creator']
+ #@sisu << %{#{y['subject']}} if y['subject']
+ @sisu << %{#{y['description'] }} if y['description']
+ #@sisu << %{#{y['publisher']}} if y['publisher']
+ #@sisu << %{#{y['contributor']}} if y['contributor']
+ @sisu << %{#{y['date']} } if y['date']
+ #@sisu << %{#{y['date_created']}} if y['date_created']
+ #@sisu << %{#{y['date_issued']}} if y['date_issued']
+ #@sisu << %{#{y['date_available']}} if y['date_available']
+ #@sisu << %{#{y['date_valid']}} if y['date_valid']
+ #@sisu << %{#{y['date_modified']}} if y['date_modified']
+ #@sisu << %{#{y['type']}} if y['type']
+ #@sisu << %{#{y['format']}} if y['format']
+ #@sisu << %{#{y['identifier']}} if y['identifier']
+ #@sisu << %{#{y['source']}} if y['source']
+ #@sisu << %{#{y['language']}} if y['language']
+ #@sisu << %{#{y['coverage']}} if y['coverage']
+ #@sisu << %{#{y['relation']}} if y['relation']
+ #@sisu << %{#{y['rights']}} if y['rights']
+ #@sisu << %{#{y['copyright']}} if y['copyright']
+ #@sisu << %{#{y['keyword']}} if y['keyword']
+ @sisu << %{</description>}
+ @sisu << %{</item>}
+ end
+ end
+ @sisu << %{</channel>\n</rss>}
+ #@sisu.each {|para| @@rss.puts para} #KEEP does all
+ if "united nations"[match]
+ @sisu.each {|para| @@rss_un.puts para}
+ @sisu=[]
+ end
+ if "unidroit"[match]
+ @sisu.each {|para| @@rss_unidroit.puts para}
+ @sisu=[]
+ end
+ if "hcpil"[match]
+ @sisu.each {|para| @@rss_hcpil.puts para}
+ @sisu=[]
+ end
+ if "contract"[match]
+ @sisu.each {|para| @@rss_contracts.puts para}
+ @sisu=[]
+ end
+ if "navigate"[match]
+ @sisu.each {|para| @@rss_nav.puts para}
+ @sisu=[]
+ end
+ end
+ def rss_un
+ match=/united\s+nations|uncitral/i
+ rss(match, 'Lex Mercatoria Pages on the United Nations')
+ end
+ def rss_unidroit
+ match=/unidroit/i
+ rss(match, 'Lex Mercatoria pages on UNIDROIT')
+ end
+ def rss_hcpil
+ match=/hague\s+conference|hcpil/i
+ rss(match, 'Lex Mercatoria pages on the Hague Conference on Private International Law')
+ end
+ def rss_contracts
+ match=/contracts?/i
+ rss(match, 'Lex Mercatoria Contract Law pages')
+ end
+ def rss_nav
+ match=/navigate(\s|$)/i
+ rss(match, 'Lex Mercatoria Navigation pages')
+ end
+ def dummy
+ @sisu << %{<doc>}
+ @yaml.each do |y|
+ @sisu << %{<content>}
+ @sisu << %{#{y['title']}} if y['title']
+ @sisu << %{#{y['subtitle']}} if y['subtitle']
+ @sisu << %{#{y['creator']}} if y['creator']
+ @sisu << %{#{y['subject']}} if y['subject']
+ @sisu << %{#{y['description']}} if y['description']
+ @sisu << %{#{y['publisher']}} if y['publisher']
+ @sisu << %{#{y['contributor']}} if y['contributor']
+ @sisu << %{#{y['date']}} if y['date']
+ @sisu << %{#{y['date_created']}} if y['date_created']
+ @sisu << %{#{y['date_issued']}} if y['date_issued']
+ @sisu << %{#{y['date_available']}} if y['date_available']
+ @sisu << %{#{y['date_valid']}} if y['date_valid']
+ @sisu << %{#{y['date_modified']}} if y['date_modified']
+ @sisu << %{#{y['type']}} if y['type']
+ @sisu << %{#{y['format']}} if y['format']
+ @sisu << %{#{y['identifier']}} if y['identifier']
+ @sisu << %{#{y['source']}} if y['source']
+ @sisu << %{#{y['language']}} if y['language']
+ @sisu << %{#{y['coverage']}} if y['coverage']
+ @sisu << %{#{y['relation']}} if y['relation']
+ @sisu << %{#{y['rights']}} if y['rights']
+ @sisu << %{#{y['copyright']}} if y['copyright']
+ @sisu << %{#{y['keyword']}} if y['keyword']
+ @sisu << %{</content>}
+ end
+ @sisu << %{</doc>}
+ @sisu.each {|para| @@rss.puts para}
+ end
+ def debris
+ outputdir=SiSU_Env::Info_env.new.path.feed
+ x=Dir.new(outputdir).entries
+ x.each do |y|
+ #unless FileTest.file?("#{outputdir}/#{y}") and File.size?("#{outputdir}/#{y}") == 0
+ if File.size("#{outputdir}/#{y}") == 0
+ #File.unlink("#{outputdir}/#{y}")
+ puts "#{outputdir}/#{y}"
+ puts File.size("#{outputdir}/#{y}")
+ end
+ end
+ end
+ end
+ class RDF < Yaml_info_read
+ def songsheet
+ loadfile
+ rdf
+ rdf_un
+ rdf_unidroit
+ rdf_hcpil
+ rdf_contracts
+ rdf_nav
+ debris
+ end
+ def rdf
+ end
+ def rdf_un
+ end
+ def rdf_unidroit
+ end
+ def rdf_hcpil
+ end
+ def rdf_contracts
+ end
+ def rdf_nav
+ end
+ def debris
+ end
+ end
+end
+ #% start
+require SiSU_lib + '/param'
+require SiSU_lib + '/defaults'
+require SiSU_lib + '/sysenv'
+include SiSU_Param
+include SiSU_Env
+include SiSU_Viz
+outputdir=SiSU_Env::Info_env.new.path.feed
+pwd=Dir.pwd
+@argv=[]
+argv=$*
+p argv
+my_make=SiSU_Env::Create_file.new('','')
+if argv.to_s =~/yaml/
+ my_make.file_semantic
+ files=Dir["*.sst,*._sst,*-sst"]
+ end
+ files.each {|f| @argv << f[/(.+?)\.[_-]?sst$/,1] if f =~/.+?\.[_-]?sst$/}
+ #########
+ files.each do |filename|
+ Semantic::YamlInfoCreate.new(filename).songsheet
+ end
+elsif argv.to_s =~/rss/
+ #rss=%{#{outputdir}/semantic.xml}
+ #@@rss=File.new(rss, "w+")
+ rss_nav=%{#{outputdir}/navigate.xml}
+ @@rss_nav=File.new(rss_nav, "w+")
+ #
+ #rss_un=%{#{outputdir}/un.xml}
+ #@@rss_un=File.new(rss_un, "w+")
+ #rss_unidroit=%{#{outputdir}/unidroit.xml}
+ #@@rss_unidroit=File.new(rss_unidroit, "w+")
+ #rss_hcpil=%{#{outputdir}/hcpil.xml}
+ #@@rss_hcpil=File.new(rss_hcpil, "w+")
+ #rss_contracts=%{#{outputdir}/contracts.xml}
+ #@@rss_contracts=File.new(rss_contracts, "w+")
+ ##my_make.file_rss
+ Semantic::RSS.new.songsheet
+elsif argv.to_s =~/rdf/
+ #rdf=%{#{outputdir}/semantic.rdf}
+ #@@rdf=File.new(rdf, "w+")
+ #rdf_un=%{#{outputdir}/un.rdf}
+ #@@rdf_un=File.new(rdf_un, "w+")
+ #rdf_unidroit=%{#{outputdir}/unidroit.rdf}
+ #@@rdf_unidroit=File.new(rdf_unidroit, "w+")
+ #rdf_hcpil=%{#{outputdir}/hcpil.rdf}
+ #@@rdf_hcpil=File.new(rdf_hcpil, "w+")
+ #rdf_contracts=%{#{outputdir}/contracts.rdf}
+ #@@rdf_contracts=File.new(rdf_contracts, "w+")
+ #rdf_nav=%{#{outputdir}/navigate.rdf}
+ #@@rdf_nav=File.new(rdf_nav, "w+")
+ ##my_make.file_rdf
+ #Semantic::RDF.new.songsheet
+end
+__END__
+
diff --git a/lib/sisu/0.52/share_src.rb b/lib/sisu/0.52/share_src.rb
new file mode 100644
index 00000000..9574de18
--- /dev/null
+++ b/lib/sisu/0.52/share_src.rb
@@ -0,0 +1,88 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: share sisu source markup file, copy it to output directory!
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Markup
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ pwd=Dir.pwd
+ class Source
+ require 'fileutils'
+ include FileUtils
+ def initialize(opt)
+ @opt=opt
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ stub=@opt.fnb.gsub(/~[a-z]+$/,'')
+ @output_path="#{@env.path.output}/#{stub}"
+ end
+ def read
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share Document Source!',@opt.fns)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Copy sisu markup file to output directory","#{@opt.fns} -> #@output_path")
+ tell.warn unless @opt.cmd =~/q/
+ File.mkpath(@env.path.output) unless FileTest.directory?(@env.path.output)
+ File.mkpath(@output_path) unless FileTest.directory?(@output_path)
+ if FileTest.directory?(@output_path)
+ unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@output_path)
+ else
+ req=@opt.fns.gsub(/(.+)?\.ssm$/,'\1.composite.sst')
+ file=@opt.fns.gsub(/(.+)?\.ssm$/,'\1._sst')
+ if FileTest.file?(file); cp(file,"#@output_path/#{req}")
+ else print "did not find #{file} to copy"
+ end
+ end
+ else
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Output directory does not exist","#{@opt.fns} -> #@output_path")
+ tell.warn unless @opt.cmd =~/q/
+ exit
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/share_src_kdissert.rb b/lib/sisu/0.52/share_src_kdissert.rb
new file mode 100644
index 00000000..a6a2e968
--- /dev/null
+++ b/lib/sisu/0.52/share_src_kdissert.rb
@@ -0,0 +1,82 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: share sisu source markup file, copy it to output directory!
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Kdi_source
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ pwd=Dir.pwd
+ class Source
+ require 'fileutils'
+ include FileUtils
+ def initialize(opt)
+ @opt=opt
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @output_path="#{@env.path.output}/#{@opt.fnb}"
+ end
+ def read
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share Kdissert Source Document!',@opt.fnb)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Copy kdissert file to output directory","#{@opt.fnb} -> #@output_path")
+ tell.warn unless @opt.cmd =~/q/
+ File.mkpath(@env.path.output) unless FileTest.directory?(@env.path.output)
+ File.mkpath(@output_path) unless FileTest.directory?(@output_path)
+ if FileTest.directory?(@output_path)
+ if @opt.fns =~/\.kdi\._sst$/ and FileTest.file?(@opt.fnb)
+ cp(@opt.fnb,@output_path)
+ end
+ else
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Output directory does not exist","#{@opt.fnb} -> #@output_path")
+ tell.warn unless @opt.cmd =~/q/
+ exit
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/shared_db.rb b/lib/sisu/0.52/shared_db.rb
new file mode 100644
index 00000000..ba98e195
--- /dev/null
+++ b/lib/sisu/0.52/shared_db.rb
@@ -0,0 +1,78 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by the different db types, dbi, postgresql, sqlite
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_DB
+ require SiSU_lib + '/db_columns'
+ require SiSU_lib + '/db_tests'
+ require SiSU_lib + '/db_create'
+ require SiSU_lib + '/db_select'
+ require SiSU_lib + '/db_indexes'
+ require SiSU_lib + '/db_drop'
+ require SiSU_lib + '/db_remove'
+ require SiSU_lib + '/db_load_tuple'
+ require SiSU_lib + '/db_import'
+ class Column_size < SiSU_DB_columns::Column_size
+ end
+ class Test < SiSU_DB_tests::Test
+ end
+ class Create <SiSU_DB_create::Create #<SiSU_DB::Column_size
+ end
+ class Case <SiSU_DB_select::Case
+ end
+ class Index <SiSU_DB_index::Index # create documents Indexes def initialize(opt,conn='',sql_type='')
+ end
+ class Drop <SiSU_DB_drop::Drop
+ end
+ class Remove <SiSU_DB_remove::Remove
+ end
+ class Load_tuple <SiSU_DB_tuple::Load_tuple #% main database populate
+ end
+ class Import <SiSU_DB_import::Import #<SiSU_DB::Column_size #% main
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/shared_html.rb b/lib/sisu/0.52/shared_html.rb
new file mode 100644
index 00000000..a236783f
--- /dev/null
+++ b/lib/sisu/0.52/shared_html.rb
@@ -0,0 +1,55 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: shared html parts
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_HTML_shared
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/html_table'
+ class Table < SiSU_HTML_table::Table
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/shared_html_lite.rb b/lib/sisu/0.52/shared_html_lite.rb
new file mode 100644
index 00000000..4d4e03b1
--- /dev/null
+++ b/lib/sisu/0.52/shared_html_lite.rb
@@ -0,0 +1,180 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by db and flatfile output generators, mostly xml/xhtml/html formatting
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Format_Shared
+ require SiSU_lib + '/defaults'
+ include SiSU_Viz
+ class CSS_Format
+ def initialize(content=nil,id=nil,ocnd='',ocns='',lv='',hname=nil)
+ content.gsub!(/<:i[12]>/,'')
+ @content=content
+ @id=@ocn=id
+ @ocnd,@ocns=ocnd,ocns
+ @lv=@notenumber=lv.to_s
+ @hname=hname.to_s
+ @tab="\t"
+ # lots introduced to do html tables in db
+ @@tablehead,@@tablefoot=[],[]
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def paragraph
+ %{#{@tab*1}<p class="h#@lv" id="#@ocn" type="substantive" header="#@hname">\n#{@tab*2}#@content\n#{@tab*1}</p>\n} << "\n"
+ end
+ def endnote
+ <<GSUB
+#{@tab*1}<p class="endnote" name="note_#@notenumber" from="#@ocn">
+#{@tab*2}<a name="_#@notenumber" href="#-#@notenumber">#@notenumber.</a> <note>#@content</note>
+#{@tab*1}</p>
+GSUB
+ end
+ def lev_toc_hname
+ %{#{@tab*1}<p class="toc#@lv" header="#@hname"><a href="##@ocn">\n#{@tab*2}#@content\n#{@tab*1}</a></p>\n} << "\n"
+ end
+ def lev_toc
+ %{#{@tab*1}<p class="toc#@lv"><a href="##@ocn">\n#{@tab*2}#@content\n#{@tab*1}</a></p>\n} << "\n"
+ end
+ def lev4_plus
+ %{#{@tab*1}<p class="h#@lv" id="#@ocn" type="substantive" header="#@hname">\n#{@tab*2}#@content\n#{@tab*1}</p>\n} << "\n"
+ end
+ def lev4_minus
+ %{#{@tab*1}<p class="h#@lv" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n} << "\n"
+ end
+ def norm_comment
+ %{#{@tab*1}<p class="norm" id="none" type="comment">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}
+ end
+ def norm
+ %{#{@tab*1}<p class="norm" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}
+ end
+ def indent1
+ %{#{@tab*1}<p class="indent1" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}
+ end
+ def indent2
+ %{#{@tab*1}<p class="indent2" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}
+ end
+ def para_table
+ %{<p class="norm" align="left"><font #{@vz.font_small} #{@vz.font_color} #{@vz.font_face}>}
+ end
+ def ocn
+ %{#{@tab*1}<p class="ocn">#@ocn</p>} << "\n"
+ end
+ def html_table # get rid of use html_table
+ @new_content=[]
+ @content.split(/\n/).each do |parablock|
+ m=parablock[/<!f(.+?)!>/,1]
+ @@tablefoot<<m if m
+ parablock.gsub!(/<!f.+?!>/,'')
+ @@tablehead=1 if parablock =~/<!Th¡/
+ parablock.gsub!(/<!Th?¡.+?!~(\d+)>/,
+ #%{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center"><tr><td valign="top" align="justify"><p class="norm" id="\\1"> </p> </td><td>\n} +
+ %{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">})
+ if parablock =~/<!TZ!>/
+ tablefoot=[]
+ @@tablefoot.each {|x| tablefoot << %{<p align="center"><font size=2><i>#{x}</i></font></p>\n}}
+ @@tablefoot=[]
+ parablock.gsub!(/<!TZ!>/,
+ %{#{@vz.table_close}\n}) # +
+ #%{#{tablefoot}})
+ end
+ if @@tablehead == 1
+ if parablock =~/¡¡/
+ parablock.gsub!(/<!¡¡(\d+?)¡/,
+ %{\n<tr>} +
+ %{\n<td width="\\1%" valign="top">} +
+ %{#{para_table}<b>})
+ parablock.gsub!(/¡¡(\d+?)¡/,
+ %{</b></td><td width="\\1%" valign="top">} +
+ %{#{para_table}<b>})
+ parablock.gsub!(/!>/, '</b></td></tr>')
+ @@tablehead=0 #if parablock =~/!>/
+ end
+ parablock
+ else
+ parablock.gsub!(/<!¡¡(\d+?)¡/,
+ %{\n<tr>} +
+ %{\n<td width="\\1%" valign="top">} +
+ %{#{para_table}})
+ parablock.gsub!(/¡¡(\d+?)¡/,
+ %{</td><td width="\\1%" valign="top">} +
+ %{#{para_table}})
+ parablock.gsub!(/!>/, '</td></tr>')
+ parablock
+ end
+ @new_content << parablock
+ end
+ @new_content.join
+ end
+ end
+ class CSS_Format_generic #does CSS_Format in one definition, needs to be told about class, despite brevity of generic, easier to see structure with CSS_Format
+ def initialize(css_class='',content='',id=nil,ocnd=nil,ocns=nil,lv='',hname=nil)
+ @tab="\t"
+ @class=css_class
+ @content=content
+ @lv=@notenumber=lv.to_s
+ #@ocn=ocn.to_s
+ @hname=hname.to_s
+ @id=@ocn=id
+ end
+ def paragraph
+ css_class=%{class="#@class" }
+ if @ocn
+ id=%{id="#@ocn" }
+ type=%{type="substantive" }
+ else
+ id=%{id="none" }
+ type=%{type="comment" }
+ end
+ header=%{header="#@hname" } if @hname
+ %{#{@tab*1}<p #{css_class}#{id}#{type}#{header}>\n#{@tab*2}#@content\n#{@tab*1}</p>\n} << "\n"
+ end
+ def para
+ paragraph
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/shared_txt.rb b/lib/sisu/0.52/shared_txt.rb
new file mode 100644
index 00000000..bd0b41cc
--- /dev/null
+++ b/lib/sisu/0.52/shared_txt.rb
@@ -0,0 +1,299 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: modules shared by flatfile output generators
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_text_utils
+ class Wrap
+ def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil)
+ @para,@n_char_max,@n_indent=para,n_char_max,n_indent
+ @br="\n"
+ @n_hang=unless n_hang; @n_hang=@n_indent
+ else n_hang
+ end
+ end
+ def line_wrap
+ space=' '
+ spaces_indent,spaces_hang="#@br#{space*@n_indent}",space*@n_hang
+ line=0
+ out=[]
+ out[line]=''
+ #line=0,out,out[line]=0,[],''
+ #@para.gsub!(/<br(?: \/)?>/,"\n") #watch #added
+ words=@para.scan(/\S+/)
+ while words != ''
+ word=words.shift
+ if not word
+ out[line].strip!.squeeze!(' ') unless out[line].empty? #check
+ break
+ elsif (out[line].length + word.length) > (@n_char_max - @n_indent) and out[line] =~/\S+/
+ out[line].strip!.squeeze!(' ')
+ line += 1
+ end
+ out[line]="#{out[line]} #{word}" if word
+ end
+ out.join(spaces_indent).gsub(/\A\n+/m,'').insert(0,spaces_hang)
+ end
+ def line_wrap_indent1
+ @n_indent,@n_hang=2,2
+ line_wrap
+ end
+ def line_wrap_endnote
+ @n_indent,@n_hang=4,2
+ line_wrap
+ end
+ end
+#end
+#module SiSU_scan
+ class Header_scan
+ def initialize(md,para)
+ @regxcl=/<~\d+;\w\d+;\w\d+><(?:[0-9a-f]{32}|[0-9a-f]{64}):(?:[0-9a-f]{32}|[0-9a-f]{64})>/
+ para=para.gsub(@regxcl,'').dup
+ @md,@p=md,para
+ end
+ def extract(tag,tag_content,type,attrib)
+ dc=if dc_tag and dc_content
+ [dc_tag,dc_content,{dc_tag=>dc_content}]
+ else nil
+ end
+ end
+ def header(tag,tag_content,type='',attrib='') #this will break stuff and must be tested thoroughly 20060825
+ @tag,@tag_content,@type,@attrib=tag,tag_content,type,attrib
+ def label #element
+ @tag
+ end
+ def type
+ @type
+ end
+ def text
+ @tag_content
+ end
+ def info #element text
+ @tag_content
+ end
+ def attribute
+ @attrib
+ end
+ def element
+ @tag
+ end
+ def attrib
+ @attrib
+ end
+ def el
+ @tag
+ end
+ self
+ end
+ def start_is_zero
+ meta=case @p
+ when /^0~(title)\s+(.+?)$/; header($1,@md.dc_title,'meta','dc') #dc 1
+ #when /^0~(subtitle)\s+(.+?)$/; header($1,$2)
+ when /^0~(creator|author)\s+(.+?)$/; header('creator',$2,'meta','dc') #dc 2
+ when /^0~(subject)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 3
+ when /^0~(description)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 4
+ when /^0~(publisher)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 5
+ when /^0~(contributor)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 6
+ when /^0~(date)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 7
+ when /^0~(date\.created)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(date\.issued)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(date\.available)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(date\.valid)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(date\.modified)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(type)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 8
+ when /^0~(format)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 9
+ when /^0~(identifier)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 10
+ when /^0~(source)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 11
+ when /^0~(language)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 12
+ when /^0~(relation)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 13
+ when /^0~(coverage)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 14
+ when /^0~(rights)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 15
+ when /^0~(keywords)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(copyright)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(translator|translated_by)\s+(.+?)$/; header('translator',$2,'meta','extra')
+ when /^0~(illustrator|illustrated_by)\s+(.+?)$/; header('illustrator',$2,'meta','extra')
+ when /^0~(prepared_by)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(digitized_by)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(comments?)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(abstract)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(tags?)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(catalogue)\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^0~(class(?:ify)?_loc)\s+(.+?)$/; header('classify_loc',$2,'meta','extra')
+ when /^0~(class(?:ify)?_dewey)\s+(.+?)$/; header('classify_dewey',$2,'meta','extra')
+ when /^0~(class(?:ify)?_pg)\s+(.+?)$/; header('classify_pg',$2,'meta','extra')
+ when /^0~(class(?:ify)?_isbn)\s+(.+?)$/; header('classify_isbn',$2,'meta','extra')
+ when /^0~(toc|structure)\s+(.+?)$/; header('structure',$2,'meta','extra')
+ when /^0~(toc|structure)\s+(.+?)$/; header('structure',$2,'proc','instruct')
+ when /^0~(level|page|markup)\s+(.+?)$/; header('markup',$2,'process','instruct')
+ when /^0~(bold)\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^0~(italics|itali[sz]e)\s+(.+?)$/; header('italicize',$2,'process','instruct')
+ when /^0~(vocabulary|wordlist)\s+(.+?)$/; header('vocabulary',$2,'process','instruct')
+ when /^0~(skin)\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^0~(css|stylesheet)\s+(.+?)$/; header('css',$2,'process','instruct')
+ when /^0~(links)\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^0~(prefix)\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^0~(suffix)\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^0~(information)\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^0~(contact)\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^0~(rcs|cvs)\s+(.+?)$/; header('version',$2,'process','instruct')
+ else nil
+ end
+ end
+ def start_is_at
+ meta=case @p
+ when /^@(title):\s+(.+?)$/; header($1,@md.dc_title,'meta','dc') #dc 1
+ #when /^@(subtitle):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(creator|author):\s+(.+?)$/; header('creator',$2,'meta','dc') #dc 2
+ when /^@(subject):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 3
+ when /^@(description):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 4
+ when /^@(publisher):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 5
+ when /^@(contributor):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 6
+ when /^@(date):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 7
+ when /^@(date\.created):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(date\.issued):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(date\.available):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(date\.valid):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(date\.modified):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(type):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 8
+ when /^@(format):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 9
+ when /^@(identifier):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 10
+ when /^@(source):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 11
+ when /^@(language):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 12
+ when /^@(relation):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 13
+ when /^@(coverage):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 14
+ when /^@(rights):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 15
+ when /^@(keywords):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(copyright):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(translator|translated_by):\s+(.+?)$/; header('translator',$2)
+ when /^@(illustrator|illustrated_by):\s+(.+?)$/; header('illustrator',$2)
+ when /^@(prepared_by):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(digitized_by):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(comments?):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(abstract):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(tags?):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(catalogue):\s+(.+?)$/; header($1,$2,'meta','extra')
+ when /^@(class(?:ify)?_loc):\s+(.+?)$/; header('classify_loc',$2,'meta','extra')
+ when /^@(class(?:ify)?_dewey):\s+(.+?)$/; header('classify_dewey',$2,'meta','extra')
+ when /^@(class(?:ify)?_pg):\s+(.+?)$/; header('classify_pg',$2,'meta','extra')
+ when /^@(class(?:ify)?_isbn):\s+(.+?)$/; header('classify_isbn',$2,'meta','extra')
+ when /^@(toc|structure):\s+(.+?)$/; header('structure',$2,'process','instruct')
+ when /^@(level|page|markup):\s+(.+?)$/; header('markup',$2,'process','instruct')
+ when /^@(bold):\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^@(italics|itali[sz]e):\s+(.+?)$/; header('italicize',$2,'process','instruct')
+ when /^@(vocabulary|wordlist):\s+(.+?)$/; header('vocabulary',$2,'process','instruct')
+ when /^@(skin):\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^@(css|stylesheet):\s+(.+?)$/; header('css',$2,'process','instruct')
+ when /^@(links):\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^@(prefix):\s+(.+?)$/; header($1,$2,'process','instruct') #add a & b
+ when /^@(suffix):\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^@(information):\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^@(contact):\s+(.+?)$/; header($1,$2,'process','instruct')
+ when /^@(rcs|cvs):\s+(.+?)$/; header('version',$2,'process','instruct')
+ else nil
+ end
+ end
+ def dublin
+ out=if @p =~/^0~\S+\s/; start_is_zero
+ elsif @p =~/^@\S+:[+-]?\s/; start_is_at
+ else nil
+ end
+ end
+ def meta
+ out=if @p =~/^0~\S+\s/; start_is_zero
+ elsif @p =~/^@\S+:[+-]?\s/; start_is_at
+ else nil
+ end
+ end
+ end
+end
+module SiSU_text_parts_flatfile
+ class Split_text_object
+ @@dl=nil
+ attr_reader :format,:text,:ocn,:lev_para_ocn
+ def initialize(md,para)
+ @md,@para=md,para
+ @format,@ocn='null','null'
+ #@format,@ocn=nil,nil
+ @@dl ||=SiSU_Env::Info_env.new.digest.length
+ end
+ def lev_segname_para_ocn
+ if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>.*/
+ if /^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)
+ @format,segname,@text,@ocn=$1,$2,$3,$4
+ @format="#@format~#{segname}" #
+ elsif /^([1-6]~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)
+ @format,@text,@ocn=$1,$2,$3 #,$4
+ elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)
+ @format,@text,@ocn=$1,$2,$3
+ elsif /^([1-6])~(\S+)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)
+ @@alt_id_count+=1
+ @format,segname,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}"
+ @format="#@format~#{segname}" #
+ elsif /^([1-6]~)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)
+ @@alt_id_count+=1
+ @format,@text,@ocn=$1,$2,"x#{@@alt_id_count}"
+ end
+ else
+ if /(.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)
+ @text,@ocn=$1,$2
+ end
+ if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>|^$/ #added 2002w06
+ @text=/(.+?)/m.match(@para)[1]
+ end
+ if /^(\d)~\S*\s+(.+)/m.match(@para)
+ @format,@text=$1,$2
+ end
+ end
+ @lev_para_ocn=if @para =~/.+<~\d+>/ #hmmm, watch
+ Format::ParaSiSU.new(@md,@format,@text,@ocn)
+ else Format::ParaSiSU.new(@md,@format,@text,'<~0>')
+ end
+ self
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/shared_xml.rb b/lib/sisu/0.52/shared_xml.rb
new file mode 100644
index 00000000..a3b4b07f
--- /dev/null
+++ b/lib/sisu/0.52/shared_xml.rb
@@ -0,0 +1,580 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: common file for xml generation
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_text_parts
+ class Split_text_object
+ require SiSU_lib + '/param'
+ require SiSU_lib + '/xml_format'
+ include SiSU_Viz
+ include SiSU_XML_format
+ @@alt_id_count=0
+ @@dp=nil
+ attr_reader :format,:text,:ocn,:lev_para_ocn
+ def initialize(md,para)
+ @md,@para=md,para
+ @format,@ocn='null','null'
+ #@format,@ocn=nil,nil
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def lev_segname_para_ocn #using shared_txt instead, watch #% watch closely
+ if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if /^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,segname,@text,@ocn=$1,$2,$3,$4
+ @format="#@format~#{segname}" #
+ elsif /^([1-6]~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@text,@ocn=$1,$2,$3 #,$4
+ elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@text,@ocn=$1,$2,$3
+ elsif /^([1-6])~(\S+)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,segname,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}"
+ @format="#@format~#{segname}" #
+ elsif /^([1-6]~)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,@text,@ocn=$1,$2,"x#{@@alt_id_count}"
+ end
+ else
+ if /(.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @text,@ocn=$1,$2
+ end
+ if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06
+ @text=/(.+?)/m.match(@para)[1]
+ end
+ if /^(\d)~\S*\s+(.+)/m.match(@para)
+ @format,@text=$1,$2
+ end
+ end
+ @lev_para_ocn=if @para =~/.+<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ SiSU_XML_format::Format_scroll.new(@md,@format,@text,@ocn)
+ else
+ SiSU_XML_format::Format_scroll.new(@md,@format,@text,"<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>")
+ end
+ self
+ end
+ def lev_segname_para
+ if @para =~/^(\d~|<:.+?>).+/
+ if /^([1-6])~(\S+)\s+(\S.+)/m.match(@para)
+ @format,segname,@text=$1,$2,$3
+ @format="#@format~#{segname}" #
+ elsif /^([1-6]~)\s+(\S.+)/m.match(@para)
+ @format,@text=$1,$2
+ elsif /<:(.+?)>\s*(\S.+?)/m.match(@para)
+ @format,@text=$1,$2
+ elsif /^([1-6])~(\S+)\s+(\S.+?)/m.match(@para)
+ @@alt_id_count+=1
+ @format,segname,@text=$1,$2,$3
+ @format="#@format~#{segname}" #
+ elsif /^([1-6]~)\s+(\S.+?)/m.match(@para)
+ @@alt_id_count+=1
+ @format,@text=$1,$2
+ end
+ else
+ if /(.+?)/m.match(@para)
+ @text=$1
+ end
+ if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06
+ @text=/(.+?)/m.match(@para)[1]
+ end
+ if /^(\d)~\S*\s+(.+)/m.match(@para)
+ @format,@text=$1,$2
+ end
+ end
+ @lev_para_ocn=if @para =~/.+<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ SiSU_XML_format::Format_scroll.new(@md,@format,@text,@ocn)
+ else
+ SiSU_XML_format::Format_scroll.new(@md,@format,@text,"<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>")
+ end
+ self
+ end
+ end
+end
+module SiSU_XML_munge
+ class Trans
+ def initialize(md)
+ @sys=SiSU_Env::System_call.new
+ @dir=SiSU_Env::Info_env.new(md.fns)
+ @dp=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def char_enc #character encode
+ def utf8(para='')
+ if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn
+ #¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûü
+ #¢£¥§©ª«®°±²³µ¶¹º»¼½¾×÷
+ ##para.gsub!(//, '&#;')
+ ##para.gsub!(//, '&;')
+ para.gsub!(/¢/, '&#162;') # '&cent;' # &#162;
+ para.gsub!(/£/, '&#163;') # '&pound;' # &#163;
+ para.gsub!(/¥/, '&#165;') # '&yen;' # &#165;
+ para.gsub!(/§/, '&#167;') # '&sect;' # &#167;
+ para.gsub!(/©/, '&#169;') # '&copy;' # &#169;
+ para.gsub!(/ª/, '&#170;') # '&ordf;' # &#170;
+ para.gsub!(/«/, '&#171;') # '&laquo;' # &#171;
+ para.gsub!(/®/, '&#174;') # '&reg;' # &#174;
+ para.gsub!(/°/, '&#176;') # '&deg;' # &#176;
+ para.gsub!(/±/, '&#177;') # '&plusmn;' # &#177;
+ para.gsub!(/²/, '&#178;') # '&sup2;' # &#178;
+ para.gsub!(/³/, '&#179;') # '&sup3;' # &#179;
+ para.gsub!(/µ/, '&#181;') # '&micro;' # &#181;
+ para.gsub!(/¶/, '&#182;') # '&para;' # &#182;
+ para.gsub!(/¹/, '&#185;') # '&sup1;' # &#185;
+ para.gsub!(/º/, '&#186;') # '&ordm;' # &#186;
+ para.gsub!(/»/, '&#187;') # '&raquo;' # &#187;
+ para.gsub!(/¼/, '&#188;') # '&frac14;' # &#188;
+ para.gsub!(/½/, '&#189;') # '&frac12;' # &#189;
+ para.gsub!(/¾/, '&#190;') # '&frac34;' # &#190;
+ para.gsub!(/×/, '&#215;') # '&times;' # &#215;
+ para.gsub!(/÷/, '&#247;') # '&divide;' # &#247;
+ para.gsub!(/¿/, '&#191;') # '&iquest;' # &#191;
+ para.gsub!(/À/, '&#192;') # '&Agrave;' # &#192;
+ para.gsub!(/Á/, '&#193;') # '&Aacute;' # &#193;
+ para.gsub!(/Â/, '&#194;') # '&Acirc;' # &#194;
+ para.gsub!(/Ã/, '&#195;') # '&Atilde;' # &#195;
+ para.gsub!(/Ä/, '&#196;') # '&Auml;' # &#196;
+ para.gsub!(/Å/, '&#197;') # '&Aring;' # &#197;
+ para.gsub!(/Æ/, '&#198;') # '&AElig;' # &#198;
+ para.gsub!(/Ç/, '&#199;') # '&Ccedil;' # &#199;
+ para.gsub!(/È/, '&#200;') # '&Egrave;' # &#200;
+ para.gsub!(/É/, '&#201;') # '&Eacute;' # &#201;
+ para.gsub!(/Ê/, '&#202;') # '&Ecirc;' # &#202;
+ para.gsub!(/Ë/, '&#203;') # '&Euml;' # &#203;
+ para.gsub!(/Ì/, '&#204;') # '&Igrave;' # &#204;
+ para.gsub!(/Í/, '&#205;') # '&Iacute;' # &#205;
+ para.gsub!(/Î/, '&#206;') # '&Icirc;' # &#206;
+ para.gsub!(/Ï/, '&#207;') # '&Iuml;' # &#207;
+ para.gsub!(/Ð/, '&#208;') # '&ETH;' # &#208;
+ para.gsub!(/Ñ/, '&#209;') # '&Ntilde;' # &#209;
+ para.gsub!(/Ò/, '&#210;') # '&Ograve;' # &#210;
+ para.gsub!(/Ó/, '&#211;') # '&Oacute;' # &#211;
+ para.gsub!(/Ô/, '&#212;') # '&Ocirc;' # &#212;
+ para.gsub!(/Õ/, '&#213;') # '&Otilde;' # &#213;
+ para.gsub!(/Ö/, '&#214;') # '&Ouml;' # &#214;
+ para.gsub!(/Ø/, '&#216;') # '&Oslash;' # &#216;
+ para.gsub!(/Ù/, '&#217;') # '&Ugrave;' # &#217;
+ para.gsub!(/Ú/, '&#218;') # '&Uacute;' # &#218;
+ para.gsub!(/Û/, '&#219;') # '&Ucirc;' # &#219;
+ para.gsub!(/Ü/, '&#220;') # '&Uuml;' # &#220;
+ para.gsub!(/Ý/, '&#221;') # '&Yacute;' # &#221;
+ para.gsub!(/Þ/, '&#222;') # '&THORN;' # &#222;
+ para.gsub!(/ß/, '&#223;') # '&szlig;' # &#223;
+ para.gsub!(/à/, '&#224;') # '&agrave;' # &#224;
+ para.gsub!(/á/, '&#225;') # '&aacute;' # &#225;
+ para.gsub!(/â/, '&#226;') # '&acirc;' # &#226;
+ para.gsub!(/ã/, '&#227;') # '&atilde;' # &#227;
+ para.gsub!(/ä/, '&#228;') # '&auml;' # &#228;
+ para.gsub!(/å/, '&#229;') # '&aring;' # &#229;
+ para.gsub!(/æ/, '&#230;') # '&aelig;' # &#230;
+ para.gsub!(/ç/, '&#231;') # '&ccedil;' # &#231;
+ para.gsub!(/è/, '&#232;') # '&egrave;' # &#232;
+ para.gsub!(/é/, '&#233;') # '&acute;' # &#233;
+ para.gsub!(/ê/, '&#234;') # '&circ;' # &#234;
+ para.gsub!(/ë/, '&#235;') # '&euml;' # &#235;
+ para.gsub!(/ì/, '&#236;') # '&igrave;' # &#236;
+ para.gsub!(/í/, '&#237;') # '&acute;' # &#237;
+ para.gsub!(/î/, '&#238;') # '&icirc;' # &#238;
+ para.gsub!(/ï/, '&#239;') # '&iuml;' # &#239;
+ para.gsub!(/ð/, '&#240;') # '&eth;' # &#240;
+ para.gsub!(/ñ/, '&#241;') # '&ntilde;' # &#241;
+ para.gsub!(/ò/, '&#242;') # '&ograve;' # &#242;
+ para.gsub!(/ó/, '&#243;') # '&oacute;' # &#243;
+ para.gsub!(/ô/, '&#244;') # '&ocirc;' # &#244;
+ para.gsub!(/õ/, '&#245;') # '&otilde;' # &#245;
+ para.gsub!(/ö/, '&#246;') # '&ouml;' # &#246;
+ para.gsub!(/ø/, '&#248;') # '&oslash;' # &#248;
+ para.gsub!(/ù/, '&#250;') # '&ugrave;' # &#250;
+ para.gsub!(/ú/, '&#251;') # '&uacute;' # &#251;
+ para.gsub!(/û/, '&#252;') # '&ucirc;' # &#252;
+ para.gsub!(/ü/, '&#253;') # '&uuml;' # &#253;
+ para.gsub!(/þ/, '&#254;') # '&thorn;' # &#254;
+ para.gsub!(/ÿ/, '&#255;') # '&yuml;' # &#255;
+ end
+ end
+ def html(para='')
+ if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn
+ para.gsub!(/¢/, '&cent;') # &#162;
+ para.gsub!(/£/, '&pound;') # &#163;
+ para.gsub!(/¥/, '&yen;') # &#165;
+ para.gsub!(/§/, '&sect;') # &#167;
+ para.gsub!(/©/, '&copy;') # &#169;
+ para.gsub!(/ª/, '&ordf;') # &#170;
+ para.gsub!(/«/, '&laquo;') # &#171;
+ para.gsub!(/®/, '&reg;') # &#174;
+ para.gsub!(/°/, '&deg;') # &#176;
+ para.gsub!(/±/, '&plusmn;') # &#177;
+ para.gsub!(/²/, '&sup2;') # &#178;
+ para.gsub!(/³/, '&sup3;') # &#179;
+ para.gsub!(/µ/, '&micro;') # &#181;
+ para.gsub!(/¶/, '&para;') # &#182;
+ para.gsub!(/¹/, '&sup1;') # &#185;
+ para.gsub!(/º/, '&ordm;') # &#186;
+ para.gsub!(/»/, '&raquo;') # &#187;
+ para.gsub!(/¼/, '&frac14;') # &#188;
+ para.gsub!(/½/, '&frac12;') # &#189;
+ para.gsub!(/¾/, '&frac34;') # &#190;
+ para.gsub!(/×/, '&times;') # &#215;
+ para.gsub!(/÷/, '&divide;') # &#247;
+ para.gsub!(/¿/, '&iquest;') # &#191;
+ para.gsub!(/À/, '&Agrave;') # &#192;
+ para.gsub!(/Á/, '&Aacute;') # &#193;
+ para.gsub!(/Â/, '&Acirc;') # &#194;
+ para.gsub!(/Ã/, '&Atilde;') # &#195;
+ para.gsub!(/Ä/, '&Auml;') # &#196;
+ para.gsub!(/Å/, '&Aring;') # &#197;
+ para.gsub!(/Æ/, '&AElig;') # &#198;
+ para.gsub!(/Ç/, '&Ccedil;') # &#199;
+ para.gsub!(/È/, '&Egrave;') # &#200;
+ para.gsub!(/É/, '&Eacute;') # &#201;
+ para.gsub!(/Ê/, '&Ecirc;') # &#202;
+ para.gsub!(/Ë/, '&Euml;') # &#203;
+ para.gsub!(/Ì/, '&Igrave;') # &#204;
+ para.gsub!(/Í/, '&Iacute;') # &#205;
+ para.gsub!(/Î/, '&Icirc;') # &#206;
+ para.gsub!(/Ï/, '&Iuml;') # &#207;
+ para.gsub!(/Ð/, '&ETH;') # &#208;
+ para.gsub!(/Ñ/, '&Ntilde;') # &#209;
+ para.gsub!(/Ò/, '&Ograve;') # &#210;
+ para.gsub!(/Ó/, '&Oacute;') # &#211;
+ para.gsub!(/Ô/, '&Ocirc;') # &#212;
+ para.gsub!(/Õ/, '&Otilde;') # &#213;
+ para.gsub!(/Ö/, '&Ouml;') # &#214;
+ para.gsub!(/Ø/, '&Oslash;') # &#216;
+ para.gsub!(/Ù/, '&Ugrave;') # &#217;
+ para.gsub!(/Ú/, '&Uacute;') # &#218;
+ para.gsub!(/Û/, '&Ucirc;') # &#219;
+ para.gsub!(/Ü/, '&Uuml;') # &#220;
+ para.gsub!(/Ý/, '&Yacute;') # &#221;
+ para.gsub!(/Þ/, '&THORN;') # &#222;
+ para.gsub!(/ß/, '&szlig;') # &#223;
+ para.gsub!(/à/, '&agrave;') # &#224;
+ para.gsub!(/á/, '&aacute;') # &#225;
+ para.gsub!(/â/, '&acirc;') # &#226;
+ para.gsub!(/ã/, '&atilde;') # &#227;
+ para.gsub!(/ä/, '&auml;') # &#228;
+ para.gsub!(/å/, '&aring;') # &#229;
+ para.gsub!(/æ/, '&aelig;') # &#230;
+ para.gsub!(/ç/, '&ccedil;') # &#231;
+ para.gsub!(/è/, '&egrave;') # &#232;
+ para.gsub!(/é/, '&acute;') # &#233;
+ para.gsub!(/ê/, '&circ;') # &#234;
+ para.gsub!(/ë/, '&euml;') # &#235;
+ para.gsub!(/ì/, '&igrave;') # &#236;
+ para.gsub!(/í/, '&acute;') # &#237;
+ para.gsub!(/î/, '&icirc;') # &#238;
+ para.gsub!(/ï/, '&iuml;') # &#239;
+ para.gsub!(/ð/, '&eth;') # &#240;
+ para.gsub!(/ñ/, '&ntilde;') # &#241;
+ para.gsub!(/ò/, '&ograve;') # &#242;
+ para.gsub!(/ó/, '&oacute;') # &#243;
+ para.gsub!(/ô/, '&ocirc;') # &#244;
+ para.gsub!(/õ/, '&otilde;') # &#245;
+ para.gsub!(/ö/, '&ouml;') # &#246;
+ para.gsub!(/ø/, '&oslash;') # &#248;
+ para.gsub!(/ù/, '&ugrave;') # &#250;
+ para.gsub!(/ú/, '&uacute;') # &#251;
+ para.gsub!(/û/, '&ucirc;') # &#252;
+ para.gsub!(/ü/, '&uuml;') # &#253;
+ para.gsub!(/þ/, '&thorn;') # &#254;
+ para.gsub!(/ÿ/, '&yuml;') # &#255;
+ end
+ end
+ self
+ end
+ def tidywords(wordlist)
+ wordlist.each do |x|
+ x.gsub!(/&/,'&amp;') unless x =~/&\S+;/
+ end
+ end
+ def markup(para='')
+ wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
+ para=tidywords(wordlist).join(' ').strip
+ para.gsub!(/(^|\s+)<\s+/,'\1&lt; ')
+ para.gsub!(/\s+>(\s+|$)/,' &gt;\1')
+ para.gsub!(/<:pb>\s*/,'')
+ para.gsub!(/<+[-~]#>+/,'')
+ para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'')
+ para.gsub!(/^(<:i[12]>\s*)_\*\s+/,'\1 <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="/usr/share/sisu/image/bullet_red.png" width="12" height="12" alt="*" /> ')
+ para.gsub!(/^_\*\s+/,'<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="/usr/share/sisu/image/bullet_red.png" width="12" height="12" alt="*" /> ')
+ para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))\s+(\d+)x(\d+)(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\2" width="\\3" height="\\4" />[\\2] \\5})
+ para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\2"/>\\2})
+ para.gsub!(/(^|\s)\{([^}]+)\}(https?:\/\/[^"><]+?)([,.:;"><]?(?:\s|$))/,'\1<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\3">\2</link>\4')
+ para.gsub!(/(^|\s)(https?:\/\/[^"><]+?)([,.:;"><]?(?:\s|$))/,'\1<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\2">\2</link>\3')
+ para.gsub!(/&nbsp;/,' ') #clean
+ para
+ end
+ def markup_light(para='')
+ para.gsub!(/\/\{(.+?)\}\//,'<i>\1</i>')
+ para.gsub!(/[*!]\{(.+?)\}[*!]/,'<b>\1</b>')
+ para.gsub!(/_\{(.+?)\}_/,'<u>\1</u>')
+ para.gsub!(/-\{(.+?)\}-/,'<del>\1</del>')
+ para.gsub!(/<br(\s*\/)?>/,'<br />')
+ para.gsub!(/<:pb>\s*/,'')
+ para.gsub!(/<[-~]#>/,'')
+ para.gsub!(/(^|\s)&\s+/,'\1&amp; ') #sort
+ para.gsub!(/&([^;]{1,5})/,'&amp;\1') #sort, rough estimate, revisit #WATCH found in node not sax
+ para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,
+ "<image.path>#{@dir.url.images_local}\/\\1</image.path>")
+ para.gsub!(/&nbsp;/,' ')
+ wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
+ para=tidywords(wordlist).join(' ').strip
+ para
+ end
+ def markup_group(para='')
+ para.gsub!(/</,'&lt;')
+ para.gsub!(/>/,'&gt;')
+ para.gsub!(/&lt;br(?:\s+\/)?&gt;/,'<br />')
+ para
+ end
+ end
+end
+module SiSU_XML_tags #Format
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ class RDF
+ def initialize(md='',seg_name=[],tracker=0)
+ @dc_title=@dc_subtitle=@dc_creator=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_date_created=@dc_date_issued=@dc_date_available=@dc_date_valid=@dc_date_modified=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@dc_relation=@dc_coverage=@dc_rights=@copyright=@owner=@keywords=''
+ #seg_name=%{#{@@seg_name[@@tracker]} - } if @@seg_name[@@tracker]
+ @md=md
+ @sfx,@pdf=@md.sfx,@md.pdf
+ @rdfurl=%{ rdf:about="http://www.jus.uio.no/lm/toc"\n}
+ if @md.dc_title # DublinCore 1 - title
+ @rdf_title=%{ dc.title="#{seg_name}#{@md.dc_title}"\n}
+ @dc_title=%{ <meta name="dc.title" content="#{seg_name}#{@md.dc_title}" />\n}
+ #if @md.subtitle
+ # @rdf_title=%{ dc.title="#{seg_name}#{@md.title} - #{@md.subtitle}"\n}
+ # @title=%{<meta name="dc.title" } +
+ # %{content="#{seg_name}#{@md.title} - #{@md.subtitle}" />\n}
+ #else
+ # @rdf_title=%{ dc.title="#{seg_name}#{@md.title}"\n}
+ # @title=%{<meta name="dc.title" } +
+ # %{content="#{seg_name}#{@md.title}" />\n}
+ #end
+ end
+ if @md.dc_creator # DublinCore 2 - creator/author (author)
+ @rdf_creator=%{ dc.creator="#{@md.dc_creator}"\n}
+ content=meta_content_clean(@md.dc_creator)
+ @dc_creator=%{ <meta name="dc.creator" content="#{content}" />\n}
+ end
+ if @md.dc_subject # DublinCore 3 - subject (us library of congress, eric or udc, or schema???)
+ @rdf_subject=%{ dc.subject="#{@md.dc_subject}"\n}
+ content=meta_content_clean(@md.dc_subject)
+ @dc_subject=%{ <meta name="dc.subject" content="#{content}" />\n}
+ end
+ if @md.dc_description # DublinCore 4 - description
+ @rdf_description=%{ dc.description="#{@md.dc_description}"\n}
+ content=meta_content_clean(@md.dc_description)
+ @dc_description=%{ <meta name="dc.description" content="#{content}" />\n}
+ end
+ if @md.dc_publisher # DublinCore 5 - publisher (current copy published by)
+ @rdf_publisher=%{ dc.publisher="#{@md.dc_publisher}"\n}
+ content=meta_content_clean(@md.dc_publisher)
+ @dc_publisher=%{ <meta name="dc.publisher" content="#{content}" />\n}
+ end
+ if @md.dc_contributor # DublinCore 6 - contributor
+ @rdf_contributor=%{ dc.contributor="#{@md.dc_contributor}"\n}
+ content=meta_content_clean(@md.dc_contributor)
+ @dc_contributor=%{ <meta name="dc.contributor" content="#{content}" />\n}
+ end
+ if @md.dc_date # DublinCore 7 - date year-mm-dd
+ @rdf_date=%{ dc.date="#{@md.dc_date}"\n}
+ @dc_date=%{ <meta name="dc.date" content="#{@md.dc_date}" #{@md.date_scheme} />\n}
+ end
+ if @md.dc_date_created # DublinCore 7 - date.created year-mm-dd
+ @rdf_date_created=%{ dc.date.created="#{@md.dc_date_created}"\n}
+ @dc_date_created=%{ <meta name="dc.date.created" content="#{@md.dc_date_created}" #{@md.date_created_scheme} />\n}
+ end
+ if @md.dc_date_issued # DublinCore 7 - date.issued year-mm-dd
+ @rdf_date_issued=%{ dc.date.issued="#{@md.dc_date_issued}"\n}
+ @dc_date_issued=%{ <meta name="dc.date.issued" content="#{@md.dc_date_issued}" #{@md.date_issued_scheme} />\n}
+ end
+ if @md.dc_date_available # DublinCore 7 - date.available year-mm-dd
+ @rdf_date_available=%{ dc.date.available="#{@md.dc_date_available}"\n}
+ @dc_date_available=%{ <meta name="dc.date.available" content="#{@md.dc_date_available}" #{@md.date_available_scheme} />\n}
+ end
+ if @md.dc_date_valid # DublinCore 7 - date.valid year-mm-dd
+ @rdf_date_valid=%{ dc.date.valid="#{@md.dc_date_valid}"\n}
+ @dc_date_valid=%{ <meta name="dc.date.valid" content="#{@md.dc_date_valid}" #{@md.date_valid_scheme} />\n}
+ end
+ if @md.dc_date_modified # DublinCore 7 - date.modified year-mm-dd
+ @rdf_date_modified=%{ dc.date.modified="#{@md.dc_date_modified}"\n}
+ @dc_date_modified=%{ <meta name="dc.date.modified" content="#{@md.dc_date_modified}" #{@md.date_modified_scheme} />\n}
+ end
+ if @md.dc_type # DublinCore 8 - type (genre eg. report, convention etc)
+ @rdf_type=%{ dc.type="#{@md.dc_type}"\n}
+ content=meta_content_clean(@md.dc_type)
+ @dc_type=%{ <meta name="dc.type" content="#{content}" />\n}
+ end
+ if @md.dc_format # DublinCore 9 - format (use your mime type)
+ @rdf_format=%{ dc.format="#{@md.dc_format}"\n}
+ content=meta_content_clean(@md.dc_format)
+ @dc_format=%{ <meta name="dc.format" content="#{content}" />\n}
+ end
+ if @md.dc_identifier # DublinCore 10 - identifier (your identifier, could use urn which is free)
+ @rdf_identifier=%{ dc.identifier="#{@md.dc_identifier}"\n}
+ content=meta_content_clean(@md.dc_identifier)
+ @dc_identifier=%{ <meta name="dc.identifier" content="#{content}" />\n}
+ end
+ if @md.dc_source # DublinCore 11 - source (document source)
+ @rdf_source=%{ dc.source="#{@md.dc_source}"\n}
+ content=meta_content_clean(@md.dc_source)
+ @dc_source=%{ <meta name="dc.source" content="#{content}" />\n}
+ end
+ if @md.dc_language[:name] # DublinCore 12 - language (English)
+ @rdf_language=%{ dc.language="#{@md.dc_language[:name]}"\n}
+ @dc_language=%{ <meta name="dc.language" content="#{@md.dc_language[:name]}" />\n}
+ end
+ if @md.language_original[:name]
+ @rdf_language_original=%{ dc.language="#{@md.language_original[:name]}"\n}
+ @language_original=%{ <meta name="dc.language" content="#{@md.language_original[:name]}" />\n}
+ end
+ if @md.dc_relation # DublinCore 13 - relation
+ @rdf_relation=%{ dc.relation="#{@md.dc_relation}"\n}
+ content=meta_content_clean(@md.dc_relation)
+ @dc_relation=%{ <meta name="dc.relation" content="#{content}" />\n}
+ end
+ if @md.dc_coverage # DublinCore 14 - coverage
+ @rdf_coverage=%{ dc.coverage="#{@md.dc_coverage}"\n}
+ content=meta_content_clean(@md.dc_coverage)
+ @dc_coverage=%{ <meta name="dc.coverage" content="#{content}" />\n}
+ end
+ if @md.dc_rights # DublinCore 15 - rights
+ @rdf_rights=%{ dc.rights="#{@md.dc_rights}"\n}
+ content=meta_content_clean(@md.dc_rights)
+ @dc_rights=%{ <meta name="dc.rights" content="#{content}" />\n}
+ end
+ content=meta_content_clean(@md.keywords)
+ @keywords=%{ <meta name="keywords" content="#{content}" />\n} if @md.keywords
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def meta_content_clean(content='')
+ unless content.nil?
+ content.tr!('"',"'")
+ end
+ content
+ end
+ def rdftoc #tocHead #values strung together, because some empty, and resulting output (line breaks) is much better
+ #<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ # xmlns:dc="http://purl.org/dc/elements/1.1/">
+ # <rdf:Description rdf:about="http://www.jus.uio.no/lm/doc"
+ # dc:creator="Author"
+ # dc:title="Title"
+ # dc:description="Description if any"
+ # dc:date="Publication Date"
+ # />
+ #</rdf:RDF>
+ #Dublin Core
+#### XML only :-( KEEP
+#<<WOK
+#<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+# xmlns:dc="http://purl.org/dc/elements/1.1/">
+# <rdf:Description
+# #@rdfurl#@rdf_title#@rdf_subtitle#@rdf_creator#@rdf_subject#@rdf_description#@rdf_publisher#@rdf_contributor#@rdf_date#@rdf_dateCreated#@rdf_dateIssued#@rdf_dateAvailable#@rdf_dateValid#@rdf_dateModified#@rdf_type#@rdf_format#@rdf_identifier#@rdf_source#@rdf_language#@rdf_relation #@rdf_coverage#@rdf_rights
+# />\n
+#</rdf:RDF>\n
+#WOK
+ end
+ def rdfseg #segHead
+ rdftoc
+ end
+ def comment_xml(extra='')
+ generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version]
+ lastdone="Last Generated on: #{Time.now}"
+ rubyv="Ruby version: #{@md.ruby_version}"
+ sc=if @md.sc_info
+ "Source file: #{@md.sc_filename} version: #{@md.sc_number} of: #{@md.sc_date}"
+ else ''
+ end
+ if extra.empty?
+<<WOK
+<!-- Document processing information:
+ * #{generator}
+ * #{rubyv}
+ * #{sc}
+ * #{lastdone}
+ * SiSU http://www.jus.uio.no/sisu
+-->
+WOK
+ else
+<<WOK
+<!-- Document processing information:
+ * #{extra}
+ * #{generator}
+ * #{rubyv}
+ * #{sc}
+ * #{lastdone}
+ * SiSU http://www.jus.uio.no/sisu
+-->
+WOK
+ end
+ end
+ def comment_xml_sax
+ desc='SiSU XML, SAX type representation'
+ comment_xml(desc)
+ end
+ def comment_xml_node
+ desc='SiSU XML, Node type representation'
+ comment_xml(desc)
+ end
+ def comment_xml_dom
+ desc='SiSU XML, DOM type representation'
+ comment_xml(desc)
+ end
+ def metatag_html #values strung together, because some empty, and resulting output (line breaks) is much better
+#{@vz.js_head}
+<<WOK
+#@dc_title#@dc_subtitle#@dc_creator#@dc_subject#@dc_description#@dc_publisher#@dc_contributor#@dc_date#@dc_date_created#@dc_date_issued#@dc_date_available#@dc_date_valid#@dc_date_modified#@dc_type#@dc_format#@dc_identifier#@dc_source#@dc_language#@dc_relation#@dc_coverage#@dc_rights#@copyright#@owner
+#{@vz.txt_generator}
+#{@vz.png_ico}
+WOK
+ end
+ end
+end
+module SiSU_Tables
+ require SiSU_lib + '/xml_tables'
+end
+__END__
+
diff --git a/lib/sisu/0.52/sisupod_make.rb b/lib/sisu/0.52/sisupod_make.rb
new file mode 100644
index 00000000..21e35e64
--- /dev/null
+++ b/lib/sisu/0.52/sisupod_make.rb
@@ -0,0 +1,316 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: create sisupod filetype and copy it to output directory!
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Doc
+ require 'fileutils'
+ include SiSU_Env
+ class Source
+ include FileUtils #::Verbose
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/response'
+ def initialize(opt)
+ @opt=opt
+ m=/.+\/(\S+)/m
+ @date=SiSU_Env::Info_date.new.dt
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @ver=SiSU_Env::Info_version.new.get_version
+ @ans=SiSU_Response::Response.new
+ pod_path="#{@env.path.processing}/sisupod"
+ @v=if @opt.cmd =~/[VM]/; 'v'
+ else ''
+ end
+ File.mkpath(pod_path) unless FileTest.directory?(pod_path)
+ rm_rf("#{@env.path.processing}sisupod/*") if FileTest.directory?("#{@env.path.processing}sisupod")
+ end
+ def read
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (zip)',@opt.fns)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ unless @opt.fns.empty?
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns}.zip -> #{@env.path.output}/#{@opt.fnb}/sisupod.zip")
+ tell.warn unless @opt.cmd =~/q/
+ directories
+ sisupod_build
+ sisupod_zip
+ #sisupod_7zip
+ else
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make (zip) of sisu work directory',"#{@env.stub_pwd}\_#@date.zip")
+ tell.warn unless @opt.cmd =~/q/
+ tell.blue_tab unless @opt.cmd =~/q/
+ ans=@ans.response?('make sisupod of entire directory?')
+ if ans; sisupod_zip_directory
+ end
+ end
+ end
+ def sisupod_zip_directory
+ sisupod_directory="sisupod-#{@env.stub_pwd}-#@date.ssp" # "sisupod-#{@env.stub_pwd}-#@date.zip"
+ unless File.symlink?('sisupod'); File.symlink(Dir.pwd,'sisupod')
+ end
+ re_base_dir='^sisupod/([^.][^/]*\.(ssm|ssi|sst)$|_sisu/)'
+ re_files='/[a-zA-Z0-9.~_-]+\.(ssm|ssi|sst|rb|css|png|jpg|gif|yaml)$'
+ re_ignore='/[.~_-][^/]+$'
+ if File.symlink?('sisupod')
+ info="SiSU sisupod #{@ver[:version]} directory contents #{sisupod_directory}"
+ system(%{
+ echo "#{info}"
+ echo "#{info}" > sisu_zip.txt
+ zip -qz #{sisupod_directory} sisu_zip.txt < sisu_zip.txt
+ for I in `find -H sisupod -print | \
+ egrep "#{re_base_dir}" | \
+ egrep "#{re_files}" | \
+ egrep -v "#{re_ignore}" `
+ do zip #{sisupod_directory} $I
+ done
+ })
+ else puts "the required systemlink 'sisupod' could not be created on the current directory: remove the file or directory named 'sisupod' within #{Dir.pwd}"
+ end
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (tar gzip)',@opt.fns)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Zipped directory',sisupod_directory)
+ tell.warn unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new('',sisupod_directory)
+ tell.blue_tab unless @opt.cmd =~/q/
+ end
+ def directories
+ SiSU_Env::Info_env.new.sisupod
+ end
+ def select(skin='') # skin loading logic here
+ load SiSU_lib + '/defaults.rb'
+ @skin={}
+ skin_path = [
+ "#{@env.path.pwd}/_sisu/skin",
+ "#{@env.path.home}/.sisu/skin",
+ '/etc/sisu/skin',
+ "#{@env.path.processing}/external_document/skin"
+ ]
+ sk_doc,sk_dir="doc/#{skin}.rb","dir/skin_#{@env.stub_pwd}.rb"
+ skin_path.each do |v| #document skin priority 1
+ if FileTest.file?("#{v}/#{sk_doc}")
+ @skin[:name],@skin[:type]="#{v}/#{sk_doc}",'doc'
+ break
+ end
+ end
+ unless @skin.length > 0
+ skin_path.each do |v| #directory skin priority 2
+ if FileTest.file?("#{v}/#{sk_dir}")
+ @skin[:name],@skin[:type]="#{v}/#{sk_dir}",'dir'
+ break
+ end
+ end
+ end
+ @skin
+ end
+ def sisupod_build #see also sisupod in sysenv
+ @rgx_rb_image=/["'](\S+?\.(?:png|jpg|gif))["']/
+ @rgx_image=/\{\s*(\S+?\.(?:png|jpg|gif))/
+ @rgx_skin=/^(?:@skin:|0~skin)\s+(\S+)/
+ @rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/
+ file_array=IO.readlines(@opt.fns,'')
+ skin,images,doc_import=[],[],[]
+ #skin_dir=SiSU_Env::Info_skin.new.select
+ #skin << [skin_dir.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')]
+ file_array.each do |f| #% work area
+ if f !~/^%\s/
+ skin << f.scan(@rgx_skin).uniq.flatten if f =~@rgx_skin
+ images << f.scan(@rgx_image).uniq if f =~@rgx_image
+ elsif f =~/^%\s/ and @opt.fns =~/\._sst$/
+ doc_import << f.scan(@rgx_doc_import).uniq if f =~@rgx_doc_import
+ end
+ end
+ docskin=nil
+ if skin and skin.length > 0
+ docskin=skin.pop.flatten.join
+ skin_source=select(docskin)
+ else
+ skin_source=select
+ end
+ docskin_place="#{@env.path.processing}/sisupod/_sisu/skin/#{skin_source[:type]}"
+ if skin_source[:type] =~/dir/
+ docskin_with_path="#{docskin_place}/skin_#{@env.stub_pwd}.rb"
+ docskin=[docskin_with_path.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')]
+ docskin='skin_sisupod'
+ end
+ if skin_source and docskin
+ cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb")
+ #if skin_source[:type] =~/dir/
+ # File.symlink("#{docskin_place}/#{docskin}.rb","#{docskin_place}/skin_#{@env.stub_pwd}.rb")
+ #end
+ skinfile_array=IO.readlines(skin_source[:name],'')
+ para_images=[]
+ skinfile_array.each do |f| #% work area
+ unless f =~/^%+ / #hmmm
+ images << f.scan(@rgx_rb_image).uniq if f =~@rgx_rb_image #and FileTest.file?(f.scan(@rgx_rb_image).uniq)
+ #does not really discriminate, may duplicate images in sisu file, and may take images from default image pool
+ end
+ end
+ end
+ #1. mapping in doc dir?
+ #2. need images used by skin, scan skin??
+ if images and images.length > 1
+ images.flatten!.uniq!
+ image_path_pwd='_sisu/image'
+ path_pod_conf="#{@env.path.processing}/sisupod/_sisu"
+ images_path_pod="#{path_pod_conf}/image"
+ #unattractive hard coding ... !
+ images_pwd="#{@env.path.pwd}/#{image_path_pwd}"
+ ##sequence copies base images, defaults used in all html outputs
+ #image_source_base='/usr/share/sisu/image'
+ #dir_pwd=Dir.pwd
+ #Dir.chdir(image_source_base)
+ #base_images=Dir.glob('*')
+ #base_images.each do |i|
+ # cp_r(i,"#{images_path_pod}/#{i}")
+ #end
+ #Dir.chdir(dir_pwd)
+ if FileTest.directory?(image_path_pwd)
+ images=images.uniq
+ images.each do |i|
+ cp_r("#{images_pwd}/#{i}","#{images_path_pod}/#{i}") if FileTest.file?("#{images_pwd}/#{i}")
+ end
+ #chmod(0755, dir_images_www)
+ else puts "\tWARN, did not find - #{image_path_pod}"
+ end
+ end
+ x=@env.document_language_versions_found #check multiple document language versions (param not used)
+ if doc_import.flatten.length > 0 and @opt.fns =~/\._sst$/
+ doc_import.flatten.each do |f|
+ cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")
+ end
+ end
+ if x[:f] and x[:f].length > 1 #store multiple document language versions, sisupod
+ x[:f].each do |f|
+ cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")
+ end
+ elsif @opt.fns =~/\._sst/
+ ssm=@opt.fns.gsub(/\._sst/,'.ssm')
+ cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}")
+ else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}")
+ end #NB not all possibilies met, revisit, also in case of composite file may wish to add README
+ end
+ def sisupod_7zip #look at later
+ dir=SiSU_Env::Info_env.new(@opt.fns)
+ local_path="#{dir.path.output}/#{dir.fnb}"
+ File.mkpath(local_path) unless FileTest.directory?(local_path)
+ system(%{
+ cd #{@env.path.processing}
+ echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt
+ #7zip -qz #{@opt.fns}.7z sisu_zip.txt < sisu_zip.txt
+ 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@opt.fns}.7z sisu_zip.txt
+ 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@opt.fns}.7z sisupod
+ #7zip -qr #{@opt.fns}.7z sisupod
+ mv #{@opt.fns}.7z #{local_path}/sisupod.7z &
+ rm -r sisupod/* && cd #{@env.path.pwd}
+ })
+ tell=SiSU_Screen::Ansi.new('',"#{@opt.fns}.7z")
+ tell.blue_tab unless @opt.cmd =~/q/
+ end
+ def sisupod_zip
+ dir=SiSU_Env::Info_env.new(@opt.fns)
+ local_path="#{dir.path.output}/#{dir.fnb}"
+ File.mkpath(local_path) unless FileTest.directory?(local_path)
+ system(%{
+ cd #{@env.path.processing}
+ echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt
+ zip -qz #{@opt.fns}.zip sisu_zip.txt < sisu_zip.txt
+ zip -qr #{@opt.fns}.zip sisupod
+ mv #{@opt.fns}.zip #{local_path}/sisupod.zip &
+ rm -r sisupod/* && cd #{@env.path.pwd}
+ })
+ tell=SiSU_Screen::Ansi.new('',"#{@opt.fns}.zip")
+ tell.blue_tab unless @opt.cmd =~/q/
+ end
+ end
+end
+__END__
+question?: should you permit the packing of multiple files in single .gz ?
+
+ open @opt.fns, parse file
+ extract from file content:
+ images and copy each image from whatever image source to _sisu/sisupod/sisu/_sisu/image
+ skin and copy active skin from whatever source to _sisu/sisupod/sisu/_sisu/skin/doc
+ extract from skin images required by skin
+
+ remove previously existing contents of _/sisu/sisupod &
+ make directory structure:
+
+ _sisu
+ sisupod
+ sisu
+ content.sst [file content]
+ filename.sst [link to content.sst]
+ _sisu
+ conf
+ skin/
+ doc [relevant skin if any other than default]
+ image [all images for specific document gathered here]
+
+sisu
+ _sisu
+ sisurc.yml
+ skin/
+ dir/
+ doc/
+ misc/
+ site/
+ yaml/
+ convert/
+ standard_terms/
+ image
+ processing
+ dal/
+ tex/
+ texinfo/
+ tune/
+ sisupod
+
+special case
+
+composite file (master), e.g.
+SiSU.ssm
+
diff --git a/lib/sisu/0.52/sitemaps.rb b/lib/sisu/0.52/sitemaps.rb
new file mode 100644
index 00000000..71956b03
--- /dev/null
+++ b/lib/sisu/0.52/sitemaps.rb
@@ -0,0 +1,213 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: sitemap created from parameters extracted from input file(s)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Sitemaps
+ require SiSU_lib + '/param'
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/shared_xml'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_XML_munge
+ class Source
+ require 'fileutils'
+ include FileUtils
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ songsheet
+ end
+ def songsheet
+ begin
+ @sys=SiSU_Env::System_call.new
+ fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@opt.fns)
+ @fn=SiSU_Env::Env_call.new(@opt.fns).lang(fn_set_lang[:c])
+ if @opt.cmd =~/Y/
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @trans=SiSU_XML_munge::Trans.new(@md) #check @md is required
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @rdf=SiSU_XML_tags::RDF.new(@md)
+ @fnb_utf8_xml=@md.fnb.dup
+ @trans.char_enc.utf8(@fnb_utf8_xml) if @sys.locale =~/utf-?8/i #% utf8
+ output_map(sitemap)
+ elsif @opt.mod.inspect =~/--sitemaps/
+ @sitemap_idx_fn='sitemapindex.xml'
+ @env=SiSU_Env::Info_env.new
+ output_idx(sitemap_index)
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"sitemap index:","#{@env.path.output}/#@sitemap_idx_fn")
+ tell.result unless @opt.cmd =~/q/
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ def make_file(path,filename)
+ if File.writable?("#{path}/."); File.new("#{path}/#{filename}",'w+')
+ else
+ SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn
+ end
+ end
+ def make_path(path)
+ File.mkpath(path) unless FileTest.directory?(path)
+ end
+ def output_map(sitemap)
+ path="#{@env.path.output}/#{@md.fnb}"
+ filename=@fn[:sitemap]
+ touch_path=@env.path.sitemaps
+ touch_filename=@fn[:sitemap_touch]
+ SiSU_Env::SiSU_file.new(@md).make_path(path)
+ file=SiSU_Env::SiSU_file.new(@md).make_file(path,filename)
+ file << sitemap
+ if FileTest.file?("#{touch_path}/#{touch_filename}")
+ rm("#{touch_path}/#{touch_filename}")
+ end
+ SiSU_Env::SiSU_file.new(@md).touch_file(touch_path,touch_filename)
+ end
+ def output_idx(sitemap)
+ path=@env.path.output
+ filename=@sitemap_idx_fn
+ make_path(path)
+ file=make_file(path,filename)
+ file << sitemap
+ #cp("#{path}/#{filename}","#{@env.path.output}/#{filename}")
+ end
+ def sitemap_index
+ sitemap_files=Dir.glob("#{@env.path.sitemaps}/sitemap_*.xml")
+ sitemap_idx=[]
+ sitemap_idx <<<<WOK
+<?xml version="1.0" encoding="UTF-8"?>
+<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemaps/0.9
+ http://www.sitemaps.org/schemas/sitemaps/sitemap.xsd"
+ xmlns="http://www.sitemaps.org/schemas/sitemapindex/0.9">
+WOK
+ sitemap_files.each do |s|
+ f=s.gsub(/.+?\/sitemap_([^\/]+?)\.xml$/,'\1')
+ @trans.char_enc.utf8(f) if @sys.locale =~/utf-?8/i #% utf8
+sitemap_idx <<<<WOK
+ <sitemap>
+ <loc>#{@env.path.url.remote}/#{f}/sitemap.xml</loc>
+ </sitemap>
+WOK
+#<lastmod>1993-10-03T16:00:16+00:00</lastmod>
+ end
+ sitemap_idx <<<<WOK
+</sitemapindex>
+WOK
+ idx=sitemap_idx.join
+ end
+ def sitemap
+ map=if @md.dc_date_modified and @md.dc_date_modified=~/\d{4}-\d{2}-\d{2}/
+ sitemap_date_modified
+ else sitemap_no_date
+ end
+ end
+ def sitemap_date_modified
+<<WOK
+<?xml version='1.0' encoding='UTF-8'?>
+<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemaps/0.9
+ http://www.sitemaps.org/schemas/sitemaps/sitemap.xsd"
+ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+#{@rdf.comment_xml}
+ <url>
+ <loc>#{@env.path.url.remote}/#@fnb_utf8_xml/#{@fn[:toc]}</loc>
+ <lastmod>#{@md.dc_date_modified}</lastmod>
+ <changefreq>monthly</changefreq>
+ <priority>0.7</priority>
+ </url>
+ <url>
+ <loc>#{@env.path.url.remote}/#@fnb_utf8_xml/#{@fn[:doc]}</loc>
+ <lastmod>#{@md.dc_date_modified}</lastmod>
+ <priority>0.5</priority>
+ </url>
+ <url>
+ <loc>#{@env.path.url.remote}/#@fnb_utf8_xml/#{@fn[:manifest]}</loc>
+ <lastmod>#{@md.dc_date_modified}</lastmod>
+ <priority>0.5</priority>
+ </url>
+</urlset>
+WOK
+ end
+ def sitemap_no_date
+<<WOK
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+#{@rdf.comment_xml}
+ <url>
+ <loc>#{@env.path.url.remote}/#@fnb_utf8_xml/#{@fn[:toc]}</loc>
+ <changefreq>monthly</changefreq>
+ <priority>0.7</priority>
+ </url>
+ <url>
+ <loc>#{@env.path.url.remote}/#@fnb_utf8_xml/#{@fn[:doc]}</loc>
+ <priority>0.5</priority>
+ </url>
+ <url>
+ <loc>#{@env.path.url.remote}/#@fnb_utf8_xml/#{@fn[:manifest]}</loc>
+ <priority>0.5</priority>
+ </url>
+</urlset>
+WOK
+ end
+ end
+end
+__END__
+* sanitize xml, pass through filter to ensure is valid - done but needs testing
+* remote placement of sitemaps --sitemaps -R (probably makes more sense than doing against -Y [filename/wildcard]) - done but needs testing
+* gzip sitemaps - not before testing / after testing
+* issue with master documnts, naming and mapping, check multilingual
+
+<!-- Document processing information:
+ * Generated by: SiSU 0.48.6 of 2006w45/6 (20061111)
+ * Ruby version: ruby 1.8.5 (2006-08-25) [i486-linux]
+ *
+ * Last Generated on: Sat Nov 18 15:28:08 +0000 2006
+ * SiSU http://www.jus.uio.no/sisu
+-->
+
diff --git a/lib/sisu/0.52/spell.rb b/lib/sisu/0.52/spell.rb
new file mode 100644
index 00000000..f3e264de
--- /dev/null
+++ b/lib/sisu/0.52/spell.rb
@@ -0,0 +1,91 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: spellchecking
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module Utility
+ class Spell
+ def initialize(input,filesrc,flg)
+ @flg=flg
+ @filename, @filetype = /(.+?)(\.\w\w\w0$)/.match(filesrc)[1,2] #.gsub(/\.\w\w\w0$/, "")
+ @input=input
+ @allwords=[]
+ puts @filename
+ @speller='aspell' # 'ispell'
+ @dictionary = 'british'
+ @lang = 'en_GB'
+ end
+ def check
+ @input.each do |data|
+ data.gsub!(/(http|www|ftp|gopher|png|jpg|gif|html|htm|&nbsp;)\S+/i,' ')
+ data.gsub!(/<\/?(table|tr|td|b|p|href).*?>/i,' ')
+ data.gsub!(/(<==.+|<:\S+>|<!.+?!>|^0~.+|\{\{\{|~)/,' ')
+ data.gsub!(/(["|<>)(\n'`'.;&_-]|\=)/,' ')
+ data.gsub!(/\b(altExternal|
+ target|externalimg|
+ srcimagebext|
+ img|src|toc|pdf|
+ cd|org|
+ helvetica|roman
+ )\b/i,' ')
+ data.gsub!(/EOF/,'')
+ @words=data.scan(/\S+/)
+ @words.each { |y| @allwords << y }
+ end
+ @allwords.uniq!
+ if @flg =~ /S/
+ File.open('/home/ralph/spell_error','a+') do |file| #fix
+ file.puts %{\n\n<<#@filename>>}
+ end
+ @allwords.each { |y| puts y.inspect; system(%{cat #{y} | /usr/bin/#@speller -l -d #@dictionary >> ~/spell_error })}
+ else
+ @allwords.each { |y| sp = %x{echo #{y}|#@speller -l }; puts sp unless sp.empty?}
+ end
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/sst_convert_markup.rb b/lib/sisu/0.52/sst_convert_markup.rb
new file mode 100644
index 00000000..d1c337cf
--- /dev/null
+++ b/lib/sisu/0.52/sst_convert_markup.rb
@@ -0,0 +1,298 @@
+=begin
+ * Name: modify.rb
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: A conversion script for canned substitutions,
+ a fairly generic simple tool that can be used to store other canned conversions,
+ used here for altering SiSU markup
+
+ * 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, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Modify
+ require SiSU_lib + '/sst_identify_markup'
+ require SiSU_lib + '/sst_from_kdissert'
+ require SiSU_lib + '/sst_to_s_xml_sax'
+ require SiSU_lib + '/sst_to_s_xml_dom'
+ require SiSU_lib + '/sst_to_s_xml_node'
+ require SiSU_lib + '/sst_from_xml'
+ require SiSU_lib + '/response'
+ class Convert_markup
+ require 'fileutils'
+ include FileUtils #::Verbose
+ def initialize(opt)
+ @opt=opt
+ @description='This is a script that contains canned text conversions for reuse'
+ @response=SiSU_Response::Response.new
+ @ask=SiSU_Response::Response.new
+ @warn='WARNING, PROCEED AT YOUR OWN RISK, will make file changes.'
+ end
+ def current_match_and_replace
+ convert_37_to_38
+ end
+ def message(text)
+ response=''
+ unless @opt.cmd=~/QQ/ or @opt.cmd=~/q/
+ response=@ask.response?(%{#{ text}\nProceed? })
+ end
+ end
+ def help
+ print <<WOK
+
+#@description
+
+sisu --convert --to38 [filename/wildcard]
+ converts pre 0.37 sisu markup to 0.38 experimental
+ [--37to38]
+
+sisu --convert --to37 [filename/wildcard]
+ converts pre 0.37 sisu markup to 0.38 experimental
+ [--38to37]
+
+sisu --convert --36to37 [filename/wildcard]
+ converts pre 0.36 file-name, to 0.37 file-name
+ [--36to37]
+
+sisu --identify [filename]
+ attempts to identify markup version used in file
+
+sisu --query [version number]
+ gives short summary of distinguishing characteristic
+ of that version of markup
+
+WOK
+ exit
+ end
+ #%% substitutions to be made
+ def convert_37_to_38
+ message("#@warn\nConvert sisu markup from 0.37 to 0.38")
+ [
+ [/^0~(\S+?)([+-])\s+/, '@\1:\2 ', //],
+ [/^0~(\S+)\s+/, '@\1: ', //],
+ [/^@toc:\s+/, '@structure: ', //],
+ [/^1~/, ':A~', //],
+ [/^2~/, ':B~', //],
+ [/^3~/, ':C~', //],
+ [/^4~/, '1~', //],
+ [/^5~/, '2~', //],
+ [/^6~/, '3~', //],
+ [/^7~/, '4~', //],
+ [/^8~/, '5~', //],
+ [/^9~/, '6~', //],
+ [/1/, ':A', /^@(?:level|markup):\s/],
+ [/2/, ':B', /^@(?:level|markup):\s/],
+ [/3/, ':C', /^@(?:level|markup):\s/],
+ [/4/, '1', /^@(?:level|markup):\s/],
+ [/5/, '2', /^@(?:level|markup):\s/],
+ [/6/, '3', /^@(?:level|markup):\s/]
+ ]
+ end
+ def convert_38_to_37
+ message("#@warn\nConvert sisu markup from 0.38 to 0.37")
+ [
+ [/^@(\S+?):([+-])\s+/, '0~\1\2 ', //],
+ [/^@(\S+?):\s+/, '0~\1 ', //],
+ [/^0~structure\s+/, '0~toc ', //],
+ [/^1~/, '4~', //],
+ [/^2~/, '5~', //],
+ [/^3~/, '6~', //],
+ [/^4~/, '7~', //],
+ [/^5~/, '8~', //],
+ [/^6~/, '9~', //],
+ [/^:?A~/, '1~', //],
+ [/^:?B~/, '2~', //],
+ [/^:?C~/, '3~', //],
+ [/1/, '4', /^0~(?:level|markup)\s/],
+ [/2/, '5', /^0~(?:level|markup)\s/],
+ [/3/, '6', /^0~(?:level|markup)\s/],
+ [/:?A/, '1', /^0~(?:level|markup)\s/],
+ [/:?B/, '2', /^0~(?:level|markup)\s/],
+ [/:?C/, '3', /^0~(?:level|markup)\s/]
+ ]
+ end
+ def convert_filename_36_to_37
+ @opt.files.each do |f|
+ s=case f
+ when /(\.s[1-3])$/; f.sub($1,'.sst')
+ when /(\.r[1-3])$/; f.sub($1,'.ssm')
+ when /(\.ri)$/; f.sub($1,'.ssi')
+ else f
+ end
+ pwd=Dir.pwd
+ unless f == s
+ unless File.exist?("#{pwd}/#{s}")
+ puts "./#{f} -> ./#{s}"
+ cp("#{pwd}/#{f}","#{pwd}/#{s}")
+ else "File already exists, < #{s} > will not overwrite"
+ end
+ end
+ end
+ end
+ def convert_to_simple_xml_model_sax
+ SiSU_simple_xml_model_sax::Convert.new(@opt).read
+ end
+ def convert_to_simple_xml_model_dom
+ SiSU_simple_xml_model_dom::Convert.new(@opt).read
+ end
+ def convert_to_simple_xml_model_node
+ SiSU_simple_xml_model_node::Convert.new(@opt).read
+ end
+ def convert_kdi_to_sst
+ SiSU_Kdissert::Convert.new(@opt).read
+ end
+ def convert_s_xml_to_sst
+ SiSU_sst_from_xml::Convert.new(@opt).read
+ end
+ def convert_footnotes
+ require SiSU_lib + '/sst_do_inline_footnotes'
+ SiSU_Convert_footnotes::Source.new(@opt).read
+ end
+ def conversion
+ #%% do it -------------------------->
+ if @opt.files and @opt.files.length > 0
+ mr=nil
+ #%% changes to make m match, r replace -------------------------->
+ if @opt.mod.inspect =~/--help/; help
+ elsif @opt.mod.inspect =~/(?:convert|to)[=-](?:xml |sxs|sax|sxd|dom|sxn|node)/
+ ext=case @opt.mod.inspect
+ when /(?:convert|to)[=-](?:xml|sxs|sax)/; '.sxs.xml'
+ when /(?:convert|to)[=-](?:sxd|dom)/; '.sxd.xml'
+ when /(?:convert|to)[=-](?:sxn|node)/; '.sxn.xml'
+ end
+ message("#{@opt.files.inspect}\n\nWARNING, PROCEED AT YOUR OWN RISK,\noverwriting any equivalent file with the extension #{ext}")
+ mr=case @opt.mod.inspect
+ when /(?:convert|to)[=-](?:sxs|sax|xml )/; convert_to_simple_xml_model_sax
+ when /(?:convert|to)[=-](?:sxd|dom)/; convert_to_simple_xml_model_dom
+ when /(?:convert|to)[=-](?:sxn|node)/; convert_to_simple_xml_model_node
+ else help
+ end
+ else
+ mr=case @opt.mod.inspect
+ when /(?:(?:37)?to-?38|--(?:convert|to)[=-](?:current|0.38))/; convert_37_to_38
+ when /(?:(?:38)?to-?37|--(?:convert|to)[=-](?:0.37))/; convert_38_to_37
+ when /(?:36to37)/; convert_filename_36_to_37
+ when /(?:convert|from)[=-]kdi/; convert_kdi_to_sst
+ when /(?:(?:convert|from)[=-])?(?:xml_to_sst|xml2sst|sxml|sxs|sxd|sxd)/; convert_s_xml_to_sst
+ when /(?:convert|to)[=-]footnotes/; convert_footnotes
+ when /convert|default/; current_match_and_replace
+ else help
+ end
+ end
+ unless @opt.mod.inspect =~/kdi/
+ match_and_replace=mr
+ #start_processing =/not used in this example/i
+ end_processing =/END\s+OF\s+FILE/
+ i=@opt.fns
+ if i =~/(?:\.sst|\.ssm|\.ssi)$/
+ @new,@matched,@flag_start,@flag_end,@empty1,@empty2=true,false,false,false,false,false
+ o="#{i}.bk" #o is for old
+ markup_version=SiSU_Markup::Markup_identify.new(@opt).markup_version?
+ if (@opt.mod.inspect=~/37/ and markup_version=~/0.38/) or
+ (@opt.mod.inspect=~/current|38/ and markup_version=~/0.37/)
+ puts "#{i} #{markup_version}"
+ file=File.open(i,'r')
+ cont=file.readlines
+ file.close
+ cont.each do |y|
+ match_and_replace.each do |m,r,w|
+ if y =~m and y =~w
+ if @new
+ @new=false
+ File.unlink(o) if File.exists?(o)
+ File.rename(i,o)
+ File.unlink(i) if File.exists?(i)
+ @file=File.new(i,'w')
+ @matched=true
+ break
+ end
+ end
+ end
+ end
+ if @matched
+ puts "conversion match in #{i}" unless @opt.cmd=~/q/
+ @flag_start=true
+ cont.each do |y|
+ if y =~end_processing
+ @flag_end=true
+ end
+ if @flag_start and not @flag_end
+ match_and_replace.each do |m,r,w|
+ if y =~m and y =~w
+ puts m.inspect + ' -> ' + r unless @opt.cmd=~/q/
+ puts "in: #{y}" if @opt.cmd=~/[vVM]/
+ y.gsub!(m,r) if m and r
+ puts "out: #{y}" if @opt.cmd=~/[vVM]/
+ end
+ end
+ end
+ if y=~/^\s*$/; @empty1=true
+ else @empty1=false
+ end
+ @file.puts y unless (@empty1==true and @empty2==true)
+ if y=~/^\s*$/; @empty2=true
+ else @empty2=false
+ end
+ end
+ @file.close
+ else puts "NO conversion match in #{i}" unless @opt.cmd=~/q/
+ end
+ else puts "Requested conversion #{@opt.mod.inspect} markup #{markup_version} identified in #{i}" if @opt.cmd=~/[vVM]/
+ end
+ end
+ end
+ else puts 'this routine makes permanent changes to the contents of the files matched, as instructed within [no matches]'
+ end
+ end
+ end
+end
+#%% files to match for this conversion set ------------------------->
+require SiSU_lib + '/options'
+argv=$*
+@opt=SiSU_commandline::Options.new(argv)
+case @opt.mod.inspect
+when /=kdi/
+ SiSU_Modify::Convert_markup.new(@opt).conversion
+when /(?:36|37|38)?to-?(?:37|38)|--convert|--to|--from|default/
+@opt.files.each do |fns|
+ @opt.fns=fns
+ SiSU_Modify::Convert_markup.new(@opt).conversion
+end
+else
+ @opt.mod='--help'
+ SiSU_Modify::Convert_markup.new(@opt).help
+end
+__END__
diff --git a/lib/sisu/0.52/sst_do_inline_footnotes.rb b/lib/sisu/0.52/sst_do_inline_footnotes.rb
new file mode 100644
index 00000000..90102d7c
--- /dev/null
+++ b/lib/sisu/0.52/sst_do_inline_footnotes.rb
@@ -0,0 +1,461 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download
+
+ * Description: preprocessing, (dal), data abstraction used in subsequent processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Convert_footnotes
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/param'
+ require SiSU_lib + '/dal_syntax'
+ require SiSU_lib + '/i18n'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ include Syntax
+ class Instantiate < SiSU_Param::Parameters::Instructions
+ @@flag={} #Beware!!
+ def initialize
+ @@flag['table_to']=false
+ @@counter=@@column=@@columns=@@flag_vocab=0
+ @@endnote={}
+ @@endnote_array=@@word_mode=[]
+ @@endnote_call_counter=1
+ @@line_mode=''
+ end
+ end
+ class Source <Instantiate
+ @@dal_array=[]
+ @@fns=nil
+ def initialize(opt)
+ @opt=opt
+ @@fns||@opt.fns
+ @my_make_fns=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ @fnm=@my_make_fns.marshal_meta
+ SiSU_Env::Create_system_link.new.images
+ end
+ def read #creates dal
+ begin
+ dal=[]
+ @@dal_array=[]
+ @@fns=@opt.fns
+ create_dal
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ Instantiate.new
+ end
+ end
+ def get #reads dal, unless does not exist then creates first
+ begin
+ dal=[]
+ unless @@fns==@opt.fns
+ @@fns=@opt.fns
+ @@dal_array=[]
+ end
+ dal=if @@dal_array.empty?; read_fnm
+ else @@dal_array.dup #check
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ Instantiate.new
+ end
+ end
+ protected
+ def create_dal
+ dal_array=[]
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'convert footnotes')
+ tell.green_title_hi unless @opt.cmd =~/q/
+ file_array=IO.readlines(@opt.fns,'')
+ file_array.each do |l|
+ if l =~/\r\n/; l.gsub!(/\r\n/,"\n")
+ end
+ end
+ meta=file_array.dup
+ meta=meta.join.split("\n\n") #check whether can be eliminated, some of these are large objects to have twice
+ @md=SiSU_Param::Parameters::Instructions.new(meta,@opt).extract
+ if @md.en[:mismatch] == 0 or @md.mod.inspect =~/=footnotes-force/
+ meta=nil
+ dal=SiSU_Convert_footnotes::Make.new(@md,file_array).song
+ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.fns}.fn").output if @md.cmd =~/v/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"#{@md.fns}.fn -> #{@md.fns}.fn") unless @md.cmd =~/q/
+ tell.txt_red unless @md.cmd =~/q/
+ dal.each{|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?}
+ dal_array
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'no footnote conversion done, problem with source file','to override use --convert=footnote-force (this is not advised)')
+ tell.warn if @cmd !~/q/
+ ''
+ end
+ end
+ def read_fnm
+ dal=[]
+ dal=if FileTest.file?(@fnm); File.open(@fnm){ |f| dal=Marshal.load(f)}
+ else SiSU_Convert_footnotes::Source.new(@opt).create_dal #watch
+ end
+ end
+ end
+ class Output
+ def initialize(md,data)
+ @md,@data=md,data
+ #@data=data.compact
+ @my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @hard="#{Dir.pwd}/#{@md.fns}.fn"
+ end
+ def hard_output
+ filename_note=@my_make.file_note
+ @data.each {|s| filename_note.puts s.strip + "\n\n" unless s.strip.empty?}
+ end
+ end
+ class Make
+ @@endnote={}
+ @@endnote_array=@@word_mode=[]
+ @@endnote_call_counter=1
+ @@comment='%'
+ @@flag={ ['table_to']=>false }
+ @@dp=nil
+ def initialize(md,data)
+ @md,@data=md,data
+ @@word_mode=[]
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @skin=SiSU_Env::Info_skin.new(@md)
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns)
+ @language=l[:l]
+ @translate=SiSU_Translate::Source.new(@md,@language)
+ end
+ def reset
+ @@counter=@@column=@@columns=@@flag_vocab=0
+ @@endnote={}
+ @@endnote_array=@@word_mode=[]
+ @@endnote_call_counter=1
+ @@line_mode=''
+ end
+ def song
+ reset
+ data=@data
+ @metafile="#{@env.path.dal}/#{@md.fns}.meta"
+ my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns)
+ data=data.join.split("\n\n")
+ data_new=[]
+ data.each do |x|
+ data_new << if x =~ /\n\n/m; x.split(/\n\n+/)
+ else x
+ end
+ end
+ data=data_new.flatten
+ data=SiSU_Convert_footnotes::Make.new(@md,data).substitutions_and_insertions?
+ data=SiSU_Convert_footnotes::Make.new(@md,data).character_check
+ data=SiSU_Convert_footnotes::Make.new(@md,data).endnotes
+ SiSU_Convert_footnotes::Output.new(@md,data).hard_output
+ reset
+ data
+ end
+ protected
+ def vocabulary
+ data=@data
+ tuned_file,vocab_insert=[],[]
+ data.each do |para|
+ if para =~/^1~/ and @@flag_vocab == 0
+ vocab_insert << '@vocabulary: lex' << "\n\n" << para
+ tuned_file << vocab_insert unless para.nil?
+ @@flag_vocab=1
+ else tuned_file << para unless para.nil?
+ end
+ end
+ tuned_file
+ end
+ def character_check
+ require 'iconv'
+ reset
+ data=@data
+ @tuned_file=[]
+ endnote_no=1
+ data.each do |para|
+ para.strip!
+ #para.gsub!(/([12])~\?\s+/,'\1~ ') #conditional header for incorporated document 2004w12
+ para.gsub!(/^[{~}]\s*$/,'')
+ para.gsub!(/^#{@@comment}.*/,'') #remove comment and divider #%
+ para.gsub!(/<~#>|~#\s*/,'~#')
+ para.gsub!(/-#\s*/,'-#')
+ #para.gsub!(/-#\s*/,'<-#><~#>')
+ para.gsub!(/(~\{ )\s+/,'\1')
+ para.gsub!(/ \/\//,'<br />') #added 2004w29
+ para.gsub!(/<br>/,'<br />') #needed by xml, xhtml etc.
+ para.gsub!(/`/,"'")
+ para.gsub!(/\342\200\231/,"'") #if para =~/’/ #Avoid #&lsquo; &rsquo; #&ldquo; &rdquo;
+ para.gsub!(/\t/,' ')
+ para.gsub!(/�/,' ') #watch, replace with char code
+ para.gsub!(/[“”]/,'""')
+ para.gsub!(/[­–—]/,'-') #— – chk
+ para.gsub!(/·/,'*')
+ para.gsub!(/\\copy(?:right)?\b/,'&#169;')
+ para.gsub!(/\\trademark\b|\\tm\b/,'&#174;')
+ para.gsub!(/\44/,'&#36;') #$ watch
+ para=para + "\n"
+ case para
+ when /\^~/ # endnotes
+ #% Note must do this first (earlier loop) and then enter gathered data into ~^\d+
+ sub_para=para.dup
+ @@endnote_array << sub_para.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/,'~{ \1 }~').strip
+ endnote_no+=1
+ para=nil if para =~/\^~ .+/ #removes 'binary' endnote now in endnote array for later insertion
+ end
+ @tuned_file << para unless para.nil?
+ end
+ @tuned_file
+ end
+ def substitutions_and_insertions?
+ data=@data
+ tuned_file=[]
+ data.each do |para|
+ if @md.markup =~/0\.16|0\.37/ #parameters not extracted/available
+ para.gsub!(/^0~\S+\s+/,'@\1: ')
+ para.gsub!(/^1~/,':A~')
+ para.gsub!(/^2~/,':B~')
+ para.gsub!(/^3~/,':C~')
+ para.gsub!(/^4~/,'1~')
+ para.gsub!(/^5~/,'2~')
+ para.gsub!(/^6~/,'3~')
+ para.gsub!(/^7~/,'4~')
+ para.gsub!(/^8~/,'5~')
+ para.gsub!(/^9~/,'6~')
+ end
+ if para =~/<:insert\d+!?>/ and para !~/^%\s+/
+ @skin.select
+ #require "#{@md.doc_skin}" #FIX now
+ ins=SiSU_Viz::Inserts.new
+ case para
+ when /^\s*<:insert1>\s*$/
+ para=[]
+ ins.insert1.split(/\n\n/).each{|x| para << x }
+ when /^\s*<:insert2>\s*$/
+ para=[]
+ ins.insert2.split(/\n\n/).each{|x| para << x }
+ when /^\s*<:insert3>\s*$/
+ para=[]
+ ins.insert3.split(/\n\n/).each{|x| para << x << "\n"}
+ para=ins.insert3
+ when /^\s*<:insert4>\s*$/
+ para=[]
+ ins.insert4.split(/\n\n/).each{|x| para << x << "\n"}
+ para=ins.insert4
+ when /^\s*<:insert5>\s*$/
+ para=[]
+ ins.insert5.split(/\n\n/).each{|x| para << x << "\n"}
+ when /^\s*<:insert6>\s*$/
+ para=[]
+ ins.insert6.split(/\n\n/).each{|x| para << x << "\n"}
+ when /^\s*<:insert7>\s*$/
+ para=[]
+ ins.insert7.split(/\n\n/).each{|x| para << x << "\n"}
+ end
+ para.each{|x| tuned_file << x }
+ else tuned_file << para
+ end
+ tuned_file.compact!
+ end
+ tuned_file
+ end
+ def name_endnote_seg
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ para.gsub!(/<:3>\s*<:ee>/,
+ "#{@@endnote['special_align']} <p /><br />\r " +
+ "#{@@endnote['seg_name_3']} <p /> " +
+ "#{@@endnote['special_align_close']}")
+ para.gsub!(/<:2>\s*<:ee>/,
+ "#{@@endnote['special_align']} <p /><br />\r " +
+ "#{@@endnote['seg_name_2']} <p />" +
+ "#{@@endnote['special_align_close']}")
+ para.gsub!(/<:1>\s*<:ee>/,
+ "#{@@endnote['special_align']} <p /><br />\r " +
+ "#{@@endnote['seg_name_1']} <p /> " +
+ "#{@@endnote['special_align_close']}")
+ @tuned_file << para
+ end
+ # debug 2003w46 adding revision control info
+ if @md.flag_auto_endnotes and @md.flag_separate_endnotes_make
+ @tuned_file << "\n1~endnotes Endnotes <~0;0:0;u0>" #prob numbering, revisit
+ end
+ @tuned_file << "\n<ENDNOTES>"
+ @tuned_file
+ end
+ def owner_details_seg
+ data << '1~owner.details Owner Details'
+ end
+ def number_sub_heading(para,num,title_no)
+ case para
+ when /#{num}~- /; para.gsub!(/#{num}~- /,"#{title_no} ")
+ when /^#{num}~#\s*/; para.gsub!(/^#{num}~#\s*/,"#{title_no} ")
+ when /^#{num}~[a-z_\.]+ /
+ para.gsub!(/^#{num}~([a-z_\.]+)\s+(.+)/i,%{#{num}~\\1 #{title_no} \\2 <:name##{title_no}>})
+ else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main
+ end
+ if @md.toc_lev_limit and @md.toc_lev_limit < num
+ para.gsub!(/^[2-6]~(?:~\S+)?\s*/,'!_ ')
+ end
+ para
+ end
+ def set_heading_top #% make sure no false positives
+ unless @md.set_heading_top
+ puts "\tdocument contains no top level heading, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ unless @md.set_heading_top
+ if para !~/^(?:@\S+:|0~\S+)\s/m and para !~/\A\s*\Z/m
+ @md.set_heading_top=true
+ head=if @md.title ; ":A~ #{@md.title}"
+ else ':A~ [no title provided]'
+ end
+ @tuned_file << head
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ end
+ def set_heading_seg #% make sure no false positives
+ unless @md.set_heading_seg
+ puts "\tdocument contains no segment level, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ unless @md.set_heading_seg
+ if para !~/^(?:@\S+:|0~\S+|:[ABC]~)/m and para !~/\A\s*\Z/m and para !~/<:p[bn]>/
+ @md.set_heading_seg=true
+ head=if @md.title ; "1~seg [#{@md.title}]"
+ else '1~seg [segment]'
+ end
+ @tuned_file << head
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ end
+ def set_header_title #% make sure no false positives
+ unless @md.set_header_title
+ puts "\t no document title provided, (will have to manufacture one)" if @md.cmd =~/[MV]/
+ data=@data
+ @tuned_file=[]
+ data.each do |para|
+ unless @md.set_header_title
+ if para !~/^%{1,2}\s/m and para !~/\A\s*\Z/m
+ @tuned_file << "0~title #{@md.heading_seg_first}"
+ @md.title=@md.heading_seg_first
+ @md.set_header_title=true
+ end
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ end
+ def endnotes #% endnote work zone
+ data=@data
+ @tuned_file=[]
+ endnote_no,endnote_ref=1,1
+
+ data.each do |para|
+ case para # manually numbered endnotes <!e(\d)!> <!e_(\d)!> -->
+ when /~\{\s+.+?\}~/ # auto-numbered endnotes <!e!> <!e_!> -->
+ para.gsub!(/\s*\}~/,' }~') # required 2003w31
+ @word_mode=para.scan(/\S+/)
+ word_mode=SiSU_Convert_footnotes::Make.new(@md,@word_mode).endnote_call_number
+ para=word_mode.join(' ')
+ endnote_ref+=1
+ when /~\^(?:\s|$)|<:e>/ #%Note inserts endnotes previously gathered from /^(<!e[:_]!>|[-~]\{{3})/ (in earlier loop)
+ word_mode=para.scan(/\S+/)
+ word_mode=SiSU_Convert_footnotes::Make.new(@md,word_mode).endnote_call_number
+ para=word_mode.join(' ')
+ endnote_ref+=1
+ end
+ @tuned_file << para
+ end
+ @tuned_file
+ end
+ def endnote_call_number
+ data=@data
+ data.each do |word|
+ case word
+ when /~\{/
+ unless word =~/~\{\*+/
+ #word.gsub!(/~\{/,"~\{#{@@endnote_call_counter} ") #hard places/writes footnote number
+ @@endnote_call_counter+=1
+ end
+ when /~\^|<:e>/
+ word.gsub!(/~\^|<:e>/,"#{@@endnote_array[@@endnote_call_counter-1]}")
+ @@endnote_call_counter+=1
+ end
+ end
+ end
+ def strip_clean_extra_spaces(s) # dal output tuned
+ s=s.dup
+ s=s.gsub(/[ ]+([,.;:?](?:$|\s))/,'\1')
+ s=s.gsub(/ [ ]+/,' ')
+ s=s.gsub(/^ [ ]+/,'')
+ s=s.gsub(/ [ ]+$/,'')
+ s=s.gsub(/(<\/[bi]>')[ ]+(s )/,'\1\2')
+ end
+ def strip_clean_of_markup(s) # used for digest, define rules, make same as in db clean
+ s=s.dup
+ s=s.gsub(/(?:<\/?[ib]>|<~\d+;(?:\w|[0-6]:)\d+;\w\d+>|<#@dp:#@dp>|^:[A-C]~\S+|^[1-6]~\S+|~\{\d+\s.+?\}~)/,'') # markup and endnotes removed
+ #% same as db clean -->
+ s=s.gsub(/<del>(.+?)<\/del>/,'DELETED(\1)') # deletions
+ s=s.gsub(/<sup>(\d+)<\/sup>/,'[\1]')
+ s=s.gsub(/(?:&nbsp\\;)+/,' ')
+ s=s.gsub(/\{.+?\.(?:png|jpg|gif).+?\}(?:https?|ftp)\\\:\S+ /,' [image] ') # else image names found in search
+ s=s.gsub(/\s\s+/,' ')
+ s=s.strip
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/sst_from_kdissert.rb b/lib/sisu/0.52/sst_from_kdissert.rb
new file mode 100644
index 00000000..9dc80bb5
--- /dev/null
+++ b/lib/sisu/0.52/sst_from_kdissert.rb
@@ -0,0 +1,176 @@
+=begin
+ * Name: modify.rb
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: Conversion script from kdissert .kdi to sisu markup .ssm (master document)
+ * 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, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Kdissert
+ require SiSU_lib + '/sysenv'
+ class Convert
+ require 'rexml/document'
+ include REXML
+ def initialize(opt)
+ @opt=opt
+ @sisu,@sisu_base=[],[]
+ @ver=SiSU_Env::Info_version.new.get_version
+ end
+ def read
+ kdissert_to_sisu
+ end
+ def sisu_head
+ sisu_head=<<WOK
+% SiSU #{@ver[:version]} auto-conversion from Kdissert file [check necessary]
+
+@title: #@title
+
+@prefix: Kdissert document map, converted to SiSU markup
+
+@links: {Kdissert}http://freehackers.org/~tnagy/kdissert/
+
+@base_program: kdissert
+
+@skin: skin_kdissert
+
+% @date:
+
+@rcs:+ $Id$
+
+@level: num_top=1
+
+WOK
+ end
+ def kdissert_to_sisu
+ unless @opt.files.empty?
+ @opt.files.each do |kdi|
+ @sisu_base=[]
+ if kdi =~/\.kdi$/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Kdissert to SiSU',"#{kdi} --> #{kdi}.ssm")
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ system("cp #{kdi} /tmp/. && cd /tmp && tar xzvf /tmp/#{kdi} && cd -")
+ file=File.new("/tmp/maindoc.xml")
+ @output=File.new("#{kdi}.ssm",'w')
+ doc=Document.new(file)
+ root=doc.root
+ @el=[]
+ root.each do |x|
+ end
+ root.each_with_index do |content,idx|
+ if root.elements["item[#{idx}]/summary"]
+ id,ma,ch=nil,nil,[]
+ 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]={ :id=>id,:ma=>ma,:ch=>ch,:sum=>sum,:txt=>txt }
+ if ma == '-1'
+ @el[id][:lev]=':A'
+ @top=id
+ end
+ end
+ end
+ @doc=[]
+ @title=@el[@top][:sum]
+ puts @el[@top][:sum].inspect
+ @doc << @el[@top][:txt] #% careful: hack to make it possible to modify sisu headers
+ @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
+ # 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;br&gt;/,'<br>')
+ c.gsub!(/&lt;(:p[bn])&gt;/,'<\1>')
+ c.gsub!(/&lt;&lt;([|]\S+[|]@[|].?[|])/,'<<\1')
+ c.gsub!(/&lt;/,'\<')
+ c.gsub!(/&gt;/,'\>')
+ c.gsub!(/&quot;/,'"')
+ c.gsub!(/ \s+/,' ')
+ @sisu_base << c.strip + "\n\n"
+ end
+ else puts ".kdi extension expected, filename not recognised: << #{kdi} >>"
+ end
+ @output << sisu_head << @sisu_base
+ end
+ else puts '.kdi file for conversion to sisu expected'
+ end
+ @opt.files.each do |f|
+ f.gsub!(/.kdi$/,'.kdi.ssm')
+ end
+ puts @opt.files.inspect
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/sst_from_xml.rb b/lib/sisu/0.52/sst_from_xml.rb
new file mode 100644
index 00000000..1b2651e3
--- /dev/null
+++ b/lib/sisu/0.52/sst_from_xml.rb
@@ -0,0 +1,148 @@
+=begin
+ * Name: modify.rb
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: Conversion script from kdissert .kdi to sisu markup .ssm (master document)
+ * 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, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_sst_from_xml
+ require SiSU_lib + '/sysenv'
+ class Convert
+ require 'rexml/document'
+ include REXML
+ def initialize(opt)
+ @opt=opt
+ @sisu,@sisu_base=[],[]
+ @ver=SiSU_Env::Info_version.new.get_version
+ end
+ def tell(filename,type)
+ SiSU_Screen::Ansi.new(@opt.cmd,"XML #{type} to SiSU sst","#{filename} --> #{filename}.sst").green_hi_blue
+ end
+ def read
+ xml_to_sisu
+ end
+ def markup_head(text)
+ text.strip!
+ text.gsub!(/(?:\s*\n|\s\s+)/,' ')
+ text.gsub!(/<header class=['"]\S+?['"]>(.+?)<\/header>/,'\1')
+ text.gsub!(/<(\w+)>(.+?)<\/\w+>/,'@\1: \2')
+ text.gsub!(/<header class=['"]\S+?['"]><(\w+)>(.+?)<\/\w+><\/header>/,'@\1: \2')
+ text.gsub!(/\s +/,' ')
+ text.strip!
+ text + "\n\n"
+ end
+ def markup(text)
+ text.strip!
+ text.gsub!(/(?:\s*\n|\s\s+)/,' ')
+ text.gsub!(/<text class='h1'>(.+?)<\/text>/,':A~ \1')
+ text.gsub!(/<text class='h2'>(.+?)<\/text>/,':B~ \1')
+ text.gsub!(/<text class='h3'>(.+?)<\/text>/,':C~ \1')
+ text.gsub!(/<text class='h4'>(.+?)<\/text>/,'1~ \1')
+ text.gsub!(/<text class='h5'>(.+?)<\/text>/,'2~ \1')
+ text.gsub!(/<text class='h6'>(.+?)<\/text>/,'3~ \1')
+ text.gsub!(/<text class='norm'>(.+?)<\/text>/,'\1')
+ text.gsub!(/<endnote symbol='norm'>(.+?)<\/endnote>/,'~{ \1 }~')
+ text.gsub!(/<br ?\/>/,'<br>')
+ text.gsub!(/<i>(.+?)<\/i>/,'/{\1}/')
+ text.gsub!(/<b>(.+?)<\/b>/,'*{\1}*')
+ text.gsub!(/<u>(.+?)<\/u>/,'_{\1}_')
+ text.gsub!(/\s +/,' ')
+ text.strip!
+ #text.gsub!(/<header>(.+?)<\/header/,"@#{x.name}: \\1\n\n")
+ text + "\n\n"
+ end
+ def sax
+ out_file=File.new(@output_file_name,'w')
+ head=@doc.root.get_elements('//head/header')
+ body=@doc.root.get_elements('//object/text')
+ out_file.puts "% SiSU text #{@ver[:version]} (generated from a SiSU XML markup representation)\n\n"
+ head.each do |x|
+ if x.name == 'header'
+ head=markup_head(x.to_s)
+ out_file.puts head
+ end
+ end
+ body.each do |x|
+ if x.name == 'text'
+ body=markup(x.to_s)
+ out_file.puts body
+ end
+ end
+ end
+ def node
+ sax
+ end
+ def dom
+ raise "#{__FILE}::#{__LINE__} xml dom representation to sst not yet implemented (experimental simple xml representations sax and node to sst are in place)."
+ end
+ def xml_to_sisu
+ unless @opt.files.empty?
+ @opt.files.each do |xml|
+ @sisu_base=[]
+ if xml =~/\.sx[sdn]\.xml$/
+ begin
+ @doc_str=IO.readlines(xml,'').join("\n")
+ @output=File.new("#{xml}.sst",'w')
+ @doc=REXML::Document.new(@doc_str)
+ @output_file_name="#{Dir.pwd}/#{xml}.sst"
+ @el=[]
+ rescue REXML::ParseException
+ end
+ end
+ if xml =~/\.sxs\.xml$/
+ unless @opt.cmd =~/q/; tell(xml,'sax')
+ end
+ sax
+ elsif xml =~/\.sxd\.xml$/
+ unless @opt.cmd =~/q/; tell(xml,'dom')
+ end
+ dom
+ elsif xml =~/\.sxn\.xml$/
+ unless @opt.cmd =~/q/; tell(xml,'node')
+ end
+ node
+ else puts "filename not recognised: << #{xml} >>"
+ end
+ @output << @sisu_base
+ end
+ else puts '.xml file for conversion to sisu expected'
+ end
+ puts @opt.files.inspect
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/sst_identify_markup.rb b/lib/sisu/0.52/sst_identify_markup.rb
new file mode 100644
index 00000000..8dbca059
--- /dev/null
+++ b/lib/sisu/0.52/sst_identify_markup.rb
@@ -0,0 +1,322 @@
+=begin
+ * Name: modify.rb
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: A conversion script for canned substitutions,
+ a fairly generic simple tool that can be used to store other canned conversions,
+ used here for altering SiSU markup
+
+ * 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, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Markup
+ class Markup_inform
+ attr_accessor :version
+ def initialize(version,message,declared_markup='',declared_type='')
+ @version,@message,@declared_markup,@declared_type=version,message,declared_markup,declared_type
+ end
+ def version
+ @version
+ end
+ def message
+ @message
+ end
+ def declared_version
+ @declared_markup
+ end
+ def declared_type
+ @declared_type
+ end
+ def history
+ Markup_history.new(@version).query
+ end
+ end
+ class Markup_identify
+ def initialize(opt)
+ @opt=opt
+ @description='This is a script attempts to identify the version of markup used in SiSU (and provides information on changes in markup)'
+ end
+ def help
+ print <<WOK
+
+#@description
+
+WOK
+ exit
+ end
+ def identify
+ f=@opt.fns
+ if f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])$/ and File.exist?(f)
+ file=File.open(f,'r')
+ cont=file.readlines
+ file.close
+ links,oldlinks='',''
+ markup=nil
+ @declared_type,@declared_markup='[text?]',''
+ if cont[0] =~ /^(?:%\s+)?SiSU\s+(text|master|insert)\s+([0-9](?:\.[0-9]+){1,2})/ or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/
+ @declared_type,@declared_markup=$1,$2
+ #puts "SiSU #@declared_markup (declared markup version)"
+ #else puts 'markup version not declared'
+ elsif cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/
+ @declared_markup=$1
+ end
+ @flag_38=false
+ cont.each_with_index do |y,i|
+ if y =~/^(?:0\{?~links?|@links?:)\s/ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/
+ links=unless y =~/\{.+?\}\S+/; oldlinks=' (pre 0.20.4 header links)'
+ else ' (post 0.20.4 header links)'
+ end
+ end
+ if @flag_38 or (y =~/^:?A~/ and f =~/(?:\.sst|\.ssm|\.ssi)/)
+ version='0.38'
+ markup=Markup_inform.new(version,'0.38' + oldlinks,@declared_markup,@declared_type)
+ @flag_38=true
+ break if i >= 200
+ if y =~ /(?:~{\*+|~\[\*|~\[\+)\s/
+ version='0.42'
+ markup=Markup_inform.new(version,'0.42' + oldlinks,@declared_markup,@declared_type)
+ break
+ end
+ end
+ if (y =~/^1~/ and f =~/(?:\.sst|\.ssm|\.ssi)/) and not @flag_38
+ version='0.37'
+ markup=Markup_inform.new(version,'0.37 is substantially 0.16 - 0.36 markup with new file-extension' + oldlinks,@declared_markup,@declared_type)
+ break
+ end
+ if y =~/^1~/ and f =~/\.([rs])([123])/ and not @flag_38
+ t,n=$1,$2
+ version='0.16'
+ instruct=if t =~/r/
+ " (change file extension from .#{t}#{n} to .ssm)"
+ else " (change file extension from .#{t}#{n} to .sst)"
+ end
+ markup=Markup_inform.new(version,'0.16 - 0.36' + instruct + links,@declared_markup,@declared_type)
+ break
+ end
+ if y =~/^0\{~/ and not @flag_38
+ version='0.1'
+ markup=Markup_inform.new(version,'0.1 - 0.15',@declared_markup,@declared_type)
+ break
+ end
+ if y =~/^0\{{3}/ and not @flag_38
+ markup=Markup_inform.new('circa. 1997','old, check date',@declared_markup,@declared_type)
+ break
+ end
+ markup='Not a recognised file type '
+ end
+ markup
+ else Markup_history.new(@opt).help_query
+ end
+ end
+ def determine_markup_version
+ if @opt.fns.nil? or @opt.fns.empty?; Markup_history.new(@opt).help_identify
+ end
+ if File.exist?(@opt.fns)
+ if @opt.fns =~/\.(?:sst|ssm|ssi|s[123i]|r[123])/
+ markup=identify #(@opt.fns)
+ if defined? markup.version
+ #if defined? markup and defined? markup.version
+ unless @opt.cmd =~/q/
+ message=unless markup.declared_version.empty?
+ "#{@opt.fns}\n markup Type Declared as SiSU #{markup.declared_version} #{markup.declared_type}\n appears to be SiSU #{markup.version}"
+ else
+ "Markup Type Appears to be SiSU #{markup.version}\n in file #{@opt.fns}"
+ end
+ puts message
+ #puts markup.message
+ puts %{"sisu --query-#{markup.version}" for a brief description of markup type}
+ end
+ end
+ else puts 'file-type not recognised: ' + @opt.fns
+ end
+ else puts 'file not found: ' + @opt.fns
+ end
+ if defined? markup.version; markup.version
+ else 'markup type/version not determined'
+ end
+ end
+ def markup_version?
+ if @opt.fns.empty?
+ @opt.files.each do |fns|
+ @opt.fns=fns
+ determine_markup_version
+ end
+ else determine_markup_version
+ end
+ end
+ end
+ class Markup_history
+ def initialize(opt)
+ @opt=opt
+ end
+ def sisu_0_42
+ <<WOK
+ SiSU 0.42 is the same as 0.38 with the introduction of some additional endnote types,
+
+ Introduces some varations on endnotes, in particular the use of the asterisk
+ ~{* for example for describing an author }~ and ~{** for describing a second author }~
+
+ * for example for describing an author
+
+ ** for describing a second author
+
+ and ~[* my note ]~ or ~[+ another note ]~ which numerically increments an
+ asterisk and plus respectively
+
+ *1 my note
+ +1 another note
+
+WOK
+ end
+ def sisu_0_38
+ <<WOK
+
+ SiSU 0.38 introduced alternative experimental header and heading/structure markers,
+
+ @headername: and headers :A~ :B~ :C~ 1~ 2~ 3~
+
+ as the equivalent of
+
+ 0~headername and headers 1~ 2~ 3~ 4~ 5~ 6~
+
+ The internal document markup of SiSU 0.16 remains valid and standard
+ Though note that SiSU 0.37 introduced a new file naming convention
+
+ SiSU has in effect two sets of levels to be considered, using 0.38 notation
+ A-C headings/levels, pre-ordinary paragraphs /pre-substantive text, and
+ 1-3 headings/levels, levels which are followed by ordinary text.
+ This may be conceptualised as levels A,B,C, 1,2,3, and using such letter
+ number notation, in effect:
+ A must exist, optional B and C may follow in sequence (not strict)
+ 1 must exist, optional 2 and 3 may follow in sequence
+ i.e. there are two independent heading level sequences A,B,C and 1,2,3
+ (using the 0.16 standard notation 1,2,3 and 4,5,6)
+ on the positive side:
+ * the 0.38 A,B,C,1,2,3 alternative makes explicit an aspect of structuring
+ documents in SiSU that is not otherwise obvious to the newcomer (though
+ it appears more complicated, is more in your face and likely to be
+ understood fairly quickly)
+ * the substantive text follows levels 1,2,3 and it is 'nice' to do
+ most work in those levels
+WOK
+ end
+ def sisu_0_37
+ <<WOK
+
+ SiSU 0.37 introduced new file naming convention,
+ using the file extensions .sst .ssm and .ssi
+ to replace .s1 .s2 .s3 .r1 .r2 .r3 and .si
+
+ this is captured by the following file 'rename' instruction:
+
+ rename 's/\.s[123]$/\.sst/' *.s{1,2,3}
+ rename 's/\.r[123]$/\.ssm/' *.r{1,2,3}
+ rename 's/\.si$/\.ssi/' *.si
+
+ The internal document markup remains unchanged, from SiSU 0.16
+WOK
+ end
+ def sisu_0_16
+ <<WOK
+
+ SiSU 0.16 (0.15 development branch) introduced the use of
+
+ the header 0~ and headings/structure 1~ 2~ 3~ 4~ 5~ 6~
+
+ in place of the 0.1 header, heading/structure notation
+WOK
+ end
+ def sisu_0_1
+ <<WOK
+
+ SiSU 0.1 headers and headings structure represented by
+ header 0{~ and headings/structure 1{ 2{ 3{ 4{~ 5{ 6{
+WOK
+ end
+ def help_query
+ <<WOK
+
+ sisu --query=[sisu version [0.38] or 'history]
+ provides a short history of changes to SiSU markup
+
+WOK
+ end
+ def help_identify
+ <<WOK
+
+ sisu --identify [filename]
+ attempts to identify the SiSU markup used in a file
+
+WOK
+ end
+ def query
+ tell=if @opt.mod.inspect =~/--query/
+ tell=case @opt.mod.inspect
+ when /history/
+ "#{sisu_0_38}\n#{sisu_0_37}\n#{sisu_0_16}\n#{sisu_0_1}"
+ when /0.42/
+ "#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}"
+ when /0.38/
+ "#{sisu_0_38}#{sisu_0_16}"
+ when /0.37/
+ "#{sisu_0_37}\n#{sisu_0_16}"
+ when /0.1[6-9]|0.2[0-9]|0.3[0-6]/
+ "#{sisu_0_16}\n#{sisu_0_1}"
+ when /0.[1-9]|0.1[1-4]/
+ sisu_0_1
+ else puts "NOT RECOGNISED: #{@opt.mod.inspect}"
+ help_query
+ end
+ tell
+ else help_query
+ end
+ end
+ end
+end
+__END__
+#%% to use as independent program ------------------------->
+f=$*
+cf=f[0].to_s
+f.shift
+match_and_replace=[]
+unless f.length > 0; f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be
+end
+puts "SiSU files:"
+puts f
+f.each do |x|
+ SiSU_Markup::Markup_identify.new(x).markup_version?
+end
diff --git a/lib/sisu/0.52/sst_to_s_xml_dom.rb b/lib/sisu/0.52/sst_to_s_xml_dom.rb
new file mode 100644
index 00000000..9665250b
--- /dev/null
+++ b/lib/sisu/0.52/sst_to_s_xml_dom.rb
@@ -0,0 +1,563 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: simple xml representation (dom style)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_simple_xml_model_dom
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/dal_doc_str'
+ require SiSU_lib + '/shared_xml'
+ require SiSU_lib + '/xml_format'
+ include SiSU_XML_format
+ include SiSU_XML_munge
+ require SiSU_lib + '/rexml'
+ include SiSU_Rexml
+ @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0
+ @@tablefoot=''
+ class Convert
+ @@fns=nil
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get #bug, relies on info persistence, assumes -m has previously been run
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/[MV]/; "#{Dir.pwd}/#{@md.fn[:sxd]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sxd]}"
+ elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{Dir.pwd}/#{@md.fn[:sxd]}"
+ else ''
+ end
+ SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',"#{@md.fns} -> #{@md.fn[:sxd]}").colorize unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{Dir.pwd}/#{@md.fn[:sxd]}")
+ tell.flow if @opt.cmd =~/[MV]/
+ unless @@fns==@opt.fns
+ @@fns=@opt.fns
+ @@dal_array=[]
+ end
+ @dal_array=if @@dal_array.empty?; read_fnm
+ else @@dal_array.dup # check
+ end
+ SiSU_simple_xml_model_dom::Convert::Songsheet.new(@dal_array,@md,@env).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure #file closed in songsheet
+ end
+ end
+ def read_fnm
+ dal=[]
+ if FileTest.file?("#{Dir.pwd}/#{@opt.fns}")
+ dal=IO.readlines("#{Dir.pwd}/#{@opt.fns}","\n\n")
+ else puts 'Error'
+ end
+ end
+ private
+ class Songsheet
+ def initialize(data,md,dir)
+ @data,@md,@env=data,md,dir
+ end
+ def songsheet
+ begin
+ SiSU_simple_xml_model_dom::Convert::Scroll.new(@data,@md).songsheet
+ SiSU_simple_xml_model_dom::Convert::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:sxd]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ class Scroll
+ require SiSU_lib + '/shared_txt'
+ require SiSU_lib + '/css'
+ include SiSU_text_utils
+ @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] }
+ def initialize(data='',md=nil)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @regx=/^(?:(?:<:p[bn]>\s*)?(?::?[A-C]|\d~)(?:(\S+))?\s+)?(.+)/
+ @tab="\t"
+ if @md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @trans=SiSU_XML_munge::Trans.new(@md)
+ end
+ @sys=SiSU_Env::System_call.new
+ end
+ def songsheet
+ pre
+ markup
+ post
+ publish
+ end
+ protected
+ def embedded_endnotes(para='')
+ para.gsub!(/~\{(.+?)\}~/,
+ '<endnote><note>\1</note></endnote> ')
+ para.gsub!(/~\[([*+])\s+(.+?)\]~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ end
+ def xml_markup(para='')
+ para.gsub!(/~\[([*+])\s+(.+?)\]~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ para.gsub!(/~\{([*+]+)\s+(.+?)\}~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ para.gsub!(/~\{(.+?)\}~/,
+ '<endnote><note>\2</note></endnote> ')
+ end
+ def xml_head(meta)
+ txt=meta.text
+ txt.gsub!(/\/{(.+?)}\//,'<i>\1</i>')
+ txt.gsub!(/[*!]{(.+?)}[*!]/,'<b>\1</b>')
+ txt.gsub!(/_{(.+?)}_/,'<u>\1</u>')
+ txt.gsub!(/-{(.+?)}-/,'<del>\1</del>')
+ txt.gsub!(/<br(?: \/)?>/,'<br />')
+ txt.gsub!(/ & /,' and ')
+ @@xml[:head] <<<<WOK
+#{@tab}<header class="#{meta.attrib}">
+#{@tab*2}<#{meta.el}>
+#{@tab*3}#{txt}
+#{@tab*2}</#{meta.el}>
+#{@tab}</header>
+WOK
+ end
+ def xml_sc(md='')
+ sc=if @md.sc_info
+ <<WOK
+ <source_control>
+ <sc class="sourcefile">
+ #{@md.sc_filename}
+ </sc>
+ <sc class="number">
+ #{@md.sc_number}
+ </sc>
+ <sc class="date">
+ #{@md.sc_date}
+ </sc>
+ </source_control>
+WOK
+ else ''
+ end
+ @@xml[:sc]=sc
+ end
+ def xml_element(lv='',para='',hname='',tag='',xml_element='',xml_content='')
+ lv=lv.to_i
+ n=lv - 1
+ n1=lv
+ n2=lv + 1
+ n3=lv + 2
+ v=lv - 3
+ tag=''
+ tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname
+ @@xml[:body] <<<<WOK
+#{@tab*n}#{xml_element}
+#{@tab*n1}<heading>
+#{@tab*n2}<object>
+#{@tab*n3}<text>#{para[@regx,2]}</text>
+#{@tab*n2}</object>
+#{@tab*n1}</heading>#{xml_content}
+WOK
+ if lv == 4
+ @copen[1]=true
+ @copen[2]=@copen[3]=false
+ elsif lv == 5
+ @copen[2]=true
+ @copen[3]=false
+ elsif lv == 6
+ @copen[3]=true
+ end
+ end
+ def xml_structure(lv='',para='',hname='' )
+ puts lv if @md.cmd =~/[VM]/
+ lv=lv.to_i
+ n=lv - 1
+ n1=lv
+ n2=lv + 1
+ n3=lv + 2
+ v=lv - 3
+ tag=''
+ tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname !=nil
+ case lv
+ when 1..3
+ xml_element="<heading#{lv}>"
+ 3.downto(lv) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[1] or @cont[2] or @cont[3]
+ @cont[1]=false if @cont[1]
+ @cont[2]=false if @cont[2]
+ @cont[3]=false if @cont[3]
+ ####### attempt to close contents
+ if @copen[3] # 6{
+ [3,2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ @copen[1]=@copen[2]=@copen[3]=false
+ elsif @copen[2] # 5{
+ [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ @copen[1]=@copen[2]=@copen[3]=false
+ elsif @copen[1] # 4{
+ [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ @copen[1]=@copen[2]=@copen[3]=false
+ end
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x]
+ @level[x]=false
+ end
+ when 4..6
+ 6.downto(lv) do |x|
+ y=x - 1
+ if @level[x] == true
+ u=x - 3;
+ @xml_contents_close[x]=''
+ end
+ end
+ cv=lv - 3
+ xml_element="<contents#{cv}>"
+ xml_content="\n#{@tab*5}<content>"
+ case lv
+ when 4
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[1]
+ if @copen[3] == true # 6{
+ [3,2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ elsif @copen[2] == true # 5{
+ [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ elsif @copen[1] == true # 4{
+ [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ end
+ @cont[1]=true
+ when 5
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[2] or @cont[1]
+ if @copen[3] == true #6{
+ [3,2].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ elsif @copen[2] == true #5{
+ [2].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ end
+ @cont[2]=true
+ when 6
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[3] or @cont[2] or @cont[1]
+ [3].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" } if @copen[3]
+ @cont[3]=true
+ end
+ end
+ xml_element(lv,para,hname,tag,xml_element,xml_content)
+ @level[lv]=true
+ ((lv+1)..6).each { |x| @level[x]=false }
+ end
+ def group_structure(para='')
+ para.gsub!(/<:group(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*6}<object>} << "\n"
+ @@xml[:body] << %{#{@tab*7}<text class="group">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</text>\n}
+ @@xml[:body] << "#{@tab*6}</object>" << "\n"
+ end
+ def poem_structure(para='')
+ para.gsub!(/<:verse(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*6}<object>} << "\n"
+ @@xml[:body] << %{#{@tab*7}<text class="verse">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</text>\n}
+ @@xml[:body] << "#{@tab*6}</object>" << "\n"
+ end
+ def code_structure(para='')
+ para.gsub!(/<:code(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*6}<object>} << "\n"
+ @@xml[:body] << %{#{@tab*7}<text class="code">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</text>\n}
+ @@xml[:body] << "#{@tab*6}</object>" << "\n"
+ end
+ def table_structure(table='')
+ @@xml[:body] << %{#{@tab*0}<object>} << "\n"
+ @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ @endnotes=[]
+ end
+ def tidywords(wordlist)
+ wordlist.each do |x|
+ x.gsub!(/&/,'&amp;') unless x =~/&\S+;/
+ end
+ end
+ def markup
+ data=@data
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ xml_sc(@md)
+ @rcdc=false
+ @level,@cont,@copen,@xml_contents_close=[],[],[],[]
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @xml_contents_close[x]='' }
+ data.each do |para|
+ wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
+ para=tidywords(wordlist).join(' ').strip
+ para.gsub!(/<[-~]#>/,'')
+ para.gsub!(/<br\/?>/,'<br />')
+ para.gsub!(/<:pb>\s*/,'')
+ para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,
+ "<image.path>#{dir.url.images_local}/\\1</image.path>")
+ para.gsub!(/&nbsp;/,' ')
+ para=SiSU_document_structure::Structure.new(@md,para).structure
+ @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
+ if para =~/\A(?:@|0~)(\S+?):?\s+(.+?)\Z/m
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; xml_head(d_meta)
+ end
+ end
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/)
+ if para !~/(^0~|^@\S+?:|<ENDNOTES>|<EOF>)/
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para
+ unless @rcdc
+ if para !~/^(?:%\s|0~|@\S+?:)/
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(\S+)?/
+ xml_markup(para)
+ xml_structure($1,para,$2)
+ para=@sto.lev_para_ocn.heading_body1
+ when /^(2)~(\S+)?/
+ xml_markup(para)
+ xml_structure($1,para,$2)
+ para=@sto.lev_para_ocn.heading_body2
+ when /^(3)~(\S+)?/
+ xml_markup(para)
+ xml_structure($1,para,$2)
+ para=@sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)?/
+ xml_markup(para)
+ xml_structure($1,para,$2)
+ para=@sto.lev_para_ocn.heading_body4
+ when /^(5)~(\S+)?/
+ xml_markup(para)
+ xml_structure($1,para,$2)
+ para=@sto.lev_para_ocn.heading_body5
+ when /^(6)~(\S+)?/
+ xml_markup(para)
+ xml_structure($1,para,$2)
+ para=@sto.lev_para_ocn.heading_body6
+ #when /^(i1)$/i
+ # #format_scroll.gsubBody
+ # #para=@sto.lev_para_ocn.scrIndent1
+ #when /^(i2)$/i
+ # format_scroll.gsubBody
+ # para=@sto.lev_para_ocn.scrIndent2
+ #when /^(center)$/i
+ # para.gsub!(/(.+)/,
+ # %{<center>(\\1)</center>})
+ # para=@sto.lev_para_ocn.scrPara
+ #when /^(b|bold)$/i
+ # para.gsub!(/(.+)/,
+ # %{<b>(\\1)</b>})
+ # para=@sto.lev_para_ocn.scrPara
+ #when /null/ # see whether u can improve
+ # if (para !~/#{@margin.txt_0}|#{@margin.txt_1}|#{@margin.txt_2}/)
+ # #format_scroll.gsubBody
+ # #para=@sto.lev_para_ocn.scrPara
+ # end
+ else
+ if para =~ /<:verse>/
+ poem_structure(para)
+ elsif para =~ /<:group>/
+ group_structure(para)
+ elsif para =~ /<:code>/
+ para.gsub!(/</,'&lt;')
+ para.gsub!(/>/,'&gt;')
+ code_structure(para)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para)
+ para=table.table_split
+ @@xml[:body] << table_structure(para)
+ else #xml_structure
+ xml_markup(para)
+ @@xml[:body] << %{#{@tab*6}<object>} << "\n" if para[@regx] and para[@regx,2]
+ @@xml[:body] << "#{@tab*7}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*6}</object>" << "\n" if para[@regx]
+ end
+ end
+ elsif para =~/(Note|Endnotes?)/
+ elsif para =~/(MetaData)/ and para =~/<~\d+;[m]\d+;\w\d+><#{@@dp}:#{@@dp}>$/ #debug 2003w46 add rc info
+ format_scroll=Format_scroll.new(@md,'<br /><a name="metadata">MetaData</a>')
+ para=format_scroll.bold_para
+ elsif para =~/(Owner Details)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#{@@dp}:#{@@dp}>$/
+ format_scroll=Format_scroll.new(@md,'<br /><a name="owner.details">Owner Details</a>')
+ @@xml[:owner_details]=format_scroll.bold_para
+ para=''
+ elsif para =~/(.*)<:#>(.*)/
+ one,two=$1,$2
+ format_text=Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ if para =~/.*<:#>.*$/
+ para=case para
+ when /<:i1>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ when /<:i2>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ # where condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ else
+ end
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+!>/,' ')
+ end
+ end
+ @content_flag=true
+ 6.downto(4) do |x|
+ y=x - 1; v=x - 3
+ if @level[x] == true
+ if @content_flag==true
+ @@xml[:body] << "#{@tab*5}</content>\n#{@tab*y}</contents#{v}>\n"
+ @content_flag=false
+ else
+ @@xml[:body] << "\n#{@tab*y}</contents#{v}>\n"
+ end
+ end
+ end
+ 3.downto(1) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true
+ end
+ #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }
+ end
+ def pre
+ rdf=SiSU_XML_tags::RDF.new(@md)
+ dir=SiSU_Env::Info_env.new
+ @@xml[:head],@@xml[:body]=[],[]
+ css=SiSU_Env::CSS_select.new(@md).xml_sax
+ encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ end
+ @@xml[:open] =<<WOK
+#{encoding}
+<?xml-stylesheet type="text/css" href="../#{dir.path.style}/#{css}"?>
+#{rdf.comment_xml_dom}
+<document>
+WOK
+ @@xml[:head] << "<head>\n"
+ @@xml[:body] << "<body>\n"
+ end
+ def post
+ @@xml[:head] << @@xml[:sc]
+ @@xml[:head] << "</head>\n"
+ @@xml[:body] << "</body>\n"
+ @@xml[:close] = "</document>\n"
+ end
+ def publish
+ content=[]
+ data=@data
+ content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
+ content << @@xml[:owner_details] if @md.stmp =~/\w\w/
+ content << @@xml[:tail] << @@xml[:close]
+ Output.new(content.to_s,@md).xml
+ @@xml={}
+ end
+ end
+ class Output
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def xml
+ @sisu=[]
+ @data.each do |para|
+ para.gsub!(/\/\{(.+?)\}\//,'<italic>\1</italic>')
+ para.gsub!(/\*\{(.+?)\}\*/,'<bold>\1</bold>')
+ para.gsub!(/!\{(.+?)\}!/,'<bold>\1</bold>')
+ para.gsub!(/_\{(.+?)\}_/,'<underscore>\1</underscore>')
+ para.gsub!(/-\{(.+?)\}-/,'<strike>\1</strike>')
+ # do { links }http://url
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+?!>/,'')
+ para="#{para}\n" unless para.empty?
+ @sisu << para
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.scan(/.+/)
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxd]).mkfile_pwd
+ if filename_sxm.class == File
+ @sisu.each {|para| filename_sxm.puts para}
+ filename_sxm.close
+ else puts 'file not created, is directory writable?'
+ end
+ end
+ end
+ class Tidy
+ def initialize(md,dir)
+ @md,@env=md,dir
+ @prog=SiSU_Env::Info_program.new
+ end
+ def xml
+ if @prog.tidy !=false #note values can be other than true
+ if @md.cmd =~/[VM]/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
+ tell.colorize unless @md.cmd =~/q/
+ tell.grey_open unless @md.cmd =~/q/
+ tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
+ tidy =SiSU_Env::System_call.new("#{Dir.pwd}/#{@md.fn[:sxd]}",tidyfile)
+ tidy.well_formed?
+ tell.p_off unless @md.cmd =~/q/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/sst_to_s_xml_node.rb b/lib/sisu/0.52/sst_to_s_xml_node.rb
new file mode 100644
index 00000000..3ff58c2b
--- /dev/null
+++ b/lib/sisu/0.52/sst_to_s_xml_node.rb
@@ -0,0 +1,636 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: simple xml representation (node style)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_simple_xml_model_node
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/dal_syntax'
+ require SiSU_lib + '/dal_doc_str'
+ require SiSU_lib + '/shared_xml'
+ require SiSU_lib + '/xml_format'
+ include SiSU_XML_format
+ include SiSU_XML_munge
+ require SiSU_lib + '/rexml'
+ include SiSU_Rexml
+ @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0
+ @@tablefoot=''
+ class Convert
+ @@fns=nil
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get #bug, relies on info persistence, assumes -m has previously been run
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/[MV]/; "#{Dir.pwd}/#{@md.fn[:sxn]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sxn]}"
+ elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{Dir.pwd}/#{@md.fn[:sxn]}"
+ else ''
+ end
+ SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML Node',"#{@md.fns} -> #{@md.fn[:sxn]}").colorize unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{Dir.pwd}/#{@md.fn[:sxn]}")
+ tell.flow if @opt.cmd =~/[MV]/
+ unless @@fns==@opt.fns
+ @@fns=@opt.fns
+ @@dal_array=[]
+ end
+ @dal_array=if @@dal_array.empty?; read_fnm
+ else @@dal_array.dup #.dup #jokes on you
+ end
+ SiSU_simple_xml_model_node::Convert::Songsheet.new(@dal_array,@md,@env).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure #file closed in songsheet
+ end
+ end
+ def read_fnm
+ dal=[]
+ if FileTest.file?("#{Dir.pwd}/#{@opt.fns}")
+ dal=IO.readlines("#{Dir.pwd}/#{@opt.fns}","\n\n")
+ else puts 'Error'
+ end
+ end
+ private
+ class Songsheet
+ def initialize(data,md,dir)
+ @data,@md,@env=data,md,dir
+ end
+ def songsheet
+ begin
+ SiSU_simple_xml_model_node::Convert::Scroll.new(@data,@md).songsheet
+ SiSU_simple_xml_model_node::Convert::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:sxn]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ class Scroll
+ require SiSU_lib + '/shared_txt'
+ require SiSU_lib + '/css'
+ include SiSU_text_utils
+ @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] }
+ @@parent={ :ocn=>[],:node=>[] }
+ @@offspring={ :ocn=>[],:node=>[] }
+ @@current=nil
+ def initialize(data='',md=nil)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @regx=/^(?:(?:<:p[bn]>\s*)?(?::?[A-C]~|\d~)(?:(\S+))?\s+)?(.+)/
+ @tab="\t"
+ if @md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @trans=SiSU_XML_munge::Trans.new(@md)
+ end
+ @sys=SiSU_Env::System_call.new
+ @ocn=[]
+ @node={ :ocn=>[],:no=>[] }
+ end
+ def songsheet
+ pre
+ markup
+ post
+ publish
+ end
+ protected
+ def embedded_endnotes(para='')
+ para.gsub!(/~\{(.+?)\}~/,'<endnote symbol="norm">\1</endnote> ')
+ para.gsub!(/~\[([*+])\s+(.+?)\]~/,'<endnote symbol="\1">\2</endnote> ')
+ end
+ def xml_head(meta)
+ txt=meta.text
+ txt.gsub!(/\/{(.+?)}\//,'<i>\1</i>')
+ txt.gsub!(/[*!]{(.+?)}[*!]/,'<b>\1</b>')
+ txt.gsub!(/_{(.+?)}_/,'<u>\1</u>')
+ txt.gsub!(/-{(.+?)}-/,'<del>\1</del>')
+ txt.gsub!(/<br(?: \/)?>/,'<br />')
+ txt.gsub!(/ & /,' and ')
+ @@xml[:head] <<<<WOK
+#{@tab}<header class="#{meta.attrib}">
+#{@tab*2}<#{meta.el}>
+#{@tab*3}#{txt}
+#{@tab*2}</#{meta.el}>
+#{@tab}</header>
+WOK
+ end
+ def xml_sc(md='')
+ sc=if @md.sc_info
+ <<WOK
+ <source_control>
+ <sc class="sourcefile">
+ #{@md.sc_filename}
+ </sc>
+ <sc class="number">
+ #{@md.sc_number}
+ </sc>
+ <sc class="date">
+ #{@md.sc_date}
+ </sc>
+ </source_control>
+WOK
+ else ''
+ end
+ @@xml[:sc]=sc
+ end
+ def parent
+ def node
+ @@parent[:node]
+ end
+ def ocn
+ @@parent[:ocn]
+ end
+ def prt_node
+ parent.node.each_with_index { |a,n| puts "n.#{n} a.#{a}" unless n == 0 } #x == node
+ end
+ def prt_ocn
+ parent.ocn.each_with_index { |a,n| puts "n.#{n} a.#{a}" unless n == 0 } #x == node
+ end
+ self
+ end
+ def offspring
+ def node
+ @@offspring=if parent.node
+ @offspring=[]
+ parent.node.each_with_index do |n,o|
+ if n
+ @offspring[n] ||=[]
+ @offspring[n] << o
+ end
+ end
+ @offspring
+ else @@offspring
+ end
+ end
+ self
+ end
+ def build_relationships(o='',lv='')
+ if lv.to_s =~/[0-6]/
+ @node[:ocn][lv]=o.ocn
+ @node[:no][lv]=o.node
+ end
+ if lv.to_s =~/^[1-6]/; @@current=lv
+ end
+ if o.node == 1 or lv == 1
+ @@parent[:node][o.node]=0
+ elsif @@current == lv and @@current !=nil
+ if @node[:no][lv-1] != nil
+ @@parent[:node][o.node]=@node[:no][lv-1]
+ elsif @node[:no][lv-2] != nil
+ @@parent[:node][o.node]=@node[:no][lv-2]
+ elsif @node[:no][lv-3] != nil:
+ @@parent[:node][o.node]=@node[:no][lv-3]
+ else puts 'error'
+ end
+ elsif lv == nil
+ if o.ocn.class == Fixnum and @@current
+ @@parent[:node][o.node]=@node[:no][@@current]
+ end
+ else puts 'error'
+ end
+ if @@current == lv and @@current !=nil
+ if @node[:ocn][lv-1] != nil
+ @@parent[:ocn][o.ocn]=@node[:ocn][lv-1]
+ elsif @node[:ocn][lv-2] != nil
+ @@parent[:ocn][o.ocn]=@node[:ocn][lv-2]
+ elsif @node[:ocn][lv-3] != nil:
+ @@parent[:ocn][o.ocn]=@node[:ocn][lv-3]
+ else puts 'error'
+ end
+ elsif lv == nil
+ if o.ocn.class == Fixnum and @@current
+ @@parent[:ocn][o.ocn]=@node[:ocn][@@current]
+ end
+ else puts 'error'
+ end
+ end
+ def node_structure(o='',para='',lv='',hname='') #extracted endnotes
+ if o.ocn
+ lv=lv.to_i
+ lv=nil if lv == 0
+ build_relationships(o,lv)
+ end
+ end
+ def xml_structure(o='',para='',lv='',hname='') #extracted endnotes
+ if o.ocn
+ puts para if lv and @md.cmd =~/M/
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ embedded_endnotes(para)
+ if para[@regx]
+ paragraph="#{para[@regx,2]}"
+ util=SiSU_text_utils::Wrap.new(paragraph,70)
+ wrapped=util.line_wrap
+ end
+ if @md.cmd =~/[VM]/
+ if offspring.node[o.node]
+ puts "#{o.node}::#{parent.node[o.node]}::[#{offspring.node[o.node].join(',')}]"
+ else
+ puts "#{o.node}::#{parent.node[o.node]}"
+ end
+ end
+ @@xml[:body] << "#{@tab*0}<object>" if para[@regx]
+ #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv
+ @@xml[:body] << "#{@tab*1}" << "\n" if para[@regx]
+ if @md.mod.inspect =~/odf/ #condition not currently present, but consider
+ @@xml[:body] << %{#{@tab*1}<ocn>#{o.ocn}</ocn>\n}
+ end
+ @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"
+ elsif wrapped =~/\A%%?\s+/; %{<!--\n#{@tab*1}<text class="comment">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n-->\n} # comments [not included, review]
+ else %{#{@tab*1}<text class="norm">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} # main text, contents, body KEEP
+ end
+ #@@xml[:body] << "#{@tab*1}<text>\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n" # main text, contents, body KEEP
+ @@xml[:body] << "#{@endnotes}" if @endnotes # main text, endnotes KEEP
+ ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP
+ @@xml[:body] << %{#{@tab*1}<node>\n}
+ @@xml[:body] << %{#{@tab*2}<id>#{o.node}</id>\n}
+ @@xml[:body] << %{#{@tab*2}<parent>#{parent.node[o.node]}</parent>\n}
+ if offspring.node[o.node]
+ @@xml[:body] << %{#{@tab*2}<offspring>#{offspring.node[o.node].join(',')}</offspring>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}</node>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx]
+ @endnotes=[]
+ end
+ end
+ def group_structure(o='',para='')
+ para.gsub!(/<:group(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object>}
+ if @md.mod.inspect =~/odf/
+ @@xml[:body] << %{#{@tab*1}<ocn>#{o.ocn}</ocn>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}<text class="group">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << %{#{@tab*1}<node>\n}
+ @@xml[:body] << %{#{@tab*2}<id>#{o.node}</id>\n}
+ @@xml[:body] << %{#{@tab*2}<parent>#{parent.node[o.node]}</parent>\n}
+ if offspring.node[o.node]
+ @@xml[:body] << %{#{@tab*2}<offspring>#{offspring.node[o.node].join(',')}</offspring>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}</node>\n}
+ @@xml[:body] << "#{@tab*0}</object>"
+ end
+ def poem_structure(o='',para='')
+ para.gsub!(/<:verse(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object>}
+ if @md.mod.inspect =~/odf/
+ @@xml[:body] << %{#{@tab*1}<ocn>#{o.ocn}</ocn>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}<text class="verse">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << %{#{@tab*1}<node>\n}
+ @@xml[:body] << %{#{@tab*2}<id>#{o.node}</id>\n}
+ @@xml[:body] << %{#{@tab*2}<parent>#{parent.node[o.node]}</parent>\n}
+ if offspring.node[o.node]
+ @@xml[:body] << %{#{@tab*2}<offspring>#{offspring.node[o.node].join(',')}</offspring>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}</node>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def code_structure(o='',para='')
+ para.gsub!(/<:code(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object>}
+ if @md.mod.inspect =~/odf/
+ @@xml[:body] << %{#{@tab*1}<ocn>#{o.ocn}</ocn>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}<text class="code">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << %{#{@tab*1}<node>\n}
+ @@xml[:body] << %{#{@tab*2}<id>#{o.node}</id>\n}
+ @@xml[:body] << %{#{@tab*2}<parent>#{parent.node[o.node]}</parent>\n}
+ if offspring.node[o.node]
+ @@xml[:body] << %{#{@tab*2}<offspring>#{offspring.node[o.node].join(',')}</offspring>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}</node>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def table_structure(o='',table='') #tables
+ @@xml[:body] << %{#{@tab*0}<object>}
+ if @md.mod.inspect =~/odf/
+ @@xml[:body] << %{#{@tab*1}<ocn>#{o.ocn}</ocn>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP
+ @@xml[:body] << %{#{@tab*1}<node>\n}
+ @@xml[:body] << %{#{@tab*2}<id>#{o.node}</id>\n}
+ @@xml[:body] << %{#{@tab*2}<parent>#{parent.node[o.node]}</parent>\n}
+ if offspring.node[o.node]
+ @@xml[:body] << %{#{@tab*2}<offspring>#{offspring.node[o.node].join(',')}</offspring>\n}
+ end
+ @@xml[:body] << %{#{@tab*1}</node>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]
+ @endnotes=[]
+ end
+ def markup
+ data=[]
+ @data=@data.join.split("\n\n")
+ @data=SiSU_document_structure::Code.new(@md,@data).code
+ @data.each do |para|
+ data << SiSU_document_structure::Structure.new(@md,para).structure
+ end
+ data=Syntax::Markup.new(@md,data).songsheet
+ data=SiSU_document_structure::Tables.new(@md,data).tables
+ obj=SiSU_document_structure::OCN.new(@md,data).ocn
+ obj.compact!
+ data=nil
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ xml_sc(@md)
+ @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]
+ @rcdc=false
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @xml_contents_close[x]='' }
+ obj.each do |o|
+ para=o.txt unless o.txt =~/^%% / #comments are lost, consider
+ if para
+ para=@trans.markup_light(para)
+ @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
+ if para =~/\A(?:@|0~)(\S+?):?\s+(.+?)\Z/m # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; xml_head(d_meta)
+ end
+ end
+ end
+ end
+ obj.each do |o|
+ para=o.txt unless o.txt =~/^%% / #comments are lost, consider
+ if para
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/)
+ if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para
+ unless @rcdc
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(\S+)?/
+ node_structure(o,para,$1,$2)
+ when /^(2)~(\S+)?/
+ node_structure(o,para,$1,$2)
+ when /^(3)~(\S+)?/
+ node_structure(o,para,$1,$2)
+ when /^(4)~(\S+)?/ # work on see Split_text_object
+ node_structure(o,para,$1,$2)
+ when /^(5)~(\S+)?/
+ node_structure(o,para,$1,$2)
+ when /^(6)~(\S+)?/
+ node_structure(o,para,$1,$2)
+ else
+ if para =~ /<:verse>/
+ node_structure(o,para)
+ elsif para =~ /<:group>/
+ node_structure(o,para)
+ elsif para =~ /<:code>/
+ node_structure(o,para)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para)
+ para=table.table_split
+ node_structure(o,para)
+ else node_structure(o,para,nil,nil)
+ end
+ end
+ end
+ end
+ end
+ end
+ obj.each do |o|
+ para=o.txt unless o.txt =~/^%% / #comments are lost, consider
+ if para
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/)
+ if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para
+ unless @rcdc
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(\S+)?/
+ xml_structure(o,para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body1
+ when /^(2)~(\S+)?/
+ xml_structure(o,para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body2
+ when /^(3)~(\S+)?/
+ xml_structure(o,para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)?/ # work on see Split_text_object
+ xml_structure(o,para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body4
+ when /^(5)~(\S+)?/
+ xml_structure(o,para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body5
+ when /^(6)~(\S+)?/
+ xml_structure(o,para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body6
+ else
+ if para =~ /<:verse>/
+ poem_structure(o,para)
+ elsif para =~ /<:group>/
+ group_structure(o,para)
+ elsif para =~ /<:code>/
+ para.gsub!(/</,'&lt;')
+ para.gsub!(/>/,'&gt;')
+ code_structure(o,para)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para)
+ para=table.table_split
+ table_structure(o,para)
+ else xml_structure(o,para,nil,nil)
+ end
+ end
+ para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ if para =~/.*<:#>.*$/
+ para=case para
+ when /<:i1>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ when /<:i2>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ end
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+!>/,'') ## Clean Prepared Text #bugwatch reinstate
+ end
+ end
+ end
+ 6.downto(4) do |x|
+ y=x - 1; v=x - 3
+ @@xml[:body] << "#{@tab*5}</content>\n#{@tab*y}</contents#{v}>\n" if @level[x] == true
+ end
+ 3.downto(1) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true
+ end
+ #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }
+ end
+ def pre
+ rdf=SiSU_XML_tags::RDF.new(@md)
+ dir=SiSU_Env::Info_env.new
+ @@xml[:head],@@xml[:body]=[],[]
+ css=SiSU_Env::CSS_select.new(@md).xml_sax
+ encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ end
+ @@xml[:open] =<<WOK
+#{encoding}
+<?xml-stylesheet type="text/css" href="../#{dir.path.style}/#{css}"?>
+#{rdf.comment_xml_node}
+<document>
+WOK
+ @@xml[:head] << "<head>\n"
+ @@xml[:body] << "<body>\n"
+ end
+ def post
+ @@xml[:head] << @@xml[:sc]
+ @@xml[:head] << "</head>\n"
+ @@xml[:body] << "</body>\n"
+ @@xml[:close] = "</document>\n"
+ end
+ def publish
+ content=[]
+ data=@data
+ content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
+ content << @@xml[:owner_details] if @md.stmp =~/\w\w/
+ content << @@xml[:tail] << @@xml[:close]
+ Output.new(content.to_s,@md).xml
+ @@xml={}
+ end
+ end
+ class Output
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def xml
+ @sisu=[]
+ @data.each do |para|
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+?!>/,'')
+ para="#{para}\n" unless para.empty?
+ @sisu << para
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.scan(/.+/)
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxn]).mkfile_pwd
+ if filename_sxm.class == File
+ @sisu.each {|para| filename_sxm.puts para}
+ filename_sxm.close
+ else puts 'file not created, is directory writable?'
+ end
+ end
+ end
+ class Tidy
+ def initialize(md,dir)
+ @md,@env=md,dir
+ @prog=SiSU_Env::Info_program.new
+ end
+ def xml
+ if @prog.tidy !=false #note values can be other than true
+ if @md.cmd =~/[VM]/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
+ tell.colorize unless @md.cmd =~/q/
+ tell.grey_open unless @md.cmd =~/q/
+ tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
+ tidy=SiSU_Env::System_call.new("#{Dir.pwd}/#{@md.fn[:sxn]}",tidyfile)
+ tidy.well_formed?
+ tell.p_off unless @md.cmd =~/q/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
+Notes:
+
+ocn
+ocn are given to substantive text objects
+
+nodes
+nodes != ocn
+nodes are given to every text object (regardless of whether or not it is "substantive" and/or introduced by the editor just for structuring purposes)
+
+nodes are required for a node/tree based representation of content, e.g. a document mapping tool such as kdissert
+nodes are given to all structural divisions/headings whether or not they are given an ocn
+
+why arn't all structural divisions given an ocn?
+sometimes to structure documents correctly, it is necessary to introduce a dummy level, e.g. using a marker like
+4~ [Preamble]-#
+these are heading items that are not in the original text, and do not warrant an ocn
+they do however require a node value
+
+[at other times the editor introduces a comment that is not to be recognised as a part of the original text]
+
+it is unofortunate that the nature of documents is such that ocn != nodes
+[that ocn should be the equivalent of nodes has been rejected]
+
+map
+parent <parent>x</parent>
+parent of 1 is either 0 or as in kdissert -1 (i prefer 0)
+offspring <offspring>x..y</offspring>
+siblings - gratuitous, <siblings>x..y</siblings> and therefore optional but might as well
diff --git a/lib/sisu/0.52/sst_to_s_xml_sax.rb b/lib/sisu/0.52/sst_to_s_xml_sax.rb
new file mode 100644
index 00000000..f94fbc9f
--- /dev/null
+++ b/lib/sisu/0.52/sst_to_s_xml_sax.rb
@@ -0,0 +1,434 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: simple xml representation (sax style)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_simple_xml_model_sax
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/dal_doc_str'
+ require SiSU_lib + '/shared_xml'
+ require SiSU_lib + '/xml_format'
+ include SiSU_XML_format
+ include SiSU_XML_munge
+ require SiSU_lib + '/rexml'
+ include SiSU_Rexml
+ @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0
+ @@tablefoot=''
+ class Convert
+ @@fns=nil
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get #bug, relies on info persistence, assumes -m has previously been run
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/[MV]/; "#{Dir.pwd}/#{@md.fn[:sxs]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sxs]}"
+ elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{Dir.pwd}/#{@md.fn[:sxs]}"
+ else ''
+ end
+ SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML SAX',"#{@md.fns} -> #{@md.fn[:sxs]}").colorize unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{Dir.pwd}/#{@md.fn[:sxs]}").flow if @opt.cmd =~/[MV]/
+ unless @@fns==@opt.fns
+ @@fns=@opt.fns
+ @@dal_array=[]
+ end
+ @dal_array=if @@dal_array.empty?; read_fnm
+ else @@dal_array.dup #check
+ end
+ SiSU_simple_xml_model_sax::Convert::Songsheet.new(@dal_array,@md,@env).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure #file closed in songsheet
+ end
+ end
+ def read_fnm
+ dal=[]
+ if FileTest.file?("#{Dir.pwd}/#{@opt.fns}")
+ dal=IO.readlines("#{Dir.pwd}/#{@opt.fns}","\n\n")
+ else puts 'Error'
+ end
+ end
+ private
+ class Songsheet
+ def initialize(data,md,dir)
+ @data,@md,@env=data,md,dir
+ end
+ def songsheet
+ begin
+ SiSU_simple_xml_model_sax::Convert::Scroll.new(@data,@md).songsheet
+ SiSU_simple_xml_model_sax::Convert::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:sxs]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ class Scroll
+ require SiSU_lib + '/shared_txt'
+ require SiSU_lib + '/css'
+ include SiSU_text_utils
+ @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] }
+ def initialize(data='',md=nil)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @regx=/^(?:(?:<:p[bn]>\s*)?(?::?[A-C]~|\d~)(?:(\S+))?\s+)?(.+)/
+ @tab="\t"
+ if @md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @trans=SiSU_XML_munge::Trans.new(@md)
+ end
+ @sys=SiSU_Env::System_call.new
+ end
+ def songsheet
+ pre
+ markup
+ post
+ publish
+ end
+ protected
+ def embedded_endnotes(para='')
+ para.gsub!(/~\{(.+?)\}~/,'<endnote symbol="norm">\1</endnote> ')
+ para.gsub!(/~\[([*+])\s+(.+?)\]~/,'<endnote symbol="\1">\2</endnote> ')
+ end
+ def xml_head(meta)
+ txt=meta.text
+ txt.gsub!(/\/{(.+?)}\//,'<i>\1</i>')
+ txt.gsub!(/[*!]{(.+?)}[*!]/,'<b>\1</b>')
+ txt.gsub!(/_{(.+?)}_/,'<u>\1</u>')
+ txt.gsub!(/-{(.+?)}-/,'<del>\1</del>')
+ txt.gsub!(/<br(?: \/)?>/,'<br />')
+ txt.gsub!(/ & /,' and ')
+ @@xml[:head] <<<<WOK
+#{@tab}<header class="#{meta.attrib}">
+#{@tab*2}<#{meta.el}>
+#{@tab*3}#{txt}
+#{@tab*2}</#{meta.el}>
+#{@tab}</header>
+WOK
+ end
+ def xml_sc(md='')
+ sc=if @md.sc_info
+ <<WOK
+ <source_control>
+ <sc class="sourcefile">
+ #{@md.sc_filename}
+ </sc>
+ <sc class="number">
+ #{@md.sc_number}
+ </sc>
+ <sc class="date">
+ #{@md.sc_date}
+ </sc>
+ </source_control>
+WOK
+ else ''
+ end
+ @@xml[:sc]=sc
+ end
+ def xml_structure(para='',lv='',hname='') #extracted endnotes
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ embedded_endnotes(para)
+ if para[@regx]
+ paragraph="#{para[@regx,2]}"
+ util=SiSU_text_utils::Wrap.new(paragraph,70)
+ wrapped=util.line_wrap
+ end
+ @@xml[:body] << "#{@tab*0}<object>" if para[@regx]
+ #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv
+ @@xml[:body] << "#{@tab*1}" << "\n" if para[@regx]
+ @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"
+ elsif wrapped =~/\A%%?\s+/; %{<!--\n#{@tab*1}<text class="comment">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n-->\n} # comments
+ else %{#{@tab*1}<text class="norm">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} # main text, contents, body KEEP
+ end
+ #@@xml[:body] << "#{@tab*1}<text>\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n" # main text, contents, body KEEP
+ @@xml[:body] << "#{@endnotes}" if @endnotes # main text, endnotes KEEP
+ ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx]
+ @endnotes=[]
+ end
+ def group_structure(para='')
+ para.gsub!(/<:group(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object>}
+ @@xml[:body] << %{#{@tab*1}<text class="group">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>"
+ end
+ def poem_structure(para='')
+ para.gsub!(/<:verse(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object>}
+ @@xml[:body] << %{#{@tab*1}<text class="verse">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def code_structure(para='')
+ para.gsub!(/<:code(?:-end)?>/,'')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object>}
+ @@xml[:body] << %{#{@tab*1}<text class="code">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def table_structure(table='') #tables
+ @@xml[:body] << %{#{@tab*0}<object>}
+ @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]
+ @endnotes=[]
+ end
+ def tidywords(wordlist)
+ wordlist.each do |x|
+ x.gsub!(/&/,'&amp;') unless x =~/&\S+;/
+ end
+ end
+ def markup
+ data=[]
+ #@data=@data.join.split("\n\n")
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ xml_sc(@md)
+ @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]
+ @rcdc=false
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @xml_contents_close[x]='' }
+ @data.each do |para|
+ data << SiSU_document_structure::Structure.new(@md,para).structure
+ end
+ data.each do |para|
+ para=@trans.markup_light(para)
+ @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
+ if para =~/\A(?:@|0~)(\S+?):?\s+(.+?)\Z/m # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; xml_head(d_meta)
+ end
+ end
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/)
+ if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para
+ unless @rcdc
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(\S+)?/
+ xml_structure(para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body1
+ when /^(2)~(\S+)?/
+ xml_structure(para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body2
+ when /^(3)~(\S+)?/
+ xml_structure(para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)?/ # work on see Split_text_object
+ xml_structure(para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body4
+ when /^(5)~(\S+)?/
+ xml_structure(para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body5
+ when /^(6)~(\S+)?/
+ xml_structure(para,$1,$2)
+ para=@sto.lev_para_ocn.heading_body6
+ #when /^(i1)$/i
+ # #format_scroll.gsubBody
+ # #para=@sto[:lev_para_ocn].scrIndent1
+ #when /^(i2)$/i
+ # format_scroll.gsubBody
+ # para=@sto[:lev_para_ocn].scrIndent2
+ #when /^(center)$/i
+ # para.gsub!(/(.+)/,
+ # %{<center>(\\1)</center>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /^(b|bold)$/i
+ # para.gsub!(/(.+)/,
+ # %{<b>(\\1)</b>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /null/ # see whether u can improve
+ # if (para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/)
+ # #format_scroll.gsubBody
+ # #para=@sto[:lev_para_ocn].scrPara
+ # end
+ else
+ if para =~ /<:verse>/
+ poem_structure(para)
+ elsif para =~ /<:group>/
+ group_structure(para)
+ elsif para =~ /<:code>/
+ para.gsub!(/</,'&lt;')
+ para.gsub!(/>/,'&gt;')
+ code_structure(para)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para)
+ para=table.table_split
+ table_structure(para)
+ else xml_structure(para,nil,nil)
+ end
+ end
+ para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ if para =~/.*<:#>.*$/
+ para=case para
+ when /<:i1>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ when /<:i2>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ end
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+!>/,'') ## Clean Prepared Text #bugwatch reinstate
+ end
+ end
+ 6.downto(4) do |x|
+ y=x - 1; v=x - 3
+ @@xml[:body] << "#{@tab*5}</content>\n#{@tab*y}</contents#{v}>\n" if @level[x] == true
+ end
+ 3.downto(1) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true
+ end
+ #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }
+ end
+ def pre
+ rdf=SiSU_XML_tags::RDF.new(@md)
+ dir=SiSU_Env::Info_env.new
+ @@xml[:head],@@xml[:body]=[],[]
+ css=SiSU_Env::CSS_select.new(@md).xml_sax
+ encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ end
+ @@xml[:open] =<<WOK
+#{encoding}
+<?xml-stylesheet type="text/css" href="../#{dir.path.style}/#{css}"?>
+#{rdf.comment_xml_sax}
+<document>
+WOK
+ @@xml[:head] << "<head>\n"
+ @@xml[:body] << "<body>\n"
+ end
+ def post
+ @@xml[:head] << @@xml[:sc]
+ @@xml[:head] << "</head>\n"
+ @@xml[:body] << "</body>\n"
+ @@xml[:close] = "</document>\n"
+ end
+ def publish
+ content=[]
+ data=@data
+ content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
+ content << @@xml[:owner_details] if @md.stmp =~/\w\w/
+ content << @@xml[:tail] << @@xml[:close]
+ Output.new(content.to_s,@md).xml
+ @@xml={}
+ end
+ end
+ class Output
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def xml
+ @sisu=[]
+ @data.each do |para|
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+?!>/,'')
+ para="#{para}\n" unless para.empty?
+ @sisu << para
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.scan(/.+/)
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxs]).mkfile_pwd
+ if filename_sxm.class == File
+ @sisu.each {|para| filename_sxm.puts para}
+ filename_sxm.close
+ else puts 'file not created, is directory writable?'
+ end
+ end
+ end
+ class Tidy
+ def initialize(md,dir)
+ @md,@env=md,dir
+ @prog=SiSU_Env::Info_program.new
+ end
+ def xml
+ if @prog.tidy !=false #note values can be other than true
+ if @md.cmd =~/[VM]/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
+ tell.colorize unless @md.cmd =~/q/
+ tell.grey_open unless @md.cmd =~/q/
+ tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
+ tidy =SiSU_Env::System_call.new("#{Dir.pwd}/#{@md.fn[:sxs]}",tidyfile)
+ tidy.well_formed?
+ tell.p_off unless @md.cmd =~/q/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/sysenv.rb b/lib/sisu/0.52/sysenv.rb
new file mode 100644
index 00000000..9bd2e977
--- /dev/null
+++ b/lib/sisu/0.52/sysenv.rb
@@ -0,0 +1,2517 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: system environment, resource control and configuration details
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+@@cX=nil
+@@current_document=Dir.pwd #nil #''
+module SiSU_Env
+ require 'fileutils'
+ require 'singleton'
+ include FileUtils::Verbose
+ @@noyaml=false
+ class Info_date
+ require 'date'
+ attr_accessor :dt,:t
+ def initialize
+ @dt,@t=Date.today.to_s,Time.now
+ end
+ def week
+ w=@t.strftime("%W")
+ "#{@t.year}w#{w}"
+ end
+ def month
+ "#{@t.year}#{@t.month}"
+ end
+ def year
+ @t.year
+ end
+ def weekonly
+ #@t.cweek
+ @t.strftime("%W")
+ end
+ def monthonly
+ @t.month
+ end
+ end
+ class Info_system
+ require 'rbconfig'
+ include Singleton
+ @@user,@@home,@@hostname,@@pwd,@@sisu_etc,@@host,@@arch,@@rbver,@@dir_arch,@@dir_sitearch,@@dir_bin,@@locale,@@rc,@@ad=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'],Config::CONFIG['sysconfdir'] + '/sisu',Config::CONFIG['host'],Config::CONFIG['arch'],%x{ruby -v}.strip,Config::CONFIG['archdir'],Config::CONFIG['sitearchdir'],Config::CONFIG['bindir'],%x{locale charmap}.strip,nil,{} # %x{ruby -v}.strip # Config::CONFIG['rb_ver']
+ out=Config::CONFIG['localstatedir']
+ etc=Config::CONFIG['sysconfdir'] + '/sisu'
+ share=Config::CONFIG['datadir'] + '/sisu'
+ data=Config::CONFIG['datadir'] + '/sisu-examples/sample'
+ m=/.+\/(\S+)/m
+ @stub_pwd ||=@@pwd[m,1]
+ prcss_dir='_sisu_processing'
+ prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}"
+ @processing_dir=if @@home and File.writable?("#{@@home}/."); "#{@@home}/#{prcss_dir_stub}"
+ #elsif File.writable?("#{@@pwd}/."); "#{@@pwd}/#{prcss_dir}"
+ else prcss_dir_stub
+ end
+ tmp_processing=if @@user; "/tmp/#{prcss_dir}/#{@@user}/#{@stub_pwd}"
+ else "/tmp/#{prcss_dir_stub}"
+ end
+ user=ENV['USER']
+ port_pgsql=if defined? ENV['PGPORT'] and not (ENV['PGPORT'].nil? or ENV['PGPORT'].empty?) and ENV['PGPORT']=~/^\d+$/; ENV['PGPORT']
+ else '5432'
+ end
+ IMAGES=:images
+ SISU_ETC=:sisu_etc
+ SISU_SHARE=:sisu_share
+ SAMPLE_DATA_PATH=:sample_data_path
+ IMAGE_STUB=:image_stub
+ STYLESHEET_STUB=:stylesheet_stub
+ IMAGE_LOCAL=:image_local
+ WEBSERV_PATH=:webserv_path
+ WEBSERV_MAN=:webserv_man
+ WEBSERV_PHP=:webserv_php
+ WEBSERV_CGI=:webserv_cgi
+ WEBSERV_RSS=:webserv_rss
+ WEBSERV_SQLITE=:webserv_sqlite
+ OUTPUT_LOCAL=:output_local
+ PROCESSING_PATH=:processing_path
+ PROCESSING_PATH_TMP=:processing_path_tmp
+ PROCESSING_PATH_TMP_BASE=:processing_path_tmp_base
+ PROCESSING_DAL=:processing_dal
+ PROCESSING_TUNE=:processing_tune
+ PROCESSING_LATEX=:processing_latex
+ PROCESSING_TEXINFO=:processing_texinfo
+ PROCESSING_LOUT=:processing_lout
+ PROCESSING_ENCODING=:processing_encoding
+ PAPERSIZE=:papersize
+ LANGUAGE=:language
+ LANGUAGE_CODE=:language_code
+ MULTILINGUAL=:multilingual
+ CONCORD_MAX=:concord_max
+ DIGEST=:digest
+ WEBSERV_HOST_CGI=:webserv_host_cgi
+ WEBSERV_PORT_CGI=:webserv_port_cgi
+ POSTGRESQL_USER=:postgresql_user
+ POSTGRESQL_PORT=:postgresql_port
+ SQLITE_USER=:sqlite_user
+ SQLITE_PATH=:sqlite_path
+ SQLITE_PORT=:sqlite_port
+ DEFAULT_DIR={
+ IMAGES => '_sisu/image',
+ SISU_ETC => etc,
+ SISU_SHARE => share,
+ SAMPLE_DATA_PATH => data,
+ IMAGE_STUB => '_sisu/image',
+ STYLESHEET_STUB => '_sisu/css',
+ IMAGE_LOCAL => @@pwd + '/_sisu/image',
+ WEBSERV_PATH => out + '/www',
+ #WEBSERV_DIR => www, # uncomment for urls...
+ #WEBSERV_IMAGE => out + '/www/_sisu/image',
+ WEBSERV_MAN => out + '/www/man', #alter
+ WEBSERV_PHP => out + '/www/php',
+ WEBSERV_CGI => '/usr/lib/cgi-bin',
+ WEBSERV_RSS => out + '/www/feed',
+ WEBSERV_SQLITE => out + '/www/sqlite',
+ OUTPUT_LOCAL => @@home + '/sisu_www',
+ PROCESSING_PATH => @processing_dir,
+ PROCESSING_PATH_TMP_BASE => tmp_processing,
+ PROCESSING_PATH_TMP => tmp_processing,
+ PROCESSING_DAL => 'dal',
+ PROCESSING_TUNE => 'tune',
+ PROCESSING_LATEX => 'tex',
+ PROCESSING_TEXINFO => 'texinfo',
+ PROCESSING_LOUT => 'lout',
+ PROCESSING_ENCODING => 'encoding',
+ #TEXINFO_STUB => 'texinfo',
+ PAPERSIZE => 'A4', #A4, US_letter, book_b5, book_a5, US_legal
+ LANGUAGE => 'English',
+ LANGUAGE_CODE => 'en', #change, unecessary duplication though currently used
+ MULTILINGUAL => true,
+ CONCORD_MAX => 200000,
+ DIGEST => 'md5',
+ WEBSERV_HOST_CGI => 'http://localhost',
+ WEBSERV_PORT_CGI => 8081, #8111,8123,8081
+ POSTGRESQL_USER => @@user, #'ralph', # change user !!!
+ POSTGRESQL_PORT => port_pgsql,
+ #POSGRESQL_LINKS_PATH => '',
+ SQLITE_USER => @@user,
+ SQLITE_PATH => @@user, #??
+ SQLITE_PORT => '**',
+ }
+ @@default_dir=DEFAULT_DIR
+ m=/.+\/(\S+)/m
+ stub_pwd=@@pwd[m,1]
+ @@rc_path=["#@@pwd/_sisu","#@@home/.sisu",@@sisu_etc]
+ @@yamlrc_path=unless stub_pwd =~/^sisupod$/
+ ["#@@pwd/_sisu","#@@home/.sisu",@@sisu_etc]
+ else #security policy: prevent reading of sisurc.yml in sisupod
+ ["#@@home/.sisu",@@sisu_etc]
+ end
+ @@ad_path=unless stub_pwd =~/^sisupod$/
+ ["#@@pwd/_sisu/skin/yml","#@@home/.sisu/skin/yml","#{@@sisu_etc}/skin/yml"]
+ else #security policy: prevent reading of sisurc.yml in sisupod
+ ["#@@home/.sisu",@@sisu_etc]
+ end
+ attr_accessor :user,:home,:hostname,:pwd,:host,:arch,:rbver,:dir_arch,:dir_sitearch,:dir_bin,:locale,:webserv_path,:webserv_host_cgi,:webserv_port_cgi,:default_dir,:rc_path,:yamlrc_path,:ad_path
+ def initialize
+ @user,@home,@hostname,@pwd,@sisu_etc,@host,@arch,@rbver,@dir_arch,@dir_sitearch,@dir_bin,@locale,@default_dir,@rc_path,@yamlrc_path,@ad_path=@@user,@@home,@@hostname,@@pwd,@@sisu_etc,@@host,@@arch,@@rbver,@@dir_arch,@@dir_sitearch,@@dir_bin,@@locale,@@default_dir,@@rc_path,@@yamlrc_path,@@ad_path
+ #note rbver is duplicated in Info_version
+ end
+ end
+ class Load
+ def initialize(prog,mandatory=false)
+ @prog,@mandatory=prog,mandatory
+ end
+ def prog
+ load_prog=false
+ $:.each do |reqpath|
+ if FileTest.exists?("#{reqpath}/#@prog.rb")
+ load_prog=true
+ break
+ end
+ end
+ if load_prog and @prog=~/dbi/; require 'dbi' #revisit
+ end
+ if load_prog; require @prog
+ else
+ tell=if @mandatory; SiSU_Screen::Ansi.new(@cmd,"module required: #@prog")
+ else SiSU_Screen::Ansi.new(@cmd,"#@prog load requested")
+ end
+ tell.warn
+ end
+ load_prog
+ end
+ def prog?
+ load_prog=false
+ $:.each do |reqpath|
+ if FileTest.exists?("#{reqpath}/#@prog.rb"); load_prog=true
+ break
+ end
+ end
+ load_prog
+ end
+ end
+ class Get_init < Info_system
+ include Singleton
+ @@noyaml=false
+ @@rc,@@vz,@@tx=nil,nil,nil
+ @@ad={ :promo=>nil,:promo_list=>nil,:flag_promo=>false }
+ attr_accessor :yaml
+ def initialize
+ super()
+ end
+ def skin
+ @@vz ||=SiSU_Viz::Skin.new
+ end
+ def tex
+ @@tx ||=SiSU_Viz::TeX.new
+ end
+ def yamlrc
+ unless @@rc
+ @yamlrc_path.each do |v|
+ if @@noyaml or FileTest.exists?("#{v}/noyaml")
+ puts "WARNING - YAML loading switched off, to enable delete the file:\n\t#{v}/noyaml\n\n" unless @@noyaml
+ @@noyaml=true
+ break
+ else
+ if FileTest.exists?("#{v}/sisurc.yml")
+ unless @@rc
+ require 'yaml'
+ @@rc ||= YAML::load(File::open("#{v}/sisurc.yml"))
+ end
+ break
+ end
+ unless @@rc
+ if FileTest.exists?("#{v}/sisurc.yaml")
+ unless @@rc
+ require 'yaml'
+ @@rc ||= YAML::load(File::open("#{v}/sisurc.yaml"))
+ end
+ break
+ end
+ end
+ end
+ end
+ end
+ @@rc
+ end
+ def ads #WORK AREA
+ tell_no_yaml='WARNING - YAML loading switched off, to enable delete the file:'
+ @ad_path.each do |v|
+ if @@noyaml or FileTest.exists?("#{v}/noyaml")
+ puts tell_no_yaml + "\n\t#{v}/noyaml\n" unless @@noyaml
+ @@noyaml=true
+ break
+ else
+ #tell=SiSU_Screen::Ansi.new('','promo off (file not found): list.yml')
+ if FileTest.exists?("#{v}/list.yml")
+ unless @@ad[:promo_list]
+ require 'yaml'
+ @@ad[:promo_list] ||= YAML::load(File::open("#{v}/list.yml"))
+ end
+ @@ad[:flag_promo]=true
+ break
+ end
+ #tell.warn if @cmd=~/MV/
+ @@ad[:flag_promo]=false
+ end
+ end
+ @ad_path.each do |v|
+ if @@noyaml or FileTest.exists?("#{v}/noyaml")
+ puts tell_no_yaml + "\n\t#{v}/noyaml\n" unless @@noyaml
+ @@noyaml=true
+ break
+ else
+ #tell=SiSU_Screen::Ansi.new('','promo off (file not found): promo.yml')
+ if FileTest.exists?("#{v}/promo.yml")
+ unless @@ad[:promo]
+ require 'yaml'
+ @@ad[:promo] ||= YAML::load(File::open("#{v}/promo.yml"))
+ end
+ @@ad[:flag_promo]=true
+ break
+ end
+ #tell.warn if @cmd=~/MV/
+ @@ad[:flag_promo]=false
+ end
+ end
+ @@ad
+ end
+ end
+ class Env_call
+ @@rc,@@fns,@@fnn,@@fnb,@@fnt,@@flv=nil,nil,nil,nil,nil,nil
+ @@ad={}
+ attr_accessor :rc,:fnn,:fnb,:fnt,:fnv,:ad
+ def initialize(fns='')
+ super()
+ @fns=fns
+ @sys=Info_system.instance
+ @rc=Get_init.instance.yamlrc
+ @ad=Get_init.instance.ads
+ if @fns and @fns != '' and @fns !=@@fns
+ @@fns,@@fnn,@@fnb,@@fnt,@@flv=@fns,nil,nil,nil,nil
+ end
+ if @fns and @fns != '' #watch
+ if multilingual
+ m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst|ssm)$/
+ @@fnn ||=@fns[m,1]
+ @@fnb ||=@fns[m,2]
+ @@fnt ||=@fns[m,3]
+ @@flv ||=document_language_versions_found[:f]
+ else m=/(.+?)\.([_-]?sst|ssm)$/
+ @@fnb ||=@fns[m,1]
+ @@fnm ||=@fns[m,1]
+ @@fnt ||=@fns[m,2]
+ end
+ end
+ @fnn,@fnb,@fnt,@flv=@@fnn,@@fnb,@@fnt,@@flv
+ end
+ def multilingual
+ if defined? @rc['default']['multilingual'] and @rc['default']['multilingual'] != nil; @rc['default']['multilingual']
+ else true
+ end
+ end
+ def document_language_versions_found
+ @fn={}
+ unless (@fns.nil? or @fns.empty?)
+ if multilingual
+ m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst$)/
+ @fn[:b],@fn[:m],@fn[:t]=@fns[m,1],@fns[m,2],@fns[m,3]
+ else m=/(.+?)\.([_-]?sst$)/
+ @fn[:b]=@fn[:m]=@fns[m,1]
+ @fn[:t]=@fns[m,2]
+ end
+ end
+ lang=SiSU_Env::Standardise_language.new
+ langs=lang.codes
+ x=[]
+ if FileTest.file?("#{@fn[:m]}.#{@fn[:t]}"); x << "#{@fn[:m]}.#{@fn[:t]}"
+ end
+ x << @fns
+ langs.each do |l|
+ lng=SiSU_Env::Standardise_language.new(l)
+ if FileTest.file?("#{@fn[:m]}~#{lng.code}.#{@fn[:t]}")
+ x << "#{@fn[:m]}~#{lng.code}.#{@fn[:t]}"
+ elsif FileTest.file?("#{@fn[:m]}~#{lng.name}.#{@fn[:t]}")
+ x << "#{@fn[:m]}~#{lng.name}.#{@fn[:t]}"
+ end
+ end
+ @fn[:f]=x.uniq!
+ @fn
+ end
+ def published_manifests?(output_base)
+ ob=output_base
+ @fn={}
+ @m=[]
+ unless (@fns.nil? or @fns.empty?)
+ if multilingual
+ m=/((.+?)(?:\~\w{2,3})?)\.([_-]?sst$)/
+ @fn[:b],@fn[:m],@fn[:t]=@fns[m,1],@fns[m,2],@fns[m,3]
+ #@fl[:v]=@env.document_language_versions_found
+ else m=/(.+?)\.([_-]?sst$)/
+ @fn[:b]=@fn[:m]=@fns[m,1]
+ @fn[:t]=@fns[m,2]
+ end
+ end
+ lang=SiSU_Env::Standardise_language.new
+ langs=lang.codes
+ x=[]
+ if FileTest.file?("#{@fn[:m]}.#{@fn[:t]}"); x << "#{@fn[:m]}.#{@fn[:t]}"
+ end
+ dir=SiSU_Env::Info_env.new(@fns)
+ @m << {:m => 'sisu_manifest.html', :l => 'English' } #fix later, default language
+ langs.each do |l|
+ lng=SiSU_Env::Standardise_language.new(l)
+ fns_c="#{@fn[:m]}~#{lng.code}.#{@fn[:t]}"
+ fns_l="#{@fn[:m]}~#{lng.name}.#{@fn[:t]}"
+ if FileTest.file?(fns_c)
+ fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_c)
+ lng=fn_set_lang[:l]
+ fn=SiSU_Env::Env_call.new(fns_c).lang(fn_set_lang[:c])
+ @m << {:m => fn[:manifest], :l => lng }
+ elsif FileTest.file?(fns_l)
+ fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_l)
+ @fnl=dir.i18n.lang_filename(fn_set_lang[:c])
+ fn=SiSU_Env::Env_call.new(fns_l).lang(fn_set_lang[:c])
+ @m << {:m => fn[:manifest], :l => lng }
+ end
+ end
+ @m.uniq!
+ @m
+ end
+ def filename(code,name,suffix)
+ d=SiSU_Env::Info_env.new(@fns)
+ fnl=d.i18n.lang_filename(code)
+ "#{fnl[:pre]}#{name}#{fnl[:mid]}#{suffix}#{fnl[:post]}"
+ end
+ def lang(code)
+ @fn={
+ :html => filename(code,'','.html'),
+ :concordance => filename(code,'concordance','.html'),
+ :sax => filename(code,'sax','.xml'),
+ :dom => filename(code,'dom','.xml'),
+ :docbook => filename(code,'docbook','.xml'),
+ :xhtml => filename(code,'scroll','.xhtml'),
+ :pdf_l => filename(code,'landscape','.pdf'),
+ :pdf_p => filename(code,'portrait','.pdf'),
+ :toc => filename(code,'toc','.html'),
+ :doc => filename(code,'doc','.html'),
+ :index => filename(code,'index','.html'),
+ :odf => filename(code,'opendocument','.odt'),
+ :plain => filename(code,'plain','.txt'),
+ :wiki => filename(code,'wiki','.txt'),
+ :digest => filename(code,'digest','.txt'),
+ :metadata => filename(code,'metadata','.html'), #chk
+ :manifest => filename(code,'sisu_manifest','.html'),
+ :sitemap => filename(code,'sitemap','.xml'),
+ :sitemap_touch => filename(code,"sitemap_#@fnb",'.xml'),
+ :sxs => filename(code,@fnb,'.sxs.xml'),
+ :sxd => filename(code,@fnb,'.sxd.xml'),
+ :sxn => filename(code,@fnb,'.sxn.xml')
+ }
+ @fn
+ end
+ end
+ class System_call
+ @@locale_flag=false
+ def initialize(input='',output='',cmd='')
+ @input,@output,@cmd=input,output,cmd
+ @prog=SiSU_Env::Info_program.new
+ @sys=Info_system.instance
+ end
+ def program_found?(program)
+ found=`whereis #{program}`
+ state=if found =~/bin\/#{program}\b/; true
+ else false
+ end
+ end
+ def locale #locales utf8 or other
+ unless @@locale_flag
+ @@locale_flag=true
+ puts @sys.locale #unless @cmd =~/q/ # locale info UTF8 etc. KEEP
+ end
+ @sys.locale
+ end
+ def file_encoding(filename,cmd='') #file encoding
+ program='file'
+ if program_found?(program)
+ encoding=%x{file #{filename}}.strip
+ encoding.gsub!(/#{filename}:(\s+|$)/,'')
+ encoding=if encoding and not encoding.empty?; encoding
+ else 'UTF-8 assumed, encoding undetermined'
+ end
+ puts encoding if cmd =~/[VM]/
+ encoding
+ else encoding='UTF-8 assumed, file encoding check program unavailable'
+ end
+ end
+ def wc #word count
+ program='wc'
+ if program_found?(program) and locale !~/utf-?8/i; true
+ else
+ program_ref="(not available)" unless program_found?(program)
+ program_ref="(UTF-8)" if locale =~/utf-?8/i
+ #puts "\tWARN: #{program}\n\t\t using alternative to word count program #{program_ref}"
+ false
+ end
+ end
+ def rcs #rcs for document markup data
+ program='rcs'
+ program_ref="\n\t\tdocument version information requested"
+ if program_found?(rcs); true
+ else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ false
+ end
+ end
+ def cvs #cvs for document markup data
+ program='cvs'
+ program_ref="\n\t\tdocument version information requested"
+ if program_found?(cvs); true
+ else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ false
+ end
+ end
+ def openssl #openssl for digests
+ program='openssl'
+ program_ref="\n\t\tused to generate requested source document identification digest"
+ if program_found?(program); true
+ else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ false
+ end
+ end
+ def md5(filename) #md5 dgst
+ program='openssl'
+ program_ref="\n\t\tmd5 digest requested"
+ if program_found?(program)
+ dgst=%x{openssl dgst -md5 #{filename}}.strip
+ dgst.scan(/\S+/)
+ else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ false
+ end
+ end
+ def sha256(filename) #sha dgst
+ program='openssl'
+ program_ref="\n\t\tsha digest requested"
+ if program_found?(program)
+ dgst=%x{openssl dgst -sha256 #{filename}}.strip
+ dgst.scan(/\S+/)
+ else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ false
+ end
+ end
+ def psql #psql
+ program='psql'
+ program_ref="\n\t\tpsql requested"
+ if program_found?(program); true
+ else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ false
+ end
+ end
+ def create_pg_db(dbname_stub=nil) #createdb
+ unless dbname_stub
+ @pwd ||=Dir.pwd
+ m=/.+\/(\S+)/im
+ dbname_stub=@pwd[m,1]
+ end
+ program='createdb'
+ program_ref="\n\t\tcreatedb dbname SiSU_#{dbname_stub} #for postgresql database creation"
+ if program_found?(program); system("createdb SiSU_#{dbname_stub}")
+ else puts "\tWARN: #{program} is not available #{program_ref}" #if @cmd =~/v/
+ end
+ end
+ def relaxng(cmd='') #trang - convert between different schema languages for XML
+ program='trang'
+ program_ref="\n\t\tsee http://www.thaiopensource.com/relaxng/trang.html"
+ if program_found?(program); system("trang #@input #@output")
+ else puts "\tWARN: #{program} is not installed #{program_ref}" if cmd =~/V/
+ end
+ end
+ def well_formed? #tidy - check for well formed xml xhtml etc.
+ program=@prog.tidy
+ program_ref="\n\t\tsee http://tidy.sourceforge.net/"
+ if program_found?(program); system("#{@prog.tidy} -xml #@input > #@output")
+ else puts "\tWARN: #{program} is not installed #{program_ref}"
+ end
+ end
+ def latex2pdf #convert from latex to pdf
+ prog=[]
+ prog=['pdflatex','pdfetex','pdftex']
+ program_ref="\n\t\tSee http://www.tug.org/applications/pdftex/\n\t\tOn Debian this is is included in tetex-extra"
+ @pdfetex_flag=false
+ @cmd ||=''
+ tell=if @cmd =~/[MVv]/; ''
+ else '> /dev/null'
+ end
+ mode='batchmode'
+ #mode='nonstopmode'
+ prog.each do |program|
+ if program_found?(program)
+ case program
+ when /pdflatex/; system("#{program} -interaction=#{mode} #@input #{tell}\n")
+ when /pdfetex/; system("#{program} -interaction=#{mode} -fmt=pdflatex #@input #{tell}\n") # debian specific paramters ?
+ #system("#{program} -interaction=batchmode -progname=pdflatex #@input\n")
+ when /pdftex/; system("#{program} -interaction=#{mode} -fmt=pdflatex #@input #{tell}\n")
+ end
+ @pdfetex_flag=true
+ break
+ end
+ unless @pdfetex_flag; puts "\tWARN: none of the following programs are installed: #{program[0]}, #{program[1]}, #{program[2]} is installed. #{program_ref}"
+ end
+ end
+ end
+ def makeinfo #texinfo
+ program='makeinfo'
+ program_ref="\n\t\tsee http://www.gnu.org/software/texinfo/"
+ if program_found?(program); system("makeinfo #@input\n")
+ else puts "\tWARN: #{program} is not installed #{program_ref}"
+ end
+ end
+ def scp
+ program='scp'
+ if program_found?(program); system("scp -Cr #@input #@output")
+ else puts "\tWARN: #{program} not found"
+ end
+ end
+ def rsync(action='')
+ program='rsync'
+ if program_found?(program)
+ vb=if @cmd =~/q/; 'q'
+ elsif @cmd =~/v/; 'v'
+ else ''
+ end
+ msg=''
+ msg=" && echo 'OK: #@input -> #@output'" unless @cmd =~/q/
+ system("rsync -az#{vb} #{action} #@input #@output #{msg}")
+ else puts "\tWARN: #{program} not found"
+ end
+ end
+ def rm
+ if @cmd =~/^-Z[mMvVq]*$/; rm_rf(@input)
+ elsif @cmd =~/V/; rm(@input)
+ elsif @cmd !~/q/; rm(@input)
+ elsif @cmd =~/q/; rm(@input)
+ #elsif @cmd =~/q/; system("rm #{action} #@input")
+ else puts "\tWARN: operation ignored"
+ end
+ end
+ end
+ class Standardise_language
+ def initialize(l='')
+ @language=l
+ if @language.empty?
+ @language=Info_env.new.defaults[:language]
+ end
+ end
+ def language #use ISO_639-2
+ lang={}
+ case @language
+ when /American|^us$/i; d,c,l=false,'en','American English' #depreciated, see iso 639-2
+ when /English|^en$/i; d,c,l=false,'en','English'
+ when /French|Francais|^fr$/i; d,c,l=false,'fr','French'
+ when /German|^de$/i; d,c,l=false,'de','German'
+ when /Italian|^it$/i; d,c,l=false,'it','Italian'
+ when /Spanish|Espanol|^es$/i; d,c,l=false,'es','Spanish'
+ when /Brazilian(?: Portuguese)?|^br$/i; d,c,l=false,'pt','Brazilian Portuguese' #depreciated, see iso 639-2
+ when /Portuguese|^pt$/i; d,c,l=false,'pt','Portuguese'
+ when /Swedish|Svensk|^sv$/i; d,c,l=false,'sv','Swedish'
+ when /Danish|Dansk|^da$/i; d,c,l=false,'da','Danish'
+ when /Finnish|Finsk|Suomi|^fi$/i; d,c,l=false,'fi','Finnish'
+ when /Norwegian|Norsk|^no$/i; d,c,l=false,'no','Norwegian'
+ when /Icelandic|^is$/i; d,c,l=false,'is','Icelandic'
+ when /Dutch|^nl$/i; d,c,l=false,'nl','Dutch'
+ when /Estonian|^et$/i; d,c,l=false,'et','Estonian'
+ when /Hungarian|^hu$/i; d,c,l=false,'hu','Hungarian'
+ when /Polish|^pl$/i; d,c,l=false,'pl','Polish'
+ when /Romanian|^ro$/i; d,c,l=false,'ro','Romanian'
+ when /Russian|^ru$/i; d,c,l=false,'ru','Russian'
+ when /Greek|^el$/i; d,c,l=false,'el','Greek'
+ when /Ukranian|^uk$/i; d,c,l=false,'uk','Ukranian'
+ when /Turkish|^tr$/i; d,c,l=false,'tr','Turkish'
+ #when /Serbian/i; d,c,l=false,'', 'Serbian'
+ #when /Welsh/i; d,c,l=false,'', 'Welsh'
+ #when /Basque/i; d,c,l=false,'', 'Basque'
+ #when /Breton/i; d,c,l=false,'', 'Breton'
+ #when /Catalan/i; d,c,l=false,'', 'Catalan'
+ #when /Galician/i; d,c,l=false,'', 'Galician'
+ #when /Saa?mi/i; d,c,l=false,'', 'Saami'
+ #when /Hebrew/i; d,c,l=false,'', 'Hebrew'
+ #when /Latin/i; d,c,l=false,'', 'Latin'
+ #when /Esperanto/i; d,c,l=false,'', 'Esperanto'
+ when /Slovenian|^sl$/i; d,c,l=false,'sl','Slovenian'
+ when /Croatian|^hr$/i; d,c,l=false,'hr','Croatian'
+ when /Slovak(?:ian)?|^sk$/i; d,c,l=false,'sk','Slovakian'
+ when /Czech|^cs$/i; d,c,l=false,'cs','Czech'
+ when /Bulgarian|^bg$/i; d,c,l=false,'bg','Bulgarian'
+ else d,c,l=true,'en','English (default)'
+ #else d,c,l=true,'xx','Default'
+ end
+ lang[:d],lang[:c],lang[:l]=d,c,l
+ lang
+ end
+ def name
+ language[:l].downcase
+ end
+ def title
+ language[:l]
+ end
+ def code
+ language[:c]
+ end
+ def file_to_language(file)
+ m=/.+?\~(\w{2,3})\.[_-]?sst$/
+ @language=if file =~m ; file[m,1]
+ else ''
+ end
+ language
+ end
+ def codes
+ codes=['us','en','fr','de','it','es','br','pt','sv','da','fi','no','is','nl','et','hu','pl','ro','ru','el','uk','tr','sk','hr','sl','cs','bg'] # remove us and br see iso-639-2
+ end
+ end
+ class Info_env < Env_call
+ require 'fileutils'
+ include FileUtils
+ attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:webserv_host_cgi,:webserv_port_cgi,:processing,:etc,:yamlrc_dir
+ @@image_flag,@@local_image=true,true #warning on @@image_flag
+ @@fb=nil
+ def initialize(fns='',md=nil)
+ super() #you may not want to re-execute this tatic info so frequently!
+ @fns,@md=fns,md
+ @env=Env_call.new(fns) if fns
+ fnb=if @md and defined? @md.fnb; @md.fnb
+ elsif defined? @env.fnb and @env.fnb; @env.fnb
+ elsif not @fns.nil? and not @fns.empty?
+ m=/(.+)?\.(?:[_-]?sst|ssm)$/m
+ @fns[m,1] if not @fns.empty?
+ end
+ if fnb; @@fb ||=fnb
+ end
+ @sys=Info_system.instance
+ @fnb ||=@@fb #clean up this... used primarily for zap which is not passed normal parameters
+ @fixed_websev_root='' # @home
+ @pwd=@@pwd||=Dir.pwd
+ m=/.+\/(\S+)/m
+ @stub_pwd=@@pwd[m,1]
+ end
+ def user
+ @sys.user
+ end
+ def hostname
+ @sys.hostname
+ end
+ def host
+ @sys.host
+ end
+ def arch
+ @sys.arch
+ end
+ def rbver
+ @sys.rbver
+ end
+ def locale
+ @sys.locale
+ end
+ def concord_max
+ concord_max=if defined? @rc['processing']['concord_max'] and @rc['processing']['concord_max']:
+ @rc['processing']['concord_max']
+ else defaults[:concord_max]
+ end
+ end
+ def current_document
+ @@current_document||=Dir.pwd
+ @@current_document
+ end
+ def stub_pwd #200412
+ @stub_pwd
+ end
+ def sisupod
+ #path.processing
+ # sisupod
+ # sisu
+ # content.sst [file content]
+ # filename.sst [link to content.sst]
+ # _sisu
+ # conf
+ # skin/
+ # doc [relevant skin if any other than default]
+ # image [all images for specific document gathered here]
+ sisupod_processing_path="#{path.processing}/sisupod"
+ rm_rf(sisupod_processing_path) if FileTest.directory?(sisupod_processing_path) or FileTest.file?(sisupod_processing_path)
+ paths=[]
+ paths=["#{path.processing}/sisupod/_sisu/skin/doc","#{path.processing}/sisupod/_sisu/skin/dir","#{path.processing}/sisupod/_sisu/skin/site","#{path.processing}/sisupod/_sisu/image"]
+ paths.each {|x| File.mkpath(x) unless FileTest.directory?(x) }
+ end
+ def defaults #multiple default directories
+ @default_dir ||=@sys.default_dir #DEFAULT_DIR
+ end
+ #def skin
+ # @@vz ||=SiSU_Viz::Skin.new
+ #end
+ def widget #needs (md) #move
+ @rc=SiSU_Env::Get_init.instance.yamlrc
+ @ad=SiSU_Env::Get_init.instance.ads
+ @vz=SiSU_Env::Get_init.instance.skin
+ @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false }
+ def promo?
+ @flag[:ad]=if @md.flag_promo && @ad[:flag_promo]
+ @flag[:md]=true
+ true
+ elsif defined? @vz.widget_promo and not @vz.widget_promo.nil? and @vz.widget_promo.class == Array and @vz.widget_promo.length > 0
+ @flag[:sk]=true
+ true
+ elsif defined? @rc['promo'] and not @rc['promo'].nil? and @rc['promo'].length > 0
+ @flag[:rc]=true
+ true
+ else
+ false
+ end
+ @flag
+ end
+ def search?
+ flag=if defined? @rc['search'] and
+ defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ flag=if promo?[:ad]
+ false
+ elsif defined? @vz.widget_search and @vz.widget_search == true
+ true
+ elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true
+ true
+ else
+ false
+ end
+ else
+ false
+ end
+ end
+ def search_fixed?
+ flag=if defined? @rc['search'] and
+ defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ flag=if promo?[:ad]
+ false
+ elsif defined? @vz.widget_search and @vz.widget_search == true
+ true
+ elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true
+ true
+ else
+ false
+ end
+ else
+ false
+ end
+ end
+ def search_form(action=nil,db=nil)
+ rc=SiSU_Env::Get_init.instance.yamlrc
+ create_form=if action and db and action =~/http:\/\// and db =~/\S+/
+ true
+ elsif widget.search?
+ db=if rc['search']['db']=~/\S+/
+ rc['search']['db']=~/^SiSU_\S+/ ? rc['search']['db'] : "SiSU_#{rc['search']['db']}"
+ else nil
+ end
+ action=rc['search']['action']
+ true
+ else false
+ end
+ if create_form
+ %{<td align="center" bgcolor="#ffffff">
+<!-- Search SiSU -->
+<a name="search"></a>
+<font size="2">
+<form method="get" action="#{rc['search']['action']}" target="_top">
+<input type="text" name="s1" size="24" maxlength="255" />
+<br />
+<input type="hidden" name="db" value="#{db}" />
+<input type="hidden" name="a" value="1" />
+<input type="hidden" name="ltd" value="1000" />
+<input type="hidden" name="off" value="0" />
+<input type="radio" name="view" value="index" checked="checked" /> idx
+<input type="radio" name="view" value="text" /> txt
+<input type="submit" name="ignore" value="search" />
+<input type="checkbox" name="fns" value="#{@md.fnb}" />
+</form>
+</font>
+<!-- Search SiSU -->
+</td> }
+ else ''
+ end
+ end
+ def search_form_static(action=nil,db=nil)
+ rc=SiSU_Env::Get_init.instance.yamlrc
+ create_form=if action and db and action =~/http:\/\// and db =~/\S+/
+ true
+ elsif widget.search_fixed?
+ db=if rc['search']['db']=~/\S+/
+ rc['search']['db']=~/^SiSU_\S+/ ? rc['search']['db'] : "SiSU_#{rc['search']['db']}"
+ else nil
+ end
+ action=rc['search']['action']
+ true
+ else false
+ end
+ if create_form
+ %{<td align="center" bgcolor="#ffffff">
+<!-- Search SiSU -->
+<a name="search"></a>
+<font size="2">
+<form method="get" action="#{rc['search']['action']}" target="_top">
+<input type="text" name="s1" size="24" maxlength="255" />
+<br />
+<input type="hidden" name="db" value="#{db}" />
+<input type="hidden" name="a" value="1" />
+<input type="hidden" name="ltd" value="1000" />
+<input type="hidden" name="off" value="0" />
+<input type="radio" name="view" value="index" checked="checked" /> idx
+<input type="radio" name="view" value="text" /> txt
+<input type="submit" name="ignore" value="search" />
+<input type="checkbox" name="fns" value="#{@md.fnb}" />
+</form>
+</font>
+<!-- Search SiSU -->
+</td> }
+ else ''
+ end
+ end
+ def search_action
+ action=if search?
+ else ''
+ end
+ end
+ self
+ end
+ def widget_static
+ @rc=SiSU_Env::Get_init.instance.yamlrc
+ @vz=SiSU_Env::Get_init.instance.skin
+ @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false }
+ def search?
+ flag=if defined? @rc['search'] and
+ defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ flag=if defined? @vz.widget_search and @vz.widget_search == true
+ true
+ elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true
+ true
+ else
+ false
+ end
+ else
+ false
+ end
+ end
+ def search_fixed?
+ flag=if defined? @rc['search'] and
+ defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/
+ flag=if defined? @vz.widget_search and @vz.widget_search == true
+ true
+ elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true
+ true
+ else
+ false
+ end
+ else
+ false
+ end
+ end
+ def search_form(action=nil,db=nil)
+ rc=SiSU_Env::Get_init.instance.yamlrc
+ create_form=if action and db and action =~/http:\/\// and db =~/\S+/
+ true
+ elsif widget_static.search?
+ db=if rc['search']['db']=~/\S+/
+ rc['search']['db']=~/^SiSU_\S+/ ? rc['search']['db'] : "SiSU_#{rc['search']['db']}"
+ else nil
+ end
+ action=rc['search']['action']
+ true
+ else false
+ end
+ if create_form and @fnb and @fnb=~/\S+/
+ %{<!-- Search SiSU -->
+<a name="search"></a>
+<font size="2">
+<form method="get" action="#{rc['search']['action']}" target="_top">
+<input type="text" name="s1" size="24" maxlength="255" />
+<br />
+<input type="hidden" name="db" value="#{db}" />
+<input type="hidden" name="a" value="1" />
+<input type="hidden" name="fns" value="#@fnb" />
+<input type="radio" name="view" value="index" /> idx
+<input type="radio" name="view" value="text" checked="checked" /> txt
+<input type="submit" name="ignore" value="search" />
+</form>
+</font>
+<!-- Search SiSU --> }
+ elsif create_form
+ %{<!-- Search SiSU -->
+<a name="search"></a>
+<font size="2">
+<form method="get" action="#{rc['search']['action']}" target="_top">
+<input type="text" name="s1" size="24" maxlength="255" />
+<br />
+<input type="hidden" name="db" value="#{db}" />
+<input type="hidden" name="a" value="1" />
+<input type="radio" name="view" value="index" checked="checked" /> idx
+<input type="radio" name="view" value="text" /> txt
+<input type="submit" />
+</form>
+</font>
+<!-- Search SiSU --> }
+ else ''
+ end
+ end
+ def search_action
+ action=if search?
+ else ''
+ end
+ end
+ self
+ end
+ def path #dir
+ def home
+ @sys.home
+ #@home
+ end
+ def pwd
+ @sys.pwd
+ end
+ def stub_pwd
+ @stub_pwd
+ end
+ def etc
+ defaults[:sisu_etc] #live/dynamic
+ # @sys.sisu_etc #broken: live/dynamic
+ # defaults[:sisu_etc] #live/dynamic
+ end
+ def arch
+ @sys.dir_arch
+ end
+ def sitearch
+ @sys.dir_sitearch
+ end
+ def bin
+ @sys.dir_bin
+ end
+ def share #shared data repository source directory
+ defaults[:sisu_share]
+ end
+ def style
+ defaults[:stylesheet_stub]
+ end
+ def sample_data #sample data repository source directory
+ defaults[:sample_data_path]
+ end
+ def rc
+ @sys.rc_path
+ end
+ def yamlrc
+ rc.each do |v|
+ if FileTest.exists?("#{v}/sisurc.yml")
+ @yamlrc_dir="#{v}/sisurc.yml"
+ break
+ end
+ end
+ unless @yamlrc_dir
+ rc.each do |v|
+ if FileTest.exists?("#{v}/sisurc.yaml")
+ @yamlrc_dir="#{v}/sisurc.yaml"
+ break
+ end
+ end
+ end
+ @yamlrc_dir
+ end
+ def man
+ if defined? @rc['webserv']['man']; "#{webserv}/#{@rc['webserv']['man']}"
+ else defaults[:webserv_man]
+ end
+ end
+ def webserv_path #testing, check need, remove
+ @webserv_path
+ end
+ def webserv #separation required for webrick which cannot use path.output (different requirements as no file is passed)
+ man_path=if defined? @rc['webserv']['path'] and @rc['webserv']['path'] =~/\S\S+/
+ man_path=case @rc['webserv']['path']
+ when /^\/\S+/; @rc['webserv']['path']
+ when /^\.\/(\S+)/; "#{pwd}/#{$1}"
+ when /^~\/(\S+)/; "#{home}/#{$1}"
+ else "#{home}/#{@rc['webserv']['path']}"
+ end
+ else nil
+ end
+ @webserv_path=if defined? man_path and File.writable?("#{man_path}/."); man_path #web server path as configured in rc file
+ elsif FileTest.directory?(defaults[:webserv_path]) and File.writable?("#{defaults[:webserv_path]}/.") #web server path default
+ defaults[:webserv_path]
+ else #create default directory under home and place output there
+ File.mkpath(defaults[:output_local]) unless FileTest.directory?(defaults[:output_local])
+ defaults[:output_local]
+ end
+ end
+ def webserv_stub_ensure
+ File.mkpath(path.webserv) unless FileTest.directory?(path.webserv)
+ File.mkpath("#{path.webserv}/#@stub_pwd") unless FileTest.directory?("#{path.webserv}/#@stub_pwd")
+ end
+ def webserv_map_pwd #dir
+ "#{path.webserv}/#{stub_pwd}"
+ end
+ def webserv_dir #fixed/hard path to /www web/presentation directory, on Debian /var/www subdirectories are created within it, depending on markup directory stub-name (last segment of markup directory name)
+ defaults[:webserv_dir]
+ end
+ def webserv_image #web/presentation directory, subdirectories are created within it, depending on markup directory stub-name (last segment of markup directory name)
+ images=if defined? @rc['webserv']['images']
+ @rc['webserv']['images']
+ else defaults[:images]
+ end
+ "#{path.webserv}/#{images}"
+ end
+ def output #web/webserv output directory... subdirectory into which further subdirectories are made based on file names
+ "#{path.webserv}/#@stub_pwd"
+ end
+ def sitemaps
+ "#{path.output}/sitemaps"
+ end
+ def encoding
+ pth="#{processing}/#{defaults[:processing_encoding]}"
+ File.mkpath(pth) unless FileTest.directory?(pth)
+ pth
+ end
+ def processing_base_tmp
+ defaults[:processing_path_tmp_base]
+ end
+ def processing #processing directory, used/needed for sisu work files, has sub-directories (dal,tex etc)
+ File.mkpath(defaults[:processing_path]) unless FileTest.directory?(defaults[:processing_path])
+ File.mkpath(defaults[:processing_path_tmp]) unless FileTest.directory?(defaults[:processing_path_tmp])
+ path_processing=if defined? @rc['processing']['path'] and @rc['processing']['path']
+ File.mkpath("#{path.home}/#{@rc['processing']['path']}") unless FileTest.directory?("#{path.home}/#{@rc['processing']['path']}")
+ ["#{path.home}/#{@rc['processing']['path']}",defaults[:processing_path],defaults[:processing_path_tmp]]
+ else [defaults[:processing_path],defaults[:processing_path_tmp]]
+ end
+ @processing=nil
+ path_processing.each do |v| #
+ #if File.writable?("#{v}/.") #check now is earlier
+ @processing=v
+ unless FileTest.directory?(@processing)
+ puts "a processing directory (#@processing) is being created for use by sisu"
+ File.mkpath(@processing)
+ end
+ break
+ #end
+ end
+ @processing
+ end
+ def dal
+ pth=if defined? @rc['processing']['dal']; "#{processing}/#{@rc['processing']['dal']}"
+ else "#{processing}/#{defaults[:processing_dal]}"
+ end
+ File.mkpath(pth) unless FileTest.directory?(pth)
+ pth
+ end
+ def tune
+ pth=if defined? @rc['processing']['tune']; "#{processing}/#{@rc['processing']['tune']}"
+ else "#{processing}/#{defaults[:processing_tune]}"
+ end
+ File.mkpath(pth) unless FileTest.directory?(pth)
+ pth
+ end
+ def odf
+ "#{processing}/odf"
+ end
+ def tex
+ pth=if defined? @rc['processing']['latex']; "#{processing}/#{@rc['processing']['latex']}"
+ else "#{processing}/#{defaults[:processing_latex]}"
+ end
+ File.mkpath(pth) unless FileTest.directory?(pth)
+ pth
+ end
+ def texi
+ pth=if defined? @rc['processing']['texinfo']; "#{processing}/#{@rc['processing']['texinfo']}"
+ else "#{processing}/#{defaults[:processing_texinfo]}"
+ end
+ File.mkpath(pth) unless FileTest.directory?(pth)
+ pth
+ end
+ def texinfo #texinfo webserv, check
+ "#{processing}/#{defaults[:processing_texinfo]}"
+ end
+ def lout
+ pth=if defined? @rc['processing']['lout']; "#{processing}/#{@rc['processing']['lout']}"
+ else "#{processing}/#{defaults[:processing_lout]}"
+ end
+ File.mkpath(pth) unless FileTest.directory?(pth)
+ pth
+ end
+ def feed
+ if defined? @rc['webserv']['feed']; "#{public_output}/#{@rc['webserv']['feed']}"
+ else defaults[:webserv_feed]
+ end
+ end
+ def feed_home
+ "#{public_output}/#{@rc['webserv']['feed_home']}"
+ end
+ def scripts #used previously only to include tla version info
+ if defined? @rc['project']['path']; "#{home}/#{@rc['project']['path']}"
+ end
+ end
+ def sqlite
+ "#{home}/sqlite"
+ end
+ def cgi
+ if defined? @rc['webserv']['cgi']; "#{@rc['webserv']['cgi']}"
+ else defaults[:webserv_cgi]
+ end
+ end
+ def php
+ if defined? @rc['webserv']['php']; "#{public_output}/#{@rc['webserv']['php']}"
+ else defaults[:webserv_php]
+ end
+ end
+ # programs
+ def output_tell
+ url.webserv_map_pwd
+ end
+ def image_source #image repository source directory
+ image_path=if defined? @rc['image']['path'] and defined? @rc['image']['public']
+ pth="#{@rc['image']['path']}"
+ "#{pth}/#{@rc['image']['public']}"
+ else
+ "#{share}/image"
+ end
+ end
+ def image_source_tex #image repository source directory
+ image_path=if defined? @rc['image']['path'] and defined? @rc['image']['public']
+ pth="#{@rc['image']['path']}"
+ "#{pth}/#{@rc['image']['public']}"
+ else
+ image=defaults[:image_stub]
+ "#{share}/image"
+ end
+ end
+ def image_external
+ "#{processing}/external_document/image"
+ end
+ def image_source_local_tex
+ if FileTest.directory?(defaults[:image_local]); defaults[:image_local]
+ end
+ end
+ def image_source_remote_tex
+ if FileTest.directory?(image_external); image_external
+ end
+ end
+ self
+ end
+ def url
+ def hostname
+ "http://#{@sys.hostname}"
+ end
+ def dir_url
+ "file://#{path.webserv}/#{stub_pwd}"
+ end
+ def localhost
+ "http://localhost/#{stub_pwd}"
+ end
+ def local
+ "http://#{hostname}/#@stub_pwd"
+ end
+ def root
+ if defined? @rc['webserv']['url_root'] and @rc['webserv']['url_root'] =~/http:\/\//; "#{@rc['webserv']['url_root']}/#@stub_pwd"
+ else "http://localhost/#@stub_pwd"
+ end
+ end
+ def remote
+ root
+ end
+ def webserv_host_base
+ if defined? @rc['webserv']['host']
+ case @rc['webserv']['host']
+ when /http:\/\//; @rc['webserv']['host']
+ when /\S+/; "http://#{@rc['webserv']['host']}"
+ else defaults[:webserv_host_cgi]
+ end
+ else defaults[:webserv_host_cgi]
+ end
+ end
+ def webrick_port
+ if @md and @md.cmd.inspect=~/-F/ and @md.mod.inspect=~/port=(\d+)/
+ $1
+ else
+ if defined? @rc['webserv_cgi']['port']
+ if @rc['webserv_cgi']['port'].nil? and (defined? @md.mod and not @md.mod.nil? and @md.mod.inspect=~/webrick/)
+ defaults[:webserv_port_cgi]
+ elsif not @rc['webserv_cgi']['port'].nil?
+ @rc['webserv_cgi']['port']
+ else defaults[:webserv_port_cgi]
+ end
+ else defaults[:webserv_port_cgi]
+ end
+ end
+ end
+ def webserv_port_cgi
+ if @md and @md.cmd.inspect=~/-F/ and @md.mod.inspect=~/port=(\d+)/
+ $1
+ else
+ if defined? @rc['webserv_cgi']['port']
+ if @rc['webserv_cgi']['port'].nil? and (defined? @md.mod and not @md.mod.nil? and @md.mod.inspect=~/webrick/)
+ defaults[:webserv_port_cgi]
+ elsif not @rc['webserv_cgi']['port'].nil?
+ @rc['webserv_cgi']['port']
+ else nil
+ end
+ else nil
+ end
+ end
+ end
+ def webserv_cgi #web url for local webserv (localhost, or hostname)
+ if defined? @rc['webserv_cgi']['host'] and not @rc['webserv_cgi']['host'].nil?
+ http=@rc['webserv_cgi']['host'] =~ /http:\/\// ? '' : 'http://'
+ if webserv_port_cgi
+ "#{http}#{@rc['webserv_cgi']['host']}:#{webserv_port_cgi}/#@stub_pwd"
+ else "#{http}#{@rc['webserv_cgi']['host']}/#@stub_pwd"
+ end
+ else
+ http=webserv_host_base=~/http:\/\// ? '' : 'http://'
+ if webserv_port_cgi
+ "#{http}#{webserv_host_base}:#{webserv_port_cgi}/#@stub_pwd"
+ else "#{http}#{webserv_host_base}/#@stub_pwd"
+ end
+ end
+ end
+ def webserv_base_cgi #web url for local webserv (localhost, or hostname)
+ if defined? @rc['webserv_cgi']['host'] and not @rc['webserv_cgi']['host'].nil?
+ http=@rc['webserv_cgi']['host'] =~ /http:\/\// ? '' : 'http://'
+ if webserv_port_cgi
+ "#{http}#{@rc['webserv_cgi']['host']}:#{webserv_port_cgi}"
+ else "#{http}#{@rc['webserv_cgi']['host']}"
+ end
+ else
+ http=webserv_host_base=~/http:\/\// ? '' : 'http://'
+ if webserv_port_cgi
+ "#{http}#{webserv_host_base}:#{webserv_port_cgi}"
+ else "#{http}#{webserv_host_base}"
+ end
+ end
+ end
+ def webrick #must have a port #REMOVE
+ #port=":#{webserv_port_cgi}"
+ if defined? @rc['webserv_cgi']['host'] and not @rc['webserv_cgi']['host'].nil?
+ http=if @rc['webserv_cgi']['host'] =~/http:\/\//
+ 'http://'
+ else defaults
+ end
+ "#{http}#{@rc['webserv_cgi']['host']}"
+ elsif webserv_host_base and not webserv_host_base.nil?
+ "#{http}#{webserv_host_base}"
+ else "#{http}localhost"
+ end
+ end
+ def webserv #web url for local webserv (localhost, or hostname)
+ if path.webserv_dir and path.webserv =~ /#{path.webserv_dir}/ #revisit
+ "#{path.webserv}/#@stub_pwd".gsub(/#{path.webserv_dir}/,"#{url.hostname}/#@stub_pwd")
+ elsif defined? @rc['webserv']['webrick_url'] and @rc['webserv']['webrick_url'] == false
+ "file://#{path.webserv}/#@stub_pwd"
+ else "#{url.hostname}:#{webserv_port_cgi}/#@stub_pwd"
+ end
+ end
+ def webserv_base #web url for local webserv (localhost, or hostname)
+ if path.webserv_dir and path.webserv =~ /#{path.webserv_dir}/ #revisit
+ "#{path.webserv}/#@stub_pwd".gsub(/#{path.webserv_dir}/,"#{url.hostname}")
+ elsif defined? @rc['webserv']['webrick_url'] and @rc['webserv']['webrick_url'] == false
+ "file://#{path.webserv}"
+ else "#{url.webrick_base}"
+ end
+ end
+ def webserv_files_from_db #sort this out, messy
+ if defined? @rc['webserv_cgi']['file_links']
+ case @rc['webserv_cgi']['file_links']
+ when /webserv_cgi/; url.webserv_base_cgi
+ when /webserv/; @rc['webserv']['url_root']
+ when /http:\/\//; @rc['webserv_cgi']['file_links']
+ when /\S+/; "http://#{@rc['webserv_cgi']['file_links']}"
+ else webserv_base_cgi
+ end
+ else webserv_base_cgi
+ end
+ end
+ def sample_search_form_title
+ if defined? @rc['search']['title'] and @rc['search']['title'] =~/\S+/
+ @rc['search']['title']
+ else %{SiSU search form (sample):}
+ end
+ end
+ def output_tell
+ output_type=if defined? @rc['show_output_on'] and @rc['show_output_on'] =~/^(?:filesystem|webserv|(?:local|remote)(?:_webserv)?|webrick)/
+ @rc['show_output_on']
+ else 'filesystem'
+ end
+ output=case output_type
+ when /^filesystem(?:_url)?/; url.dir_url
+ when /^remote(?:_webserv)?/; url.remote
+ when /^(?:webserv|local_webserv)/; url.local
+ when /^local(:\d+)/; url.hostname + $1 + '/' + stub_pwd
+ when /^localhost(:\d+)/; url.localhost + $1 + '/' + stub_pwd
+ when /^localhost/; url.localhost
+ when /^webrick/; url.webrick
+ when /^path/; url.webserv_map_pwd
+ else url.webserv_map_pwd
+ end
+ end
+ def images
+ '../_sisu/image'
+ end
+ def images_local
+ if FileTest.directory?(defaults[:image_local])
+ if @@image_flag
+ require 'ftools'
+ images=Dir.glob("#{defaults[:image_local]}/*.{png,jpg,gif}")
+ pth="#{path.webserv}/#@stub_pwd"
+ File.mkpath("#{pth}/_sisu/image_local") unless FileTest.directory?("#{pth}/_sisu/image_local")
+ images.each { |i| File.install(i,"#{pth}/#{i}") } unless images.length > 0
+ @@image_flag=false
+ end
+ '../_sisu/image_local'
+ else
+ if @@local_image==true
+ cmd=if @cmd; @cmd
+ else ''
+ end
+ tell=SiSU_Screen::Ansi.new(cmd,"WARNING - no local image directory or images:", defaults[:image_local] )
+ tell.warn unless cmd =~/q/
+ @@local_image=false
+ end
+ url.images
+ end
+ end
+ #def images_external #url_images_external #ex defaults url.path_png
+ # '../_sisu/image_external'
+ #end
+ def images_external
+ if FileTest.directory?(image_external)
+ if @@image_flag
+ require 'ftools'
+ images=Dir.glob("#{image_external}/*.{png,jpg,gif}")
+ pth="#{path.webserv}/#@stub_pwd"
+ File.mkpath("#{pth}/_sisu/image_external") unless FileTest.directory?("#{pth}/_sisu/image_external")
+ images.each { |i| File.install(i,"#{pth}/#{i}") } unless images.length > 0
+ @@image_flag=false
+ end
+ '../_sisu/image_external'
+ else
+ if @@local_image==true
+ tell=SiSU_Screen::Ansi.new(@cmd,"WARNING - image directory for external images or no such images:", :image_external )
+ tell.warn unless @cmd =~/q/
+ @@local_image=false
+ end
+ url.images_external
+ end
+ end
+ self
+ end
+ def digest
+ def type
+ if defined? @rc['default']['digest'] and @rc['default']['digest'] != nil
+ case @rc['default']['digest']
+ when /^sha(?:2|256)?$/; 'sha256'
+ when /^md5$/; 'md5'
+ else 'md5'
+ end
+ else 'md5'
+ end
+ end
+ def length
+ case digest.type
+ when /sha256/; 64
+ when /md5/; 32
+ else 32
+ end
+ end
+ def pattern
+ "[0-9a-f]{#{digest.length}}"
+ end
+ self
+ end
+ def program
+ def text_editor
+ if defined? @rc['program_select']['editor'] and @rc['program_select']['editor'] =~/\S\S+/
+ @rc['program_select']['editor']
+ elsif defined? @rc['program_select']['text_editor'] and @rc['program_select']['text_editor'] =~/\S\S+/
+ @rc['program_select']['text_editor']
+ else 'editor' #'gvim -c :R -c :S'
+ end
+ end
+ def pdf_viewer
+ if defined? @rc['program_select']['pdf_viewer'] and @rc['program_select']['pdf_viewer'] =~/\S\S+/
+ @rc['program_select']['pdf_viewer']
+ else 'pdf-viewer' #'evince'
+ end
+ end
+ def web_browser
+ if defined? @rc['program_select']['www_browser'] and @rc['program_select']['www_browser'] =~/\S\S+/
+ @rc['program_select']['www_browser']
+ elsif defined? @rc['program_select']['web_browser'] and @rc['program_select']['web_browser'] =~/\S\S+/
+ @rc['program_select']['web_browser']
+ else 'x-www-browser' #'kazehakase' 'galeon'
+ end
+ end
+ def www_browser
+ web_browser
+ end
+ def console_web_browser
+ if defined? @rc['program_select']['console_www_browser'] and @rc['program_select']['console_www_browser'] =~/\S\S+/
+ @rc['program_select']['console_www_browser']
+ elsif defined? @rc['program_select']['console_web_browser'] and @rc['program_select']['console_web_browser'] =~/\S\S+/
+ @rc['program_select']['console_web_browser']
+ else 'console-www-browser' #'links2' 'elinks' 'epiphany'
+ end
+ end
+ def console_www_browser
+ web_browser
+ end
+ def xml_viewer
+ if defined? @rc['program_select']['xml_viewer'] and @rc['program_select']['xml_viewer'] =~/\S\S+/
+ @rc['program_select']['xml_viewer']
+ else text_editor
+ end
+ end
+ def xml_editor
+ xml_viewer
+ end
+ def odf_viewer
+ if defined? @rc['program_select']['odf_viewer'] and @rc['program_select']['odf_viewer'] =~/\S\S+/
+ @rc['program_select']['odf_viewer']
+ else 'oowriter' #'odf-viewer','oowriter'
+ end
+ end
+ def file_encoding #file encoding
+ is=''
+ if defined? @rc['program_set']['file_encoding']; is=@rc['program_set']['encoding']
+ end
+ if is.nil? or is==true; is='encoding'
+ end
+ is
+ end
+ def wc #wordcount
+ is=''
+ if defined? @rc['program_set']['wc']; is=@rc['program_set']['wc']
+ end
+ if is.nil? or is==true; is='wc'
+ end
+ is
+ end
+ def tidy
+ if defined? @rc['program_set']['tidy']; is=@rc['program_set']['tidy']
+ end
+ if is.nil? or is==true; is='tidy'
+ end
+ is
+ end
+ def rexml #should be part of ruby 1.8 but apparently not always
+ is=if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
+ true
+ else false
+ end
+ is=if defined? @rc['program_set']['rexml']; @rc['program_set']['rexml']
+ else ''
+ end
+ if is.nil? or is==true; is='rexml'
+ end
+ is
+ end
+ def pdflatex
+ is=if defined? @rc['program_set']['pdflatex']; @rc['program_set']['pdflatex']
+ else ''
+ end
+ if is.nil? or is==true; is='pdflatex'
+ end
+ is
+ end
+ def postgresql
+ is=if defined? @rc['program_set']['postgresql']; @rc['program_set']['postgresql']
+ else ''
+ end
+ if is.nil? or is==true; is='postgresql'
+ end
+ is
+ end
+ def sqlite
+ is=if defined? @rc['program_set']['sqlite']; @rc['program_set']['sqlite']
+ else ''
+ end
+ if is.nil? or is==true; is='sqlite'
+ end
+ is
+ end
+ self
+ end
+ def i18n
+ def language # language settings
+##
+ m=/.+\/\S+?\~(\S+)/
+ pwd=Dir.pwd
+ conf=if defined? @rc['default']['language']; @rc['default']['language']
+ else nil
+ end
+ l=if pwd=~m ; pwd[m1,1] #2 directory: by visible directory name
+ elsif conf; @rc['default']['language'] #3 config: from sisurc.yaml
+ else defaults[:language] #4 sisu: program default
+ end #1 document: param gets
+ SiSU_Env::Standardise_language.new(l)
+ end
+ def multilingual
+ if defined? @rc['default']['multilingual'] and @rc['default']['multilingual'] != nil; @rc['default']['multilingual']
+ else defaults[:multilingual]
+ end
+ end
+ def lang_filename(l)
+ @lang={}
+ x=if multilingual
+ x=if defined? @rc['default']['language_file'] and @rc['default']['language_file'] != nil; @rc['default']['language_file']
+ else 1
+ end
+ else 0
+ end
+ if (l != defaults[:language_code]) or (language.code != defaults[:language_code]) #watch
+ if x==1; @lang[:pre],@lang[:mid],@lang[:post]="#{l}.",'',''
+ elsif x==2; @lang[:pre],@lang[:mid],@lang[:post]='',".#{l}",''
+ elsif x==3; @lang[:pre],@lang[:mid],@lang[:post]='','',".#{l}"
+ else @lang[:pre],@lang[:mid],@lang[:post]='','',''
+ end
+ else @lang[:pre],@lang[:mid],@lang[:post]='','',''
+ end
+ @lang
+ end
+ self
+ end
+ def file_encoding
+ is=''
+ if defined? @rc['program_set']['file_encoding']; is=@rc['program_set']['encoding']
+ end
+ if is.nil? or is==true; is='encoding'
+ end
+ is
+ end
+ def papersize # paper settings, default overidden in param if set within document
+ if defined? @rc['default']['papersize']; @rc['default']['papersize'].downcase
+ else defaults[:papersize].downcase
+ end
+ end
+ def odf_structure
+ rm_rf("#{path.processing}/odf")
+ system("unzip -q #{path.share}/odf/odt.zip -d #{path.processing}")
+ end
+ def sisupod_gen(fns_pod)
+ pwd=Dir.pwd
+ sisupod_processing_path="#{path.processing}/sisupod"
+ rm_rf(sisupod_processing_path) if FileTest.directory?(sisupod_processing_path) or FileTest.file?(sisupod_processing_path)
+ File.mkpath(sisupod_processing_path) unless FileTest.directory?(sisupod_processing_path)
+ if FileTest.file?("#{Dir.pwd}/#{fns_pod}")
+ system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{path.processing}")
+ else
+ tell=SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}")
+ tell.warn unless @cmd=~/q/
+ end
+ sisupod_processing_path
+ end
+ end
+ class Info_processing_flag
+ attr_accessor :color,:cf_0,:cf_1,:cf_2,:cf_3,:cf_4,:cf_5
+ def initialize
+ @rc=Get_init.instance.yamlrc
+ end
+ def color #processing flag shortcuts
+ if defined? @rc['flag']['color']; @rc['flag']['color']
+ else false
+ end
+ end
+ def cf_0 #processing flag shortcuts
+ if defined? @rc['flag']['default'] and
+ not (@rc['flag']['default'].nil? or @rc['flag']['default'].empty?)
+ @rc['flag']['default']
+ else '-NhwpAobxXyYv'
+ end
+ end
+ def cf_1 #processing flag shortcuts
+ if defined? @rc['flag']['i'] and
+ not (@rc['flag']['i'].nil? or @rc['flag']['i'].empty?)
+ @rc['flag']['i']
+ else '-NhwpAoy' #'-Nhwpy'
+ end
+ end
+ def cf_2 #processing flag shortcuts
+ if defined? @rc['flag']['ii'] and
+ not (@rc['flag']['ii'].nil? or @rc['flag']['ii'].empty?)
+ @rc['flag']['ii']
+ else '-NhwpAobxXy' # '-NhwpAoy'
+ end
+ end
+ def cf_3 #processing flag shortcuts
+ if defined? @rc['flag']['iii'] and
+ not (@rc['flag']['iii'].nil? or @rc['flag']['iii'].empty?)
+ @rc['flag']['iii']
+ else '-NhwpAobxXyY'
+ end
+ end
+ def cf_4 #processing flag shortcuts
+ if defined? @rc['flag']['iv'] and
+ not (@rc['flag']['iv'].nil? or @rc['flag']['iv'].empty?)
+ @rc['flag']['iv']
+ else '-NhwpAobxXDyY --import'
+ end
+ end
+ def cf_5 #processing flag shortcuts
+ if defined? @rc['flag']['v'] and
+ not (@rc['flag']['v'].nil? or @rc['flag']['v'].empty?)
+ @rc['flag']['v']
+ else '-NhwpAobxXDyY --update'
+ end
+ end
+ end
+ class Info_settings < Info_env
+ def permission?(prog) #program defaults
+ if defined? @rc['permission_set'][prog]; @rc['permission_set'][prog]
+ else false
+ end
+ end
+ def program?(prog) #program defaults
+ if defined? @rc['program_set'][prog]; @rc['program_set'][prog]
+ else false
+ end
+ end
+ end
+ class File_map < Info_env
+ attr_accessor :local_sisu_source
+ def initialize(opt='') #watch
+ super()
+ @opt=opt #,opt.fns,opt.cmd
+ #@file=@opt.fns #not always fns
+ @env=if @opt.fns and not @opt.fns.empty?
+ SiSU_Env::Info_env.new(@opt.fns)
+ else
+ SiSU_Env::Info_env.new('dummy.sst')
+ end
+ if @opt.cmd =~/m/; @md=SiSU_Param::Parameters.new(@opt).get
+ end
+ ft=[]
+ if @md and defined? @md.fn and @md.fn # used for multilingual
+ if @md.cmd =~ /[hH]/; ft << @md.fn[:html]
+ end
+ if @md.cmd =~ /w/ and @md.cmd !~ /[hH]/; ft << @md.fn[:concordance]
+ end
+ if @md.cmd =~ /y/ and @md.cmd !~ /[hH]/; ft << @md.fn[:manifest]
+ end
+ if @md.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p]
+ end
+ if @md.cmd =~ /x/; ft << @md.fn[:sax]
+ end
+ if @md.cmd =~ /X/; ft << @md.fn[:dom]
+ end
+ if @md.cmd =~ /b/; ft << @md.fn[:xhtml]
+ end
+ if @md.cmd =~ /[aAeE]/; ft << @md.fn[:plain]
+ end
+ if @md.cmd =~ /[g]/; ft << @md.fn[:wiki]
+ end
+ if @md.cmd =~ /N/; ft << @md.fn[:digest]
+ end
+ if @md.cmd =~ /o/; ft << @md.fn[:odf]
+ end
+ if @md.cmd =~ /s/; ft << @md.fns
+ end
+ if @md.cmd =~ /S/; ft << 'sisupod.zip' << '.kdi'
+ end
+ @fnb=@md.fnb
+ else # still needed where/when param is not parsed
+ if @opt.cmd =~ /[hH]/; ft << '.html' << '.html.??'
+ end
+ if @opt.cmd =~ /w/ and @opt.cmd !~ /[hH]/; ft << 'concordance.html' << '??.concordance.html' << 'concordance.??.html'
+ end
+ if @opt.cmd =~ /y/ and @opt.cmd !~ /[hH]/; ft << 'sisu_manifest.html' << '??.sisu_manifest.html' << 'sisu_manifest.??.html'
+ end
+ if @opt.cmd =~ /p/; ft << 'landscape.pdf' << 'portrait.pdf' << '.pdf'
+ end
+ if @opt.cmd =~ /x/; ft << 'sax.xml' << '??.sax.xml' << 'sax.??.xml'
+ end
+ if @opt.cmd =~ /X/; ft << 'dom.xml' << '??.dom.xml' << 'dom.??.xml'
+ end
+ if @opt.cmd =~ /b/; ft << 'scroll.xhtml' << '??.scroll.xhtml' << 'scroll.??.xhtml'
+ end
+ if @opt.cmd =~ /[aAeE]/; ft << 'plain.txt' << '??.plain.txt' << 'plain.??.txt'
+ end
+ if @opt.cmd =~ /[g]/; ft << 'wiki.txt' << '??.wiki.txt' << 'wiki.??.txt'
+ end
+ if @opt.cmd =~ /N/; ft << 'digest.txt' << '??.digest.txt' << 'digest.??.txt'
+ end
+ if @opt.cmd =~ /o/; ft << 'opendocument.odt' << '??.opendocument.odt' << 'opendocument.??.odt'
+ end
+ if @opt.cmd =~ /s/; ft << '.sst' << '.ssi' << '.ssm'
+ end
+ if @opt.cmd =~ /S/; ft << 'sisupod.zip' << '.kdi'
+ end
+ if @opt.mod.inspect =~ /sxm|sxs|xml/; ft << @fnb << '.sxs.xml'
+ end
+ if @opt.mod.inspect =~ /sxd/; ft << @fnb << '.sxd.xml'
+ end
+ if @opt.mod.inspect =~ /sxn/; ft << @fnb << '.sxn.xml'
+ end
+ end
+ ft=ft.uniq
+ filetypes=ft.join(',')
+ @filetypes=if filetypes !~/..+/; '' # -r called alone, copy all
+ elsif @opt.cmd =~/u/; '' # -u added, copy all, (used to create remote directory tree see output path), not the usual function of -u
+ elsif filetypes =~/\S+?,\S+/; '*{' + filetypes + '}' # more than one relevant file type
+ else '*' + filetypes # one relevant file type
+ end
+ @source_path=if @fnb and not @fnb.empty?; "#{@env.path.output}/#@fnb"
+ else @env.path.output
+ end
+ @local_sisu_source=if @filetypes =~/\S/; "#@source_path/#@filetypes"
+ else @source_path
+ end
+ end
+ end
+ class Clean_output
+ require 'fileutils'
+ include FileUtils::Verbose
+ def initialize(opt)
+ @opt=opt
+ z=File_map.new(@opt)
+ @zap=z.local_sisu_source
+ if @opt.cmd =~ /[hH]/
+ @zap=Dir.glob(@zap).join(' ')
+ if @opt.cmd !~ /w/; @zap.gsub!(/#@source_path\/concordance.html/,'')
+ end
+ end
+ @env=SiSU_Env::Info_env.new
+ end
+ def zap
+ if @zap !~/\/\//; rm_rf(@zap) if FileTest.directory?(@zap)
+ else puts 'suspect zap request, ignored'
+ end
+ #Dir.unlink(@zap) if FileTest.directory?(@zap)
+ #System_call.new(@zap,'',@cmd).rm
+ end
+ def zap_map
+ if @opt.fnb and not @opt.fnb.empty?
+ sm="#{@env.path.output}/sitemaps/sitemap_#{@opt.fnb}.xml"
+ rm(sm) if FileTest.file?(sm)
+ end
+ end
+ end
+ class Info_remote_host
+ def initialize
+ @rc=Get_init.instance.yamlrc
+ end
+ def remote_host #see Info_remote remote_host_base_general
+ r={}
+ r=if (defined? @rc['remote']['user'] and defined? @rc['remote']['host'])
+ r[:user]=@rc['remote']['user']
+ r[:host]=@rc['remote']['host']
+ r[:path]=if defined? @rc['remote']['path']
+ @rc['remote']['path']
+ else ''
+ end
+ r[:name]="#{r[:user]}@#{r[:host]}:#{r[:path]}"
+ r
+ else
+ r[:name]='.'
+ r[:user]=''
+ r[:host]=''
+ r[:path]=''
+ r
+ #puts "no remote host or user"
+ end
+ end
+ end
+ class Info_remote < File_map
+ @@flag_remote=false
+ require 'socket'
+ def initialize(opt)
+ super(opt) #
+ @opt=opt
+ @rc=Get_init.instance.yamlrc
+ end
+ def remote_host_base_general
+ SiSU_Env::Info_remote_host.new.remote_host
+ end
+ def remote_host_base
+ remote=remote_host_base_general
+ #host_ip=IPSocket.getaddress(remote[:host]) unless remote[:host].empty?
+ @@flag_remote=true if remote[:name] =~/\S+@\S+/ #and host_ip =~/\d+\.\d+\.\d+\.\d+/ #very naive check should be enough /[0-255]+\.[0-255]+\.[0-255]+\.[0-255]+/
+ #remote[:name]
+ remote_host_base_general[:name]
+ end
+ def scp #sort out later using ruby libraries #not ideal, first time each file is sent, -r must be called separately for subdir to be built
+ input=@local_sisu_source
+ output=case @opt.cmd
+ when /u/; "#{self.remote_host_base}/#{@env.path.stub_pwd}/." #creates remote directory tree, this is not the usual function of u
+ when /[aAbeEhHNopwxXy]/; "#{self.remote_host_base}/#{@env.path.stub_pwd}/#{@fnb}/."
+ else "#{self.remote_host_base}/#{@env.path.stub_pwd}/."
+ end
+ if (input =~/\S/ and input !~/\/\//) and (output =~/\S/ and output !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/
+ System_call.new(input,output).scp
+ elsif @opt.cmd =~/U/; puts "#{input} -> #{output}"
+ else puts 'suspect scp request, ignored'
+ end
+ end
+ def rsync
+ input=@source_path
+ output="#{self.remote_host_base}/#{@env.path.stub_pwd}/."
+ if (input =~/\S/ and input !~/\/\//) and (output =~/\S/ and output !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/
+ System_call.new(input,output,@opt.cmd).rsync('--delete-after')
+ elsif @opt.cmd =~/U/
+ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "#{input} -> #{output}"
+ else
+ puts 'suspect rsync request, ignored'
+ puts "#{input} -> #{output} remote flag: #@@flag_remote"
+ puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ end
+ end
+ def scp_base #base site
+ input=@source_path
+ output="#{remote_host_base}/#{@env.path.stub_pwd}/."
+ if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ puts "begin scp_base: #{input} -> #{output}"
+ System_call.new("#{input}/#{@env.path.style}/",output).scp
+ elsif @opt.cmd =~/U/
+ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "begin scp_base: #{input} -> #{output}"
+ puts "#{input}/#{@env.path.style}/ -> #{output}"
+ else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ end
+ end
+ def scp_base_all #base site
+ input=@source_path
+ output="#{remote_host_base}/#{@env.path.stub_pwd}/."
+ if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ puts "begin scp_base_all: #{input} -> #{output}"
+ System_call.new("#{input}/_sisu/image/",output).scp
+ System_call.new("#{input}/_sisu/image_local/",output).scp
+ System_call.new("#{input}/#{@env.path.style}/",output).scp
+ elsif @opt.cmd =~/U/
+ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "scp_base_all: #{input} -> #{output}"
+ puts "#{input}/_sisu/image/ -> #{output}"
+ puts "#{input}/_sisu/image_local/ -> #{output}"
+ puts "#{input}/#{@env.path.style}/ -> #{output}"
+ else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ end
+ end
+ def rsync_base #base site
+ input=@source_path
+ output="#{remote_host_base}/#{@env.path.stub_pwd}/."
+ if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ #puts "begin rsync_base: #{input} -> #{output}"
+ #System_call.new("#{input}/_sisu/image/",output).rsync
+ #System_call.new("#{input}/_sisu/image_local/",output).rsync
+ #System_call.new("#{input}/#{@env.path.style}/",output).rsync
+ elsif @opt.cmd =~/U/
+ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "rsync_base: #{input} -> #{output}"
+ puts "#{input}/_sisu/image/ -> #{output}"
+ puts "#{input}/_sisu/image_local/ -> #{output}"
+ puts "#{input}/#{@env.path.style}/ -> #{output}"
+ else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ end
+ end
+ def rsync_base_sync #base site
+ input=@source_path
+ output="#{remote_host_base}/#{@env.path.stub_pwd}/."
+ if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ puts "begin rsync_base_sync: #{input} -> #{output}"
+ System_call.new("#{input}/_sisu/image/",output).rsync('--delete-after')
+ System_call.new("#{input}/_sisu/image_local/",output).rsync('--delete-after')
+ System_call.new("#{input}/#{@env.path.style}/",output).rsync('--delete-after')
+ elsif @opt.cmd =~/U/
+ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "rsync_base_sync: #{input} -> #{output}"
+ puts "#{input}/_sisu/image/ -> #{output}"
+ puts "#{input}/_sisu/image_local/ -> #{output}"
+ puts "#{input}/#{@env.path.style}/ -> #{output}"
+ else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ end
+ end
+ def rsync_sitemaps #sitemap directory
+ input="#@source_path/sitemapindex.xml"
+ output="#{remote_host_base}/#{@env.path.stub_pwd}/."
+ if @@flag_remote
+ #if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] #and @@flag_remote==true and @opt.cmd !~/U/
+ System_call.new(input,output).rsync('--delete-after')
+ elsif @opt.cmd =~/U/
+ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ puts "rsync_sitemaps: #{input} -> #{output}"
+ else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
+ end
+ end
+ end
+ class Info_version <Info_env
+ require 'rbconfig'
+ def get_version
+ require 'ftools'
+ @version={}
+ @pwd=ENV['PWD']
+ yst_etc="#{defaults[:sisu_etc]}/version.yml"
+ lib_path=`echo $RUBYLIB`.split(':')
+ if File.exist?(yst_etc); @version=YAML::load(File::open(yst_etc)) #unless @@noyaml
+ end
+ @version
+ end
+ def rbversion
+ #Config::CONFIG['ruby_version']
+ %x{ruby -v}.strip
+ end
+ end
+ class Create_system_link #< Info_env #revisit problems created 2004w41
+ def initialize
+ @env=SiSU_Env::Info_env.new
+ end
+ def images
+ File.mkpath("#{@env.path.output}/_sisu") unless FileTest.directory?("#{@env.path.output}/_sisu")
+ File.symlink("../../_sisu/image", "#{@env.path.output}/_sisu/image") unless File.symlink?("#{@env.path.output}/_sisu/image")
+ end
+ def man_forms
+ #File.symlink("../../man/form", "#{@env.path.output}/man/form") unless File.symlink?("#{@env.path.output}/man/form") == true
+ end
+ def man_pdf
+ #File.symlink("../../man/form", "#{@env.path.output}/man/pdf") unless File.symlink?("#{@env.path.output}/man/pdf") == true
+ end
+ end
+ class Info_file < Info_env
+ def initialize(fns='')
+ @env=SiSU_Env::Info_env.new
+ @fns=fns
+ end
+ def basefilename
+ m=/(.+?)\.(?:[_-]?sst|ssm)$/m
+ fnb=@fns[m,1]
+ end
+ def project
+ "#{@env.development}/sisu.lnk"
+ end
+ def project_info
+ "#{@env.datapriv_i}/sisu.er3"
+ end
+ def project_todo
+ "#{@env.development}/todo.txt"
+ end
+ def admin_self
+ "#{@env.path.home}/.corundum/dots.lnk"
+ end
+ def admin_root
+ '/root/.corundum/admin.txt'
+ end
+ end
+ class Info_db < Info_env
+ @@rc=nil
+ def initialize
+ @@pwd ||=Dir.pwd
+ @pwd=Dir.pwd
+ @env=SiSU_Env::Info_env.new
+ m=/.+\/(\S+)/m
+ @pwd_stub=@pwd[m,1]
+ @rc=@@rc ||=Get_init.instance.yamlrc
+ @defaults=Info_env.new.defaults
+ end
+ def user
+ @env.user
+ end
+ def db_psql
+ "SiSU_#@pwd_stub"
+ end
+ def db_mysql
+ 'lm'
+ end
+ def db_sqlite
+ "#{@env.path.webserv}/#@pwd_stub/sisu_sqlite.db"
+ end
+ def port_psql #PGPORT
+ if defined? @rc['db']['postgresql']['port'] and @rc['db']['postgresql']['port'] =~/\d+/
+ @rc['db']['postgresql']['port']
+ else @defaults[:postgresql_port]
+ end
+ end
+ def port_mysql
+ '**'
+ end
+ def dbi_psql
+ "DBI:Pg:database=#{db_psql};port=#{port_psql}"
+ end
+ def dbi_mysql
+ "dbi:Mysql:database=#{db_mysql};port=#{port_mysql}"
+ end
+ def dbi_sqlite
+ "DBI:SQLite:#{db_sqlite}" #sqlite3 ?
+ end
+ end
+ class Info_port < Info_env
+ def initialize
+ @env=SiSU_Env::Info_env.new
+ end
+ def webrick
+ @env.url.webrick_port
+ end
+ end
+ class Info_program < Info_env #revisit
+ attr_accessor :editor,:wc,:tidy,:rexml,:pdflatex,:postgresql,:sqlite
+ def initialize
+ prog=SiSU_Env::Info_env.new.program
+ @editor,@wc,@tidy,@rexml,@pdflatex,@postgresql,@sqlite=prog.text_editor,prog.wc,prog.tidy,prog.rexml,prog.pdflatex,prog.postgresql,prog.sqlite
+ end
+ end
+ class Info_skin
+ def initialize(md=nil,skin=nil)
+ @md=md
+ @d_sk=if skin.class==String ; skin
+ elsif defined? md.doc_skin and md.doc_skin; md.doc_skin
+ else nil
+ end
+ @home,@pwd=ENV['HOME'],ENV['PWD']
+ m=/.+\/(\S+)/m
+ @pwd_stub=@pwd[m,1]
+ @env=SiSU_Env::Info_env.new
+ end
+ def select # skin loading logic here
+ load SiSU_lib + '/defaults.rb'
+ skin_path=[]
+ @env.sys.rc_path.each{|x| skin_path << "#{x}/skin"}
+ skin_path << "#{@env.path.processing}/external_document/skin"
+ #skin_path << "#{@env.path.processing}/external_document/_sisu/skin" #revisit
+ skin=true
+ if @pwd_stub =~/^sisupod$/ and @md.mod.inspect !~/--trust/; skin=false #security only run skins on sisupod if --trust flag is provided
+ end
+ doc_skin,dir_skin=nil,nil
+ if skin
+ unless @d_sk.nil?
+ sk_doc="doc/#@d_sk.rb"
+ skin_path.each do |v| #document skin priority 1
+ if FileTest.file?("#{v}/#{sk_doc}")
+ doc_skin="#{v}/#{sk_doc}"
+ load doc_skin
+ break
+ end
+ end
+ end
+ unless doc_skin
+ sk_dir="dir/skin_#@pwd_stub.rb"
+ skin_path.each do |v| #directory skin priority 2
+ if FileTest.file?("#{v}/#{sk_dir}")
+ dir_skin="#{v}/#{sk_dir}"
+ load dir_skin
+ break
+ end
+ end
+ end
+ end
+ sk=if doc_skin; doc_skin
+ elsif dir_skin; dir_skin
+ else nil
+ end
+ end
+ end
+ class CSS_default
+ def html
+ 'html.css'
+ end
+ def html_tables
+ 'html_tables.css'
+ end
+ def xhtml
+ 'xhtml.css'
+ end
+ def xml_sax
+ 'sax.css'
+ end
+ def xml_dom
+ 'dom.css'
+ end
+ def docbook_xml
+ 'docbook.css'
+ end
+ def homepage
+ 'index.css'
+ end
+ end
+ class CSS_select < Info_env
+ def initialize(md)
+ @md=md
+ @env=SiSU_Env::Info_env.new
+ end
+ def html
+ css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html.css")
+ "#{@md.doc_css}_html.css"
+ elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_html.css")
+ "#{@env.path.stub_pwd}_html.css"
+ else CSS_default.new.html
+ end
+ end
+ def html_tables
+ css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html_tables.css")
+ "#{@md.doc_css}_html_tables.css"
+ elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_html_tables.css")
+ "#{@env.path.stub_pwd}_html_tables.css"
+ else CSS_default.new.html_tables
+ end
+ end
+ def xhtml
+ css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xhtml.css")
+ "#{@md.doc_css}_xhtml.css"
+ elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xhtml.css")
+ "#{@env.path.stub_pwd}_xhtml.css"
+ else CSS_default.new.xhtml
+ end
+ end
+ def xml_sax
+ css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_sax.css")
+ "#{@md.doc_css}_xml_sax.css"
+ elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xml_sax.css")
+ "#{@env.path.stub_pwd}_xml_sax.css"
+ else CSS_default.new.xml_sax
+ end
+ end
+ def xml_dom
+ css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_dom.css")
+ "#{@md.doc_css}_xml_dom.css"
+ elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xml_dom.css")
+ "#{@env.path.stub_pwd}_xml_dom.css"
+ else CSS_default.new.xml_dom
+ end
+ end
+ def docbook_xml
+ css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_docbook.css")
+ "#{@md.doc_css}_xml_dom.css"
+ elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_docbook.css")
+ "#{@env.path.stub_pwd}_docbook.css"
+ else CSS_default.new.docbook_xml
+ end
+ end
+ def homepage
+ css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_homepage.css")
+ "#{@md.doc_css}_homepage.css"
+ elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_homepage.css")
+ "#{@env.path.stub_pwd}_homepage.css"
+ else CSS_default.new.homepage
+ end
+ end
+ end
+ class CSS_stylesheet
+ def initialize(md)
+ @md=md
+ @css=CSS_select.new(@md)
+ @env=SiSU_Env::Info_env.new
+ end
+ def html
+ %{ <link rel="stylesheet" href="../#{@env.path.style}/#{@css.html}" type="text/css" />}
+ end
+ def html_tables
+ %{ <link rel="stylesheet" href="../#{@env.path.style}/#{@css.html_tables}" type="text/css" />}
+ end
+ end
+ class SiSU_file <Info_env #todo unify with Create_file
+ def initialize(md,fno='')
+ begin
+ @fno,@fns,@fnb=fno,md.fns,md.fnb
+ @env=SiSU_Env::Info_env.new(@fns)
+ @env_out="#{@env.path.output}/#@fnb"
+ rescue; STDERR.puts SiSU_Screen::Ansi.new(@cmd,$!,$@).rescue
+ ensure
+ end
+ end
+ def make_file(path,filename)
+ if File.writable?("#{path}/."); File.new("#{path}/#{filename}",'w+')
+ else
+ SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn
+ end
+ end
+ def touch_file(path,filename)
+ if File.writable?("#{path}/.");
+ system("touch #{path}/#{filename}")
+ #File.new("#{path}/#{filename}",'w+')
+ else
+ SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn
+ end
+ end
+ def make_path(path)
+ File.mkpath(path) unless FileTest.directory?(path)
+ end
+ def mkdir_initialize # not used but consider using
+ File.mkpath(@env.path.output) unless FileTest.directory?(@env.path.output)
+ File.mkpath("#{@env.path.output}/#@fnb") unless FileTest.directory?("#{@env.path.output}/#@fnb")
+ File.mkpath("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}")
+ File.mkpath(@env.path.dal) unless FileTest.directory?(@env.path.dal)
+ File.mkpath(@env.path.tune) unless FileTest.directory?(@env.path.tune)
+ end
+ def mkdir
+ dir=@env.path.output
+ txt_path="#{dir}/#@fnb"
+ File.mkpath(dir) unless FileTest.directory?(dir)
+ File.mkpath(txt_path) unless FileTest.directory?(txt_path)
+ File.mkpath("#{dir}/#{@env.path.style}") unless FileTest.directory?("#{dir}/#{@env.path.style}")
+ File.mkpath(@env.path.dal) unless FileTest.directory?(@env.path.dal)
+ File.mkpath(@env.path.tune) unless FileTest.directory?(@env.path.tune)
+ end
+ def mkfile #consider using more
+ path="#{@env.path.output}/#@fnb"
+ filename=@fno
+ file=make_file(path,filename)
+ end
+ def mkfile_pwd
+ path=Dir.pwd
+ filename=@fno
+ file=make_file(path,filename)
+ end
+ end
+ class Create_file <Info_env #todo unify with SiSU_file
+ def initialize(cmd,fns,operation='')
+ @cmd=cmd
+ begin
+ super(fns)
+ @env=SiSU_Env::Info_env.new(fns)
+ ver=Info_version.new
+ case operation #watch
+ when /pdf/; @env_out=''
+ when /sql/
+ when /xml|plaintext|ascii/; @env_out="#{@env.path.output}/#@fnb" #check change of name to plaintext from ascii
+ else
+ if defined? @md.sfx_src and @md.sfx_src =~/ss[ftsumc]/
+ @env_suf='lm'
+ @env_out_root=@env.path.output
+ @env_out="#{@env.path.output}/#@fnb"
+ @env_tex=@env.path.tex
+ @env_lout=@env.path.lout
+ @@publisher='SiSU http://www.jus.uio.no/sisu'
+ @env_pdf="#@env_out_root/pdf"
+ end
+ end
+ rescue; STDERR.puts SiSU_Screen::Ansi.new(@cmd,$!,$@).rescue
+ ensure
+ end
+ end
+ def param_instantiate
+ @cX||=SiSU_Screen::Ansi.new(@cmd)
+ @@date=Info_date.new
+ @@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=@@yaml=@@yamladdr=nil
+ @@publisher='SiSU scribe'
+ end
+ def html_root
+ #@env.path.output
+ end
+ def mkdir_pdf
+ Dir.mkdir(@env.path.tex) unless FileTest.directory?(@env.path.tex)
+ end
+ def file_generic(output_file='')
+ filename="#{@env.path.output}/#@fnb/#{output_file}"
+ File.new(filename,'w+')
+ end
+ def file_error
+ File.new('/tmp/errorlog.sisu','w+')
+ end
+ def file_meta
+ File.new("#{@env.path.dal}/#@fns.meta",'w+')
+ end
+ def file_note
+ File.new("#{Dir.pwd}/#@fns.fn",'w+')
+ end
+ def marshal_meta
+ "#{@env.path.dal}/#@fns.meta.rbm"
+ end
+ def meta
+ "#{@env.path.dal}/#@fns.meta"
+ end
+ def file_tune
+ File.new("#{@env.path.tune}/#@fns.tune",'w+')
+ end
+ def marshal_tune
+ "#{@env.path.tune}/#@fns.marshal_tune"
+ end
+ def file_semantic
+ filename_semantic="./semantic.yaml"
+ @@filename_semantic=File.new(filename_semantic,'w+')
+ end
+ def file_rss
+ filename_rss="./semantic.xml"
+ @@filename_rss=File.new(filename_rss,'w+')
+ end
+ def file_html_scroll(md)
+ filename_scroll="#{@env.path.output}/#{md.fnb}/#{md.fnl[:pre]}doc#{md.fnl[:mid]}.html#{md.fnl[:post]}"
+ @@filename_html_scroll=File.new(filename_scroll,'w+')
+ end
+ def file_html_index(md)
+ filename_index="#{@env.path.output}/#{md.fnb}/#{md.fnl[:pre]}index#{md.fnl[:mid]}.html#{md.fnl[:post]}"
+ @@filename_html_index=File.new(filename_index,'w+')
+ end
+ def file_html_segtoc(md)
+ filename_segtoc="#{@env.path.output}/#{md.fnb}/#{md.fnl[:pre]}toc#{md.fnl[:mid]}.html#{md.fnl[:post]}"
+ File.new(filename_segtoc,'w+')
+ end
+ def file_texinfo
+ File.new("#{@env.path.texinfo}/#@fnb.texinfo",'w+')
+ end
+ end
+ class Create_site < Info_env
+ require SiSU_lib + '/css'
+ include SiSU_Style
+ def initialize(cmd)
+ @cmd=cmd
+ @env=SiSU_Env::Info_env.new
+ @home,@pwd=ENV['HOME'],ENV['PWD'] #@pwd=Dir.pwd
+ @rc=Get_init.instance.yamlrc
+ @vz=SiSU_Env::Get_init.instance.skin
+ @vz_home=SiSU_Viz::Home.new
+ end
+ def homepage
+ homepage_path=nil
+ @env.sys.rc_path.each do |v|
+ if FileTest.file?("#{v}/home/index.html")
+ homepage_path="#{v}/home/index.html"
+ break
+ end
+ end
+ File.mkpath("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}")
+ if homepage_path and FileTest.file?(homepage_path)
+ cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html")
+ cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html")
+ else
+ doc_skin=nil
+ sk_doc='doc/skin_sisu.rb'
+ @env.sys.rc_path.each do |v| #document skin priority 1
+ if FileTest.file?("#{v}/skin/#{sk_doc}")
+ doc_skin="#{v}/skin/#{sk_doc}"
+ load doc_skin
+ break
+ end
+ end
+ filename_homepage=File.new("#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html",'w')
+ filename_homepage_toc=File.new("#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html",'w')
+ filename_homepage << @vz_home.index
+ filename_homepage_toc << @vz_home.index
+ end
+ end
+ def cp_images(src_path,dest_path)
+ if FileTest.directory?(src_path)
+ cd(src_path)
+ source=Dir.glob("*.{png,jpg,gif,ico}")
+ File.mkpath(dest_path) unless FileTest.directory?(dest_path)
+ chmod(0755,dest_path)
+ source.each do |i|
+ cp_r(i,"#{dest_path}/#{i}")
+ chmod(0644,"#{dest_path}/#{i}")
+ end
+ cd(@pwd)
+ else puts "\tWARN, did not find - #{src_path}"
+ end
+ end
+ def cp_local_images
+ src="#@pwd/_sisu/image"
+ dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_local"
+ cp_images(src,dest)
+ end
+ def cp_external_images
+ src="#{@env.path.processing}/external_document/image"
+ dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external"
+ cp_images(src,dest)
+ end
+ def cp_webserver_images
+ src=@env.path.image_source
+ dest="#{@env.path.webserv}/_sisu/image"
+ cp_images(src,dest)
+ end
+ def cp_base_images #fix images
+ src="#{@env.path.share}/image"
+ dest="#{@env.path.webserv}/_sisu/image"
+ cp_images(src,dest)
+ end
+ def cp_css
+ File.mkpath("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}")
+ css_path=['/etc/sisu/css',"#@home/.sisu/css","#@pwd/_sisu/css"] #BROKEN
+ if defined? @rc['permission_set']['css_modify'] and @rc['permission_set']['css_modify']
+ tell=SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}")
+ css_path.each do |x|
+ if FileTest.directory?(x)
+ cd(x)
+ source=Dir.glob("*.{css}")
+ source.each do |i|
+ cp(i,"#{@env.path.output}/#{@env.path.style}")
+ end
+ cd(@pwd)
+ end
+ end
+ else tell=SiSU_Screen::Ansi.new(@cmd,"modify css is not set or is set to: false")
+ end
+ tell.warn if @cmd=~/[MV]/
+ fn_css=SiSU_Env::CSS_default.new
+ css=SiSU_Style::CSS.new
+ path_style="#{@env.path.output}/#{@env.path.style}"
+ File.mkpath(path_style) unless FileTest.directory?(path_style)
+ style=File.new("#{path_style}/#{fn_css.homepage}",'w')
+ style << css.homepage
+ style.close
+ style=File.new("#{path_style}/#{fn_css.html_tables}",'w')
+ style << css.html_tables
+ style.close
+ style=File.new("#{path_style}/#{fn_css.html}",'w')
+ style << css.html
+ style.close
+ style=File.new("#{path_style}/#{fn_css.xml_sax}",'w')
+ style << css.xml_sax
+ style.close
+ style=File.new("#{path_style}/#{fn_css.xml_dom}",'w')
+ style << css.xml_dom
+ style=File.new("#{path_style}/#{fn_css.docbook_xml}",'w')
+ style << css.docbook_xml
+ style.close
+ style=File.new("#{path_style}/#{fn_css.xhtml}",'w')
+ style << css.xhtml
+ style.close
+ end
+ end
+end
+module SiSU_Screen
+ require SiSU_lib + '/screen_text_color'
+end
+module SiSU_Errors
+ require SiSU_lib + '/errors'
+end
+__END__
diff --git a/lib/sisu/0.52/termsheet.rb b/lib/sisu/0.52/termsheet.rb
new file mode 100644
index 00000000..6e87a0b8
--- /dev/null
+++ b/lib/sisu/0.52/termsheet.rb
@@ -0,0 +1,158 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: SiSU information Structuring Universe, specialised pre-processing wrapper
+
+ * NOTE wrapper makes little sense without additional components, additional sample files must be provided - (saved till later as may confuse)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+=end
+require SiSU_lib + '/sysenv'
+require SiSU_lib + '/param'
+include SiSU_Param
+@do,@done,@used,@html_output,@txt_input,@txt_output,@@report=Array.new(7){[]}
+@@info=nil
+@c=0
+@cX=SiSU_Screen::Ansi.new('yes').cX
+@done << "\n#{@cX.blue_hi}#{@cX.black}Summary#{@cX.off*2}"
+def talent(termsheet,flag)
+ no_ocn='0' if flag =~/0/ #flag to request switch off of text object numbering
+ @@info=nil
+ @@info=termsheet.gsub(/(.+?)\.termsheet\.rb/,'../facility_data/\1.html')
+ @env=SiSU_Env::Info_env.new
+ @dir_fd="#{@env.path.output}/facility_data"
+ Dir.mkdir(@dir_fd) unless FileTest.directory?(@dir_fd)==true
+ html_output=[]
+ case termsheet
+ when /.+?\.(termsheet)\.rb$/
+ @basename=termsheet[/(.+?)\.termsheet\.rb/, 1]
+ @standard_form={}
+ require termsheet
+ include Termsheet
+ @standard_form=Termsheet::StandardForms.new.standardforms
+ puts %{\n#{@@cX.yellow_hi}#{@@cX.black}From#{@@cX.off*2}: #{@@cX.grey_hi}#{@@cX.black}#{@basename}.termsheet.rb#{@@cX.off*3}\n\n}
+ @standard_form.each do |k,v|
+ @c+=1
+ require v
+ puts %{\n#{@@cX.blue_hi}#{@@cX.black}Producing the following#{@@cX.off*2}: #{@@cX.green}#{@basename}.#{k}#{@@cX.off}\n\n}
+ @done << %{\n\t#{@@cX.grey}Documents generated#{@@cX.off}: #{@@cX.cyan}#{@basename}.#{k}#{@@cX.off}\n}
+ @used << %{\n\t#{@@cX.grey}Using#{@@cX.off}: #{@@cX.ruby}#{v}#{@@cX.off}\n}
+ html_output=<<WOK
+<br /><a href="../#{@basename}.#{k}/landscape.pdf">
+<img border="0" width="18" height="15" src="../_sisu/image/b_pdf.png" alt="pdf landscape"></a>&nbsp;
+<a href="../#{@basename}.#{k}/portrait.pdf">
+<img border="0" width="15" height="18" src="../_sisu/image/b_pdf.png" alt="pdf portrait"></a>&nbsp;
+<a href="../#{@basename}.#{k}/sisu_manifest.html">#{@basename}.#{k}.sisu_manifest.html</a>
+WOK
+ @html_output << html_output
+ @txt_input << %{\n\tForm #@c: <url:#{Dir.pwd}/#{v}>\n\t |#{Dir.pwd}/#{v}|@|^|\n}
+ @txt_output << %{\n\t#{k}: |../#{@basename}.#{k}/sisu_manifest.html|@|^|\n}
+ @report_file_i=File.new("#@dir_fd/#@basename.txt",'w+')
+ @report_file_o=File.new("#@dir_fd/#@basename.html",'w+')
+ @filename_new=File.new("#@basename.#{k}.sst",'w+')
+ file_array=IO.readlines(v,"\n")
+ @do << %{#{k}}
+ @filename_new << @document
+ # "require v" pulls in the composite @document
+ # "termsheet" having all the variables required to complete the standard form @document
+ @filename_new.close
+ end
+ @do.each do |x|
+ system %{sisu -Nhwpo #{@basename}.#{x}.sst\n}
+ end
+ else print "not processed --> ", termsheet, "\n"
+ end
+ @done << %{\n\t#{@@cX.green}Summary:#{@@cX.off} #{@@cX.blue}#{@env.path.output}/facility_data/#{@basename}.html#{@@cX.off}\n}
+ @done << %{\n\t#{@@cX.grey}From details provided in#{@@cX.off}: #{@@cX.green}#{termsheet}#{@@cX.off}\n}
+ terms=%{\nTermsheet: <url:#{Dir.pwd}/#{termsheet}>\n |#{Dir.pwd}/#{termsheet}|@|^|\n}
+ @report_file_i << "<url:all.txt>\n|all.txt|@|^|\n" << terms << "\nForms:\n" << @txt_input << "\nOutput Files\n" << @txt_output
+ @report_file_o << %{<a href="toc.html">^</a><br />\n} << @html_output
+ @@report << @done << @used << "\n"
+ @done,@used=[],[]
+end
+require SiSU_lib + '/param'
+@argv=$*
+@proc="#{@argv[0].to_s}"
+if @proc =~ /^-?[wft]/
+ @argv.shift
+ @argv.each do |termsheet|
+ talent(termsheet,@proc)
+ end
+end
+@env=SiSU_Env::Info_env.new
+@dir_fd="#{@env.path.output}/facility_data"
+@url="#{@env.url.webserv}/facility_data"
+@@report << %{\n#{@@cX.grey}See#{@@cX.off}: #{@@cX.blue}#@dir_fd/all.txt\t#@dir_fd/toc.html\t#@dir_fd/#{@@cX.off}\n\n#{@@cX.grey}See#{@@cX.off}: #{@@cX.blue}#@url/all.txt\t#@url/toc.html\t#@url/#{@@cX.off}\n\n}
+puts @@report
+File.unlink("#@dir_fd/all.txt") if FileTest.file?("#@dir_fd/all.txt")
+File.unlink("#@dir_fd/toc.html") if FileTest.file?("#@dir_fd/toc.html")
+summary_file=File.new("#@dir_fd/all.txt",'w+')
+summary_html=File.new("#@dir_fd/toc.html",'w+')
+ls_txt=%x{ls #@dir_fd/*.txt}
+report_thlnk=[]
+ls_txt.scan(/.+/)
+ls_txt.each {|x| report_thlnk << x.gsub!(/#@dir_fd\/(.+)/,"<url:\\1>\n|\\1|@|^|")}
+report_thlnk.join("\n")
+ls_html=%x{ls #@dir_fd/*.html}
+#NOTE is necessary to purge @dir_fd ~myout/faciliytData
+report_html=[]
+ls_html.split(/.+/)
+ls_html.each {|x| report_html << x.gsub!(/#@dir_fd\/(.+)/,'<a href="\1">\1</a><br />')}
+report_html.join("\n")
+summary_file << "#{report_thlnk}"
+summary_html << "#{report_html}"
+__END__
+sisu -t x_bank.and.*
+e.g. sisu -t x_bank.and.*.termsheet.rb
+e.g. sisu_termsheet.rb -t x_bank.and.c*.termsheet.rb
+program calls upon termsheet file with extension termsheet.rb
+termsheet.rb calls upon relevant standard form files (to be used) with extension .sForm.rb
+there is also a standard_terms.rb file - with terms/details that are constant
+the file produced is named after the termsheet.rb with that extension replaced with .er30
+from there scribbler.rb is called upon its usual metaVerse html and pdf creation
+! :-)
+to test run
+termsheet.rb -f dev.export.import.trade.facility.termsheet.rb
+the term sheet calls the standard form or template that is to be run against it.
diff --git a/lib/sisu/0.52/texinfo.rb b/lib/sisu/0.52/texinfo.rb
new file mode 100644
index 00000000..ca62710b
--- /dev/null
+++ b/lib/sisu/0.52/texinfo.rb
@@ -0,0 +1,408 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: texinfo processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_TexInfo
+ require SiSU_lib + '/html'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ #include Stamp ... needed removed arbitrarily 2005w05/1 (warnings about undefined flags)
+ require SiSU_lib + '/texinfo_format'
+ include TexInfoFormat
+ @tex_file=[]
+ @@tex_backslash="\\\\"
+ @@tabular="{tabular}"
+ @@table_pagebreak_counter,@@tex_endnote_call_counter,@@tex_table_flag,@@tex_counter,@@tex_column,@@tex_columns,@@counting=0,0,0,0,0,0,0
+ @@column_instruct,@@tex_line_mode,@@tex_word_mode,@@start_table,@@line_mode='','','','',''
+ @@n,@@copyright,@@tableheader=nil,nil,nil
+ @@tex_col_w=[]
+ @@tex_pattern_margin_number="\\\\marginpar.+?\s+"
+ class Source #Songsheet
+ include SiSU_Param
+ include SiSU_Viz
+ include SiSU_TexInfo
+ def initialize(opt)
+ @opt=opt
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @st={ 'tex'=>{} }
+ @tex=TexInfoFormat::Texinfo.new
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def directories
+ begin
+ case @opt.fns
+ when /\.[_-]?sst$/
+ Dir.mkdir(@env.path.output) unless FileTest.directory?("#{@env.path.output}")
+ Dir.mkdir(@env.path.texi) unless FileTest.directory?(@env.path.tex)
+ @@filename_texinfo=File.new(%{#{@env.path.texi}/#@opt.fnb.texinfo},'w+')
+ end
+ rescue; STDERR.puts SiSU_Screen::Ansi.new(@opt.cmd,$!,$@).rescue
+ ensure
+ end
+ end
+ def read
+ songsheet
+ end
+ def songsheet
+ begin
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'TexInfo')
+ tell.green_title_hi unless @opt.cmd =~/q/
+ data=IO.readlines(@opt.fns,'')
+ @md=SiSU_Param::Parameters.new(@opt).get
+ puts "\t#{@@cX.grey}TexInfo#{@@cX.off}"
+ #@@copyright="\n #{@@tex_backslash*2}[3]\\ \\linebreak \\copyright \\ #{@md.copyright_tex}" if @md.copyright_tex #appears to be redundant ! remove 2004w19
+ if @md.markup.to_s !~ /url_png/
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ directories
+ @marshalfile=my_make.marshal_meta
+ if FileTest.file?(@marshalfile)==true
+ File.open(@marshalfile) { |f| @@tuned_file=Marshal.load(f)}
+ tell.meta_verse_skipped unless @opt.cmd =~/q/
+ else
+ tex_array=IO.readlines(@opt.fns,'')
+ SiSU_Metaverse.songsheet(tex_array)
+ end
+ tex_array=@@tuned_file
+ Texinfo_make.new(tex_array,@md).songsheet
+ tex_array=''
+ end
+ #@@filename_texinfo.close if @@filename_texinfo
+ @@filename_texinfo=nil
+ rescue; STDERR.puts SiSU_Screen::Ansi.new(@opt.cmd,$!,$@).rescue
+ ensure
+ @@filename_texinfo.close if @@filename_texinfo
+ end
+ end
+ end
+ class Texinfo_make
+ include SiSU_Param
+ include TexInfoFormat
+ @@tex_1='(?:.+?)+~' #?? debug
+ @@tabular="{tabular}"
+ @@tex_pattern_margin_number="\\\\marginpar.+?\s+"
+ @@dp=nil
+ def initialize(data,md)
+ @data,@md=data,md #fns
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @st={ 'tex'=>{} }
+ #@tex=TexInfoFormat::Texinfo.new
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def songsheet
+ begin
+ @data=pre
+ @data=endnote
+ @data=markup
+ @data=tail
+ output
+ makeinfo
+ rescue; STDERR.puts SiSU_Screen::Ansi.new(@md.cmd,$!,$@).rescue
+ ensure
+ end
+ end
+ def pre
+ @tex_file=[]
+ data=@data
+ data.each do |para|
+ para.gsub!(/&/,'<=and>')
+ # DEBUG 2003w16 this is a kludge, because i could not get parameters
+ # from param, Sort out ... revert to more elegant solution
+ if para =~ /<!Th?¡\s+c/
+ @@flag['tables']='y' # KLUDGE get from param
+ end
+ para.gsub!(/<:p[bn]>/,'')
+ do_mono=TexInfoFormat::Texinfo.new(para,@md)
+ @tex_file << do_mono.spec_char
+ end
+ data=@tex_file.delete_if {|x| x =~ /^0(?:\\)+~/m}
+ data=@tex_file # ...
+ end
+ def endnote
+ data=@data
+ @tex_file=[]
+ data.each do |para|
+ # BUG bug -> have problems with endnotes in headers
+ if para =~ /\\~\\\{\d+\s+/ #if para =~ /<!e\s+/ # watch
+ para.gsub!(/\s*\\~\\\{(\d+)\s+(.+?)<#@dp>\\\}\\~/m,' @footnote{ \2} ')
+ end
+ @tex_file << para
+ end
+ @tex_file
+ end
+ def poem
+ data=@data
+ @tex_file=[]
+ @@counting=0
+ data.each do |para|
+ if para =~ /<:code>/
+ @@flag['code']=1
+ @@counting=1
+ end
+ if para =~ /<:verse>/
+ @@flag['poem']=1
+ end
+ if @@flag['code']==1
+ if @@flag['code']==1 and para =~ /<:code[-_](?:end|close)>/ #watch change not tested 200501
+ @@flag['code']=0
+ end
+ if @@flag['code']==1 and para =~ /\S/
+ sub_array=para.dup
+ @@line_mode=sub_array.scan(/.+/)
+ Tune.code_lines(@@line_mode)
+ para=@@line_mode.join
+ end
+ elsif @@flag['poem']==1
+ if @@flag['poem']==1 and para =~ /<:verse[-_](?:end|close)>/ #watch change not tested 200501
+ @@flag['poem']=0
+ end
+ if @@flag['poem']==1 and para =~ /\S/
+ sub_array=para.dup
+ @@line_mode=sub_array.scan(/.+/)
+ Tune.code_lines(@@line_mode)
+ para=@@line_mode.join
+ end
+ end
+ @tex_file << para
+ end
+ end
+ def code_lines
+ data=@data
+ data.each do |line|
+ if line =~ /\S/ and line !~ /<:(code|verse).+/
+ if @@flag['code']==1
+ line.gsub!(/^\s*(.+)/m, "\\noindent \\marginpar\[left-text\]{\\begin{tiny}#{@@counting}\\end{tiny}}\\1\\")
+ @@counting+=1 if @@flag['code']==1
+ else line.gsub!(/(.+)/m,'\noindent\1\')
+ end
+ end
+ end
+ end
+ def tables
+ data=@data
+ @tex_file=[]
+ @@tableheader=0
+ data.each do |para|
+ if para =~ /¡|<!T/i
+ do_mono=TexInfoFormat::Texinfo.new(para,@md)
+ para=do_mono.longtable # using longtable latex package
+ end
+ @tex_file << para
+ end
+ end
+ def markup
+ data=@data
+ @tex_file=[]
+ md={}
+ @tex_file << TexInfoFormat::Texinfo.new('',@md).head
+ mono=TexInfoFormat::Texinfo.new(@md.title,@md)
+ @tex_file << mono.topnode
+ texinfo_menu=[]
+ n_menu,n_submenu=0,0
+ @submenu,@subsubmenu={},{}
+ data.each do |para|
+ if para =~ /^[1-3]\\+~\S*(.+?)\s*$/
+ toc=TexInfoFormat::Texinfo.new($1,@md)
+ texinfo_menu << toc.menu
+ end
+ if para =~ /^[4-6]\\+~\S+\s*(.+?)\s*$/
+ toc=TexInfoFormat::Texinfo.new($1,@md)
+ texinfo_menu << toc.menu
+ case para
+ when /^[4]\\+~\S+\s+(.+?)\s*$/
+ n_menu+=1
+ @submenu[n_menu]=[]
+ when /^[5]\\+~\S+\s+(.+?)\s*$/
+ n_submenu+=1
+ @subsubmenu[n_menu]=[]
+ @submenu[n_menu] << toc.menu
+ when /^[6]\\+~\S+\s+(.+?)\s*$/
+ @subsubmenu[n_submenu] << toc.menu
+ end
+ end
+ end
+ texinfo_menu.compact!
+ texinfo_menu << "* Dublin Core::"
+ @tex_file << texinfo_menu
+ @tex_file << "* Index::\n" +
+ "@end menu\n\n" +
+ "@c {{{ 5\n\n"
+ n_menu,n_submenu=0,0
+ @@do_submenu,@@do_subsubmenu=1,1
+ data.each do |para|
+ mono=TexInfoFormat::Texinfo.new(para,@md)
+ case para
+ when /^1\\+/; mono.level1
+ when /^2\\+/; mono.level2
+ when /^3\\+/; mono.level3
+ when /^4\\+~/
+ mono.level4
+ n_menu+=1
+ @@do_submenu,@@do_subsubmenu=1,1
+ when /^5\\+/
+ n_submenu+=1
+ @@do_subsubmenu=1
+ if @@do_submenu==1
+ menu=TexInfoFormat::Texinfo.new(@submenu[n_menu],@md)
+ para="#{menu.submenu}#{mono.level5}"
+ @@do_submenu=0
+ else mono.level5
+ end
+ when /^6\\+/
+ if @@do_submenu==1
+ menu=TexInfoFormat::Texinfo.new(@subsubmenu[n_menu],@md)
+ para="#{menu.subsubmenu}#{mono.level6}"
+ @@do_subsubmenu=0
+ else
+ mono.level6
+ end
+ # when /^<!i1!>/
+ # mono.indent1
+ # when /^<!i2!>/
+ # mono.indent2
+ # when /<!:\s+/
+ # mono.graphics
+ # when /^\s*<!image\s+/
+ # mono.image
+ # when /\}image/
+ # mono.png
+ # when /\}http/
+ # mono.http
+ else
+ if para !~/\S/
+ para=nil
+ else
+ para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'~[\1]')
+ #para.gsub!(/[1-3]\\\\\{\\\\\{\\\\\{\s+/, '')
+ #para.gsub!(/[1-3]\\\\\{\s+/, '')
+ para=para
+ end
+ #para.gsub!(/^\s+$/mi, "")
+ end
+#%case with endnotes
+ para.gsub!(/\s*[0-8]\\+(\S+)?\s+/,' ') if para
+ @tex_file << para if para
+ end
+ data=@tex_file
+ end
+ def numbering
+ data=@data
+ data=Texinfo_make.new(data,@md).number_titles
+ #TOGGLE to SWITCH PARAGRAPH NUMBERING (ON & OFF)
+ data=Texinfo_make.new(data,@md).number_paras \
+ if @md.fns !~ /\.e[pdr]00/ and @md.markup !~ /not_to/i
+ end
+ def number_titles
+ data=@data
+ @tex_file=[]
+ input=%{#{@md.markup}}[/(num_top\s*=\s*(\d?))?/m,2] # else default usually 4 # this was a bit of a trick required to pass nil to input if nothing matched... #puts input
+ #input=/(num_top\s*=\s*(\d?))?/m.match(@md[:markup]) [2] # else default usually 4 # this was a bit of a trick required to pass nil to input if nothing matched... #puts input
+ num_top=input.to_i
+ t_no1=0; t_no2=0; t_no3=0; t_no4=0;
+ no1=num_top; no2=(num_top + 1); no3=(num_top + 2); no4=(num_top + 3);
+ data.each do |para|
+ if @md.markup =~ /num_top/i and para !~ /0\\+/
+ if para =~ /^[1-6]\\+(?:~\S+)?\s*<!h-.+?-!>/ and para !~ /<:\d-endnotes>/
+ header=para[/<!h-(.+?)-!>/m, 1].gsub!(/-/m,'.')
+ para.gsub!(/^(?:[1-6]\\+(?:~\S+)|<:([12356]|4-.+?-)>)\s*<!h-.+?-!>/,
+ "\\1 #{header} ")
+ end
+ elsif para =~ /<!h!>|<!h\d!>|<!h.+?!>|<!!h.+?!>/
+ if para =~ /<!h-.+?-!>/
+ para.gsub!(/<!h-(.+?)-!>/,'\1 ')
+ end
+ end
+ @tex_file << para
+ end
+ data=@tex_file
+ end
+ def number_paras
+ data=@data
+ @tex_file=[]
+ paranumber=0
+ data.each do |para|
+ if para =~/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/ and para !~ /<EOF>/
+ parablock,paranum=/(.+?)<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/im.match(para)[1,2]
+ do_duo=TexInfoFormat::DuoTex.new(parablock,paranum) ###is BUG
+ para=do_duo.paraNum if parablock
+ end
+ @tex_file << para
+ end
+ data=@tex_file
+ end
+ def tail
+ data=@data
+ tex=TexInfoFormat::Texinfo.new('',@md)
+ data << tex.dublincore
+ data << tex.tail
+ end
+ def output
+ data=@data
+ data.compact!
+ data.each {|para| (@@filename_texinfo.puts para,"\n") if para}
+ @@filename_texinfo.close
+ end
+ def makeinfo
+ if @md.fns =~/\.[_-]?sst$/
+ m=/(.+?)\.[_-]?sst$/.match(@md.fns)
+ fnb,sfx=m[1],m[2]
+ pwd=Dir.pwd
+ case sfx
+ when /[_-]?sst$/
+ @env=SiSU_Env::Info_env.new(@md.fns,@md.cmd)
+ Dir.chdir(@env.path.texi)
+ texinfo=SiSU_Env::System_call.new("#{fnb}.texinfo")
+ texinfo.makeinfo
+ end
+ Dir.chdir(pwd)
+ end
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/texinfo_format.rb b/lib/sisu/0.52/texinfo_format.rb
new file mode 100644
index 00000000..dc070647
--- /dev/null
+++ b/lib/sisu/0.52/texinfo_format.rb
@@ -0,0 +1,507 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: texinfo formatting template
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module TexInfoFormat
+ @@table_pg_break_counter=1
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ class Texinfo
+ @@tex_backslash="\\\\"
+ @@tex_1='\\\\~' #?? debug
+ @@tabular="{tabular}"
+ @@tex_pattern_margin_number="\\\\marginpar.+?\s+"
+ @@dp=nil
+ def initialize(data=nil,md=nil,three=nil)
+ @para=@one=data
+ @md=md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def head
+ t=Time.now
+ year = t.year
+ filename=%{#{@md.fns}}[/(.+?)\.\w\w\d\d$/,1]
+ title=Texinfo.new(@md.title).spec_char
+ title=title.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{@@tex_backslash*2} ")
+ title.gsub!(/\$/,"\\$")
+ title.gsub!(/[,]\s*/,' - ')
+ if @md.subtitle
+ subtitle=Texinfo.new(@md.subtitle).spec_char
+ subtitle=subtitle.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{@@tex_backslash*2} ")
+ subtitle.gsub!(/\$/,"\\$")
+ subtitle.gsub!(/[,]\s*/,' - ')
+ subtitle="@subtitle @value{VERSION}, @value{UPDATED}\n" #bugwatch
+ end
+ subtitle ||=''
+ author=@md.dc_creator if @md.dc_creator
+ author ||=''
+ author.gsub!(/[\*]/,'') #if author
+ head =<<WOK
+\\input texinfo @c -*-texinfo-*-
+@comment $Id$
+@comment %**start of header
+@setfilename #{@md.fnb}.info
+@settitle #{title} @value{VERSION}
+@syncodeindex pg cp
+@comment %**end of header
+@c {{{ 2
+@copying
+SiSU in texinfo version of #{title}
+(version @value{VERSION}, @value{UPDATED})
+
+Copyright @copyright{} #{year} #{author}.
+
+@quotation
+Copyright #{author}, generated by ``SiSU''
+@end quotation
+@end copying
+
+@dircategory SiSU Texinfo
+@direntry
+* sisu: SiSU texinfo file.
+@end direntry
+WOK
+ if @md.subtitle
+ titlepage=<<WOK
+@c {{{ 3
+@titlepage
+@title #{title} #{subtitle}
+@author #{author}
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+@contents
+WOK
+ else
+ titlepage=<<WOK
+@c {{{ 3
+@titlepage
+@title #{title}
+@value{VERSION}, @value{UPDATED}
+@author #{author}
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@contents
+WOK
+ end
+ "#{head}#{titlepage}"
+ end
+ def topnode
+ @one=Texinfo.new(@one).spec_char
+ @one=@one.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{@@tex_backslash*2} ")
+ @one.gsub!(/\$/,"\\$")
+ @one.gsub!(/[,]\s*/,' - ')
+ "@c {{{ 4\n" +
+ "@ifnottex\n" +
+ "@node Top\n" +
+ "@top #@one\n\n" +
+ "@insertcopying\n" +
+ "@end ifnottex\n\n" +
+ "@menu\n"
+ end
+ def dublincore
+ title=Texinfo.new(@md.title).spec_char if @md.title
+ subtitle=Texinfo.new(@md.subtitle).spec_char if @md.subtitle
+ dc_title="#{title} - #{subtitle}"
+ dc_creator=Texinfo.new(@md.dc_creator).spec_char if @md.dc_creator
+ dc_subject=Texinfo.new(@md.dc_subject).spec_char if @md.dc_subject
+ dc_description=Texinfo.new(@md.dc_description).spec_char if @md.dc_description
+ dc_publisher=Texinfo.new(@md.dc_publisher).spec_char if @md.dc_publisher
+ dc_contributor=Texinfo.new(@md.dc_contributor).spec_char if @md.dc_contributor
+ dc_date=Texinfo.new(@md.dc_date).spec_char if @md.dc_date
+ dc_date_created=Texinfo.new(@md.dc_date_created).spec_char if @md.dc_date_created
+ dc_date_issued=Texinfo.new(@md.dc_date_issued).spec_char if @md.dc_date_issued
+ dc_date_available=Texinfo.new(@md.dc_date_available).spec_char if @md.dc_date_available
+ dc_date_valid=Texinfo.new(@md.dc_date_valid).spec_char if @md.dc_date_valid
+ dc_date_modified=Texinfo.new(@md.dc_date_modified).spec_char if @md.dc_date_modified
+ dc_type=Texinfo.new(@md.dc_type).spec_char if @md.dc_type
+ dc_format=Texinfo.new(@md.dc_format).spec_char if @md.dc_format
+ dc_identifier=Texinfo.new(@md.dc_identifier).spec_char if @md.dc_identifier
+ dc_source=Texinfo.new(@md.dc_source).spec_char if @md.dc_source
+ dc_language=Texinfo.new(@md.dc_language[:name]).spec_char if @md.dc_language[:name]
+ #language_original=Texinfo.new(@md.language_original[:name]).spec_char if @md.language_original[:name]
+ dc_relation=Texinfo.new(@md.dc_relation).spec_char if @md.dc_relation
+ dc_coverage=Texinfo.new(@md.dc_coverage).spec_char if @md.dc_coverage
+ dc_rights=Texinfo.new(@md.dc_rights).spec_char if @md.dc_rights
+ dc_title="Title: #{dc_title}\n\n" if dc_title
+ dc_creator="Creator: #{dc_creator}\n\n" if dc_creator
+ dc_subject="Subject: #{dc_subject}\n\n" if dc_subject
+ dc_description="Description: #{dc_description}\n\n" if dc_description
+ dc_publisher="Publisher: #{dc_publisher}\n\n" if dc_publisher
+ dc_contributor="Contributor: #{dc_contributor}\n\n" if dc_contributor
+ dc_date="Date: #{dc_date}\n\n" if dc_date
+ dc_date_created="Date Created: #{dc_date_created}\n\n" if dc_date_created
+ dc_date_issued="Date Issued: #{dc_date_issued}\n\n" if dc_date_issued
+ dc_date_available="Date Available: #{dc_date_available}\n\n" if dc_date_available
+ dc_date_valid="Date Valid: #{dc_date_valid}\n\n" if dc_date_valid
+ dc_date_modified="Date Modified: #{dc_date_modified}\n\n" if dc_date_modified
+ dc_format="Format: #{dc_format}\n\n" if dc_format
+ dc_identifier="Identifier: #{dc_identifier}\n\n" if dc_identifier #watch
+ dc_source="Source: #{dc_source}\n\n" if dc_source
+ dc_language="Language: #{dc_language}\n\n" if dc_language
+ dc_relation="Relation: #{dc_relation}\n\n" if dc_relation
+ dc_coverage="Coverage: #{dc_coverage}\n\n" if dc_coverage
+ dc_rights="Rights: #{dc_rights}\n\n" if dc_rights
+ "@node Dublin Core\n" +
+ "@chapter Dublin Core\n" +
+ "@cindex chapter, Dublin Core\n\n" +
+ "#{dc_title}" +
+ "#{dc_creator}" +
+ "#{dc_subject}" +
+ "#{dc_description}" +
+ "#{dc_publisher}" +
+ "#{dc_contributor}" +
+ "#{dc_date}" +
+ "#{dc_date_created}" +
+ "#{dc_date_issued}" +
+ "#{dc_date_available}" +
+ "#{dc_date_valid}" +
+ "#{dc_date_modified}" +
+ "#{dc_format}" +
+ "#{dc_identifier}" +
+ "#{dc_source}" +
+ "#{dc_language}" +
+ "#{dc_relation}" +
+ "#{dc_coverage}" +
+ "#{dc_rights}" +
+ "\n\n"
+ end
+ def tail
+ "@c {{{ 6\n" +
+ "@node Index\n" +
+ "@unnumbered Index\n" +
+ "@printindex cp\n\n" +
+ "@bye"
+ end
+ def menu
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,:]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ "* #@para::"
+ end
+ def level1
+ @para.gsub!(/[1]\\+~/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,:]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ @para.gsub!(/.+/,"#{para}")
+ end
+ def level2
+ @para.gsub!(/[2]\\+~/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,:]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ @para.gsub!(/.+/,"#{para}")
+ end
+ def level3
+ @para.gsub!(/[3]\\+\~/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,:]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ @para.gsub!(/.+/,"#{para}")
+ end
+ def level4
+ @para.gsub!(/[4]\\+~\S+/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,:]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ @para.gsub!(/.+/,"#{para}")
+ end
+ def level5
+ @para.gsub!(/[5]\\+~\S+/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,:]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ @para.gsub!(/.+/,"#{para}")
+ end
+ def level6
+ @para.gsub!(/[6]\\+~\S+/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,:]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ @para.gsub!(/.+/,"#{para}")
+ end
+ def submenu
+ @para=@para.join("\n")
+ @para.gsub!(/[5]\\+~\S+/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@menu\n#@para\n@end menu\n\n"
+ @para.gsub!(/.+/m,"#{para}")
+ end
+ def subsubmenu
+ @para=@para.join("\n")
+ @para.gsub!(/[6]\\+~\S+/,'')
+ @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
+ @para.gsub!(/\s*[,]\s*/,' - ')
+ @para.gsub!(/<:#>/,'')
+ @para.strip!
+ para="@menu\n#@para\n@menu\n\n"
+ @para.gsub!(/.+/m,"#{para}")
+ end
+ def indent1
+ @para.gsub!(/<:i1>(.*)/,'\1')
+ end
+ def indent2
+ @para.gsub!(/<:i2>(.*)/,'\1')
+ end
+ def spec_char # special characters
+ @para.gsub!(/<EOF>/i,'')
+ @para.gsub!(/@/i,'@@')
+ @para.gsub!(/&(lt|#060);/,'\<&nbsp;')
+ @para.gsub!(/&(gt|#062);/,'&nbsp;\>')
+ @para.gsub!(/&#123;/,'\{&nbsp;')
+ @para.gsub!(/&#125;/,'\}&nbsp;')
+ @para.gsub!(/&#(126|152);/i,'~&nbsp;')
+ @para.gsub!(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ')
+ @para.gsub!(/\\/,'\\backslash ')
+ @para.gsub!(/<:pb>/,'\\newpage')
+ @para.gsub!(/\\backslash copyright/,'\\copyright ')
+ @para.gsub!(/\^/,'\\wedge ')
+ @para.gsub!(/(\$)/,"\\$")
+ @para.gsub!(/\~/,'\\~')
+ @para.gsub!(/%/,"\\%")
+ if @para !~ /^\s*<:image|\}:image\s/
+ @para.gsub!(/_/,'\_')
+ end
+ @para.gsub!(/\{/,"\\{")
+ @para.gsub!(/\}/,"\\}")
+ @para.gsub!(/&nbsp;&nbsp;/,' ') # ~ character for hardspace
+ @para.gsub!(/&nbsp;/,' ') # ~ character for hardspace
+ @para.gsub!(/&(\S+?);/,'')
+ @para.gsub!(/(\s+&\s+)/,' and ')
+ @para.gsub!(/(\&)/,"\\&")
+ @para.gsub!(/§/i,'\S')
+ @para.gsub!(/£/i,'\pounds')
+ @para.gsub!(/å/i,'\aa')
+ @para.gsub!(/æ/i,'\ae')
+ @para.gsub!(/ø/i,'\o')
+ @para.gsub!(/Å/i,'\AA')
+ @para.gsub!(/Æ/i,'\AE')
+ @para.gsub!(/Ø/i,'\O')
+ @para.gsub!(/&(.+?);/i,' ')
+ @para.gsub!(/<a href=".+?">/i,' ')
+ @para.gsub!(/<\/a>/i,' ')
+ @para.gsub!(/<:ee>/i,'')
+ @para.gsub!(/<!>/i,' ')
+ @para.gsub!(/<b>(.+?)<\/b>/,'\*\1\*')
+ @para.gsub!(/<i>(.+?)<\/i>/,'\/\1\/')
+ @para.gsub!(/<u>(.+?)<\/u>/,'\_\1\_')
+ @para.gsub!(/"(.+?)"/,"`\\1'") # open & close "
+ @para.gsub!(/\s+"/," `") # open "
+ @para.gsub!(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*"/,'\1`') # open "
+ @para.gsub!(/"(\s|\.|,|:|;)/,"'\\1") # close "
+ @para.gsub!(/"([1-6-]\\+(?:~\S+)?|<.+?>)?\s*$/,"'\\1") # close "
+ @para.gsub!(/"(\.|,)/,"'") # close "
+ @para.gsub!(/\s+'/," `") # open '
+ @para.gsub!(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*'/,'\1`') # open '
+ #if @para=~/#{@@tex_1}/
+ #end
+ #@para.gsub!(/^([1-6-](?:#{@@tex_2}|#{@@tex_1})(?:\\~\S+)?|<.+?>)?\s*"/i,"\\1`") # open "
+ #@para.gsub!(/"([1-6-](?:#{@@tex_2}|#{@@tex_1})(?:\\~\S+)?|<.+?>)?\s*$/i,"'\\1") # close "
+ #@para.gsub!(/^([1-6-](?:#{@@tex_2}|#{@@tex_1})(?:\\~\S+)?|<.+?>)?\s*'/i,"\\1`") # open '
+ @para.gsub!(/(<font.*?>|<\/font>)/,'')
+ @para.gsub!(/\s*<sup>(\S+?)<\/sup>/,'^\1')
+ @para.gsub!(/(<sup>|<\/sup>)/,'')
+ @para
+ end
+ def longtable
+ @end_table="\\end{longtable}"
+ @row_break='\\\\\\'
+ if @para[/<!Th?¡\s+c(\d+);(.+?)!>/i]
+ no_of_cols,cols_width=$1,$2
+ @@tableheader=1 if @para =~ /<!Th/i
+ @w=cols_width.split(/;\s+/)
+ @@number_of_cols=no_of_cols
+ @colW=[]
+ @colW << '{'
+ @w.each do |x|
+ col_w=x.gsub(/.+/,'l\|') #unless x.nil?
+ @colW << "#{col_w}" if col_w
+ end
+ @colW << '}'
+ @colW=@colW.join
+ @@start_table="\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" +
+ "\\begin{longtable}[hb]#@colW\n"
+ @para.gsub!(/<!Th?¡\s+c\d+?;.+!>/,"#{@@start_table}")
+ end
+ if @para =~/<!TZ!>/
+ @para.gsub!(/<!TZ!>/," #@end_table")
+ end
+ @para.gsub!(/<!¡/,'')
+ if @@tableheader==1
+ if @para =~/¡\d+?¡(.+?)(?:¡|!)/
+ tablefoot=para[/\<!f(.+?)!\>/,1]
+ @para.gsub!(/\<!f(.+?)!\>/,'')
+ @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,
+ "{\\begin{tiny} {\\bfseries \\1}\\end{tiny}}&")
+ @para.gsub!(/&>\s*$/,
+ " #@row_break \\hline\\endhead #@row_break")
+ @para="#@para \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot
+ @@tableheader=0
+ @@number_of_cols=0
+ end
+ else
+ if @para =~/¡\d+?¡(.+?)(?:¡|!)/
+ @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,"\\begin{tiny}\\1\\end{tiny}&")
+ @para.gsub!(/&>\s*$/," #@row_break")
+ end
+ end
+ @para
+ end
+ def scopedtable
+ # some features related to headers have been incorporated in longtable
+ # that are not included yet here, so until synced is broken on some
+ # input files, work needs to be done if is to work as before
+ @end_table="\\end{tabular}"
+ @row_break='\\\\\\\\'
+ @break_page="#@row_break\n#@row_break \n"
+ if @para[/<!Th?¡\s+c(\d+);(.+?)!>/i]
+ no_of_cols,cols_width=$1,$2
+ @w=cols_width.split(/;\s+/)
+ @colW=[]
+ @w.each do |x|
+ col_w=((x.to_i*12)/100.00).to_s #unless x.nil?
+ @colW << "p{#{col_w}cm}" if col_w
+ end
+ @@start_table="\\begin{tabular}{#@colW}\n"
+ @para.gsub!(/<!Th?¡\s+c\d+?;.+!>/,"#{@@start_table}")
+ end
+ if @para =~/<!TZ!>/
+ @para.gsub!(/<!TZ!>/,"#@end_table")
+ @@table_pg_break_counter=1
+ end
+ if @para =~/<!¡/
+ if @@table_pg_break_counter==28 # taken from 34 ideal for portrait to 28 which suits landscape
+ @para =
+ "\n\n#@end_table \n" +
+ "#@break_page" +
+ "#{@@start_table}\n"
+ @@table_pg_break_counter=1
+ else
+ @para.gsub!(/<!¡/,'')
+ @@table_pg_break_counter+=1
+ tablefoot=@para[/\<!f(.+?)!\>/]
+ @para.gsub!(/\<!f(.+?)!\>/,'')
+ end
+ end
+ if @para =~/¡\d+?¡(.+?)(?:¡|!)/
+ @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,"\\begin{tiny}\\1\\end{tiny}&")
+ @para.gsub!(/&>\s*$/,"#@row_break")
+ end
+ @para
+ end
+ def graphics
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @para.gsub!(/<::\s+(\S+?)\s+>/i, #watch
+ "\\includegraphics*[width=11pt]{#{dir.path.image_source_tex}/c_\\1.png}")
+ end
+ def image
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ width="100"
+ width=@para[/<:image.+?width=``(\d+)''.+?>/im,1]
+ width=width.to_i*0.4
+ @para.gsub!(/<:image\s+((?:https?|ftp)\S+)\s+(\S+)\s+.+\s+?>/i,
+ "\\href{\\1}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_tex}/\\2}}")
+ @para.gsub!(/<:image\s+(\S+)\s+.+\s+?>/i,
+ "\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_tex}/\\1}")
+ end
+ def png
+ # very messy clean up ! - work area, testing
+ z=@para[/\\\{(.+?)\}(?:image|png)/,1] # match operator for z \\ fragile !
+ image,w,x,y=z.scan(/\S+/)
+ image.gsub!(/\\/,'')
+ @para.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,"<image #{image} not available>") # fragile match operator\\ fragile !
+ end
+ def http
+ # very messy clean up ! - work area, testing
+ z=@para[/\\\{(.+?)\}(?:https?|ftp):\/\//,1] # match operator for z \\ fragile !
+ url=@para[/((?:https?|ftp):\S+)/im,1]
+ if @para =~/\.(png|jpg|gif)/
+ image,w,x,y=z.scan(/\S+/)
+ image.gsub!(/\\/,'')
+ width=200
+ width=z[/w=(\d+)/im,1] if z =~/w=(\d+)/
+ width=width.to_i*0.8
+ width=400 if width > 400
+ c=z[/``(.+?)''/im,1]
+ caption="{\\\\\\\ \n\\begin{scriptsize}#{c}\\end{scriptsize}&}" if c
+ end
+ if image
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @para.gsub!(/\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/, # fragile match operator\\ fragile !
+ "\n\\href{#{url}}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_tex}/#{image}}}#{caption}")
+ else
+ link=z[/(.+?)\\/im,1]
+ @para.gsub!(/\{.+?\}(?:https?|ftp):\/\/\S+/,"\n\\noindent\\href{#{url}}{#{link}}") # fragile match operator\\ fragile !
+ end
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/texpdf.rb b/lib/sisu/0.52/texpdf.rb
new file mode 100644
index 00000000..27c4f3bf
--- /dev/null
+++ b/lib/sisu/0.52/texpdf.rb
@@ -0,0 +1,611 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: LaTeX generation
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_TeX
+ require 'pstore'
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/texpdf_format'
+ include SiSU_TeX_Pdf
+ @tex_file=@@tex_footnote_array=@@tex_col_w=[]
+ @@tex_backslash ||="\\\\"
+ @@tilde='\\\\\\~' #?? debug crazy
+ @@tabular="{tabular}"
+ @@column_instruct=@@squigle_close=@@tex_line_mode=@@tex_word_mode=@@line_mode=''
+ @@tex_debug_counter=@@table_pagebreak_counter=@@tex_footnote_call_counter=@@tex_table_flag=@@tex_counter=@@tex_column=@@tex_columns=@@tex_columns=@@counting=0
+ @@tex_pattern_margin_number="\\\\begin\\\{tiny\\\}~\\\\end\\\{tiny\\\}\\\{\\\\marginpar.+?\s+"
+ #@@tex_pattern_margin_number="\\\\marginpar.+?\s+"
+ @@n=@@tableheader=@@rights=nil
+ @@date ||=SiSU_Env::Info_date.new
+ class Source #Songsheet #<SiSU_Param::MyFiles
+ require 'pstore'
+ require SiSU_lib + '/sysenv'
+ require SiSU_lib + '/param'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/dal'
+ include SiSU_DAL
+ include SiSU_TeX
+ def initialize(opt)
+ @opt=opt
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ end
+ def directories
+ begin
+ @dir_out_root=@env.path.output
+ case @opt.fns
+ when /\.[_-]?sst$/
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ Dir.mkdir(@env.path.tex) unless FileTest.directory?(@env.path.tex)
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ def read
+ songsheet
+ end
+ def songsheet
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'LaTeX/PDF')
+ tell.green_title_hi unless @opt.cmd =~/q/
+ path=@env.url.output_tell
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{path}/#{@md.fnb}/#{@md.fn[:pdf_l]}")
+ tell.flow if @opt.cmd =~/[MVv]/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{path}/#{@md.fnb}/#{@md.fn[:pdf_p]}")
+ tell.flow if @opt.cmd =~/[MVv]/
+ data=IO.readlines(@opt.fns,'') #wasteful, revisit
+ @md=SiSU_Param::Parameters.new(@opt).get
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ if @md.flag_pdf
+ $flag=@md.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format
+ @dir_o="#{@env.path.output}/#{@opt.fnb}"
+ directories
+ filename_index="#{@md.txt_path}/pdf"
+ newfilename=filename_index
+ #% needed needs to be reprogrammed !!!
+ SiSU_Env::Info_skin.new(@md).select
+ dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_TeX::Source::LaTeX_create.new(dal_array,@md,'landscape').songsheet
+ SiSU_TeX::Source::LaTeX_create.new(dal_array,@md,'portrait').songsheet
+ dal_array=''
+ pwd=Dir.pwd
+ SiSU_TeX::Source::LaTeX_to_pdf.new(@md).latexrun_selective
+ Dir.chdir(pwd)
+ else
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'instructed NOT to produce LaTeX/PDF')
+ tell.warn unless @opt.cmd =~/q/
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ unless @opt.cmd =~/[MV]/ #check maintenance flag
+ texfiles = Dir["#{@env.path.tex}/#{@opt.fns}*"]
+ texfiles.each do |f|
+ if FileTest.file?(f)
+ File.unlink(f)
+ end
+ end
+ end
+ @tex_file=@@tex_footnote_array=[]
+ @@column_instruct=''
+ @@squigle_close=@@tex_line_mode=@@tex_word_mode=@@line_mode=''
+ @@tex_debug_counter=@@table_pagebreak_counter=@@tex_footnote_call_counter=@@tex_table_flag=@@tex_counter=@@tex_column=@@tex_columns=@@tex_columns=@@counting=0
+ @@tex_col_w=[]
+ @@n=@@tableheader=@@rights=nil
+ @@date=SiSU_Env::Info_date.new
+ @@flag={}
+ $flag=1 #remove at some stage
+ SiSU_Env::Create_file.new(@opt.cmd,@opt.fns).param_instantiate
+ end
+ end
+ private
+ class LaTeX_to_pdf #<Songsheet
+ require 'fileutils'
+ include FileUtils #::Verbose
+ @@n_lpdf||=0 #change
+ def initialize(md)
+ @md=md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ end
+ def latex_do(texfilename)
+ @texfilename=texfilename
+ @@n_lpdf=@@n_lpdf+1
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'portrait ->')
+ tell.dark_grey_title_hi if @md.cmd =~/[MVv]/
+ tex_fn_base=@texfilename.gsub(/\.tex$/,'')
+ cmd=SiSU_Env::System_call.new("#{tex_fn_base}.tex",'',@md.cmd)
+ tell=SiSU_Screen::Ansi.new(@md.cmd)
+ tell.grey_open unless @md.cmd =~/q/
+ 2.times { |i| cmd.latex2pdf unless ("#{tex_fn_base}.tex" !~/\w+/) }
+ tell.p_off unless @md.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'landscape ->')
+ tell.dark_grey_title_hi if @md.cmd =~/[MVv]/
+ cmd=SiSU_Env::System_call.new("#{tex_fn_base}.landscape.tex",'',@md.cmd)
+ tell.grey_open
+ 2.times { |i| cmd.latex2pdf unless ("#{tex_fn_base}.landscape.tex" !~/\w+/) }
+ tell.p_off unless @md.cmd =~/q/
+ pwd=Dir.pwd
+ portrait_pdf="#{pwd}/#{tex_fn_base}.pdf"
+ landscape_pdf="#{pwd}/#{tex_fn_base}.landscape.pdf"
+ if FileTest.file?(portrait_pdf)
+ File.install(portrait_pdf,"#@dir_sisu/#{@md.fnb}/#{@md.fn[:pdf_p]}")
+ File.unlink(portrait_pdf)
+ end
+ if FileTest.file?(landscape_pdf)
+ File.install(landscape_pdf,"#@dir_sisu/#{@md.fnb}/#{@md.fn[:pdf_l]}")
+ File.unlink(landscape_pdf)
+ end
+ tell=SiSU_Screen::Ansi.new(@md.cmd,@@n_lpdf,'processed (SiSU LaTeX to pdf - using pdfetex aka. pdftex or pdflatex)')
+ tell.generic_number unless @md.cmd =~/q/
+ end
+ def latexrun_selective
+ begin
+ ep_dir=Dir.pwd
+ Dir.chdir(ep_dir)
+ @tex_f_no=0
+ info={}
+ if FileTest.file?("#{ep_dir}/#{@md.fns}")
+ if @md.fns =~/\.[_-]?sst$/
+ @dirout=SiSU_Env::Info_env.new(@md.fns)
+ case @md.fns
+ when /\.[_-]?sst$/
+ if FileTest.directory?(@env.path.tex)==true
+ Dir.chdir(@env.path.tex)
+ @dir_sisu=@dirout.path.output
+ texfile=@md.fns.gsub(/$/,'.tex')
+ texfile=texfile.gsub(/~/,'-')
+ if File.exists?(texfile) and File.size(texfile) > 0
+ @tex_f_no+=1
+ latex_do(texfile)
+ else
+ puts "\tzero file size #{@env.path.tex}/#{@md.fns}"
+ end
+ end
+ end
+ end
+ else
+ puts "\n#{@cX.fuschia}FILE NOT FOUND:#{@cX.off} << #{file} >> - requested latex system processing skipped\n"
+ end
+ lst=Dir["*.{aux,log,out}"]
+ lst.each {|file| File.unlink(file)} if lst
+ #touch("#{@dir_pdf}index.html") #correct @dir_pdf appears to contain slash / and should not
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.fns,@md.cmd).error
+ end
+ end
+ end
+ class LaTeX_create
+ include SiSU_Param
+ @@tex_backslash ||="\\\\"
+ @@tilde='\\\\\\~' #?? debug crazy
+ @@tex_head_portrait,@@tex_head_landscape=[],[]
+ @@flag_group,@@flag_code=false,false
+ @@dp,@@prefix_b=nil,nil
+ def initialize(data,md,orientation)
+ @data,@md,@orientation=data,md,orientation
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @st={ :tex=>{} }
+ @tex=SiSU_TeX_Pdf::Use_TeX.new(@md,@orientation)
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def songsheet
+ begin
+ @@tex_footnote_array=[] #check
+ data=@data
+ @@rights=nil
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"pdfTex #@orientation")
+ tell.txt_grey unless @md.cmd =~/q/
+ if @md.dc_rights
+ use=@md.dc_rights.dup #dup is necessary, else contents of :rights changed
+ do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,use)
+ copymark=if @md.creator_copymark; '{\\begin{small}\\raisebox{1ex}{\\copyright}\\end{small}} '
+ else ''
+ end
+ copyright=do_mono.special_characters_safe.gsub(/^\s*Copyright/, copymark)
+ @@rights||="\n #{@@tex_backslash*2}[3]\\ \\linebreak #{copyright}"
+ end
+ if @md.prefix_b
+ do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,@md.prefix_b)
+ prefix_b=do_mono.special_characters_safe
+ @@prefix_b="\n #{@@tex_backslash*2}[3]\\ \\linebreak \\ #{prefix_b}\n" unless @@prefix_b
+ end
+ if @md.markup.to_s !~/url_png/
+ @data=pre
+ @data=footnote
+ if @md.flag_tables
+ @data=tables
+ end
+ @data=numbering
+ @data=markup
+ output
+ end
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.fns,@md.cmd).error
+ ensure
+ end
+ end
+ protected
+ def pre
+ @tex_file=[]
+ data=@data
+ data.each do |para|
+ # DEBUG 2003w16 this is a kludge, because i could not get parameters
+ # from param, Sort out ... revert to more elegant solution
+ # even more of a kludge as had to insert newlines where code is used not satisfactory, think about
+ pg=if para =~/<:br>/; para.split(/<:br>/)
+ else para
+ end
+ pg.each do |pg|
+ if pg =~/<!Th?¡\s+c/; @md.flag_tables=true # KLUDGE get from param
+ end
+ do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,pg)
+ @tex_file << do_mono.special_characters
+ end
+ end
+ data=@tex_file.delete_if {|x| x =~/^\s*0#{@@tilde}/}
+ @tex_file
+ end
+ def footnote
+ data=@data.dup
+ @tex_file=[]
+ data.each do |para|
+ para2=para.dup
+ # EMBEDDED FOOTNOTES / ENDNOTES should be straightforward but not quite a synch.
+ footnote=[]
+ if para =~/~\\\{[\d*+]+\s|\\\~\[([*+]\d+)\s/ # note escape not necessary in front of ~ has implications for many other matches #debug note
+ para.gsub!(/\\~\\\{(\d+)\s+(.+?)<#@dp>\\\}\\~/m,"\\footnote[\\1]{%\n \\2} ") #removed space before \\footnote 2004w21, watch
+ para.gsub!(/\\~\[([*+]\d+)\s+(.+?)<#@dp>\]\\~/m,"\\FootnoteA{\\1}{%\n \\2} ") #work on asterisk footnotes
+ para.gsub!(/\\~\\\{([*+]+)\s+(.+?)<#@dp>\\\}\\~/m,"\\FootnoteA{\\1}{%\n \\2} ") #work on asterisk footnotes
+ end
+ @tex_file << para
+ end
+ @tex_file
+ end
+ def tables
+ data=@data
+ @tex_file=[]
+ @@tableheader=0
+ data.each do |para|
+ if para =~/¡|<!T/
+ do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para)
+ para=do_mono.longtable_landscape if @orientation =~/landscape/ # using longtable latex package
+ para=do_mono.longtable_portrait if @orientation =~/portrait/ # using longtable latex package
+ end
+ @tex_file << para
+ end
+ end
+ def enclose(para,type='')
+ para.strip!
+ if type =~/code/; para
+ #para = '\begin{footnotesize} \begin{ttfamily} ' + para + ' \end{ttfamily} \end{footnotesize}'
+ elsif para !~/(\\begin\{tabular\}.*|\\end\{tabular\}|&|#{@@tex_backslash*2})\s*$/ #check
+ para.gsub!(/(.+)/m,"\n#{@tex.skip_small} \\1 #{@tex.skip_small}\n")
+ else para
+ end
+ end
+ def markup
+ data=@data
+ @tex_file=[]
+ md={}
+ #% document headers watch special characters in title & subtitle: glark "\{\{~(sub)?title.+?[$&%#_\{\}]" *.(lm|er)??
+ home=@vz.txt_home.gsub(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>|\\\\/,' - ') #no line splitting in heading neither html nor latex
+ title=@md.title.gsub(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>|\\\\/,' - ') #no line splitting in heading neither html nor latex
+ subtitle=@md.subtitle.gsub(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>|\\\\/,' - ') if @md.subtitle #no line splitting in heading neither html nor latex
+ orient=SiSU_TeX_Pdf::Format_text_object.new(@md,@orientation,"#{home}: - #{title} #{subtitle}") #.new
+ if @orientation =~/portrait/
+ @@tex_head_portrait << orient.document_head_with_orientation
+ elsif @orientation =~/landscape/
+ @@tex_head_landscape << orient.document_head_with_orientation
+ end
+ @tex_file <<<<WOK
+#{@tex.header}#{@tex.footer}
+\\makeatother
+\\makeatother
+\\begin{document}
+WOK
+ sisu_rc_footnote=if @md.sc_info; @tex.doc_sc_info_footnote_full
+ else @tex.doc_sc_info_footnote_brief
+ end
+ @copymark=if @md.creator_copymark; '^\copyright'
+ else ''
+ end
+ if @orientation =~/landscape/ # using longtable latex package
+ @tex_file << SiSU_TeX_Pdf::Format_text_object.new(@md,@md.title,@md.subtitle).title_landscape
+ if @md.dc_creator
+ do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,@md.dc_creator)
+ creator=do_mono.special_characters
+ @tex_file << if @md.creator_home
+ <<WOK
+
+\\author{\\href{#{@md.creator_home}}{#@copymark \\textnormal{#{creator}}}}
+WOK
+ else "\n\\author{#@copymark \\textnormal{#{creator}}}"
+ end
+ end
+ @tex_file << unless @md.fnb =~/^mail\s*$/
+ "\n\\date{copy @ #{@tex.site} #{sisu_rc_footnote}}"
+ else "\\date"
+ end
+ else #portrait
+ @tex_file << SiSU_TeX_Pdf::Format_text_object.new(@md,@md.title,@md.subtitle).title_portrait
+ if @md.dc_creator
+ creator=@md.dc_creator
+ @tex_file << if @md.creator_home
+ <<WOK
+
+\\author{\\href{#{@md.creator_home}}{#@copymark \\textnormal{#{creator}}}}
+WOK
+ else "\n\\author{#@copymark \\textnormal{#{creator}}}"
+ end
+ end
+ @tex_file << unless @md.fnb =~/^mail\s*$/; "\n\\date{copy @ #{@tex.site} #{sisu_rc_footnote}}"
+ else "\\date"
+ end
+ end
+ @tex_file <<<<WOK
+\\pagenumbering{roman}\\maketitle
+\\pagestyle{fancy}
+WOK
+ #@tex_file << @tex.newpage #newpage clearpage depending on portrait or landscape
+ @tex_file << "\\newpage\n"
+ @tex_file << @@rights if @md.dc_rights #if @orientation =~/landscape/
+ @tex_file << @@prefix_b if @md.prefix_b
+ @tex_file << @tex.sisu_rights
+ @tex_file << if @md.sc_info; @tex.doc_sc_info
+ else @tex.doc_no_sc_info
+ end
+ @tex_file << @tex.manifest_info
+ @tex_file << @tex.newpage
+ @tex_file <<<<WOK
+\\pagestyle{fancy}
+\\tableofcontents
+#{@tex.newpage}
+\\pagenumbering{arabic}
+#{@tex.paraskip_normal}
+WOK
+ @tex_file << @tex.newpage
+ @group_collect=[]
+ data.each do |para| #% case follows with levels 1-6 indents & graphics
+ mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para)
+ if para =~/<:(code|alt|verse|group)>/ or @@flag_group==true
+ if para =~/<:(code|alt|verse|group)>/
+ @lineone=case para
+ when /<:(alt|verse|group)>/; para
+ when /<:code>/; "#{@tex.paraskip_small} \\begin{footnotesize} \\begin{ttfamily} " + para
+ else 'error' #should never occur
+ end
+ end
+ if para =~/<=curly/ #takes care of escaped curly braces, expand
+ do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para)
+ para=do_mono.special_characters_curly(para)
+ end
+ regx=/<:((?:code|alt|verse|group)(?:-end)?)>/
+ x=regx.match(para)[1] if para =~regx
+ x=$1
+ para.gsub!(/\n<:(?:code|alt|verse|group)>\n/m,'')
+ para=enclose(para,'code') unless para =~/^$/
+ if x =~/(?:alt|verse|group)/; @@flag_group=true
+ elsif x =~/code/; @@flag_group,@@flag_code=true,true
+ elsif @@flag_group==true; @group_collect << para #<< "\n\n"
+ end
+ if x =~/(?:code|alt|verse|group)-end/
+ regx=/(\\+marginpar\{\\+begin\{tiny\}\d+\\+end\{tiny\}\})/
+ y=if para =~regx
+ regx.match(para)[1]
+ else ''
+ end
+ para.gsub!(regx,'')
+ @group_collect.each{ |x| x.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ') }
+ @lineone.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ')
+ #@group_collect.each{ |x| x.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ') }
+ #@lineone.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ')
+ insert=[]
+ if para =~/<:code-end>/
+ insert << y + @lineone << @group_collect << ' \end{ttfamily} \end{footnotesize}' << " #{@tex.paraskip_normal}"
+ else insert << y + @lineone << @group_collect
+ end
+ @@flag_group,@@flag_code=false,false
+ @group_collect=[]
+ para.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ')
+ #para.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ')
+ @tex_file << insert.flatten
+ end
+ else
+ if para =~ /\}(?:https?|ftp)/
+ para=mono.http(@orientation)
+ end
+ case para
+ when /^1#{@@tilde}/; mono.level1
+ when /^2#{@@tilde}/; mono.level2
+ when /^3#{@@tilde}/; mono.level3
+ when /^4#{@@tilde}/; mono.level4
+ when /^5#{@@tilde}/; mono.level5
+ when /^6#{@@tilde}/; mono.level6
+ when /^<:i1>/; mono.indent1
+ when /^<:i2>/; mono.indent2
+ when /<:=/; mono.symbol_graphic #watch
+ when /^\s*<:image\s+/; mono.image
+ when /\}image/; mono.png
+ else
+ para.strip!
+ para=enclose(para) unless para =~/^$/
+ end
+ para.gsub!(/(\.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ') #% tread with care
+ #para.gsub!(/(.#{@@tilde}(?:\\~\S+)?\s*|<:\S+>|<!.*?!>|<!>)/,' ') #KEEP reference, problem escaping open curly braces \{
+ if para =~/<=curly/ #takes care of escaped curly braces, expand
+ do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para)
+ para=do_mono.special_characters_curly(para)
+ end
+ @tex_file << para
+ end
+ end
+ @tex_file << "\n\\newpage\n" # was \\pagebreak\n
+ @md.subtitle_tex=@md.subtitle.dup if @md.subtitle
+ # kludge ... look again later
+ @tex_file << if @md.doc_skin !~/skin_mail/; @tex.doc_tail
+ else @tex.mail_tail
+ end
+ if defined? @md.lnk and @md.lnk
+ @md.lnk.each do |l|
+ if l[:say]
+ url=%<#{l[:url]}>
+ url.gsub!(/(?:\\)*([$&~%_#}{^])/,"\\\\\\1") #latex special chars
+ s_lnk=l[:say]
+ s_lnk.gsub!(/(<br>|<br \/>|<p>|<p \/>)/,'')
+ s_lnk.gsub!(/(?:\\)*([$&~%_#}{^])/,"\\\\\\1") #latex special chars
+ if url !~/^\.(\.)?\//
+ s_lnk_url=%<\\begin{scriptsize}\\href{#{url}}{#{url}}\\end{scriptsize}> # note this bit of dereferencing magic
+ else
+ url.gsub!(/\.\.\//,'')
+ s_lnk_url="(#{@tex.site}) \\\\\n" + ' ' +
+ "\\begin{scriptsize}" +
+ %<\\href\{#{@vz.url_root_http}/#{url}\}\{#{@vz.url_root_http}/#{url}\}> + # note this bit of dereferencing magic
+ "\\end{scriptsize}"
+ end
+ @tex_file << " #{s_lnk} \\\\\n #{s_lnk_url} \n" unless @md.doc_skin =~/skin_mail/
+ s_lnk=s_lnk_url=nil
+ end
+ end
+ end
+ @tex_file << " #{@tex.sitename} home: \\\\
+\\begin{bfseries}#{@tex.site}\\end{bfseries}
+"
+ #Stamp.stamp #removed 200408 but watch
+ #% code for inclusion of addresses of promulgating authority
+ @st[:tex][:stmp]||=@md.stmpd
+ stamp=@st[:tex][:stmp] if @st[:tex][:stmp]
+ if stamp
+ use=stamp.gsub(/\n/,"#{@@tex_backslash*2}\n")
+ @tex_file << "\n\\newpage\n"
+ @tex_file << "\\section*" +
+ "{#{@tex.owner_chapter}}\n" +
+ "\\addcontentsline{toc}" +
+ "{section}{#{@tex.owner_chapter}}\n"
+ @tex_file << "#{use}\n"
+ @tex_file << @@rights if @@rights
+ end
+ @tex_file << "\n\\end{document}"
+ end
+ def footnote_call_number
+ data=@data
+ data.each do |word|
+ if word =~/<:e>/
+ @@tex_footnote_array[@@tex_footnote_call_counter].strip! if @@tex_footnote_array[@@tex_footnote_call_counter]
+ word.gsub!(/<:e>/,
+ " \\footnote{%\n #{@@tex_footnote_array[@@tex_footnote_call_counter]}} ")
+ @@tex_footnote_call_counter+=1
+ end
+ end
+ end
+ def numbering
+ data=@data
+ LaTeX_create.new(data,@md,@orientation).number_paras if @md.markup !~/not_to/
+ end
+ def number_paras
+ data=@data
+ @tex_file=[]
+ data.each do |para|
+ if para =~/<\\~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ and para !~/\\end\{longtable\}|<EOF>/ #catch <!TZ!>
+ m=/(.+?)<\\~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m
+ parablock=para[m,1]
+ paranum=para[m,2]
+ do_duo=SiSU_TeX_Pdf::Format_text_object.new(@md,parablock,paranum)
+ para=do_duo.para_num if parablock
+ elsif para =~/^<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #2005 this is added for tables, rationalise
+ m=/<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m
+ paranum=para[m,1]
+ para.gsub!(/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'')
+ para="\\marginpar{\\begin{tiny}#{paranum}\\end{tiny}}" + para
+ #para="\\marginpar{\\begin{tiny}#{paranum}\\end{tiny}}"
+ #elsif para =~/<!T.+?!~\d+?>/
+ elsif para =~/^<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+>/ #extra 2005 this is added for tables, rationalise
+ m=/<~(\d+);[oh]\d+;\w\d+>/m
+ paranum=para[m, 1]
+ para.gsub!(/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+>/,'')
+ para="\\marginpar{\\begin{tiny}#{paranum}\\end{tiny}}" + para
+ elsif para =~/\\end\{longtable\}/ #catch <!TZ!>
+ para.gsub!(/<\\~\d+>|<\\~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'')
+ para.gsub!(/<\\~\d+>|<\\~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+>/,'') #extra
+ end
+ @tex_file << para
+ end
+ @tex_file
+ end
+ def output
+ data=@data
+ @tex_file=[]
+ data.flatten!
+ data.compact!
+ data.each do |para|
+ para.gsub!(/^\s+/,'')
+ @tex_file << para
+ end
+ fns_l=@md.fns.gsub(/~/,'-') #this is a sorry fix, but necessary as it appears latex programs like not ~
+ if @orientation =~/landscape/ #@tex_file << "\n<!EOF!>"
+ filename_tex_landscape=File.new("#{@env.path.tex}/#{fns_l}.landscape.tex",'w+')
+ filename_tex_landscape << @@tex_head_landscape
+ @tex_file.each {|para| filename_tex_landscape.puts para,"\n" unless para.empty?}
+ filename_tex_landscape.close
+ @@tex_head_landscape=[]
+ elsif @orientation =~/portrait/
+ filename_tex_portrait=File.new("#{@env.path.tex}/#{fns_l}.tex",'w+')
+ filename_tex_portrait << @@tex_head_portrait
+ @tex_file.each {|para| filename_tex_portrait.puts para,"\n" unless para.empty?}
+ filename_tex_portrait.close
+ @@tex_head_portrait=[]
+ end
+ @tex_file=[]
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/texpdf_format.rb b/lib/sisu/0.52/texpdf_format.rb
new file mode 100644
index 00000000..db18ce61
--- /dev/null
+++ b/lib/sisu/0.52/texpdf_format.rb
@@ -0,0 +1,1222 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: LaTeX formatting template, unicode utf-8 version, used for pdf
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_TeX_Pdf
+ @@table_pg_break_counter=1
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ class Use_TeX
+ attr_accessor :url,:txt,:date
+ def initialize(md,orientation='')
+ @md,@orientation=md,orientation
+ @vz=SiSU_Env::Get_init.instance.skin
+ @date=SiSU_Env::Info_date.new
+ @copymark='{\\begin{footnotesize}\\raisebox{1ex}{\\copyright}\\end{footnotesize}}'
+ end
+ def skip
+ "\n\\vspace*{\\smallskipamount} \n"
+ end
+ def paraskip_normal
+ '\setlength{\parskip}{1ex plus0.5ex minus0.2ex}'
+ end
+ def paraskip_small
+ '\setlength{\parskip}{0.5ex plus0.2ex minus0.1ex}'
+ end
+ def skip_small
+ #"\\smallskip{}"
+ end
+ def skip_small_vspace
+ "\n\\vspace*{\\smallskipamount} \n"
+ end
+ def skip_small_footnote
+ #"\n\\smallskip{}\n"
+ end
+ def skip_medium
+ "\n\\medskip{}\n\n"
+ end
+ def skip_dummy
+ "\n"
+ end
+ def header
+ "\\lhead[ ]{ }\n" +
+ "\\chead[ \\fancyplain{} \\bfseries \\footnotesize \\leftmark ]{ \\fancyplain{} \\bfseries \\footnotesize \\rightmark }\n" +
+ "\\rhead[ ]{ }\n"
+ end
+ def footer
+ base_prog_txt=if @md.base_program
+ case @md.base_program
+ when /kdissert/i; " \\\\ \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert}"
+ else ''
+ end
+ else ''
+ end
+ "\\lfoot[\\textrm{\\thepage}]{\\tiny \\href{#{@vz.url_sisu}}{#{@vz.txt_signature}}#{base_prog_txt}}\n" +
+ "\\cfoot[\\href{#{@vz.url_home}}{#{@vz.url_txt}}]{\\href{#{@vz.url_home}}{#{@vz.url_txt}}}\n" +
+ "\\rfoot[\\tiny \\href{#{@vz.url_sisu}}{#{@vz.txt_signature}}]{\\textrm{\\thepage}}\n"
+ end
+ def site
+ "\\href{#{@vz.url_home}}{#{@vz.url_txt}}"
+ end
+ def sitename #owners site, eg freeculture, free.for.all, gutenberg etc.
+ "\\href{#{@vz.url_home}}{#{@vz.txt_home}}"
+ end
+ def owner_chapter
+ "Contact Details for Original Promulgating Authority"
+ end
+ #BOOK standard dimensions - 229x156
+ def newpage
+ case @orientation
+ when /landscape/ # using longtable latex package
+<<WOK
+\\clearpage
+WOK
+ when /portrait/
+<<WOK
+\\newpage
+WOK
+ end
+ end
+ def sisu_rights
+ v=SiSU_Env::Info_version.new.get_version
+ base_prog_txt=if @md.base_program
+ case @md.base_program
+ when /kdissert/i; "\n\\\\ This document prepared using \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert \\ http://freehackers.org/~tnagy/kdissert/ } \\\\ Kdissert is Document Mapping software by Thomas Nagy"
+ else ''
+ end
+ else ''
+ end
+<<WOK
+\\\\ ~
+{\\begin{footnotesize}#{base_prog_txt}
+\\\\ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU \\ www.jus.uio.no/sisu } \\begin{tiny}[ #{v[:project]} #{v[:version]} of #{v[:date_stamp]} ]\\end{tiny}
+\\\\ using SiSU: object citation numbering, markup, meta-markup, and system
+\\\\ #@copymark Ralph Amissah 1997, current #{@date.year}, All Rights Reserved.
+\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 2 } or later, \\href{http://www.fsf.org/licenses/gpl.html}{http://www.fsf.org/licenses/gpl.html}.
+{\\end{footnotesize}
+\\\\
+WOK
+ end
+ def doc_sc_info_footnote_full
+<<WOK
+\\footnote{%\nGenerated by \\href{http://www.jus.uio.no/sisu}{SiSU \\ www.jus.uio.no/sisu }\\ \\newline \\scriptsize{Document version information: \\emph{sourcefile} \\uline{#{@md.fnstex}}; \\emph{version} \\uline{#{@md.sc_number}}; \\emph{date} \\uline{#{@md.sc_date}}; \\emph{time} \\uline{#{@md.sc_time}}}}
+WOK
+ end
+ def doc_sc_info_footnote_brief
+ " \\footnote{%\nGenerated by \\href{http://www.jus.uio.no/sisu}{SiSU \\ www.jus.uio.no/sisu }\\\n}"
+ end
+ def doc_sc_info
+ v=SiSU_Env::Info_version.new.get_version
+<<WOK
+\\\\
+{\\begin{footnotesize}
+Document version information: \\\\
+\\emph{sourcefile} \\uline{#{@md.fnstex}}; \\emph{version} \\uline{#{@md.sc_number}}; \\emph{date} \\uline{#{@md.sc_date}}; \\emph{time} \\uline{#{@md.sc_time}} \\\\
+Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- version information: \\\\
+\\uline{ #{v[:project]} #{v[:version]} of #{v[:date_stamp]}}
+\\end{footnotesize}}&
+WOK
+ end
+ def doc_no_sc_info
+ v=SiSU_Env::Info_version.new.get_version
+<<WOK
+\\\\
+{\\begin{small}
+Document information: \\\\
+\\emph{sourcefile} \\uline{#{@md.fnstex}} \\\\
+Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- version information: \\\\
+\\uline{ #{v[:project]} #{v[:version]} of #{v[:date_stamp]}}
+
+\\end{small}}&
+WOK
+ end
+ def manifest_info
+ url=@md.fnb.gsub(/(?:\\)*([$&~%_#}{^])/,'\\\\\1')
+ fn=@md.fn[:manifest].gsub(/(?:\\)*([$&~%_#}{^])/,'\\\\\1')
+<<WOK
+{\\begin{footnotesize}
+\\\\ For alternative output formats of this document check:
+\\\\ \\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{fn}}{#{@vz.url_root_http}/#{url}/#{fn}}\\end{scriptsize}
+\\end{footnotesize}}&
+WOK
+ end
+ def endnotes #not used should be inserted before MetaData section which preceeds doc_tail, but is "part of document"
+<<WOK
+\\subsection*{Endnotes}
+\\addcontentsline{toc}{section}{Endnotes}
+\\
+\\listofendnotes
+WOK
+ end
+ def doc_tail
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ base_html="#{dir.url.root}/#{@md.fnb}"
+ v=SiSU_Env::Info_version.new.get_version
+ sisu_ico=if FileTest.file?("#{dir.path.image_source_tex}/sisu.png")
+ "\\includegraphics*[width=60pt]{#{dir.path.image_source_tex}/sisu.png}"
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'WARNING - image directory or image(s) missing:', %{"#{dir.path.image_source_tex}"} )
+ tell.warn unless @md.cmd =~/q/
+ " SiSU "
+ end
+ url=@md.fnb.gsub(/(?:\\)*([$&~%_#}{^])/,'\\\\\1')
+<<WOK
+\\subsection*{Information on this document copy and an unofficial List of Some web related information and sources}
+\\addcontentsline{toc}{section}{Information on this document copy and an unofficial List of Some web related information and sources}
+\\\\
+\"Support Open Standards and Open Sources for the Information Technology Infrastructure\" RA\\subsubsection*{Information on this document copy #{site}}
+\\addcontentsline{toc}{subsection}{Information on this document copy}
+{\\begin{footnotesize}
+\\\\ Generated by \\href{http://www.jus.uio.no/sisu/}{SiSU} found at \\href{http://www.jus.uio.no/sisu/}{www.jus.uio.no/sisu} \\begin{tiny}[ #{v[:project]} #{v[:version]} #{v[:date_stamp]} ]\\end{tiny} (using SiSU: object citation numbering, markup, meta-markup, and system) #@copymark Ralph Amissah 1997, current #{@date.year}, All Rights Reserved.
+\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 2 } or later (\\href{http://www.fsf.org/licenses/gpl.html}{www.fsf.org/licenses/gpl.html}). {\\end{footnotesize}
+{\\begin{small}
+\\\\ W3 since October 3 1993 \\href{http://www.jus.uio.no/sisu/}{#{sisu_ico}}SiSU 1997, current #{@date.year}. \\\\ #{sitename} presentations at \\begin{bfseries}#{site}\\end{bfseries} \\\\ \\\\ #{@md.title} \\textbf{pdf} versions can be found at: \\\\
+{\\end{small}
+\\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_p]}}{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_p]}}\\end{scriptsize} \\\\
+\\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_l]}}{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_l]}}\\end{scriptsize} \\\\
+\\\\\n#{@md.title} \\textbf{html} versions may be found at: \\\\
+\\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:toc]}}{#{@vz.url_root_http}/#{url}/#{@md.fn[:toc]}}\\end{scriptsize} or \\\\
+\\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:doc]}}{#{@vz.url_root_http}/#{url}/#{@md.fn[:doc]}}\\end{scriptsize}
+\\\\
+\\\\
+\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:manifest]}}{SiSU Manifest} of document output and metadata may be found at: \\\\
+\\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:manifest]}}{#{@vz.url_root_http}/#{url}/#{@md.fnl[:pre]}sisu\\_manifest#{@md.fnl[:mid]}.html#{@md.fnl[:post]}}\\end{scriptsize}
+\\\\
+\\\\
+ #{sitename} found at: \\begin{bfseries}#{site}\\end{bfseries}\\subsubsection*{Links that may be of interest at #{@vz.txt_home} and elsewhere:}
+\\addcontentsline{toc}{subsection}{Links that may be of interest}
+WOK
+ end
+ def mail_tail #not retested, the old mail_tail is commented out and appended to this program
+ dir=SiSU_Env::Info_env.new(@md.fns)
+<<WOK
+\\subsection*{Mail sender details}
+\\addcontentsline{toc}{subsection}{Mail sender details}
+\\\\
+Mail from: ralph@amissah.com\\\\
+44 20 8789 3452\\\\
+44 77 9669 4448
+\\\\
+ \"Support Open Standards and Open Sources for the Information Technology Infrastructure\" RA
+\\subsubsection*{Information on this document copy #{site}\\copyright}
+Presentations' look and feel generated by \\href{http://www.jus.uio.no/sisu/}{SiSU Scribe} \\href{http://www.jus.uio.no/sisu/}{http://www.jus.uio.no/sisu/} programmed in Ruby on Debian/Gnu/Linux by \\copyright Ralph Amissah, W3 since October 3 1993 \\href{http://www.jus.uio.no/sisu/}{\\includegraphics*[width=35pt]{#{dir.path.image_source_tex}/sisu.png}}for #{sitename}. SiSU Scribe (sisu information structuring unit) produces Electronic Documents, i.e. it generates structured output for use in a number of file formats, including the pdf file produced here.
+WOK
+ end
+ end
+ class Format_text_object
+ require 'iconv'
+ attr_accessor :string,:string1,:string,:orientation,:url,:dir,:tex
+ @@sys=SiSU_Env::System_call.new
+ @@tex_backslash="\\\\"
+ @@tilde='\\\\\\~' #?? debug crazy
+ @@tex_pattern_margin_number="\\\\begin\\\{tiny\\\}~\\\\end\\\{tiny\\\}\\\{\\\\marginpar.+?\s+"
+ @@tableheader=0
+ @@sys=SiSU_Env::System_call.new
+ @@flag_code=false
+ @@dp=nil
+ def initialize(md,string,string1=nil)
+ @md,@string,@string1=md,string,string1
+ if defined? @md.image and @md.image =~/center/
+ @center_begin,@center_end='\begin{center}','\end{center}'
+ else @center_begin,@center_end='',''
+ end
+ @start_table=''
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @tx=SiSU_Env::Get_init.instance.tex
+ end
+ def longtable_landscape
+ @end_table='\end{longtable}'
+ @row_break='\\\\\\'
+ if @string[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/]
+ no_of_cols,cols_width,ocn=$1,$2,$3
+ tw=case @md.papersize
+ when /a4/i; @tx.a4.landscape.w #European default, SiSU default
+ when /letter/i; @tx.letter.landscape.w #U.S. default
+ when /legal/i; @tx.legal.landscape.w #U.S. alternative
+ when /book|b5/i; @tx.b5.landscape.w #book default - larger
+ when /a5/i; @tx.a5.landscape.w
+ else @tx.a4.landscape.w #default currently A4
+ end
+ textwidth=(tw.to_i/2) - 24
+ @@tableheader=1 if @string =~/<!Th/
+ @w=cols_width.split(/;\s*/)
+ @@number_of_cols=no_of_cols
+ @colW=[]
+ @colW << '{'
+ @w.each do |x|
+ x.strip!
+ x=(x.to_i * textwidth)/100
+ col_w=x.to_s # x.gsub(/.+/,'l\|') #unless x.nil?
+ @colW << "p{#{col_w}mm}" if col_w
+ end
+ @colW << '}'
+ @colW=@colW.join
+ @start_table="<~#{ocn}>\n\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" +
+ "\\begin{tiny}\n\\begin{longtable}#@colW\n"
+ @string.gsub!(/<!Th?¡\s+c\d+?;.+!\\~\d+;\w\d+;\w\d+>/,@start_table)
+ end
+ if @string =~/<!TZ!>/
+ @string.gsub!(/<!TZ!>/," #@end_table\n\\end{tiny}")
+ end
+ @string.gsub!(/<!¡/,'')
+ if @@tableheader == 1
+ if @string =~/¡\d+?¡(.+?)(?:¡|!)/
+ tablefoot=@string[/\<!f(.+?)!\>/,1]
+ @string.gsub!(/\<!f(.+?)!\>/,'')
+ @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\bfseries \1&')
+ @string.gsub!(/&>\s*$/," #@row_break \\hline\\endhead #@row_break")
+ @string="#@string \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot
+ @@tableheader,@@number_of_cols=0,0
+ end
+ else
+ if @string =~/¡\d+?¡(.+?)(?:¡|!)/
+ @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\1&')
+ @string.gsub!(/&>\s*$/," #@row_break")
+ end
+ end
+ @string="<~#{ocn}>" + @string
+ end
+ def longtable_portrait
+ @end_table='\end{longtable}'
+ @row_break='\\\\\\'
+ if @string[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/]
+ no_of_cols,cols_width,ocn=$1,$2,$3
+ tw=case @md.papersize
+ when /a4/i; @tx.a4.portrait.w #European default, SiSU default
+ when /letter/i; @tx.letter.portrait.w #U.S. default
+ when /legal/i; @tx.legal.portrait.w #U.S. alternative
+ when /book|b5/i; @tx.b5.portrait.w #book default - larger
+ when /a5/i; @tx.a5.portrait.w
+ else @tx.a4.portrait.w #default currently A4
+ end
+ textwidth=tw.to_i - 20
+ @@tableheader=1 if @string =~/<!Th/
+ @w=cols_width.split(/;\s*/)
+ @@number_of_cols=no_of_cols
+ @colW=[]
+ @colW << '{'
+ @w.each do |x|
+ x.strip!
+ x=(x.to_i * textwidth)/100
+ #x=(x.to_i/100.0 * 160)
+ col_w=x.to_s # x.gsub(/.+/,'l\|') #unless x.nil?
+ @colW << "p{#{col_w}mm}" if col_w
+ end
+ @colW << '}'
+ @colW=@colW.join
+ @start_table="<~#{ocn}>\n\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" +
+ "\\begin{tiny}\n\\begin{longtable}#@colW\n"
+ @string.gsub!(/<!Th?¡\s+c\d+?;.+!\\~\d+;\w\d+;\w\d+>/,"#@start_table")
+ end
+ if @string =~/<!TZ!>/
+ @string.gsub!(/<!TZ!>/," #@end_table\n\\end{tiny}")
+ end
+ @string.gsub!(/<!¡/,'')
+ if @@tableheader == 1
+ if @string =~/¡\d+?¡(.+?)(?:¡|!)/
+ tablefoot=@string[/\<!f(.+?)!\>/,1]
+ @string.gsub!(/\<!f(.+?)!\>/,'')
+ @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\bfseries \1&')
+ @string.gsub!(/&>\s*$/," #@row_break \\hline\\endhead #@row_break")
+ @string="#@string \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot
+ @@tableheader,@@number_of_cols=0,0
+ end
+ else
+ if @string =~/¡\d+?¡(.+?)(?:¡|!)/
+ @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\1&')
+ @string.gsub!(/&>\s*$/," #@row_break")
+ end
+ end
+ @string="<~#{ocn}>" + @string
+ end
+ def scopedtable
+ # some features related to headers have been incorporated in longtable that are not included yet here,
+ # so until synced is broken on some input files, work needs to be done if is to work as before
+ @end_table="\\end{tabular}"
+ @row_break='\\\\\\\\'
+ @break_page="#@row_break\n#@row_break \n"
+ if @string[/<!Th?¡\s+c(\d+);(.+?)!>/]
+ no_of_cols, cols_width=$1,$2
+ @w=cols_width.split(/;\s*/)
+ @colW=[]
+ @w.each do |x|
+ col_w=((x.to_i*12)/100.00).to_s #unless x.nil?
+ @colW << "p{#{col_w}cm}" if col_w
+ end
+ @start_table="\\begin{tabular}{#@colW}\n"
+ @string.gsub!(/<!Th?¡\s+c\d+?;.+!>/,"#@start_table}")
+ end
+ if @string =~/<!TZ!>/
+ @string.gsub!(/<!TZ!>/,"#@end_table")
+ @@table_pg_break_counter=1
+ end
+ if @string =~/<!¡/
+ if @@table_pg_break_counter == 28 # taken from 34 ideal for portrait to 28 which suits landscape
+ @string = "\n\n#@end_table \n#@break_page#@start_table\n"
+ @@table_pg_break_counter=1
+ else
+ @string.gsub!(/<!¡/,'')
+ @@table_pg_break_counter+=1
+ tablefoot=@string[/\<!f(.+?)!\>/,1]
+ @string.gsub!(/\<!f(.+?)!\>/,'')
+ end
+ end
+ if @string =~/¡\d+?¡(.+?)(?:¡|!)/
+ @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,"\\1&")
+ @string.gsub!(/&>\s*$/,"#@row_break")
+ end
+ @string
+ end
+ def special_characters_1(para)
+ # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list
+ #p @@utf_8.list
+ #@string=Iconv.conv('ISO-8859-1', 'UTF-8', @string)
+ word=@string.scan(/\S+|\n/) #unless line =~/^(?:0~\S|%+\s)/
+ para_array=[]
+ if word
+ word.each do |w| # _ - / # | : ! ^ ~
+ unless para =~/^(?:0~|%+ |<!Th?¡ )/m
+ w.gsub!(/[\\]?~/,'<=tilde>') unless w=~/^[1-6]~|~\{|\}~|~\[|\]~|^\^~\s|~\^|\*~\S+|~#|\{t~|<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/
+ w.gsub!(/&#(?:126|152);/,'<=tilde>') #126 usual
+ #w.gsub!(/&#(?:126|152);/,'<=tilde>') unless w=~/https?:\/\/\S+/ #126 usual
+ w.gsub!(/\\?\||&#124;/,'<=pipe>') #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX
+ end
+ para_array << w
+ end
+ para=para_array.join(' ')
+ @string=para.strip
+ end
+ @string.gsub!(/<~\d+;(?:\w|[0-6]:)\d+;[umdv]\d+><#@dp:#@dp>/,'')
+ @string.gsub!(/.+?<-#>/,'')
+ @string.gsub!(/<EOF>/,'')
+ @string.gsub!(/<ENDNOTES?>/,'')
+ #problem sequence ->
+ @string.gsub!(/&(?:nbsp);/,'<=hardspace>') # < SiSU special character also LaTeX
+ @string.gsub!(/&(?:lt|#060);/,'<=lt>') # < SiSU special character also LaTeX
+ @string.gsub!(/&(?:gt|#062);/,'<=gt>') # > SiSU special character also LaTeX
+ @string.gsub!(/&#123;/,'<=curlyopen>') # { SiSU special character also LaTeX
+ @string.gsub!(/&#125;/,'<=curlyclose>') # } SiSU special character also LaTeX
+ @string.gsub!(/&#(?:126|152);/,'<=tilde>') # ~ SiSU special character also LaTeX
+ @string.gsub!(/&#035;/,'\#') # # SiSU special character also LaTeX
+ @string.gsub!(/&#033;/,'!') # ! SiSU not really special sisu character but done, also LaTeX
+ @string.gsub!(/&#042;/,'*') # * should you wish to escape astrisk e.g. describing \*{bold}*
+ @string.gsub!(/&#045;/,'-') # - SiSU special character also LaTeX
+ @string.gsub!(/&#043;/,'+') # + SiSU special character also LaTeX
+ @string.gsub!(/&#044;/,',') # + SiSU special character also LaTeX
+ @string.gsub!(/&#038;/,'<=amp>') #unless @string=~/<:code>/ # / SiSU special character also LaTeX
+ @string.gsub!(/&#047;/,'<=slash>') # / SiSU special character also LaTeX
+ @string.gsub!(/&#092;/,'<=backslash>') # \ SiSU special character also LaTeX
+ @string.gsub!(/&#095;/,'<=underscore>') # _ SiSU special character also LaTeX
+ @string.gsub!(/&#124;/,'|') # | SiSU not really special sisu character but done, also LaTeX
+ @string.gsub!(/&#058;/,':') # : SiSU not really special sisu character but done, also LaTeX
+ @string.gsub!(/&#094;/,'<=caret>') # ^ SiSU not really special sisu character but done, also LaTeX
+ @string.gsub!(/\#/,'<=hash>')
+ ##watch placement, problem sequence ^
+ @string.gsub!(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ')
+ @string.gsub!(/<:pb>/,'\newpage')
+ @string.gsub!(/<:pn>/,'\clearpage')
+ @string.gsub!(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript
+ end
+ def special_characters_2(para)
+ @string.gsub!(/&#156;/,'\oe ')
+ @string.gsub!(/\$/,'\$')
+ @string.gsub!(/\#/,'\#')
+ @string.gsub!(/\%/,'\%')
+ @string.gsub!(/\~/,'\~') #revist, should not be necessary to mark remaining tildes
+ if @string !~/^\s*<:image|\}:image\s/
+ @string.gsub!(/_/,'\_')
+ end
+ @string.gsub!(/\{/,'\{')
+ @string.gsub!(/\}/,'\}')
+ @string.gsub!(/&nbsp;/,'~') # ~ character for hardspace
+ # sequence important must appear after removal of { and }
+ @string.gsub!(/&\S+?;/,'') #hmmm
+ # sequence imortant place before removal of &
+ if @string=~/<:code>/; @@flag_code=true
+ elsif @string=~/<:code-end>/; @@flag_code=false
+ end
+ if @@flag_code; @string.gsub!(/&/,'{\\\&}')
+ else @string.gsub!(/(\s+&\s+)/,' and ')
+ end
+ @string.gsub!(/§/,'\S') #latex: space between next character not preserved? #@string.gsub!(/§ /,'\S ')
+ @string.gsub!(/£/,'\pounds')
+ @string.gsub!(/&\S+?;/,' ')
+ @string.gsub!(/<a href=".+?">/,' ')
+ @string.gsub!(/<\/a>/,' ')
+ if @string !~/^\s*<:image|\}image/ #watch carefully could introduce breaks ! removed \}http changed 0.1.1-4 200501
+ if @string =~/(?:https?|ftp):\/\/\S+?<\/\S>/ #problems where have font attribute eg </u> (change substitution sequence?) # [^\}>] added for escaped curly brace <=curlyclose> watch
+ @string.gsub!(/[^\}>]((?:https?|ftp):\/\/\S+?)(<\/\S>)/,' \begin{scriptsize}\href{\1}{ \1 } \end{scriptsize}\2')
+ else # regular urls !! http:// href
+ if @string=~/(?:https?|ftp):\/\/\S+?[,.]? /
+ @string.gsub!(/(?:^|[^\}>])((?:https?|ftp):\/\/\S+?)([,.])? /,' \begin{scriptsize}\href{\1}{ \1}\end{scriptsize}\2 ')
+ else @string.gsub!(/(?:^|[^\}>])((?:https?|ftp):\/\/\S+)/,' \begin{scriptsize}\href{ \1 }{\1} \end{scriptsize}') #should not be necessary, not checked
+ end
+ end
+ else #@string =~/\\~\\\{.+?\\\}\\~/ # \\~\\{1
+ #@string.gsub!(/(?:\n)?(http:\/\/\S+)/," \\begin{scriptsize}\\href{\\1}{\\1} \\end{scriptsize}") #bug...
+ end
+ @string.gsub!(/<:ee>/,'')
+ @string.gsub!(/<!>/,' ')
+ #proposed change, insert, but may be redundant
+ @string.gsub!(/ \/><:i[12]>(.+?)(?:\}~|<br)/,' \begin{ParagraphIndent}{0.01\columnwidth}\1\end{ParagraphIndent} ') # footnote indents, problems if match exists in ordinary paragraphs? check! Work Area 200501 a bit tricky as must be able to match multiple times, and to clean remainder
+ @string.gsub!(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>/," #{@@tex_backslash*2} ") # Work Area
+ @string.gsub!(/<b>(.+?)<\/b>/,'\begin{bfseries}\1 \end{bfseries}')
+ @string.gsub!(/<em>(.+?)<\/em>/,'\begin{bfseries}\1 \end{bfseries}')
+ @string.gsub!(/<(bold|strong)>(.+?)<\/(bold|strong)>/,'\begin{bfseries}\1 \end{bfseries}')
+ @string.gsub!(/<h\d+>(.+?)<\/h\d+>/,'\begin{bfseries}\1 \end{bfseries}')
+ @string.gsub!(/<i>(.+?)<\/i>/,'\emph{\1}')
+ @string.gsub!(/<italic>(.+?)<\/italic>/,'\emph{\1}')
+ @string.gsub!(/<u>(.+?)<\/u>/,'\uline{\1}') # ulem
+ @string.gsub!(/<ins>(.+?)<\/ins>/,'\uline{\1}') # ulem
+ @string.gsub!(/<del>(.+?)<\/del>/,'\sout{\1}') # ulem
+ @string.gsub!(/<sub>(.+?)<\/sub>/,"\$_{\\textrm{\\1}}\$")
+ @string.gsub!(/<sup>(.+?)<\/sup>/,"\$^{\\textrm{\\1}}\$")
+ unless @@flag_code
+ @string.gsub!(/"(.+?)"/,"``\\1''") # quote marks / quotations open & close " need condition exclude for code
+ @string.gsub!(/\s+"/,' ``') # open "
+ @string.gsub!(/^([1-6-]#{@@tilde}\S*|<.+?>)?\s*"/,'\1``') # open "
+ @string.gsub!(/"(\s|\.|,|:|;)/,"''\\1") # close "
+ @string.gsub!(/"([1-6-]#{@@tilde}\S*|<.+?>)?\s*$/,"''\\1") # close "
+ @string.gsub!(/"(\.|,)/,"''") # close "
+ @string.gsub!(/\s+'/,' `') # open '
+ @string.gsub!(/^([1-6-]#{@@tilde}\S*|<.+?>)?\s*'/,'\1`') # open '
+ end
+ @string.gsub!(/^(<:i[12]>)?\s*\\_\*\s*/,'\\1 \begin{math} \bullet \end{math}~~') #bullets - added 2004w17 watch \\_
+ @string.gsub!(/(<font.*?>|<\/font>)/,'')
+ @string.gsub!(/\s*<sup>(\S+?)<\/sup>/,'^\1')
+ @string.gsub!(/(<sup>|<\/sup>)/,'')
+ @string
+ end
+ def special_characters_3(para)
+ @string.gsub!(/<br(\s*[^\/][^>])/,'\1') # clean up, incredibly messy :-( footnote indents, problems if match exists in ordinary paragraphs? check! Work Area 200501 a bit tricky as must be able to match multiple times, and to clean remainder
+ @string.gsub!(/([^<][^b][^r]\s+)\/>/,'\1') # clean up, incredibly messy :-( footnote indents, problems if match exists in ordinary paragraphs? check! Work Area 200501 a bit tricky as must be able to match multiple times, and to clean remainder
+ #problem sequence (another kludge) ->
+ @string.gsub!(/<=lt>/,'{\UseTextSymbol{OML}{<}}')
+ @string.gsub!(/<=gt>/,'{\UseTextSymbol{OML}{>}}')
+ #@string.gsub!(/<=lt>/,'\<')
+ #@string.gsub!(/<=gt>/,'\>')
+ @string.gsub!(/<=underscore>/,'\_')
+ @string.gsub!(/(\href\{http:\/\/\S+?)(?:(?:<=tilde>)(\S+))+\}/,'\1\~\2}') #tildes in urls \href treated differently from text
+ @string.gsub!(/<=tilde>/,'{\~~}')
+ @string.gsub!(/<=pipe>/,'{\textbar}')
+ @string.gsub!(/<=caret>/,'{\^{~}}')
+ #@string.gsub!(/<=caret>/,'\^{}')
+ @string.gsub!(/<=exclaim>/,'\Verbatim{!}')
+ @string.gsub!(/<=hash>/,'{\#}')
+ #@string.gsub!(/<=hash>/,'{\UseTextSymbol{OT1}{#}}')
+ #@string.gsub!(/<=slash>/,'{\slash}')
+ @string.gsub!(/<=hardspace>/,'{~}') #changed ... 2005
+ @string.gsub!(/<=amp>/,'{\\\&}') #changed ... 2005
+ #@string.gsub!(/<=amp>/,'{\UseTextSymbol{OT1}{&}}')
+ @string.gsub!(/<=slash>/,'{/}')
+ @string.gsub!(/<=backslash>/,'{\textbackslash}')
+ #@string.gsub!(/<=asterisk>/,'*')
+ #@string.gsub!(/<=exclaim>/,'!')
+ #@string.gsub!(/<=asterisk>/,'{\ast}')
+ #@string.gsub!(/<=copymark>/,"^{\\copyright} ") # watch has been problematic
+ #copymark='{\\begin{small}\\raisebox{1ex}{\\copyright}\\end{small}} '
+ @string.gsub!(/<=copymark>\s*(.+)?\s+(<\\~\d+;\w(?:[0-6]:)?\d+;\w\d+><#@dp:#@dp>)/,"^\\copyright \\textnormal{\\1} \\2") # watch likely to be problematic
+ @string
+ end
+ def special_characters_curly(para)
+ @string.gsub!(/<=curlyopen>/,'\{')
+ @string.gsub!(/<=curlyclose>/,'\}')
+ @string
+ end
+ def special_characters_unsafe_1(para) #depreciated, make obsolete
+ # some substitutions are sequence sensitive, rearrange with care.
+ @string.gsub!(/\\backslash (copyright|clearpage|newpage)/,"\\\\\\1") #kludge bad solution, find out where tail is sent through specChar !
+ end
+ def special_characters_unsafe_2(para)
+ end
+ def special_characters_unsafe_3(para)
+ end
+ def special_characters #special characters - some substitutions are sequence sensitive, rearrange with care.
+ special_characters_1(@string)
+ special_characters_unsafe_1(@string)
+ special_characters_2(@string)
+ special_characters_3(@string)
+ end
+ def special_characters_safe #special characters - some substitutions are sequence sensitive, rearrange with care.
+ special_characters_1(@string)
+ special_characters_2(@string)
+ #special_characters_3(@string)
+ end
+ def heading_major(para,lev)
+ title=@md.title
+ para.strip! if para
+ para.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ cont_ln=para.dup
+ cont_ln.gsub!(/#{@@tex_pattern_margin_number}/,'')
+ cont_ln.gsub!(/#{lev}#{@@tilde}\s+/,'')
+ if para =~/\\[Ff]ootnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings!
+ cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')
+ cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')
+ end
+ para.gsub!(/(#{@md.lev}.*)\n?$/m,"\\part*{\\1}
+\\addcontentsline{toc}{section}{#{cont_ln}}
+\\markboth{#{title}}\n") if (para !~/#{lev}#{@@tilde}/)
+ para.gsub!(/^#{lev}#{@@tilde}\s*(.*)\n?$/m,
+ "\\part*{\\1}
+\\addcontentsline{toc}{section}{#{cont_ln}}
+\\markboth{#{title}}\n")
+ end
+ def level1
+ heading_major(@string,1)
+ end
+ def level2
+ heading_major(@string,2)
+ end
+ def level3
+ heading_major(@string,3)
+ end
+ def level4
+ @string.strip! if @string
+ @string.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ cont_ln=@string.dup
+ cont_ln.gsub!(/#{@@tex_pattern_margin_number}/,'')
+ cont_ln.gsub!(/#{@@tex_backslash*2}/,"#{@@tex_backslash*4}") # added w42
+ cont_ln.gsub!(/4#{@@tilde}\S+\s+/,'')
+ cont_ln.gsub!(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
+ cont_ln.gsub!(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
+ title=@md.title
+ @string.gsub!(/#{@md.lv4}\s+(#{@md.lv4})/m,'\1')
+ if @string =~/4#{@@tilde}endnotes|<:4-endnotes>/
+ # watch exclusion removes endnotes marker from pdf 2003w03
+ @string.gsub!(/.+/m,'')
+ end
+ if @string =~/\\footnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings!
+ cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')
+ cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')
+ end
+ if @string !~/4#{@@tilde}/
+ @string.gsub!(/(#{@md.lv4}.*)\n?$/m,"\\subsubsection*{\\1}
+\\addcontentsline{toc}{subsection}{#{cont_ln}}
+\\markright{#{title}}")
+ else
+ @string.gsub!(/^\s*4#{@@tilde}\S+\s*(.*)?\n?$/m,"\\subsubsection*{\\1}
+\\addcontentsline{toc}{subsection}{#{cont_ln}}
+\\markright{#{title}}")
+ end
+ @string.gsub!(/#{@md.lv4}\s*(.marginpar)/m,'\1')
+ end
+ def level5
+ # there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\@string*, same for next section 2002w46
+ @string.strip! if @string
+ @string.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ cont_ln=@string.dup
+ cont_ln.gsub!(/#{@@tex_pattern_margin_number}/,'')
+ cont_ln.gsub!(/5#{@@tilde}\S*\s+/,'')
+ cont_ln.gsub!(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
+ cont_ln.gsub!(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
+ cont_ln.gsub!(/\\\&/,' and ') #revisit: tmp bugfix 200507, substitutes & with 'and' in toc, needed e.g. for AT&T, see ffa
+ @string.gsub!(/#{@md.lv5}\s+(#{@md.lv5})/m,'\1')
+ if @string =~/\\footnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings!
+ cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')
+ cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')
+ end
+ if @string !~/5#{@@tilde}/
+ @string.gsub!(/(#{@md.lv5}.*?)\n?$/m,"\\subsubsection*{\\1}
+\\addcontentsline{toc}{subsubsection}{#{cont_ln} \\\\
+}")
+ else
+ @string.gsub!(/^\s*5#{@@tilde}\S*\s*(.*)?\n?$/m,"\\subsubsection*{\\1}
+\\addcontentsline{toc}{subsubsection}{#{cont_ln} \\\\
+}")
+ end
+ @string.gsub!(/#{@md.lv5}\s*(.marginpar)/m,'\1')
+ end
+ def level6
+ # there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\sub@string*, same for previous section 2002w46
+ @string.strip! if @string
+ @string.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1')
+ cont_ln=@string.dup
+ cont_ln.gsub!(/#{@@tex_pattern_margin_number}/,'')
+ cont_ln.gsub!(/6#{@@tilde}\S*\s+/,'')
+ cont_ln.gsub!(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
+ cont_ln.gsub!(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
+ @string.gsub!(/#{@md.lv6}\s+(#{@md.lv6})/m,'\1')
+ if @string =~/\\footnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings!
+ cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')
+ cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')
+ end
+ @string.gsub!(/(#{@md.lv6}.*)\n?$/m,
+ "\\subsubsection*{\\1}") if (@string !~/6#{@@tilde}/)
+ @string.gsub!(/^\s*6#{@@tilde}\S*\s*(.*)?\n?$/m,
+ '\subsubsection*{\1}')
+ @string.gsub!(/#{@md.lv6}\s*(.marginpar)/m,'\1')
+ #end BUGWATCH
+ end
+ def indent1
+ @string.gsub!(/<:i1>(.*)/m,
+ '\begin{ParagraphIndent}{0.01\columnwidth} \1
+\end{ParagraphIndent}
+')
+ end
+ def indent2
+ @string.gsub!(/<:i2>(.*)/m,
+ '\begin{ParagraphIndent}{0.02\columnwidth} \1
+\end{ParagraphIndent}
+')
+ end
+ def symbol_graphic
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ image='c_' + /<:=\s*(\S+?)\s*>/m.match(@string).captures.join + '.png' #watch
+ if FileTest.file?("#{dir.path.image_source_tex}/#{image}")
+ @string.gsub!(/<:=\s*(\S+?)\s*>/,
+ "\\includegraphics*[width=11pt]{#{dir.path.image_source_tex}/c_\\1.png}")
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search path: #{dir.path.image_source_tex}")
+ tell.error2 unless @md.cmd =~/q/
+ @string.gsub!(/\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/,'') # fragile match operator\\ fragile !
+ end
+ end
+ def image
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ image,m=/<:image\s+(\S+)\s+.+?width=``(\d+)''.+?>/m.match(@string).captures
+ width=m[1] || '100'
+ width=width.to_i*0.4
+ image_source=if @md.fns =~/\._?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}")
+ dir.path.image_source_local_tex
+ elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{dir.path.image_source_remote_tex}/#{image}")
+ dir.path.image_source_remote_tex
+ elsif FileTest.file?("#{dir.path.image_source_tex}/#{image}")
+ dir.path.image_source_tex
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_local_tex},#{dir.path.image_source_remote_tex} and #{dir.path.image_source_tex}")
+ tell.error2 unless @md.cmd =~/q/
+ nil
+ end
+ if image_source
+ @string.gsub!(/<:image\s+((?:https?|ftp)\S+)\s+(\S+)\s+.+\s+?>/,
+ @center_begin + "\\href{\\1}{\\includegraphics*[width=#{width}pt]{#{image_source}/\\2}}" + @center_end )
+ @string.gsub!(/<:image\s+(\S+)\s+.+\s+?>/,
+ @center_begin + "\\includegraphics*[width=#{width}pt]{#{image_source}/\\1}" + @center_end )
+ else @string.gsub!(/<:image\s+(\S+)\s+.+\s+?>/,'\1}')
+ end
+ end
+ def png #fc missing image check
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ # messy clean up
+ z=@string[/\\\{(\S.+?)\}(?:image|png)/,1].strip if @string =~ /\\\{\S.+?\}(?:image|png)/ # match operator for z \\ fragile !
+ if z #debug 2004w14
+ image=z[/(\S+?\.(?:png|jpg|gif)\b)/m]
+ image.gsub!(/\\/,'')
+ width=if z =~ /\d+x\d*/
+ w=(z[/(\d+)x\d*/,1]).to_i
+ w*0.8
+ else '100' #revisit, is bug for small images/icons
+ end
+ width='380' if width.to_i > 380
+ c=z[/``(.+?)''/m]
+ end
+ hsp="\n{\\color{mywhite} .}&~\n" # ~ character for hardspace
+ caption="{\\\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" if c
+ #caption="{\\\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c[1]}\\end{scriptsize}&}" if c
+ image_source=if @md.fns =~/\._?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}")
+ dir.path.image_source_local_tex
+ elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{dir.path.image_source_remote_tex}/#{image}")
+ dir.path.image_source_remote_tex
+ elsif FileTest.file?("#{dir.path.image_source_tex}/#{image}")
+ dir.path.image_source_tex
+ else
+ unless image.nil? or image.length < 2
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_local_tex},#{dir.path.image_source_remote_tex} and #{dir.path.image_source_tex}")
+ tell.error2 unless @md.cmd =~/q/
+ end
+ nil
+ end
+ if image_source
+ @string.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/, # fragile match operator\\ fragile !
+ "#@center_begin\n\\includegraphics*[width=#{width}pt]{#{image_source}/#{image}}#{caption}#@center_end")
+ else
+ @string.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,'') # fragile match operator\\ fragile !
+ end
+ end
+ def http_word_mode(orientation='')
+ # clean up ! - work area, testing
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @words=[]
+ @string.each do |word|
+ @words << if word=~/\{.+?\}(?:https?|ftp):\S+/
+ if word =~/\\\{(.+?)\\\}((?:https?|ftp)\S+?)([.,](?:\s|$))/
+ r=%r/\\\{(.+?)\\?\}((?:https?|ftp):\S+?)(?:[.,](?:\s|$)|(?:\s|$))/
+ d=/\\\{.+?\\?\}(?:https?|ftp):\S+([.,](?:\s|$))/.match(word).captures.to_s
+ else
+ r=%r/\\\{(.+?)\\?\}((?:https?|ftp):\S+)/
+ d=''
+ end
+ z,url=r.match(word).captures if word =~r
+ url=url.strip
+ if word =~/\{\s*\S+\.?(?:png|jpg|gif)/ and word=~/\s+\d+x\d+\s+/
+ image,x,y=z.scan(/\S+/)
+ image.gsub!(/\\/,'')
+ width=200
+ width=z[/(\d+)x\d*/,1] ||='200' #watch
+ dm=case @md.papersize
+ when /a4/; @tx.a4
+ when /letter/; @tx.letter
+ when /legal/; @tx.legal
+ when /b5/; @tx.b5
+ when /a5/; @tx.a5
+ else @tx.a4
+ end
+ ##dm=SiSU_Env::Get_init.instance.tex(@md.papersize).dimensions #test!
+ #dm=SiSU_Viz::TeX.new(@md.papersize).dimensions
+ width=if orientation =~/portrait/ #value is not currently passed
+ width=if width.to_i > dm.portrait.img_px; dm.portrait.img_px
+ else width
+ end
+ else
+ width=if width.to_i > dm.landscape.img_px; dm.landscape.img_px
+ else width
+ end
+ end
+ c=z[/``(.+?)''/m,1]
+ hsp="\n{\\color{mywhite} .}&~\n" # ~ character for hardspace
+ caption="{\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" if c
+ elsif word =~/\{\s*(\S+\.?\.(?:png|jpg|gif))/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,%{document built without image: "#{$1}" as image dimensions not provided (& librmagick-ruby is not installed)?\n})
+ tell.print_grey #unless @opt.cmd =~/q/
+ end
+ ins=if image #most images fc etc. #% clean up !
+ out=if @md.fns =~/\._?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}")
+ @center_begin +
+ "\\\n\\href{#{url}}" + #not satisfactory: \\ added to ^line to mimic reference file output
+ "{\\includegraphics*[width=#{width}pt]" +
+ "{#{dir.path.image_source_local_tex}/#{image}}}" +
+ "#{caption}" +
+ @center_end if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+)/
+ elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{dir.path.image_source_remote_tex}/#{image}")
+ @center_begin +
+ "\\\n\\href{#{url}}" + #not satisfactory: \\ added to ^line to mimic reference file output
+ "{\\includegraphics*[width=#{width}pt]" +
+ "{#{dir.path.image_source_remote_tex}/#{image}}}" +
+ "#{caption}" +
+ @center_end if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+)/
+ elsif FileTest.file?("#{dir.path.image_source_tex}/#{image}")
+ @center_begin +
+ "\\\n\\href{#{url}}\n" + #not satisfactory: \\ added to ^line to mimic reference file output, mirror above ... not tested
+ "{\\includegraphics*[width=#{width}pt]" +
+ "{#{dir.path.image_source_tex}/#{image}}}" +
+ "#{caption}" +
+ @center_end if word =~/(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+)/
+ else
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_local_tex},#{dir.path.image_source_remote_tex} and #{dir.path.image_source_tex}")
+ tell.error2 unless @md.cmd =~/q/
+ '' if word =~ /\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/
+ end
+ else
+ link=z.strip #[/(.+?)\\/m,1]
+ word="\\href{#{url}}{#{link}}#{d}" if word =~/\\\{.+?\\\}(?:https?|ftp):\/\/\S+/
+ end
+ else word
+ end
+ end
+ @words.join
+ end
+ def http(orientation)
+ wm=@string.dup.scan(/\\\{.+?\\\}(?:(?:https?|ftp):\S+|image)|\w+\s*|./m) #first match of interest others passed through
+ @string=SiSU_TeX_Pdf::Format_text_object.new(@md,wm).http_word_mode(orientation)
+ end
+ def language
+ @lang=if @md.dc_language[:code]
+ case @md.dc_language[:code]
+ when 'en'; 'english'
+ when 'us'; 'USenglish' # depreciated, see iso-639-2
+ when 'fr'; 'french'
+ when 'de'; 'ngerman'
+ when 'it'; 'italian'
+ when 'es'; 'spanish'
+ when 'pt'; 'portuges'
+ #when 'br'; 'brazilian' # depreciated, see iso-639-2
+ when 'sv'; 'swedish'
+ when 'da'; 'danish'
+ when 'fi'; 'finnish'
+ when 'no'; 'norske,nynorsk'
+ when 'is'; 'icelandic'
+ when 'nl'; 'dutch'
+ when 'et'; 'estonian'
+ when 'hu'; 'magyar'
+ when 'pl'; 'polish'
+ when 'ro'; 'romanian'
+ when 'ru'; 'russian'
+ when 'gl'; 'greek'
+ when 'uk'; 'ukrainian'
+ when 'tr'; 'turkish'
+ when 'sk'; 'slovak'
+ when 'sl'; 'slovenian'
+ when 'hr'; 'croatian'
+ when 'cs'; 'czech'
+ when 'bg'; 'bulgarian'
+ else 'english'
+ end
+ else 'english'
+ end
+ end
+ def title
+ @string=Format_text_object.new(@md,@string).special_characters_safe
+ if @string1
+ @string1=Format_text_object.new(@md,@string1).special_characters_safe
+ @string1.gsub!(/\$/,"\\$")
+ "\n\\title{#@string#{@@tex_backslash*2} \\textbf{\\normalsize #@string1}\\normalsize}"
+ else "\n\\title{#@string}"
+ end
+ end
+ def title_landscape
+ title
+ end
+ def title_portrait
+ title
+ end
+ def tex_head_lang #babel 18n
+ language
+ #@md.dc_language[:name]
+ lang=if @lang =~/^(?:en)$/; @lang
+ else "#@lang,english"
+ end
+ end
+ def tex_head_encode
+ case @md.file_encoding
+ when /iso-?8859/i #% iso8859
+ <<WOK
+\\usepackage[latin1]{inputenc}
+WOK
+ else #% utf-8 assumed
+ <<WOK
+\\usepackage{babel}
+\\usepackage{ucs}
+\\usepackage[utf8x]{inputenc}
+WOK
+ end
+ end
+ def tex_head_info
+ generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version]
+ lastdone="Last Generated on: #{Time.now}"
+ rubyv="Ruby version: #{@md.ruby_version}"
+ <<WOK
+%% Sisu Sabaki (Linux & Ruby - \"better ways\") LaTeX output
+%% #{generator}
+%% #{rubyv}
+%% LaTeX output
+%% #{lastdone}
+%% SiSU http://www.jus.uio.no/sisu
+WOK
+ end
+ def tex_head_paper_portrait(d)
+ <<WOK
+#{tex_head_info}
+\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang},titlepage]{scrartcl} %with titlepage
+\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm}
+\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}
+\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}}
+\\setlength{\\headsep}{#{d[:headsep]}}
+\\setlength{\\marginparsep}{#{d[:marginparsep]}}
+\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
+WOK
+ end
+ def tex_head_paper_landscape(d)
+ <<WOK
+#{tex_head_info}
+\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang}, landscape, titlepage, twocolumn]{scrartcl} %with titlepage
+\\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm}
+\\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}
+\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}}
+\\setlength{\\headsep}{#{d[:headsep]}}
+\\setlength{\\columnsep}{#{d[:columnsep]}}
+\\setlength{\\marginparsep}{#{d[:marginparsep]}}
+\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
+WOK
+ end
+ def tex_head_paper_dimensions
+ d={}
+ case @string
+ when /portrait/
+ #textheight,textwidth=@tx.a4.portrait.h,@tx.a4.portrait.w
+ d[:papertype],d[:fontsize]='a4paper','11pt'
+ d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='0mm','0mm','-12pt'
+ d[:headheight],d[:headsep],d[:columnsep]='12pt','35pt',''
+ d[:marginparsep],d[:marginparwidth]='4mm','8mm'
+ case @md.papersize
+ when /a4/i #European default, SiSU default
+ d[:papertype],d[:fontsize]='a4paper','12pt'
+ d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w
+ when /letter/i #U.S. default
+ d[:papertype],d[:fontsize]='letterpaper','12pt'
+ d[:textheight],d[:textwidth]=@tx.letter.portrait.h,@tx.letter.portrait.w
+ when /legal/i #U.S. alternative
+ d[:papertype],d[:fontsize]='legalpaper','12pt'
+ d[:textheight],d[:textwidth]=@tx.legal.portrait.h,@tx.legal.portrait.w
+ when /book|b5/i #book default - larger
+ d[:papertype],d[:fontsize]='b5paper','11pt'
+ d[:textheight],d[:textwidth]=@tx.b5.portrait.h,@tx.b5.portrait.w
+ when /a5/i
+ d[:papertype],d[:fontsize]='a5paper','11pt'
+ d[:textheight],d[:textwidth]=@tx.a5.portrait.h,@tx.a5.portrait.w
+ else #default currently A4
+ d[:papertype],d[:fontsize]='a4paper','12pt'
+ d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w
+ end
+ when /landscape/
+ #d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w
+ d[:papertype],d[:fontsize]='a4paper','11pt'
+ d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-8mm','-8mm','-18mm'
+ d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt'
+ d[:marginparsep],d[:marginparwidth]='4mm','8mm'
+ case @md.papersize
+ when /a4/i #European default, SiSU default
+ d[:papertype],d[:fontsize]='a4paper','12pt'
+ d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w
+ when /letter/i #U.S. default
+ d[:papertype],d[:fontsize]='letterpaper','11pt'
+ d[:textheight],d[:textwidth]=@tx.letter.landscape.h,@tx.letter.landscape.w
+ when /legal/i #U.S. alternative
+ d[:papertype],d[:fontsize],d[:columnsep]='legalpaper','11pt','48pt'
+ d[:textheight],d[:textwidth]=@tx.legal.landscape.h,@tx.legal.landscape.w
+ when /book|b5/i #book default - larger
+ d[:papertype],d[:fontsize],d[:columnsep]='b5paper','11pt','35pt'
+ d[:textheight],d[:textwidth]=@tx.b5.landscape.h,@tx.b5.landscape.w
+ when /a5/i
+ d[:papertype],d[:fontsize],d[:columnsep]='a5paper','10pt','38pt'
+ d[:textheight],d[:textwidth]='10pt',@tx.a5.landscape.h,@tx.a5.landscape.w
+ else #default currently A4
+ d[:papertype],d[:fontsize]='a4paper','12pt'
+ d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w
+ end
+ end
+ d
+ end
+ def tex_head_paper
+ d={}
+ case @string
+ when /portrait/
+ tex_head_paper_portrait(tex_head_paper_dimensions)
+ when /landscape/
+ tex_head_paper_landscape(tex_head_paper_dimensions)
+ end
+ end
+ def tex_head_pdftex
+ color=case @string
+ when /portrait/
+ <<WOK
+ colorlinks=true,
+ urlcolor=myblack,
+ filecolor=myblack,
+ linkcolor=myblack,
+WOK
+ when /landscape/
+ <<WOK
+ colorlinks=true,
+ urlcolor=myblue, % \\href{...}{...} external url
+ filecolor=mygreen, % \\href{...} local file
+ linkcolor=myred, % \\href{...} and \\pageref{...}
+WOK
+ end
+ <<WOK
+\\usepackage{url}
+\\usepackage{alltt}
+\\usepackage{thumbpdf}
+\\usepackage[pdftex,
+ #{color.strip}
+ pdftitle={#@string1},
+% pdftitle={Untitled},
+ pdfauthor={LM-sisu-scribe},
+ pdfsubject={law},
+ pdfkeywords={law},
+ pageanchor=true,
+ plainpages=true,
+ pdfpagelabels=true,
+ pagebackref,
+ bookmarks=true,
+ bookmarksopen=true,
+ pdfmenubar=true,
+ pdfpagemode=UseOutline,
+ pdffitwindow=true,
+ pdfwindowui=true,
+ plainpages=false,
+% pdfusetitle=true,
+% pdfpagelayout=SinglePage,
+% pdfpagelayout=TwoColumnRight,
+% pdfpagelayout=TwoColumnLeft,
+% pdfstartpage=3,
+ pdfstartview=FitH
+]
+{hyperref}
+\\usepackage[usenames]{color}
+\\definecolor{myblack}{rgb}{0,0,0}
+\\definecolor{myred}{rgb}{0.75,0,0}
+\\definecolor{mygreen}{rgb}{0,0.5,0}
+\\definecolor{myblue}{rgb}{0,0,0.5}
+\\definecolor{mywhite}{rgb}{1,1,1}
+WOK
+ end
+ def tex_head_misc
+ <<WOK
+\\usepackage{textcomp}
+\\usepackage[parfill]{parskip}
+\\usepackage[normalem]{ulem}
+\\usepackage{soul}
+\\usepackage{longtable}
+\\usepackage{graphicx}
+\\makeatletter
+\\parindent0pt
+\\usepackage{mathptmx}
+\\usepackage{amssymb}
+% amssymb used for backslash
+WOK
+ end
+ def document_head_with_orientation
+ endnotes=("\\usepackage{endnotes}" if @string =~/endnotes?/)||'' #not implemented see also def endnotes
+ language
+ <<WOK
+#{tex_head_paper}
+#{tex_head_encode}
+#{tex_head_pdftex}
+#{tex_head_misc}
+\\setcounter{secnumdepth}{2}
+\\setcounter{tocdepth}{4}
+\\makeatletter
+#{endnotes}
+\\usepackage[multiple,marginal]{footmisc}
+% \\setlength\\footnotemargin{40pt}
+\\usepackage[para]{manyfoot}
+\\DeclareNewFootnote{A}
+%\\DeclareNewFootnote[para]{A}
+\\newenvironment{ParagraphIndent}[1]%
+{
+\\begin{list}{}{%
+\\setlength\\topsep{0pt}%
+\\addtolength{\\leftmargin}{#1}
+\\setlength\\parsep{0pt plus 1pt}%
+}
+\\item[]
+}
+{\\end{list}}
+\\usepackage{fancyhdr}\n\\lhead{}
+\\renewcommand{\\part}{\\\@startsection
+{part}%
+{1}%
+{-2mm}%
+{-\\baselineskip}%
+{0.5\\baselineskip}%
+{\\bfseries\\large\\scshape}}%
+\\renewcommand{\\section}{\\\@startsection
+{section}%
+{2}%
+{-2mm}%
+{-\\baselineskip}%
+{0.5\\baselineskip}%
+{\\bfseries\\Large\\upshape}}%
+\\renewcommand{\\subsection}{\\\@startsection
+{subsection}%
+{3}%
+{-2mm}%
+{-\\baselineskip}%
+{0.5\\baselineskip}%
+{\\bfseries\\large\\upshape}}%
+\\renewcommand{\\subsubsection}{\\\@startsection
+{subsubsection}%
+{4}%
+{-2mm}%
+{-\\baselineskip}%
+{0.5\\baselineskip}%
+{\\bfseries\\normalsize\\upshape}}%
+\\renewcommand{\\paragraph}{\\\@startsection
+{paragraph}%
+{5}%
+{-2mm}%
+{-\\baselineskip}%
+{0.5\\baselineskip}%
+{\\normalfont\\normalsize\\itshape}}%
+\\renewcommand{\\subparagraph}{\\\@startsection
+{subparagraph}%
+{6}%
+{-2mm}%
+{-\\baselineskip}%
+{0.5\\baselineskip}%
+{\\normalfont\\normalsize\\itshape}}%\n
+\\selectlanguage{#{language}}
+WOK
+ end
+ def a4generic
+ end
+ def para_num
+ paranumber_display=if @md.mod.inspect =~/--no-ocn/; '' #!ocn no object citation numbering
+ else "\\begin{tiny}~\\end{tiny}{\\marginpar{\\begin{tiny}#@string1\\end{tiny}}}" #ocn object citation numbering
+ end
+ if @string !~/^([1-6a-z-]#{@@tilde}\S*|<:.+?>|#{@md.lv1}|#{@md.lv2}|#{@md.lv3}|#{@md.lv4}|#{@md.lv5}|#{@md.lv6})/
+ @string.gsub!(/^\s*(.+)/m,"#{paranumber_display}\\1\n") #watch - in 1-6 is suspect
+ else
+ if (@string =~/^(?:[1-6a-z-]#{@@tilde}\S*|<:.+?>)/) #watch - in 1-6 is suspect
+ @string.gsub!(/^([1-6a-z-]#{@@tilde}\S*|<:.+?>)\s*(.+)/m,"\\1 #{paranumber_display} \\2\n") #watch - in 1-6 is suspect
+ else
+ @string.gsub!(/(#{@md.lv1}.+)$/,"#{@md.lv1} #{paranumber_display}\\1\n")
+ @string.gsub!(/(#{@md.lv2}.+)$/,"#{@md.lv2} #{paranumber_display}\\1\n")
+ @string.gsub!(/(#{@md.lv3}.+)$/,"#{@md.lv3} #{paranumber_display}\\1\n")
+ @string.gsub!(/(#{@md.lv4}.+)$/,"#{@md.lv4} #{paranumber_display}\\1\n")
+ @string.gsub!(/(#{@md.lv5}.+)$/,"#{@md.lv5} #{paranumber_display}\\1\n")
+ @string.gsub!(/(#{@md.lv6}.+)$/,"#{@md.lv6} #{paranumber_display}\\1\n")
+ end
+ end
+ @string
+ end
+ def lev1
+ end
+ def lev2
+ end
+ def lev3
+ end
+ def lev4
+ end
+ def lev5
+ end
+ def lev6
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/update.rb b/lib/sisu/0.52/update.rb
new file mode 100644
index 00000000..811e0946
--- /dev/null
+++ b/lib/sisu/0.52/update.rb
@@ -0,0 +1,123 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: update previous output (with similar output file type formats)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Update_control_flag
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Param
+ class Check
+ def initialize(opt)
+ @opt=opt
+ @md=SiSU_Param::Parameters.new(@opt).get
+ end
+ def read
+ begin
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ out=@env.path.output
+ base_path="#{out}/#{@md.fnb}"
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'Checking previous output',base_path)
+ tell.green_hi_blue unless @md.cmd =~/q/
+ Set_CF.new(@md).set_flags
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ private
+ class Set_CF
+ def initialize(md)
+ @md=md
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ out=@env.path.output
+ @base_path="#{out}/#{@md.fnb}"
+ end
+ def set_flags #-mNhwpoabxXyv
+ flag='-v'
+ if FileTest.file?("#@base_path/#{@md.fn[:doc]}")==true
+ flag=flag + 'a'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:toc]}")==true \
+ or FileTest.file?("#@base_path/#{@md.fn[:doc]}")==true
+ flag=flag + 'h'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:xhtml]}")==true
+ flag=flag + 'b'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:sax]}")==true
+ flag=flag + 'x'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:dom]}")==true
+ flag=flag + 'X'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:odf]}")==true
+ flag=flag + 'o'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:pdf_p]}")==true \
+ or FileTest.file?("#@base_path/#{@md.fn[:pdf_l]}")==true
+ flag=flag + 'p'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:concordance]}")==true
+ flag=flag + 'w'
+ end
+ if FileTest.file?("#@base_path/#{@md.fn[:digest]}")==true
+ flag=flag + 'N'
+ end
+ if FileTest.file?("#@base_path/#{@md.fns}")==true
+ flag=flag + 's'
+ end
+ if FileTest.file?("#@base_path/sisupod.tgz")==true
+ flag=flag + 'S'
+ end
+ puts flag
+ flag
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/urls.rb b/lib/sisu/0.52/urls.rb
new file mode 100644
index 00000000..22f929e8
--- /dev/null
+++ b/lib/sisu/0.52/urls.rb
@@ -0,0 +1,229 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: urls for output files
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_urls
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Screen
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ class Source
+ attr_reader :opt
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ SiSU_urls::Output_urls.new(@opt).songsheet if @opt.fnb #fnb[/.+?\.(?:[_-]?sst|ssm)$/]
+ rescue; SiSU_Errors::Info_error.new($!,$@,nil,@opt.cmd).error
+ ensure
+ end
+ end
+ end
+ class Output_urls
+ include SiSU_Param
+ attr_reader :fns,:fnb,:cmd,:dir,:m_regular,:u
+ def initialize(opt)
+ @opt=opt
+ fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@opt.fns)
+ @cmd=@opt.cmd
+ env=SiSU_Env::Env_call.new(@opt.fns)
+ @fnb=env.fnb
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@opt.fns)
+ @fnl=@env.i18n.lang_filename(fn_set_lang[:c])
+ @fn=SiSU_Env::Env_call.new(@opt.fns).lang(fn_set_lang[:c])
+ @m_regular=/(.+?)\.(?:[_-]?sst|ssm)$/
+ @path=SiSU_Env::Info_env.new(@opt.fns)
+ @webserv_url=@path.url.output_tell
+ @tool=@env.program.text_editor
+ @editor=@env.program.text_editor
+ @browser=@env.program.web_browser
+ @console_browser=@env.program.console_web_browser
+ @pdf_viewer=@env.program.pdf_viewer
+ @odf_viewer=@env.program.odf_viewer
+ source=if @opt.fns =~/\.sst$/; @opt.fns
+ elsif @opt.fns =~/\._sst/; "#@fnb.composite.sst"
+ else 'not recognised file'
+ end
+ @u ||= {
+ 'a (Plain-text (footnotes))'=>@fn[:plain],
+ 'A (Plain-text (footnotes) dos)'=>@fn[:plain],
+ 'b (XHTML)'=>@fn[:xhtml],
+ 'B (Docbook XML)'=>@fn[:docbook],
+ 'D[iu] (DBI import/update postgresql)'=>'dbi psql',
+ 'd[iu] (DBI import/update sqlite)'=>'dbi sqlite',
+ 'e (Plain-text (endnotes))'=>@fn[:plain],
+ 'E (Plain-text (endnotes) dos)'=>@fn[:plain],
+ 'h (HTML segmented)'=>@fn[:toc],
+ 'H (HTML segmented)'=>@fn[:toc],
+ 'h (HTML scroll)'=>@fn[:doc],
+ 'H (HTML scroll)'=>@fn[:doc],
+ 'I (Info file)'=>'info',
+ 'm (Document Abstraction)'=>'dal',
+ 'N (Digests md5/sha256)'=>@fn[:digest],
+ 'o (ODF:ODT - Open Document)'=>@fn[:odf],
+ 'p (PDF landscape)'=>@fn[:pdf_l],
+ 'p (PDF portrait)'=>@fn[:pdf_p],
+ 'P[iu] (DB postgresql import/update)'=>'psql',
+ 's (sisu markup)'=>source,
+ 'S (sisupod)'=>'sisupod.zip',
+ 'x (XML sax type)'=>@fn[:sax],
+ 'X (XML dom type)'=>@fn[:dom],
+ 'y (Manifest, html)'=>@fn[:manifest],
+ 'Y (Sitemap, xml)'=>@fn[:sitemap],
+ 'w (Concordance, html)'=>@fn[:concordance],
+ }.sort {|a,b| a[0].downcase<=>b[0].downcase}
+ end
+ def songsheet
+ begin
+ urls_all if @opt.cmd=~/U/
+ urls_select if @opt.cmd=~/[uvVM]/
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ def urls_maintenance(opt,x,y)
+ if x=~/^([aAbBceEhHmNopwxXy])/ and opt.cmd =~/[aAbBceEhHmNopwxXy]/ and x=~/^[#{opt.cmd}]/
+ m=$1
+ f=y
+ tool=@editor
+ if x =~/^m/ and @opt.cmd=~/m/ and x=~/^[#{opt.cmd}]/ and @opt.cmd =~/M/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@editor #{@env.path.dal}/#{@opt.fns}.meta")
+ tell.maintenance unless @opt.cmd =~/q/
+ end
+ if x=~/^([hHw])/ and @opt.cmd=~/[hHw]/ and x=~/^[#{@opt.cmd}]/
+ f=if x !~/segmented/; "#{y}.html"
+ else "#{y}.index.html"
+ end
+ end
+ if x=~/^p/ and @opt.cmd=~/p/ and x=~/^[#{@opt.cmd}]/
+ tool=@pdf_viewer
+ if opt.cmd =~/M/
+ fns=@opt.fns.gsub(/~/,'-')
+ tell=if y =~/landscape/
+ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@editor #{@env.path.tex}/#{fns}.landscape.tex")
+ else SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@editor #{@env.path.tex}/#{fns}.tex")
+ end
+ tell.maintenance unless @opt.cmd =~/q/
+ end
+ end
+ if x=~/^o/ and @opt.cmd=~/o/ and x=~/^[#{@opt.cmd}]/
+ tool=@odf_viewer
+ end
+ if x !~/^m/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{tool} #{@env.path.output}/#@fnb/#{y}")
+ tell.maintenance unless @opt.cmd =~/q/
+ end
+ @opt.cmd.gsub!(/#{m}/,'')
+ end
+ end
+ def urls_select
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"URLs")
+ tell.grey_title_hi unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#@fnb")
+ tell.flow unless @opt.cmd =~/q/
+ m=/.+\/(\S+)/m
+ @pwd_stub="#@webserv_url"[m,1]
+ @u.each do |x,y|
+ if @opt.fns =~ @m_regular
+ if x=~/^([aAbBceEhHNopsSwxXyY])/ and @opt.cmd=~/[aAbBceEhHNopsSwxXyY]/ and x=~/^[#{@opt.cmd}]/
+ m=$1
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/#@fnb/#{y}")
+ tell.result unless @opt.cmd =~/q/
+ @opt.cmd.gsub!(/#{m}/,'')
+ end
+ if x=~/^I/ and @opt.cmd =~/I/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@path.path.texinfo}; pinfo ./#@fnb.#{y}; cd -")
+ tell.result unless @opt.cmd =~/q/
+ @opt.cmd.gsub!(/I/,'')
+ end
+ if x=~/^D/ and @opt.cmd =~/D/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI psql","#@pwd_stub::#{@opt.fns}",y)
+ tell.result unless @opt.cmd =~/q/
+ @opt.cmd.gsub!(/D[iu]/,'')
+ end
+ if x=~/^d/ and @opt.cmd =~/d/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI sqlite","sqlite #{@env.path.output}/sisu_sqlite.db", "#{y}")
+ tell.result unless @opt.cmd =~/q/
+ @opt.cmd.gsub!(/d[iu]/,'')
+ end
+ if x=~/^P/ and @opt.cmd =~/P/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} Psql","#@pwd_stub::#{@opt.fns}",y)
+ tell.result unless @opt.cmd =~/q/
+ @opt.cmd.gsub!(/P[iu]/,'')
+ end
+ urls_maintenance(@opt,x,y) if @opt.cmd =~/[MV]/
+ end
+ end
+ end
+ def urls_all
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'URLs')
+ tell.grey_title_hi unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#@fnb")
+ tell.flow unless @opt.cmd =~/q/
+ @u.each do |x,y|
+ tell=case x
+ when /^m/
+ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@env.program.text_editor} ~#{y}/#@fnb.#{y}")
+ when /^[aAbBcdeEhHNopswxXy]/
+ tellx=SiSU_Screen::Ansi.new(@opt.cmd,"-p (LaTeX)","#{@env.program.text_editor} ~work/tex_rz/#@fnb.tex") if y=~/landscape/
+ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/#@fnb/#{y}")
+ when /^Y/
+ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/sitemap/#{y}")
+ when /^I/
+ SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@path.path.texinfo}; pinfo ./#@fnb.#{y}; cd -")
+ end
+ tellx.result if tellx
+ tell.result if tell
+ tellx=nil
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/vocab.rb b/lib/sisu/0.52/vocab.rb
new file mode 100644
index 00000000..f0d7a405
--- /dev/null
+++ b/lib/sisu/0.52/vocab.rb
@@ -0,0 +1,113 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: Vocabulary, wordlist (first usd by concordance)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module Wordlists
+ class Lists
+ def initialize
+ end
+ def scanlist
+ /(?:<i>(?:[\w0-9"]+[\s]*){2,7}<\/i>|<b>(?:[\w0-9"]+[\s]*){2,7}<\/b>|http:\/\/\S+)|code\{.+?\}code|<\S+?>|\w+/mi
+ end
+ def lesser
+ /^(?:
+ a|about|all|also|although|am|an[dy]?|approach(?:es|ed)?|are|around|a[st]|availab(?:ility|le)|
+ b|back|be|been|both|but|by|
+ c|can|close|come|could|
+ d|damaged?|did|do|does|doing|done|down|
+ e|each|early|easy|eight|end|even|every(?:thing)?|exist(?:ed|ence|ing|s)?|
+ f|fair|fall|familiar|feature[ds]?|fees?|few|first(?:ly)?|five|fix(?:ed)?|for|form|forecast(?:ed|s|ing)?|four|frequent(?:ed|ly)?|from|frustration|fully?|fundamental|
+ g|generally|get|give|go|got|gone|
+ h|had|half|has|have|height?|held|her|here|him|his|hmm+|hold|how(?:ever)?|html|https?|ftp|
+ i|if|in|include|inclusion|info|initial|initially|inquire|insofar|instead|interest(?:ed|ing|ingly|s)|in(?:to)?|introduc(?:e|tion)|is|it|like(?:ly|wise)?|
+ k|kee[np]|kept|key|kn[eo]w|
+ l|large(?:ly)?|later?|lead|least|le[dt]|less|like(?:ly)?|list(?:ed|s)?|little|long(?:er)?|looks?|lots?|low(?:er)?|
+ m|made|main|major|mak(?:es?|ing)|many|may|maybe|mean|ment|mid|might|minor|miss|more|most(?:ly)?|move[ds]?|movement|moving|much|
+ n|needs?|new|next|nine|no[nrtw]?|
+ o|off?|often|old|on|one|or|once|one|only|open|other(s|wise)?|our|out|outline|output|over|overview|own|
+ p|particularly|partly|pass|past|pay|pdf|perhaps|please|post|potential|practical(?:ly)?|pre|prefer|presum(?:e|ably|s)|problem(atic|s)?|pull|push|put|
+ q|quite|
+ r|ran|range|rather|read|real|reasonable|receive|recent|recogni[sz]e|reduce|refer|reference|relative|regard(?:ing|less|s)?|really|release|relevant|remarks?|remove|repeat|result|return|run|
+ s|say|search|second(?:ly)?|see(?:[kn]|ing|ingly|ms?)?|sen[dt]|separate|self|set|seven|several|she|similar(?:ly)?|simpl(?:e|y)|since|situations?|situated|six|small|so|some(?:thing)?|start(?:ed)?|stop(?:ped)?|such|sure|
+ t|take[ns]?|ten|test|thanks?|that|the|their|then|there|these|they|third(?:ly)?|this|those|though|three|to|today|towards?|tried|try|two|
+ u|under(?:lying|stand|standing)?|unfortunately|up(?:on)|use[dsr]?|
+ w|want|was|well|ways?|what|when|where|which|while|whilst|who(?:se)?|wide(?:ly)?|will|with(?:in|out)|why|wide|width|when|where|which|why|would|
+ z)$/i
+ end
+ def special
+ #/<i>(?:[\w0-9"]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?:
+ /<i>(?:[\w0-9"]+[\s]*){2,7}<\/i>|<b>(?:[\w0-9"]+[\s]*){2,7}<\/b>|https?:\/\/\S+|ftp:\/\/\S+|(?:
+ a|
+ b|
+ c|
+ d|
+ e|
+ f|
+ g|
+ h|
+ i|
+ j|
+ l|
+ m|
+ n|
+ o|
+ p|
+ r|
+ s|
+ t|
+ u|
+ w|
+ h|
+ u|
+ zz|\w+)/i
+ end
+ def greater
+ /^(?:kajfsajflajskdfjz)$/i
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/vocab_lex.rb b/lib/sisu/0.52/vocab_lex.rb
new file mode 100644
index 00000000..41a13034
--- /dev/null
+++ b/lib/sisu/0.52/vocab_lex.rb
@@ -0,0 +1,144 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: Vocabulary, wordlist legal, lex, (first used by concordance)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module Wordlists
+ require SiSU_lib + '/vocab'
+ class Lists
+ def initialize
+ end
+ #/<i>(?:[a-z0-9]+[\b\s]+){2,7}?<\/i>|(?:
+ #/<i>(?:[a-zA-Z0-9]+[\s]*){2,7}?<\/i>|(?:
+ #/<i>(?:[\S]+[\s]*){2,7}<\/i>|http:\/\/\S+|(?: #demands much processing ! cannot use :-(
+ #/<i>(?:[\S]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?:
+ #/<i>(?:\S+\s*){1,7}?<\/i>|(?:
+ #/<i>(?:[\S]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?:
+ def scanlist
+ #/<i>(?:[\w0-9"]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?:
+ /(?:
+ a|advance payments?|actions? for annulment|alternative dispute resolution|anticipatory breach|applicable law|arbitral (?:courts?|institutions?)|arbitral process|arbitral tribunal|arbitration agreement|arbitration awards?|arbitration between states|arbitration clause|arbitration rules?|autonomous contract|autonomy of contract|autonomy of parties|
+ b|bilateral agreement|bill of exchange|bill of lading|binding agreementss?|breach of contract|buyer's obligations?|buyer's rights?|
+ c|carriage of goods(?: by sea)|choice of law|commercial dispute|conformity of (?:contract|documents|goods)|contemporaneous performance|contra proferentem|contract of (?:carriage|insurance|sale)|contract rate|contract(?:ual)? price|cost of (?:carriage|credit|goods|insurance|transport(?:ation)?)|cross examination|currency regulations?|
+ d|date of (?:delivery|payment|shipment)|delivery (?:date|of (?:substitute )?goods)|delocalisation theory|discovery of documents|dispute resolution|dissenting opinions?|distributorship agreements?|due process|
+ e|employment agreements?|enforceability of award|equality of treatment|equity and good concience|equity clauses?|european convention|european (?:economic )?community|european union|examination (?:in chief|of goods)|excess of authority|exclusion (?:of claims|of convention|period)|ex parte|
+ f|factoring convention|federal states?|force majeure|formal requirements?|fundamental breach|future disputes?|
+ g|gap filling|general (?:business conditions|conditions of business|terms)|general principles?(?: of law)?|geneva convention|good faith|grain and feed trade association|governing law|
+ h|harmoni[sz]ation of laws?|
+ i|identification of goods|immediate (?:delivery|payment)|institutional rules|intellectual property(?: rights?)?|interim awards?|international bank for reconstruction and development|international bar association|international centre for the settlement of investment disputes|international chamber of commerce|investment securities|
+ j|judicial proceedings?|
+ l|lack of conformity|language of hearings?|league of nations|legal (?:remed(?:ies|y)|rights?)|letter of credit|lex fori|lex mercatoria|lex loci contractus|limitation period|
+ m|majority awards?|matrimonial disputes?|maximum period|mini trials?|minutes of meetings?|minutes of trials?|model law|monetary payments?|moral obligations?|moveable goods|
+ n|nachfrist notice|national law|new international economic order|notice of non-?conformity|number of|
+ o|obligation to(?: dispatch|give (?:advice|notice)|preserve(?: goods)?)?|
+ p|partial (?:delivery|performance)|party autonomy|passing of risk|payment (?:by install?ments|in advance|guarantees?|of price)|peace palace|period (?:for payment|of delivery|of performance|of time)|permanent court of international justice|personal injury|preliminary meetings?|possessory rights?|preliminary steps?|preservation of goods|private international law|procedural (?:law|orders?)|products? liability|professional institutions?|promissory notes?|public international law|
+ r|reasonable (?:bystander|man|men|person)\b|red book|regional conventions?|registration of awards?|resolution of disputes?|retention of title|revocation of offer|right (?:of|to) (?:delivery?|perform|performance|reject(?:ion)?|refuse|refusal|retain|retention)|
+ s|sea waybill|seat theory|separate opinions|security for credit|separation of powers|seller'?s obligations?|seller's rights?|set off|settlement of disputes?|shipping instructions|sovereign immunity|specific performance|stabilisation clauses?|statement of reasons?|submission agreements?|substantive issues?|substantive law|suspension of performance|
+ t|taking delivery|temporary (?:impediment|injunction)|terms of (?:payment|reference|trade)|third[ -]part(?:y|ies)(?: claims?| rights)?|terms of reference|time (?:limits?|of payment)|trade associations?|trade marks?|trade usages?|transfer of (?:obligations?|rights?)|
+ u|unification of law|uniform (?:interpretation|rules)|use of goods|
+ w|warehouse (?:certificates?|receipt)|
+ x|
+ y|
+ z|
+ conventions|new york convention on recognition and enforcement of arbitral awards|united nations conference on international trade law|
+ cities|new york|los angeles|san fransisco|
+ countries|hong kong|united kingdom|united states(?: of america)?|
+ zz|\w+)/i
+ end
+ def special #the idea is that words like contract, arbitration, buyer, seller should be left intact in scanlist but captured if in a term here, information should not be duplicated in the two lists !
+ #/<i>(?:[\w0-9"]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?:
+ /<i>(?:[\w0-9"]+[\s]*){2,7}<\/i>|<b>(?:[\w0-9"]+[\s]*){2,7}<\/b>|https?:\/\/\S+|ftp:\/\/\S+|(?:
+ a|add hoc(?: arbitration)?|agreement to arbitrate|american arbitration association|avoidance of (?:\S+\s+){0,2}contract|
+ b|
+ c|claim (?:\S+\s+){0,4}(?:damages|restitution)|commencement of arbitration|conclusion of (?:the )?contract|court of arbitration|
+ d|domestic arbitration|
+ e|
+ f|formation of (?:\S+\s+){0,2}contract|fundamental breach (?:\S+\s+){1,2}contract|
+ g|
+ h|
+ i|informal arbitrations?|install?ment contracts?|institutional arbitration|international arbitration|
+ j|joint debtors?|
+ l|language of (?:the )?arbitration|leasing contract|liquidated damages|(?:buyer|seller) loses? the right|
+ m|mitigation of (?:damages?|loss)|
+ n|nuclear damage|
+ o|
+ p|panels? of arbitrators|performance of (?:the)?contract|permanent court of arbitration|place of (?:arbitration|business|payment|performance)|preparation of contract|presiding arbitrators?|
+ r|regulation of international arbitration|removal of arbitrators?|right (?:\S+\s+){0,3}to (?:declare the contract avoided|claim(?: damages)?)|right or claim of (?:a|the) third party|right to rely on|
+ s|statutory arbitrations?|
+ t|termination of contract|trade arbitrations?|
+ u|
+ w|
+ x|
+ y|
+ institutions|american bar association|international montetary fund|london court of international arbitration|united nations|world bank|world intellectual property organi[sz]ation|world trade organi[sz]ation|
+ zz|(?:buyer's|seller's) right|
+ zz|\w+)/i
+ end
+ def greater #line break will not be matched
+ /^(?:
+ a|arbitrat(e|ors?|ions?)|anticipatory|assurance|
+ b|breach|
+ c|care|commercial|consideration|contract|cost|credit|
+ d|damages|duty|effect|enforce[ds]?|evidence|examples?|exchange|exception|exclude[ds]?|exclusion|exclusive|excuse[ds]?|executed?|exempt(?:s|ed|ing)?|excercise[ds]?|expir[ey]|
+ f|fair|fees?|finance|(un)?foreseeab(ility|le)|form|free|freight|frustration|full|fundamental|
+ g|general||global(ly)?|goods|govern(?:ed|ing|s)?|greater|grounds|
+ h|harm|
+ i|impact|impede|impediment|impracticab(ility|le)|inform|information|installments?|insur(ance|e[ds]?)|intent(ion|ional|ionally)?|interest|international(ly)?|interpret(ation)?|
+ l|law(s|yers?)?|limit(ation|ed|ing|s)?|
+ m|mitigat(e|ed|ing|ion)|model|modern|monetary|money|
+ n|noti(ce|fy|fication)|neither|new|no|nor|
+ o|oblig(ations?|ors?)|
+ p|parol|part(?:ial|ies|y)|perform(ance)?|period|postal|preamble|preserve|principles?|procedur(e|al)|proceeds|provide(ed|s)|provisions?|purpose|
+ r|rational|reasonable|recind|rectif(ication|y)|recourse|recovery?|reduction|reliance|relief|rely|remed(ies|y|ying)|reports?|requests?|require(s|ments)?|reservation|review|revis(e|ion|ed)|retain(ed|er)|rights?|rule(s|ed)?|ruling|
+ s|sales?|secretary|section|service|sources?|status|standard|sufficient|
+ t|terminat(e|ed|ion)|tort|trade(er|ing)?|transnational|treaty|
+ u|uniform(ity)?
+ z)$/i
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/webrick.rb b/lib/sisu/0.52/webrick.rb
new file mode 100644
index 00000000..b6f2bd67
--- /dev/null
+++ b/lib/sisu/0.52/webrick.rb
@@ -0,0 +1,163 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: webrick share - note sisu by default does not link with file suffixes, see man pages for options
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah mailto:ralph@amissah.com
+ Ralph Amissah mailto:amissah@gmail.com
+
+=end
+def brick(port,get='')
+ cgidir=if get=~/pwd/; Dir.pwd
+ else '/usr/lib/cgi-bin' # @env.path.cgi
+ end
+ port=SiSU_Env::Info_port.new.webrick
+ begin
+ s=HTTPServer.new(
+ :Port => port,
+ :DocumentRoot => Dir::pwd + '/htdocs',
+ :CGIPathEnv => ENV['PATH']
+ )
+ cgi_dir = File.expand_path(cgidir)
+ @mount.each { |x,y| # mount subdirectories
+ s.mount(x, HTTPServlet::FileHandler, y, true)
+ }
+ s.mount('/cgi-bin', HTTPServlet::FileHandler, cgi_dir, {:FancyIndexing=>true})
+ #### mount subdirectories, true added to permit dir listing
+ trap("INT"){ s.shutdown }
+ s.start
+ rescue; SiSU_Errors::Info_error.new($!,$@,'-W',nil).error #fix
+ ensure
+ end
+end
+begin #%
+ require 'webrick'
+ include WEBrick
+ require 'time'
+ require 'fileutils'
+ include FileUtils
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Screen
+ @cX=SiSU_Screen::Ansi.new('yes').cX
+ @env=SiSU_Env::Info_env.new
+ port=SiSU_Env::Info_port.new
+ @argv=$*
+ @host=@env.url.webrick
+ #@host=ENV['HOSTNAME']
+ host='localhost'
+ @port="#{@argv[0].to_i}"
+ @port="#{port.webrick}" if @port =~ /^0$/
+ @serve=[]
+ Dir.foreach(@env.path.webserv) {|x| @serve << x if x !~/^\./ and FileTest.directory?("#{@env.path.webserv}/#{x}") }
+ @mount=[]
+ @serve.each {|x| @mount << ["/#{x}", "#{@env.path.webserv}/#{x}"]}
+ @pwd=Dir.pwd
+ @week=Time.now.strftime(%{%Yw%W})
+ puts "\n"
+ @mount.each { |x,y|
+ puts " #{@cX.cyan}#{x}#{@cX.off}\t#{@cX.grey}see#{@cX.off} #{@cX.blue}#@host:#@port#{x}/wb.cgi#{@cX.off} #{@cX.ruby}@#{@cX.off} #{@cX.blue}#@host:#@port#{x}/#{@cX.off}"
+ }
+ puts "#{@cX.grey}"
+ #%
+ wb_s2=[]
+ #% writes file wb.cgi to shared directories ...
+ #% wb_top
+ wb_top=%q(#!/usr/bin/env ruby
+ # * arch-tag: webrick info on environment, mounted directories, and contents of pwd
+ require 'time'
+ require 'cgi'
+ require 'fcgi'
+ ls=Dir.entries('./')
+ dir_contents=[]
+ ls.each { |x| dir_contents << "<a href=\"./#{x}/\">#{x}</a><br>" unless x =~/^(\.)+$/ }
+ dir_contents=dir_contents.sort.join(' ')
+ #host=ENV['HOSTNAME']
+ #host=%x{echo $HOSTNAME}
+ )
+ #% wb_s1
+ wb_s1=<<WOK
+
+ page=CGI.new "html3"
+ page.out {
+ page.html {
+ page.head { page.title {"#@host Webrick Report"} } +
+ page.body {
+ page.h1 {"Webrick #@host"} +
+ page.p {"Webrick is Ruby's built in webserver."} +
+ page.center {"Host name: " + page.b{"#@host "} + "(#@host) port: " + page.b{"#@port"}} +
+ page.center {"#{Time.now}"} +
+ page.center {"#{Time.now.strftime(%{%Yw%W})}"} +
+ #page.center { "Center " + page.em{"emphasise "} + page.i{"italicise " } + page.b{"bold "} + page.u{"underline "}} +
+ page.p {''} +
+ page.p {''} +
+ page.p {page.b{"Webrick Served Directories: "}} +
+WOK
+ #% wb_s2 (mounts)
+ @mount.each do |x,y| wb_s2 <<<<WOK
+ page.p {page.b{'<a href="#@host:#@port#{x}/">#{x}</a> '} + '<a href="#@host:#@port#{x}/">#@host:#@port#{x}</a> (mounts: #{y}/) <a href="#@host:#@port#{x}/wb.cgi">info (wb.cgi)</a>'} +
+WOK
+end
+ #% wb_end
+ wb_end=<<WOK
+ page.p {page.b{"Contents of PWD (see URL): "}} +
+ page.p {"#\{dir_contents}"}
+ }
+ }
+ }
+WOK
+ @mount.each { |x,y| #% wb puts
+ puts y
+ filename=File.new("#{y}/wb.cgi",'w')
+ filename << wb_top
+ filename << wb_s1
+ filename << wb_s2
+ filename << wb_end
+ filename.close
+ chmod(0755,"#{y}/wb.cgi &") if FileTest.file?("#{y}/wb.cgi &")
+ }
+ puts " #{@cX.off}"
+ get=@argv.shift if @argv[0] =~/pwd/ #% argv
+ brick(@port,get)
+rescue; SiSU_Errors::Info_error.new($!,$@,'-W',nil).error #fix
+ensure
+end
diff --git a/lib/sisu/0.52/wikispeak.rb b/lib/sisu/0.52/wikispeak.rb
new file mode 100644
index 00000000..a8ae64f1
--- /dev/null
+++ b/lib/sisu/0.52/wikispeak.rb
@@ -0,0 +1,391 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: wiki text generation, stripped wiki output (unix, linefeed)
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Wikispeak
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/plaintext_format'
+ include Format
+ require SiSU_lib + '/shared_txt'
+ pwd=Dir.pwd
+ @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0
+ @@tablefoot=''
+ class Source
+ def initialize(opt)
+ @opt=opt
+ @@dostype='msdos footnotes'
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ tool=if @opt.cmd =~/[MVv]/; "#{@env.program.text_editor} #{path}/#{@md.fnb}/#{@md.fn[:wiki]}"
+ else ''
+ end
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Wikispeak',tool)
+ tell.green_hi_blue unless @opt.cmd =~/q/
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:wiki]}")
+ tell.flow if @opt.cmd =~/[MV]/
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_Wikispeak::Source::Scroll.new(@dal_array,@md).songsheet
+ SiSU_Env::Info_skin.new(@md).select #watch
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ private
+ class Split_text_object <Source
+ require SiSU_lib + '/plaintext_format'
+ include SiSU_Viz
+ include Format
+ @@alt_id_count=0
+ @@dp=nil
+ attr_reader :format,:lev,:text,:ocn,:lev_para_ocn
+ def initialize(para)
+ @para=para
+ @format,@ocn='null','null'
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def lev_segname_para_ocn
+ @text=nil
+ if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,$5
+ elsif /^(([1-6])~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@lev,@text,@ocn=$1,$2,$3,$4
+ elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @format,@text,@ocn=$1,$2,$3,$4
+ elsif /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;[um]\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,"x#{@@alt_id_count}"
+ elsif /^(([1-6])~)\s+(\S.+?)<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @@alt_id_count+=1
+ @format,@lev,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}"
+ end
+ else
+ if /(.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)
+ @text,@ocn=$1,$2
+ end
+ if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$|^$/ #added 2002w06
+ @text=/(.+?)/m.match(@para)[1]
+ end
+ if /^((\d)~(?:~\S+)?)\s+(.+)/m.match(@para)
+ @format,@lev,@text=$1,$2,$3
+ end
+ end
+ format=@format.dup
+ @lev_para_ocn=if @para =~/.+<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ Format::Format_text_object.new(format,@text,@ocn)
+ else
+ Format::Format_text_object.new(format,@text,"<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>")
+ end
+ self
+ end
+ end
+ class Scroll <Source
+ require SiSU_lib + '/shared_txt'
+ include SiSU_text_utils
+ @@endnotes_para=[]
+ @@wiki={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] }
+ @@dp=nil
+ def initialize(data,md)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #m # 2004w18 pb pn removal added
+ @tab="\t"
+ @@dostype='unix footnotes'
+ @br="\n"
+ #@@dostype='msdos footnotes'
+ #@br="\r\n"
+ end
+ def songsheet
+ markup
+ publish
+ #@data.each { |x| puts x.inspect if x =~/\[table/ }
+ end
+ # Used for extraction of endnotes from paragraphs
+ def extract_endnotes(para='')
+ notes=para.scan(/~[{\[]([\d*+]+\s+.+?)\s*<#@dp>[}\]]~/)
+ @n=[]
+ end
+ def wiki_metadata(meta)
+ util=SiSU_text_utils::Wrap.new(meta.text,70,15,1)
+ txt=util.line_wrap
+ @@wiki[:metadata] <<= if meta.type == 'meta'
+ <<WOK
+
+#{@tab}#{meta.el}: #{txt}
+WOK
+ else ''
+ end
+ end
+ def wiki_tail
+ SiSU_Env::Info_skin.new(@md).select
+ vz=SiSU_Env::Get_init.instance.skin
+ generator="Generated by: #{@md.sisu_version[:project]} #{@md.sisu_version[:version]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]})" if @md.sisu_version[:version]
+ lastdone="Last Generated on: #{Time.now}"
+ rubyv="Ruby version: #{@md.ruby_version}"
+ sc=if @md.sc_info
+ "Source file: #{@md.sc_filename}#{@br}Version number: #{@md.sc_number}#{@br}Version date: #{@md.sc_date}#{@br}"
+ else ''
+ end
+ @@wiki[:tail] <<<<WOK
+#@br
+Other versions of this document: #@br
+manifest:
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:manifest]}#@br
+html:
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:toc]}#@br
+pdf:
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:pdf_p]}
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:pdf_l]}#@br
+plaintext (plain text):
+ #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:plain]}#@br
+at:
+ #{vz.url_site}#@br
+
+#{sc}
+* #{generator}
+* #{rubyv}
+* #{lastdone}
+* SiSU #{vz.url_sisu}
+WOK
+ end
+ def wiki_structure(para='',lv='',ocn='',hname='') #% Used to extract the structure of a document
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ extract_endnotes(para)
+ para.gsub!(/~[{\[](?:[\d*+]+)\s+(.+?)<#@dp>[}\]]~/,'<ref>\1</ref>') # endnote marker marked up
+ para.gsub!(/^\d~\S*\s+/,'') # endnote marker marked up
+ para.gsub!(/<\S+?><#@dp:#@dp>/,'') # endnote marker marked up
+ if lv
+ @@wiki[:body] << case lv
+ when 1; '='*2 << para.strip << @br*2
+ when 2..3; '='*2 << para.strip << @br*2
+ when 4; '='*4 << para.strip << @br*2
+ when 5..6; '='*4 << para.strip << @br*2
+ end
+ else @@wiki[:body] << para << @br*2 # main text, contents, body KEEP
+ end
+ end
+ def markup # Used for major markup instructions
+ data=@data
+ dir=SiSU_Env::Info_env.new(@md.fns)
+ @data_mod,@endnotes,@level,@cont,@copen,@wiki_contents_close=Array.new(6){[]}
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @wiki_contents_close[x]='' }
+ wiki_tail
+ table_message='[table omitted, see other document formats]'
+ fix=[]
+ data.each do |para|
+ para.gsub!(/<!Th?¡.+/m,"#@br#{table_message}")
+ para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
+ para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down
+ para.gsub!(/&#169;/,'©') # bullet markup, marked down
+ para.gsub!(/&amp;/,'&') # bullet markup, marked down
+ para.gsub!(/<sup>(.+?)<\/sup>/,'^\1^')
+ para.gsub!(/<sub>(.+?)<\/sub>/,'[\1]')
+ para.gsub!(/<i>(.+?)<\/i>/,"''\\1''")
+ para.gsub!(/<b>(.+?)<\/b>/,"'''\\1'''")
+ para.gsub!(/<u>(.+?)<\/u>/,'_\1_')
+ para.gsub!(/\{(.+?)\}(http:\/\/\S+)/,'[\2 \1]')
+ para.gsub!(/(http:\/\/\S+)/,'[\1]')
+ para.gsub!(/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/,'')
+ para.gsub!(/<:p[bn]>/,'') # remove page breaks
+ para.gsub!(/^\s*<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'') # remove empty lines - check
+ para.gsub!(/<a href=".+?">(.+?)<\/a>/m,'\1')
+ para.gsub!(/<:name#\S+?>/,'') # remove name links
+ para.gsub!(/&nbsp;/,' ') # decide on
+ para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,' [ \1 ]') #"[ #{dir.url.images_local}\/\\1 ]")
+ para.gsub!(/^\{\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"\s*\}\S+/,'[image: "\1"]')
+ wordlist=para.scan(/\S+/)
+ if para =~/^0~(\S+)\s+(.+?)\Z/m # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; wiki_metadata(d_meta)
+ end
+ end
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ if para =~@regx #/.+?<~\d+;\w\d+;\w\d+>.*/ #watch change
+ paranum=para[@regx,3]
+ @p_num=Format::Paragraph_number.new(paranum)
+ end
+ @sto=Split_text_object.new(para).lev_segname_para_ocn
+ ### problem in scroll, it appears tables are getting paragraph numbers
+ m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m and para=~/\S+/
+ para=case @sto.format
+ when /^(1)~(?:(\S+))?/
+ wiki_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body1
+ when /^(2)~(?:(\S+))?/
+ wiki_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body2
+ when /^(3)~(?:(\S+))?/
+ wiki_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)/ # work on see SiSU_text_parts::Split_text_object
+ wiki_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body4
+ when /^(5)~(?:(\S+))?/
+ wiki_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body5
+ when /^(6)~(?:(\S+))?/
+ wiki_structure(para,$1,@sto.ocn,$2)
+ @sto.lev_para_ocn.heading_body6
+ #when /^(i1)$/
+ # #formatMono.gsubBody
+ # #para=@sto[:lev_para_ocn].scrIndent1
+ #when /^(i2)$/
+ # formatMono.gsubBody
+ # para=@sto[:lev_para_ocn].scrIndent2
+ #when /^(center)$/
+ # para.gsub!(/(.+)/,
+ # %{<center>(\\1)</center>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /^(b|bold)$/
+ # para.gsub!(/(.+)/,
+ # %{<b>(\\1)</b>})
+ # para=@sto[:lev_para_ocn].scrPara
+ #when /null/ # see whether u can improve
+ # if (para !~/#{@margin.txt_0}|#{@margin.txt_1}|#{@margin.txt_2}/)
+ # #formatMono.gsubBody
+ # #para=@sto[:lev_para_ocn].scrPara
+ # end
+ else
+ wiki_structure(para,nil,nil,nil) #watch may be problematic
+ para
+ end
+ elsif para =~/#{table_message}/
+ @@wiki[:body] << para << @br
+ elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ elsif para =~/(MetaData)/ and para =~/<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info ####suspect visit
+ #formatMono=MonoSiSU.new('<br /><a name="metadata">MetaData</a>')
+ #para=formatMono.bold_para
+ elsif para.include? 'Owner Details' and para !~/<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ #formatMono=MonoSiSU.new('<br /><a name="owner.details">Owner Details</a>')
+ #@@wiki[:owner_details]=formatMono.bold_para
+ #para=''
+ elsif para =~/(¡|<!Th?)/ #tables !
+ elsif para =~/(.*)<!#!>(.*)/
+ one,two=$1,$2
+ format_text=Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if (para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/) # -endnote
+ case para
+ when /<:i1>/
+ if para =~/.*<:#>.*$/
+ format_text=Format_text_object.new(para,'')
+ para=format_text.scr_indent_one_no_paranum
+ end
+ when /<:i2>/
+ if para =~/.*<:#>.*$/
+ format_text=Format_text_object.new(para,'')
+ para=format_text.scr_indent_one_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ para.gsub!(/<!.+!>/,' ') if para ## Clean Prepared Text
+ para.gsub!(/<:\S+>/,' ') if para ## Clean Prepared Text
+ end
+ end
+ end
+ def publish
+ divider="="
+ content=[]
+ data=@data
+ content << @@wiki[:open]
+ content << @@wiki[:head]
+ content << @@wiki[:body]
+ #content << @@wiki[:metadata]
+ #content << @@wiki[:owner_details] if @md.stmp =~/\w+/ #not used?
+ #content << @@wiki[:tail]
+ Output.new(content.to_s,@md).wiki
+ @@wiki[:head],@@wiki[:body],@@wiki[:tail],@@wiki[:metadata]=[],[],[],[]
+ end
+ end
+ class Output <Source
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(content,md)
+ @content,@md=content,md
+ end
+ def wiki #%wiki output
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_wiki=SiSU_Env::SiSU_file.new(@md,@md.fn[:wiki]).mkfile
+ @sisu=[]
+ @content.each do |para| # this is a hack
+ if para =~/^\S/
+ if para !~/^([*=-]|\.){5}/; filename_wiki.puts para #unix wiki
+ else filename_wiki.puts para #unix wiki
+ end
+ else filename_wiki.puts para # if para =~/^\s/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
diff --git a/lib/sisu/0.52/xhtml.rb b/lib/sisu/0.52/xhtml.rb
new file mode 100644
index 00000000..7bf4e451
--- /dev/null
+++ b/lib/sisu/0.52/xhtml.rb
@@ -0,0 +1,483 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xhtml output logic, flow
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml scroll.xhtml >> index.tidy
+=end
+module SiSU_XHTML #XML_SAX derivative
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/shared_xml'
+ require SiSU_lib + '/xml_format'
+ include SiSU_XML_format
+ include SiSU_XML_munge
+ require SiSU_lib + '/rexml'
+ include SiSU_Rexml
+ @@alt_id_count=0
+ @@tablehead=0
+ @@tablefoot=''
+ @@number_of_cols=0
+ class Source
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:xhtml]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:xhtml]}"
+ elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:xhtml]}"
+ else ''
+ end
+ SiSU_Screen::Ansi.new(@opt.cmd,'invert','XHTML',tool).colorize unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:xhtml]}").flow if @opt.cmd =~/[MV]/
+ my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_XHTML::Source::Songsheet.new(@md,@dal_array,@env).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ #file closed in songsheet
+ end
+ end
+ class Songsheet
+ def initialize(md,data,dir)
+ @md,@data,@env=md,data,dir
+ end
+ def songsheet
+ begin
+ SiSU_XHTML::Source::Scroll.new(@md,@data).songsheet
+ SiSU_XHTML::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:xhtml]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ class Scroll
+ @@xml={ :body=>[],:sisu=>[],:open=>[],:close=>[],:head=>[] }
+ require SiSU_lib + '/shared_txt'
+ require SiSU_lib + '/css'
+ include SiSU_text_utils
+ @@dp=nil
+ def initialize(md=nil,data='')
+ @md,@data=md,data
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @regx=/^(?:(?:<:p[nb]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ @tab="\t"
+ @env=SiSU_Env::Info_env.new(@md.fns)
+ @trans=SiSU_XML_munge::Trans.new(@md)
+ @sys=SiSU_Env::System_call.new
+ end
+ def songsheet
+ pre
+ markup
+ post
+ publish
+ end
+ protected
+ def embedded_endntoes(para='')
+ para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,
+ '<endnote><number>\1</number><note>\2</note></endnote> ')
+ para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ end
+ def extract_endnotes(para='')
+ notes=para.scan(/~[{\[]([\d*+]+\s+.+?)\s*<#@dp>[}\]]~/)
+ notes.each do |e|
+ s=e.to_s
+ util=SiSU_text_utils::Wrap.new(s,70)
+ wrap=util.line_wrap
+ wrap.gsub!(/^(\d+)\s+(.+?)\s*\Z/m, <<WOK
+#{@tab*1}<endnote notenumber="\\1">
+#{@tab*2}\\1. \\2
+#{@tab*1}</endnote>
+WOK
+)
+ wrap.gsub!(/^([*+]\d+)\s+(.+?)\s*\Z/m, <<WOK
+#{@tab*1}<endnote symbol="\\1">
+#{@tab*2}\\1 \\2
+#{@tab*1}</endnote>
+WOK
+)
+ wrap.gsub!(/^([*+]+)\s+(.+?)\s*\Z/m, <<WOK
+#{@tab*1}<endnote symbol="\\1.length">
+#{@tab*2}\\1 \\2
+#{@tab*1}</endnote>
+WOK
+)
+#KEEP alternative presentation of endnotes
+# wrap.gsub!(/^(\d+)\s+(.+?)\s*\Z/m, <<WOK
+##{@tab*1}<p class="endnote" notenumber="\\1">
+##{@tab*2}\\1. \\2
+##{@tab*1}</p>
+#WOK
+#)
+ @endnotes << wrap
+ end
+ end
+ def xml_head(meta)
+ txt=meta.text
+ txt.gsub!(/<br(?: \/)?>/,'')
+ txt.gsub!(/ & /,' and ')
+ el=meta.el.gsub(/\./,'_')
+ el_txt=meta.el.gsub(/\./,' ')
+ @@xml[:head] <<= if meta.type == 'meta'
+ <<WOK
+#{@tab}<meta>#{el_txt.capitalize}:</meta>
+#{@tab}<#{el} class="#{meta.attrib}">
+#{@tab*2}#{txt}
+#{@tab}</#{el}>
+#{@tab}<br />
+WOK
+ else ''
+ end
+ end
+ def xml_structure_ee(para='',lv='',ocn='',hname='') #embedded endnotes
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ embedded_endnotes(para)
+ if para[@regx]
+ paragraph="#{para[@regx,2]}"
+ util=SiSU_text_utils::Wrap.new(paragraph,70)
+ wrapped=util.line_wrap
+ end
+ @@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]
+ @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]
+ @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">#{wrapped}</text>\n} << "\n"
+ else %{#{@tab*1}<text class="norm">#{wrapped}</text>\n} # main text, contents, body KEEP
+ end
+ ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx]
+ end
+ def xml_structure(para='',lv='',ocn='',hname='',type='norm') #extracted endnotes
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ extract_endnotes(para)
+ #puts @endnotes
+ para.gsub!(/~[{\[]([\d*+]+)\s+(?:.+?)\s*<#@dp>[}\]]~/,'<en>\1</en>') #footnote/endnote clean
+ if para[@regx]
+ paragraph="#{para[@regx,2]}"
+ util=SiSU_text_utils::Wrap.new(paragraph,70)
+ wrapped=util.line_wrap
+ end
+ @@xml[:body] << if para[@regx,3]; %{#{@tab*0}<object id="#{para[@regx,3]}">} << "\n"
+ else "#{@tab*0}<object>" << "\n" if para[@regx]
+ end
+ #@@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]
+ #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv
+ @@xml[:body] << %{#{@tab*1}<text class="#{type}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} unless lv # main text, contents, body KEEP
+ @@xml[:body] << %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n" if lv # main text, contents, body KEEP
+ #@@xml[:body] << %{#{@tab*1}<text heading="#{lv}">\n} << "\n" if lv
+ @@xml[:body] << "#{@endnotes}" if @endnotes # main text, endnotes KEEP
+ @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]
+ ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx]
+ @endnotes=[]
+ end
+ def group_structure(para='',ocn='')
+ para.gsub!(/<:group(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*1}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*1}<text class="group">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def poem_structure(para='',ocn='')
+ para.gsub!(/<:verse(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*1}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*1}<text class="verse">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def code_structure(para='',ocn='')
+ para.gsub!(/<:code(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.gsub!(/\s\s/,'&#160;&#160;')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*1}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*1}<text class="code">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def table_structure(table='',ocn='') #tables
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]
+ @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]
+ @endnotes=[]
+ end
+ def markup
+ data=@data
+ @endnotes=[]
+ @rcdc=false
+ @level,@cont,@copen,@xml_contents_close=[],[],[],[]
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @xml_contents_close[x]='' }
+ data.each do |para|
+ para=@trans.markup(para)
+ @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
+ if para =~/^0~(\S+)\s+(.+?)$/ # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; xml_head(d_meta)
+ end
+ end
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/)
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ paranum=para[@regx,3]
+ @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum)
+ end
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para_ocn
+ ### problem in scroll, it appears tables are getting paragraph numbers
+ unless @rcdc
+ m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body1
+ when /^(2)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body2
+ when /^(3)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)/ # work on see SiSU_text_parts::Split_text_object
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body4
+ when /^(5)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body5
+ when /^(6)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body6
+ else
+ matched=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/mi.match(para)
+ stamp,ocn=matched[0],matched[1]
+ if para =~ /<:verse>/
+ para.gsub!(/#{stamp}/,'')
+ poem_structure(para,ocn)
+ elsif para =~ /<:group>/
+ para.gsub!(/#{stamp}/,'')
+ group_structure(para,ocn)
+ elsif para =~ /<:code>/
+ para.gsub!(/#{stamp}/,'')
+ code_structure(para,ocn)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para,ocn)
+ para=table.table_split
+ table_structure(para,ocn)
+ elsif para =~ /<:i1>/
+ xml_structure(para,nil,nil,nil,'indent1')
+ elsif para =~ /<:i2>/
+ xml_structure(para,nil,nil,nil,'indent2')
+ else
+ xml_structure(para,nil,nil,nil)
+ end
+ #@@xml[:body] << "#{@tab*6}<object>" << "\n" if para[@regx]
+ #@@xml[:body] << "#{@tab*7}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]
+ #@@xml[:body] << "#{@tab*7}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # main text, contents, body KEEP
+ #@@xml[:body] << "#{@tab*6}</object>" << "\n" if para[@regx]
+ end
+ elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ elsif para =~/(MetaData)/ and para =~/<~(\d+);[m]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info
+ format_scroll=Format_scroll.new(@md,'<br /><a name="metadata">MetaData</a>')
+ para=format_scroll.bold_para
+ elsif para =~/(Owner Details)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_scroll=Format_scroll.new(@md,'<br /><a name="owner.details">Owner Details</a>')
+ @@xml[:owner_details]=format_scroll.bold_para
+ para=''
+ elsif para =~/(.*)<:#>(.*)/
+ one,two=$1,$2
+ format_text=Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if (para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/) # -endnote
+ para=case para
+ when /<:i1>/
+ if para =~/.*<:#>.*$/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ when /<:i2>/
+ if para =~/.*<:#>.*$/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ else para
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ else #
+ end
+ para.gsub!(/<:\S+?>/,'') if para ## Clean Prepared Text #bugwatch reinstate
+ para.gsub!(/<!.+!>/,'') if para ## Clean Prepared Text #bugwatch reinstate
+ end
+ end
+ 6.downto(4) do |x|
+ y=x - 1; v=x - 3
+ @@xml[:body] << "#{@tab*5}</content>\n#{@tab*y}</contents#{v}>\n" if @level[x] == true
+ end
+ 3.downto(1) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true
+ end
+ #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }
+ end
+ def pre
+ rdf=SiSU_XML_tags::RDF.new(@md)
+ dir=SiSU_Env::Info_env.new
+ @@xml[:head],@@xml[:body]=[],[] #added
+ css=SiSU_Env::CSS_select.new(@md).xhtml
+ encoding=if @sys.locale =~/utf-?8/i #% utf8
+ '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else
+ '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ end
+ @@xml[:open] =<<WOK
+#{encoding}
+<?xml-stylesheet type="text/css" href="../#{@env.path.style}/#{css}"?>
+#{rdf.comment_xml}
+<document>
+WOK
+ @@xml[:head] << %{<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n}
+ @@xml[:body] << "<body>\n"
+ end
+ def post
+ @@xml[:head] << "</head>\n"
+ @@xml[:body] << "</body>\n"
+ @@xml[:close] = "</document>\n"
+ end
+ def publish
+ content=[]
+ data=@data
+ content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
+ content << @@xml[:owner_details] if @md.stmp =~/\w\w/
+ content << @@xml[:tail] << @@xml[:close]
+ Output.new(@md,content.to_s).xml
+ @@xml={} # check whether should be nil
+ end
+ end
+ class Output
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(md,data)
+ @md,@data=md,data
+ end
+ def xml
+ @sisu=[]
+ @data.each do |para|
+ #para.strip!
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+?!>/,'')
+ para="#{para}\n" unless para.empty?
+ @sisu << para
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.scan(/.+/)
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:xhtml]).mkfile
+ @sisu.each {|para| filename_xml.puts para}
+ filename_xml.close
+ end
+ end
+ class Tidy
+ def initialize(md,dir)
+ @md,@env=md,dir
+ @prog=SiSU_Env::Info_program.new #(md.fns) #if md
+ end
+ def xml
+ if @prog.tidy !=false
+ if @md.cmd =~/[VM]/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
+ tell.colorize unless @md.cmd =~/q/
+ tell.grey_open unless @md.cmd =~/q/
+ tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
+ tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:xhtml]}",tidyfile)
+ tidy.well_formed?
+ tell.p_off unless @md.cmd =~/q/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
+<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="UTF-16" standalone="no"?>
diff --git a/lib/sisu/0.52/xml.rb b/lib/sisu/0.52/xml.rb
new file mode 100644
index 00000000..f6a1623f
--- /dev/null
+++ b/lib/sisu/0.52/xml.rb
@@ -0,0 +1,505 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xml output (sax style) processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml sax.xml >> index.tidy
+=end
+module SiSU_XML_SAX
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/shared_xml'
+ require SiSU_lib + '/xml_format'
+ include SiSU_XML_format
+ include SiSU_XML_munge
+ require SiSU_lib + '/rexml'
+ include SiSU_Rexml
+ @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0
+ @@tablefoot=''
+ class Source
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:sax]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:sax]}"
+ elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:sax]}"
+ else ''
+ end
+ SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML SAX',tool).colorize unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:sax]}").flow if @opt.cmd =~/[MV]/
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_XML_SAX::Source::Songsheet.new(@dal_array,@md,@env).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ #file closed in songsheet
+ end
+ end
+ private
+ class Songsheet
+ def initialize(data,md,dir)
+ @data,@md,@env=data,md,dir
+ end
+ def songsheet
+ begin
+ SiSU_XML_SAX::Source::Scroll.new(@data,@md).songsheet
+ SiSU_XML_SAX::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:sax]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ class Scroll
+ require SiSU_lib + '/shared_txt'
+ require SiSU_lib + '/css'
+ include SiSU_text_utils
+ @@dp,@@env=nil,nil
+ @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] }
+ def initialize(data='',md=nil)
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ @tab="\t"
+ @env=SiSU_Env::Info_env.new(@md.fns) if @md
+ @trans=SiSU_XML_munge::Trans.new(@md)
+ @sys=SiSU_Env::System_call.new
+ end
+ def songsheet
+ pre
+ markup
+ post
+ publish
+ end
+ protected
+ def embedded_endntoes(para='')
+ para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,
+ '<endnote><number>\1</number><note>\2</note></endnote> ')
+ para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ end
+ def extract_endnotes(para='')
+ notes=para.scan(/~[{\[]([\d*+]+\s+.+?)\s*<#@dp>[}\]]~/)
+ notes.each do |e|
+ s=e.to_s
+ util=SiSU_text_utils::Wrap.new(s,70)
+ wrap=util.line_wrap
+ wrap.gsub!(/^(\d+)\s+(.+?)\s*\Z/m, <<WOK
+#{@tab*1}<endnote notenumber="\\1">
+#{@tab*2}<number>\\1</number>
+#{@tab*2}<note>
+#{@tab*3}\\2
+#{@tab*2}</note>
+#{@tab*1}</endnote>
+WOK
+)
+ wrap.gsub!(/^([*+]\d+)\s+(.+?)\s*\Z/m, <<WOK
+#{@tab*1}<endnote symbol="\\1">
+#{@tab*2}<symbol>\\1</symbol>
+#{@tab*2}<note>
+#{@tab*3}\\2
+#{@tab*2}</note>
+#{@tab*1}</endnote>
+WOK
+)
+ wrap.gsub!(/^([*+]+)\s+(.+?)\s*\Z/m, <<WOK
+#{@tab*1}<endnote symbol="\\1.length">
+#{@tab*2}<symbol>\\1</symbol>
+#{@tab*2}<note>
+#{@tab*3}\\2
+#{@tab*2}</note>
+#{@tab*1}</endnote>
+WOK
+)
+ @endnotes << wrap
+ end
+ end
+ def xml_head(meta)
+ txt=meta.text
+ txt.gsub!(/<br(?: \/)?>/,'')
+ txt.gsub!(/ & /,' and ')
+ el=meta.el.gsub(/\./,'_')
+ el_txt=meta.el.gsub(/\./,' ')
+ @@xml[:head] <<= if meta.type == 'meta'
+ <<WOK
+#{@tab}<meta>#{el_txt.capitalize}:</meta>
+#{@tab}<#{el} class="#{meta.attrib}">
+#{@tab*2}#{txt}
+#{@tab}</#{el}>
+#{@tab}<br />
+WOK
+ else ''
+ end
+ end
+ def xml_sc(md='')
+ sc=if @md.sc_info
+ <<WOK
+ <source_control>
+ <meta>filename:</meta>
+ <sc class="sourcefile">
+ #{@md.sc_filename}
+ </sc><br />
+ <meta>version number:</meta>
+ <sc class="number">
+ #{@md.sc_number}
+ </sc><br />
+ <meta>version date:</meta>
+ <sc class="date">
+ #{@md.sc_date}
+ </sc><br />
+ </source_control>
+WOK
+ else ''
+ end
+ @@xml[:sc]=sc #<<<<WOK
+#WOK
+ end
+ def xml_structure_ee(para='',lv='',ocn='',hname='') #embedded endnotes
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ embedded_endnotes(para)
+ if para[@regx]
+ paragraph="#{para[@regx,2]}"
+ util=SiSU_text_utils::Wrap.new(paragraph,70)
+ wrapped=util.line_wrap
+ end
+ @@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]
+ @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]
+ @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">#{wrapped}</text>\n} << "\n"
+ else %{#{@tab*1}<text class="norm">#{wrapped}</text>\n} # main text, contents, body KEEP
+ end
+ #@@xml[:body] << "#{@tab*1}<text>#{wrapped}</text>\n" # main text, contents, body KEEP
+ ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx]
+ end
+ def xml_structure(para='',lv='',ocn='',hname='',type='norm') #extracted endnotes
+ lv=lv.to_i
+ n=lv - 1
+ n3=lv + 2
+ lv=nil if lv == 0
+ extract_endnotes(para)
+ #puts @endnotes
+ para.gsub!(/~[{\[]([\d*+]+)\s+(?:.+?)\s*<#@dp>[}\]]~/,'<en>\1</en>') #footnote/endnote clean
+ if para[@regx]
+ paragraph="#{para[@regx,2]}"
+ util=SiSU_text_utils::Wrap.new(paragraph,70)
+ wrapped=util.line_wrap
+ end
+ @@xml[:body] << if para[@regx,3]; %{#{@tab*0}<object id="#{para[@regx,3]}">} << "\n"
+ else "#{@tab*0}<object>" << "\n" if para[@regx]
+ end
+ #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv
+ @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]
+ @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"
+ else %{#{@tab*1}<text class="#{type}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} # main text, contents, body KEEP
+ end
+ @@xml[:body] << "#{@endnotes}" if @endnotes # main text, endnotes KEEP
+ ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx]
+ @endnotes=[]
+ end
+ def group_structure(para='',ocn='')
+ para.gsub!(/<:group(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*1}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*1}<text class="group">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def poem_structure(para='',ocn='')
+ para.gsub!(/<:verse(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*1}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*1}<text class="verse">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def code_structure(para='',ocn='')
+ para.gsub!(/<:code(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.gsub!(/\s\s/,'&#160;&#160;')
+ para.strip!
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*1}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*1}<text class="code">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*2}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*1}</text>\n}
+ @@xml[:body] << "#{@tab*0}</object>" << "\n"
+ end
+ def table_structure(table='',ocn='') #tables
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]
+ @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]
+ @endnotes=[]
+ end
+ def markup
+ data=@data
+ xml_sc(@md)
+ @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]
+ @rcdc=false
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @xml_contents_close[x]='' }
+ data.each do |para|
+ para=@trans.markup(para)
+ @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
+ if para =~/^0~(\S+)\s+(.+?)$/ # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; xml_head(d_meta)
+ end
+ end
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/)
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ paranum=para[@regx,3]
+ @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum)
+ end
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para_ocn
+ ### problem in scroll, it appears tables are getting paragraph numbers
+ unless @rcdc
+ m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body1
+ when /^(2)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body2
+ when /^(3)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body3
+ when /^(4)~(\S+)/ # work on see Split_text_object
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body4
+ when /^(5)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body5
+ when /^(6)~(?:(\S+))?/
+ xml_structure(para,$1,@sto.ocn,$2)
+ para=@sto.lev_para_ocn.heading_body6
+ else
+ matched=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/mi.match(para)
+ stamp,ocn=matched[0],matched[1]
+ if para =~ /<:verse>/
+ para.gsub!(/#{stamp}/,'')
+ poem_structure(para,ocn)
+ elsif para =~ /<:group>/
+ para.gsub!(/#{stamp}/,'')
+ group_structure(para,ocn)
+ elsif para =~ /<:code>/
+ para.gsub!(/#{stamp}/,'')
+ code_structure(para,ocn)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para,ocn)
+ para=table.table_split
+ table_structure(para)
+ elsif para =~ /<:i1>/
+ xml_structure(para,nil,nil,nil,'indent1')
+ elsif para =~ /<:i2>/
+ xml_structure(para,nil,nil,nil,'indent2')
+ else xml_structure(para,nil,nil,nil)
+ end
+ #@@xml[:body] << "#{@tab*6}<object>" << "\n" if para[@regx]
+ #@@xml[:body] << "#{@tab*7}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]
+ #@@xml[:body] << "#{@tab*7}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # main text, contents, body KEEP
+ #@@xml[:body] << "#{@tab*6}</object>" << "\n" if para[@regx]
+ end
+ elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ #format_scroll=MonoSiSU.new('<br /><a name="notes">Note</a>')
+ #para=format_scroll.boldPara
+ elsif para =~/(MetaData)/ and para =~/<~(\d+);[m]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info
+ format_scroll=Format_scroll.new(@md,'<br /><a name="metadata">MetaData</a>')
+ para=format_scroll.bold_para
+ elsif para =~/(Owner Details)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_scroll=Format_scroll.new(@md,'<br /><a name="owner.details">Owner Details</a>')
+ @@xml[:owner_details]=format_scroll.bold_para
+ para=''
+ elsif para =~/(.*)<!#!>(.*)/
+ one,two=$1,$2
+ format_text=Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ if para =~/.*<:#>.*$/
+ para=case para
+ when /<:i1>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ when /<:i2>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ else #
+ end
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+!>/,'') ## Clean Prepared Text #bugwatch reinstate
+ end
+ end
+ 6.downto(4) do |x|
+ y=x - 1; v=x - 3
+ @@xml[:body] << "#{@tab*5}</content>\n#{@tab*y}</contents#{v}>\n" if @level[x] == true
+ end
+ 3.downto(1) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true
+ end
+ #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }
+ end
+ def pre
+ rdf=SiSU_XML_tags::RDF.new(@md)
+ dir=SiSU_Env::Info_env.new
+ @@xml[:head],@@xml[:body]=[],[] #added
+ css=SiSU_Env::CSS_select.new(@md).xml_sax
+ encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ end
+ @@xml[:open] =<<WOK
+#{encoding}
+<?xml-stylesheet type="text/css" href="../#{dir.path.style}/#{css}"?>
+#{rdf.comment_xml}
+<document>
+WOK
+ @@xml[:head] << "<head>\n"
+ @@xml[:body] << "<body>\n"
+ end
+ def post
+ @@xml[:head] << @@xml[:sc]
+ @@xml[:head] << "</head>\n"
+ @@xml[:body] << "</body>\n"
+ @@xml[:close] = "</document>\n"
+ end
+ def publish
+ content=[]
+ data=@data
+ content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
+ content << @@xml[:owner_details] if @md.stmp =~/\w\w/
+ content << @@xml[:tail] << @@xml[:close]
+ Output.new(content.to_s,@md).xml
+ @@xml={} # check whether should be nil
+ end
+ end
+ class Output
+ include SiSU_Param
+ include SiSU_Env
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def xml
+ @sisu=[]
+ @data.each do |para|
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+?!>/,'')
+ para="#{para}\n" unless para.empty?
+ @sisu << para
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.scan(/.+/)
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:sax]).mkfile
+ @sisu.each {|para| filename_xml.puts para}
+ filename_xml.close
+ end
+ end
+ class Tidy
+ def initialize(md,dir)
+ @md,@env=md,dir
+ @prog=SiSU_Env::Info_program.new
+ end
+ def xml
+ if @prog.tidy !=false #note values can be other than true
+ if @md.cmd =~/[VM]/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
+ tell.colorize unless @md.cmd =~/q/
+ tell.grey_open unless @md.cmd =~/q/
+ tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
+ tidy =SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:sax]}",tidyfile)
+ tidy.well_formed?
+ tell.p_off unless @md.cmd =~/q/
+ end
+ end
+ end
+ def xmlexp #possibly use to decide whether to call rexml
+ end
+ end
+ end
+end
+__END__
+<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="UTF-16" standalone="no"?>
diff --git a/lib/sisu/0.52/xml_dom.rb b/lib/sisu/0.52/xml_dom.rb
new file mode 100644
index 00000000..f600a15d
--- /dev/null
+++ b/lib/sisu/0.52/xml_dom.rb
@@ -0,0 +1,537 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xml (dom style) output processing
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml dom.xml >> index.tidy
+=end
+module SiSU_XML_DOM
+ require SiSU_lib + '/defaults'
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ require SiSU_lib + '/dal'
+ require SiSU_lib + '/shared_xml'
+ require SiSU_lib + '/xml_format'
+ include SiSU_XML_format
+ include SiSU_XML_munge
+ require SiSU_lib + '/rexml'
+ include SiSU_Rexml
+ @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0
+ @@tablefoot=''
+ class Source
+ def initialize(opt)
+ @opt=opt
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ path=@env.path.output_tell
+ loc=@env.url.output_tell
+ tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:dom]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:dom]}"
+ elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:dom]}"
+ else ''
+ end
+ SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',tool).colorize unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:dom]}").flow if @opt.cmd =~/[MV]/
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_XML_DOM::Source::Songsheet.new(@dal_array,@md,@env).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ #file closed in songsheet
+ end
+ end
+ private
+ class Songsheet
+ def initialize(data,md='',dir='')
+ @data,@md,@env=data,md,dir
+ end
+ def songsheet
+ begin
+ SiSU_XML_DOM::Source::Scroll.new(@data,@md).songsheet
+ SiSU_XML_DOM::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/ # test wellformedness, comment out when not in use
+ SiSU_Rexml::Rexml.new(@md,@md.fn[:dom]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
+ rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
+ ensure
+ end
+ end
+ end
+ class Scroll
+ @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=>[] }
+ require SiSU_lib + '/shared_txt'
+ include SiSU_text_utils
+ @@dp=nil
+ def initialize(data='',md='')
+ @data,@md=data,md
+ @vz=SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #
+ @tab="\t"
+ @trans=SiSU_XML_munge::Trans.new(@md)
+ @sys=SiSU_Env::System_call.new
+ end
+ def songsheet
+ pre
+ markup
+ post
+ publish
+ end
+ protected
+ def xml_markup(para='')
+ para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,
+ '<endnote><number>\1</number><note>\2</note></endnote> ')
+ para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,
+ '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')
+ end
+ def xml_head(meta)
+ txt=meta.text
+ txt.gsub!(/<br(?: \/)?>/,'')
+ txt.gsub!(/ & /,' and ')
+ el=meta.el.gsub(/\./,'_')
+ el_txt=meta.el.gsub(/\./,' ')
+ @@xml[:head] <<= if meta.type == 'meta'
+ <<WOK
+#{@tab}<header>
+#{@tab*2}<meta>#{el_txt.capitalize}:</meta>
+#{@tab*2}<#{el}>
+#{@tab*3}#{txt}
+#{@tab*2}</#{el}>
+#{@tab}</header>
+WOK
+ else ''
+ end
+ end
+ def xml_sc(md='')
+ sc=if @md.sc_info
+ <<WOK
+ <source_control>
+ <meta>filename:</meta>
+ <sc class="sourcefile">
+ #{@md.sc_filename}
+ </sc><br />
+ <meta>version number:</meta>
+ <sc class="number">
+ #{@md.sc_number}
+ </sc><br />
+ <meta>version date:</meta>
+ <sc class="date">
+ #{@md.sc_date}
+ </sc><br />
+ </source_control>
+WOK
+ else ''
+ end
+ @@xml[:sc]=sc #<<<<WOK
+#WOK
+ end
+ def xml_element(lv='',ocn='',para='',hname='',tag='',xml_element='',xml_content='')
+ lv=lv.to_i
+ n=lv - 1
+ n1=lv
+ n2=lv + 1
+ n3=lv + 2
+ v=lv - 3
+ tag=''
+ tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname #!=nil
+ @@xml[:body] <<<<WOK
+#{@tab*n}#{xml_element}
+#{@tab*n1}<heading>
+#{@tab*n2}<object id="#{ocn}">
+#{@tab*n3}<ocn>#{ocn}</ocn>#{tag}
+#{@tab*n3}<text>#{para[@regx,2]}</text>
+#{@tab*n2}</object>
+#{@tab*n1}</heading>#{xml_content}
+WOK
+ if lv == 4
+ @copen[1]=true
+ @copen[2]=@copen[3]=false
+ elsif lv == 5
+ @copen[2]=true
+ @copen[3]=false
+ elsif lv == 6
+ @copen[3]=true
+ end
+ end
+ def xml_structure(lv='',ocn='',para='',hname='' )
+ lv=lv.to_i
+ n=lv - 1
+ n1=lv
+ n2=lv + 1
+ n3=lv + 2
+ v=lv - 3
+ tag=''
+ tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname !=nil
+ #if para[@regx]
+ # paragraph="#{para[@regx,2]}"
+ # util=SiSU_text_utils::Paragraph.new(paragraph,70)
+ # wrapped=util.line_wrap
+ #end
+ case lv
+ when 1..3
+ xml_element="<heading#{lv}>"
+ 3.downto(lv) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[1] or @cont[2] or @cont[3]
+ #@@xml[:body] << "#{@tab*5}</content>\n" if @cont[1] == true or @cont[2] == true or @cont[3] == true
+ @cont[1]=false if @cont[1]
+ @cont[2]=false if @cont[2]
+ @cont[3]=false if @cont[3]
+ ####### attempt to close contents
+ if @copen[3] # 6{
+ [3,2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ @copen[1]=@copen[2]=@copen[3]=false
+ elsif @copen[2] # 5{
+ [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ @copen[1]=@copen[2]=@copen[3]=false
+ elsif @copen[1] # 4{
+ [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ @copen[1]=@copen[2]=@copen[3]=false
+ end
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x]
+ @level[x]=false
+ end
+ when 4..6
+ 6.downto(lv) do |x|
+ y=x - 1
+ if @level[x] == true
+ u=x - 3;
+ @xml_contents_close[x]=''
+ end
+ end
+ cv=lv - 3
+ xml_element="<contents#{cv}>"
+ xml_content="\n#{@tab*5}<content>"
+ case lv
+ when 4
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[1]
+ if @copen[3] == true # 6~
+ [3,2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ elsif @copen[2] == true # 5~
+ [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ elsif @copen[1] == true # 4~
+ [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ end
+ @cont[1]=true
+ when 5
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[2] or @cont[1]
+ if @copen[3] == true #6~
+ [3,2].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ elsif @copen[2] == true #5~
+ [2].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
+ end
+ @cont[2]=true
+ when 6
+ @@xml[:body] << "#{@tab*5}</content>\n" if @cont[3] or @cont[2] or @cont[1]
+ [3].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" } if @copen[3] #6{
+ @cont[3]=true
+ end
+ end
+ xml_element(lv,ocn,para,hname,tag,xml_element,xml_content)
+ @level[lv]=true
+ ((lv+1)..6).each { |x| @level[x]=false }
+ end
+ def group_structure(para='',ocn='')
+ para.gsub!(/<:group(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.strip!
+ @@xml[:body] << %{#{@tab*6}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*7}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*7}<text class="group">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</text>\n}
+ @@xml[:body] << "#{@tab*6}</object>" << "\n"
+ end
+ def poem_structure(para='',ocn='')
+ para.gsub!(/<:verse(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.strip!
+ @@xml[:body] << %{#{@tab*6}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*7}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*7}<text class="verse">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</text>\n}
+ @@xml[:body] << "#{@tab*6}</object>" << "\n"
+ end
+ def code_structure(para='',ocn='')
+ para.gsub!(/<:code(?:-end)?>/,'')
+ para=@trans.markup_group(para)
+ para.gsub!(/\s\s/,'&#160;&#160;')
+ para.strip!
+ @@xml[:body] << %{#{@tab*6}<object id="#{ocn}">} << "\n"
+ @@xml[:body] << %{#{@tab*7}<ocn>#{ocn}</ocn>} << "\n"
+ @@xml[:body] << %{#{@tab*7}<text class="code">#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
+ @@xml[:body] << %{#{@tab*7}</text>\n}
+ @@xml[:body] << "#{@tab*6}</object>" << "\n"
+ end
+ def table_structure(table='',ocn='') #tables
+ @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]
+ @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]
+ @endnotes=[]
+ end
+ def markup
+ data=@data
+ xml_sc(@md)
+ @rcdc=false
+ @level,@cont,@copen,@xml_contents_close=[],[],[],[]
+ (0..6).each { |x| @cont[x]=@level[x]=false }
+ (4..6).each { |x| @xml_contents_close[x]='' }
+ data.each do |para|
+ para=@trans.markup(para)
+ @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
+ if para =~/^0~(\S+)\s+(.+?)$/ # for headers
+ d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
+ if d_meta; xml_head(d_meta)
+ end
+ end
+ @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/)
+ if para !~/(^0~|<ENDNOTES>|<EOF>)/
+ if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ paranum=para[@regx,3]
+ @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum)
+ end
+ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para_ocn
+ ### problem in scroll, it appears tables are getting paragraph numbers
+ unless @rcdc
+ m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ if para =~m
+ format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
+ case @sto.format
+ when /^(1)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body1 #if para =~m
+ when /^(2)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body2 #if para =~m
+ when /^(3)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body3 #if para =~m
+ when /^(4)~(\S+)/ # work on see SiSU_text_parts::Split_text_object
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body4 #if para =~m
+ when /^(5)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body5 #if para =~m
+ when /^(6)~(?:(\S+))?/
+ xml_markup(para)
+ xml_structure($1,@sto.ocn,para,$2)
+ para=@sto.lev_para_ocn.heading_body6 #if para =~m
+ else
+ matched=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/mi.match(para)
+ stamp,ocn=matched[0],matched[1]
+ if para =~ /<:verse>/
+ para.gsub!(/#{stamp}/,'')
+ poem_structure(para,ocn)
+ elsif para =~ /<:group>/
+ para.gsub!(/#{stamp}/,'')
+ group_structure(para,ocn)
+ elsif para =~ /<:code>/
+ para.gsub!(/#{stamp}/,'')
+ code_structure(para,ocn)
+ elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
+ table=SiSU_Tables::Table_xml.new(para,ocn)
+ para=table.table_split
+ @@xml[:body] << table_structure(para,ocn)
+ else #xml_structure(para, nil, nil, nil)
+ type=case para
+ when /^\s*<:i1>/; 'indent1'
+ when /^\s*<:i2>/; 'indent2'
+ else 'norm'
+ end
+ xml_markup(para)
+ @@xml[:body] << %{#{@tab*6}<object id="#{para[@regx,3]}">} << "\n" if para[@regx] and para[@regx,3]
+ @@xml[:body] << "#{@tab*7}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]
+ @@xml[:body] << %{#{@tab*7}<text class="#{type}">#{para[@regx,2]}</text>\n} if para[@regx,2] # main text, contents, body KEEP
+ @@xml[:body] << "#{@tab*6}</object>" << "\n" if para[@regx]
+ end
+ end
+ elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ #format_scroll=MonoSiSU.new('<br /><a name="notes">Note</a>')
+ #para=format_scroll.boldPara
+ elsif para =~/(MetaData)/ and para =~/<~\d+;[m]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info
+ format_scroll=Format_scroll.new(@md,'<br /><a name="metadata">MetaData</a>')
+ para=format_scroll.bold_para
+ elsif para =~/(Owner Details)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
+ format_scroll=Format_scroll.new(@md,'<br /><a name="owner.details">Owner Details</a>')
+ @@xml[:owner_details]=format_scroll.bold_para
+ para=''
+ elsif para =~/(.*)<:#>(.*)/
+ one,two=$1,$2
+ format_text=Format_text_object.new(one,two)
+ para=format_text.seg_no_paranum
+ end
+ para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ if para =~/.*<:#>.*$/
+ para=case para
+ when /<:i1>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ when /<:i2>/
+ format_text=Format_text_object.new(para,'')
+ format_text.scr_inden_ocn_e_no_paranum
+ end
+ end
+ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
+ # i don't get the condition for no paranum
+ end
+ if para =~/<:center>/
+ one,two=/(.*)<:center>(.*)/.match(para)[1,2]
+ format_text=Format_text_object.new(one,two)
+ para=format_text.center
+ end
+ else #
+ end
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+!>/,' ') ## Clean Prepared Text
+ end
+ end
+ @content_flag=true
+ 6.downto(4) do |x|
+ y=x - 1; v=x - 3
+ if @level[x] == true #2004w36 bug fix? watch/test previous logic broke on free.for.all @coontent_flag introduced
+ if @content_flag==true
+ @@xml[:body] << "#{@tab*5}</content>\n#{@tab*y}</contents#{v}>\n"
+ @content_flag=false
+ else
+ @@xml[:body] << "\n#{@tab*y}</contents#{v}>\n"
+ end
+ end
+ end
+ 3.downto(1) do |x|
+ y=x - 1
+ @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true
+ end
+ #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }
+ end
+ def pre
+ rdf=SiSU_XML_tags::RDF.new(@md)
+ dir=SiSU_Env::Info_env.new
+ css=SiSU_Env::CSS_select.new(@md).xml_dom
+ encoding=if @sys.locale =~/utf-?8/i; '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
+ else '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'
+ end
+ @@xml[:open] =<<WOK
+#{encoding}
+<?xml-stylesheet type="text/css" href="../#{dir.path.style}/#{css}"?>
+#{rdf.comment_xml}
+<document>
+WOK
+ @@xml[:head] << "<head>\n"
+ @@xml[:body] << "<body>\n"
+ end
+ def post
+ @@xml[:head] << @@xml[:sc]
+ @@xml[:head] << "</head>\n"
+ @@xml[:body] << "</body>\n"
+ @@xml[:close] = "</document>\n"
+ end
+ def publish
+ content=[]
+ data=@data
+ content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
+ content << @@xml[:owner_details] if @md.stmp =~/\w\w/
+ content << @@xml[:tail] << @@xml[:close]
+ Output.new(content.to_s,@md).xml
+ @@xml[:head],@@xml[:body],@@xml[:tail]=[],[],[] # check whether should be nil
+ end
+ end
+ class Output
+ include SiSU_Param
+ def initialize(data,md)
+ @data,@md=data,md
+ end
+ def xml
+ @sisu=[]
+ @data.each do |para| #p
+ #para.strip!
+ para.gsub!(/<:\S+?>/,'')
+ para.gsub!(/<!.+?!>/,'')
+ para="#{para}\n" unless para.empty?
+ @sisu << para
+ end
+ new_file_data=@sisu.to_s
+ @sisu=new_file_data.scan(/.+/)
+ #@sisu.compact!
+ SiSU_Env::SiSU_file.new(@md).mkdir
+ filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:dom]).mkfile
+ @sisu.each {|para| filename_xml.puts para}
+ filename_xml.close
+ end
+ end
+ class Tidy
+ def initialize(md,dir)
+ @md,@env=md,dir
+ @prog=SiSU_Env::Info_program.new #(md.fns) #if md
+ end
+ def xml
+ if @prog.tidy !=false
+ if @md.cmd =~/[VM]/
+ tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
+ tell.colorize unless @md.cmd =~/q/
+ tell.grey_open unless @md.cmd =~/q/
+ tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
+ tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:dom]}",tidyfile)
+ tidy.well_formed?
+ tell.p_off unless @md.cmd =~/q/
+ end
+ end
+ end
+ end
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/xml_format.rb b/lib/sisu/0.52/xml_format.rb
new file mode 100644
index 00000000..111e2bee
--- /dev/null
+++ b/lib/sisu/0.52/xml_format.rb
@@ -0,0 +1,339 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: xml template
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+
+ * Notes: tidy -xml index.xml >> index.tidy
+=end
+module SiSU_XML_format
+ require SiSU_lib + '/param'
+ include SiSU_Param
+ include SiSU_Viz
+ class Paragraph_number
+ def initialize(md,paranum)
+ @md=md
+ @paranum=/(\d+)/m.match(paranum)[1]
+ end
+ def display
+ p_num_display=@paranum.gsub(/(\d+)/,
+ '<font size="1" color="#777777">' +
+ '&nbsp;&nbsp;\1</font>')
+ p_num_display
+ end
+ def name
+ p_num_name=@paranum.gsub(/(\d+)/,'<a name="\1"></a>')
+ p_num_name
+ end
+ def goto
+ p_num_goto=@paranum.gsub(/(\d+)/,'<a href="#\1">')
+ p_num_goto
+ end
+ end
+ class Head_information
+ def initialize #dc rdf
+ @dc_title=@dc_subtitle=@dc_creator=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@dc_relation=@dc_coverage=@dc_rights=@copyright=@owner=@keywords=''
+ @sfx,@pdf,@md=@@md.sfx,@@md.pdf,@@md
+ # DublinCore 1 - title
+ @rdfurl=%{ rdf:about="http://www.jus.uio.no/lm/toc"\n}
+ if @md.dc_title
+ @dc_title=%{<meta name="dc.title" content="#{seg_name}#{@md.dc_title}" />\n}
+ #if @md.subtitle
+ # #@rdf_title=%{ dc.title="#{seg_name}#{@md.title} - #{@md.subtitle}"\n}
+ # @dc_title=%{<meta name="dc.title" content="#{seg_name}#{@md.title} - #{@md.subtitle}" />\n}
+ #else
+ # #@rdf_title=%{ dc.title="#{seg_name}#{@md.title}"\n}
+ # @dc_title=%{<meta name="dc.title" content="#{seg_name}#{@md.dc_title}" />\n}
+ #end
+ end
+ if @md.dc_creator # DublinCore 2 - creator/author (author)
+ @rdf_creator=%{ dc.creator="#{@md.dc_creator}"\n}
+ @dc_creator=%{<meta name="dc.creator" content="#{@md.dc_creator}" />\n}
+ end
+ if @md.dc_subject # DublinCore 3 - subject (us library of congress, eric or udc, or schema???)
+ @rdf_subject=%{ dc.subject="#{@md.dc_subject}"\n}
+ @dc_subject=%{<meta name="dc.subject" content="#{@md.dc_subject}" />\n}
+ end
+ if @md.dc_description # DublinCore 4 - description
+ @rdf_description=%{ dc.description="#{@md.description}"\n}
+ @dc_description=%{<meta name="dc.dc_description" content="#{@md.description}" />\n}
+ end
+ if @md.dc_publisher # DublinCore 5 - publisher (current copy published by)
+ @rdf_publisher=%{ dc.publisher="#{@md.dc_publisher}"\n}
+ @dc_publisher=%{<meta name="dc.publisher" content="#{@md.dc_publisher}" />\n}
+ end
+ if @md.dc_contributor # DublinCore 6 - contributor
+ @rdf_contributor=%{ dc.contributor="#{@md.dc_contributor}"\n}
+ @dc_contributor=%{<meta name="dc.contributor" content="#{@md.dc_contributor}" />\n}
+ end
+ if @md.dc_date # DublinCore 7 - date year-mm-dd
+ @rdf_date=%{ dc.date="#{@md.dc_date}"\n}
+ @dc_date=%{<meta name="dc.date" content="#{@md.dc_date}" #{@md.date_scheme} />\n}
+ end
+ if @md.dc_date_created # DublinCore 7 - date.created year-mm-dd
+ @rdf_date_created=%{ dc.date.created="#{@md.dc_date_created}"\n}
+ @dc_date_created=%{<meta name="dc.date.created" content="#{@md.dc_date_created}" #{@md.date_created_scheme} />\n}
+ end
+ if @md.dc_date_issued # DublinCore 7 - date.issued year-mm-dd
+ @rdf_date_issued=%{ dc.date.issued="#{@md.dc_date_issued}"\n}
+ @dc_date_issued=%{<meta name="dc.date.issued" content="#{@md.dc_date_issued}" #{@md.date_issued_scheme} />\n}
+ end
+ if @md.dc_date_available # DublinCore 7 - date.available year-mm-dd
+ @rdf_date_available=%{ dc.date.available="#{@md.dc_date_available}"\n}
+ @dc_date_available=%{<meta name="dc.date.available" content="#{@md.dc_date_available}" #{@md.date_available_scheme} />\n}
+ end
+ if @md.dc_date_valid # DublinCore 7 - date.valid year-mm-dd
+ @rdf_date_valid=%{ dc.date.valid="#{@md.dc_date_valid}"\n}
+ @dc_date_valid=%{<meta name="dc.date.valid" content="#{@md.dc_date_valid}" #{@md.date_valid_scheme} />\n}
+ end
+ if @md.dc_date_modified # DublinCore 7 - date.modified year-mm-dd
+ @rdf_date_modified=%{ dc.date.modified="#{@md.dc_date_modified}"\n}
+ @dc_date_modified=%{<meta name="dc.date.modified" content="#{@md.dc_date_modified}" #{@md.date_modified_scheme} />\n}
+ end
+ if @md.dc_type # DublinCore 8 - type (genre eg. report, convention etc)
+ @rdf_type=%{ dc.type="#{@md.dc_type}"\n}
+ @dc_type=%{<meta name="dc.type" content="#{@md.dc_type}" />\n}
+ end
+ if @md.dc_format # DublinCore 9 - format (use your mime type)
+ @rdf_format=%{ dc.format="#{@md.dc_format}"\n}
+ @dc_format=%{<meta name="dc.format" content="#{@md.dc_format}" />\n}
+ end
+ if @md.dc_identifier # DublinCore 10 - identifier (your identifier, could use urn which is free)
+ @rdf_identifier=%{ dc.identifier="#{@md.dc_identifier}"\n}
+ @dc_identifier=%{<meta name="dc.identifier" content="#{@md.dc_identifier}" />\n}
+ end
+ if @md.dc_source # DublinCore 11 - source (document source)
+ @rdf_source=%{ dc.source="#{@md.dc_source}"\n}
+ @dc_source=%{<meta name="dc.source" content="#{@md.dc_source}" />\n}
+ end
+ if @md.dc_language[:name] # DublinCore 12 - language (English)
+ @rdf_language=%{ dc.language="#{@md.dc_language[:name]}"\n}
+ @dc_language=%{<meta name="dc.language" content="#{@md.dc_language[:name]}" />\n}
+ end
+ if @md.language_original[:name] # DublinCore 12 - language (English)
+ @rdf_language_original=%{ dc.language="#{@md.language_original[:name]}"\n}
+ @language_original=%{<meta name="dc.language" content="#{@md.language_original[:name]}" />\n}
+ end
+ if @md.dc_relation # DublinCore 13 - relation
+ @rdf_relation=%{ dc.relation="#{@md.dc_relation}"\n}
+ @dc_relation=%{<meta name="dc.relation" content="#{@md.dc_relation}" />\n}
+ end
+ if @md.dc_coverage # DublinCore 14 - coverage
+ @rdf_coverage=%{ dc.coverage="#{@md.dc_coverage}"\n}
+ @dc_coverage=%{<meta name="dc.coverage" content="#{@md.dc_coverage}" />\n}
+ end
+ if @md.dc_rights # DublinCore 15 - rights
+ @rdf_rights=%{ dc.rights="#{@md.dc_rights}"\n}
+ @dc_rights=%{<meta name="dc.rights" content="#{@md.dc_rights}" />\n}
+ end
+ @copyright=%{<meta name="copyright" content="#{@md.dc_rights}" />\n} if @md.rights # possibly redundant see dc.rights
+ @owner=%{<meta name="owner" content="#{@md.owner}" />\n} if @md.owner
+ @keywords=%{<meta name="keywords" content="#{@md.keywords}" />\n} if @md.keywords
+ @vz=SiSU_Env::Get_init.instance.skin #margin,paragraph,table,banner,url,png,txt,color,font,nav_txt,nav_png,credits,js,php
+ @index=case @md.file_type
+ when /php/; 'index' # @index="index.php"
+ else 'index'
+ end
+ end
+ def toc_head_escript #embedded script in this case PHP
+ # %{<p>PHP or other embedded script for object persistence may go HERE</p>}
+ end
+ #def seg_head_escript #embedded script in this case PHP
+ # # %{<p>PHP or other embedded script for object persistence may go HERE</p>}
+ #end
+ def table_close
+ '</font> </td></tr></table>'
+ end
+ def buttons_home
+ %{\n#{@banner.home_and_index_buttons}\n}
+ end
+ def copyat
+ %{copy @ <a href="#{@url.home}" #{@js.home}>#{@txt.home}</a>}
+ end
+ def toc_head
+ #<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ # xmlns:dc="http://purl.org/dc/elements/1.1/">
+ # <rdf:Description rdf:about="http://www.jus.uio.no/lm/doc"
+ # dc:creator="Author"
+ # dc:title="Title"
+ # dc:description="Description if any"
+ # dc:date="Publication Date"
+ # />
+ #</rdf:RDF>
+ #Dublin Core
+ <<WOK
+<html>
+<head>
+<title>#{@md.html_title}</title>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <rdf:Description
+#@rdfurl
+#@rdf_title
+#@rdf_subtitle
+#@rdf_creator
+#@rdf_subject
+#@rdf_description
+#@rdf_publisher
+#@rdf_contributor
+#@rdf_date
+#@rdf_date_created
+#@rdf_date_issued
+#@rdf_date_available
+#@rdf_date_valid
+#@rdf_date_modified
+#@rdf_type
+#@rdf_format
+#@rdf_identifier
+#@rdf_source
+#@rdf_language
+#@rdf_relation
+#@rdf_coverage
+#@rdf_rights
+ />
+</rdf:RDF>
+#@dc_title
+#@dc_creator
+#@dc_subject
+#@dc_description
+#@dc_publisher
+#@dc_contributor
+#@dc_date
+#@dc_date_created
+#@dc_date_issued
+#@dc_date_available
+#@dc_date_valid
+#@dc_date_modified
+#@dc_type
+#@dc_format
+#@dc_identifier
+#@dc_source
+#@dc_language
+#@dc_relation
+#@dc_coverage
+#@dc_rights
+#@copyright
+#@owner
+#{@png.ico}
+#{@txt.generator}
+#{@js.head}
+\n</head>
+#{@color.body}
+#{@font.css_table_file}
+<a name="top"></a>
+<a name="up"></a>
+<a name="start"></a>
+#{@js.top}
+WOK
+ end
+ end
+ class Format_text_object
+ @@dp=nil
+ attr_accessor :md,:one,:two,:three,:parablock,:table,:link,:linkname,:format,:paranum,:p_num,:para_id,:headname,:margin,:paragraph,:table,:banner,:url,:icon,:font,:one_stripped
+ def initialize(md,*txt)
+ @md=md
+ txt[0].gsub!(/\.(html|pdf|php)/,'') if one =~/\.\.\/\S+/
+ @one,@two,@three=txt[0],txt[1],txt[2]
+ @format,@parablock=txt[0],txt[1]
+ if txt[2]=~/\d+/
+ @paranum=/(\d+)/m.match(txt[2])[1]
+ @headname=''
+ #if txt[2]=~/\d+/
+ m=/\d~(\S+)/m.match(format)
+ headname=m[1] if m
+ @headname=%{<a name="h#{headname}"></a>} unless headname.nil?
+ @p_num=SiSU_XML_format::Paragraph_number.new(@md,@paranum)
+ end
+ #{
+ rgx=/^[1-6-]~{1,2}/ #watch
+ link=txt[0].gsub(rgx,'') if @one =~rgx
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ rgx=/~\{\d+\s+(.+?)<#@dp>\}~/
+ link=txt[0].gsub(rgx,'\1') if txt[0] =~rgx
+ @link,@linkname=link,txt[1]
+ @vz=SiSU_Env::Get_init.instance.skin
+ end
+ def scr_endnote_body
+ "<endnote>#@one</endnote> "
+ end
+ end
+ class Format_scroll < Format_text_object
+ def initialize(*txt)
+ super(*txt)
+ end
+ def heading_body
+ %{<p class="norm">#{@p_num.name}#@headname#@parablock </p>} +
+ %{<p class="paranum">#{@p_num.display} </p>\n}
+ end
+ def heading_body1
+ %{<h1 class="norm">#{@p_num.name}#@headname#@parablock </h1>} +
+ %{<p class="paranum">#{@p_num.display} </p>\n}
+ end
+ def heading_body2
+ %{<h2 class="norm">#{@p_num.name}#@headname#@parablock </h2>} +
+ %{<p class="paranum">#{@p_num.display} </p>\n}
+ end
+ def heading_body3
+ %{<h3 class="norm">#{@p_num.name}#@headname#@parablock </h3>} +
+ %{<p class="paranum">#{@p_num.display} </p>\n}
+ end
+ def heading_body4
+ %{<h4 class="norm">#{@p_num.name}#@headname#@parablock</h4>} +
+ %{<p class="paranum">#{@p_num.display} </p>\n}
+ end
+ def heading_body5
+ %{<h5 class="norm">#{@p_num.name}#@headname#@parablock </h5>} +
+ %{<p class="paranum">#{@p_num.display} </p>\n}
+ end
+ def heading_body6
+ %{<h6 class="norm">#{@p_num.name}#@headname#@parablock </h6>} +
+ %{<p class="paranum">#{@p_num.display} </p>\n}
+ end
+ end
+ class XML
+ end
+end
+__END__
+
diff --git a/lib/sisu/0.52/xml_tables.rb b/lib/sisu/0.52/xml_tables.rb
new file mode 100644
index 00000000..5f48c3f7
--- /dev/null
+++ b/lib/sisu/0.52/xml_tables.rb
@@ -0,0 +1,202 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: common file for xml table generation
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Tables
+ require SiSU_lib + '/defaults'
+ include SiSU_Viz
+ class Table #_xml
+ @@tablehead=0
+ @@tablefoot=[] #watch #bug??? #check was @@tablefoot
+ def initialize(one,ocn='')
+ @one,@parablock,@ocn,@vz=one,one,ocn,SiSU_Env::Get_init.instance.skin
+ end
+ def table_split #% used but, no longer operational, revisit
+ @new_content=[]
+ @one.split(/\n/).each do |parablock|
+ table=Table_xml.new("#{parablock}\n")
+ @new_content << table.table
+ end
+ @new_content.join
+ end
+ end
+ class Table_xml <Table
+ @@tablehead=0
+ @@tablefoot=[]
+ @@dp=nil
+ def initialize(one,ocn='')
+ @one,@parablock,@ocn,@vz=one,one,ocn,SiSU_Env::Get_init.instance.skin
+ @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
+ end
+ def table
+ m=@parablock[/<!f(.+?)!>/,1]
+ @@tablefoot << m if m
+ @parablock.gsub!(/<!f.+?!>/,'')
+ @@tablehead=1 if @parablock =~/<!Th¡/
+ if @parablock =~/<!Th?¡/
+ @parablock.gsub!(/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/,
+ %{\n<ocn>#@ocn</ocn><table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">})
+ end
+ if @parablock =~/<!TZ!>/
+ tablefoot=[]
+ #bug table footers need rethink, removed for now
+ @@tablefoot.each {|x| tablefoot << ''}
+ @@tablefoot=[]
+ @parablock.gsub!(/<!TZ!>\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,"</table>\n") # +
+ @parablock.gsub!(/<!TZ!>\s*/,"</table>\n")
+ end
+ if @@tablehead == 1
+ if @parablock =~/¡¡/
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,
+ %{<tr>
+ <td width="\\1%" valign="top">
+ #{@vz.paragraph_table_xml}<b>})
+ @parablock.gsub!(/¡¡(\d+?)¡/,
+ %{</b></td><td width="\\1%" valign="top">
+ #{@vz.paragraph_table_xml}<b>})
+ @parablock.gsub!(/!>/,"</b>\n</td>\n</tr>")
+ @@tablehead=0
+ end
+ @parablock
+ else
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,
+ %{<tr>
+ <td width="\\1%" valign="top">
+ #{@vz.paragraph_table_xml}})
+ @parablock.gsub!(/¡¡(\d+?)¡/,
+ %{
+ </td>
+ <td width="\\1%" valign="top">
+ #{@vz.paragraph_table_xml}})
+ @parablock.gsub!(/!>/,"\n</td>\n</tr>\n")
+ end
+ @parablock
+ end
+ end
+ class Table_xml_exp <Table
+ @@tablehead=0
+ @@tablefoot=[]
+ def initialize(one)
+ @one,@parablock,@vz=one,one,SiSU_Env::Get_init.instance.skin
+ end
+ def table_head(inf)
+ %{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+ <tr>
+ <td valign="top" align="justify">
+ <a name="#{inf}"></a>
+ </td>
+ <td>
+<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">}
+ end
+ def table_end(tablefoot='')
+ %{</table>#{@vz.margin_numless}#{@vz.margin_numless}&nbsp;#{@vz.table_close}
+#{tablefoot}}
+ end
+ def table_row(inf,h=false)
+ bold=if h; '<b>'
+ else ''
+ end
+ %{
+<tr>
+ <td width="#{inf}%" valign="top">#{bold}}
+ end
+ def table_cell(inf,h=false)
+ if h; %{</b></td><td width="#{inf}%" valign="top"><b>}
+ else %{</td><td width="#{inf}%" valign="top">}
+ end
+ end
+ def table_row_close(h=false)
+ bold_close=if h; '</b>'
+ else ''
+ end
+ "#{bold_close}</td></tr>"
+ end
+ def table
+ m=@parablock[/<!f(.+?)!>/,1]
+ @@tablefoot << m if m
+ @parablock.gsub!(/<!f.+?!>/,'')
+ @@tablehead=1 if @parablock =~/<!Th¡/
+ if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/; @parablock=table_head($1)
+ end
+ if @parablock =~/<!TZ!>/
+ tablefoot=[]
+ @@tablefoot.each {|x| tablefoot << ''}
+ @@tablefoot=[]
+ if @parablock =~/<!TZ!>/; @parablock=table_end
+ end
+ end
+ if @@tablehead == 1
+ if @parablock =~/¡¡/
+ if @parablock =~/<!¡¡(\d+?)¡/
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))
+ end
+ if @parablock =~/¡¡(\d+?)¡/
+ @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))
+ end
+ if @parablock =~/!>/
+ @parablock.gsub!(/!>/,table_row_close(true))
+ end
+ @@tablehead=0
+ end
+ @parablock
+ else
+ if @parablock =~/<!¡¡(\d+?)¡/
+ @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1))
+ end
+ if @parablock =~/¡¡(\d+?)¡/
+ @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1))
+ end
+ if @parablock =~/!>/
+ @parablock.gsub!(/!>/,table_row_close)
+ end
+ @parablock
+ end
+ @parablock
+ end
+ end
+end
+
diff --git a/lib/sisu/0.52/zap.rb b/lib/sisu/0.52/zap.rb
new file mode 100644
index 00000000..42ee840d
--- /dev/null
+++ b/lib/sisu/0.52/zap.rb
@@ -0,0 +1,73 @@
+=begin
+ * Name: SiSU information Structuring Universe - Structured information, Serialized Units
+ * Author: Ralph Amissah
+ * http://www.jus.uio.no/sisu
+ * http://www.jus.uio.no/sisu/SiSU/download.html
+
+ * Description: zap wipe clean previous output of the type specified
+
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah
+
+ * License: GPL 2 or later
+
+ Summary of GPL 2
+
+ 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 2 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/gpl2.fsf
+
+ SiSU was first released to the public on January 4th 2005
+
+ SiSU uses:
+
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ © Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+
+ * Notes: tidy -ascii index.xml >> index.tidy
+
+ * Ralph Amissah: ralph@amissah.com
+ ralph.amissah@gmail.com
+=end
+module SiSU_Zap
+ require SiSU_lib + '/sysenv'
+ include SiSU_Env
+ pwd=Dir.pwd
+ class Source
+ def initialize(opt)
+ @opt=opt
+ @env=SiSU_Env::Info_env.new(@opt.fns)
+ @zap_path="#{@env.path.output}/#{@env.fnb}"
+ @zap=SiSU_Env::Clean_output.new(@opt)
+ end
+ def read
+ if SiSU_Env::Info_settings.new.permission?('zap')
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Clean files related to processing #{@opt.cmd} ->","#{@opt.fns} -> #@zap_path")
+ @zap.zap
+ @zap.zap_map
+ else tell=SiSU_Screen::Ansi.new(@opt.cmd,'use of -Z (zap) has not enabled in sisurc.yml')
+ end
+ tell.warn unless @opt.cmd =~/q/
+ end
+ end
+end
+__END__
diff --git a/man/man1/sisu.1 b/man/man1/sisu.1
new file mode 100644
index 00000000..10d38caa
--- /dev/null
+++ b/man/man1/sisu.1
@@ -0,0 +1,1497 @@
+.\" Name: SiSU information Structuring Universe
+.\" Author: Ralph Amissah
+.\" Description: sisu manpage
+.\" arch-tag: sisu manpage
+.\" License: GPL 2 or later
+.\" Notes: Process this file with
+.\" groff -man -Tascii sisu.1
+.\" nroff -man sisu.1 | most
+.\" /[^\\][-']
+.\" :%s/\([^\\]\)\([-']\)/\1\\\2/c
+.\" |sisu.1|@|^|<url:sisu.1>
+.TH "sisu" "1" "April 04, 2007" "version 0.52" "USER COMMANDS and basic Markup"
+.SH "NAME"
+.B SiSU
+\- Structured information, Serialized Units \- a document publishing system
+.SH "SYNOPSIS"
+.B sisu
+.B [
+.I \-AabcDdEeFHhIMmNnopqrRSstUuVvwXxYyZz0\-9
+.B ] [
+.I filename/ wildcard
+.B ]
+.PP
+.B sisu
+.B [
+.I \-Ddcv
+.B ] [
+.I instruction
+.B ]
+.PP
+.B sisu
+.B [
+.I \-CcFLSVvW
+.B ]
+.PP
+Note: commands should be issued from within the directory that contains the marked up files, cd to markup directory.
+.\" %% Description
+.SH "DESCRIPTION"
+.B SiSU
+SiSU is a document publishing system, that from a simple single marked\-up document, produces multiple of output formats including: plaintext, html, LaTeX, pdf, xhtml, XML, info, and SQL (PostgreSQL and SQLite), which share numbered text objects ("object citation numbering") and the same document structure information. For more see:
+.I <http://www.jus.uio.no/sisu>
+.PP
+.\" %% Summary
+.SH "Summary of man page"
+.TP
+This man page covers a number of subjects in brief, including: document processing command flags; document markup (basic markup and headers); configuration files; directory structure; skins; document naming; interactive help and other information.
+.\" %% Flags
+.SH "DOCUMENT PROCESSING COMMAND FLAGS"
+.TP
+.BI \-A \ [filename/wildcard]
+produces
+.I plaintext
+with
+.I dos linefeeds
+and without markup, (object numbers are omitted), has footnotes at end of each paragraph that contains them [
+.I \-a
+for equivalent Unix (linefeed) output file] [see
+.I \-E
+for endnotes].
+.TP
+.BI \-a \ [filename/wildcard]
+produces
+.I plaintext
+with
+.I Unix linefeeds
+and without markup, (object numbers are omitted), has footnotes at end of each paragraph that contains them [
+.I \-A
+for equivalent dos (linefeed) output file] [see
+.I \-e
+for endnotes].
+.TP
+.BI \-b \ [filename/wildcard]
+produces
+.I xhtml/XML
+output for browser viewing (sax parsing).
+.TP
+.BI \-C \ [\-\-init=site]
+.I configure/initialise
+shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used).
+.BI \-C \ \-\-init=site
+.I configure/initialise site
+more extensive than
+.I \-C
+on its own, shared output directory files/force update, existing shared output config files such as css and dtd files are updated if this modifier is used.
+.TP
+.BI \-c \ [filename/wildcard]
+screen
+.I toggle ansi screen colour
+on or off depending on default set (unless \-c flag is used: if sisurc colour default is set to \'true\', output to screen will be with colour, if sisurc colour default is set to \'false\' or is undefined screen output will be without colour).
+.TP
+.BI \-D \ [instruction] \ [filename]
+database postgresql
+(
+.I \-\-pgsql
+may be used instead)
+possible instructions, include:
+.I \-\-createdb;
+.I \-\-create;
+.I \-\-dropall;
+.I \-\-import \ [filename];
+.I \-\-update \ [filename];
+.I \-\-remove \ [filename];
+see database section below.
+.TP
+.BI \-d \ [\-\-db\-[database \ type \ (sqlite|pg)]] \ \-\-[instruction] \ [filename]
+database type
+default set to sqlite, (for which
+.I \-\-sqlite
+may be used instead)
+or to specify another database
+.I \-\-db\-[pgsql, sqlite]
+(however see \-D)
+possible instructions include:
+.I \-\-createdb;
+.I \-\-create;
+.I \-\-dropall;
+.I \-\-import \ [filename];
+.I \-\-update \ [filename];
+.I \-\-remove \ [filename];
+see database section below.
+.TP
+.BI \-E \ [filename/wildcard]
+produces
+.I plaintext
+with
+.I dos linefeeds,
+and without markup, endnotes follow the main text (in
+.I \-a
+endnotes follow the paragraphs that contain them). There are no object numbers [see
+.I \-e
+for Unix (linefeed) output file] [see
+.I \-A
+for footnotes].
+.TP
+.BI \-e \ [filename/wildcard]
+produces
+.I plaintext
+with
+.I Unix linefeeds,
+and without markup, endnotes follow the main text. Object numbers are omitted. [
+.I \-E
+for equivalent dos (linefeed) output file] [
+.I \-a
+for footnotes].
+.TP
+.BI \-F \ [\-\-webserv=webrick]
+generate examples of (naive)
+.I cgi search form
+for
+.I sqlite
+and
+.I pgsql
+depends on your already having used sisu to populate an sqlite and/or pgsql database, (the sqlite version scans the output directories for existing sisu_sqlite databases, so it is first necessary to create them, before generating the search form) see
+.I \-d
+.I \-D
+and the
+.I database section
+below.
+If the optional parameter
+.I \-\-webserv=webrick
+is passed, the cgi examples created will be set up to use the default port set for use by the webrick server, (otherwise the port is left blank and the system setting used, usually 80). The samples are dumped in the present work directory which must be writable, (with screen instructions given that they be copied to the
+.I cgi\-bin
+directory).
+.I \-Fv
+(in addition to the above) provides some information on setting up
+.I hyperestraier
+for sisu
+.\" An alternative optional parameter
+.\" .I the letters pwd
+.\" anticipates that the present work directory will be used to test the cgi script.
+.TP
+.\" .BI \-g \ [filename/wildcard]
+.\" produces html/css/scroll (using markup shared with db)output for browser viewing (easily modified to XML)
+.\" .TP
+.BI \-H \ [filename/wildcard]
+produces
+.I html
+without link suffixes (.html .pdf etc.) ("Hide"). Requires an appropriately configured web server. [behaviour switched after 0.35 see \-h].
+.TP
+.BI \-h \ [filename/wildcard]
+produces
+.I html
+(with hardlinks i.e. with name suffixes in links/local urls).
+html, with internal document links that include the document suffix, i.e. whether it is .html or .pdf (required for browsing directly off a file system, and works with most web servers). [behaviour switched after 0.35 see \-H].
+.TP
+.BI \-I \ [filename/wildcard]
+produces
+.I texinfo
+file.
+.TP
+.BI \-L
+prints license information.
+.TP
+.BI \-M \ [filename/wildcard/url]
+.I maintenance mode
+files created for processing preserved and their locations indicated. (also see \-V)
+.TP
+.BI \-m \ [filename/wildcard/url]
+assumed for most other flags, creates new meta\-markup file, (the
+.I metaverse
+) that is used in all subsequent processing of other output. This step is assumed for most processing flags. To skip it see
+.I \-n
+.TP
+.BI \-N \ [filename/wildcard/url]
+document
+.I digest
+or
+.I document content certificate
+(
+.I DCC
+)
+as
+.I md5 digest tree
+of the document: the digest for the document, and digests for each object contained within the document (together with information on software versions that produced it) (digest.txt).
+.I \-NV
+for verbose digest output to screen.
+.TP
+.BI \-n \ [filename/wildcard/url]
+skip meta\-markup (building of "metaverse"), this skips the equivalent of
+.I \-m
+which is otherwise assumed by most processing flags.
+.TP
+.BI \-o \ [filename/wildcard/url]
+output basic document in
+.I opendocument
+file format (opendocument.odt).
+.TP
+.BI \-p \ [filename/wildcard]
+produces
+.I LaTeX pdf
+(portrait.pdf & landscape.pdf).
+Default paper size is set in config file, or document header, or provided with additional command line parameter, e.g.
+.I \-\-papersize\-a4
+preset sizes include: 'A4', U.S. 'letter' and 'legal' and book sizes 'A5' and 'B5' (system defaults to A4).
+.TP
+.BI \-q \ [filename/wildcard]
+.I quiet
+less output to screen.
+.TP
+.BI \-R \ [filename/wildcard]
+.I copies
+sisu output files to
+.I remote host
+using rsync. This requires that sisurc.yml has been provided with information on hostname and username, and that you have your "keys" and ssh agent in place. Note the behavior of rsync different if \-R is used with other flags from if used alone. Alone the rsync \-\-delete parameter is sent, useful for cleaning the remote directory (when \-R is used together with other flags, it is not). Also see
+.I \-r
+.TP
+.BI \-r \ [filename/wildcard]
+.I copies
+sisu output files to
+.I remote host
+using scp. This requires that sisurc.yml has been provided with information on hostname and username, and that you have your "keys" and ssh agent in place. Also see
+.I \-R
+.TP
+.BI \-S
+produces a
+.I sisupod
+a zipped sisu directory of markup files
+including
+.I sisu markup source files
+and the directories local
+.I configuration file,
+.I images
+and
+.I skins.
+.B Note:
+this only includes the configuration files or skins contained in
+.I ./_sisu
+not those in
+.I ~/.sisu
+.I \-S \ [filename/wildcard]
+option.
+.B Note:
+(this option is tested only with zsh).
+.TP
+.BI \-S \ [filename/wildcard]
+produces a zipped file of the prepared document specified along with associated images, by default named
+.I sisupod.zip
+they may alternatively be named with the filename extension
+.I .ssp
+This provides a quick way of gathering the relevant parts of a sisu document which can then for example be emailed. A sisupod includes
+.I sisu markup source file,
+(along with associated documents if a master file, or available in multilingual versions),
+together with related
+.I images
+and
+.I skin.
+SiSU commands can be run directly against a sisupod contained in a local directory, or provided as a url on a remote site. As there is a security issue with skins provided by other users, they are not applied unless the flag \-\-trust or \-\-trusted is added to the command instruction, it is recommended that file that are not your own are treated as untrusted. The directory structure of the unzipped file is understood by sisu, and sisu commands can be run within it.
+.B Note:
+if you wish to send multiple files, it quickly becomes more space efficient to zip the sisu markup directory, rather than the individual files for sending). See the
+.I \-S
+option without [filename/wildcard].
+.TP
+.BI \-s \ [filename/wildcard]
+copies sisu markup file to output directory.
+.TP
+.BI \-t \ [filename/wildcard \ (*.termsheet.rb)]
+standard form document builder, preprocessing feature
+.TP
+.BI \-U \ [filename/wildcard]
+prints
+.I url output list/map
+for the available processing flags options and resulting files that could be requested, (can be used to get a list of processing options in relation to a file, together with information on the output that would be produced),
+.I \-u
+provides
+.I url output mapping
+for those flags requested for processing. The default assumes sisu_webrick is running and provides webrick url mappings where appropriate, but these can be switched to file system paths in sisurc.yml
+.TP
+.BI \-u \ [filename/wildcard]
+provides
+.I url mapping
+of output files for the flags requested for processing, also see
+.I \-U
+.TP
+.B \-V
+on its own, provides SiSU
+.I version
+and
+.I environment information
+(sisu \-\-help env)
+.TP
+.BI \-V \ [filename/wildcard]
+even more
+.I verbose
+than the
+.I \-v
+flag. (also see \-M)
+.TP
+.B \-v
+on its own, provides SiSU
+.I version information
+.TP
+.BI \-v \ [filename/wildcard]
+provides
+.I verbose output
+of what is being built, where it is being built (and error messages if any), as with
+.I \-u
+flag provides a url mapping of files created for each of the processing flag requests. See also
+.B \-V
+.TP
+.BI \-W
+starts ruby\'s
+.I webrick webserver
+points at sisu output directories, the default port is set to 8081 and can be changed in the resource configuration files. [tip: the webrick server requires link suffixes, so html output should be created using the
+.I \-h
+option rather than
+.I \-H
+; also, note
+.I \-F webrick
+].
+.\"% An alternative optional parameter
+.\" .I the letters pwd
+.\" results in the cgi\-bin directory being set to the present work directory. This is offered to simplify testing the cgi test form generated by
+.\" .I \-S
+.TP
+.BI \-w \ [filename/wildcard]
+produces
+.I concordance (wordmap)
+a rudimentary index of all the words in a document.
+.TP
+.BI \-X \ [filename/wildcard]
+produces
+.I XML output
+with deep document structure, in the nature of dom.
+.TP
+.BI \-x \ [filename/wildcard]
+produces
+.I XML output
+shallow structure (sax parsing).
+.TP
+.BI \-Y \ [filename/wildcard]
+produces a short sitemap entry for the document, based on html output and the sisu_manifest.
+.I \-\-sitemaps
+generates/updates the sitemap index of existing sitemaps. (Experimental, [g,y,m announcement this week])
+.TP
+.BI \-y \ [filename/wildcard]
+produces an html summary of output generated (hyperlinked to content) and document specific metadata (sisu_manifest.html). This step is assumed for most processing flags.
+.TP
+.BI \-Z \ [filename/wildcard]
+Zap, if used with other processing flags
+.I deletes output files
+of the type about to be processed, prior to processing.
+If \-Z is used as the lone processing related flag (or in conjunction with a combination of \-[mMvVq]), will remove the related document output directory.
+.TP
+.BI \-z \ [filename/wildcard]
+produces
+.I php
+(zend) [this feature is disabled for the time being]
+.\" %% modifiers
+.SH "modifiers"
+.TP
+.BI \-\-no\-ocn
+[with \-h \-H or \-p] switches off object citation numbering. Produce output without identifying numbers in margins of html or LaTeX/pdf output.
+.TP
+.BI \-\-no\-annotate
+strips output text of editor endnotes~[* square brackets ]~ denoted by asterisk or dagger/plus sign
+.TP
+.BI \-\-no\-asterisk
+strips output text of editor endnotes~[* square brackets ]~ denoted by asterisk sign
+.TP
+.BI \-\-no\-dagger
+strips output text of editor endnotes~[+ square brackets ]~ denoted by dagger/plus sign
+.\" .TP
+.\" .BI \-\-no\-asterisk
+.\" .TP
+.\" .BI \-\-no\-dagger
+.\" .TP
+.\" .BI \-\-no\-annotate
+.\" %% Flags Database
+.SH "databases"
+.TP
+dbi \- database interface
+.B \-D
+or
+.B \-\-pgsql
+set for
+.I postgresql
+.B \-d
+or
+.B \-\-sqlite
+default set for
+.I sqlite
+\-d is modifiable with \-\-db=[database \ type \ (pgsql \ or \ sqlite)]
+.TP
+.B \-Dv \-\-createall
+initial step, creates required relations (tables, indexes) in existing postgresql database (a database should be created manually and given the same name as working directory, as requested) (rb.dbi) [
+.I \-dv \-\-createall
+sqlite equivalent] it may be necessary to run sisu
+.I \-Dv \-\-createdb
+initially
+.TP
+NOTE: at the present time for postgresql it may be necessary to manually create the database. The command would be
+.I 'createdb [database name]'
+where database name would be SiSU_[present working directory name (without path)]. Please use only alphanumerics and underscores.
+.TP
+.B \-Dv \-\-import
+.I [filename/wildcard]
+imports data specified to postgresql db (rb.dbi) [
+.I \-dv \-\-import
+sqlite equivalent]
+.TP
+.B \-Dv \-\-update
+.I [filename/wildcard]
+updates/imports specified data to postgresql db (rb.dbi) [
+.I \-dv \-\-update
+sqlite equivalent]
+.TP
+.B \-D \-\-remove
+.I [filename/wildcard]
+removes specified data to postgresql db (rb.dbi) [
+.I \-d \-\-remove
+sqlite equivalent]
+.TP
+.B \-D \-\-dropall
+kills data" and drops (postgresql or sqlite) db, tables & indexes [
+.I \-d \-\-dropall
+sqlite equivalent]
+.TP
+The v in e.g. \-Dv is for verbose output.
+.RE
+.\" %% Flags Shorthand
+.SH "Shortcuts, Shorthand for multiple flags"
+.TP
+.BI \-\-update \ [filename/wildcard]
+Checks existing file output and runs the flags required to update this output. This means that if only html and pdf output was requested on previous runs, only the \-hp files will be applied, and only these will be generated this time, together with the summary. This can be very convenient, if you offer different outputs of different files, and just want to do the same again.
+.TP
+\-0 to \-5 [filename or wildcard]
+Default shorthand mappings (note that the defaults can be changed/configured in the sisurc.yml file):
+.PP
+.I \-0
+\-mNhwpAobxXyYv
+.PB
+[this is the default action run when no options are give, i.e. on 'sisu [filename]']
+.PP
+.I \-1
+\-mNHwpy
+.PP
+.I \-2
+\-mNHwpaoy
+.PP
+.I \-3
+\-mNhwpAobxXyY
+.PP
+.I \-4
+\-mNhwpAobxXDyY \ \-\-import
+.PP
+.I \-5
+\-mNhwpAobxXDyY \ \-\-update
+.PP
+add
+.I \-v
+for verbose mode and
+.I \-c
+for color, e.g.
+.I sisu \-2vc
+[filename or wildcard]
+.PP
+consider
+.I \-u
+for appended url info or
+.I \-v
+for verbose output
+.\" %% Markup
+.SH "DOCUMENT MARKUP"
+.B SiSU Markup
+an incomplete summary.
+.PP
+.B Note:
+files should be marked up for SiSU using
+.I UTF\-8
+encoding.
+.PP
+Some interactive help on markup is available, by typing
+.I sisu
+and selecting
+.I markup
+or
+.I sisu \-\-help markup
+.TP
+Sample markup files can be used as examples:
+.I <http://www.jus.uio.no/sisu/sample>
+.TP
+actual marked up plaintext files ready for use:
+.I <http://www.jus.uio.no/sisu/sample/markup>
+.TP
+as html with syntax highlighting for viewing:
+.I <http://www.jus.uio.no/sisu/sample/syntax>
+.TP
+an alternative presentation of markup syntax:
+.I <http://www.jus.uio.no/sisu/sample/on_markup.txt>
+.\" %% Markup Basic
+.SH "Basic Markup"
+Data text markup (alternative to available html subset)
+.\" preformatted text follows
+.PP
+Heading levels are :A~ ,:B~ ,:C~ ,1~ ,2~ ,3~ ... :A \- :C being part / section headings, followed by other heading levels, and 1 \-6 being headings followed by substantive text or sub\-headings.
+.BR
+.I :A~
+usually the title
+.BR
+.I :A~?
+conditional level 1 heading (used where a stand\-alone document may be imported into another)
+.PP
+.I 1~filename
+level 1 heading, the primary division such as Chapter that is followed by substantive text, and may be further subdivided (this is the level on which by default html segments are made)
+.PP
+.I !{
+emphasis
+.I }!
+.PP
+.I *{
+bold text
+.I }*
+.PP
+.I _{
+underscore
+.I }_
+.PP
+.I /{
+italics
+.I }/
+.PP
+.I \'"{
+citation
+.I }"
+.PP
+.I ^{
+superscript
+.I }^
+.PP
+.I ,{
+subscript
+.I },
+.PP
+.I +{
+inserted text
+.I }+
+.PP
+.I \-{
+strikethrough
+.I }\-
+.\" %% Markup Endnotes
+.SH "Footnotes/Endnotes"
+.PP
+.I ~{
+a footnote or endnote
+.I }~
+.PP
+footnote/endnote
+.I ~{
+self contained endnote marker & endnote in one
+.I }~
+.PP
+.I ~{*
+unnumbered asterisk footnote/endnote, insert multiple asterisks if required
+.I }~
+.PP
+.I ~[*
+editors notes, numbered asterisk footnote/endnote series
+.I ]~
+(+ the plus sign may be used as well)
+.PP
+alternative endnote pair notation:
+.PP
+.I ~^
+endnote marker
+.PP
+.I ^~
+endnote text following the paragraph in which the marker occurs
+.\" %% Markup Line Operations
+.SH "Line Operations (marker placed at start of line)"
+.PP
+.I !_
+bold line
+.PP
+.I _1
+indent paragraph one level
+.PP
+.I _2
+indent paragraph two steps
+.PP
+.I _*
+bullet paragraph
+.PP
+.I #
+number paragraph (see headers for numbering document headings)
+.PP
+.I _#
+number paragraph level 2 (see headers for numbering document headings)
+.\" %% Markup Links
+.SH "Links"
+.PP
+.I {
+link name
+.I }http://url.org
+.PP
+.I {
+image.png
+.I }http://url.org
+.PP
+.I {
+image.png
+.I }image
+.PP
+.I {
+tux.png 64x80
+.I }image
+.PP
+NOTE: (a) png and jpg support only (no gif)
+(b) width x height, not required if imagemagick is installed, (where provided, dimensions may be smaller than the actual image), [images should be no larger than width: 480 and height: 640]
+.PP
+the shortcut:
+.PP
+.I {~^
+[text to link]
+.I }http://url.org
+.PP
+is equivalent to:
+.PP
+.I {
+[text to link]
+.I }http://url.org
+.I ~{
+http://url.org
+.I }~
+.PP
+(which produces hyper\-linked text within a document/paragraph, with an endnote providing the url for the text location used in the hyperlink)
+.PP
+url example:
+.PP
+.I {
+SiSU Geek Writer
+.I }http://www.jus.uio.no/sisu/
+.PP
+linked image:
+.PP
+.I {
+tux.png 64x80 "a better way"
+.I }http://www.jus.uio.no/sisu/
+image example with all options
+.PP
+note width x height
+.PP
+the shortcut:
+.PP
+.I {
+[text to link]
+.I [3sS]}markup_source_filename.sst
+.PP
+if a server host name has been provided/configured, will provide a list of available output types that would be generated using the shortcut command and the markup file provided, i.e. output generated using the command (as configured): "sisu \-3sS markup_source_filename.sst", using server host, directory stub, filename to compose the link.
+.\" %% Markup html name tagging
+.SH "Adding a fixed names in html"
+.PP
+.I *~[name]
+manual location marker/tagging at present only in html to produce <a name="[name]"></a> (use sparingly)
+.RS
+note at a heading level the same is automatically achieved by providing names to headings 5 and 6 i.e. 5~[name] and 6~[name] or in the case of auto\-heading numbering, without further intervention.
+.RE
+.\" %% Markup escape ocn
+.SH "Escape object citation numbering"
+.PP
+(place marker at end of paragraph)
+.PP
+.I ~#
+unnumbered paragraph
+.PP
+.I \-#
+unnumbered paragraph, delete when not required (place marker at end of paragraph) [used in dummy headings, eg. for segmented html]
+.PP
+It is convenient to mention here that the
+.I \-0
+flag generates html and latex/pdf output without visible object character numbers.
+.PP
+.I sisu \-0
+[filename.sst]
+.\" %% Markup latex/pdf page breaks
+.SH "Page breaks (LaTeX/pdf)"
+.PP
+page breaks are introduced to pdfs either as header instructions, indicating that pages should break at given levels, and mentioned in the header section, or manually, using the following notation
+.PP
+.I <:pb>
+page break, which breaks a page, starting a new page in single column text and a new column in double column text
+.PP
+.I <:pn>
+page new, which starts a new page, in both single and double column text (leaving an empty column in double column text if necessary).
+.\" %% Markup comments
+.SH "Comment line"
+.PP
+.I %
+ignored by sisu in processing if placed at beginning of line
+.PP
+.I %%
+ignored by sisu in processing if placed at beginning of line, used for folding by vim folds
+.\" %% Special Characters
+.SH "Special characters"
+special characters can be escaped with a backslash
+.I { } < >
+are contextual special characters, (in combination with other characters).
+.I ~ \- _ / % ^
+and occasionally
+.I ! # + ,
+are special characters in particular circumstances,
+see the syntax chart.
+[note that SiSU is not optimised for technical writing]
+.\" %% Markup Tables
+.SH "Tables"
+.PP
+.I table{
+[number of columns] [column width %];[column width %]
+
+ [table content, line breaks are important see example below]
+
+.I }table
+
+ sample table:
+
+.I table{~h c3; 26; 32; 32;
+
+ This is a table, column1
+ this would become row one of column two
+ column three of row one is here
+
+ column one row 2
+ column two of row two
+ column three of row two, and so on
+
+ column one row three
+ and so on
+ here
+
+.I }table
+
+whole table gets an object citation number
+
+.\" %% Markup other grouped text
+.SH "Other Grouped or Pre\-formatted Text"
+.I poem{
+
+ [Text here]
+
+ [Text here]
+
+.I }poem
+
+each verse is given an object citation number
+
+ \-\-\-\-
+
+.I group{
+
+ [Text here]
+
+.I }group
+
+whole group gets an object citation number
+
+ \-\-\-\-
+
+.I code{
+
+ [Text here]
+
+.I }code
+
+whole group gets an object citation number
+
+.\" %% Composite Documents
+.SH "Composite Documents"
+.PP
+It is possible to build a document by requiring other documents. The documents required may complete documents that could be generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other documents), by convention it should be named with the suffix
+.I .ssm
+(master)
+Within this document you would provide information on the other documents that should be included within the text. These may be other documents that would be processed in a regular way, or markup bits prepared only for inclusion within a master document
+.I .sst
+regular markup file, or
+.I .ssi
+(insert/information)
+.I .sst
+A secondary file of the composite document is built prior to processing with the same prefix and the suffix
+.I ._sst
+and
+.I .\_sst
+There are a number of alternative syntaxes for requiring external documents in order to permit use of ascii hypertext linking available in the vim editor. They are as follows:
+
+.TP
+basic markup for importing a document
+
+.I r{
+filename
+.I }
+
+.I {
+filename.si
+.I }require
+
+.I << {
+filename.si
+.I }
+#for vim folds
+
+.TP
+importing a document with textlink syntax
+
+.I |filename.si|@|^|require
+
+.I << |filename.si|@|^|
+#for vim folds
+
+.TP
+importing a document with thlnk syntax
+
+.I <url:filename.si>require
+
+.I << <url:filename.si>
+#for vim folds
+
+.TP
+remote documents may be called with the thlnk syntax (or regular sisu syntax), e.g.
+
+.I << <url:http://www.url.com/filename.si>
+
+.\" %% Document Headers
+.SH "Document Headers"
+Header tags appear at the beginning of a document and provide meta information on the document (such as the Dublin Core), or information as to how the document as a whole is to be processed.
+
+All header instructions may take either form:
+.I @headername:
+[introduced in 0.38] or
+.I 0~headername
+All Dublin Core meta tags are available
+
+.I @indentifier:
+information or instructions [introduced in 0.38]
+
+or
+
+.I 0~indentifier
+information or instructions, old equivalent, depreciated
+
+where the "identifier" is a tag recognised by the program, and the "information" or "instructions" belong to the tag/indentifier specified.
+
+Note: a header where used should only be used once; all headers apart from @title: (0~title) are optional; the @structure: (0~toc) header is used to describe document structure, and can be useful to know.
+
+@structure: PART; CHAPTER; SECTION; ARTICLE; none; none;
+
+structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^)
+
+ For help see one of the following (and markup samples):
+
+ * interactive help \- type \'sisu \-\-help headers\'
+
+ * marked up text samples
+
+ * the SiSU_Markup.txt file provided with the program
+
+ * an outline of headers is provided below \-\->
+.\" %% Header options
+.SH "Outline of header options"
+.I % SiSU 0.38
+[declared file\-type identifier with markup version]
+
+.I @title:
+My Title \- This is now the Title of the Document and used as such
+
+.I @subtitle:
+The Subtitle if any
+
+.I @creator:
+[or ~author] Ralph Amissah
+
+.I @subject:
+(whatever your subject)
+
+.I @description:
+
+.I @publisher:
+
+.I @contributor:
+
+.I @translator:
+[or ~translated_by]
+
+.I @illustrator:
+[or ~illustrated_by]
+
+.I @prepared_by:
+[or ~digitized_by]
+
+.I @date:
+2000\-08\-27 [ also @date.created: @date.issued: @date.available: @date.valid: @date.modified: ]
+
+.I @type:
+article
+
+.I @format:
+
+.I @identifier:
+
+.I @source:
+
+.I @language:
+[or @language.document:]
+language in which current version of document is published. Some country settings result in processing adjustments, e.g. in LaTeX hyphenation, some country codes are recognized, but the language name in Engish is preferred. English is the default setting.
+(en \- English, fr \- French, de \- German, it \- Italian, es \- Spanish, pt \- Portuguese, sv \- Swedish, da \- Danish, fi \- Finnish, no \- Norwegian, is \- Icelandic, nl \- Dutch, ee \- Estonian, hu \- Hungarian, pl \- Polish, ro \- Romanian, ru \- Russian, gl \- Greek, uk \- Ukranian, tr \- Turkish, si \- Slovene, sk \- Slovak, hr \- Croatian, cs \- Czech, bg \- Bulgarian ) [however, encodings are not available for all of the languages listed.]
+
+.I @language.original:
+original language in which the work was published
+
+.I @papersize:
+(A4|US_letter|book_B5|book_A5|US_legal)
+
+.I @relation:
+
+.I @coverage:
+
+.I @rights:
+copyright, all rights reserved, public domain, copyleft, creative commons variant, etc.
+
+.I @owner:
+
+.I @keywords:
+text document generation processing management LaTeX pdf structured XML citation [your keywords here, used for example by rss feeds, and in sql sear ches]
+
+.I @abstract:
+[paper abstract, placed after table of contents]
+
+.I @comment:
+[...]
+
+.I @catalogue:
+loc=[Library of Congress classification]; dewey=[Dewey classification]; isbn=[ISBN]; pg=[Project Gutenberg text number]
+
+.I @classify_loc:
+Library of Congress classification
+
+.I @classify_dewey:
+Dewey classification
+
+.I @classify_isbn:
+ISBN
+
+.I @classify_pg:
+Project Gutenberg text number
+
+.I @prefix_a:
+[prefix is placed just before table of contents \- not implemented]
+
+.I @prefix_b:
+or @prefix: [prefix is placed just after table of contents]
+
+.I @rcs:
+$Id$ [or
+.I @cvs:
+used by rcs or cvs to embed version (revision control) information into document, rcs or cvs can usefully provide a history of updates to a document ]
+
+.I @structure:
+PART; CHAPTER; SECTION; ARTICLE; none; none; optional, where document structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^) default markers :A~ to :C~ and 1~ to 6~ can be used within text instead, without this header ta g, and may be used to supplement the instructions provided in this header tag if provided (@structure: is a synonym for @toc:)
+
+.I @markup:
+information on the markup used, e.g.
+.I new=1,2,3; break=4; num_top=4
+[or newpage=1,2,3; breakpage=4; num_top=4]
+newpage and breakpage, heading level, used by LaTeX to breakpages. breakpage: starts on a new page in single column text and on a new column in double column text; newpage: starts on a new page for both single and double column texts.
+.I num_top=4
+[auto\-number document, starting at level 4. the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level]
+.I num_extract
+[take numbering of headings provided (manually in marked up source document), and use for numbering of segments. Available where a clear numbering structure is provided within document, without the repetition of a number in a header.]
+[In 0.38 notation, you would map to the equivalent levels, the examples provided would map to the following
+new=A,B,C; break=1; num_top=1
+[or newpage=A,B,C; breakpage=1; num_top=1]
+see headings]
+
+.I @bold:
+[regular expression of words/phrases to be made bold]
+
+.I @italics:
+[regular expression of words/phrases to italicise]
+
+.I @vocabulary:
+name of taxonomy/vocabulary/wordlist to use against document
+
+.I @skin:
+skin_doc_[name_of_desired_document_skin]
+
+.I @links:
+{ SiSU }http://www.jus.uio.no/sisu/ { FSF }http://www.fsf.org
+
+.I @promo:
+sisu, ruby, search_libre_docs, open_society
+[places content in right pane in html, makes use of list.yml and promo.yml, commented out sample in document sample: free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams.sst]
+
+.I :A~
+Top level heading [this usually has similar content to the title @title: ]
+NOTE: the heading levels described here are in 0.38 notation, see heading
+
+.I :B~
+Second level heading [this is a heading level divider]
+
+.I :C~
+Third level heading [this is a heading level divider]
+
+.I 1~
+Top level heading preceding substantive text of document or sub\-heading 2, the heading level that would normally be marked 1. or 2. or 3. etc. in a document, and the level on which sisu by default would break html output into named segments, names are provided automatically if none are given (a number), otherwise takes the form 1~my\_filename\_for\_this\_segment
+
+.I 2~
+Second level heading preceding substantive text of document or sub\-heading 3 , the heading level that would normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc. in a document.
+
+.I 3~
+Third level heading preceding substantive text of document, that would normally be marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document
+
+NOTE: headers and heading levels used in the description provided refer to 0.38 markup
+(a conversion script provided in sisu\-examples, modify.rb makes conversion between 0.37 and 0.38 markup simple)
+
+For some help on document structure try
+
+.I sisu \-\-help headings
+
+and view sample markup documents provided
+
+.\" % .I number in sequence but do not make a heading
+.\" where autonmumbering has been selected, autonumbering may be applied to a paragraph which is not to become a heading, by use of the heading level to which a dash sign is added i.e. 1~ would become 1~\- (this may be done for the second and third autonumber levels)
+
+.\" %% Configuration files
+.SH "CONFIGURATION FILES"
+.PP
+Some configuration is required for SiSU, specifying in which directory processing should be done, and where the generated output should be placed.
+.PP
+SiSU resource configuration is determined by looking at the following files if they exist:
+.PP
+.I ./_sisu/sisurc.yml
+.PP
+.I ~/.sisu/sisurc.yml
+.PP
+.I /etc/sisu/sisurc.yml
+.PP
+In the absence of instructions in any of these it falls back to the internal program defaults.
+.PP
+Configuration determines the output and processing directories and the database access details.
+.PP
+A sample sisurc.yml may be found in /etc/sisu/sisurc.yml
+
+.\" %% More Help on Markup and headers
+.SH "More HELP on Markup and headers"
+type:
+ sisu ~
+ sisu \-\-help
+
+ markup help is available on:
+ document wide instructions: headers (document structure)
+ general text markup: headings; endnotes; tables
+
+A markup table and sample marked\-up files (also in html with syntax highlighting) are available at:
+
+.I <http://www.jus.uio.no/sisu/sample>
+
+.\" %% Directory Structure and Document Output
+.SH "DIRECTORY STRUCTURE & Document Output"
+.TP
+SiSU determines output directories by looking at the resource configuration files, and in their absence the programs internal defaults.
+.\" %% Directory defaults
+.SH "Default Directories"
+.TP
+In the absence of other specifications in
+.I ~/.sisu/sisurc.yml
+in
+.I /etc/sisu/sisurc.yml
+SiSU writes to the following directories, processing files are placed in sub\-directories within
+.I ./_sisu/processing
+and if that is not writable to
+.I /tmp/sisu_processing
+.PP
+Output is written to sub\-directories within
+.I /var/www/
+if it exists and is writable, and otherwise to
+.I ~/sisu_output
+.\" %% Directory markup and file mapping
+.SH "Markup Document Directories and File Mapping"
+.TP
+Ideally documents should be placed as collections sub\-directories of their own, with a common denominator, such as subject or author.
+.TP
+The last part of a directory path is used to create a sub\-directory into which generated documents are placed, in (sub\-sub)directories of their own.
+.TP
+the document
+.PP
+.RS
+.I ~/ebook/free_culture.sst
+.RE
+.TP
+would map to
+.PP
+.RS
+.I ~[configured output path]/ebook/free_culture
+.RE
+.TP
+within which would be placed all html, XML, pdf output, typically under the names:
+.PP
+.RS
+.I index.html
+index for segmented text
+.PP
+.I doc.html
+full length scrollable document
+.PP
+.I toc.html
+index for segmented text
+.PP
+html segments, as many as there may be...
+.TP
+.I portrait.pdf
+.PP
+.I landscape.pdf
+.PP
+.I sax.xml
+XML shallow structure, sax type parsing
+.PP
+.I dom.xml
+XML deeper structure, dom type parsing
+.PP
+.I scroll.xhtml
+xhtml
+.PP
+.I plain.txt
+plain text
+.\" %% Directory multi\-language document convention and file mapping
+.SH "Multi\-language Document File Naming and Directory Mapping"
+.TP
+If the same document exists in different language versions, and it is desired that the published language versions should reside in the same output directory, the following filenaming convention should be observed, using Spannish as the sample language code (es) [it is very likley the use of country codes as language codes will be changed or extended in future] [filename]~[language code].sst
+.TP
+filename~es.sst
+.TP
+within sisurc.yml under the heading default the setting of language file: at 1, 2 or 3 determines the output filenaming convention used, as follows:
+.TP
+(1) [output directory path]/filename/es.index.html
+.TP
+(2) [output directory path]/filename/index.es.html
+.TP
+(3) [output directory path]/filename/index.html.es (which Apache for example can be configured to use to automatically serve each users preference)
+.TP
+filename~fr.sst
+.TP
+filename~de.sst
+.TP
+etc. would be placed in the same directory using the same convention as indeed would:
+.TP
+filename.sst
+.TP
+using the default convention mapping convention.
+.TP
+Selecting this form of filename will overide other language settings including the language header within a document.
+.\" %% Directory db mapping
+.SH "Markup Document Directories and Database Mapping"
+.PP
+Similarly there is a mapping to the database into which documents are placed.
+.PP
+The last part of a directory path is used to create a sub\-directory into which generated documents are placed, in a database of the same name, unless overridden.
+.PP
+Documents within the directory
+.I ~/ebook
+.PP
+.RS
+.I ~/ebook/free_culture.sst
+.RE
+.PP
+would be placed in tables within the database
+.PP
+.RS
+.I SiSU_ebook
+.RE
+.\" %% Skins
+.SH "SKINS \- document, directory and site skins"
+.PP
+Skins modify the default appearance of document output on a document, directory, or site wide basis. Skins are looked for in the following locations:
+.PP
+.I ./_sisu/skin
+.PP
+.I ~/.sisu/skin
+.PP
+.I /etc/sisu/skin
+.PP
+Within the skin directory are the following the default sub\-directories for document skins:
+.PP
+.I ./skin/doc
+.PP
+.I ./skin/dir
+.PP
+.I ./skin/site
+.PP
+Documents take on a document skin, if the header of the document specifies a skin to be used.
+.PP
+A directory may be mapped on to a particular skin, so all documents within that directory take on a particular appearance. If a skin exists in the skin/dir with the same name as the document directory, it will automatically be used for each of the documents in that directory, (except where a document specifies the use of another skin, in the skin/doc directory).
+when
+end
+.PP
+A personal habit is to place all skins within the doc directory, and symbolic links as needed from the site, or dir directories as required.
+.PP
+A site skin, modifies the program default skin.
+.PP
+Sample skins may be found in /etc/sisu/skin/doc and /usr/share/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc (or equivalent directory)
+.PP
+Samples of list.yml and promo.yml may be found in /usr/share/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml (or equivalent directory)
+.\" %% Document Naming convention
+.SH "DOCUMENT NAMING CONVENTION"
+.PP
+SiSU documents are named with the suffix
+.I ss
+followed by a third distinguishing letter, usually t for ordinary text files.
+.PP
+.I .sst
+is used by regular documents, and for most purposes is all you need to be aware of
+.PP
+.I .ssm
+suffix indicates a master or composite document, i.e. a document which requests other documents, which may have the file extension .sst or .ssi. See section on Composite Documents for information on how these are prepared.
+.PP
+.I .ssi
+indicates some prepared sisu markup information that is to be requested within master or composite document(s) and is not to be processed as a stand\-alone document.
+.PP
+.I ._sst
+and
+.I .\-sst
+suffix are reserved for SiSU processing, and indicate a secondary file. Such secondary files are created when a composite file is constructed, and when a url is provided, it is saved locally for processing, as a secondary processing file. Secondary files may be clobbered by SiSU at will, and are not a way of storing information.
+
+.I .sxs.xml
+simple xml sax, sisu markup representation
+
+.I .sxd.xml
+simple xml dom, sisu markup representation
+
+.I .sxn.xml
+simple xml node, sisu markup representation
+
+.I .sxs.xml.sst
+or
+.I .sxd.xml.sst
+or
+.I .sxn.xml.sst
+auto\-converted from a simple xml markup representation (sxs, sxd, sxn)
+.\" %% Remote Operations
+.SH "REMOTE OPERATIONS"
+.PP
+These may be of three basic types.
+.PP
+Instruction that processed files are to be copied to a remote server, using the \-r or \-R flag as part of the processing instruction. This requires previous setting up/configuration of the method to be used (eg scp assumed for \-r and rsync for \-R) and url to which these files are to be sent. *
+.PP
+The downloading of a remote file for processing using SiSU locally, which is achieved in one of two ways:
+.PP
+A processing instruction may include the url to the a remote file that is to be processed \- this will be downloaded and given a temporary file .t extension, and will be processed using SiSU locally.
+.PP
+A file may request the inclusion of a remote document within it, see comments on "Composite Documents" for the request syntax.
+.PP
+Finally SiSU may be run on a remote server, which you download marked up files to for processing. This is not really a function of the operation of SiSU, just an available possibility given that not much bandwidth is required.
+.PP
+* with regard to remote files processed locally, the \-r option, a limitation is that it is up to the user to ensure that the remote file does not have an identical filename to another, e.g. local file, that is to be processed in the same directory. So far this has not been found to happen in practice... Alternative solutions are under consideration, but it is desired that filenames be human assigned, and meaningful, so hash keys of contents for filenames are not amongst the options considered.
+.\" %% Note
+.SH "NOTE"
+.PP
+For basic use only a fraction of the information provided here is required. There may be a bit of an information management problem in determining what though.
+For the markup of a book see the samples provided in
+.I <http://www.jus.uio.no/sisu/sample>
+and referred to in the text
+.I <http://www.jus.uio.no/sisu/SiSU>
+The flags to generate html and pdf for use locally would be sisu \-mHp [name of file to be processed]
+This does assume an ok install and setup of SiSU and the associated software it uses.
+
+.\" %% Processing Examples
+.SH "PROCESSING EXAMPLES"
+.PP
+To initialise a new directory
+.B sisu
+.I \-C
+.PP
+Note: this create a corresponding output subdirectory and this copies css stylesheet files and basic image files to the output directory. The output directory is created in the output path/directory as a subdirectory with its name corresponding to that of the directory you are currently initialising.
+.PP
+generate the metafile used in subsequent processing only (note changes made to the markup file will not appear in subsequently generated text unless this flag is used:
+.B sisu
+.I \-m
+[filename or wildcard]
+.PP
+to create html and pdf output, with verbose output of samplefile1.sst and samplefile2.sst
+.B sisu
+.I \-mhpv
+samplefile1.sst samplefile2.sst
+.RS
+Note:
+.I \-m
+does initial processing, and
+.I \-H
+omits filename suffixes and requires a properly configured web server.
+.I \-h
+is used to include filename suffixes for file system viewing
+.RE
+.PP
+generate html, a word map and pdf with verbose output for all marked up documents in a directory:
+.B sisu
+.I \-mhwpv
+*
+.PP
+generate html, word map, pdf, plaintext, xhtml, xml sax and xml dom versions with verbose output for all marked up documents in a directory:
+.B sisu
+.I \-mhwpabxXv
+*
+.PP
+to create html, pdf, xml, plaintext and a concordance file (wordmap) as output, with verbose output of all marked up files in a directory
+.B sisu
+.I \-mhpxXawv
+*.{r,s}?
+.PP
+generate html, word map and pdf and place on remote server with verbose output 2 named example files in a directory (assumes has been set up, and first time must be run without other flags ie sisu
+.I \-mrv
+[filenames/wildcard]):
+.B sisu
+.I \-mhwprv
+example_file.sst other_example_file.sst
+.PP
+to process a remote sisu marked up file (html,pdf,concordance), provide the url(s) (works for text only files, will be downloaded and processed locally):
+.B sisu
+.I \-mhwpv
+http://www.jus.uio.no/sisu/sample/markup/gpl2.fsf.sst http://www.jus.uio.no/sisu/sample/markup/autonomy_markup0.sst
+.PP
+one file is local the other remote process (html,pdf,concordance,plaintext and place on pre\-set remote destination):
+.B sisu
+.I \-mhwparv
+gpl2.fsf.sst http://www.jus.uio.no/sisu/sample/markup/autonomy_markup0.sst
+.PP
+initialize database, create relations (first manually create database with same name as working directory):
+.B sisu
+.I \-Dv createall
+.PP
+it may be necessary to first run
+.B sisu
+.I \-Dv createdb
+.PP
+import all marked up files first time into a database:
+.B sisu
+.I \-Dv import
+*
+.PP
+.I \-c
+toggles color
+.\" %% Interactive help
+.SH "INTERACTIVE HELP OPTIONS"
+.PP
+SiSU has an interactive help, which is accessed by typing just "sisu" at the command line, or as described below:
+.B sisu
+commands, document preparation, customisation, installation etc.
+.\" preformatted text follows
+.nf
+try:
+.I sisu \-\-help
+
+ sisu help
+ help sisu \-\-help
+ commands sisu \-\-help commands
+ environment sisu \-\-help env
+ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+ Using SiSU
+ commands: sisu \-\-help commands
+ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+ Preparing Documents for SiSU
+ markup: sisu \-\-help markup (an incomplete overview)
+ headers: sisu \-\-help headers (document\-wide instructions, meta\-data)
+ structure sisu \-\-help structure (document structure, headings, tables of contents)
+ endnotes: sisu \-\-help endnotes
+ tables: sisu \-\-help tables
+ an example 0.37: sisu \-\-help example37
+ an example 0.38: sisu \-\-help example38
+ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+ search sisu \-\-help search
+ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+ customise: sisu \-\-help customise
+ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+ SiSU\'s License
+ license: sisu \-\-help license
+
+ sisu interactive help topics include:
+ keywords include: list, commands, shortcuts, markup, syntax, headers,
+ headings, endnotes, tables, example, customise, skin, environment,
+ directories, path, language, db, install, setup, configure,
+ external_programs, dublincore, termsheet, search, features,
+ external_programs, license, exit
+.fi
+
+.SH "SiSU VERSION CONVERSION"
+.PP
+.I sisu \-\-to\-current [filename/wildcard]
+converts from 0.37 markup to current markup (0.38)
+
+.I sisu \-\-to\-38 [filename/wildcard]
+converts from 0.37 markup to 0.38
+
+.I sisu \-\-to\-37 [filename/wildcard]
+converts from 0.38 markup to 0.37
+
+.I sisu \-\-convert\-36to37 [filename/wildcard]
+re\-names file from pre\-0.36 convention to 0.37
+
+.I sisu \-\-convert\-footnotes [filename/wildcard]
+converts footnotes to preferred embedded footnote markup style
+
+.I sisu \-\-convert\-footnotes\-force [filename/wildcard]
+converts footnotes to preferred embedded footnote markup style, even if there is a mismatch of footnote numbers. WARNING: there is a problem with the source document and it is necessary to manually check where each footnotes actually should be.
+
+convert from sst to simple xml representations (sax, dom and node):
+
+.I sisu \-\-to\-sax [filename/wildcard]
+or
+.I sisu \-\-to\-sxs [filename/wildcard]
+
+.I sisu \-\-to\-dom [filename/wildcard]
+or
+.I sisu \-\-to\-sxd [filename/wildcard]
+
+.I sisu \-\-to\-node [filename/wildcard]
+or
+.I sisu \-\-to\-sxn [filename/wildcard]
+
+convert to sst from simple xml representations (sax, dom and node):
+
+.I sisu \-\-from\-xml2sst [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]]
+
+or the same:
+
+.I sisu \-\-from\-sxml [filename/wildcard [.sxs.xml,.sxd.xml,sxn.xml]]
+
+.I sisu \-\-from\-kdi [kdissert filename]
+attempts to convert a kdissert file (.kdi) to sisu markup
+
+.I sisu \-\-identify [filename/wildcard]
+attempts to identify the markup version of the file
+
+.I sisu \-\-query=[version number]
+and
+.I sisu \-\-query=history
+provides a brief summary of changes to SiSU markup
+
+.SH "SAMPLE MARKUP DOCUMENTS"
+.PP
+
+Sample markup documents are provided in sisu\-examples and are available online.
+
+.\" %% Further Information
+.SH "HOME PAGE"
+.PP
+.I <http://www.jus.uio.no/sisu>
+
+.SH "AUTHOR"
+Ralph Amissah
+.I <ralph@amissah.com>
+or
+.I <ralph.amissah@gmail.com>
+
+.SH "SEE ALSO"
+.BR sisu(8),
+.BR sisu_webrick(1),
+.BR sisu_termsheet(1),
+.BR sisu_pdf(1)
+.BR sisu_sqlite(1)
+.BR sisu_postgresql(1)
+.BR sisu_vim(7)
diff --git a/man/man1/sisu_termsheet.1 b/man/man1/sisu_termsheet.1
new file mode 100644
index 00000000..48044296
--- /dev/null
+++ b/man/man1/sisu_termsheet.1
@@ -0,0 +1,60 @@
+.\" Name: SiSU information Structuring Universe
+.\" Author: Ralph Amissah
+.\" Description: sisu termsheet (preprocessing) manpage
+.\" arch-tag: sisu manpage
+.\" License: GPL 2 or later
+.\" Notes: Process this file with
+.\" groff -man -Tascii sisu.1
+.\" nroff -man sisu.1 | most
+.\" |sisu.1|@|^|<url:sisu.1>
+.TH sisu_termsheet 1 "December 17, 2005" "version 0.34" "SiSU termsheet merge (sisu \-t [termsheet\-name])"
+.SH NAME
+.B SiSU
+\- Structured information, Serialized Units \- a document publishing system
+.SH SYNOPSIS
+.PP
+.B sisu
+.B \-t
+.I [termsheet\-name(s)]
+.\"%% Description
+.SH DESCRIPTION
+.B sisu_termsheet
+.I is part of SiSU is
+.B invoked
+.I through the sisu command (man sisu)
+.PP
+.\"%% Summary
+.SH Summary of man page
+.PP
+sisu_termsheet, is started with the command:
+.B sisu \-t
+.I [termsheet\-name(s)]
+.\"%% Flags
+.SH DOCUMENT PROCESSING COMMAND FLAGS
+.PP
+.BI sisu \ \-t \ [termsheet\-name(s)]
+(runs sisu_termsheet) merges the termsheet(s) specified on the commandline with the documents it is instructed to merge in the termsheet(s), and produces regular
+.I SiSU
+output documents from the merged results.
+.PP
+[further documentation on termsheets required]
+.\"%% Further Information
+.SH FURTHER INFORMATION
+.PP
+For more information on
+.I SiSU
+see:
+.I <http://www.jus.uio.no/sisu>
+.PP
+or
+.I man sisu
+.SH AUTHOR
+Ralph Amissah
+.I <ralph@amissah.com>
+or
+.I <ralph.amissah@gmail.com>
+.SH SEE ALSO
+.BR sisu(1),
+.BR sisu(8),
+.BR sisu_webrick(1),
+.BR sisu_vim(7)
diff --git a/man/man1/sisu_webrick.1 b/man/man1/sisu_webrick.1
new file mode 100644
index 00000000..ecdcb9b4
--- /dev/null
+++ b/man/man1/sisu_webrick.1
@@ -0,0 +1,76 @@
+.\" Name: SiSU information Structuring Universe
+.\" Author: Ralph Amissah
+.\" Description: sisu webrick manpage
+.\" arch-tag: sisu manpage
+.\" License: GPL 2 or later
+.\" Notes: Process this file with
+.\" groff -man -Tascii sisu.1
+.\" nroff -man sisu.1 | most
+.\" |sisu.1|@|^|<url:sisu.1>
+.TH sisu_webrick 1 "December 17, 2005" "version 0.34" "sisu \-W"
+.SH NAME
+.B SiSU
+\- Structured information, Serialized Units \- a document publishing system
+.SH SYNOPSIS
+.B sisu_webrick
+.I [port]
+.PP
+or
+.PP
+.B sisu
+.B \-W
+.I [port]
+.\"%% Description
+.SH DESCRIPTION
+.B sisu_webrick
+.I is part of SiSU (man sisu)
+sisu_webrick starts Ruby\'s Webrick web\-server and points it to the directories to which
+.I SiSU
+output is written, providing a list of these directories (assuming
+.I SiSU
+is in use and they exist).
+.PP
+The default port for sisu_webrick is set to 8081, this may be modified in the yaml file:
+.I ~/.sisu/sisurc.yaml
+a sample of which is provided as
+.I /etc/sisu/sisurc.yaml
+(or in the equivalent directory on your system).
+.\"%% Summary
+.SH Summary of man page
+.PP
+sisu_webrick, may be started on it\'s own with the command:
+.B sisu_webrick
+.I [port]
+or using the sisu command with the \-W flag:
+.B sisu \-W
+.I [port]
+.PP
+where no port is given and settings are unchanged the default port is 8081
+.\"%% Flags
+.SH DOCUMENT PROCESSING COMMAND FLAGS
+.PP
+.BI sisu \ \-W \ [port]
+starts Ruby Webrick web\-server, serving
+.I SiSU
+output directories, on the port provided, or if no port is provided and the defaults have not been changed in
+.I ~/.sisu/sisurc.yaml
+then on port 8081
+.\"%% Further Information
+.SH FURTHER INFORMATION
+.PP
+For more information on
+.I SiSU
+see:
+.I <http://www.jus.uio.no/sisu>
+.PP
+or
+.I man sisu
+.SH AUTHOR
+Ralph Amissah
+.I <ralph@amissah.com>
+or
+.I <ralph.amissah@gmail.com>
+.SH SEE ALSO
+.BR sisu(1),
+.BR sisu_vim(7)
+.BR sisu(8),
diff --git a/man/man7/sisu_vim.7 b/man/man7/sisu_vim.7
new file mode 100644
index 00000000..af4f8135
--- /dev/null
+++ b/man/man7/sisu_vim.7
@@ -0,0 +1,59 @@
+.\" Name: SiSU information Structuring Universe
+.\" Author: Ralph Amissah
+.\" Description: vim sisu package manpage
+.\" arch-tag: sisu manpage
+.\" License: GPL 2 or later
+.\" Notes: Process this file with
+.\" groff -man -Tascii vim_sisu.1
+.\" nroff -man vim_sisu.1 | most
+.\" |sisu.1|@|^|<url:sisu.1>
+.TH vim_sisu 7 "July 7, 2006" "version 0.42" "vim syntax and filetype plugin with folds for SiSU markup"
+.SH NAME
+.B SiSU
+\- Structured information, Serialized Units \- a document publishing system.
+.SH SYNOPSIS
+.PP
+An ftplugin to provide vim folds for SiSU markup, and to set some defaults for SiSU markup in installed by sisu.
+.PP
+Vim 7 includes sisu markup syntax highlighting.
+.PP
+Vim related files are included in /usr/share/sisu/vim/addons, (including the syntax highlighter which may be used by Vim 6).
+.PP
+sisu\-vim actions are activated on files with the suffix .sst .ssm .ssi .-sst ._sst (and the same with a further .meta extension)
+.PP
+.BI <ctrl>F
+activate folds on headings matched in a document (also provides folds when sourced on a ruby program file), also
+.B :F
+.PP
+.BI <ctrl>S
+search and replace down
+.PP
+.BI <ctrl>G
+search and replace globally within file
+.PP
+.BI <ctrl>X
+ruby regex global search and replace within file
+.PP
+.BI <ctrl>C
+set color scheme to
+.B slate
+which is provided
+.\"%% Further Information
+.SH FURTHER INFORMATION
+.PP
+For more information on
+.I SiSU
+see:
+.I <http://www.jus.uio.no/sisu>
+.PP
+or
+.I man sisu
+.SH AUTHOR
+Ralph Amissah
+.I <ralph@amissah.com>
+or
+.I <ralph.amissah@gmail.com>
+.SH SEE ALSO
+.BR sisu(1),
+.BR sisu(8),
+.BR sisu_webrick(1)
diff --git a/man/man8/sisu.8 b/man/man8/sisu.8
new file mode 100644
index 00000000..c55847d4
--- /dev/null
+++ b/man/man8/sisu.8
@@ -0,0 +1,276 @@
+.\" Name: SiSU information Structuring Universe
+.\" Author: Ralph Amissah
+.\" Description: sisu manpage
+.\" License: GPL 2 or later
+.\" Notes: Process this file with
+.\" groff -man -Tascii sisu.1
+.\" nroff -man sisu.1 | most
+.\" /[^\\][-']
+.\" :%s/\([^\\]\)\([-']\)/\1\\\2/c
+.TH sisu 8 "October 26, 2006" "version 0.48" "CONFIGURATION and SETUP"
+.SH NAME
+.B SiSU
+\- Structured information, Serialized Units \- a document publishing system
+.SH SYNOPSIS
+.B sisu
+.B [\-mhwpxXv...] [
+.I filename/wildcard
+.B ]
+.\"%% Description
+.SH DESCRIPTION
+A document publishing system, that from a simple single marked\-up document,
+produces a multitude of output formats including: html, latex, pdf, info, and
+sql output, which can be cross referenced as having the same document structure
+and text object numbering, "object citation numbering". Features include its\'
+simple syntax; the semantic identification of documents using the Dublin Core;
+document management; built to be associated with a revision control system;
+text object numbering for the identification of a texts location in any of the
+output formats, easy skinning on a site wide, or per document basis, ... for
+more see
+.I man 1 sisu
+or
+.I <http://www.jus.uio.no/sisu>
+.PP
+.B SiSU is an alternative way of publishing and managing documents.
+.\"%% Installation
+.SH INSTALLATION
+.PP
+Up to date information on SiSU downloads, and their installation should be
+available from:
+.I <http://www.jus.uio.no/sisu/SiSU/download.html>
+or at:
+.I <http://www.jus.uio.no/sisu/sisu_download/download.html>
+.PP
+There you should find links to the latest source tarball, and instructions on
+how to install SiSU.
+.PP
+Sample marked up documents are are available at
+.I /usr/share/doc/sisu/sisu_markup_samples/dfsg
+or equivalent directory, or online at
+.I <http://www.jus.uio.no/sisu/sample/markup.html>
+or for viewing in html with syntax highlighting from
+.I <http://www.jus.uio.no/sisu/sample/syntax>
+.PP
+A syntax table is provided at
+.I /usr/share/doc/sisu/on_markup.txt
+or equivalent, and online at
+.I <http://www.jus.uio.no/sisu/sample/on_markup.txt>
+.PP
+.I man 1 sisu
+has a syntax table along with processing commands.
+.PP
+SiSU also provides some help via the command:
+.I sisu \-\-help
+and selecting an appropriate subject, e.g.
+.PP
+.I sisu \-\-help commands
+.PP
+.I sisu \-\-help markup
+.PP
+.I sisu \-\-help headers
+.PP
+.I sisu \-\-help env
+.PP
+The rest of this note is on post installation setup
+.\"%% Post Installation Setup
+.SH Post Installation Setup \- Quick start
+.PP
+After installation of sisu-complete, move to the document samples directory
+.PP
+ cd /usr/share/doc/sisu/sisu_markup_samples/dfsg
+.PP
+and run
+.PP
+ sisu \-1 free_as_in_freedom.rms_and_free_software.sam_williams.sst
+.PP
+or the same:
+.PP
+ sisu \-NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst
+.PP
+look at output results, see the "sisu_manifest" page created for the document
+.PP
+To generate an online document move to a writable directory, (create a work
+directory and cd into it) as the file will be downloaded there and e.g.
+.PP
+.I sisu \-1 http://www.jus.uio.no/sisu/gpl2.fsf/gpl2.fsf.sst
+.PP
+.I sisu \-3 http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst
+.PP
+examine source document, vim has syntax highlighting support
+.PP
+gvim free_as_in_freedom.rms_and_free_software.sam_williams.sst
+.PP
+additional markup samples in
+.I <http://www.jus.uio.no/sisu/SiSU/2.html>
+.PP
+it should also be possible to run sisu against sisupods (prepared zip files, created by running the command sisu -S [filename]), whether stored locally or remotely.
+.PP
+.I sisu \-3 http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip
+.PP
+there is a security issue associated with the running of document skins that are not your own, so these are turned of by default, and the use of the following command, which switches on the associated skin is not recommended:
+.PP
+.I sisu \-3 \-\-trust http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip
+.PP
+For help
+.I man sisu
+.PP
+.I sisu \-\-help
+.PP
+.I sisu \-\-help env
+for the way sisu "sees/maps" your system
+.PP
+.I sisu \-\-help commands
+for list of commands and so on
+.PP
+.\"%% B. Generate a (local) document from a markup/work directory.
+.B Document markup directory
+.PP
+Perhaps the easiest way to begin is to create a directory for sisu marked up
+documents within your home directory, and copy the file structure (and document
+samples) provided in the document sample directory:
+.I mkdir ~/sisu_test
+.PP
+.I cd ~/sisu_test
+.PP
+.I cp \-a /usr/share/doc/sisu/sisu_markup_samples/dfsg/* ~/sisu_test/.
+.PP
+.B \-\-\-\-\-\-\-\-\-\-
+.PP
+.B Tip:
+the markup syntax examples may be of interest
+.I <http://www.jus.uio.no/sisu/sample/>
+.PP
+.B Tip:
+.I sisu \-U [sisu markup filename]
+should printout the different possible outputs and where sisu would place them.
+.PP
+.B Tip:
+if you want to toggle ansi color add
+.I c
+to your flags.
+.PP
+.B \-\-\-\-\-\-\-\-\-\-
+.PP
+.\"%% configuration files
+.B SiSU configuration file search path is:
+.PP
+.I ./_sisu/sisurc.yaml
+.PP
+.I ~/.sisu/sisurc.yaml
+.PP
+.I /etc/sisu/sisurc.yaml
+.PP
+.\"%% Debian Installation Note
+.SH Debian INSTALLATION Note
+.PP
+It is best you see
+.I <http://www.jus.uio.no/sisu/SiSU/download.html#debian>
+for up the most up to date information.
+.PP
+notes taken from the Debian control file (end edited), gives an idea of
+additional packages that SiSU can make use of if available, (the
+use/requirement of some of which are interdependent for specific actions by
+SiSU):
+.PP
+Package: sisu
+.PP
+Depends: ruby (>= 1.8.4), libwebrick-ruby
+.PP
+Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, librmagick-ruby, trang,
+ tidy, librexml-ruby, zip, unzip, openssl, rsync, openssh-client \| lsh-client,
+ keychain, hyperestraier, kdissert
+.PP
+Suggests: libfcgi-ruby1.8, rcs \| cvs, lv, texinfo, pinfo, rename
+.PP
+Package: sisu-complete
+.PP
+Depends: ruby (>= 1.8.4), sisu, sisu-pdf, sisu-postgresql, sisu-sqlite
+.PP
+Recommends: hyperestraier
+.PP
+Package: sisu-pdf
+.PP
+Depends: sisu, tetex-bin \| texlive-base-bin, tetex-extra \| texlive-latex-extra,
+ texlive-latex-extra, latex-ucs
+.PP
+Suggests: evince, xpdf
+.PP
+Package: sisu-postgresql
+.PP
+Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
+.PP
+Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1
+.PP
+Package: sisu-sqlite
+.PP
+Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
+.PP
+Suggests: libdbd-sqlite
+.PP
+Package: sisu-markup-samples
+.PP
+Depends: sisu
+.PP
+.fi
+.\"%% Configuration Files
+.SH DOCUMENT RESOURCE CONFIGURATION
+.B sisu
+resource configuration information is obtained from sources (where they exist):
+.\" preformatted text follows
+.nf
+.I ~/.sisu/sisurc.yaml
+.I /etc/sisu/[sisu version]/sisurc.yaml
+.I sisu program defaults
+.fi
+.PP
+.\"%% Skins
+.B Skins
+.PP
+default document appearance may be modified using skins contained in
+sub\-directories located at the following paths:
+.\" preformatted text follows
+.nf
+.I ./_sisu/skin
+.I ~/.sisu/skin
+.I /etc/sisu/skin
+.fi
+.PP
+more specifically, the following locations (or their /etc/sisu equivalent) should be used:
+.PP
+.I ~/.sisu/skin/doc
+skins for individual documents;
+.PP
+.I ~/.sisu/skin/dir
+skins for directories of matching names;
+.PP
+.I ~/.sisu/skin/site
+site\-wide skin
+modifying the site\-wide appearance of documents.
+.PP
+Usually all skin files are placed in the document skin directory:
+.I ~/.sisu/skin/doc
+with softlinks being made to the skins contained there from other skin directories as required.
+.\"%% Further Information
+.SH FURTHER INFORMATION
+.PP
+For more information on
+.I SiSU
+see:
+.I <http://www.jus.uio.no/sisu>
+.PP
+or
+.I man sisu
+.\"%% Author
+.SH AUTHOR
+Ralph Amissah
+.I <ralph@amissah.com>
+or
+.I <ralph.amissah@gmail.com>
+.SH SEE ALSO
+.BR sisu(1),
+.BR sisu_examples(1),
+.BR sisu_webrick(1),
+.BR sisu_pdf(1)
+.BR sisu_sqlite(1)
+.BR sisu_postgresql(1)
+.BR sisu_termsheet(1),
diff --git a/setup.rb b/setup.rb
new file mode 100644
index 00000000..424a5f37
--- /dev/null
+++ b/setup.rb
@@ -0,0 +1,1585 @@
+#
+# setup.rb
+#
+# Copyright (c) 2000-2005 Minero Aoki
+#
+# This program is free software.
+# You can distribute/modify this program under the terms of
+# the GNU LGPL, Lesser General Public License version 2.1.
+#
+
+unless Enumerable.method_defined?(:map) # Ruby 1.4.6
+ module Enumerable
+ alias map collect
+ end
+end
+
+unless File.respond_to?(:read) # Ruby 1.6
+ def File.read(fname)
+ open(fname) {|f|
+ return f.read
+ }
+ end
+end
+
+unless Errno.const_defined?(:ENOTEMPTY) # Windows?
+ module Errno
+ class ENOTEMPTY
+ # We do not raise this exception, implementation is not needed.
+ end
+ end
+end
+
+def File.binread(fname)
+ open(fname, 'rb') {|f|
+ return f.read
+ }
+end
+
+# for corrupted Windows' stat(2)
+def File.dir?(path)
+ File.directory?((path[-1,1] == '/') ? path : path + '/')
+end
+
+
+class ConfigTable
+
+ include Enumerable
+
+ def initialize(rbconfig)
+ @rbconfig = rbconfig
+ @items = []
+ @table = {}
+ # options
+ @install_prefix = nil
+ @config_opt = nil
+ @verbose = true
+ @no_harm = false
+ end
+
+ attr_accessor :install_prefix
+ attr_accessor :config_opt
+
+ attr_writer :verbose
+
+ def verbose?
+ @verbose
+ end
+
+ attr_writer :no_harm
+
+ def no_harm?
+ @no_harm
+ end
+
+ def [](key)
+ lookup(key).resolve(self)
+ end
+
+ def []=(key, val)
+ lookup(key).set val
+ end
+
+ def names
+ @items.map {|i| i.name }
+ end
+
+ def each(&block)
+ @items.each(&block)
+ end
+
+ def key?(name)
+ @table.key?(name)
+ end
+
+ def lookup(name)
+ @table[name] or setup_rb_error "no such config item: #{name}"
+ end
+
+ def add(item)
+ @items.push item
+ @table[item.name] = item
+ end
+
+ def remove(name)
+ item = lookup(name)
+ @items.delete_if {|i| i.name == name }
+ @table.delete_if {|name, i| i.name == name }
+ item
+ end
+
+ def load_script(path, inst = nil)
+ if File.file?(path)
+ MetaConfigEnvironment.new(self, inst).instance_eval File.read(path), path
+ end
+ end
+
+ def savefile
+ '.config'
+ end
+
+ def load_savefile
+ begin
+ File.foreach(savefile()) do |line|
+ k, v = *line.split(/=/, 2)
+ self[k] = v.strip
+ end
+ rescue Errno::ENOENT
+ setup_rb_error $!.message + "\n#{File.basename($0)} config first"
+ end
+ end
+
+ def save
+ @items.each {|i| i.value }
+ File.open(savefile(), 'w') {|f|
+ @items.each do |i|
+ f.printf "%s=%s\n", i.name, i.value if i.value? and i.value
+ end
+ }
+ end
+
+ def load_standard_entries
+ standard_entries(@rbconfig).each do |ent|
+ add ent
+ end
+ end
+
+ def standard_entries(rbconfig)
+ c = rbconfig
+
+ rubypath = File.join(c['bindir'], c['ruby_install_name'] + c['EXEEXT'])
+
+ major = c['MAJOR'].to_i
+ minor = c['MINOR'].to_i
+ teeny = c['TEENY'].to_i
+ version = "#{major}.#{minor}"
+
+ # ruby ver. >= 1.4.4?
+ newpath_p = ((major >= 2) or
+ ((major == 1) and
+ ((minor >= 5) or
+ ((minor == 4) and (teeny >= 4)))))
+
+ if c['rubylibdir']
+ # V > 1.6.3
+ libruby = "#{c['prefix']}/lib/ruby"
+ librubyver = c['rubylibdir']
+ librubyverarch = c['archdir']
+ siteruby = c['sitedir']
+ siterubyver = c['sitelibdir']
+ siterubyverarch = c['sitearchdir']
+ elsif newpath_p
+ # 1.4.4 <= V <= 1.6.3
+ libruby = "#{c['prefix']}/lib/ruby"
+ librubyver = "#{c['prefix']}/lib/ruby/#{version}"
+ librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
+ siteruby = c['sitedir']
+ siterubyver = "$siteruby/#{version}"
+ siterubyverarch = "$siterubyver/#{c['arch']}"
+ else
+ # V < 1.4.4
+ libruby = "#{c['prefix']}/lib/ruby"
+ librubyver = "#{c['prefix']}/lib/ruby/#{version}"
+ librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
+ siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
+ siterubyver = siteruby
+ siterubyverarch = "$siterubyver/#{c['arch']}"
+ end
+ parameterize = lambda {|path|
+ path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')
+ }
+
+ if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
+ makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
+ else
+ makeprog = 'make'
+ end
+
+ [
+ ExecItem.new('installdirs', 'std/site/home',
+ 'std: install under libruby; site: install under site_ruby; home: install under $HOME')\
+ {|val, table|
+ case val
+ when 'std'
+ table['rbdir'] = '$librubyver'
+ table['sodir'] = '$librubyverarch'
+ when 'site'
+ table['rbdir'] = '$siterubyver'
+ table['sodir'] = '$siterubyverarch'
+ when 'home'
+ setup_rb_error '$HOME was not set' unless ENV['HOME']
+ table['prefix'] = ENV['HOME']
+ table['rbdir'] = '$libdir/ruby'
+ table['sodir'] = '$libdir/ruby'
+ end
+ },
+ PathItem.new('prefix', 'path', c['prefix'],
+ 'path prefix of target environment'),
+ PathItem.new('bindir', 'path', parameterize.call(c['bindir']),
+ 'the directory for commands'),
+ PathItem.new('libdir', 'path', parameterize.call(c['libdir']),
+ 'the directory for libraries'),
+ PathItem.new('datadir', 'path', parameterize.call(c['datadir']),
+ 'the directory for shared data'),
+ PathItem.new('mandir', 'path', parameterize.call(c['mandir']),
+ 'the directory for man pages'),
+ PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']),
+ 'the directory for system configuration files'),
+ PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']),
+ 'the directory for local state data'),
+ PathItem.new('libruby', 'path', libruby,
+ 'the directory for ruby libraries'),
+ PathItem.new('librubyver', 'path', librubyver,
+ 'the directory for standard ruby libraries'),
+ PathItem.new('librubyverarch', 'path', librubyverarch,
+ 'the directory for standard ruby extensions'),
+ PathItem.new('siteruby', 'path', siteruby,
+ 'the directory for version-independent aux ruby libraries'),
+ PathItem.new('siterubyver', 'path', siterubyver,
+ 'the directory for aux ruby libraries'),
+ PathItem.new('siterubyverarch', 'path', siterubyverarch,
+ 'the directory for aux ruby binaries'),
+ PathItem.new('rbdir', 'path', '$siterubyver',
+ 'the directory for ruby scripts'),
+ PathItem.new('sodir', 'path', '$siterubyverarch',
+ 'the directory for ruby extentions'),
+ PathItem.new('rubypath', 'path', rubypath,
+ 'the path to set to #! line'),
+ ProgramItem.new('rubyprog', 'name', rubypath,
+ 'the ruby program using for installation'),
+ ProgramItem.new('makeprog', 'name', makeprog,
+ 'the make program to compile ruby extentions'),
+ SelectItem.new('shebang', 'all/ruby/never', 'ruby',
+ 'shebang line (#!) editing mode'),
+ BoolItem.new('without-ext', 'yes/no', 'no',
+ 'does not compile/install ruby extentions')
+ ]
+ end
+ private :standard_entries
+
+ def load_multipackage_entries
+ multipackage_entries().each do |ent|
+ add ent
+ end
+ end
+
+ def multipackage_entries
+ [
+ PackageSelectionItem.new('with', 'name,name...', '', 'ALL',
+ 'package names that you want to install'),
+ PackageSelectionItem.new('without', 'name,name...', '', 'NONE',
+ 'package names that you do not want to install')
+ ]
+ end
+ private :multipackage_entries
+
+ ALIASES = {
+ 'std-ruby' => 'librubyver',
+ 'stdruby' => 'librubyver',
+ 'rubylibdir' => 'librubyver',
+ 'archdir' => 'librubyverarch',
+ 'site-ruby-common' => 'siteruby', # For backward compatibility
+ 'site-ruby' => 'siterubyver', # For backward compatibility
+ 'bin-dir' => 'bindir',
+ 'bin-dir' => 'bindir',
+ 'rb-dir' => 'rbdir',
+ 'so-dir' => 'sodir',
+ 'data-dir' => 'datadir',
+ 'ruby-path' => 'rubypath',
+ 'ruby-prog' => 'rubyprog',
+ 'ruby' => 'rubyprog',
+ 'make-prog' => 'makeprog',
+ 'make' => 'makeprog'
+ }
+
+ def fixup
+ ALIASES.each do |ali, name|
+ @table[ali] = @table[name]
+ end
+ @items.freeze
+ @table.freeze
+ @options_re = /\A--(#{@table.keys.join('|')})(?:=(.*))?\z/
+ end
+
+ def parse_opt(opt)
+ m = @options_re.match(opt) or setup_rb_error "config: unknown option #{opt}"
+ m.to_a[1,2]
+ end
+
+ def dllext
+ @rbconfig['DLEXT']
+ end
+
+ def value_config?(name)
+ lookup(name).value?
+ end
+
+ class Item
+ def initialize(name, template, default, desc)
+ @name = name.freeze
+ @template = template
+ @value = default
+ @default = default
+ @description = desc
+ end
+
+ attr_reader :name
+ attr_reader :description
+
+ attr_accessor :default
+ alias help_default default
+
+ def help_opt
+ "--#{@name}=#{@template}"
+ end
+
+ def value?
+ true
+ end
+
+ def value
+ @value
+ end
+
+ def resolve(table)
+ @value.gsub(%r<\$([^/]+)>) { table[$1] }
+ end
+
+ def set(val)
+ @value = check(val)
+ end
+
+ private
+
+ def check(val)
+ setup_rb_error "config: --#{name} requires argument" unless val
+ val
+ end
+ end
+
+ class BoolItem < Item
+ def config_type
+ 'bool'
+ end
+
+ def help_opt
+ "--#{@name}"
+ end
+
+ private
+
+ def check(val)
+ return 'yes' unless val
+ case val
+ when /\Ay(es)?\z/i, /\At(rue)?\z/i then 'yes'
+ when /\An(o)?\z/i, /\Af(alse)\z/i then 'no'
+ else
+ setup_rb_error "config: --#{@name} accepts only yes/no for argument"
+ end
+ end
+ end
+
+ class PathItem < Item
+ def config_type
+ 'path'
+ end
+
+ private
+
+ def check(path)
+ setup_rb_error "config: --#{@name} requires argument" unless path
+ path[0,1] == '$' ? path : File.expand_path(path)
+ end
+ end
+
+ class ProgramItem < Item
+ def config_type
+ 'program'
+ end
+ end
+
+ class SelectItem < Item
+ def initialize(name, selection, default, desc)
+ super
+ @ok = selection.split('/')
+ end
+
+ def config_type
+ 'select'
+ end
+
+ private
+
+ def check(val)
+ unless @ok.include?(val.strip)
+ setup_rb_error "config: use --#{@name}=#{@template} (#{val})"
+ end
+ val.strip
+ end
+ end
+
+ class ExecItem < Item
+ def initialize(name, selection, desc, &block)
+ super name, selection, nil, desc
+ @ok = selection.split('/')
+ @action = block
+ end
+
+ def config_type
+ 'exec'
+ end
+
+ def value?
+ false
+ end
+
+ def resolve(table)
+ setup_rb_error "$#{name()} wrongly used as option value"
+ end
+
+ undef set
+
+ def evaluate(val, table)
+ v = val.strip.downcase
+ unless @ok.include?(v)
+ setup_rb_error "invalid option --#{@name}=#{val} (use #{@template})"
+ end
+ @action.call v, table
+ end
+ end
+
+ class PackageSelectionItem < Item
+ def initialize(name, template, default, help_default, desc)
+ super name, template, default, desc
+ @help_default = help_default
+ end
+
+ attr_reader :help_default
+
+ def config_type
+ 'package'
+ end
+
+ private
+
+ def check(val)
+ unless File.dir?("packages/#{val}")
+ setup_rb_error "config: no such package: #{val}"
+ end
+ val
+ end
+ end
+
+ class MetaConfigEnvironment
+ def initialize(config, installer)
+ @config = config
+ @installer = installer
+ end
+
+ def config_names
+ @config.names
+ end
+
+ def config?(name)
+ @config.key?(name)
+ end
+
+ def bool_config?(name)
+ @config.lookup(name).config_type == 'bool'
+ end
+
+ def path_config?(name)
+ @config.lookup(name).config_type == 'path'
+ end
+
+ def value_config?(name)
+ @config.lookup(name).config_type != 'exec'
+ end
+
+ def add_config(item)
+ @config.add item
+ end
+
+ def add_bool_config(name, default, desc)
+ @config.add BoolItem.new(name, 'yes/no', default ? 'yes' : 'no', desc)
+ end
+
+ def add_path_config(name, default, desc)
+ @config.add PathItem.new(name, 'path', default, desc)
+ end
+
+ def set_config_default(name, default)
+ @config.lookup(name).default = default
+ end
+
+ def remove_config(name)
+ @config.remove(name)
+ end
+
+ # For only multipackage
+ def packages
+ raise '[setup.rb fatal] multi-package metaconfig API packages() called for single-package; contact application package vendor' unless @installer
+ @installer.packages
+ end
+
+ # For only multipackage
+ def declare_packages(list)
+ raise '[setup.rb fatal] multi-package metaconfig API declare_packages() called for single-package; contact application package vendor' unless @installer
+ @installer.packages = list
+ end
+ end
+
+end # class ConfigTable
+
+
+# This module requires: #verbose?, #no_harm?
+module FileOperations
+
+ def mkdir_p(dirname, prefix = nil)
+ dirname = prefix + File.expand_path(dirname) if prefix
+ $stderr.puts "mkdir -p #{dirname}" if verbose?
+ return if no_harm?
+
+ # Does not check '/', it's too abnormal.
+ dirs = File.expand_path(dirname).split(%r<(?=/)>)
+ if /\A[a-z]:\z/i =~ dirs[0]
+ disk = dirs.shift
+ dirs[0] = disk + dirs[0]
+ end
+ dirs.each_index do |idx|
+ path = dirs[0..idx].join('')
+ Dir.mkdir path unless File.dir?(path)
+ end
+ end
+
+ def rm_f(path)
+ $stderr.puts "rm -f #{path}" if verbose?
+ return if no_harm?
+ force_remove_file path
+ end
+
+ def rm_rf(path)
+ $stderr.puts "rm -rf #{path}" if verbose?
+ return if no_harm?
+ remove_tree path
+ end
+
+ def remove_tree(path)
+ if File.symlink?(path)
+ remove_file path
+ elsif File.dir?(path)
+ remove_tree0 path
+ else
+ force_remove_file path
+ end
+ end
+
+ def remove_tree0(path)
+ Dir.foreach(path) do |ent|
+ next if ent == '.'
+ next if ent == '..'
+ entpath = "#{path}/#{ent}"
+ if File.symlink?(entpath)
+ remove_file entpath
+ elsif File.dir?(entpath)
+ remove_tree0 entpath
+ else
+ force_remove_file entpath
+ end
+ end
+ begin
+ Dir.rmdir path
+ rescue Errno::ENOTEMPTY
+ # directory may not be empty
+ end
+ end
+
+ def move_file(src, dest)
+ force_remove_file dest
+ begin
+ File.rename src, dest
+ rescue
+ File.open(dest, 'wb') {|f|
+ f.write File.binread(src)
+ }
+ File.chmod File.stat(src).mode, dest
+ File.unlink src
+ end
+ end
+
+ def force_remove_file(path)
+ begin
+ remove_file path
+ rescue
+ end
+ end
+
+ def remove_file(path)
+ File.chmod 0777, path
+ File.unlink path
+ end
+
+ def install(from, dest, mode, prefix = nil)
+ $stderr.puts "install #{from} #{dest}" if verbose?
+ return if no_harm?
+
+ realdest = prefix ? prefix + File.expand_path(dest) : dest
+ realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
+ str = File.binread(from)
+ if diff?(str, realdest)
+ verbose_off {
+ rm_f realdest if File.exist?(realdest)
+ }
+ File.open(realdest, 'wb') {|f|
+ f.write str
+ }
+ File.chmod mode, realdest
+
+ File.open("#{objdir_root()}/InstalledFiles", 'a') {|f|
+ if prefix
+ f.puts realdest.sub(prefix, '')
+ else
+ f.puts realdest
+ end
+ }
+ end
+ end
+
+ def diff?(new_content, path)
+ return true unless File.exist?(path)
+ new_content != File.binread(path)
+ end
+
+ def command(*args)
+ $stderr.puts args.join(' ') if verbose?
+ system(*args) or raise RuntimeError,
+ "system(#{args.map{|a| a.inspect }.join(' ')}) failed"
+ end
+
+ def ruby(*args)
+ command config('rubyprog'), *args
+ end
+
+ def make(task = nil)
+ command(*[config('makeprog'), task].compact)
+ end
+
+ def extdir?(dir)
+ File.exist?("#{dir}/MANIFEST") or File.exist?("#{dir}/extconf.rb")
+ end
+
+ def files_of(dir)
+ Dir.open(dir) {|d|
+ return d.select {|ent| File.file?("#{dir}/#{ent}") }
+ }
+ end
+
+ DIR_REJECT = %w( . .. CVS SCCS RCS CVS.adm .svn )
+
+ def directories_of(dir)
+ Dir.open(dir) {|d|
+ return d.select {|ent| File.dir?("#{dir}/#{ent}") } - DIR_REJECT
+ }
+ end
+
+end
+
+
+# This module requires: #srcdir_root, #objdir_root, #relpath
+module HookScriptAPI
+
+ def get_config(key)
+ @config[key]
+ end
+
+ alias config get_config
+
+ # obsolete: use metaconfig to change configuration
+ def set_config(key, val)
+ @config[key] = val
+ end
+
+ #
+ # srcdir/objdir (works only in the package directory)
+ #
+
+ def curr_srcdir
+ "#{srcdir_root()}/#{relpath()}"
+ end
+
+ def curr_objdir
+ "#{objdir_root()}/#{relpath()}"
+ end
+
+ def srcfile(path)
+ "#{curr_srcdir()}/#{path}"
+ end
+
+ def srcexist?(path)
+ File.exist?(srcfile(path))
+ end
+
+ def srcdirectory?(path)
+ File.dir?(srcfile(path))
+ end
+
+ def srcfile?(path)
+ File.file?(srcfile(path))
+ end
+
+ def srcentries(path = '.')
+ Dir.open("#{curr_srcdir()}/#{path}") {|d|
+ return d.to_a - %w(. ..)
+ }
+ end
+
+ def srcfiles(path = '.')
+ srcentries(path).select {|fname|
+ File.file?(File.join(curr_srcdir(), path, fname))
+ }
+ end
+
+ def srcdirectories(path = '.')
+ srcentries(path).select {|fname|
+ File.dir?(File.join(curr_srcdir(), path, fname))
+ }
+ end
+
+end
+
+
+class ToplevelInstaller
+
+ Version = '3.4.1'
+ Copyright = 'Copyright (c) 2000-2005 Minero Aoki'
+
+ TASKS = [
+ [ 'all', 'do config, setup, then install' ],
+ [ 'config', 'saves your configurations' ],
+ [ 'show', 'shows current configuration' ],
+ [ 'setup', 'compiles ruby extentions and others' ],
+ [ 'install', 'installs files' ],
+ [ 'test', 'run all tests in test/' ],
+ [ 'clean', "does `make clean' for each extention" ],
+ [ 'distclean',"does `make distclean' for each extention" ]
+ ]
+
+ def ToplevelInstaller.invoke
+ config = ConfigTable.new(load_rbconfig())
+ config.load_standard_entries
+ config.load_multipackage_entries if multipackage?
+ config.fixup
+ klass = (multipackage?() ? ToplevelInstallerMulti : ToplevelInstaller)
+ klass.new(File.dirname($0), config).invoke
+ end
+
+ def ToplevelInstaller.multipackage?
+ File.dir?(File.dirname($0) + '/packages')
+ end
+
+ def ToplevelInstaller.load_rbconfig
+ if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
+ ARGV.delete(arg)
+ load File.expand_path(arg.split(/=/, 2)[1])
+ $".push 'rbconfig.rb'
+ else
+ require 'rbconfig'
+ end
+ ::Config::CONFIG
+ end
+
+ def initialize(ardir_root, config)
+ @ardir = File.expand_path(ardir_root)
+ @config = config
+ # cache
+ @valid_task_re = nil
+ end
+
+ def config(key)
+ @config[key]
+ end
+
+ def inspect
+ "#<#{self.class} #{__id__()}>"
+ end
+
+ def invoke
+ run_metaconfigs
+ case task = parsearg_global()
+ when nil, 'all'
+ parsearg_config
+ init_installers
+ exec_config
+ exec_setup
+ exec_install
+ else
+ case task
+ when 'config', 'test'
+ ;
+ when 'clean', 'distclean'
+ @config.load_savefile if File.exist?(@config.savefile)
+ else
+ @config.load_savefile
+ end
+ __send__ "parsearg_#{task}"
+ init_installers
+ __send__ "exec_#{task}"
+ end
+ end
+
+ def run_metaconfigs
+ @config.load_script "#{@ardir}/metaconfig"
+ end
+
+ def init_installers
+ @installer = Installer.new(@config, @ardir, File.expand_path('.'))
+ end
+
+ #
+ # Hook Script API bases
+ #
+
+ def srcdir_root
+ @ardir
+ end
+
+ def objdir_root
+ '.'
+ end
+
+ def relpath
+ '.'
+ end
+
+ #
+ # Option Parsing
+ #
+
+ def parsearg_global
+ while arg = ARGV.shift
+ case arg
+ when /\A\w+\z/
+ setup_rb_error "invalid task: #{arg}" unless valid_task?(arg)
+ return arg
+ when '-q', '--quiet'
+ @config.verbose = false
+ when '--verbose'
+ @config.verbose = true
+ when '--help'
+ print_usage $stdout
+ exit 0
+ when '--version'
+ puts "#{File.basename($0)} version #{Version}"
+ exit 0
+ when '--copyright'
+ puts Copyright
+ exit 0
+ else
+ setup_rb_error "unknown global option '#{arg}'"
+ end
+ end
+ nil
+ end
+
+ def valid_task?(t)
+ valid_task_re() =~ t
+ end
+
+ def valid_task_re
+ @valid_task_re ||= /\A(?:#{TASKS.map {|task,desc| task }.join('|')})\z/
+ end
+
+ def parsearg_no_options
+ unless ARGV.empty?
+ task = caller(0).first.slice(%r<`parsearg_(\w+)'>, 1)
+ setup_rb_error "#{task}: unknown options: #{ARGV.join(' ')}"
+ end
+ end
+
+ alias parsearg_show parsearg_no_options
+ alias parsearg_setup parsearg_no_options
+ alias parsearg_test parsearg_no_options
+ alias parsearg_clean parsearg_no_options
+ alias parsearg_distclean parsearg_no_options
+
+ def parsearg_config
+ evalopt = []
+ set = []
+ @config.config_opt = []
+ while i = ARGV.shift
+ if /\A--?\z/ =~ i
+ @config.config_opt = ARGV.dup
+ break
+ end
+ name, value = *@config.parse_opt(i)
+ if @config.value_config?(name)
+ @config[name] = value
+ else
+ evalopt.push [name, value]
+ end
+ set.push name
+ end
+ evalopt.each do |name, value|
+ @config.lookup(name).evaluate value, @config
+ end
+ # Check if configuration is valid
+ set.each do |n|
+ @config[n] if @config.value_config?(n)
+ end
+ end
+
+ def parsearg_install
+ @config.no_harm = false
+ @config.install_prefix = ''
+ while a = ARGV.shift
+ case a
+ when '--no-harm'
+ @config.no_harm = true
+ when /\A--prefix=/
+ path = a.split(/=/, 2)[1]
+ path = File.expand_path(path) unless path[0,1] == '/'
+ @config.install_prefix = path
+ else
+ setup_rb_error "install: unknown option #{a}"
+ end
+ end
+ end
+
+ def print_usage(out)
+ out.puts 'Typical Installation Procedure:'
+ out.puts " $ ruby #{File.basename $0} config"
+ out.puts " $ ruby #{File.basename $0} setup"
+ out.puts " # ruby #{File.basename $0} install (may require root privilege)"
+ out.puts
+ out.puts 'Detailed Usage:'
+ out.puts " ruby #{File.basename $0} <global option>"
+ out.puts " ruby #{File.basename $0} [<global options>] <task> [<task options>]"
+
+ fmt = " %-24s %s\n"
+ out.puts
+ out.puts 'Global options:'
+ out.printf fmt, '-q,--quiet', 'suppress message outputs'
+ out.printf fmt, ' --verbose', 'output messages verbosely'
+ out.printf fmt, ' --help', 'print this message'
+ out.printf fmt, ' --version', 'print version and quit'
+ out.printf fmt, ' --copyright', 'print copyright and quit'
+ out.puts
+ out.puts 'Tasks:'
+ TASKS.each do |name, desc|
+ out.printf fmt, name, desc
+ end
+
+ fmt = " %-24s %s [%s]\n"
+ out.puts
+ out.puts 'Options for CONFIG or ALL:'
+ @config.each do |item|
+ out.printf fmt, item.help_opt, item.description, item.help_default
+ end
+ out.printf fmt, '--rbconfig=path', 'rbconfig.rb to load',"running ruby's"
+ out.puts
+ out.puts 'Options for INSTALL:'
+ out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
+ out.printf fmt, '--prefix=path', 'install path prefix', ''
+ out.puts
+ end
+
+ #
+ # Task Handlers
+ #
+
+ def exec_config
+ @installer.exec_config
+ @config.save # must be final
+ end
+
+ def exec_setup
+ @installer.exec_setup
+ end
+
+ def exec_install
+ @installer.exec_install
+ end
+
+ def exec_test
+ @installer.exec_test
+ end
+
+ def exec_show
+ @config.each do |i|
+ printf "%-20s %s\n", i.name, i.value if i.value?
+ end
+ end
+
+ def exec_clean
+ @installer.exec_clean
+ end
+
+ def exec_distclean
+ @installer.exec_distclean
+ end
+
+end # class ToplevelInstaller
+
+
+class ToplevelInstallerMulti < ToplevelInstaller
+
+ include FileOperations
+
+ def initialize(ardir_root, config)
+ super
+ @packages = directories_of("#{@ardir}/packages")
+ raise 'no package exists' if @packages.empty?
+ @root_installer = Installer.new(@config, @ardir, File.expand_path('.'))
+ end
+
+ def run_metaconfigs
+ @config.load_script "#{@ardir}/metaconfig", self
+ @packages.each do |name|
+ @config.load_script "#{@ardir}/packages/#{name}/metaconfig"
+ end
+ end
+
+ attr_reader :packages
+
+ def packages=(list)
+ raise 'package list is empty' if list.empty?
+ list.each do |name|
+ raise "directory packages/#{name} does not exist"\
+ unless File.dir?("#{@ardir}/packages/#{name}")
+ end
+ @packages = list
+ end
+
+ def init_installers
+ @installers = {}
+ @packages.each do |pack|
+ @installers[pack] = Installer.new(@config,
+ "#{@ardir}/packages/#{pack}",
+ "packages/#{pack}")
+ end
+ with = extract_selection(config('with'))
+ without = extract_selection(config('without'))
+ @selected = @installers.keys.select {|name|
+ (with.empty? or with.include?(name)) \
+ and not without.include?(name)
+ }
+ end
+
+ def extract_selection(list)
+ a = list.split(/,/)
+ a.each do |name|
+ setup_rb_error "no such package: #{name}" unless @installers.key?(name)
+ end
+ a
+ end
+
+ def print_usage(f)
+ super
+ f.puts 'Inluded packages:'
+ f.puts ' ' + @packages.sort.join(' ')
+ f.puts
+ end
+
+ #
+ # Task Handlers
+ #
+
+ def exec_config
+ run_hook 'pre-config'
+ each_selected_installers {|inst| inst.exec_config }
+ run_hook 'post-config'
+ @config.save # must be final
+ end
+
+ def exec_setup
+ run_hook 'pre-setup'
+ each_selected_installers {|inst| inst.exec_setup }
+ run_hook 'post-setup'
+ end
+
+ def exec_install
+ run_hook 'pre-install'
+ each_selected_installers {|inst| inst.exec_install }
+ run_hook 'post-install'
+ end
+
+ def exec_test
+ run_hook 'pre-test'
+ each_selected_installers {|inst| inst.exec_test }
+ run_hook 'post-test'
+ end
+
+ def exec_clean
+ rm_f @config.savefile
+ run_hook 'pre-clean'
+ each_selected_installers {|inst| inst.exec_clean }
+ run_hook 'post-clean'
+ end
+
+ def exec_distclean
+ rm_f @config.savefile
+ run_hook 'pre-distclean'
+ each_selected_installers {|inst| inst.exec_distclean }
+ run_hook 'post-distclean'
+ end
+
+ #
+ # lib
+ #
+
+ def each_selected_installers
+ Dir.mkdir 'packages' unless File.dir?('packages')
+ @selected.each do |pack|
+ $stderr.puts "Processing the package `#{pack}' ..." if verbose?
+ Dir.mkdir "packages/#{pack}" unless File.dir?("packages/#{pack}")
+ Dir.chdir "packages/#{pack}"
+ yield @installers[pack]
+ Dir.chdir '../..'
+ end
+ end
+
+ def run_hook(id)
+ @root_installer.run_hook id
+ end
+
+ # module FileOperations requires this
+ def verbose?
+ @config.verbose?
+ end
+
+ # module FileOperations requires this
+ def no_harm?
+ @config.no_harm?
+ end
+
+end # class ToplevelInstallerMulti
+
+
+class Installer
+
+ FILETYPES = %w( bin lib ext data conf man )
+
+ include FileOperations
+ include HookScriptAPI
+
+ def initialize(config, srcroot, objroot)
+ @config = config
+ @srcdir = File.expand_path(srcroot)
+ @objdir = File.expand_path(objroot)
+ @currdir = '.'
+ end
+
+ def inspect
+ "#<#{self.class} #{File.basename(@srcdir)}>"
+ end
+
+ def noop(rel)
+ end
+
+ #
+ # Hook Script API base methods
+ #
+
+ def srcdir_root
+ @srcdir
+ end
+
+ def objdir_root
+ @objdir
+ end
+
+ def relpath
+ @currdir
+ end
+
+ #
+ # Config Access
+ #
+
+ # module FileOperations requires this
+ def verbose?
+ @config.verbose?
+ end
+
+ # module FileOperations requires this
+ def no_harm?
+ @config.no_harm?
+ end
+
+ def verbose_off
+ begin
+ save, @config.verbose = @config.verbose?, false
+ yield
+ ensure
+ @config.verbose = save
+ end
+ end
+
+ #
+ # TASK config
+ #
+
+ def exec_config
+ exec_task_traverse 'config'
+ end
+
+ alias config_dir_bin noop
+ alias config_dir_lib noop
+
+ def config_dir_ext(rel)
+ extconf if extdir?(curr_srcdir())
+ end
+
+ alias config_dir_data noop
+ alias config_dir_conf noop
+ alias config_dir_man noop
+
+ def extconf
+ ruby "#{curr_srcdir()}/extconf.rb", *@config.config_opt
+ end
+
+ #
+ # TASK setup
+ #
+
+ def exec_setup
+ exec_task_traverse 'setup'
+ end
+
+ def setup_dir_bin(rel)
+ files_of(curr_srcdir()).each do |fname|
+ update_shebang_line "#{curr_srcdir()}/#{fname}"
+ end
+ end
+
+ alias setup_dir_lib noop
+
+ def setup_dir_ext(rel)
+ make if extdir?(curr_srcdir())
+ end
+
+ alias setup_dir_data noop
+ alias setup_dir_conf noop
+ alias setup_dir_man noop
+
+ def update_shebang_line(path)
+ return if no_harm?
+ return if config('shebang') == 'never'
+ old = Shebang.load(path)
+ if old
+ $stderr.puts "warning: #{path}: Shebang line includes too many args. It is not portable and your program may not work." if old.args.size > 1
+ new = new_shebang(old)
+ return if new.to_s == old.to_s
+ else
+ return unless config('shebang') == 'all'
+ new = Shebang.new(config('rubypath'))
+ end
+ $stderr.puts "updating shebang: #{File.basename(path)}" if verbose?
+ open_atomic_writer(path) {|output|
+ File.open(path, 'rb') {|f|
+ f.gets if old # discard
+ output.puts new.to_s
+ output.print f.read
+ }
+ }
+ end
+
+ def new_shebang(old)
+ if /\Aruby/ =~ File.basename(old.cmd)
+ Shebang.new(config('rubypath'), old.args)
+ elsif File.basename(old.cmd) == 'env' and old.args.first == 'ruby'
+ Shebang.new(config('rubypath'), old.args[1..-1])
+ else
+ return old unless config('shebang') == 'all'
+ Shebang.new(config('rubypath'))
+ end
+ end
+
+ def open_atomic_writer(path, &block)
+ tmpfile = File.basename(path) + '.tmp'
+ begin
+ File.open(tmpfile, 'wb', &block)
+ File.rename tmpfile, File.basename(path)
+ ensure
+ File.unlink tmpfile if File.exist?(tmpfile)
+ end
+ end
+
+ class Shebang
+ def Shebang.load(path)
+ line = nil
+ File.open(path) {|f|
+ line = f.gets
+ }
+ return nil unless /\A#!/ =~ line
+ parse(line)
+ end
+
+ def Shebang.parse(line)
+ cmd, *args = *line.strip.sub(/\A\#!/, '').split(' ')
+ new(cmd, args)
+ end
+
+ def initialize(cmd, args = [])
+ @cmd = cmd
+ @args = args
+ end
+
+ attr_reader :cmd
+ attr_reader :args
+
+ def to_s
+ "#! #{@cmd}" + (@args.empty? ? '' : " #{@args.join(' ')}")
+ end
+ end
+
+ #
+ # TASK install
+ #
+
+ def exec_install
+ rm_f 'InstalledFiles'
+ exec_task_traverse 'install'
+ end
+
+ def install_dir_bin(rel)
+ install_files targetfiles(), "#{config('bindir')}/#{rel}", 0755
+ end
+
+ def install_dir_lib(rel)
+ install_files libfiles(), "#{config('rbdir')}/#{rel}", 0644
+ end
+
+ def install_dir_ext(rel)
+ return unless extdir?(curr_srcdir())
+ install_files rubyextentions('.'),
+ "#{config('sodir')}/#{File.dirname(rel)}",
+ 0555
+ end
+
+ def install_dir_data(rel)
+ install_files targetfiles(), "#{config('datadir')}/#{rel}", 0644
+ end
+
+ def install_dir_conf(rel)
+ # FIXME: should not remove current config files
+ # (rename previous file to .old/.org)
+ install_files targetfiles(), "#{config('sysconfdir')}/#{rel}", 0644
+ end
+
+ def install_dir_man(rel)
+ install_files targetfiles(), "#{config('mandir')}/#{rel}", 0644
+ end
+
+ def install_files(list, dest, mode)
+ mkdir_p dest, @config.install_prefix
+ list.each do |fname|
+ install fname, dest, mode, @config.install_prefix
+ end
+ end
+
+ def libfiles
+ glob_reject(%w(*.y *.output), targetfiles())
+ end
+
+ def rubyextentions(dir)
+ ents = glob_select("*.#{@config.dllext}", targetfiles())
+ if ents.empty?
+ setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first"
+ end
+ ents
+ end
+
+ def targetfiles
+ mapdir(existfiles() - hookfiles())
+ end
+
+ def mapdir(ents)
+ ents.map {|ent|
+ if File.exist?(ent)
+ then ent # objdir
+ else "#{curr_srcdir()}/#{ent}" # srcdir
+ end
+ }
+ end
+
+ # picked up many entries from cvs-1.11.1/src/ignore.c
+ JUNK_FILES = %w(
+ core RCSLOG tags TAGS .make.state
+ .nse_depinfo #* .#* cvslog.* ,* .del-* *.olb
+ *~ *.old *.bak *.BAK *.orig *.rej _$* *$
+
+ *.org *.in .*
+ )
+
+ def existfiles
+ glob_reject(JUNK_FILES, (files_of(curr_srcdir()) | files_of('.')))
+ end
+
+ def hookfiles
+ %w( pre-%s post-%s pre-%s.rb post-%s.rb ).map {|fmt|
+ %w( config setup install clean ).map {|t| sprintf(fmt, t) }
+ }.flatten
+ end
+
+ def glob_select(pat, ents)
+ re = globs2re([pat])
+ ents.select {|ent| re =~ ent }
+ end
+
+ def glob_reject(pats, ents)
+ re = globs2re(pats)
+ ents.reject {|ent| re =~ ent }
+ end
+
+ GLOB2REGEX = {
+ '.' => '\.',
+ '$' => '\$',
+ '#' => '\#',
+ '*' => '.*'
+ }
+
+ def globs2re(pats)
+ /\A(?:#{
+ pats.map {|pat| pat.gsub(/[\.\$\#\*]/) {|ch| GLOB2REGEX[ch] } }.join('|')
+ })\z/
+ end
+
+ #
+ # TASK test
+ #
+
+ TESTDIR = 'test'
+
+ def exec_test
+ unless File.directory?('test')
+ $stderr.puts 'no test in this package' if verbose?
+ return
+ end
+ $stderr.puts 'Running tests...' if verbose?
+ begin
+ require 'test/unit'
+ rescue LoadError
+ setup_rb_error 'test/unit cannot loaded. You need Ruby 1.8 or later to invoke this task.'
+ end
+ runner = Test::Unit::AutoRunner.new(true)
+ runner.to_run << TESTDIR
+ runner.run
+ end
+
+ #
+ # TASK clean
+ #
+
+ def exec_clean
+ exec_task_traverse 'clean'
+ rm_f @config.savefile
+ rm_f 'InstalledFiles'
+ end
+
+ alias clean_dir_bin noop
+ alias clean_dir_lib noop
+ alias clean_dir_data noop
+ alias clean_dir_conf noop
+ alias clean_dir_man noop
+
+ def clean_dir_ext(rel)
+ return unless extdir?(curr_srcdir())
+ make 'clean' if File.file?('Makefile')
+ end
+
+ #
+ # TASK distclean
+ #
+
+ def exec_distclean
+ exec_task_traverse 'distclean'
+ rm_f @config.savefile
+ rm_f 'InstalledFiles'
+ end
+
+ alias distclean_dir_bin noop
+ alias distclean_dir_lib noop
+
+ def distclean_dir_ext(rel)
+ return unless extdir?(curr_srcdir())
+ make 'distclean' if File.file?('Makefile')
+ end
+
+ alias distclean_dir_data noop
+ alias distclean_dir_conf noop
+ alias distclean_dir_man noop
+
+ #
+ # Traversing
+ #
+
+ def exec_task_traverse(task)
+ run_hook "pre-#{task}"
+ FILETYPES.each do |type|
+ if type == 'ext' and config('without-ext') == 'yes'
+ $stderr.puts 'skipping ext/* by user option' if verbose?
+ next
+ end
+ traverse task, type, "#{task}_dir_#{type}"
+ end
+ run_hook "post-#{task}"
+ end
+
+ def traverse(task, rel, mid)
+ dive_into(rel) {
+ run_hook "pre-#{task}"
+ __send__ mid, rel.sub(%r[\A.*?(?:/|\z)], '')
+ directories_of(curr_srcdir()).each do |d|
+ traverse task, "#{rel}/#{d}", mid
+ end
+ run_hook "post-#{task}"
+ }
+ end
+
+ def dive_into(rel)
+ return unless File.dir?("#{@srcdir}/#{rel}")
+
+ dir = File.basename(rel)
+ Dir.mkdir dir unless File.dir?(dir)
+ prevdir = Dir.pwd
+ Dir.chdir dir
+ $stderr.puts '---> ' + rel if verbose?
+ @currdir = rel
+ yield
+ Dir.chdir prevdir
+ $stderr.puts '<--- ' + rel if verbose?
+ @currdir = File.dirname(rel)
+ end
+
+ def run_hook(id)
+ path = [ "#{curr_srcdir()}/#{id}",
+ "#{curr_srcdir()}/#{id}.rb" ].detect {|cand| File.file?(cand) }
+ return unless path
+ begin
+ instance_eval File.read(path), path, 1
+ rescue
+ raise if $DEBUG
+ setup_rb_error "hook #{path} failed:\n" + $!.message
+ end
+ end
+
+end # class Installer
+
+
+class SetupError < StandardError; end
+
+def setup_rb_error(msg)
+ raise SetupError, msg
+end
+
+if $0 == __FILE__
+ begin
+ ToplevelInstaller.invoke
+ rescue SetupError
+ raise if $DEBUG
+ $stderr.puts $!.message
+ $stderr.puts "Try 'ruby #{$0} --help' for detailed usage."
+ exit 1
+ end
+end