diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb
index 5c20b072..a2fb45d8 100644
--- a/lib/sisu/v3/cgi_sqlite.rb
+++ b/lib/sisu/v3/cgi_sqlite.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/character_encoding.rb b/lib/sisu/v3/character_encoding.rb
index 5d19a61f..b785a715 100644
--- a/lib/sisu/v3/character_encoding.rb
+++ b/lib/sisu/v3/character_encoding.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb
index 1a801e58..174d0a81 100644
--- a/lib/sisu/v3/composite.rb
+++ b/lib/sisu/v3/composite.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb
index 9b62b441..e8d414a2 100644
--- a/lib/sisu/v3/concordance.rb
+++ b/lib/sisu/v3/concordance.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/conf.rb b/lib/sisu/v3/conf.rb
index f3f978db..7af523c2 100644
--- a/lib/sisu/v3/conf.rb
+++ b/lib/sisu/v3/conf.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/constants.rb b/lib/sisu/v3/constants.rb
index c8cac1f6..df529d31 100644
--- a/lib/sisu/v3/constants.rb
+++ b/lib/sisu/v3/constants.rb
@@ -8,7 +8,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/css.rb b/lib/sisu/v3/css.rb
index d9727a83..37211ecc 100644
--- a/lib/sisu/v3/css.rb
+++ b/lib/sisu/v3/css.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb
index 1c989a18..9f1d5372 100644
--- a/lib/sisu/v3/dal.rb
+++ b/lib/sisu/v3/dal.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_character_check.rb b/lib/sisu/v3/dal_character_check.rb
index a843f202..81f4e16b 100644
--- a/lib/sisu/v3/dal_character_check.rb
+++ b/lib/sisu/v3/dal_character_check.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_doc_objects.rb b/lib/sisu/v3/dal_doc_objects.rb
index feb5d2c1..0f501a79 100644
--- a/lib/sisu/v3/dal_doc_objects.rb
+++ b/lib/sisu/v3/dal_doc_objects.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb
index 209fc1dd..6415f7dd 100644
--- a/lib/sisu/v3/dal_doc_str.rb
+++ b/lib/sisu/v3/dal_doc_str.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_endnotes.rb b/lib/sisu/v3/dal_endnotes.rb
index 95176516..6811722f 100644
--- a/lib/sisu/v3/dal_endnotes.rb
+++ b/lib/sisu/v3/dal_endnotes.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_expand_insertions.rb b/lib/sisu/v3/dal_expand_insertions.rb
index f7adb76e..1bc66a84 100644
--- a/lib/sisu/v3/dal_expand_insertions.rb
+++ b/lib/sisu/v3/dal_expand_insertions.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_hash_digest.rb b/lib/sisu/v3/dal_hash_digest.rb
index a78c54f1..87cf4738 100644
--- a/lib/sisu/v3/dal_hash_digest.rb
+++ b/lib/sisu/v3/dal_hash_digest.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_idx.rb b/lib/sisu/v3/dal_idx.rb
index 7c00be3c..ee37690c 100644
--- a/lib/sisu/v3/dal_idx.rb
+++ b/lib/sisu/v3/dal_idx.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_images.rb b/lib/sisu/v3/dal_images.rb
index 76a94dab..693d7e9c 100644
--- a/lib/sisu/v3/dal_images.rb
+++ b/lib/sisu/v3/dal_images.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_metadata.rb b/lib/sisu/v3/dal_metadata.rb
index 77b58f86..e7614fc4 100644
--- a/lib/sisu/v3/dal_metadata.rb
+++ b/lib/sisu/v3/dal_metadata.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_numbering.rb b/lib/sisu/v3/dal_numbering.rb
index 4bfb7da3..94ff2328 100644
--- a/lib/sisu/v3/dal_numbering.rb
+++ b/lib/sisu/v3/dal_numbering.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_substitutions_and_insertions.rb b/lib/sisu/v3/dal_substitutions_and_insertions.rb
index e1326232..bb6e9d24 100644
--- a/lib/sisu/v3/dal_substitutions_and_insertions.rb
+++ b/lib/sisu/v3/dal_substitutions_and_insertions.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb
index 34ac65e2..6620c3ad 100644
--- a/lib/sisu/v3/dal_syntax.rb
+++ b/lib/sisu/v3/dal_syntax.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_columns.rb b/lib/sisu/v3/db_columns.rb
index c1fb6109..61febc54 100644
--- a/lib/sisu/v3/db_columns.rb
+++ b/lib/sisu/v3/db_columns.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_create.rb b/lib/sisu/v3/db_create.rb
index 2676542e..2d4aee0b 100644
--- a/lib/sisu/v3/db_create.rb
+++ b/lib/sisu/v3/db_create.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_dbi.rb b/lib/sisu/v3/db_dbi.rb
index 1a3825b9..3c59afa0 100644
--- a/lib/sisu/v3/db_dbi.rb
+++ b/lib/sisu/v3/db_dbi.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_drop.rb b/lib/sisu/v3/db_drop.rb
index edd08345..c2a32179 100644
--- a/lib/sisu/v3/db_drop.rb
+++ b/lib/sisu/v3/db_drop.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb
index 41515747..2c4c9bad 100644
--- a/lib/sisu/v3/db_import.rb
+++ b/lib/sisu/v3/db_import.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_indexes.rb b/lib/sisu/v3/db_indexes.rb
index abd90409..0f77c96d 100644
--- a/lib/sisu/v3/db_indexes.rb
+++ b/lib/sisu/v3/db_indexes.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_load_tuple.rb b/lib/sisu/v3/db_load_tuple.rb
index f1af99a0..8beed2a6 100644
--- a/lib/sisu/v3/db_load_tuple.rb
+++ b/lib/sisu/v3/db_load_tuple.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_remove.rb b/lib/sisu/v3/db_remove.rb
index 364f5fc7..a3acbc5a 100644
--- a/lib/sisu/v3/db_remove.rb
+++ b/lib/sisu/v3/db_remove.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_select.rb b/lib/sisu/v3/db_select.rb
index 04d12acb..4ac6e75d 100644
--- a/lib/sisu/v3/db_select.rb
+++ b/lib/sisu/v3/db_select.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_sqltxt.rb b/lib/sisu/v3/db_sqltxt.rb
index 4e451e2a..31e44667 100644
--- a/lib/sisu/v3/db_sqltxt.rb
+++ b/lib/sisu/v3/db_sqltxt.rb
@@ -9,7 +9,7 @@
* Author: Ralph Amissah
* Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Ralph Amissah All Rights Reserved.
+ 2007, 2008, 2009, 2011 Ralph Amissah All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/db_tests.rb b/lib/sisu/v3/db_tests.rb
index 55ea2e0b..9854f8b6 100644
--- a/lib/sisu/v3/db_tests.rb
+++ b/lib/sisu/v3/db_tests.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/dbi.rb b/lib/sisu/v3/dbi.rb
index 191d5099..10374a37 100644
--- a/lib/sisu/v3/dbi.rb
+++ b/lib/sisu/v3/dbi.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/defaults.rb b/lib/sisu/v3/defaults.rb
index 19941d48..6286ed17 100644
--- a/lib/sisu/v3/defaults.rb
+++ b/lib/sisu/v3/defaults.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/digests.rb b/lib/sisu/v3/digests.rb
index 77c593ac..38b79ae1 100644
--- a/lib/sisu/v3/digests.rb
+++ b/lib/sisu/v3/digests.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/embedded.rb b/lib/sisu/v3/embedded.rb
index afdfd5a7..51742957 100644
--- a/lib/sisu/v3/embedded.rb
+++ b/lib/sisu/v3/embedded.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb
index aa4ede99..0da90712 100644
--- a/lib/sisu/v3/epub.rb
+++ b/lib/sisu/v3/epub.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/epub_concordance.rb b/lib/sisu/v3/epub_concordance.rb
index 301d34a2..88a1109f 100644
--- a/lib/sisu/v3/epub_concordance.rb
+++ b/lib/sisu/v3/epub_concordance.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb
index c189eb3a..893b6015 100644
--- a/lib/sisu/v3/epub_format.rb
+++ b/lib/sisu/v3/epub_format.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb
index bd13b08b..7eb43eec 100644
--- a/lib/sisu/v3/epub_segments.rb
+++ b/lib/sisu/v3/epub_segments.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb
index 23b0acf0..b98f9caf 100644
--- a/lib/sisu/v3/epub_tune.rb
+++ b/lib/sisu/v3/epub_tune.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/errors.rb b/lib/sisu/v3/errors.rb
index d761e1db..aafc6d02 100644
--- a/lib/sisu/v3/errors.rb
+++ b/lib/sisu/v3/errors.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/git.rb b/lib/sisu/v3/git.rb
index 2a2db20c..00cd1e67 100644
--- a/lib/sisu/v3/git.rb
+++ b/lib/sisu/v3/git.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/harvest.rb b/lib/sisu/v3/harvest.rb
index 2a01910e..82a87ba3 100644
--- a/lib/sisu/v3/harvest.rb
+++ b/lib/sisu/v3/harvest.rb
@@ -9,7 +9,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/harvest_authors.rb b/lib/sisu/v3/harvest_authors.rb
index 53003bb4..656d11d0 100644
--- a/lib/sisu/v3/harvest_authors.rb
+++ b/lib/sisu/v3/harvest_authors.rb
@@ -8,7 +8,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/harvest_topics.rb b/lib/sisu/v3/harvest_topics.rb
index 948965dd..00471184 100644
--- a/lib/sisu/v3/harvest_topics.rb
+++ b/lib/sisu/v3/harvest_topics.rb
@@ -9,7 +9,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
diff --git a/lib/sisu/v3/help.rb b/lib/sisu/v3/help.rb
index b23d8066..65bbedef 100644
--- a/lib/sisu/v3/help.rb
+++ b/lib/sisu/v3/help.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -159,7 +159,7 @@ module SiSU_Help
end
def summary
print <
Date: Mon, 7 Feb 2011 11:47:34 -0500
Subject: REMOVE sisu v1
---
lib/sisu/v1/author_format.rb | 122 -
lib/sisu/v1/cgi.rb | 86 -
lib/sisu/v1/cgi_pgsql.rb | 231 --
lib/sisu/v1/cgi_sql_common.rb | 976 -------
lib/sisu/v1/cgi_sqlite.rb | 217 --
lib/sisu/v1/character_encoding.rb | 381 ---
lib/sisu/v1/composite.rb | 239 --
lib/sisu/v1/concordance.rb | 350 ---
lib/sisu/v1/conf.rb | 269 --
lib/sisu/v1/constants.rb | 172 --
lib/sisu/v1/css.rb | 2015 --------------
lib/sisu/v1/dal.rb | 272 --
lib/sisu/v1/dal_character_check.rb | 109 -
lib/sisu/v1/dal_doc_str.rb | 266 --
lib/sisu/v1/dal_doc_str_code.rb | 187 --
lib/sisu/v1/dal_doc_str_tables.rb | 198 --
lib/sisu/v1/dal_endnotes.rb | 129 -
lib/sisu/v1/dal_expand_insertions.rb | 196 --
lib/sisu/v1/dal_hash_digest.rb | 173 --
lib/sisu/v1/dal_idx.rb | 323 ---
lib/sisu/v1/dal_images.rb | 145 -
lib/sisu/v1/dal_metadata.rb | 225 --
lib/sisu/v1/dal_numbering.rb | 368 ---
lib/sisu/v1/dal_substitutions_and_insertions.rb | 154 --
lib/sisu/v1/dal_syntax.rb | 421 ---
lib/sisu/v1/db_columns.rb | 229 --
lib/sisu/v1/db_create.rb | 597 -----
lib/sisu/v1/db_dbi.rb | 93 -
lib/sisu/v1/db_drop.rb | 155 --
lib/sisu/v1/db_import.rb | 924 -------
lib/sisu/v1/db_indexes.rb | 111 -
lib/sisu/v1/db_load_tuple.rb | 155 --
lib/sisu/v1/db_remove.rb | 107 -
lib/sisu/v1/db_select.rb | 193 --
lib/sisu/v1/db_tests.rb | 119 -
lib/sisu/v1/dbi.rb | 149 -
lib/sisu/v1/defaults.rb | 2225 ---------------
lib/sisu/v1/digests.rb | 377 ---
lib/sisu/v1/embedded.rb | 139 -
lib/sisu/v1/errors.rb | 82 -
lib/sisu/v1/harvest.rb | 103 -
lib/sisu/v1/harvest_authors.rb | 325 ---
lib/sisu/v1/harvest_topics.rb | 563 ----
lib/sisu/v1/help.rb | 2035 --------------
lib/sisu/v1/html.rb | 703 -----
lib/sisu/v1/html_format.rb | 1405 ----------
lib/sisu/v1/html_minitoc.rb | 239 --
lib/sisu/v1/html_promo.rb | 442 ---
lib/sisu/v1/html_scroll.rb | 200 --
lib/sisu/v1/html_segments.rb | 540 ----
lib/sisu/v1/html_table.rb | 152 --
lib/sisu/v1/html_tune.rb | 383 ---
lib/sisu/v1/hub.rb | 590 ----
lib/sisu/v1/i18n.rb | 1605 -----------
lib/sisu/v1/manifest.rb | 648 -----
lib/sisu/v1/manpage.rb | 465 ----
lib/sisu/v1/manpage_format.rb | 119 -
lib/sisu/v1/odf.rb | 738 -----
lib/sisu/v1/odf_format.rb | 263 --
lib/sisu/v1/options.rb | 191 --
lib/sisu/v1/param.rb | 1008 -------
lib/sisu/v1/param_identify_markup.rb | 145 -
lib/sisu/v1/particulars.rb | 130 -
lib/sisu/v1/plaintext.rb | 423 ---
lib/sisu/v1/plaintext_format.rb | 120 -
lib/sisu/v1/relaxng.rb | 1177 --------
lib/sisu/v1/remote.rb | 266 --
lib/sisu/v1/response.rb | 76 -
lib/sisu/v1/rexml.rb | 127 -
lib/sisu/v1/screen_text_color.rb | 414 ---
lib/sisu/v1/share_src.rb | 97 -
lib/sisu/v1/share_src_kdissert.rb | 91 -
lib/sisu/v1/shared_html.rb | 65 -
lib/sisu/v1/shared_html_lite.rb | 276 --
lib/sisu/v1/shared_sem.rb | 157 --
lib/sisu/v1/shared_structure.rb | 173 --
lib/sisu/v1/shared_txt.rb | 223 --
lib/sisu/v1/shared_xml.rb | 739 -----
lib/sisu/v1/sisupod_make.rb | 337 ---
lib/sisu/v1/sitemaps.rb | 224 --
lib/sisu/v1/spell.rb | 102 -
lib/sisu/v1/sst_convert_markup.rb | 318 ---
lib/sisu/v1/sst_do_inline_footnotes.rb | 482 ----
lib/sisu/v1/sst_from_kdissert.rb | 194 --
lib/sisu/v1/sst_from_xml.rb | 170 --
lib/sisu/v1/sst_identify_markup.rb | 439 ---
lib/sisu/v1/sst_to_s_xml_dom.rb | 589 ----
lib/sisu/v1/sst_to_s_xml_node.rb | 649 -----
lib/sisu/v1/sst_to_s_xml_sax.rb | 454 ----
lib/sisu/v1/sysenv.rb | 3282 -----------------------
lib/sisu/v1/termsheet.rb | 167 --
lib/sisu/v1/texinfo.rb | 438 ---
lib/sisu/v1/texinfo_format.rb | 520 ----
lib/sisu/v1/texpdf.rb | 797 ------
lib/sisu/v1/texpdf_format.rb | 1556 -----------
lib/sisu/v1/update.rb | 131 -
lib/sisu/v1/urls.rb | 284 --
lib/sisu/v1/webrick.rb | 174 --
lib/sisu/v1/wikispeak.rb | 407 ---
lib/sisu/v1/xhtml.rb | 465 ----
lib/sisu/v1/xml.rb | 482 ----
lib/sisu/v1/xml_dom.rb | 561 ----
lib/sisu/v1/xml_fictionbook.rb | 313 ---
lib/sisu/v1/xml_format.rb | 357 ---
lib/sisu/v1/xml_md_oai_pmh_dc.rb | 211 --
lib/sisu/v1/xml_scaffold.rb | 206 --
lib/sisu/v1/xml_tables.rb | 213 --
lib/sisu/v1/zap.rb | 81 -
108 files changed, 45898 deletions(-)
delete mode 100644 lib/sisu/v1/author_format.rb
delete mode 100644 lib/sisu/v1/cgi.rb
delete mode 100644 lib/sisu/v1/cgi_pgsql.rb
delete mode 100644 lib/sisu/v1/cgi_sql_common.rb
delete mode 100644 lib/sisu/v1/cgi_sqlite.rb
delete mode 100644 lib/sisu/v1/character_encoding.rb
delete mode 100644 lib/sisu/v1/composite.rb
delete mode 100644 lib/sisu/v1/concordance.rb
delete mode 100644 lib/sisu/v1/conf.rb
delete mode 100644 lib/sisu/v1/constants.rb
delete mode 100644 lib/sisu/v1/css.rb
delete mode 100644 lib/sisu/v1/dal.rb
delete mode 100644 lib/sisu/v1/dal_character_check.rb
delete mode 100644 lib/sisu/v1/dal_doc_str.rb
delete mode 100644 lib/sisu/v1/dal_doc_str_code.rb
delete mode 100644 lib/sisu/v1/dal_doc_str_tables.rb
delete mode 100644 lib/sisu/v1/dal_endnotes.rb
delete mode 100644 lib/sisu/v1/dal_expand_insertions.rb
delete mode 100644 lib/sisu/v1/dal_hash_digest.rb
delete mode 100644 lib/sisu/v1/dal_idx.rb
delete mode 100644 lib/sisu/v1/dal_images.rb
delete mode 100644 lib/sisu/v1/dal_metadata.rb
delete mode 100644 lib/sisu/v1/dal_numbering.rb
delete mode 100644 lib/sisu/v1/dal_substitutions_and_insertions.rb
delete mode 100644 lib/sisu/v1/dal_syntax.rb
delete mode 100644 lib/sisu/v1/db_columns.rb
delete mode 100644 lib/sisu/v1/db_create.rb
delete mode 100644 lib/sisu/v1/db_dbi.rb
delete mode 100644 lib/sisu/v1/db_drop.rb
delete mode 100644 lib/sisu/v1/db_import.rb
delete mode 100644 lib/sisu/v1/db_indexes.rb
delete mode 100644 lib/sisu/v1/db_load_tuple.rb
delete mode 100644 lib/sisu/v1/db_remove.rb
delete mode 100644 lib/sisu/v1/db_select.rb
delete mode 100644 lib/sisu/v1/db_tests.rb
delete mode 100644 lib/sisu/v1/dbi.rb
delete mode 100644 lib/sisu/v1/defaults.rb
delete mode 100644 lib/sisu/v1/digests.rb
delete mode 100644 lib/sisu/v1/embedded.rb
delete mode 100644 lib/sisu/v1/errors.rb
delete mode 100644 lib/sisu/v1/harvest.rb
delete mode 100644 lib/sisu/v1/harvest_authors.rb
delete mode 100644 lib/sisu/v1/harvest_topics.rb
delete mode 100644 lib/sisu/v1/help.rb
delete mode 100644 lib/sisu/v1/html.rb
delete mode 100644 lib/sisu/v1/html_format.rb
delete mode 100644 lib/sisu/v1/html_minitoc.rb
delete mode 100644 lib/sisu/v1/html_promo.rb
delete mode 100644 lib/sisu/v1/html_scroll.rb
delete mode 100644 lib/sisu/v1/html_segments.rb
delete mode 100644 lib/sisu/v1/html_table.rb
delete mode 100644 lib/sisu/v1/html_tune.rb
delete mode 100644 lib/sisu/v1/hub.rb
delete mode 100644 lib/sisu/v1/i18n.rb
delete mode 100644 lib/sisu/v1/manifest.rb
delete mode 100644 lib/sisu/v1/manpage.rb
delete mode 100644 lib/sisu/v1/manpage_format.rb
delete mode 100644 lib/sisu/v1/odf.rb
delete mode 100644 lib/sisu/v1/odf_format.rb
delete mode 100644 lib/sisu/v1/options.rb
delete mode 100644 lib/sisu/v1/param.rb
delete mode 100644 lib/sisu/v1/param_identify_markup.rb
delete mode 100644 lib/sisu/v1/particulars.rb
delete mode 100644 lib/sisu/v1/plaintext.rb
delete mode 100644 lib/sisu/v1/plaintext_format.rb
delete mode 100644 lib/sisu/v1/relaxng.rb
delete mode 100644 lib/sisu/v1/remote.rb
delete mode 100644 lib/sisu/v1/response.rb
delete mode 100644 lib/sisu/v1/rexml.rb
delete mode 100644 lib/sisu/v1/screen_text_color.rb
delete mode 100644 lib/sisu/v1/share_src.rb
delete mode 100644 lib/sisu/v1/share_src_kdissert.rb
delete mode 100644 lib/sisu/v1/shared_html.rb
delete mode 100644 lib/sisu/v1/shared_html_lite.rb
delete mode 100644 lib/sisu/v1/shared_sem.rb
delete mode 100644 lib/sisu/v1/shared_structure.rb
delete mode 100644 lib/sisu/v1/shared_txt.rb
delete mode 100644 lib/sisu/v1/shared_xml.rb
delete mode 100644 lib/sisu/v1/sisupod_make.rb
delete mode 100644 lib/sisu/v1/sitemaps.rb
delete mode 100644 lib/sisu/v1/spell.rb
delete mode 100644 lib/sisu/v1/sst_convert_markup.rb
delete mode 100644 lib/sisu/v1/sst_do_inline_footnotes.rb
delete mode 100644 lib/sisu/v1/sst_from_kdissert.rb
delete mode 100644 lib/sisu/v1/sst_from_xml.rb
delete mode 100644 lib/sisu/v1/sst_identify_markup.rb
delete mode 100644 lib/sisu/v1/sst_to_s_xml_dom.rb
delete mode 100644 lib/sisu/v1/sst_to_s_xml_node.rb
delete mode 100644 lib/sisu/v1/sst_to_s_xml_sax.rb
delete mode 100644 lib/sisu/v1/sysenv.rb
delete mode 100644 lib/sisu/v1/termsheet.rb
delete mode 100644 lib/sisu/v1/texinfo.rb
delete mode 100644 lib/sisu/v1/texinfo_format.rb
delete mode 100644 lib/sisu/v1/texpdf.rb
delete mode 100644 lib/sisu/v1/texpdf_format.rb
delete mode 100644 lib/sisu/v1/update.rb
delete mode 100644 lib/sisu/v1/urls.rb
delete mode 100644 lib/sisu/v1/webrick.rb
delete mode 100644 lib/sisu/v1/wikispeak.rb
delete mode 100644 lib/sisu/v1/xhtml.rb
delete mode 100644 lib/sisu/v1/xml.rb
delete mode 100644 lib/sisu/v1/xml_dom.rb
delete mode 100644 lib/sisu/v1/xml_fictionbook.rb
delete mode 100644 lib/sisu/v1/xml_format.rb
delete mode 100644 lib/sisu/v1/xml_md_oai_pmh_dc.rb
delete mode 100644 lib/sisu/v1/xml_scaffold.rb
delete mode 100644 lib/sisu/v1/xml_tables.rb
delete mode 100644 lib/sisu/v1/zap.rb
(limited to 'lib')
diff --git a/lib/sisu/v1/author_format.rb b/lib/sisu/v1/author_format.rb
deleted file mode 100644
index 4f391dfd..00000000
--- a/lib/sisu/v1/author_format.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module FORMAT
- class Author
- def initialize(author_param)
- @author_param=author_param
- end
- def author_details
- @authors,@author_array=[],[]
- authors=@author_param.scan(/[^;]+/)
- authors.each do |a|
- a.strip!
- if a =~/"(.+?)"/
- @authors << { :the => $1 }
- @author_array << $1.upcase
- else #if a =~/,/
- x=a.scan(/[^,]+/)
- x[0].strip!
- x[1].strip! if x[1]
- if x.length == 1
- @authors << { :the => x[0] }
- @author_array << x[0].upcase
- elsif x.length == 2
- @authors << { :the=> x[0], :others => x[1] }
- @author_array << "#{x[0].upcase}, #{x[1]}"
- else #p x.length
- end
- end
- end
- l = @authors.length
- authors_string=''
- @authors.each_with_index do |a,i|
- authors_string += if a[:others]
- if (l - i) > 1
- "#{a[:others]} #{a[:the]}, "
- else
- "#{a[:others]} #{a[:the]}"
- end
- else
- if (l - i) > 2
- "#{a[:the]}, "
- else
- "#{a[:the]}"
- end
- end
- #author_format += if a[:others]
- # if (l - i) > 1
- # "#{a[:others]} #{a[:the]}, "
- # else
- # "#{a[:others]} #{a[:the]}"
- # end
- #else
- # if (l - i) > 2
- # "#{a[:the]}, "
- # else
- # "#{a[:the]}"
- # end
- #end
- end
- {:last_first_a => authors, :last_first_format_a => @author_array, :authors_h => @authors, :authors_s => authors_string, :authors_param => @author_param}
- #{:authors_array => authors, :authors_hash => @authors, :authors_string => authors_string, :authors_param => @author_param}
- #{:authors_array => authors, :authors_hash => @authors, :authors_string => authors_string, :authors_format => author_format, :authors_param => @author_param}
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/cgi.rb b/lib/sisu/v1/cgi.rb
deleted file mode 100644
index ed0331f3..00000000
--- a/lib/sisu/v1/cgi.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# coding: utf-8
-=begin
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: generates naive cgi search form for search of sisu database
- (pgsql sqlite)
-
-=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 #verify @opt.files[0].class
- 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/v1/cgi_pgsql.rb b/lib/sisu/v1/cgi_pgsql.rb
deleted file mode 100644
index f1e12110..00000000
--- a/lib/sisu/v1/cgi_pgsql.rb
+++ /dev/null
@@ -1,231 +0,0 @@
-# coding: utf-8
-=begin
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: generates naive cgi search form for search of sisu database (pgsql sqlite)
-
-=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_sys"
- @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 << %{ \n} unless x =~/apache|sisu\/image/ #check
- end
- f2 << %{ selected_db=case cgi['db']\n}
- serve.each do |x|
- f2 << %{ when /SiSU_#{x}/; ''\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 << buttons1_pgsql << 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.psql.db}"
- 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.psql.db}) 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.psql.db}'\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_sys"
- @hosturl_db="#{@env.url.webserv_base_cgi}"
- @hosturl_files="#{@env.url.webserv_files_from_db}"
- @port="#{@db.psql.port}"
- user='#{@env.user}' # check user name for access to pg database: '#{@env.user}'
- WOK_SQL
- end
- def search_statement
- <<-'WOK_SQL'
- class Dbi_search_string
- def initialize(l,t,q,cse=false)
- @l,@t,@q,@c=l,t,q,cse
- end
- def string
- search={ :search => [],:flag => false }
- if @t =~/\S+/ or @q =~/\S+/
- if @t =~/\S+/; unescaped_search=CGI.unescape(@t)
- elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q)
- end
- search_construct=[]
- if @c
- unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~\( '")
- unescaped_search.gsub!(/(.+)/,"#{@l}~\( '\\1' \)")
- else
- unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #{@l}~*\( '")
- unescaped_search.gsub!(/(.+)/,"#{@l}~*\( '\\1' \)")
- end
- search_construct << unescaped_search
- search_construct=search_construct.join(' ')
- search[:search] << search_construct
- search[:flag]=true
- search
- end
- search
- end
- end
- WOK_SQL
- end
- def search_query1
- <<-'WOK_SQL'
- @search_text,@search_endnotes=[],[]
- #%
- search[:text].each{|x| @search_text << "#{x} AND " }
- @search_text=@search_text.join.gsub!(/AND\s+$/,'') #watch
- @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.join.gsub!(/AND\s+$/,'') #watch
- @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.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#{@search_text}) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn}
- @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
- select=@sql_statement[:body] + ' ' + @sql_statement[:range]
- select
- end
- def sql_select_endnotes
- limit ||=@@limit
- offset ||=@@offset
- @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#{@search_endnotes}) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr}
- @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
- select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range]
- select
- end
- def sql_select_body_format
- %{#{sql_select_body}}
- end
- def sql_select_endnotes_format
- %{#{sql_select_endnotes}}
- end
- def contents
- @conn.select_all(sql_select_body)
- end
- def endnotes
- @conn.select_all(sql_select_endnotes)
- end
- end
- WOK_SQL
- end
- def buttons1_pgsql
- <<-'WOK_SQL'
- case sensitive
- 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/v1/cgi_sql_common.rb b/lib/sisu/v1/cgi_sql_common.rb
deleted file mode 100644
index 5b2ef9b2..00000000
--- a/lib/sisu/v1/cgi_sql_common.rb
+++ /dev/null
@@ -1,976 +0,0 @@
-# coding: utf-8
-=begin
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: generates naive cgi search form for search of sisu database (pgsql sqlite)
-
-=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'
- * Name: SiSU generated sample cgi search form
-
- * Description: generated sample cgi search form for SiSU
- (SiSU is a framework for document structuring, publishing and search)
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
- WOK_SQL
- end
- def header1
- <<-'WOK_SQL'
-#Common TOP
- @@limit,@@offset=1000,0
- @base="#{@hosturl_db}/cgi-bin/#{@version}.cgi"
- @@canned_search_url=@base
- @color_heading='#DDFFAA'
- @color_match='#ffff48'
- class Form
- def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can='')
- search_note='' if checked_searched !~/\S/
- the_can='' if checked_url !~/\S/
- search_field='' if checked_echo !~/\S/
- @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can
- @tip=if checked_tip =~/\S/
- 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__; '
- else ''
- end
- end
- def submission_form
- search_form=<<-WOK
- WOK_SQL
- end
- def header_desc
- <<-WOK_SQL
-
-
-
-
- SiSU search form (sample): SiSU information Structuring Universe
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WOK_SQL
- end
- def header2
- <<-'WOK_SQL'
-
- 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=if q['doc'] and q['search'] !~/search db/; q['doc']
- elsif q['fns']=~/\S/; q['fns']
- end
- @@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,c)
- @conn=conn
- @text_search_flag=false
- @sql_statement={ :body=>'',:endnotes=>'',:range=>'' }
- #@offset||=@@offset
- #@offset+=@@limit
- search={ :text => [],:endnotes => [] }
- cse=if c =~/\S/; true
- else false
- end
- st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string
- se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string
- @text_search_flag=st[:flag]
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << se[:search]
- end
- st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string
- if st[:flag]
- search[:text] << st[:search]
- search[:endnotes] << st[:search]
- end
- @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000
- @@offset=q['off'] if q['off']=~/\d+/ # 0
- 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 + '<d=' + sql_limit.to_s + '&off=' + sql_offset.to_s
- end
- def next
- @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s
- end
- def previous
- @offset_previous >= 0 \
- ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) \
- : ''
- end
- def start
- @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + 0.to_s
- end
- self
- end
- def pre_next(beyond_limit,img)
- can=sql_canned_search
- page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i
- if beyond_limit
- if page.to_s =~ /^1$/
- %{
- #{v[:project]}, developed using
-
- Ruby
-
- on
-
- Debian/Gnu/Linux
-
- software infrastructure,
- with the usual GPL (or OSS) suspects.
-
- Better - "performance, reliability, scalability, security & total cost of ownership"
- [not to mention flexibility & choice] use of and adherence to open standards (where practical and fair) and it is software libré.
-
- Get With the Future
-
- Way Better!
-
-
-
-
-
-
- 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_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','',''
- if cgi['view']=~/text/; checked_index,checked_text='','checked'
- else checked_index,checked_text='checked',''
- end
- checked_echo='checked' if cgi['echo'] =~/\S/
- checked_stats='checked' if cgi['stats'] =~/\S/
- checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
- checked_searched='checked' if cgi['searched'] =~/\S/
- checked_tip='checked' if cgi['tip'] =~/\S/
- checked_case='checked' if cgi['casesense'] =~/\S/
- checked_sql='checked' if cgi['sql'] =~/\S/
- if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1
- checked_all='checked'
- checked_echo=checked_stats=checked_url=checked_searched=checked_tip=checked_sql='checked'
- checked_none=''
- elsif cgi['checks'] =~/check_none/
- checked_none='checked'
- checked_all=checked_url=checked_stats=checked_searched=checked_tip=checked_echo=checked_sql=''
- elsif cgi['checks'] =~/check_selected/
- checked_selected='checked'
- elsif cgi['checks'] =~/check_default/
- checked_default='checked'
- checked_echo=checked_stats=checked_url='checked'
- checked_searched=checked_tip=checked_case=checked_sql=''
- else
- checked_selected='checked'
- checked_echo=checked_stats=checked_url='checked'
- checked_searched=checked_tip=checked_case=checked_sql=''
- end
- 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']}"
- end
- @canned_base_url="#{@base}?#{s1}&db=#{cgi['db']}"
- if checked_case=~/\S/
- @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
- @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
- else
- @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1
- @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1
- end
- canned_note='search url:'
- else
- @@canned_search_url="#{@base}?db=#{@db}&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=%{}
- canned_search_url_txt=CGI.escapeHTML(@@canned_search_url)
- the_can=%{#{canned_note} #{canned_search_url_txt} }
- 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} } if @search_for.text1 =~/\S+/
- p_keywords=%{keywords: #{green}#{@search_for.keywords} } if @search_for.keywords =~/\S+/
- p_title=%{title: #{green}#{@search_for.title} } if @search_for.title =~/\S+/
- p_author=%{author: #{green}#{@search_for.author} } if @search_for.author =~/\S+/
- p_subject=%{subject: #{green}#{@search_for.subject} } if @search_for.subject =~/\S+/
- p_description=%{description: #{green}#{@search_for.description} } if @search_for.description =~/\S+/
- p_publisher=%{publisher: #{green}#{@search_for.publisher} } if @search_for.publisher =~/\S+/
- p_contributor=%{contributor: #{green}#{@search_for.contributor} } if @search_for.contributor =~/\S+/
- p_date=%{date: #{green}#{@search_for.date} } if @search_for.date =~/\S+/
- p_type=%{type: #{green}#{@search_for.type} } if @search_for.type =~/\S+/
- p_format=%{format: #{green}#{@search_for.format} } if @search_for.format =~/\S+/
- p_identifier=%{identifier: #{green}#{@search_for.identifier} } if @search_for.identifier =~/\S+/
- p_source=%{source: #{green}#{@search_for.source} } if @search_for.source =~/\S+/
- p_language=%{language: #{green}#{@search_for.language} } if @search_for.language =~/\S+/
- p_relation=%{relation: #{green}#{@search_for.relation} } if @search_for.relation =~/\S+/
- p_coverage=%{coverage: #{green}#{@search_for.coverage} } if @search_for.coverage =~/\S+/
- p_rights=%{rights: #{green}#{@search_for.rights} } if @search_for.rights =~/\S+/
- p_comment=%{comment: #{green}#{@search_for.comment} } if @search_for.comment =~/\S+/
- p_abstract=%{abstract: #{green}#{@search_for.abstract} } if @search_for.abstract =~/\S+/
- p_filename=%{filename: #{green}#{@search_for.filename} } if @search_for.filename =~/\S+/
- search_note=<<-WOK
-
- database: #{green}#{@db}; selected view: #{green}#{cgi['view']}
- search string: "#{green}#{analyze_format}"
- #{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}
-
- WOK
- #eg = %{canned search e.g.: #{url} find: #{analyze} database: #{database}}
- #dbi_canning
- @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form
- unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
- print "Content-type: text/html\n\n"
- puts (@header+@tail)
- else #% searches
- s1=if @search_for.text1 =~/\S/
- @search_for.text1
- else 'Unavailable'
- end
- if checked_case=~/\S/
- @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
- @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
- else
- @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'}
- @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'}
- end
- #dbi_request
- dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case)
- @text_search_flag=false
- @text_search_flag=dbi_statement.text_search_flag
- s_contents=dbi_statement.contents
- s_endnotes=dbi_statement.endnotes
- @body_main,@endnotes=[],[]
- @search_regx=nil
- oldtid=0
- if @text_search_flag
- if checked_sql =~/\S/
- sql_select_body=dbi_statement.sql_select_body_format
- sql_select_endnotes=dbi_statement.sql_select_endnotes_format
- else sql_select_body,sql_select_endnotes='',''
- end
- @body_main << ' Main Text: ' << sql_select_body
- @endnotes << ' Endnotes: ' << sql_select_endnotes
- else
- end
- #text_objects_body
- s_contents.each do |c| #% text body
- location=c['filename'][/(.+?)\.(?:ssm\.sst|sst)$/,1]
- file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1]
- lang=if location =~ /\S+?~(\S\S\S?)$/
- l=location[/\S+?~(\S\S\S?)$/,1]
- location.gsub!(/(\S+?)~\S\S\S?/,'\1')
- l=".#{l}"
- else ''
- end
- #metadata_found_body
- if c['tid'].to_i != oldtid.to_i
- ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}"
- else c['title']
- end
- can_txt_srch=if cgi['view']=~/index/; %{ }
- else %{ }
- end
- title=%{ #{ti} by #{c['creator']} #{can_txt_srch} } if file_suffix=~/s/ #hmm watch file_suffix
- if @text_search_flag; title=' '+title
- else title=' '+title
- end
- @counter_txt_doc+=1
- oldtid=c['tid'].to_i
- else title=''
- end
- if @text_search_flag
- if cgi['view']=~/text/ \
- or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% txt body
- text=if c['suffix'] !~/1/ #seg
- if @search_for.text1 =~/\S+/ \
- or q['s1'] =~/\S+/ #% only this branch is working !!
- unescaped_search=if @search_for.text1 =~/\S+/
- CGI.unescape(@search_for.text1)
- elsif q['s1'] =~/\S+/
- CGI.unescape(q['s1'])
- else nil
- end
- @search_regx=if unescaped_search #check
- search_regex=[]
- build=unescaped_search.scan(/\S+/).each do |g|
- if g.to_s =~/(AND|OR)/
- search_regex << '|'
- else search_regex << %{#{g.to_s}}
- end
- end
- search_regex=search_regex.join(' ')
- search_regex=search_regex.gsub(/\s*\|\s*/,'|')
- Regexp.new(search_regex, Regexp::IGNORECASE)
- else nil
- end
- else nil
- end
- matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/)
- matched=c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{\\1})
- else c['body']
- end
- %{
Word index links are to html versions of the text the segmented version followed by the scroll (single document) version. [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).]
-
(The word listing/index is Case sensitive: Capitalized words appear before lower case)
-
- word (number of occurences) linked references to word within document
- [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.]
-
-
- (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 # [ http://[web host]/#{@fnb}/concordance.html#your_word ]
-
-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
#@word
(#@freq)
\n\t
}
- else n=@word.strip.gsub(/\s+/,'_') #also need to convert extended character set to html
- %{\n
}
- end
- @@word_previous=@word.capitalize
- w
- end
- end
- class Words
- require "#{SiSU_lib}/defaults"
- include SiSU_Viz
- require "#{SiSU_lib}/html_format"
- include SiSU_HTML_Format
- require "#{SiSU_lib}/sysenv"
- include SiSU_Screen
- @@dp=nil
- def initialize(particulars)
- @particulars=particulars
- begin
- @vz=SiSU_Env::Get_init.instance.skin
- @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array
- @path="#{@env.path.output}/#{@md.fnb}"
- @freq=Hash.new(0)
- @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
- @rxp_to=Regexp.new("#{Mx[:id_o]}~(\\d+);(?:[oh]|[0-6]:)\\d+;\\w\\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}|#{Mx[:id_o]}\S+?#{Mx[:id_c]}$")
- @rxp_lv1=/^#{Mx[:lv_o]}1:/
- @rxp_lv2=/^#{Mx[:lv_o]}2:/
- @rxp_lv3=/^#{Mx[:lv_o]}3:/
- @rxp_seg=/^#{Mx[:lv_o]}4:(\S+?)#{Mx[:lv_c]}/
- @rxp_title=Regexp.new("^#{Mx[:meta_o]}title#{Mx[:meta_c]}\s*(.+?)\s*$")
- @rxp_t1=Regexp.new('^T1')
- @rxp_t2=Regexp.new('^T2')
- @rxp_t3=Regexp.new('^T3')
- @rxp_excluded1=/(?:https?|file|ftp):\/\/\S+/
- @rxp_excluded0=/^(?:#{Mx[:fa_bold_o]}|#{Mx[:fa_italics_o]})?(?:to\d+|\d+| |#{Mx[:br_endnotes]}|EOF|#{Mx[:br_eof]}|thumb_\S+|snap_\S+|_+|-+|[(]?(?:ii+|iv|vi+|ix|xi+|xiv|xv|xvi+|xix|xx)[).]?|\S+?_\S+|[\d_]+\w\S+|[\w\d]{1,2}|\d{1,3}\w?|#@dp|[0-9a-f]{16,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\.?)(?:#{Mx[:fa_bold_c]}|#{Mx[:fa_italics_c]})?$/mi #this regex causes and cures a stack dump in ruby 1.9 !!!
- @rgx_splitlist=%r{[—.,;:-]|#{Mx[:id_o]}\S+?#{Mx[:id_c]}}mi
- @rgx_scanlist=%r{#{Mx[:fa_italics_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_bold_c]}|(?:https?|file)://\S+|#{Mx[:gr_o]}code#{Mx[:gr_o]}.+?#{Mx[:gr_o]}code-end#{Mx[:gr_o]}|<\S+?>|\w+|[a-zA-Z]+}mi
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
- end
- end
- def songsheet
- begin
- mkdir_p(@path) unless FileTest.directory?(@path)
- @file_concordance=File.open("#@path/#{@md.fn[:concordance]}",'w')
- map_para
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
- ensure
- @file_concordance.close
- end
- end
- protected
- def location_scroll(wordlocation,show)
- @wordlocation=wordlocation
- %{#@wordlocation; }
- 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
- %{[H]#@show, }
- when @rxp_t2
- %{[H]#@show, }
- when @rxp_t3
- %{[H]#@show, }
- else %{#@show, }
- end
- end
- def map_para
- @seg,toy=nil,nil
- @word_map={}
- @dal_array.each do |line|
- if line !~/#{Mx[:id_o]}~(\d+);[um]\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ #lines to ignore: # are added but not part of authors substantive text; 0 are mostly machine generated
- 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$/
- line=line.split(@rgx_splitlist).join(' ') #%take in word or other match
- for word in line.scan(@rgx_scanlist) #%take in word or other match
- #word.gsub!(@rxp_clean,'')
- word.gsub!(/#{Mx[:lnk_o]}|#{Mx[:lnk_c]}(?:http)?/,'')
- word.gsub!(/#{Mx[:fa_o]}\S+?#{Mx[:fa_o_c]}/,'')
- word.gsub!(/#{Mx[:fa_c_o]}\S+?#{Mx[:fa_c]}/,'')
- word.gsub!(/#{Mx[:gl_o]}#[a-z]+#{Mx[:gl_c]}/,'')
- word.gsub!(/#{Mx[:gl_o]}#[0-9]+#{Mx[:gl_c]}/,'')
- word.gsub!(/^\S$/,'')
- word=nil if word.empty?
- word=nil if word =~@rxp_excluded0 #watch
- word=nil if word =~@rxp_excluded1 #watch
- word=nil if word =~/^\S$/
- if word
- word.gsub!(/#{Mx[:br_nl]}|#{Mx[:br_line]}/,' ')
- word.gsub!(/#{Mx[:lv_o]}\d:\S*?#{Mx[:lv_c]}/,'')
- word.gsub!(/#{Mx[:pa_o]}:i\d#{Mx[:pa_c]}/,'')
- word.gsub!(/#{Mx[:id_o]}~\d+;\S+?#{Mx[:id_c]}/,'')
- word.gsub!(/#{Mx[:fa_o]}[a-z]{1,7}#{Mx[:fa_o_c]}|#{Mx[:fa_c_o]}[a-z]{1,7}#{Mx[:fa_c]}/,'')
- word.gsub!(/#{Mx[:mk_o]}(?:[0-9a-f]{32}:[0-9a-f]{32}|[0-9a-f]{64}:[0-9a-f]{64})#{Mx[:mk_c]}/,'')
- word.gsub!(/#{Mx[:mk_o]}(?:[0-9a-f]{32}|[0-9a-f]{64})#{Mx[:mk_c]}/,'')
- word.gsub!(/#{Mx[:en_a_o]}(?:\d|[*+])*|#{Mx[:en_b_o]}(?:\d|[*+])*|#{Mx[:en_a_c]}|#{Mx[:en_b_c]}/mi,'')
- word.gsub!(/#{Mx[:fa_o]}\S+?#{Mx[:fa_o_c]}/,''); word.gsub!(/#{Mx[:fa_c_o]}\S+?#{Mx[:fa_c]}/,'')
- #word.gsub!(/#{Mx[:fa_o]}\S+?#{Mx[:fa_c]}/,'') #watch
- word.gsub!(/<\/?\S+?>/,'')
- word.gsub!(/^\@+/,'')
- word.strip!
- word.gsub!(/#{Mx[:tc_p]}.+/,'')
- word.gsub!(/[\.,;:"]$/,'')
- word.gsub!(/["]/,'')
- word.gsub!(/^\s*[\(]/,'')
- word.gsub!(/[\(]\s*$/,'')
- word.gsub!(/^(?:See|e\.?g\.?).+/,'')
- word.gsub!(/^\s*[.,;:]\s*/,'')
- word.strip!
- word.gsub!(/^\(?[a-zA-Z]\)$/,'')
- word.gsub!(/^\d+(st|nd|rd|th)$/,'')
- word.gsub!(/^(\d+\.?)+$/, '')
- word.gsub!(/#{Mx[:mk_o]}|#{Mx[:mk_c]}/,'')
- word.gsub!(/:name#\S+/,'')
- word.gsub!(/^\S$/,'')
- word=nil if word =~/^\S$/
- word=nil if word =~/^\s*$/ #watch
- if word
- unless word =~/[A-Z][A-Z]/ \
- or word =~/\w+\s\w+/
- word.capitalize!
- end
- #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=' scroll: doc# '
- seg=''
- @file_concordance << SiSU_Concordance::Source::Doc_title.new(@particulars).create
- alph=%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]
- @file_concordance << '
}
- for word in @freq.keys.sort! {|a,b| a.downcase<=>b.downcase}
- f=/^(\S)/.match(word)[1]
- if letter < f.upcase
- while letter < f.upcase
- if alph.length > 0
- letter=alph.shift
- @file_concordance << %{\n
|<\/tr>||\[endnotes\]|<:zz>|<:isbn-|<:journal-|<:conference-|#{Mx[:br_endnotes]}/i #ocn here # added with Tune.code #¡
- regex_exclude_ocn = /^(?:alt|code|group|poem|table)\{|^\}(?:alt|code|group|poem|table)|^\}table$/ #ocn here # 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=~/^#{Mx[:lv_o]}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=~/^#{Mx[:lv_o]}[1-9]:\S*?#{Mx[:lv_c]}/ \
- 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=~/^#{Mx[:lv_o]}1:(\S*?)#{Mx[:lv_c]}/ \
- or para =~@md.lv1
- ocnh1+=1 #heading
- ocn_dv,ocn_sp="1:#{ocnh1}","h#{ocnh}"
- elsif para=~/^#{Mx[:lv_o]}2:(\S*?)#{Mx[:lv_c]}/ \
- or para =~@md.lv2; ocnh2+=1
- ocn_dv,ocn_sp="2:#{ocnh2}","h#{ocnh}"
- elsif para=~/^#{Mx[:lv_o]}3:(\S*?)#{Mx[:lv_c]}/ \
- or para =~@md.lv3; ocnh3+=1
- ocn_dv,ocn_sp="3:#{ocnh3}","h#{ocnh}"
- elsif para=~/^#{Mx[:lv_o]}4:(\S*?)#{Mx[:lv_c]}/ \
- or para =~@md.lv4; ocnh4+=1
- ocn_dv,ocn_sp="4:#{ocnh4}","h#{ocnh}"
- elsif para=~/^#{Mx[:lv_o]}5:(\S*?)#{Mx[:lv_c]}/ \
- or para =~@md.lv5; ocnh5+=1
- ocn_dv,ocn_sp="5:#{ocnh5}","h#{ocnh}"
- elsif para=~/^#{Mx[:lv_o]}6:(\S*?)#{Mx[:lv_c]}/ \
- or para =~@md.lv6; ocnh6+=1
- ocn_dv,ocn_sp="6:#{ocnh6}","h#{ocnh}"
- end
- else
- ocno+=1
- if para=~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/; ocnt+=1 #table
- ocn_dv,ocn_sp="o#{ocno}","t#{ocnt}"
- elsif para=~/^#{Mx[:gr_o]}code#{Mx[:gr_c]}/; ocnc+=1 #code block
- ocn_dv,ocn_sp="o#{ocno}","c#{ocnc}"
- elsif para=~/^#{Mx[:gr_o]}(?:group|alt|verse)#{Mx[:gr_c]}/; ocng+=1 #group, poem
- ocn_dv,ocn_sp="o#{ocno}","g#{ocng}"
- elsif para=~/#{Mx[:lnk_o]}\S+?\.(?:png|jpg|gif)\s+/m; ocni+=1 #image
- ocn_dv,ocn_sp="o#{ocno}","i#{ocni}"
- else ocnp+=1 #paragraph
- 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!(/#{Mx[:fa_o]}~##{Mx[:fa_c]}/,'') 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 =~/#{Mx[:gr_o]}(?:code|verse|alt|group)#{Mx[:gr_c]}/ #newlines taken out
- para.gsub!(/(#{Mx[:gr_o]}(?:code-end)#{Mx[:gr_c]})/,"\n\\1") if para =~/#{Mx[:gr_o]}(?:code-end)#{Mx[:gr_c]}/ #newlines added check
- if para =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}/u; para.gsub!(/(#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?)#{Mx[:gr_c]}/u,"\\1#{Mx[:tc_p]}~#{o[:ocn]};#{o[:lv]};#{o[:type]}#{Mx[:gr_c]}")
- 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/v1/dal_doc_str_code.rb b/lib/sisu/v1/dal_doc_str_code.rb
deleted file mode 100644
index 8ccd45e1..00000000
--- a/lib/sisu/v1/dal_doc_str_code.rb
+++ /dev/null
@@ -1,187 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: document abstraction
-
-=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!(/(#{Mx[:gr_o]}(?:code|verse|alt|group)#{Mx[:gr_c]})\s/,'\1') #double check
- para.gsub!(/(?:\n\s*\n)+/m,"\n") unless @@flag['code']
- if para =~/^code\{/ and not @@flag['code']
- @@flag['code']=true
- @@counter=1
- para.gsub!(/^code\{.*/,"#{Mx[:gr_o]}code#{Mx[:gr_c]}")
- elsif para =~/^(?:poem)\{/ \
- and not @@flag['code']
- @@flag['poem']=true
- para.gsub!(/^(poem)\{.*/,"#{Mx[:gr_o]}verse#{Mx[:gr_c]}")
- elsif para =~/^(?:alt|group)\{/ \
- and not @@flag['code'] #group not tested, stub 2005
- @@flag['group']=true
- para.gsub!(/^(alt|group)\{.*/,"#{Mx[:gr_o]}\\1#{Mx[:gr_c]}")
- end
- if @@flag['code']
- if @@flag['code'] \
- and para =~/^\}code/
- para.gsub!(/^\}code.*/,"#{Mx[:gr_o]}code-end#{Mx[:gr_c]}")
- @@flag['code']=false
- end
- if @@flag['code'] \
- or para =~/#{Mx[:gr_o]}code-end#{Mx[:gr_c]}/ #and para =~/\S/
- sub_array=if para !~/#{Mx[:gr_o]}code(?:-end)?#{Mx[:gr_c]}/; para.dup + "#{Mx[:br_nl]}"
- else para.dup
- end
- @line_mode=sub_array.scan(/.+/)
- #@line_mode=[]
- #sub_array.scan(/.+/) {|w| @line_mode << w + '<:br>' if w =~/[\Ss]+/}
- SiSU_document_structure_code::Code.new(@md,@line_mode).code_lines('code')
- para=@line_mode.join
- end
- elsif ( @@flag['poem'] \
- or @@flag['group'] ) \
- and not @@flag['code']
- if @@flag['poem'] \
- and para =~/^\}(?:poem)/
- para.gsub!(/^\}(poem).*/,"\n#{Mx[:gr_o]}verse-end#{Mx[:gr_c]}")
- @@flag['poem']=false
- elsif ( @@flag['group'] \
- and para =~/^\}(?:alt|group)/ ) \
- and not @@flag['code']
- para.gsub!(/^\}(alt|group).*/,"#{Mx[:gr_o]}\\1-end#{Mx[:gr_c]}")
- @@flag['group']=false
- end
- if @@flag['poem'] \
- or @@flag['group'] \
- and para =~/\S/ \
- and para !~/#{Mx[:gr_o]}(verse|code|alt|group)(-end)?#{Mx[:gr_c]}/ \
- and not @@flag['code']
- 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" + "#{Mx[:gr_o]}verse-end#{Mx[:gr_c]}" + "\n\n" + "#{Mx[:gr_o]}verse#{Mx[:gr_c]}"
- 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 =~/#{Mx[:gr_o]}(?:code|alt|group|verse)-end#{Mx[:gr_c]}/
- @verse_count=0
- @tuned_group << para
- tuned_file <<= if para =~/#{Mx[:gr_o]}group-end#{Mx[:gr_c]}/
- @tuned_group.join("\n")
- else @tuned_group=@tuned_group.join
- @tuned_group.gsub!(/#{Mx[:br_nl]}#{Mx[:br_nl]}(#{Mx[:gr_o]}code-end#{Mx[:gr_c]})/,'\1')
- @tuned_group
- 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 !~/^code\{|^\}code|#{Mx[:gr_o]}code.+/
- line.gsub!(/\s\s/,"#{Mx[:nbsp]}#{Mx[:nbsp]}")
- line.gsub!(/^/,"#{Mx[:gr_o]}codeline#{Mx[:gr_c]}") if type=='code' # try sort for texpdf special case
- if line =~/(?:https?|file|ftp):\/\/\S+$/
- line.gsub!(/$/," #{Mx[:br_nl]}")
- else line.gsub!(/$/,"#{Mx[:br_nl]}") #unless type=='code'
- end
- if @@flag['code']; @@counter+=1
- else
- end
- elsif line =~/^\s*$/
- line.gsub!(/$/,"#{Mx[:br_nl]}")
- end
- end
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/dal_doc_str_tables.rb b/lib/sisu/v1/dal_doc_str_tables.rb
deleted file mode 100644
index d9d39632..00000000
--- a/lib/sisu/v1/dal_doc_str_tables.rb
+++ /dev/null
@@ -1,198 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: document abstraction tables
-
-=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].join =~/^\{(?:t|table)(?:~h)?\s+\d+;/
- col_width=@row[0].join.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; ]*\}/
- "#{Mx[:gr_o]}Th#{Mx[:tc_p]} c#{@row[2].length}; #{widths}#{Mx[:gr_c]}"
- elsif para =~/\{(?:t|table)(?:\sc\d+;)?[\d; ]*\}/
- "#{Mx[:gr_o]}T#{Mx[:tc_p]} c#{@row[2].length}; #{widths}#{Mx[:gr_c]}"
- end
- @row.each do |l|
- l << '' if l.length == (@row[1].length - 1)
- table=[]
- if l.length == @row[1].length
- table << Mx[:tc_o] #'
'
- n= -1
- l.each do |c|
- n +=1 #'
' + c + '
'
- table << if c =~/\A(?:\n)?\s*\Z/
- "#{Mx[:tc_p]}#{Mx[:tc_p]}#{w[n]}#{Mx[:tc_p]}" + ' '
- else
- "#{Mx[:tc_p]}#{Mx[:tc_p]}#{w[n]}#{Mx[:tc_p]}" + c.strip
- end
- end
- table << Mx[:tc_c]
- tuned_file << table.join
- end
- end
- tuned_file << "#{Mx[:gr_o]}TZ#{Mx[:gr_c]}" #'
'
- 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>/,'') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200)
- para.gsub!(/<:\/hi>/,%{})
- 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+?;.+?)$/,"#{Mx[:gr_o]}Th#{Mx[:tc_p]} \\1#{Mx[:gr_c]}")
- para.gsub!(/^table\{\s+(c\d+?;.+?)$/,"#{Mx[:gr_o]}T#{Mx[:tc_p]} \\1#{Mx[:gr_c]}")
- @@flag['table_to']=true
- end
- if @@flag['table_to'] \
- and para =~/\}table/
- para.gsub!(/^\}table\s*$/,"#{Mx[:gr_o]}TZ#{Mx[:gr_c]}\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(/.+/u)
- Tables.new(@md,@@line_mode).tr_td
- para=@@line_mode.join
- para.gsub!(/(.*\S+.*)\Z/m,"#{Mx[:tc_o]}\\1#{Mx[:tc_c]}") unless para =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}/u
- end
- para.gsub!(/\n/,' ')
- para.strip!
- @tuned_table << para
- else
- para.gsub!(/\n/,' ') unless para =~/#{Mx[:gr_o]}(?:code|verse|alt|group)#{Mx[:gr_c]}/
- 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*$|#{Mx[:gr_o]}:table[-_](close|end)#{Mx[:gr_c]}|#{Mx[:gr_o]}TZ#{Mx[:gr_c]})/
- #if line.encoding.inspect =~/Encoding:ASCII-8BIT/
- # line=line.force_encoding('utf-8')
- #end
- line.gsub!(/(.+)/,"#{Mx[:tc_p]}#{Mx[:tc_p]}#{@@column[@@counter]}#{Mx[:tc_p]}\\1") unless line =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}/u
- @@counter+=1
- end
- end
- data
- end
- end
-end
-__END__
-#p line.encoding
-@data.each {|x| p x.encoding }
-p para if para.encoding.inspect =~/Encoding:ASCII-8BIT/
diff --git a/lib/sisu/v1/dal_endnotes.rb b/lib/sisu/v1/dal_endnotes.rb
deleted file mode 100644
index 3d4bd148..00000000
--- a/lib/sisu/v1/dal_endnotes.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module SiSU_endnotes
- class Endnotes
- def initialize(md,data,endnote_array=nil)
- @md,@data,@endnote_array=md,data,endnote_array
- @endnote_counter,@endnote_counter_asterisk,@endnote_counter_dag=1,1,1
- end
- def endnotes
- data=@data
- @tuned_file=[]
- endnote_no,endnote_ref=1,1
- #% endnote work zone
- data.each do |para|
- # manually numbered endnotes -->
- if @md.mod.inspect =~/--no-asterisk|--no-annotate/
- para.gsub!(/#{Mx[:en_b_o]}\s.+?#{Mx[:en_b_c]}/,'')
- end
- if @md.mod.inspect =~/--no-dagger|--no-annotate/
- para.gsub!(/#{Mx[:en_b_o]}[+]\s.+?#{Mx[:en_b_c]}/,'')
- end
- unless para =~/^#{Mx[:gr_o]}code#{Mx[:gr_c]}/
- case para
- # auto-numbered endnotes -->
- when /#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}[*+]\s+.+?#{Mx[:en_b_c]}/
- para.gsub!(/\s*(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/,' \1') # required 2003w31
- word_mode=para.scan(/#{Mx[:gr_o]}group#{Mx[:gr_c]}\n|\n#{Mx[:gr_o]}group-end#{Mx[:gr_c]}|\S+/m)
- word_mode=endnote_call_number(word_mode)
- para=word_mode.join(' ')
- endnote_ref+=1
- when /~\^(?:\s|$)|<:e>/
- #%Note inserts endnotes previously gathered from /^(|[-~]\{{3})/ (in earlier loop)
- word_mode=para.scan(/#{Mx[:gr_o]}group#{Mx[:gr_c]}\n|\n#{Mx[:gr_o]}group-end#{Mx[:gr_c]}|\S+/m)
- word_mode=endnote_call_number(word_mode)
- para=word_mode.join(' ')
- endnote_ref+=1
- end
- end
- @tuned_file << para
- end
- @endnote_counter,@endnote_counter_asterisk,@endnote_counter_dag=1,1,1
- @tuned_file=@tuned_file.flatten
- end
- def endnote_call_number(data)
- data.each do |word|
- unless data =~/^#{Mx[:gr_o]}code#{Mx[:gr_c]}/
- case word
- when /#{Mx[:en_a_o]}/
- unless word =~/#{Mx[:en_a_o]}[*+]+/
- word.gsub!(/#{Mx[:en_a_o]}/,"#{Mx[:en_a_o]}#{@endnote_counter} ")
- @endnote_counter+=1
- end
- when /#{Mx[:en_b_o]}/
- if word =~/#{Mx[:en_b_o]}[+]/
- word.gsub!(/#{Mx[:en_b_o]}[+]/,"#{Mx[:en_b_o]}\+#{@endnote_counter_dag} ")
- @endnote_counter_dag+=1
- else
- word.gsub!(/#{Mx[:en_b_o]}[*]?/,"#{Mx[:en_b_o]}\*#{@endnote_counter_asterisk} ")
- @endnote_counter_asterisk+=1
- end
- when /~\^|<:e>/
- if @endnote_array
- word.gsub!(/~\^|<:e>/,"#{@endnote_array[@endnote_counter-1]}")
- @endnote_counter+=1
- end
- end
- end
- end
- end
- end
-end
-__END__
-
diff --git a/lib/sisu/v1/dal_expand_insertions.rb b/lib/sisu/v1/dal_expand_insertions.rb
deleted file mode 100644
index 4f698f36..00000000
--- a/lib/sisu/v1/dal_expand_insertions.rb
+++ /dev/null
@@ -1,196 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module SiSU_insertions
- class Insertions
- def initialize(data)
- @data=data
- 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.inspect
- 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[:gen],file_type_names[:src]=[],[]
- file_type_names[:gen] <<= if cmd_list =~ /y/; 'sisu_manifest.html'
- end
- file_type_names[:gen] <<= if cmd_list =~ /h/; ['toc.html', 'doc.html']
- end
- file_type_names[:gen] <<= if cmd_list =~ /p/; ['landscape.pdf', 'portrait.pdf']
- end
- #file_type_names[:gen] <<= if cmd_list =~ /i/; 'manpage.1'
- #end
- file_type_names[:gen] <<= if cmd_list =~ /o/; 'opendocument.odt'
- end
- file_type_names[:gen] <<= if cmd_list =~ /b/; 'scroll.xhtml'
- end
- file_type_names[:gen] <<= if cmd_list =~ /x/; 'sax.xml'
- end
- file_type_names[:gen] <<= if cmd_list =~ /X/; 'dom.xml'
- end
- file_type_names[:gen] <<= if cmd_list =~ /a/; 'plain.txt'
- end
- file_type_names[:gen] <<= if cmd_list =~ /g/; 'wiki.txt'
- end
- file_type_names[:gen] <<= if cmd_list =~ /w/; 'concordance.html'
- end
- file_type_names[:gen] <<= if cmd_list =~ /N/; 'digest.txt'
- end
- file_type_names[:src] <<= if source and cmd_shortcut =~ /s/; source
- end
- file_type_names[:src] <<= if cmd_shortcut =~ /S/; "#{source}.zip"
- end
- file_type_names[:gen]=file_type_names[:gen].flatten
- file_type_names[:src]=file_type_names[:src].flatten
- file_type_names
- end
- def expand_insertions?
- data=@data
- tuned_file,tuned_file_tmp=[],[]
- data.each do |para|
- if para !~/^%+\s/ \
- and para =~/\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]*))\]\}(?:\.\.\/\S+?\/|\S+?\.ss[tm]\b)/
- txt,cmd,source,url_dir,note,manifest=nil,nil,nil,nil,nil,nil
- @u=SiSU_Env::Info_env.new.url
- if defined? @u.remote
- if para =~/(.+?)\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm]\b)(.*)/m
- pre,txt,cmd,source,url_dir,note="#{$1.strip} ",$2,$3,$4,$5,$6
- elsif para =~/\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm]\b)(.*)/
- pre,txt,cmd,source,url_dir,note='',$1,$2,$3,$4,$5
- end
- manifest="#{pre}{#{txt} }#{@u.remote}/#{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+#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]})?/
- txt,cmd,url_dir,note=$1,$2,$3,$4
- manifest="{ #{txt} }../#{url_dir}/toc.html#{note}\n\n"
- end
- end
- tuned_file_tmp << manifest
- output_filetypes=output_filetypes_in_cmd(cmd,source)
- output_filetypes[:gen].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/; ' odf:odt, open document text'
- when /scroll.xhtml/; ' xhtml scroll'
- when /sax.xml/; ' xml, sax'
- when /dom.xml/; ' xml, dom'
- when /plain.txt/; ' plain text utf-8'
- #when /manpage.1/; ' man, 1'
- when /wiki.txt/; ' wiki text'
- when /concordance.html/; ' concordance'
- when /digest.txt/; ' dcc, document content certificate (digests)'
- else nil
- end
- if describe
- tuned_file_tmp << if @u.remote #to double space <:br> at beginning of entry
- if describe =~/^~\^ /
- "#{Mx[:nbsp]*4} {#{describe} }#{@u.remote}/#{url_dir}/#{o_f} "
- else
- "#{Mx[:nbsp]*4} { #{describe} }#{@u.remote}/#{url_dir}/#{o_f} "
- end
- else
- if describe =~/^~\^ /
- "#{Mx[:nbsp]*4} {#{describe} }../#{url_dir}/#{o_f} "
- else "#{Mx[:nbsp]*4} { #{describe} }../#{url_dir}/#{o_f} "
- end
- end
- end
- end
- output_filetypes[:src].each do |o_f|
- describe=case o_f
- when /#{source}\.zip/; ' markup source (zipped) pod'
- when /#{source}/; ' markup source text'
- else nil
- end
- if describe
- tuned_file_tmp << if @u.remote
- x=if describe =~/zip/
- "#{Mx[:nbsp]*4} {#{describe} }#{@u.src_pod}/#{o_f} "
- else "#{Mx[:nbsp]*4} {#{describe} }#{@u.src_txt}/#{o_f} "
- end
- else
- x=if describe =~/zip/
- "#{Mx[:nbsp]*4} { #{describe} }../pod/#{o_f} "
- else "#{Mx[:nbsp]*4} { #{describe} }../zip/#{o_f} "
- end
- end
- end
- end
- tuned_file << 'group{' << tuned_file_tmp.join("\n") << '}group'
- #tuned_file << 'group{' << tuned_file_tmp.join("\n").strip << '}group'
- tuned_file_tmp=[]
- else tuned_file << para
- end
- end
- tuned_file
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/dal_hash_digest.rb b/lib/sisu/v1/dal_hash_digest.rb
deleted file mode 100644
index 734772ec..00000000
--- a/lib/sisu/v1/dal_hash_digest.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-
-module SiSU_hash
- class Object_digest
- def initialize(md,data,env=nil)
- @md,@data,@env=md,data,env
- @env ||=SiSU_Env::Info_env.new(@md.fns)
- 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.compact!
- data.each do |para|
- para.strip!
- if para=~/#{Mx[:id_o]}~\d+;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}/ \
- and para !~/#{Rx[:meta]}/ #test should not be necessary remove
- 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=@tuned_file.flatten
- #use md5 or to create hash of each dal object including ocn, & add into to each dal object
- end
- def endnote_digest(data)
- para_bit=[]
- data.each do |en_plus|
- para_bit <<= case en_plus
- when /#{Mx[:en_a_o]}|#{Mx[:en_b_o]}/
- if en_plus =~/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/
- para_txt,en_open,en_txt,en_close=/(.*?)(#{Mx[:en_a_o]}|#{Mx[:en_b_o]})(.+?)(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m.match(en_plus)[1..4]
- stripped_en=strip_clean_of_markup(en_txt)
- digest_en_strip=if @env.digest.type =~/sha256/
- Digest::SHA256.hexdigest(stripped_en)
- else
- Digest::MD5.hexdigest(stripped_en)
- end
- para_txt + en_open + en_txt + Mx[:id_o] + digest_en_strip + Mx[:id_c] + 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 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)
- unless para =~/#{Mx[:fa_o]}code#{Mx[:fa_c]}/
- case para
- when /#{Mx[:en_a_o]}[\d*+]+\s+.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}[*+]\d+\s+.+?#{Mx[:en_b_c]}/m
- en_and_para,en_and_para_digest=[],[]
- para.gsub!(/\s*(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,' \1') #watch
- para_plus_en=para.scan(/.*?#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|.*?#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/m)
- para_tail=if para =~/(?:.*?#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|.*?#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})+([\s\S]+)/m
- /(?:.*?#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|.*?#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})+(.*?#{Mx[:id_o]}~\d+;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]})/m.match(para)[1]
- #/(?:.*?#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|.*?#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})+(.+?#{Mx[:id_o]}~\d+;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]})/m.match(para)[1]
- else ''
- end
- para_plus_en << para_tail
- en_and_para_digest << endnote_digest(para_plus_en)
- para_new=en_and_para_digest.join(' ')
- @tuned << para_new + Mx[:id_o] + digest_strip + ':' + digest_all + Mx[:id_c] unless para.nil?
- else @tuned << para + Mx[:id_o] + digest_strip + ':' + digest_all + Mx[:id_c] unless para.nil?
- end
- else @tuned << para + Mx[:id_o] + digest_strip + ':' + digest_all + Mx[:id_c] unless para.nil?
- end
- @tuned.join
- end
- def strip_clean_extra_spaces(s) # dal output tuned
- s=s.dup
- s=s.gsub(/[ ]+([,.;:?](?:$|\s))/,'\1') unless s =~/#{Mx[:en_a_o]}|#{Mx[:en_b_o]}/
- s=s.gsub(/ [ ]+/,' ')
- s=s.gsub(/^ [ ]+/,'')
- s=s.gsub(/ [ ]+$/,'')
- s=s.gsub(/((?:#{Mx[:fa_bold_c]}|#{Mx[:fa_italics_c]})')[ ]+(s )/,'\1\2')
- s=s.gsub(/((?:#{Mx[:fa_bold_c]}|#{Mx[:fa_italics_c]})')[ ]+(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>
- s=s.dup
- s=s.gsub(/(?:<\/?[ib]>|#{Mx[:id_o]}~\d+;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}|#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}|^#{Mx[:lv_o]}[1-6]:\S+?#{Mx[:lv_c]}|#{Mx[:en_a_o]}\d+\s.+?#{Mx[:en_a_c]})/m,'') # markup and endnotes removed
- #% same as db clean -->
- s=s.gsub(/(.+?)<\/del>/,'DELETED(\1)') # deletions
- s=s.gsub(/(\d+)<\/sup>/,'[\1]')
- s=s.gsub(/(?:#{Mx[:nbsp]})+/,' ')
- #s=s.gsub(//,"[TABLE]\n") # tables
- #s=s.gsub(//,'\1') # tables
- #s=s.gsub(/¡¡\d+¡/,' ') # tables
- #s=s.gsub(/¡/,' ') # tables tidy later
- #s=s.gsub(/<.+?>/,'')
- s=s.gsub(/#{Mx[:lnk_o]}.+?\.(?:png|jpg|gif).+?#{Mx[:lnk_c]}(?:https?|file|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/v1/dal_idx.rb b/lib/sisu/v1/dal_idx.rb
deleted file mode 100644
index 3033fdb9..00000000
--- a/lib/sisu/v1/dal_idx.rb
+++ /dev/null
@@ -1,323 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module SiSU_book_index
- class Book_index
- def initialize(md,data,env=nil)
- @md,@data,@env=md,data,env
- @rgx_idx=/#{Mx[:idx_o]}(?:.+?)#{Mx[:idx_c]}\s*/
- #@rgx_idx=/\s*#{Mx[:idx_o]}(?:.+?)#{Mx[:idx_c]}\s*/
- @rgx_idx_ocn_init=/#{Mx[:idx_o]}(.+?)#{Mx[:idx_c]}\s*#{Mx[:id_o]}~(\d+)\S+?#{Mx[:id_c]}/
- @rgx_idx_ocn_seg=/(.+?)~(\d+)~(\S+)/
- @rgx_idx_ocn=/(.+?)~(\d+)/
- @rxp_lv1=/^#{Mx[:lv_o]}1:/
- @rxp_lv2=/^#{Mx[:lv_o]}2:/
- @rxp_lv3=/^#{Mx[:lv_o]}3:/
- @rxp_seg=/^#{Mx[:lv_o]}4:(\S+?)#{Mx[:lv_c]}/
- @rxp_to=Regexp.new("#{Mx[:id_o]}~(\\d+);(?:[oh]|[0-6]:)\\d+;\\w\\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}|#{Mx[:id_o]}\S+?#{Mx[:id_c]}$")
- @env ||=SiSU_Env::Info_env.new(@md.fns)
- end
- def indexing_song
- data=@data
- data,sisu_markup_idx,html_idx=extract_book_index(data)
- data=clean_and_insert_index(data,sisu_markup_idx)
- [data,sisu_markup_idx,html_idx]
- end
- def extract_book_index(data)
- tuned_file=[]
- idx_array=[]
- data.each do |para|
- if para =~@rxp_seg; @seg=para[@rxp_seg,1]
- end
- idx_array << @rgx_idx_ocn_init.match(para)[0].gsub(@rgx_idx_ocn_init,"\\1~\\2~#{@seg}") if para =~ @rgx_idx_ocn_init
- tuned_file << para if para
- end
- idx_array=construct_idx_array(idx_array) if idx_array.length > 0
- if idx_array.length > 0
- the_idx=construct_book_index(idx_array)
- #screen_print(the_idx) if @md.cmd.inspect =~/V/
- sisu_markup_idx,html_idx=nil,nil
- if @md.book_idx
- idx=index(the_idx)
- output_html_idx(idx[:html])
- html_idx=idx[:html]
- sisu_markup_idx=idx[:sst]
- end
- end
- [tuned_file,sisu_markup_idx,html_idx]
- end
- def construct_idx_array(idx_array)
- idx_lst=[]
- idx_array.each do |idx|
- idx_list,ocn,seg=@rgx_idx_ocn_seg.match(idx)[1..3]
- idx_lst <<=if idx_list =~/;/
- g=idx_list.scan(/[^;]+/)
- idxl=[]
- g.each do |i|
- i.strip!
- idxl << { :rough_idx => i, :ocn => ocn, :seg => seg }
- end
- idxl
- else { :rough_idx => idx_list, :ocn => ocn, :seg => seg }
- end
- end
- idx_lst.flatten!
- idx_lst
- end
- def construct_book_index(idx_array)
- @the_idx={}
- idx_array.each do |idx|
- idx_lst=idx[:rough_idx].scan(/[^|:]+/)
- idx_lst[0].strip!
- if idx_lst[0] =~/.+?\+\d+/
- use,plus=/(.+?)\+(\d+)/.match(idx_lst[0])[1,2]
- else use=idx_lst[0]
- end
- use=use[0].chr.capitalize + use[1,use.length]
- @the_idx[use]={} unless @the_idx[use] and defined? @the_idx[use]
- idx_lst.each do |i|
- i.strip!
- i,r=/(.+?)\+(\d+)/.match(i)[1,2] if i =~/.+?\+\d+/
- x=if idx_lst.length == 1 or idx_lst[0].gsub(/\+\d+/,'') == i
- @the_idx[use]['term_node_lev1']=[] unless @the_idx[use]['term_node_lev1'] and defined? @the_idx[use]['term_node_lev1']
- x=if r
- @the_idx[use]['term_node_lev1'] << { :ocn => idx[:ocn], :range => "#{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}", :seg => idx[:seg] }
- "#{i} #{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}"
- else
- @the_idx[use]['term_node_lev1'] << { :ocn => idx[:ocn], :seg => idx[:seg] }
- "#{i} #{idx[:ocn]}"
- end
- else
- @the_idx[use]['term_node_lev2']={} unless @the_idx[use]['term_node_lev2'] and defined? @the_idx[use]['term_node_lev2']
- @the_idx[use]['term_node_lev2'][i]=[] unless @the_idx[use]['term_node_lev2'][i] and defined? @the_idx[use]['term_node_lev2'][i]
- x=if r
- @the_idx[use]['term_node_lev2'][i] << { :ocn => idx[:ocn], :range => "#{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}", :seg => idx[:seg] }
- "#{idx_lst[0]}:#{i} #{idx[:ocn]}-#{idx[:ocn].to_i+r.to_i}"
- else
- @the_idx[use]['term_node_lev2'][i] << { :ocn => idx[:ocn], :seg => idx[:seg] }
- "#{idx_lst[0]}:#{i} #{idx[:ocn]}"
- end
- end
- end
- end
- the_idx=@the_idx.sort
- #p the_idx; p '-----'
- the_idx
- end
- def index(the_idx)
- @x=1
- @idx={}
- @idx[:sst],@idx[:html]=[],[]
- @idx[:sst] << "\n\n#{Mx[:br_page_new]}"
- @idx[:sst] << "\n\n#{Mx[:lv_o]}2:#{Mx[:lv_c]}Index #{Mx[:id_o]}~0;0:0;x0#{Mx[:id_c]}"
- @idx[:sst] << "\n\n#{Mx[:lv_o]}4:idx#{Mx[:lv_c]} [Index] #{Mx[:pa_non_object_dummy_heading]} #{Mx[:id_o]}~0;0:0;x0#{Mx[:id_c]}"
- alph=%W[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]
- @idx[:html] << '
'
- alph.each do |x|
- @idx[:html] << if x =~/[0-9]/; ''
- else
- %{#{x}, }
- end
- end
- @idx[:html] << '
'
- letter=alph.shift
- @idx[:html] << %{\n
}
- the_idx.each do |i|
- i.each do |x|
- if x.class == String
- f=/^(\S)/.match(x)[1]
- if letter < f
- while letter < f
- if alph.length > 0
- letter=alph.shift
- @idx[:html] << %{\n
}
- else break
- end
- end
- end
- @idx[:sst] << %{\n\n#{Mx[:fa_bold_o]}#{x},#{Mx[:fa_bold_c]} }
- aname=x.gsub(/\s+/,'_')
- @idx[:html] << %{\n
#{x}, }
- @o=@idx[:sst].index(@idx[:sst].last) #@o=@idx[:sst].length - 1
- @q=@idx[:html].index(@idx[:html].last) #@o=@idx[:html].length - 1
- print "\n" + x + ', ' if @md.cmd =~/V/
- elsif x.class == Array
- p 'array error? -->'
- print x
- elsif x.class == Hash
- if x['term_node_lev1'].class == Array
- x['term_node_lev1'].each do |a|
- if a[:range]
- @idx[:sst][@o]=@idx[:sst][@o] + %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{@env.url.root}/#{@md.fnb}/#{a[:seg]}.html##{a[:ocn]}, }
- @idx[:html][@q]=@idx[:html][@q] + %{#{a[:range]}, }
- print a[:range] + ', ' if @md.cmd =~/V/
- elsif a[:ocn]
- @idx[:sst][@o]=@idx[:sst][@o] + %{#{Mx[:lnk_o]}#{a[:ocn]}#{Mx[:lnk_c]}#{@env.url.root}/#{@md.fnb}/#{a[:seg]}.html##{a[:ocn]}, }
- @idx[:html][@q]=@idx[:html][@q] + %{#{a[:ocn]}, }
- print a[:ocn] + ', ' if @md.cmd =~/V/
- else p 'error'
- end
- end
- @idx[:html][@q]=@idx[:html][@q] + '
'
- end
- if x['term_node_lev2']
- m=x['term_node_lev2']
- m=m.sort
- m.each do |k,y|
- if k !~/term_node_lev1/
- @idx[:sst][@o]=@idx[:sst][@o] + %{#{k}, }
- @idx[:html][@q]=@idx[:html][@q] + %{\n
#{k}, }
- print "\n\t" + k + ', ' if @md.cmd =~/V/
- y.each do |z|
- if z[:range]
- @idx[:sst][@o]=@idx[:sst][@o] + %{#{Mx[:lnk_o]}#{z[:range]}#{Mx[:lnk_c]}#{@env.url.root}/#{@md.fnb}/#{z[:seg]}.html##{z[:ocn]}, }
- @idx[:html][@q]=@idx[:html][@q] + %{#{z[:range]}, }
- print z[:range] + ', ' if @md.cmd =~/V/
- elsif z[:ocn]
- @idx[:sst][@o]=@idx[:sst][@o] + %{#{Mx[:lnk_o]}#{z[:ocn]}#{Mx[:lnk_c]}#{@env.url.root}/#{@md.fnb}/#{z[:seg]}.html##{z[:ocn]}, }
- @idx[:html][@q]=@idx[:html][@q] + %{#{z[:ocn]}, }
- print z[:ocn] + ', ' if @md.cmd =~/V/
- else p 'error'
- end
- end
- @idx[:html][@q]=@idx[:html][@q] + '
'
- end
- end
- end
- @idx[:sst][@o]=@idx[:sst][@o] + " #{Mx[:id_o]}~0;0:0;x#{@x}#{Mx[:id_c]}"
- @x +=1
- end
- end
- end
- print "\n" if @md.cmd =~/V/
- @idx
- end
- def screen_print(the_idx)
- the_idx.each do |i|
- i.each do |x|
- if x.class == String
- print "\n" + x + ', '
- elsif x.class == Array
- p 'array error? -->'
- print x
- elsif x.class == Hash
- if x['term_node_lev1'].class == Array
- x['term_node_lev1'].each do |a|
- if a[:range]
- print a[:range] + ', '
- elsif a[:ocn]
- print a[:ocn] + ', '
- else p 'error'
- end
- end
- end
- if x['term_node_lev2']
- m=x['term_node_lev2']
- m=m.sort
- m.each do |k,y|
- if k !~/term_node_lev1/
- print "\n\t" + k + ', '
- #p y
- y.each do |z|
- if z[:range]
- print z[:range] + ', '
- elsif z[:ocn]
- print z[:ocn] + ', '
- else p 'error'
- end
- end
- end
- end
- end
- end
- end
- end
- end
- def output_html_idx(html_idx)
- if @md.book_idx
- path="#{@env.path.output}/#{@md.fnb}"
- Dir.mkdir(path) unless FileTest.directory?(path)
- html_index_file=File.new("#{path}/#{@md.fn[:book_idx_html]}",'w')
- html_idx.each {|x| html_index_file << x }
- html_index_file.close
- end
- end
- def clean_and_insert_index(data,sisu_markup_idx)
- tuned_file=[]
- data.each do |para|
- para.gsub!(/\n*#{@rgx_idx}/m,'')
- tuned_file << para
- if para =~/#{Mx[:br_endnotes]}/ and sisu_markup_idx
- sisu_markup_idx.each do |idx|
- tuned_file << idx
- end
- end
- end
- tuned_file
- end
- def clean_index(data)
- tuned_file=[]
- data.each do |para|
- para.gsub!(/\n*#{@rgx_idx}/m,'')
- tuned_file << para
- end
- tuned_file
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/dal_images.rb b/lib/sisu/v1/dal_images.rb
deleted file mode 100644
index 64d4bcef..00000000
--- a/lib/sisu/v1/dal_images.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module SiSU_images
- class Images
- def initialize(md,data)
- @md,@data=md,data
- end
- def images
- data=@data
- tuned_file=[]
- @rmgk=false
- imagemagick_=SiSU_Env::Info_settings.new.program?('rmagick')
- if imagemagick_
- begin
- @rmgk=SiSU_Env::Load.new('RMagick').prog
- rescue
- @rmgk=false
- end
- else
- if @md.cmd =~/[vVM]/
- tell=SiSU_Screen::Ansi.new(@md.cmd,'use of RMagick is not enabled in sisurc.yml')
- tell.warn
- end
- end
- data.each do |para|
- para.strip!
- if para =~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif)(?:\s*|\s+.+)?#{Mx[:lnk_c]}(?:(?:https?|file|ftp):\S+|image)/
- if para !~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif)\s+\d+x\d+\s+/
- m=/#{Mx[:lnk_o]}\s*(\S+\.(?:png|jpg|gif))/
- if imagemagick_
- imgs=para.scan(m).flatten
- img_col=img_row=nil
- 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.exist?("#{image_path}/#{image}")
- end
- if FileTest.exist?("#{image_path}/#{image}")
- if @rmgk
- img=Magick::ImageList.new("#{image_path}/#{image}")
- img_col,img_row=img.columns,img.rows
- else
- if @md.cmd =~/[vVM]/
- tell=SiSU_Screen::Ansi.new(@md.cmd,'RMagick not present, will attempt to use imagemagick (identify) directly')
- tell.warn
- end
- imgsys=`identify #{image_path}/#{image}`.strip #system call
- img_col,img_row=/(\d+)x(\d+)/m.match(imgsys)[1,2]
- img_col,img_row=img_col.to_i,img_row.to_i
- end
- row=(img && defined? img.rows) ? img.rows : img_row
- col=(img && defined? img.columns) ? img.columns : img_col
- if img_col > img_row #landscape
- if img_col> 640 #480
- img_col=640 #480
- img_row=((1.00*img_col/col)*row).round
- end
- else #portrait
- if img_col> 640 #480
- img_col=640 #480
- img_row=((1.00*img_col/col)*row).round
- end
- if img_row > 640
- img_row=640
- img_col=((1.00*img_row/row)*col).round
- end
- end
- para.gsub!(/(#{image})/,"#{image} #{img_col}x#{img_row}")
- else para.gsub!(/#{Mx[:lnk_o]}\s*(\S+)\.(png|jpg|gif).+?#{Mx[:lnk_c]}((?:https?|file|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!(/(#{Mx[:lnk_o]})\s*(\S+\.(?:png|jpg|gif))\s+/i,'\1\2 ') if para =~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif).+?#{Mx[:lnk_c]}(?:(?:https?|file|ftp):\S+|image)/
- tuned_file << para unless para.nil?
- end
- tuned_file
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/dal_metadata.rb b/lib/sisu/v1/dal_metadata.rb
deleted file mode 100644
index 0981eb69..00000000
--- a/lib/sisu/v1/dal_metadata.rb
+++ /dev/null
@@ -1,225 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module SiSU_metadata
- class Metadata
- def initialize(md,data)
- @md,@data=md,data
- l=SiSU_Env::Standardise_language.new.file_to_language(md.fns)
- language=l[:l]
- @tr=SiSU_Translate::Source.new(md,language)
- 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
- header1="\n#{Mx[:lv_o_1]}meta#{Mx[:lv_c]}Document Information (metadata) #{Mx[:id_o]}~0;0:0;m#{ocnm}#{Mx[:id_c]}"
- ocnm+=1
- header4="\n#{Mx[:lv_o_4]}metadata#{Mx[:lv_c]}Metadata #{Mx[:id_o]}~0;m#{ocnm};m#{ocnm}#{Mx[:id_c]}"
- ocnm+=1; ocnd+=1
- head_no_dc="#{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- ocnm+=1; ocnd+=1
- head_no_dc_tag="#{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- data.each do |para|
- case para
- when /^#{Mx[:meta_o]}(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)#{Mx[:meta_c]}/i
- m=$1
- ocnm+=1; ocnd+=1
- @dc << case para
- when /^#{Mx[:meta_o]}title#{Mx[:meta_c]}/
- "\n#{@tr.full_title}: #{Mx[:fa_underscore_o]}#{@md.full_title}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}(?:creator|author)#{Mx[:meta_c]}/
- "\n#{@tr.author}: #{Mx[:fa_underscore_o]}#{@md.author}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /#{Mx[:meta_o]}(?:translator|translated_by)#{Mx[:meta_c]}/
- "\n#{@tr.translator}: #{Mx[:fa_underscore_o]}#{@md.translator}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}(?:illustrator|illustrated_by)#{Mx[:meta_c]}/
- "\n#{@tr.illustrator}: #{Mx[:fa_underscore_o]}#{@md.illustrator}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}prepared_by#{Mx[:meta_c]}/
- "\n#{@tr.prepared_by}: #{Mx[:fa_underscore_o]}#{@md.prepared_by}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}digitized_by#{Mx[:meta_c]}/
- "\n#{@tr.digitized_by}: #{Mx[:fa_underscore_o]}#{@md.digitized_by}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}description#{Mx[:meta_c]}/
- "\n#{@tr.description}: #{Mx[:fa_underscore_o]}#{@md.description}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}subject#{Mx[:meta_c]}/
- "\n#{@tr.subject}: #{Mx[:fa_underscore_o]}#{@md.subject}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}abstract#{Mx[:meta_c]}/
- "\n#{@tr.abstract}: #{Mx[:fa_underscore_o]}#{@md.abstract}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}publisher#{Mx[:meta_c]}/
- "\n#{@tr.publisher}: #{Mx[:fa_underscore_o]}#{@md.publisher}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}contributor#{Mx[:meta_c]}/
- "\n#{@tr.contributor}: #{Mx[:fa_underscore_o]}#{@md.contributor}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}date.created#{Mx[:meta_c]}/
- "\n#{@tr.date_created}: #{Mx[:fa_underscore_o]}#{@md.date_created}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}date.issued#{Mx[:meta_c]}/
- "\n#{@tr.date_issued}: #{Mx[:fa_underscore_o]}#{@md.date_issued}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}date.available#{Mx[:meta_c]}/
- "\n#{@tr.date_available}: #{Mx[:fa_underscore_o]}#{@md.date_available}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}date.modified#{Mx[:meta_c]}/
- "\n#{@tr.date_modified}: #{Mx[:fa_underscore_o]}#{@md.date_modified}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}date.valid#{Mx[:meta_c]}/
- "\n#{@tr.date_valid}: #{Mx[:fa_underscore_o]}#{@md.date_valid}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}date#{Mx[:meta_c]}/
- "\n#{@tr.date}: #{Mx[:fa_underscore_o]}#{@md.date}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}type#{Mx[:meta_c]}/
- "\n#{@tr.type}: #{Mx[:fa_underscore_o]}#{@md.type}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}format#{Mx[:meta_c]}/
- "\n#{@tr.format}: #{Mx[:fa_underscore_o]}#{@md.format}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}rights#{Mx[:meta_c]}/
- "\n#{@tr.rights}: #{Mx[:fa_underscore_o]}#{@md.rights}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}identifier#{Mx[:meta_c]}/
- "\n#{@tr.identifier}: #{Mx[:fa_underscore_o]}#{@md.identifier}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}source#{Mx[:meta_c]}/
- "\n#{@tr.source}: #{Mx[:fa_underscore_o]}#{@md.source}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}language#{Mx[:meta_c]}/
- "\n#{@tr.language}: #{Mx[:fa_underscore_o]}#{@md.language}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}language.original#{Mx[:meta_c]}/
- "\n#{@tr.language_original}: #{Mx[:fa_underscore_o]}#{@md.language_original}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}relation#{Mx[:meta_c]}/
- "\n#{@tr.relation}: #{Mx[:fa_underscore_o]}#{@md.relation}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}coverage#{Mx[:meta_c]}/
- "\n#{@tr.coverage}: #{Mx[:fa_underscore_o]}#{@md.coverage}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}keywords#{Mx[:meta_c]}/
- "\n#{@tr.keywords}: #{Mx[:fa_underscore_o]}#{@md.keywords}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}comments#{Mx[:meta_c]}/
- "\n#{@tr.comments}: #{Mx[:fa_underscore_o]}#{@md.comments}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}cls_loc#{Mx[:meta_c]}/
- "\n#{@cls_dewey}: #{Mx[:fa_underscore_o]}#{@md.cls_dewey}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}cls_loc#{Mx[:meta_c]}/
- "\n#{@tr.cls_dewey}: #{Mx[:fa_underscore_o]}#{@md.cls_dewey}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}(?:cls_gutenberg|cls_pg)#{Mx[:meta_c]}/
- "\n#{@tr.cls_gutenberg}: #{Mx[:fa_underscore_o]}#{@md.cls_gutenberg}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- #"\n#{@tr.cls_gutenberg}: #{@md.cls_pg} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}cls_isbn#{Mx[:meta_c]}/
- "\n#{@tr.cls_isbn}: #{Mx[:fa_underscore_o]}#{@md.cls_isbn}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}prefix(?:_a)?#{Mx[:meta_c]}/
- "\n#{@tr.prefix_a}: #{Mx[:fa_underscore_o]}#{@md.prefix_a}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- when /^#{Mx[:meta_o]}prefix_b#{Mx[:meta_c]}/
- "\n#{@tr.prefix_b}: #{Mx[:fa_underscore_o]}#{@md.prefix_b}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}"
- else para.gsub(/^#{Mx[:meta_o]}(#{m})\s+(.+)/m,"\n#{m.capitalize}: #{Mx[:fa_underscore_o]}\\2#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};d#{ocnd}#{Mx[:id_c]}")
- end
- end
- end
- ocnm+=1; ocnv+=1
- head_no_rc="#{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- ocnm+=1; ocnv+=1
- head_no_rc_tag="#{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- 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}: #{Mx[:fa_underscore_o]}#{@md.sc_number}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- ocnm+=1; ocnv+=1
- @cvs << "#{@tr.sc_date}: #{Mx[:fa_underscore_o]}#{@md.sc_date}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- ocnm+=1; ocnv+=1
- @cvs << "CVS/RCS time: #{Mx[:fa_underscore_o]}#{@md.sc_time}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- 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}: #{Mx[:fa_underscore_o]}#{@md.sc_filename}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- else @rc << "#{@tr.sourcefile}: #{Mx[:fa_underscore_o]}#{@md.fns}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- end
- ocnm+=1; ocnv+=1
- if @md.file_encoding \
- and @md.file_encoding.length > 3 #translate
- @rc << "Filetype: #{Mx[:fa_underscore_o]}#{@md.file_encoding}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- end
- ocnm+=1; ocnv+=1
- if @md.dgst #change. enable by default
- @rc << "#{@tr.sourcefile_digest}, #{@md.dgst[0]} #{Mx[:fa_underscore_o]}#{@md.dgst[1]}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- ocnm+=1; ocnv+=1
- end
- if @md.dgst_skin #change. enable by default
- @rc << "Skin_Digest: #{@md.dgst_skin[0]} #{Mx[:fa_underscore_o]}#{@md.dgst_skin[1]}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- ocnm+=1; ocnv+=1
- end
- @rc << "#{Mx[:fa_bold_o]}Generated#{Mx[:fa_bold_c]} #{head_no_rc}" if @rc.length > 0
- @rc << "#{@tr.last_generated}: #{Mx[:fa_underscore_o]}#{Time.now}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- ocnm+=1; ocnv+=1
- if @md.sisu_version[:version]
- @rc << "#{@tr.sisu_version}: #{Mx[:fa_underscore_o]}#{@md.sisu_version[:project]}#{Mx[:fa_underscore_c]} #{Mx[:fa_underscore_o]}#{@md.sisu_version[:version]}#{Mx[:fa_underscore_c]} of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]}) #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- ocnm+=1; ocnv+=1
- end
- @rc << "#{@tr.ruby_version}: #{Mx[:fa_underscore_o]} #{@md.ruby_version}#{Mx[:fa_underscore_c]} #{Mx[:id_o]}~0;m#{ocnm};v#{ocnv}#{Mx[:id_c]}"
- end
- meta << Mx[:br_page_new] << header1 << header4
- meta << "Document Manifest @\n #{base_html}/#{@md.fn[:manifest]} #{Mx[:id_o]}~0;m#{ocnm};m#{ocnm}#{Mx[:id_c]}"
- meta << "#{Mx[:fa_bold_o]}Dublin Core#{Mx[:fa_bold_c]} (DC) #{head_no_dc}" if @dc.length > 0
- meta << "#{Mx[:fa_italics_o]}DC tags included with this document are provided here.#{Mx[:fa_italics_c]} #{head_no_dc_tag}" if @dc.length > 0
- @dc.each { |x| meta << x }
- meta << "#{Mx[:fa_bold_o]}Version Information#{Mx[:fa_bold_c]} #{head_no_rc}" if @rc.length > 0
- if @cvs.length > 0
- meta << "#{Mx[:fa_italics_o]}Note the version information provided here, is specific to the host site.#{Mx[:fa_italics_c]} #{head_no_rc_tag}"
- @cvs.each { |x| meta << x }
- end
- @rc.each { |x| meta << x }
- ## ENDNOTE RELATED endnote related
- meta << "\n#{Mx[:br_eof]}"
- meta=SiSU_hash::Object_digest.new(@md,meta,@env).object_digest
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/dal_numbering.rb b/lib/sisu/v1/dal_numbering.rb
deleted file mode 100644
index 56a2999c..00000000
--- a/lib/sisu/v1/dal_numbering.rb
+++ /dev/null
@@ -1,368 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module SiSU_numbering
- class Numbering
- def initialize(md,data)
- @md,@data=md,data
- end
- def numbering_song
- data=@data
- data=number_plaintext_para(data)
- data=name_endnote_seg(data) #tr issue
- data=auto_number_heading_ie_title(data) #tr issue
- data=ocn(data) #watch
- data=minor_numbering(data)
- data=name_para_seg_filename(data)
- data=set_heading_seg(data) unless @md.set_heading_seg
- data=set_heading_top(data) unless @md.set_heading_top
- data=set_header_title(data) unless @md.set_header_title
- data
- end
- def number_plaintext_para(data)
- @tuned_file=[]
- data.each do |para|
- if para !~/#{Mx[:gr_o]}(?:code|group|alt|poem|verse)#{Mx[:gr_c]}|#{Mx[:gr_o]}Th|#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}/
- para.gsub!(/(.+)\n/,'\1 ') #messy, but idea is that tables should retain breaks
- end
- para.gsub!(/^/,"\n") unless para =~/#{Mx[:tc_p]}/u
- para.gsub!(/^\s+|\s$/,"\n")
- @tuned_file << para
- end
- @tuned_file=@tuned_file.flatten
- end
- def name_endnote_seg(data)
- tuned_file=data
- if @md.flag_auto_endnotes \
- and @md.flag_separate_endnotes_make
- tuned_file << "\n#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}Endnotes #{Mx[:gl_o]}-##{Mx[:gl_c]} #{Mx[:id_o]}~0;0:0;u0#{Mx[:id_c]}"
- end
- tuned_file << "\n#{Mx[:br_endnotes]}" #DECIDE ON
- tuned_file=tuned_file.flatten
- end
- def owner_details_seg
- data << "#{Mx[:lv_o]}4:owner.details#{Mx[:lv_c]}Owner Details"
- end
- def number_sub_heading(para,num,title_no)
- case para
- when /#{Mx[:lv_o]}#{num}:-#{Mx[:lv_c]}/; para.gsub!(/#{Mx[:lv_o]}#{num}:-#{Mx[:lv_c]}/,"#{title_no} ")
- when /^#{Mx[:lv_o]}#{num}:##{Mx[:lv_c]}/; para.gsub!(/^#{Mx[:lv_o]}#{num}:##{Mx[:lv_c]}/,"#{title_no} ")
- when /^#{Mx[:lv_o]}#{num}:[a-z_\.]+#{Mx[:lv_c]}/
- para.gsub!(/^#{Mx[:lv_o]}#{num}:([a-z_\.]+)#{Mx[:lv_c]}\s*(.+)/i,%{#{Mx[:lv_o]}#{num}:\\1#{Mx[:lv_c]} #{title_no} \\2 #{Mx[:fa_o]}:name##{title_no}#{Mx[:fa_c]}})
- when /^#{Mx[:lv_o]}#{num}:#{Mx[:lv_c]}\s*#{title_no}/
- para.gsub!(/^#{Mx[:lv_o]}#{num}:#{Mx[:lv_c]}/,"#{Mx[:lv_o]}#{num}:#{title_no}#{Mx[:lv_c]}") #where title contains title number
- else para.gsub!(/^#{Mx[:lv_o]}#{num}:#{Mx[:lv_c]}/,"#{Mx[:lv_o]}#{num}:#{title_no}#{Mx[:lv_c]} #{title_no} ") #main, where title number is to be provided
- end
- if @md.toc_lev_limit \
- and @md.toc_lev_limit < num
- para.gsub!(/^#{Mx[:lv_o]}[5-9]:\S*?#{Mx[:lv_c]}/,'!_ ') #bold line, watch
- end
- para
- end
- def auto_number_heading_ie_title(data) #also does some segment naming
- @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 !~/^#{Rx[:meta]}/
- if (para =~/^(?:#{no1}|^#{no2}|^#{no3}#{no4})~#/ \
- and para !~/^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}/)
- t_not+=1 #; t_no2=0; t_no3=0
- para.gsub!(/^(#{Mx[:lv_o]}(?:#{no1}|#{no2}|#{no3}|#{no4})):#(#{Mx[:lv_c]})/,"\\1:ps#{t_not}\\2")
- end
- if para =~/#{Mx[:lv_o]}#{no1}:/
- @subnumber=1
- @subnumber=0 if para =~/#{Mx[:lv_o]}#{no1}:/
- end
- if para =~/^#{Mx[:lv_o]}[1-6]:[\w-]*#{Mx[:lv_c]}/ \
- and para !~ /(?:#{Mx[:lv_o]}[1-6]:[\w-]+-#{Mx[:lv_c]}|#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^#{Mx[:lv_o]}[1-6]:[a-z_\.]+#{Mx[:lv_c]}\s*[\d.]+)\s/ \
- and para !~/#{Mx[:fa_o]}(?:~#|-#)#{Mx[:fa_c]}/
- if para =~/^#{Mx[:lv_o]}#{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!(/^#{Mx[:lv_o]}#{no1}:#{Mx[:lv_c]}\s*(\S+)#/,"#{Mx[:lv_o]}#{no1}:#{title_no}#{Mx[:lv_c]} \\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 =~/^#{Mx[:lv_o]}#{no1}:#{Mx[:lv_c]}\s*[\d.]+\s/ #fix -> if the title starts with a numbering scheme, do not auto-number, review
- para.gsub!(/^#{Mx[:lv_o]}#{no1}:#{Mx[:lv_c]}/,"#{Mx[:lv_o]}#{no1}:#{title_no}#{Mx[:lv_c]}#{title_no}. ")
- end
- @md.seg_names << title_no
- #else puts "warning segment name #{title_no} already exists"
- end
- unless para =~/^#{Mx[:lv_o]}#{no1}:([a-z_\.]+)#{Mx[:lv_c]}\s*[A-Z]\.?\s/ #bug -> tmp fix, excludes A. B. C. lettering, but not roman numerals, is arbitrary, review required
- para.gsub!(/^#{Mx[:lv_o]}#{no1}:([a-z_\.]+)#{Mx[:lv_c]}\s*(.+)/i,
- %{#{Mx[:lv_o]}#{no1}:\\1#{Mx[:lv_c]}#{title_no}. \\2 #{Mx[:fa_o]}:name##{title_no}#{Mx[:fa_c]}})
- end
- para.gsub!(/^#{Mx[:lv_o]}#{no1}:##{Mx[:lv_c]}/,"#{title_no}. ") #watch
- para.gsub!(/^#{no1}~#\s*/,"#{title_no}. ")
- end
- if para =~/^#{Mx[:lv_o]}#{no2}:\S*?#{Mx[:lv_c]}/
- t_no2+=1; t_no3=0
- title_no="#{t_no1}.#{t_no2}"
- para=number_sub_heading(para,no2,title_no)
- end
- if para =~/^#{Mx[:lv_o]}#{no3}:\S*?#{Mx[:lv_c]}/
- t_no3+=1
- title_no="#{t_no1}.#{t_no2}.#{t_no3}"
- para=number_sub_heading(para,no3,title_no)
- end
- elsif para =~/^#{Mx[:lv_o]}[1-6]:[\w-]+-#{Mx[:lv_c]}/ # endnotes, watch2005
- para.gsub!(/^#{Mx[:lv_o]}#{no1}:([a-z_\.]+)-#{Mx[:lv_c]}/,"#{Mx[:lv_o]}#{no1}:\\1#{Mx[:lv_c]}") #"#{no1}~\\1 ")
- para.gsub!(/^#{Mx[:lv_o]}#{no2}:([a-z_\.]+)-#{Mx[:lv_c]}/,"#{Mx[:lv_o]}#{no2}:\\1#{Mx[:lv_c]}")
- para.gsub!(/^#{Mx[:lv_o]}#{no3}:([a-z_\.]+)-#{Mx[:lv_c]}/,"#{Mx[:lv_o]}#{no3}:\\1#{Mx[:lv_c]}")
- 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
- if para =~/^#{Mx[:lv_o]}[1-9]:#{Mx[:lv_c]}([\d\.]+)/ #risky (must be unique) consider output to 4~~\d instead of 4~\d
- name_num=$1
- para.gsub!(/^#{Mx[:lv_o]}([1-9]:)#{Mx[:lv_c]}/,"#{Mx[:lv_o]}\\1#{name_num}#{Mx[:lv_c]}")
- end
- if @md.toc_lev_limit
- end
- end
- @tuned_file << para
- end
- @tuned_file=@tuned_file.flatten
- end
- def ocn(data) #and auto segment numbering increment
- @tuned_file=[]
- object_array=SiSU_document_structure::OCN.new(@md,data).ocn
- object_array.each do |o|
- @tuned_file <<= if o.ocn; "#{o.txt} #{Mx[:id_o]}~#{o.ocn};#{o.lv};#{o.type}#{Mx[:id_c]}" #main ocn descriptor
- else o.txt
- end
- end
- @tuned_file=@tuned_file.flatten
- end
- def minor_numbering(data) #and auto segment numbering increment
- @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 !~/^%% |#{Rx[:meta]}|^0~|^#{Mx[:lv_o]}endnotes:|^4~endnotes|^<\/center>|<:ee>|<:e[:_]>|^\^~ |<:e[:_]\d+?>|^#{Mx[:fa_o]}:p[bn]#{Mx[:fa_c]}|^<:\#|<:- |<[:!]!4|#{Mx[:gr_o]}(?:alt|code|group|poem|table)#{Mx[:gr_c]}|^(?:alt|code|group|poem|table)\{|^\}(?:alt|code|group|poem|table)|^\}table$|
|
|
|
|<\/tr>||\[endnotes\]|<:zz>|<:isbn-|<:journal-|<:conference-|#{Mx[:br_endnotes]}/i #ocn here # added with Tune.code #¡
- if para=~/^#{Mx[:lv_o]}[1-9]:\S*?#{Mx[:lv_c]}/; 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!(/^_# /,"#{Mx[:fa_o]}:i1#{Mx[:fa_c]} #{letter[letter_small]}. ") #change 2004
- letter_small+=1
- end
- end
- end
- @tuned_file << para
- end
- @tuned_file=@tuned_file.flatten
- end
- def name_para_seg_filename(data)
- # 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
- @tuned_file=[]
- art_filename_auto=1
- @counter=1
- @unique_auto_name=[]
- if not @md.seg_autoname_safe and @md.cmd =~/[MV]/
- puts 'manual segment names, numbers used as names, risk warning (segmented html)'
- end
- data.each do |para|
- para=SiSU_document_structure::Structure.new(@md,para).structure_markup
- if para =~/^#{Mx[:lv_o]}[456]:#{Mx[:lv_c]}/
- if para=~/^#{Mx[:lv_o]}[4]:#{Mx[:lv_c]}/ \
- and not @md.set_heading_seg
- @md.set_heading_seg=true
- end
- if para =~/^#{Mx[:lv_o]}[456]:#{Mx[:lv_c]}(?:\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!(/^#{Mx[:lv_o]}([456]):#{Mx[:lv_c]}/,"#{Mx[:lv_o]}\\1:#{pattern}#{Mx[:lv_c]}")
- @md.seg_names << pattern
- else puts 'warn, there may be a conflicting numbering scheme' if @md.cmd =~/[VM]/
- end
- end
- if para =~/^#{Mx[:lv_o]}4:#{Mx[:lv_c]}.+?;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!(/^#{Mx[:lv_o]}(4:)#{Mx[:lv_c]}/,"#{Mx[:lv_o]}\\1#{pattern}#{Mx[:lv_c]}")
- @md.seg_names << pattern
- else
- para.gsub!(/^#{Mx[:lv_o]}(4:)#{Mx[:lv_c]}/,"#{Mx[:lv_o]}\\1~#{pattern}#{Mx[:lv_c]}")
- @md.seg_names << "~#{pattern}"
- end
- end
- if para =~/^#{Mx[:lv_o]}4:#{Mx[:lv_c]}/ #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!(/^#{Mx[:lv_o]}(4:)#{Mx[:lv_c]}/,%{#{Mx[:lv_o]}\\1~#{art_filename_auto}#{Mx[:lv_c]}})
- @md.seg_names << art_filename_auto
- else puts 'segment name (numbering) error'
- end
- art_filename_auto+=1
- end
- end
- @tuned_file << if para =~/^#{Mx[:lv_o]}([1-6]):\S*?#{Mx[:lv_c]}/m \
- and (@md.pagenew or @md.pagebreak)
- m=$1 #watch ref~
- para_tmp=[]
- if @md.pagenew.inspect =~/#{m}/; para_tmp << "#{Mx[:br_page_new]}\n" << para
- elsif @md.pagebreak.inspect =~/#{m}/; para_tmp << "#{Mx[:br_page]}\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(data) #% 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]/
- @tuned_file=[]
- data.each do |para|
- unless @md.set_heading_top
- if para !~/^(?:#{Rx[:meta]}|@\S+:|0~\S+)\s/m \
- and para !~/\A\s*\Z/m
- @md.set_heading_top=true
- head=if @md.title ; "#{Mx[:lv_o]}1:#{Mx[:lv_c]} #{@md.title}"
- else "#{Mx[:lv_o]}1:#{Mx[:lv_c]} [no title provided]"
- end
- @tuned_file << head
- end
- end
- @tuned_file << para
- end
- @tuned_file=@tuned_file.flatten
- end
- end
- def set_heading_seg(data) #% 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]/
- @tuned_file=[]
- data.each do |para|
- unless @md.set_heading_seg
- if para !~/^(?:#{Rx[:meta]}|#{Mx[:lv_o]}[123]:\S*?#{Mx[:lv_c]})/m \
- and para !~/\A\s*\Z/m \
- and para !~/#{Mx[:br_page]}|#{Mx[:br_page_new]}/
- @md.set_heading_seg=true
- head=if @md.title ; "#{Mx[:lv_o]}4:seg#{Mx[:lv_c]} [#{@md.title}]"
- else "#{Mx[:lv_o]}4:seg#{Mx[:lv_c]} [segment]"
- end
- @tuned_file << head
- end
- end
- @tuned_file << para
- end
- @tuned_file=@tuned_file.flatten
- end
- end
- def set_header_title(data) #% 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]/
- @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 << "#{Mx[:meta_o]}title#{Mx[:meta_c]} #{@md.heading_seg_first}"
- @md.title=@md.heading_seg_first
- @md.set_header_title=true
- end
- end
- @tuned_file << para
- end
- @tuned_file=@tuned_file.flatten
- end
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/dal_substitutions_and_insertions.rb b/lib/sisu/v1/dal_substitutions_and_insertions.rb
deleted file mode 100644
index 8733d764..00000000
--- a/lib/sisu/v1/dal_substitutions_and_insertions.rb
+++ /dev/null
@@ -1,154 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-
-
- ** Description: system environment, resource control and configuration details
-
-=end
-module SiSU_substitute_and_insert
- class SI
- def initialize(md,data)
- @md,@data=md,data
- @skin=SiSU_Env::Info_skin.new(@md)
- end
- def substitutions_and_insertions?
- data=@data
- data_expand=[]
- 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 precedes 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|
- if para =~/<:insert\d+!?>/ \
- and para !~/^%\s+/
- @skin.select
- ins=SiSU_Viz::Inserts.new
- case para
- when /^\s*<:(insert1)>\s*$/
- i=$1
- if defined? ins.insert1
- para=[]
- ins.insert1.split(/\n\n/).each{|x| para << x }
- else p "skin #{i} not found in #{@skin.select}"
- end
- when /^\s*<:(insert2)>\s*$/
- i=$1
- if defined? ins.insert2
- para=[]
- ins.insert2.split(/\n\n/).each{|x| para << x }
- else p "skin #{i} not found in #{@skin.select}"
- end
- when /^\s*<:(insert3)>\s*$/
- i=$1
- if defined? ins.insert3
- para=[]
- ins.insert3.split(/\n\n/).each{|x| para << x << "\n"}
- else p "skin #{i} not found in #{@skin.select}"
- end
- when /^\s*<:(insert4)>\s*$/
- i=$1
- if defined? ins.insert4
- para=[]
- ins.insert4.split(/\n\n/).each{|x| para << x << "\n"}
- else p "skin #{i} not found in #{@skin.select}"
- end
- when /^\s*<:(insert5)>\s*$/
- i=$1
- if defined? ins.insert5
- para=[]
- ins.insert5.split(/\n\n/).each{|x| para << x << "\n"}
- else p "skin #{i} not found in #{@skin.select}"
- end
- when /^\s*<:(insert6)>\s*$/
- i=$1
- if defined? ins.insert6
- para=[]
- ins.insert6.split(/\n\n/).each{|x| para << x << "\n"}
- else p "skin #{i} not found in #{@skin.select}"
- end
- when /^\s*<:(insert7)>\s*$/
- i=$1
- if defined? ins.insert7
- para=[]
- ins.insert7.split(/\n\n/).each{|x| para << x << "\n"}
- else p "skin #{i} not found in #{@skin.select}"
- end
- end
- para.each{|x| data_expand << x }
- else data_expand << para
- end
- data_expand.flatten!
- data_expand.compact!
- end
- data_expand.each do |para|
- para=if @md.markup_version.to_f >= 0.38
- SiSU_document_structure::Structure.new(@md,para).structure_markup_normalize
- else
- SiSU_document_structure::Structure.new(@md,para).structure_marks
- end
- #para.gsub!(//,'\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+/,"#{Mx[:meta_o]}\\1#{Mx[:meta_c]}")
- para.gsub!(/^@(\S+?):([+-])\s+/,"#{Mx[:meta_o]}\\1\\2#{Mx[:meta_c]}")
- end
- end
- end
- end
-end
-__END__
diff --git a/lib/sisu/v1/dal_syntax.rb b/lib/sisu/v1/dal_syntax.rb
deleted file mode 100644
index 98886f51..00000000
--- a/lib/sisu/v1/dal_syntax.rb
+++ /dev/null
@@ -1,421 +0,0 @@
-# coding: utf-8
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see .
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
-
-
-
-
-
-
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
-
-
-
- * Download:
-
-
- * Ralph Amissah
-
-