diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sisu/0.52/vocab.rb | 113 | ||||
| -rw-r--r-- | lib/sisu/0.52/vocab_lex.rb | 144 | ||||
| -rw-r--r-- | lib/sisu/v0/cgi.rb (renamed from lib/sisu/0.52/cgi.rb) | 14 | ||||
| -rw-r--r-- | lib/sisu/v0/cgi_pgsql.rb (renamed from lib/sisu/0.52/cgi_pgsql.rb) | 24 | ||||
| -rw-r--r-- | lib/sisu/v0/cgi_sql_common.rb (renamed from lib/sisu/0.52/cgi_sql_common.rb) | 82 | ||||
| -rw-r--r-- | lib/sisu/v0/cgi_sqlite.rb (renamed from lib/sisu/0.52/cgi_sqlite.rb) | 28 | ||||
| -rw-r--r-- | lib/sisu/v0/character_encoding.rb (renamed from lib/sisu/0.52/character_encoding.rb) | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/composite.rb (renamed from lib/sisu/0.52/composite.rb) | 24 | ||||
| -rw-r--r-- | lib/sisu/v0/concordance.rb (renamed from lib/sisu/0.52/concordance.rb) | 57 | ||||
| -rw-r--r-- | lib/sisu/v0/conf.rb (renamed from lib/sisu/0.52/conf.rb) | 14 | ||||
| -rw-r--r-- | lib/sisu/v0/css.rb (renamed from lib/sisu/0.52/css.rb) | 62 | ||||
| -rw-r--r-- | lib/sisu/v0/dal.rb (renamed from lib/sisu/0.52/dal.rb) | 231 | ||||
| -rw-r--r-- | lib/sisu/v0/dal_doc_str.rb (renamed from lib/sisu/0.52/dal_doc_str.rb) | 18 | ||||
| -rw-r--r-- | lib/sisu/v0/dal_doc_str_code.rb (renamed from lib/sisu/0.52/dal_doc_str_code.rb) | 16 | ||||
| -rw-r--r-- | lib/sisu/v0/dal_doc_str_tables.rb (renamed from lib/sisu/0.52/dal_doc_str_tables.rb) | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/dal_syntax.rb (renamed from lib/sisu/0.52/dal_syntax.rb) | 16 | ||||
| -rw-r--r-- | lib/sisu/v0/db_columns.rb (renamed from lib/sisu/0.52/db_columns.rb) | 4 | ||||
| -rw-r--r-- | lib/sisu/v0/db_create.rb (renamed from lib/sisu/0.52/db_create.rb) | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/db_drop.rb (renamed from lib/sisu/0.52/db_drop.rb) | 4 | ||||
| -rw-r--r-- | lib/sisu/v0/db_import.rb (renamed from lib/sisu/0.52/db_import.rb) | 56 | ||||
| -rw-r--r-- | lib/sisu/v0/db_indexes.rb (renamed from lib/sisu/0.52/db_indexes.rb) | 4 | ||||
| -rw-r--r-- | lib/sisu/v0/db_load_tuple.rb (renamed from lib/sisu/0.52/db_load_tuple.rb) | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/db_remove.rb (renamed from lib/sisu/0.52/db_remove.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/db_select.rb (renamed from lib/sisu/0.52/db_select.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/db_tests.rb (renamed from lib/sisu/0.52/db_tests.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/dbi.rb (renamed from lib/sisu/0.52/dbi.rb) | 20 | ||||
| -rw-r--r-- | lib/sisu/v0/defaults.rb (renamed from lib/sisu/0.52/defaults.rb) | 60 | ||||
| -rw-r--r-- | lib/sisu/v0/digests.rb (renamed from lib/sisu/0.52/digests.rb) | 18 | ||||
| -rw-r--r-- | lib/sisu/v0/docbook.rb (renamed from lib/sisu/0.52/docbook.rb) | 42 | ||||
| -rw-r--r-- | lib/sisu/v0/errors.rb (renamed from lib/sisu/0.52/errors.rb) | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/help.rb (renamed from lib/sisu/0.52/help.rb) | 306 | ||||
| -rw-r--r-- | lib/sisu/v0/html.rb (renamed from lib/sisu/0.52/html.rb) | 99 | ||||
| -rw-r--r-- | lib/sisu/v0/html_format.rb (renamed from lib/sisu/0.52/html_format.rb) | 33 | ||||
| -rw-r--r-- | lib/sisu/v0/html_format_css.rb (renamed from lib/sisu/0.52/html_format_css.rb) | 22 | ||||
| -rw-r--r-- | lib/sisu/v0/html_promo.rb (renamed from lib/sisu/0.52/html_promo.rb) | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/html_scroll.rb (renamed from lib/sisu/0.52/html_scroll.rb) | 17 | ||||
| -rw-r--r-- | lib/sisu/v0/html_segments.rb (renamed from lib/sisu/0.52/html_segments.rb) | 291 | ||||
| -rw-r--r-- | lib/sisu/v0/html_table.rb (renamed from lib/sisu/0.52/html_table.rb) | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/html_tune.rb (renamed from lib/sisu/0.52/html_tune.rb) | 28 | ||||
| -rw-r--r-- | lib/sisu/v0/hub.rb (renamed from lib/sisu/0.52/hub.rb) | 72 | ||||
| -rw-r--r-- | lib/sisu/v0/i18n.rb (renamed from lib/sisu/0.52/i18n.rb) | 116 | ||||
| -rw-r--r-- | lib/sisu/v0/manifest.rb (renamed from lib/sisu/0.52/manifest.rb) | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/odf.rb (renamed from lib/sisu/0.52/odf.rb) | 70 | ||||
| -rw-r--r-- | lib/sisu/v0/odf_format.rb (renamed from lib/sisu/0.52/odf_format.rb) | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/options.rb (renamed from lib/sisu/0.52/options.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/param.rb (renamed from lib/sisu/0.52/param.rb) | 69 | ||||
| -rw-r--r-- | lib/sisu/v0/param_identify_markup.rb (renamed from lib/sisu/0.52/param_identify_markup.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/plaintext.rb (renamed from lib/sisu/0.52/plaintext.rb) | 47 | ||||
| -rw-r--r-- | lib/sisu/v0/plaintext_format.rb (renamed from lib/sisu/0.52/plaintext_format.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/relaxng.rb (renamed from lib/sisu/0.52/relaxng.rb) | 14 | ||||
| -rw-r--r-- | lib/sisu/v0/remote_put.rb (renamed from lib/sisu/0.52/remote_put.rb) | 18 | ||||
| -rw-r--r-- | lib/sisu/v0/response.rb (renamed from lib/sisu/0.52/response.rb) | 4 | ||||
| -rw-r--r-- | lib/sisu/v0/rexml.rb (renamed from lib/sisu/0.52/rexml.rb) | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/screen_text_color.rb (renamed from lib/sisu/0.52/screen_text_color.rb) | 26 | ||||
| -rw-r--r-- | lib/sisu/v0/semantics.rb (renamed from lib/sisu/0.52/semantics.rb) | 22 | ||||
| -rw-r--r-- | lib/sisu/v0/share_src.rb (renamed from lib/sisu/0.52/share_src.rb) | 8 | ||||
| -rw-r--r-- | lib/sisu/v0/share_src_kdissert.rb (renamed from lib/sisu/0.52/share_src_kdissert.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/shared_db.rb (renamed from lib/sisu/0.52/shared_db.rb) | 24 | ||||
| -rw-r--r-- | lib/sisu/v0/shared_html.rb (renamed from lib/sisu/0.52/shared_html.rb) | 8 | ||||
| -rw-r--r-- | lib/sisu/v0/shared_html_lite.rb (renamed from lib/sisu/0.52/shared_html_lite.rb) | 16 | ||||
| -rw-r--r-- | lib/sisu/v0/shared_txt.rb (renamed from lib/sisu/0.52/shared_txt.rb) | 14 | ||||
| -rw-r--r-- | lib/sisu/v0/shared_xml.rb (renamed from lib/sisu/0.52/shared_xml.rb) | 92 | ||||
| -rw-r--r-- | lib/sisu/v0/sisupod_make.rb (renamed from lib/sisu/0.52/sisupod_make.rb) | 26 | ||||
| -rw-r--r-- | lib/sisu/v0/sitemaps.rb (renamed from lib/sisu/0.52/sitemaps.rb) | 16 | ||||
| -rw-r--r-- | lib/sisu/v0/spell.rb (renamed from lib/sisu/0.52/spell.rb) | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_convert_markup.rb (renamed from lib/sisu/0.52/sst_convert_markup.rb) | 32 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_do_inline_footnotes.rb (renamed from lib/sisu/0.52/sst_do_inline_footnotes.rb) | 34 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_from_kdissert.rb (renamed from lib/sisu/0.52/sst_from_kdissert.rb) | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_from_xml.rb (renamed from lib/sisu/0.52/sst_from_xml.rb) | 4 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_identify_markup.rb (renamed from lib/sisu/0.52/sst_identify_markup.rb) | 16 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_to_s_xml_dom.rb (renamed from lib/sisu/0.52/sst_to_s_xml_dom.rb) | 56 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_to_s_xml_node.rb (renamed from lib/sisu/0.52/sst_to_s_xml_node.rb) | 48 | ||||
| -rw-r--r-- | lib/sisu/v0/sst_to_s_xml_sax.rb (renamed from lib/sisu/0.52/sst_to_s_xml_sax.rb) | 36 | ||||
| -rw-r--r-- | lib/sisu/v0/sysenv.rb (renamed from lib/sisu/0.52/sysenv.rb) | 98 | ||||
| -rw-r--r-- | lib/sisu/v0/termsheet.rb (renamed from lib/sisu/0.52/termsheet.rb) | 14 | ||||
| -rw-r--r-- | lib/sisu/v0/texinfo.rb (renamed from lib/sisu/0.52/texinfo.rb) | 20 | ||||
| -rw-r--r-- | lib/sisu/v0/texinfo_format.rb (renamed from lib/sisu/0.52/texinfo_format.rb) | 26 | ||||
| -rw-r--r-- | lib/sisu/v0/texpdf.rb (renamed from lib/sisu/0.52/texpdf.rb) | 144 | ||||
| -rw-r--r-- | lib/sisu/v0/texpdf_format.rb (renamed from lib/sisu/0.52/texpdf_format.rb) | 119 | ||||
| -rw-r--r-- | lib/sisu/v0/update.rb (renamed from lib/sisu/0.52/update.rb) | 6 | ||||
| -rw-r--r-- | lib/sisu/v0/urls.rb (renamed from lib/sisu/0.52/urls.rb) | 10 | ||||
| -rw-r--r-- | lib/sisu/v0/webrick.rb (renamed from lib/sisu/0.52/webrick.rb) | 24 | ||||
| -rw-r--r-- | lib/sisu/v0/wikispeak.rb (renamed from lib/sisu/0.52/wikispeak.rb) | 24 | ||||
| -rw-r--r-- | lib/sisu/v0/xhtml.rb (renamed from lib/sisu/0.52/xhtml.rb) | 104 | ||||
| -rw-r--r-- | lib/sisu/v0/xml.rb (renamed from lib/sisu/0.52/xml.rb) | 93 | ||||
| -rw-r--r-- | lib/sisu/v0/xml_dom.rb (renamed from lib/sisu/0.52/xml_dom.rb) | 68 | ||||
| -rw-r--r-- | lib/sisu/v0/xml_format.rb (renamed from lib/sisu/0.52/xml_format.rb) | 58 | ||||
| -rw-r--r-- | lib/sisu/v0/xml_tables.rb (renamed from lib/sisu/0.52/xml_tables.rb) | 12 | ||||
| -rw-r--r-- | lib/sisu/v0/zap.rb (renamed from lib/sisu/0.52/zap.rb) | 6 | 
89 files changed, 1671 insertions, 2064 deletions
| diff --git a/lib/sisu/0.52/vocab.rb b/lib/sisu/0.52/vocab.rb deleted file mode 100644 index f0d7a405..00000000 --- a/lib/sisu/0.52/vocab.rb +++ /dev/null @@ -1,113 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah -   * http://www.jus.uio.no/sisu -   * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: Vocabulary, wordlist (first usd by concordance) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - -  Summary of GPL 2 - -  This program is free software; you can redistribute it and/or modify it -  under the terms of the GNU General Public License as published by the Free -  Software Foundation; either version 2 of the License, or (at your option) -  any later version. - -  This program is distributed in the hope that it will be useful, but WITHOUT -  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for -  more details. - -  You should have received a copy of the GNU General Public License along -  with this program; if not, write to the Free Software Foundation, Inc., -  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -  If you have Internet connection, the latest version of the GPL should be -  available at these locations: -    http://www.fsf.org/licenses/gpl.html -    http://www.gnu.org/copyleft/gpl.html -    http://www.jus.uio.no/sisu/gpl2.fsf - -  SiSU was first released to the public on January 4th 2005 - -  SiSU uses: -   -  *  Standard SiSU markup syntax, -  *  Standard SiSU meta-markup syntax, and the -  *  Standard SiSU object citation numbering and system -   -  © Ralph Amissah 1997, current 2007. -  All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com -                  ralph.amissah@gmail.com -=end -module Wordlists -  class Lists -    def initialize -    end -    def scanlist -      /(?:<i>(?:[\w0-9"]+[\s]*){2,7}<\/i>|<b>(?:[\w0-9"]+[\s]*){2,7}<\/b>|http:\/\/\S+)|code\{.+?\}code|<\S+?>|\w+/mi -    end -    def lesser -      /^(?: -      a|about|all|also|although|am|an[dy]?|approach(?:es|ed)?|are|around|a[st]|availab(?:ility|le)| -      b|back|be|been|both|but|by| -      c|can|close|come|could| -      d|damaged?|did|do|does|doing|done|down| -      e|each|early|easy|eight|end|even|every(?:thing)?|exist(?:ed|ence|ing|s)?| -      f|fair|fall|familiar|feature[ds]?|fees?|few|first(?:ly)?|five|fix(?:ed)?|for|form|forecast(?:ed|s|ing)?|four|frequent(?:ed|ly)?|from|frustration|fully?|fundamental| -      g|generally|get|give|go|got|gone| -      h|had|half|has|have|height?|held|her|here|him|his|hmm+|hold|how(?:ever)?|html|https?|ftp| -      i|if|in|include|inclusion|info|initial|initially|inquire|insofar|instead|interest(?:ed|ing|ingly|s)|in(?:to)?|introduc(?:e|tion)|is|it|like(?:ly|wise)?| -      k|kee[np]|kept|key|kn[eo]w| -      l|large(?:ly)?|later?|lead|least|le[dt]|less|like(?:ly)?|list(?:ed|s)?|little|long(?:er)?|looks?|lots?|low(?:er)?| -      m|made|main|major|mak(?:es?|ing)|many|may|maybe|mean|ment|mid|might|minor|miss|more|most(?:ly)?|move[ds]?|movement|moving|much| -      n|needs?|new|next|nine|no[nrtw]?| -      o|off?|often|old|on|one|or|once|one|only|open|other(s|wise)?|our|out|outline|output|over|overview|own| -      p|particularly|partly|pass|past|pay|pdf|perhaps|please|post|potential|practical(?:ly)?|pre|prefer|presum(?:e|ably|s)|problem(atic|s)?|pull|push|put| -      q|quite| -      r|ran|range|rather|read|real|reasonable|receive|recent|recogni[sz]e|reduce|refer|reference|relative|regard(?:ing|less|s)?|really|release|relevant|remarks?|remove|repeat|result|return|run| -      s|say|search|second(?:ly)?|see(?:[kn]|ing|ingly|ms?)?|sen[dt]|separate|self|set|seven|several|she|similar(?:ly)?|simpl(?:e|y)|since|situations?|situated|six|small|so|some(?:thing)?|start(?:ed)?|stop(?:ped)?|such|sure| -      t|take[ns]?|ten|test|thanks?|that|the|their|then|there|these|they|third(?:ly)?|this|those|though|three|to|today|towards?|tried|try|two| -      u|under(?:lying|stand|standing)?|unfortunately|up(?:on)|use[dsr]?| -      w|want|was|well|ways?|what|when|where|which|while|whilst|who(?:se)?|wide(?:ly)?|will|with(?:in|out)|why|wide|width|when|where|which|why|would| -      z)$/i -    end -    def special -      #/<i>(?:[\w0-9"]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?: -      /<i>(?:[\w0-9"]+[\s]*){2,7}<\/i>|<b>(?:[\w0-9"]+[\s]*){2,7}<\/b>|https?:\/\/\S+|ftp:\/\/\S+|(?: -      a| -      b| -      c| -      d| -      e| -      f| -      g| -      h| -      i| -      j| -      l| -      m| -      n| -      o| -      p| -      r| -      s| -      t| -      u| -      w| -      h| -      u| -      zz|\w+)/i -    end -    def greater -      /^(?:kajfsajflajskdfjz)$/i -    end -  end -end -__END__ diff --git a/lib/sisu/0.52/vocab_lex.rb b/lib/sisu/0.52/vocab_lex.rb deleted file mode 100644 index 41a13034..00000000 --- a/lib/sisu/0.52/vocab_lex.rb +++ /dev/null @@ -1,144 +0,0 @@ -=begin - * Name: SiSU information Structuring Universe - Structured information, Serialized Units - * Author: Ralph Amissah -   * http://www.jus.uio.no/sisu -   * http://www.jus.uio.no/sisu/SiSU/download.html - - * Description: Vocabulary, wordlist legal, lex, (first used by concordance) - - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah - - * License: GPL 2 or later - -  Summary of GPL 2 - -  This program is free software; you can redistribute it and/or modify it -  under the terms of the GNU General Public License as published by the Free -  Software Foundation; either version 2 of the License, or (at your option) -  any later version. - -  This program is distributed in the hope that it will be useful, but WITHOUT -  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for -  more details. - -  You should have received a copy of the GNU General Public License along -  with this program; if not, write to the Free Software Foundation, Inc., -  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -  If you have Internet connection, the latest version of the GPL should be -  available at these locations: -    http://www.fsf.org/licenses/gpl.html -    http://www.gnu.org/copyleft/gpl.html -    http://www.jus.uio.no/sisu/gpl2.fsf - -  SiSU was first released to the public on January 4th 2005 - -  SiSU uses: -   -  *  Standard SiSU markup syntax, -  *  Standard SiSU meta-markup syntax, and the -  *  Standard SiSU object citation numbering and system -   -  © Ralph Amissah 1997, current 2007. -  All Rights Reserved. - - * Ralph Amissah: ralph@amissah.com -                  ralph.amissah@gmail.com -=end -module Wordlists -  require SiSU_lib + '/vocab' -  class Lists -    def initialize -    end -    #/<i>(?:[a-z0-9]+[\b\s]+){2,7}?<\/i>|(?: -    #/<i>(?:[a-zA-Z0-9]+[\s]*){2,7}?<\/i>|(?: -    #/<i>(?:[\S]+[\s]*){2,7}<\/i>|http:\/\/\S+|(?: #demands much processing ! cannot use :-( -    #/<i>(?:[\S]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?: -    #/<i>(?:\S+\s*){1,7}?<\/i>|(?:  -      #/<i>(?:[\S]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?: -    def scanlist -      #/<i>(?:[\w0-9"]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?: -      /(?: -      a|advance payments?|actions? for annulment|alternative dispute resolution|anticipatory breach|applicable law|arbitral (?:courts?|institutions?)|arbitral process|arbitral tribunal|arbitration agreement|arbitration awards?|arbitration between states|arbitration clause|arbitration rules?|autonomous contract|autonomy of contract|autonomy of parties| -      b|bilateral agreement|bill of exchange|bill of lading|binding agreementss?|breach of contract|buyer's obligations?|buyer's rights?| -      c|carriage of goods(?: by sea)|choice of law|commercial dispute|conformity of (?:contract|documents|goods)|contemporaneous performance|contra proferentem|contract of (?:carriage|insurance|sale)|contract rate|contract(?:ual)? price|cost of (?:carriage|credit|goods|insurance|transport(?:ation)?)|cross examination|currency regulations?| -      d|date of (?:delivery|payment|shipment)|delivery (?:date|of (?:substitute )?goods)|delocalisation theory|discovery of documents|dispute resolution|dissenting opinions?|distributorship agreements?|due process| -      e|employment agreements?|enforceability of award|equality of treatment|equity and good concience|equity clauses?|european convention|european (?:economic )?community|european union|examination (?:in chief|of goods)|excess of authority|exclusion (?:of claims|of convention|period)|ex parte| -      f|factoring convention|federal states?|force majeure|formal requirements?|fundamental breach|future disputes?| -      g|gap filling|general (?:business conditions|conditions of business|terms)|general principles?(?: of law)?|geneva convention|good faith|grain and feed trade association|governing law| -      h|harmoni[sz]ation of laws?| -      i|identification of goods|immediate (?:delivery|payment)|institutional rules|intellectual property(?: rights?)?|interim awards?|international bank for reconstruction and development|international bar association|international centre for the settlement of investment disputes|international chamber of commerce|investment securities| -      j|judicial proceedings?| -      l|lack of conformity|language of hearings?|league of nations|legal (?:remed(?:ies|y)|rights?)|letter of credit|lex fori|lex mercatoria|lex loci contractus|limitation period| -      m|majority awards?|matrimonial disputes?|maximum period|mini trials?|minutes of meetings?|minutes of trials?|model law|monetary payments?|moral obligations?|moveable goods| -      n|nachfrist notice|national law|new international economic order|notice of non-?conformity|number of| -      o|obligation to(?: dispatch|give (?:advice|notice)|preserve(?: goods)?)?| -      p|partial (?:delivery|performance)|party autonomy|passing of risk|payment (?:by install?ments|in advance|guarantees?|of price)|peace palace|period (?:for payment|of delivery|of performance|of time)|permanent court of international justice|personal injury|preliminary meetings?|possessory rights?|preliminary steps?|preservation of goods|private international law|procedural (?:law|orders?)|products? liability|professional institutions?|promissory notes?|public international law| -      r|reasonable (?:bystander|man|men|person)\b|red book|regional conventions?|registration of awards?|resolution of disputes?|retention of title|revocation of offer|right (?:of|to) (?:delivery?|perform|performance|reject(?:ion)?|refuse|refusal|retain|retention)| -      s|sea waybill|seat theory|separate opinions|security for credit|separation of powers|seller'?s obligations?|seller's rights?|set off|settlement of disputes?|shipping instructions|sovereign immunity|specific performance|stabilisation clauses?|statement of reasons?|submission agreements?|substantive issues?|substantive law|suspension of performance| -      t|taking delivery|temporary (?:impediment|injunction)|terms of (?:payment|reference|trade)|third[ -]part(?:y|ies)(?: claims?| rights)?|terms of reference|time (?:limits?|of payment)|trade associations?|trade marks?|trade usages?|transfer of (?:obligations?|rights?)| -      u|unification of law|uniform (?:interpretation|rules)|use of goods| -      w|warehouse (?:certificates?|receipt)| -      x| -      y| -      z| -      conventions|new york convention on recognition and enforcement of arbitral awards|united nations conference on international trade law| -      cities|new york|los angeles|san fransisco| -      countries|hong kong|united kingdom|united states(?: of america)?| -      zz|\w+)/i -    end -    def special #the idea is that words like contract, arbitration, buyer, seller should be left intact in scanlist but captured if in a term here, information should not be duplicated in the two lists ! -      #/<i>(?:[\w0-9"]+[\s]*){2,7}?<\/i>|http:\/\/\S+|(?: -      /<i>(?:[\w0-9"]+[\s]*){2,7}<\/i>|<b>(?:[\w0-9"]+[\s]*){2,7}<\/b>|https?:\/\/\S+|ftp:\/\/\S+|(?: -      a|add hoc(?: arbitration)?|agreement to arbitrate|american arbitration association|avoidance of (?:\S+\s+){0,2}contract| -      b| -      c|claim (?:\S+\s+){0,4}(?:damages|restitution)|commencement of arbitration|conclusion of (?:the )?contract|court of arbitration| -      d|domestic arbitration| -      e| -      f|formation of (?:\S+\s+){0,2}contract|fundamental breach (?:\S+\s+){1,2}contract| -      g| -      h| -      i|informal arbitrations?|install?ment contracts?|institutional arbitration|international arbitration| -      j|joint debtors?| -      l|language of (?:the )?arbitration|leasing contract|liquidated damages|(?:buyer|seller) loses? the right| -      m|mitigation of (?:damages?|loss)| -      n|nuclear damage| -      o| -      p|panels? of arbitrators|performance of (?:the)?contract|permanent court of arbitration|place of (?:arbitration|business|payment|performance)|preparation of contract|presiding arbitrators?| -      r|regulation of international arbitration|removal of arbitrators?|right (?:\S+\s+){0,3}to (?:declare the contract avoided|claim(?: damages)?)|right or claim of (?:a|the) third party|right to rely on| -      s|statutory arbitrations?| -      t|termination of contract|trade arbitrations?| -      u| -      w| -      x| -      y| -      institutions|american bar association|international montetary fund|london court of international arbitration|united nations|world bank|world intellectual property organi[sz]ation|world trade organi[sz]ation| -      zz|(?:buyer's|seller's) right| -      zz|\w+)/i -    end -    def greater #line break will not be matched -      /^(?: -      a|arbitrat(e|ors?|ions?)|anticipatory|assurance| -      b|breach| -      c|care|commercial|consideration|contract|cost|credit| -      d|damages|duty|effect|enforce[ds]?|evidence|examples?|exchange|exception|exclude[ds]?|exclusion|exclusive|excuse[ds]?|executed?|exempt(?:s|ed|ing)?|excercise[ds]?|expir[ey]| -      f|fair|fees?|finance|(un)?foreseeab(ility|le)|form|free|freight|frustration|full|fundamental| -      g|general||global(ly)?|goods|govern(?:ed|ing|s)?|greater|grounds| -      h|harm| -      i|impact|impede|impediment|impracticab(ility|le)|inform|information|installments?|insur(ance|e[ds]?)|intent(ion|ional|ionally)?|interest|international(ly)?|interpret(ation)?| -      l|law(s|yers?)?|limit(ation|ed|ing|s)?| -      m|mitigat(e|ed|ing|ion)|model|modern|monetary|money| -      n|noti(ce|fy|fication)|neither|new|no|nor| -      o|oblig(ations?|ors?)| -      p|parol|part(?:ial|ies|y)|perform(ance)?|period|postal|preamble|preserve|principles?|procedur(e|al)|proceeds|provide(ed|s)|provisions?|purpose| -      r|rational|reasonable|recind|rectif(ication|y)|recourse|recovery?|reduction|reliance|relief|rely|remed(ies|y|ying)|reports?|requests?|require(s|ments)?|reservation|review|revis(e|ion|ed)|retain(ed|er)|rights?|rule(s|ed)?|ruling| -      s|sales?|secretary|section|service|sources?|status|standard|sufficient| -      t|terminat(e|ed|ion)|tort|trade(er|ing)?|transnational|treaty| -      u|uniform(ity)? -      z)$/i -    end -  end -end -__END__ - diff --git a/lib/sisu/0.52/cgi.rb b/lib/sisu/v0/cgi.rb index 83448613..63ce5321 100644 --- a/lib/sisu/0.52/cgi.rb +++ b/lib/sisu/v0/cgi.rb @@ -38,18 +38,18 @@    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. -   +   * Ralph Amissah mailto:ralph@amissah.com     Ralph Amissah mailto:amissah@gmail.com  =end  module  SiSU_CGI                                                                 #% database building documents -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/cgi_pgsql' -  require SiSU_lib + '/cgi_sqlite' +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/cgi_pgsql" +  require "#{SiSU_lib}/cgi_sqlite"    include SiSU_CGI_pgsql    class SiSU_search      def initialize(opt) @@ -57,13 +57,13 @@ module  SiSU_CGI        @webserv=@opt.files[0].to_s.strip      end      def search_info -     a=%{  +     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=SiSU_Screen::Ansi.new(@opt.cmd,a)          tell.print_grey      end      def read diff --git a/lib/sisu/0.52/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb index a5a2ef93..325f91b7 100644 --- a/lib/sisu/0.52/cgi_pgsql.rb +++ b/lib/sisu/v0/cgi_pgsql.rb @@ -38,7 +38,7 @@    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,8 +47,8 @@  =end  module  SiSU_CGI_pgsql                                                            #% database building documents -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/cgi_sql_common' +  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) @@ -66,7 +66,7 @@ module  SiSU_CGI_pgsql          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|  +          available_db.flatten.each do |x|              serve << x.gsub(/SiSU_(\S+)/,'\1')            end          else put "WARNING: no postgresql database available, (have you created one?)" @@ -82,18 +82,18 @@ module  SiSU_CGI_pgsql          end        end        f2 << "          end\n" -      if FileTest.writable?('.')  +      if FileTest.writable?('.')          output=File.open('sisu_pgsql.cgi','w')          output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons_note << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << dbi_connect << @common.main2 -        a=%{        generated sisu_pgsql.cgi,  +        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=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 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 @@ -175,7 +175,7 @@ module  SiSU_CGI_pgsql          def sql_select_body            limit ||=@@limit            offset ||=@@offset -          @sql_statement[:body]=%{SELECT metadata.title, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, documents.ocn}  +          @sql_statement[:body]=%{SELECT metadata.title, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, documents.ocn}            @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}            select=@sql_statement[:body] + ' ' + @sql_statement[:range]            select @@ -189,10 +189,10 @@ module  SiSU_CGI_pgsql            select          end          def sql_select_body_format -          %{<font color="#666666" size="2">#{sql_select_body}</font>}  +          %{<font color="#666666" size="2">#{sql_select_body}</font>}          end          def sql_select_endnotes_format -          %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}  +          %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}          end          def contents            @conn.select_all(sql_select_body) @@ -206,7 +206,7 @@ module  SiSU_CGI_pgsql      def dbi_connect        <<-'WOK_SQL'            dbi="dbi:Pg:database=#{@db};port=#{@port}" -          @conn=DBI.connect(dbi,user)  +          @conn=DBI.connect(dbi,user)        WOK_SQL      end    end diff --git a/lib/sisu/0.52/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb index ae4e170f..13f9c2a3 100644 --- a/lib/sisu/0.52/cgi_sql_common.rb +++ b/lib/sisu/v0/cgi_sql_common.rb @@ -38,7 +38,7 @@    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -53,7 +53,7 @@ module SiSU_CGI_sql      end      def about        <<-'WOK_SQL' - * Name: SiSU information Structuring Universe    + * Name: SiSU information Structuring Universe   * Author: Ralph Amissah     * http://www.jus.uio.no/sisu     * http://www.jus.uio.no/sisu/SiSU/download @@ -93,11 +93,11 @@ module SiSU_CGI_sql    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -119,7 +119,7 @@ module SiSU_CGI_sql            @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can            @tip=if checked_tip =~/\S/              '<font size="2" color="#666666">text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;</font>' -          else ''  +          else ''            end          end          def submission_form @@ -465,7 +465,7 @@ module SiSU_CGI_sql          <<-'WOK'      <br /><hr /><br />      <center><table align="center"bgcolor="#ffffff"><tr><td><font color="#666666"><table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center"> -     +      <tr align="center">        <td align="center"><p class="center"><font color="#666666" size="2">        presentations' look and feel<br /> @@ -473,7 +473,7 @@ module SiSU_CGI_sql        <a href="http://www.jus.uio.no/sisu" ><img border="0" src="#@image_src/sisu.png" alt="SiSU in Ruby with the usual GPL (or OSS) suspects - Way Better!" width="120" height="38"></a><br />        <a href="http://www.jus.uio.no/sisu" >SiSU</a><br />        version 0.50<br />2007w11/1 (2007-03-12)<br /> -     +        <table summary="SiSU rights" bgcolor="#ffffff" cellpadding="4" border="0" align="center" width="40%">          <sup>©</sup> Ralph Amissah<br />        1993, current 2007<br /> @@ -482,9 +482,9 @@ module SiSU_CGI_sql        <a href="mailto://ralph@amissah.com" >ralph@amissah.com</a><br />      </font></p>      </td></tr></table> -     +      <p><center><font color="#666666" size="2">the usual GPL (or OSS) suspects:<br />Better - "performance, reliability, scalability, security<br />& total cost of ownership"<br /><i>[not to mention flexibility & choice]</i><br /><br /><<<a href="http://www.jus.uio.no/sisu/">Way Better!</a>>></font></center></p><tr align="center"><td align="center"> -     +      </font></center></td></tr></table></center> <a name="bottom" id="bottom"></a><a name="down" id="down"></a><a name="end" id="end"></a><a name="finish" id="finish"></a><a name="stop" id="stop"></a><a name="credits" id="credits"></a>      </body></html>      WOK @@ -500,8 +500,8 @@ module SiSU_CGI_sql          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]  +          @db=if cgi['db'] =~/\S+/; +            @stub=/SiSU_(\S+)/.match(cgi['db'])[1]              cgi['db']            else              @stub='sisu' @@ -511,17 +511,17 @@ module SiSU_CGI_sql            if cgi['view']=~/text/; checked_index,checked_text='','checked'            else                    checked_index,checked_text='checked',''            end -          checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1  -          checked_searched='checked' if cgi['searched'] =~/\S/  -          checked_tip='checked' if cgi['tip'] =~/\S/  -          checked_echo='checked' if cgi['echo'] =~/\S/  -          checked_sql='checked' if cgi['sql'] =~/\S/  -          if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1  +          checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 +          checked_searched='checked' if cgi['searched'] =~/\S/ +          checked_tip='checked' if cgi['tip'] =~/\S/ +          checked_echo='checked' if cgi['echo'] =~/\S/ +          checked_sql='checked' if cgi['sql'] =~/\S/ +          if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1              checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked' -            checked_none=''  -          elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0  +            checked_none='' +          elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0              checked_none='checked' -            checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''  +            checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''            else checked_ignore='checked'            end        WOK_SQL @@ -560,7 +560,7 @@ module SiSU_CGI_sql              @@canned_search_url=if checked_all =~/checked/                "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1"              else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1" -            end       +            end              @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1              @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1              canned_note='previous search url:' @@ -580,7 +580,7 @@ module SiSU_CGI_sql              af.gsub!(/%2B/,' ')              analyze_format=af              st=af.split(/\s*;\s*/) -            search_field=st.join("\n")       +            search_field=st.join("\n")            end            green=%{<font size="2" color="#004000">}            canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) @@ -617,7 +617,7 @@ module SiSU_CGI_sql            #eg = %{canned search e.g.:<br /> <a href="#{url}">#{url}</a><br />find: #{analyze}<br />database: #{database}}            #dbi_canning            @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form -          unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/  +          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 @@ -636,7 +636,7 @@ module SiSU_CGI_sql              @body_main,@endnotes=[],[]              @search_regx=nil              oldtid=0 -            if @text_search_flag  +            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 @@ -659,14 +659,14 @@ module SiSU_CGI_sql              #metadata_found_body                if c['tid'].to_i != oldtid.to_i                  title=%{<span style="background-color: #DDFFAA"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html">#{c['title']}</a></span> by #{c['creator']} <a href="#@hosturl_files/#@stub/#{location}/portrait#{lang}.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl_files/#@stub/#{location}/landscape#{lang}.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="manifest"><font size="2"> ?</font></a><br />}  if file_suffix=~/s/ #hmm watch file_suffix -                 if @text_search_flag; title='<br /><hr>'+title  -                 else                  title='<br />'+title  +                 if @text_search_flag; title='<br /><hr>'+title +                 else                  title='<br />'+title                   end                   @counter_txt_doc+=1                   oldtid=c['tid'].to_i                  else                    title=''                  end -                if @text_search_flag  +                if @text_search_flag                    if cgi['view']=~/text/                                         #% txt body                      text=if c['suffix'] !~/1/ #seg                        if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/                         #% only this branch is working !! @@ -690,22 +690,22 @@ module SiSU_CGI_sql                        else nil                        end                        matched_para=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (c['body'].gsub(/(#@search_regx)/,'<span style="background-color: #ffff48">\1</span>')) : c['body'] #check -                      %{<hr><p><font size="2">ocn <b><a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a></b>:</font></p>#{matched_para}}  +                      %{<hr><p><font size="2">ocn <b><a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a></b>:</font></p>#{matched_para}}                      elsif c['suffix'] =~/1/ #doc                        %{#{title}<hr><p><font size="2">ocn #{c['ocn']}:#{c['body']}}                      end                      @counter_txt_ocn+=1                      output=if c['seg'] =~/\S+/; title+text -                    else                        text  +                    else                        text                      end                    elsif cgi['view']=~/index/                                     #% idx body                      if c['suffix'] !~/1/ #seg -                      index=%{<a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag  +                      index=%{<a href="#@hosturl_files/#@stub/#{location}/#{c['seg']}#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, } if @text_search_flag                      elsif c['suffix'] =~/1/ #doc -                      index=%{<a href="#@hosturl_files/#@stub/#{location}/doc#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, }  +                      index=%{<a href="#@hosturl_files/#@stub/#{location}/doc#{lang}.html##{c['ocn']}">#{c['ocn']}</a>, }                      end -                    if c['seg'] =~/\S+/  -                      if @text_search_flag  +                    if c['seg'] =~/\S+/ +                      if @text_search_flag                          @counter_txt_ocn+=1                          output=title+index                        end @@ -716,8 +716,8 @@ module SiSU_CGI_sql                        end                      end                    end -                else output=title  -                end  +                else output=title +                end                @counters_txt=if @counter_txt_doc > 0                  %{<font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.</font><br />}                else '' @@ -737,7 +737,7 @@ module SiSU_CGI_sql                end              #metadata_found_endnotes                if @text_search_flag -                if e['metadata_tid'].to_i != oldtid.to_i  +                if e['metadata_tid'].to_i != oldtid.to_i                    title=%{<br /><hr><span style="background-color: #DDFFAA"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html">#{e['title']}</a></span> by #{e['creator']} <a href="#@hosturl_files/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl_files/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="manifest"><font size="2"> ?</font></a><br />}  if file_suffix=~/s/                    @counter_endn_doc+=1                    oldtid=e['metadata_tid'].to_i @@ -746,7 +746,7 @@ module SiSU_CGI_sql                  if cgi['view']=~/text/                                           #% txt endnotes                    @counter_endn_ocn+=1                    matched_endnote=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (e['body'].to_s.gsub(/(#@search_regx)/,'<span style="background-color: #ffff48">\1</span>')) : e['body'] #check -                  output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl_files/#@stub/#{location}/endnotes.html##{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}}  +                  output=%{#{title}<hr><font size="2">note <b><a href="#@hosturl_files/#@stub/#{location}/endnotes.html##{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}}                  elsif cgi['view']=~/index/                                       #% idx endnotes                    @counter_endn_ocn+=1                    output=%{#{title}<a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a> [§ <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>], } @@ -782,9 +782,9 @@ __END__  #@counter_endn_ocn -  if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1  +  if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1      checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked' -    checked_none=''  +    checked_none=''    #elsif cgi['checks'] =~/check_fixed/ or cgi['check_fixed'] =~/\S/    #  #checked_ignore='checked'    #  checked_fixed='checked' @@ -802,8 +802,8 @@ __END__    #  checked_echo='checked' if cgi['echo'] =~/\S/    #  checked_sql='checked' if cgi['sql'] =~/\S/    #  checked_none='' -  elsif cgi['checks'] =~/check_none/ or cgi['a'].to_i==0  +  elsif cgi['checks'] =~/check_none/ or cgi['a'].to_i==0      checked_none='checked' -    checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''  +    checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''    else checked_ignore='checked'    end diff --git a/lib/sisu/0.52/cgi_sqlite.rb b/lib/sisu/v0/cgi_sqlite.rb index d00237af..6690d051 100644 --- a/lib/sisu/0.52/cgi_sqlite.rb +++ b/lib/sisu/v0/cgi_sqlite.rb @@ -38,7 +38,7 @@    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,8 +47,8 @@  =end  module  SiSU_CGI_sqlite                                                            #% database building documents -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/cgi_sql_common' +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/cgi_sql_common"    include SiSU_CGI_sql    class SiSU_search_sqlite < SiSU_CGI_common      def initialize(opt,webserv) @@ -59,9 +59,9 @@ module  SiSU_CGI_sqlite      end      def sqlite        serve=[] -      Dir.foreach(@env.path.webserv) do |x|  -        if x !~/^\./ and FileTest.directory?("#{@env.path.webserv}/#{x}")  -          if FileTest.file?("#{@env.path.webserv}/#{x}/sisu_sqlite.db"); serve << x unless x =~/^_\S+/  +      Dir.foreach(@env.path.webserv) do |x| +        if x !~/^\./ and FileTest.directory?("#{@env.path.webserv}/#{x}") +          if FileTest.file?("#{@env.path.webserv}/#{x}/sisu_sqlite.db"); serve << x unless x =~/^_\S+/            end          end        end @@ -82,18 +82,18 @@ module  SiSU_CGI_sqlite          f3 << %{          when /SiSU_#{x}/;                      "#{@env.path.webserv}/#{x}/sisu_sqlite.db"\n}        end        f3 << "          end\n" -      if FileTest.writable?('.')  +      if FileTest.writable?('.')          output=File.open('sisu_sqlite.cgi','w')          output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << f3 << dbi_connect << @common.main2 -        a=%{        generated sisu_sqlite.cgi,  -            BASED ON ALREADY CREATED sisu_sqlite.db OUTPUT, (-d)  +        a=%{        generated sisu_sqlite.cgi, +            BASED ON ALREADY CREATED sisu_sqlite.db OUTPUT, (-d)          } -        tell=SiSU_Screen::Ansi.new(@opt.cmd,a)  +        tell=SiSU_Screen::Ansi.new(@opt.cmd,a)          tell.print_grey          c=case @webserv          when /pwd/; ''          else "if necessary make the directory /usr/lib/cgi-bin : -                  sudo cp -vi #{Dir.pwd}/sisu_sqlite.cgi /usr/lib/cgi-bin/.  +                  sudo cp -vi #{Dir.pwd}/sisu_sqlite.cgi /usr/lib/cgi-bin/.                    sudo chmod -v 755 /usr/lib/cgi-bin/sisu_sqlite.cgi                    (copy sisu_sqlite.cgi to your cgi directory) and set file permissions to 755"          end @@ -182,10 +182,10 @@ module  SiSU_CGI_sqlite            select          end          def sql_select_body_format -          %{<font color="#666666" size="2">#{sql_select_body}</font>}  +          %{<font color="#666666" size="2">#{sql_select_body}</font>}          end          def sql_select_endnotes_format -          %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}  +          %{<font color="#666666" size="2">#{sql_select_endnotes}</font>}          end          def contents            @conn.select_all(sql_select_body) @@ -199,7 +199,7 @@ module  SiSU_CGI_sqlite      def dbi_connect        <<-'WOK_SQL'            @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ? -          @conn=DBI.connect(@dbi)  +          @conn=DBI.connect(@dbi)        WOK_SQL      end    end diff --git a/lib/sisu/0.52/character_encoding.rb b/lib/sisu/v0/character_encoding.rb index 743eac82..2f1f65d2 100644 --- a/lib/sisu/0.52/character_encoding.rb +++ b/lib/sisu/v0/character_encoding.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,13 +48,13 @@  =end  module SiSU_character_encode    require 'kirbybase' -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    class Characters      attr_accessor(:character_encoding,:glyph,:dec,:hex,:rb,:html,:html_name,:tex,:tex_licr,:tex_alt,:name)      def initialize(&block)        instance_eval(&block)      end -  end  +  end    class Create <Characters      def initialize        #NOTE places character_encoding.tbl in correct subdirectory ./_sisu_processing/encoding @@ -82,7 +82,7 @@ module SiSU_character_encode      end      def selected(selected,show)        @y=[] -      selected.each do |x|  +      selected.each do |x|          @y<<case show          when 'glyph';     x.glyph          when 'dec';       x.dec @@ -134,7 +134,7 @@ module SiSU_character_encode      def table        x=[]  #:glyph, :dec,:hex,  :rb,            :xml ,   :html_name,  :tex,    :tex_licr,         :tex_alt,          :name -      x=[                                                                                         +      x=[    ['',     9, '',    '',             '	', nil,         '',     '',                '',                'Horizontal tab'  ],    ['',    15, '',    '',             '', nil,         '',     '',                '',                'Line feed'       ],    ['',    17, '',    '',             '', nil,         '',     '',                '',                'Carriage return' ], diff --git a/lib/sisu/0.52/composite.rb b/lib/sisu/v0/composite.rb index 99069b8f..9f01d0e4 100644 --- a/lib/sisu/0.52/composite.rb +++ b/lib/sisu/v0/composite.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Assemble -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    class Remote_image      def initialize        @env=SiSU_Env::Info_env.new @@ -61,7 +61,7 @@ module SiSU_Assemble        path="#{@env.path.processing}/external_document/image"        File.mkpath(path) unless FileTest.directory?(path)        download_from=images_array.shift -      images_array.each do |i|  +      images_array.each do |i|          image="#{path}/#{i}"          #unless FileTest.exists?(image)            imagefile=File.new(image,'w+') @@ -76,7 +76,7 @@ module SiSU_Assemble        path="#{@env.path.processing}/external_document/skin/doc"        File.mkpath(path) unless FileTest.directory?(path)        download_from=doc_skin.shift -      doc_skin.each do |i|  +      doc_skin.each do |i|          skin="#{path}/#{i}.rb"          unless FileTest.exists?(skin)            skinfile=File.new(skin,'w+') @@ -104,7 +104,6 @@ module SiSU_Assemble        end      end      def write(assembled) -      m=/(.+)?(\.ssm$)/m        assembled_file=File.new("#{@opt.fnb}._sst",'w+')        assembled.each{|a| assembled_file << a }        assembled_file.close @@ -112,7 +111,7 @@ module SiSU_Assemble      def download_images(download_from,images_array)        path="#{@env.path.processing}/external_document/image"        File.mkpath(path) unless FileTest.directory?(path) -      images_array.each do |i|  +      images_array.each do |i|          image="#{path}/#{i}"          unless FileTest.exists?(image)            imagefile=File.new(image,'w+') @@ -127,7 +126,7 @@ module SiSU_Assemble        path="#{@env.path.processing}/external_document/skin/doc"        File.mkpath(path) unless FileTest.directory?(path)        download_from=doc_skin.shift -      doc_skin.each do |i|  +      doc_skin.each do |i|          skin="#{path}/#{i}.rb"          unless FileTest.exists?(skin)            skinfile=File.new(skin,'w+') @@ -142,15 +141,15 @@ module SiSU_Assemble        file={ :prepared=>[],:images=>[] }        rgx_image=/([a-zA-Z0-9._-]+?\.(?:png|jpg|gif))/        #file[:prepared] << "#% Date " << "\n" -      file[:prepared] << "\n% |#{fni}|@|^|>>ok\n"  -      insert_array.each do |i|  +      file[:prepared] << "\n% |#{fni}|@|^|>>ok\n" +      insert_array.each do |i|          i.gsub!(/^([12]|:?[AB])~\? /,'% [conditional heading:] \1~ ')            #off conditional heading (consider syntax)          if i =~/^0~|^@\S+?:/            i.gsub!(/\n/m,"\n%  ")            i.gsub!(/\n%\s+$/m,'')            i.gsub!(/^0~|^@\S+?:/m,"\n% [imported header:] ")                          #off imported headers          end -        file[:prepared] << i  +        file[:prepared] << i          file[:images] << i.scan(rgx_image).uniq if i =~rgx_image #flag        end        file[:prepared] << "\n% end import" << "\n\n" @@ -198,10 +197,11 @@ module SiSU_Assemble            end          else tuned_file << para          end +        tuned_file.flatten!          tuned_file.compact!        end        if @@imager.length >0 -        @@imager.each do |d,i|  +        @@imager.each do |d,i|            i.flatten!            i.uniq!            download_images(d,i) diff --git a/lib/sisu/0.52/concordance.rb b/lib/sisu/v0/concordance.rb index 5f251830..c5462a9d 100644 --- a/lib/sisu/0.52/concordance.rb +++ b/lib/sisu/v0/concordance.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,14 +47,14 @@                    ralph.amissah@gmail.com  =end  module SiSU_Concordance -  require SiSU_lib + '/param' -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/dal' +  require "#{SiSU_lib}/param" +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/dal"    include SiSU_Param    include SiSU_Env    include SiSU_Viz -  require SiSU_lib + '/html_format_css' +  require "#{SiSU_lib}/html_format_css"    include SiSU_HTML_Format    class Source      def initialize(opt) @@ -71,7 +71,7 @@ module SiSU_Concordance          tell=SiSU_Screen::Ansi.new(@md.cmd,"Concordance",tool)          tell.grey_title_hi unless @md.cmd =~/q/          wordmax=200000 -        unless @md.wc_words.nil?  +        unless @md.wc_words.nil?            if @md.wc_words < wordmax              SiSU_Concordance::Source::Words.new(@md).songsheet            else @@ -89,7 +89,7 @@ module SiSU_Concordance      end      private      class Doc_title -      require SiSU_lib + '/param' +      require "#{SiSU_lib}/param"        include SiSU_Param        include SiSU_Viz        def initialize(lnk,md) @@ -109,7 +109,7 @@ WOK        end        def create          <<WOK -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">         +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  <html>  <head>    <title> @@ -161,16 +161,14 @@ WOK        end      end      class Words -      require SiSU_lib + '/defaults' -      require SiSU_lib + '/param' +      require "#{SiSU_lib}/defaults" +      require "#{SiSU_lib}/param"        include SiSU_Viz        include SiSU_Param -      require SiSU_lib + '/html_format_css' +      require "#{SiSU_lib}/html_format_css"        include SiSU_HTML_Format -      require SiSU_lib + '/vocab' -      require SiSU_lib + '/sysenv' +      require "#{SiSU_lib}/sysenv"        include SiSU_Screen -      include Wordlists        @@dp=nil        def initialize(md)          begin @@ -190,8 +188,9 @@ WOK            @rxp_t1=Regexp.new('^T1')            @rxp_t2=Regexp.new('^T2')            @rxp_t3=Regexp.new('^T3') -          @rxp_excluded1=Regexp.new(/(?:https?|ftp):\/\/\S+/mi) -          @rxp_excluded0=Regexp.new(/^(?:to\d+|\d+| \s*| |EOF|thumb_\S+|snap_\S+|_+|-+|\S+?_\S+|[\d_]+\w\S+|[\w\d]{1,2}|\d{1,3}\w?|ii|iii|iv|vi|vii|viii|ix|xi|xii|xiii|xiv|xv|xvi|xvii|xviii|xix|xx|#@dp|[0-9a-f]{24,64}|\d{2,3}x\d{2,3}|\S{0,2}sha\d|\S{0,3}\d{4}w\d\d|\b\w\d+|\d_all\b|e\.?g\.?)$/mi) +          @rxp_excluded1=/(?:https?|ftp):\/\/\S+/mi +          @rxp_excluded0=/^(?:to\d+|\d+| |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\.?)$/mi #this regex causes and cures a stack dump in ruby 1.9 !!! +          @rgx_scanlist=%r{(?:<i>(?:[a-zA-Z0-9"\s]){2,7}</i>|<b>(?:[a-zA-Z0-9"\s]){2,7}</b>|http://\S+)|code\{.+?\}code|<\S+?>|\w+}mi          rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error          end        end @@ -227,28 +226,14 @@ WOK        def map_para          @seg,toy=nil,nil          @word_map={} -        wordlist=Wordlists::Lists.new -        lesser,greater,scanlist,special=wordlist.lesser,wordlist.greater,wordlist.scanlist,wordlist.special -        #lesser,greater,scanlist=wordlist.lesser,wordlist.greater,wordlist.scanlist          @dal_array.each do |line|            if line !~/<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/ # lines to ignore: # are added but not part of authors substantive text; 0 are mostly machine generated -            if line =~/^0~vocabulary\s+(.+)/ -              vocab=$1 -              unless vocab =~/none/ -                load SiSU_lib + "/vocab_#{vocab}.rb" -                lesser,greater,scanlist=wordlist.lesser,wordlist.greater,wordlist.scanlist -                #special=wordlist.special ##KEEP did two loops -                tell=SiSU_Screen::Ansi.new(@md.cmd,"\tloaded vocabulary: #{vocab}") -                tell.puts_grey unless @md.cmd =~/q/ #check -              end -            end              if line =~@rxp_seg;   @seg=line[@rxp_seg,1]              end              if line =~@rxp_to;    toy=line[@rxp_to,1]              end              if toy =~/\d+/ and toy !~/^0$/ -              for word in line.scan(scanlist) #%take in word or other match -              #for word in line.scan(special) #%take in word or other match #KEEP was second loop +              for word in line.scan(@rgx_scanlist) #%take in word or other match                  word=nil if word =~@rxp_excluded0 #watch                  word=nil if word =~@rxp_excluded1 #watch                  if word @@ -264,10 +249,10 @@ WOK                    word.strip!                    word.gsub!(/^\d+(st|nd|rd|th)$/,'')                    word.gsub!(/^(\d+\.?)+$/, '') -                  word = nil if word =~/^\s*$/ #watch +                  word=nil if word =~/^\s*$/ #watch                    if word                      word.capitalize! unless word =~/[A-Z][A-Z]/ or word =~/\w+\s\w+/ -                    #word.downcase! if word =~lesser  +                    #word.downcase! if word =~lesser                      #word.capitalize! if word =~greater                      @freq[word] +=1                      @word_map[word] ||= [] @@ -294,7 +279,7 @@ WOK            if keyword !~ @rxp_excluded0              if @word_map[word][0] =~ /\d+/                wm=[] -              @file_index_all << %{#{keyword}#{seg}#{@word_map[word].uniq.compact}} +              @file_index_all << %{#{keyword}#{seg}#{@word_map[word].uniq.compact.join}}              end              @file_index_all << '</p>'            end diff --git a/lib/sisu/0.52/conf.rb b/lib/sisu/v0/conf.rb index 192ffe2f..e521643a 100644 --- a/lib/sisu/0.52/conf.rb +++ b/lib/sisu/v0/conf.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,12 +47,12 @@                    ralph.amissah@gmail.com  =end  module SiSU_Initialize -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Screen -  require SiSU_lib + '/relaxng' +  require "#{SiSU_lib}/relaxng"    include SiSU_relaxng -  require SiSU_lib + '/css' +  require "#{SiSU_lib}/css"    include SiSU_Style    class Source      def initialize(opt) @@ -69,7 +69,7 @@ module SiSU_Initialize    end    class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier      require 'fileutils' -    require SiSU_lib + '/sysenv' +    require "#{SiSU_lib}/sysenv"      include FileUtils #::Verbose      def initialize(opt)        @opt=opt @@ -156,7 +156,7 @@ module SiSU_Initialize        end      end      def trang_rnc_model_output_sax -      s=@suffix   +      s=@suffix        rnc_src=@env.path.dal + '/sax.' + s[:rnc]        rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_sax        rng_file=@path[:rng] + '/' + @rxng.rng_name.output_sax diff --git a/lib/sisu/0.52/css.rb b/lib/sisu/v0/css.rb index 47f7e375..f8c7d25b 100644 --- a/lib/sisu/0.52/css.rb +++ b/lib/sisu/v0/css.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,8 +47,8 @@                    ralph.amissah@gmail.com  =end  module SiSU_Style -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/defaults' +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/defaults"    class CSS      def initialize        @vz=SiSU_Env::Get_init.instance.skin @@ -97,14 +97,14 @@ WOK      background: #{@vz.color_white};    }  /* -    table {  +    table {        margin-left: 5%;        display: block;      } -    tr {  +    tr {        display: block;      } -    th, td {  +    th, td {        display: inline;      }  */ @@ -143,7 +143,7 @@ WOK      top: 0;      bottom: 80px;      width: 100%; -  }  +  }    #top_band_search {      position: absolute;      top: 0px; @@ -387,14 +387,14 @@ WOK    p.i4 {margin-left: 35mm;}    p.i5 {margin-left: 40mm;}    p.i6 {margin-left: 45mm;} -   +    table { }    tr { }    th, td { } -  p.left, th.left, td.left {  +  p.left, th.left, td.left {      text-align: left;    } -  p.right, th.right, td.right {  +  p.right, th.right, td.right {      text-align: right;    } @@ -543,7 +543,7 @@ WOK      color: #000077;    }    li.doc { -    background: url(../image/bullet_doc.png) no-repeat 0 0;  +    background: url(../image/bullet_doc.png) no-repeat 0 0;      padding-left: 16px;      margin-left: 10px;      margin-top: 0px; @@ -966,20 +966,20 @@ WOK        margin-top: 0px;        margin-bottom: 0px;      } -    table {  +    table {        margin-left: 5%;        display: block;      } -    tr {  +    tr {        display: block;      } -    th, td {  +    th, td {        display: inline;      } -    th.left {  +    th.left {        text-align: left;      } -    td.right {  +    td.right {        text-align: right;      }      body { @@ -1167,7 +1167,7 @@ WOK        margin-top: 4px;        margin-bottom: 0px;      } -    en {  +    en {        font-size: xx-small;        vertical-align: super;      } @@ -1243,14 +1243,14 @@ WOK        margin-top: 0px;        margin-bottom: 0px;      } -    table {  +    table {        margin-left: 5%;        display: block;      } -    tr {  +    tr {        display: block;      } -    th,td {  +    th,td {        display: inline;      }      body { @@ -1375,7 +1375,7 @@ WOK        margin-top: 4px;        margin-bottom: 0px;      } -    en {  +    en {        font-size: xx-small;        vertical-align: super;      } @@ -1553,14 +1553,14 @@ WOK      text[class|="verse"], text[class|="group"], text[class|="code"] {        text-align: left;      } -    table {  +    table {        margin-left: 5%;        display: block;      } -    tr {  +    tr {        display: block;      } -    th, td {  +    th, td {        display: inline;      }      nametag { @@ -1604,7 +1604,7 @@ WOK        margin-top: 4px;        margin-bottom: 0px;      } -    en {  +    en {        font-size: xx-small;        vertical-align: super;      } @@ -1756,14 +1756,14 @@ WOK        font-weight: bold;        text-align: left;      } -    table {  +    table {        margin-left: 5%;        display: block;      } -    tr {  +    tr {        display: block;      } -    th, td {  +    th, td {        display: inline;      }      nametag { @@ -1807,7 +1807,7 @@ WOK        margin-top: 4px;        margin-bottom: 0px;      } -    en {  +    en {        font-size: xx-small;        vertical-align: super;      } @@ -1922,7 +1922,7 @@ WOK        margin-top: 0px;        margin-bottom: 6px;      } -    en {  +    en {        font-size: xx-small;        vertical-align: super;      } diff --git a/lib/sisu/0.52/dal.rb b/lib/sisu/v0/dal.rb index 130dbf87..2b711609 100644 --- a/lib/sisu/0.52/dal.rb +++ b/lib/sisu/v0/dal.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,12 +47,12 @@                    ralph.amissah@gmail.com  =end  module SiSU_DAL -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/param' -  require SiSU_lib + '/dal_syntax' -  require SiSU_lib + '/dal_doc_str' -  require SiSU_lib + '/i18n' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/param" +  require "#{SiSU_lib}/dal_syntax" +  require "#{SiSU_lib}/dal_doc_str" +  require "#{SiSU_lib}/i18n"    include SiSU_Env    include SiSU_Param    include SiSU_Viz @@ -108,7 +108,7 @@ module SiSU_DAL        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Document Abstraction')        tell.green_title_hi unless @opt.cmd =~/q/        file_array=IO.readlines(@opt.fns,'') -      file_array.each do |l|  +      file_array.each do |l|          if l =~/\r\n/; l.gsub!(/\r\n/,"\n")          end        end @@ -178,7 +178,7 @@ module SiSU_DAL        @metafile="#{@env.path.dal}/#{@md.fns}.meta"        my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns)        data=data.join.split("\n\n") -      data=SiSU_document_structure::Code.new(@md,data).code      +      data=SiSU_document_structure::Code.new(@md,data).code        data_new=[]        data.each do |x|          data_new << if x =~ /\n\n/m; x.split(/\n\n+/) @@ -186,15 +186,15 @@ module SiSU_DAL          end        end        data=data_new.flatten -      data=SiSU_DAL::Make.new(@md,data).substitutions_and_insertions? +      data=substitutions_and_insertions?(data)        data=Syntax::Markup.new(@md,data).songsheet -      data=SiSU_DAL::Make.new(@md,data).character_check -      data=SiSU_DAL::Make.new(@md,data).images -      data=SiSU_document_structure::Tables.new(@md,data).tables      -      data=SiSU_DAL::Make.new(@md,data).numbering_song -      data=SiSU_DAL::Make.new(@md,data).endnotes -      data=SiSU_DAL::Make.new(@md,data).object_digest -      meta=SiSU_DAL::Make.new(@md,data).metadata +      data=character_check(data) +      data=images(data) +      data=SiSU_document_structure::Tables.new(@md,data).tables +      data=numbering_song(data) #tr issue +      data=endnotes(data) +      data=object_digest(data) +      meta=metadata(data)        outputdata=data + meta        if @md.cmd =~/[mM]/          SiSU_DAL::Output.new(@md,outputdata).hard_output @@ -203,24 +203,10 @@ module SiSU_DAL        reset        outputdata      end -  protected  -    def vocabulary -      data=@data -      vocab_insert,tuned_file=[],[] -      data.each do |para| -        if para =~/^1~/ and @@flag_vocab == 0 -          vocab_insert << '0~vocabulary lex' << "\n\n" << para #watch consider -          tuned_file << vocab_insert unless para.nil? -          @@flag_vocab=1 -        else tuned_file << para unless para.nil? -        end -      end -      tuned_file -    end -    def character_check +  protected +    def character_check(data)        require 'iconv'        reset -      data=@data        @tuned_file=[]        endnote_no=1        data.each do |para| @@ -235,13 +221,13 @@ module SiSU_DAL          para.gsub!(/ \/\//,'<br />')                                           #added 2004w29          para.gsub!(/<br>/,'<br />')                                            #needed by xml, xhtml etc.          #para.gsub!(/<p>/,'<p />')                                             #consider -        para.gsub!(/`/,"'")    +        para.gsub!(/`/,"'")          para.gsub!(/\342\200\231/,"'") #if para =~/’/  #Avoid #‘ ’ #“ ” -        para.gsub!(/\t/,' ')    +        para.gsub!(/\t/,' ')          para.gsub!(/�/,' ') #watch, replace with char code -        para.gsub!(/[“”]/,'""')    -        para.gsub!(/[–—]/,'-')   #— – chk  -        para.gsub!(/·/,'*')    +        para.gsub!(/[“”]/,'""') +        para.gsub!(/[–—]/,'-')   #— – chk +        para.gsub!(/·/,'*')          para.gsub!(/\\copy(?:right)?\b/,'©')          para.gsub!(/\\trademark\b|\\tm\b/,'®')          #non_utf8(para) @@ -256,10 +242,9 @@ module SiSU_DAL          end          @tuned_file << para unless para.nil?        end -      @tuned_file +      @tuned_file=@tuned_file.flatten      end -    def images -      data=@data +    def images(data)        tuned_file=[]        @rmgk=false        if SiSU_Env::Info_settings.new.program?('rmagick'); @rmgk=SiSU_Env::Load.new('RMagick').prog @@ -273,7 +258,7 @@ module SiSU_DAL              m=/\{\s*(\S+\.(?:png|jpg|gif))/              if @rmgk                imgs=para.scan(m).flatten -              images=imgs.each do |image|  +              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 @@ -303,14 +288,14 @@ module SiSU_DAL                  end                end              else -              images=para.scan(m) do |image|  +              images=para.scan(m) do |image|                  tell=SiSU_Screen::Ansi.new(@md.cmd,'where image dimensions have not been provided RMagick is required',image)                  tell.warn #unless @opt.cmd =~/q/                end              end            end          end -        para.gsub!(/\{\s+(\S+\.(?:png|jpg|gif))\s+/i,'{\1 ') if para =~/\{\s+\S+\.(?:png|jpg|gif).+?\}(?:(?:https?|ftp):\S+|image)/  +        para.gsub!(/\{\s+(\S+\.(?:png|jpg|gif))\s+/i,'{\1 ') if para =~/\{\s+\S+\.(?:png|jpg|gif).+?\}(?:(?:https?|ftp):\S+|image)/          tuned_file << para unless para.nil?        end        tuned_file @@ -355,8 +340,7 @@ module SiSU_DAL        end        file_type_names=file_type_names.flatten      end -    def substitutions_and_insertions? -      data=@data +    def substitutions_and_insertions?(data)        tuned_file=[]        if data[0] =~ /^#!\s*(?:\/usr\/bin\/env sisu|\/usr\/bin\/sisu)/ # remove bang from top #! (however file is stripped, so will be removed provided no content preceeds it)          data[0].gsub!(/^#!\s*\/usr\/bin\/sisu/,'') @@ -368,7 +352,7 @@ module SiSU_DAL        end        data.each do |para|          para=if @md.markup_version.to_f >= 0.38 -          SiSU_document_structure::Structure.new(@md,para).structure_markup_normalize      +          SiSU_document_structure::Structure.new(@md,para).structure_markup_normalize          else para          end          #para.gsub!(/<url:(\S+?)>/,'\1') #consider, would permit use of text hyperlinks if desired, dal_syntax more appropriate? @@ -377,13 +361,13 @@ module SiSU_DAL            para.gsub!(/^@(\S+?):\s+/,'0~\1 ')            para.gsub!(/^@(\S+?):([+-])\s+/,'0~\1\2 ')          end -        if para !~/^%+\s/ and  +        if para !~/^%+\s/ and             para =~/^(?:_\*\s+)?\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]+))\]\}(?:\.\.\/\S+?\/|\S+?\.(?:sst|ssm)\b)(?:\s+~\{.+?\}~)?(?:\s+\*~\S+)*\s*$/            txt,cmd,source,url_dir,note,manifest=nil,nil,nil,nil,nil,nil            url_and_stub=SiSU_Env::Info_env.new.url            if defined? url_and_stub.remote              @output_url="#{url_and_stub.remote}" -            if para =~/\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm])(\s+~\{.+?\}~)?/  +            if para =~/\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm])(\s+~\{.+?\}~)?/                #syntax e.g.: { "Sphinx or Robot", Leena Krohn [3sS]}sphinx_or_robot.leena_krohn.1996.sst                txt,cmd,source,url_dir,note=$1,$2,$3,$4,$5              elsif para =~/\{(.+?)\s\[(\d[sS]*)\]\}\.\.\/(\S+?)\/(\s+~\{.+?\}~)?/ @@ -418,9 +402,9 @@ module SiSU_DAL              when /sisupod.zip/;        ' zipped markup source pod'              else nil              end -            if describe  +            if describe                if @output_url -                tuned_file << "_1 {#{describe} }#@output_url/#{url_dir}/#{o_f}\n\n" if describe  +                tuned_file << "_1 {#{describe} }#@output_url/#{url_dir}/#{o_f}\n\n" if describe                else                  tuned_file << "_1 { #{describe} }../#{url_dir}/#{o_f}\n\n"                end @@ -462,21 +446,19 @@ module SiSU_DAL        end        tuned_file      end -    def numbering_song -      data=@data -      data=SiSU_DAL::Make.new(@md,data).number_plaintext_para -      data=SiSU_DAL::Make.new(@md,data).name_endnote_seg -      data=SiSU_DAL::Make.new(@md,data).auto_number_heading_ie_title -      data=SiSU_DAL::Make.new(@md,data).ocn unless @md.markup =~/not_to/ -      data=SiSU_DAL::Make.new(@md,data).minor_numbering #unless @md.markup =~/not_to/ -      data=SiSU_DAL::Make.new(@md,data).name_para_seg_filename -      data=SiSU_DAL::Make.new(@md,data).set_heading_seg unless @md.set_heading_seg     -      data=SiSU_DAL::Make.new(@md,data).set_heading_top unless @md.set_heading_top -      data=SiSU_DAL::Make.new(@md,data).set_header_title unless @md.set_header_title +    def numbering_song(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) unless @md.markup =~/not_to/ +      data=minor_numbering(data) #unless @md.markup =~/not_to/ +      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=@data +    def number_plaintext_para(data)        @tuned_file=[]        data.each do |para|          para.gsub!(/(^|[^<][^v][^>])\n/,'\1 ') #messy, but idea is that tables should retain breaks @@ -484,24 +466,29 @@ module SiSU_DAL          para.gsub!(/^\s+|\s$/,"\n")          @tuned_file << para        end -      @tuned_file +      @tuned_file=@tuned_file.flatten      end -    def name_endnote_seg -      data=@data +    def name_endnote_seg(data)        @tuned_file=[]        data.each do |para| -        para.gsub!(/<:3>\s*<:ee>/, -          "#{@@endnote['special_align']} <p /><br />\r " + -          "#{@@endnote['seg_name_3']} <p /> " + -          "#{@@endnote['special_align_close']}") -        para.gsub!(/<:2>\s*<:ee>/, -          "#{@@endnote['special_align']} <p /><br />\r " + -          "#{@@endnote['seg_name_2']} <p />" + -          "#{@@endnote['special_align_close']}") -        para.gsub!(/<:1>\s*<:ee>/, -          "#{@@endnote['special_align']} <p /><br />\r " + -          "#{@@endnote['seg_name_1']} <p /> " + -          "#{@@endnote['special_align_close']}") +        para.gsub!(/<:3>\s*<:ee>/, <<-WOK +#{@@endnote['special_align']} <p /><br />\r +#{@@endnote['seg_name_3']} <p /> +#{@@endnote['special_align_close']} +        WOK +        ) +        para.gsub!(/<:2>\s*<:ee>/, <<-WOK +#{@@endnote['special_align']} <p /><br />\r +#{@@endnote['seg_name_2']} <p /> +#{@@endnote['special_align_close']} +        WOK +        ) +        para.gsub!(/<:1>\s*<:ee>/, <<-WOK +#{@@endnote['special_align']} <p /><br />\r +#{@@endnote['seg_name_1']} <p /> +#{@@endnote['special_align_close']} +        WOK +        )          @tuned_file << para        end        # debug 2003w46 adding revision control info @@ -509,7 +496,7 @@ module SiSU_DAL          @tuned_file << "\n4~endnotes Endnotes <~0;0:0;u0>" #prob numbering, revisit        end        @tuned_file << "\n<ENDNOTES>" -      @tuned_file +      @tuned_file=@tuned_file.flatten      end      def owner_details_seg        data << '4~owner.details Owner Details' @@ -523,16 +510,15 @@ module SiSU_DAL        else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main        end        if @md.toc_lev_limit and @md.toc_lev_limit < num -        para.gsub!(/^[5-8]~(?:~\S+)?\s*/,'!_ ')  +        para.gsub!(/^[5-8]~(?:~\S+)?\s*/,'!_ ')        end        para      end -    def auto_number_heading_ie_title                                             #also does some segment naming  -      data=@data +    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 !~/^$/  +        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 @@ -596,21 +582,19 @@ module SiSU_DAL          end          @tuned_file << para        end -      @tuned_file +      @tuned_file=@tuned_file.flatten      end -    def ocn                                                                      #and auto segment numbering increment -      data=@data +    def ocn(data)                                                                      #and auto segment numbering increment        @tuned_file=[] -      object_array=SiSU_document_structure::OCN.new(@md,data).ocn      +      object_array=SiSU_document_structure::OCN.new(@md,data).ocn        object_array.each do |o|          @tuned_file <<= if o.ocn; "#{o.txt} <~#{o.ocn};#{o.lv};#{o.type}>"          else o.txt          end -      end       -      @tuned_file +      end +      @tuned_file=@tuned_file.flatten      end -    def minor_numbering                                                          #and auto segment numbering increment -      data=@data +    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 ) @@ -633,13 +617,13 @@ module SiSU_DAL          end          @tuned_file << para        end -      @tuned_file +      @tuned_file=@tuned_file.flatten      end -    def name_para_seg_filename +    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  +      #   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) @@ -649,7 +633,6 @@ module SiSU_DAL        #   if the title/heading text starts with a numeric, then that is used (1 3.1 3rd etc.)        #   otherwise the level 4 segment number from the embedded document structure info is used        #   if there is none a sequential number is designated, preceded by an underscore -      data=@data        @tuned_file=[]        art_filename_auto=1        @counter=1 @@ -711,10 +694,9 @@ module SiSU_DAL        end        @tuned_file=@tuned_file.flatten      end -    def set_heading_top                                                          #% make sure no false positives +    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]/ -        data=@data          @tuned_file=[]          data.each do |para|            unless @md.set_heading_top @@ -728,13 +710,12 @@ module SiSU_DAL            end            @tuned_file << para          end -        @tuned_file +        @tuned_file=@tuned_file.flatten        end      end -    def set_heading_seg                                                          #% make sure no false positives +    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]/ -        data=@data          @tuned_file=[]          data.each do |para|            unless @md.set_heading_seg @@ -748,13 +729,12 @@ module SiSU_DAL            end            @tuned_file << para          end -        @tuned_file +        @tuned_file=@tuned_file.flatten        end      end -    def set_header_title                                                         #% make sure no false positives +    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]/ -        data=@data          @tuned_file=[]          data.each do |para|            unless @md.set_header_title @@ -766,11 +746,10 @@ module SiSU_DAL            end            @tuned_file << para          end -        @tuned_file +        @tuned_file=@tuned_file.flatten        end      end -    def endnotes -      data=@data +    def endnotes(data)        @tuned_file=[]        endnote_no,endnote_ref=1,1                                                                                   #% endnote work zone @@ -786,23 +765,22 @@ module SiSU_DAL                                                                                 # auto-numbered endnotes <!e!> <!e_!> -->          when /~\{\s+.+?\}~|~\[[*+]\s+.+?\]~/            para.gsub!(/\s*(\}~|\]~)/,' \1')                                     # required 2003w31 -          @word_mode=para.scan(/\S+/) -          word_mode=SiSU_DAL::Make.new(@md,@word_mode).endnote_call_number +          word_mode=para.scan(/\S+/) +          word_mode=endnote_call_number(word_mode)            para=word_mode.join(' ')            endnote_ref+=1          when /~\^(?:\s|$)|<:e>/                                                                                 #%Note inserts endnotes previously gathered from /^(<!e[:_]!>|[-~]\{{3})/ (in earlier loop)            word_mode=para.scan(/\S+/) -          word_mode=SiSU_DAL::Make.new(@md,word_mode).endnote_call_number +          word_mode=endnote_call_number(word_mode)            para=word_mode.join(' ')            endnote_ref+=1          end          @tuned_file << para        end -      @tuned_file +      @tuned_file=@tuned_file.flatten      end -    def endnote_call_number -      data=@data +    def endnote_call_number(data)        data.each do |word|          case word          when /~\{/ @@ -824,8 +802,7 @@ module SiSU_DAL          end        end      end -    def metadata -      data=@data +    def metadata(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}" @@ -958,8 +935,8 @@ module SiSU_DAL          @rc << "<b>Generated</b> #{head_no_rc}" if @rc.length > 0          @rc << "#{@tr.last_generated}: <u>#{Time.now}</u> <~0;m#{ocnm};v#{ocnv}>"          ocnm+=1; ocnv+=1 -        if @md.sisu_version[:version]  -          @rc << "#{@tr.sisu_version}: <u>#{@md.sisu_version[:project]}</u>  <u>#{@md.sisu_version[:version]}</u> of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]}) <~0;m#{ocnm};v#{ocnv}>"   +        if @md.sisu_version[:version] +          @rc << "#{@tr.sisu_version}: <u>#{@md.sisu_version[:project]}</u>  <u>#{@md.sisu_version[:version]}</u> of #{@md.sisu_version[:date_stamp]} (#{@md.sisu_version[:date]}) <~0;m#{ocnm};v#{ocnv}>"            ocnm+=1; ocnv+=1          end          @rc << "#{@tr.ruby_version}: <u> #{@md.ruby_version}</u> <~0;m#{ocnm};v#{ocnv}>" @@ -979,7 +956,7 @@ module SiSU_DAL        @rc.each { |x| meta << x }        ## ENDNOTE RELATED endnote related        meta << "\n<EOF>" -      meta=SiSU_DAL::Make.new(@md,meta).object_digest +      meta=object_digest(meta)      end      def stamped(para,hash_class)        @tuned=[] @@ -996,15 +973,15 @@ module SiSU_DAL            /(?:.*?~\{.+?\}~|.*?~\[.+?\]~)+(.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+>)/.match(para)[1]          else ''          end -        para_plus_en << para_tail  -        en_and_para_digest << SiSU_DAL::Make.new(@md,para_plus_en).endnote_digest +        para_plus_en << para_tail +        en_and_para_digest << endnote_digest(para_plus_en)          para_new=en_and_para_digest.join(' ')          @tuned << para_new + '<' + digest_strip + ':' + digest_all + '>' unless para.nil?        else @tuned << para + '<' + digest_strip + ':' + digest_all + '>' unless para.nil?        end        @tuned.join      end -    def object_digest +    def object_digest(data)      # 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?]) @@ -1012,9 +989,10 @@ module SiSU_DAL      # 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=~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+>/            if @env.digest.type =~/sha256/              for hash_class in [ Digest::SHA256 ] @@ -1028,11 +1006,10 @@ module SiSU_DAL          else @tuned_file << para unless para.nil?          end        end -      @tuned_file +      @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=@data +    def endnote_digest(data)        para_bit=[]        data.each do |en_plus|          para_bit <<= case en_plus diff --git a/lib/sisu/0.52/dal_doc_str.rb b/lib/sisu/v0/dal_doc_str.rb index b2b18ca8..04cd3bdc 100644 --- a/lib/sisu/0.52/dal_doc_str.rb +++ b/lib/sisu/v0/dal_doc_str.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,8 +49,8 @@   * Notes: tidy -xml sax.xml >> index.tidy  =end  module SiSU_document_structure -  require SiSU_lib + '/dal_doc_str_tables' -  require SiSU_lib + '/dal_doc_str_code' +  require "#{SiSU_lib}/dal_doc_str_tables" +  require "#{SiSU_lib}/dal_doc_str_code"    class Structure      def initialize(md,para)        @md,@para=md,para @@ -61,9 +61,9 @@ module SiSU_document_structure        @para      end      def structure_markup -      @para=unless @para =~/[0-6]~/  +      @para=unless @para =~/[0-6]~/          @para=case @para -        when /^\s*#{@md.lv1}/; @para.sub!(/(?:<[:!]1!?>\s*)?(.+)/,'1~ \1') if @para !~/^1~/  +        when /^\s*#{@md.lv1}/; @para.sub!(/(?:<[:!]1!?>\s*)?(.+)/,'1~ \1') if @para !~/^1~/          when /^\s*#{@md.lv2}/; @para.sub!(/(?:<[:!]2!?>\s*)?(.+)/,'2~ \1') if @para !~/^2~/          when /^\s*#{@md.lv3}/; @para.sub!(/(?:<[:!]3!?>\s*)?(.+)/,'3~ \1') if @para !~/^3~/          when /^\s*#{@md.lv4}/; @para.sub!(/(?:<[:!]4!?>\s*)?(.+)/,'4~ \1') if @para !~/^4~/ @@ -150,7 +150,7 @@ module SiSU_document_structure              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  +              unless para=~/<:#>|~#|-#/ # |^\s*\*\s*\*\s*\*\s*$ <-consider leaving un-numbered                  ocn+=1                  if para=~/^[1-8]~(?:\s+|\S)/ or para =~@md.lv1 or para =~@md.lv2 or para =~@md.lv3 or para =~@md.lv4 or para =~@md.lv5 or para =~@md.lv6                    ocnh+=1 @@ -196,9 +196,9 @@ module SiSU_document_structure                end              else o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,nil,nil,nil              end -          else  +          else              para=if para !~/^%{1,4}\s/ -              o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,nil,nil,nil  +              o[:txt],o[:node],o[:ocn],o[:lv],o[:type]=para,node,nil,nil,nil              else ''              end            end diff --git a/lib/sisu/0.52/dal_doc_str_code.rb b/lib/sisu/v0/dal_doc_str_code.rb index 46a466b6..540ffa95 100644 --- a/lib/sisu/0.52/dal_doc_str_code.rb +++ b/lib/sisu/v0/dal_doc_str_code.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -84,7 +84,7 @@ module SiSU_document_structure_code            para.gsub!(/^(alt|group)\{.*/,'<:\1>')          end          if @@flag['code'] -          if @@flag['code'] and para =~/^\}code/  +          if @@flag['code'] and para =~/^\}code/              para.gsub!(/^\}code.*/,'<:code-end>')              @@flag['code']=false            end @@ -95,7 +95,7 @@ module SiSU_document_structure_code              para=@line_mode.join            end          elsif @@flag['poem'] or @@flag['group'] -          if @@flag['poem'] and para =~/^\}(?:poem)/  +          if @@flag['poem'] and para =~/^\}(?:poem)/              para.gsub!(/^\}(poem).*/,"\n<:verse-end>")              @@flag['poem']=false            elsif @@flag['group'] and para =~/^\}(?:alt|group)/ @@ -106,11 +106,11 @@ module SiSU_document_structure_code            and para !~/<:(verse|code|alt|group)(-end)?>/              sub_array=para.dup              @line_mode=sub_array.scan(/.+/) -            type=if @@flag['poem']; 'poem'  +            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  +            div=if @@flag['poem'] and @verse_count > 0                "\n" + '<:verse-end>' + "\n\n" + '<:verse>'              else ''              end @@ -119,9 +119,9 @@ module SiSU_document_structure_code            else para            end          end -        if @@flag['code'] or @@flag['poem'] or  @@flag['group']  +        if @@flag['code'] or @@flag['poem'] or  @@flag['group']            @tuned_group << para if para =~/\S+/ -        elsif para =~/<:(?:code|alt|group|verse)-end>/  +        elsif para =~/<:(?:code|alt|group|verse)-end>/            @verse_count=0            @tuned_group << para            if para =~/<:group-end>/ diff --git a/lib/sisu/0.52/dal_doc_str_tables.rb b/lib/sisu/v0/dal_doc_str_tables.rb index e70490e5..919dca05 100644 --- a/lib/sisu/0.52/dal_doc_str_tables.rb +++ b/lib/sisu/v0/dal_doc_str_tables.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -79,7 +79,7 @@ module SiSU_document_structure_tables          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  +      else          col_w=100/@row[1].length          "#{col_w};" * @row[1].length        end @@ -102,7 +102,7 @@ module SiSU_document_structure_tables              table << if c =~/\A(?:\n)?\s*\Z/                "¡¡#{w[n]}¡" + ' '              else -              "¡¡#{w[n]}¡" + c.strip  +              "¡¡#{w[n]}¡" + c.strip              end            end            table << '!>'                                                                  #'</tr>' @@ -140,7 +140,7 @@ module SiSU_document_structure_tables              para.strip!              @tuned_table << para              @tuned_table.delete('') -            @tuned_file << @tuned_table.compact.join("\n") #@tuned_table.compact.join =~/\S+/  #would be preferable  +            @tuned_file << @tuned_table.compact.join("\n") #@tuned_table.compact.join =~/\S+/  #would be preferable              para=''              @tuned_table=[]              @@flag['table_to']=false diff --git a/lib/sisu/0.52/dal_syntax.rb b/lib/sisu/v0/dal_syntax.rb index 53d55da2..513dc721 100644 --- a/lib/sisu/0.52/dal_syntax.rb +++ b/lib/sisu/v0/dal_syntax.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -99,7 +99,7 @@ module Syntax        if (defined? @md.make_italic[:str] and @md.make_italic[:str]) \        or (defined? @vz.markup_make_italic[:str] and @vz.markup_make_italic[:str])          line= if line !~/^(0~|%{1,4}\s)/  #!~/^(?:[0-6]~|!_|%+\s)/ -          word=line.scan(@line_scan_ital)  +          word=line.scan(@line_scan_ital)            word.flatten!            word.compact! #reinstated            line_array=[] @@ -129,7 +129,7 @@ module Syntax        if (defined? @md.make_bold[:str] and @md.make_bold[:str]) or (defined? @vz.markup_make_bold[:str] and @vz.markup_make_bold[:str])          line=if line !~/^(?:[0-9]~|%+\s)/            line_array=[] -          word=line.scan(@line_scan_bold)  +          word=line.scan(@line_scan_bold)            word.flatten!            word.compact!            word.each do |w| @@ -137,7 +137,7 @@ module Syntax                if defined? @md.make_bold[:regx] and @md.make_bold[:regx]   #document header: 0~bold [bold word list]                  w.gsub!(@md.make_bold[:regx],'<b>\1</b>')                elsif defined? @vz.markup_make_bold and @vz.markup_make_bold               #defaults and skin adjusted bold word list -                w.gsub!(@vz.markup_make_bold,'<b>\1</b>')            +                w.gsub!(@vz.markup_make_bold,'<b>\1</b>')                end              else                if w =~ /(?:^!_|^[789]~)\s+/; embolden(w) #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! @@ -158,7 +158,7 @@ module Syntax        # << http://www.jus.uio.no/sisu/sisu_markup_table/markup >>        # See: data/sisu/sample/document_samples_sisu_markup/        # !{emphasis}!        e{emphasis}e       <strong>emphasis</strong> -      # *{bold text}*       b{bold}b           <b>bold text</b>   +      # *{bold text}*       b{bold}b           <b>bold text</b>        # _{underline}_       u{underline}u      <u>underline</u>        # /{italics}/         i{italics}i        <i>italics</i>        # "{citation}"        c{citation}c       <cite>citation</cite> #blockquote? @@ -273,14 +273,14 @@ module Syntax          if line =~/(<:(?:verse|group)>)/; line.gsub!(/(<:(?:verse|group)>)/i,"\\1\n") #cosmetic          else line.gsub!(/(<br \/>)/i,"\\1\n")          end -      else  +      else          line.gsub!(/<:codeline>/,"\n")        end        line      end      def tech                                                                       #script markup planned to be more strict for technical documents        # !{emphasis}!        e{emphasis}e       <strong>emphasis</strong> -      # *{bold text}*       b{bold}b           <b>bold text</b>   +      # *{bold text}*       b{bold}b           <b>bold text</b>        # _{underline}_       u{underline}u      <u>underline</u>        # /{italics}/         i{italics}i        <i>italics</i>        # "{citation}"        c{citation}c       <cite>citation</cite> diff --git a/lib/sisu/0.52/db_columns.rb b/lib/sisu/v0/db_columns.rb index 295e1ae2..513cc62e 100644 --- a/lib/sisu/0.52/db_columns.rb +++ b/lib/sisu/v0/db_columns.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. diff --git a/lib/sisu/0.52/db_create.rb b/lib/sisu/v0/db_create.rb index d5fab27d..67ef7bbd 100644 --- a/lib/sisu/0.52/db_create.rb +++ b/lib/sisu/v0/db_create.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,9 +47,9 @@                    ralph.amissah@gmail.com  =end  module SiSU_DB_create -  require SiSU_lib + '/db_columns' +  require "#{SiSU_lib}/db_columns"    class Create < SiSU_DB_columns::Column_size -    require SiSU_lib + '/sysenv' +    require "#{SiSU_lib}/sysenv"      @@dl=nil      def initialize(opt,conn='',sql_type='pg')        @opt,@conn,@sql_type=opt,conn,sql_type @@ -184,7 +184,7 @@ module SiSU_DB_create            END;          ' LANGUAGE 'plpgsql';          CREATE TRIGGER removefile AFTER INSERT -        PROCEDURE fileremoval();  +        PROCEDURE fileremoval();  */          }          @comment['documents'] =%{ diff --git a/lib/sisu/0.52/db_drop.rb b/lib/sisu/v0/db_drop.rb index 44f31d2a..5a6a28a0 100644 --- a/lib/sisu/0.52/db_drop.rb +++ b/lib/sisu/v0/db_drop.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. diff --git a/lib/sisu/0.52/db_import.rb b/lib/sisu/v0/db_import.rb index 73161dc0..3e1c72cc 100644 --- a/lib/sisu/0.52/db_import.rb +++ b/lib/sisu/v0/db_import.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,9 +47,9 @@                    ralph.amissah@gmail.com  =end  module SiSU_DB_import -  require SiSU_lib + '/db_columns' -  require SiSU_lib + '/db_load_tuple' -  require SiSU_lib + '/shared_html_lite' +  require "#{SiSU_lib}/db_columns" +  require "#{SiSU_lib}/db_load_tuple" +  require "#{SiSU_lib}/shared_html_lite"    class Import < SiSU_DB_columns::Column_size      include SiSU_Param      include SiSU_Screen @@ -76,21 +76,21 @@ module SiSU_DB_import        @col[:lid]=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i }        @col[:lid] ||=0        sql='SELECT MAX(nid) FROM endnotes' -      @id_n=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i }  +      @id_n=@conn.execute( sql ) { |x| x.fetch_all.to_s.to_i }        @id_n ||=0        @col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=0        @db=SiSU_Env::Info_db.new        @@dl ||=SiSU_Env::Info_env.new.digest.length      end      def marshal_load -      require SiSU_lib + '/dal' +      require "#{SiSU_lib}/dal"        @dal_array=SiSU_DAL::Source.new(@opt).get                  # dal file drawn here        #@dal_array.each { |x| puts x.inspect; sleep 1 }        tell=SiSU_Screen::Ansi.new(@opt.cmd,"#{@db.db_psql}::#{@opt.fns}")        tell.puts_blue unless @opt.cmd =~/q/        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Marshal Load',@fnm)        tell.print_grey if @opt.cmd =~/v/ -      case @sql_type  +      case @sql_type        when /sqlite/                                                              #fix logic for sqlite !          import_db_metadata(@dal_array)          import_documents(@dal_array) @@ -348,7 +348,7 @@ module SiSU_DB_import            data.gsub!(/<b>(.+?)<\/b>/,'\1')                             # remove bold, italics, underscore            data.gsub!(/<i>(.+?)<\/i>/,'\1')                             # remove bold, italics, underscore            data.gsub!(/<u>(.+?)<\/u>/,'\1')                             # remove bold, italics, underscore -          #data.gsub!(/<:name#\S+?>/,'')           +          #data.gsub!(/<:name#\S+?>/,'')            @col[:seg]=@@seg            if data =~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m                                                    # regular text              notedata=data.dup @@ -377,11 +377,11 @@ module SiSU_DB_import                special_character_escape(@col[:body])                @col[:plaintext]=@col[:body].dup                strip_markup(@col[:plaintext]) -              if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last +              if @en[0]; @en_a,@en_z=@en[0].first,@en[0].last                end -              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last +              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last                end -              if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last +              if @en_pls[0]; @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last                end                t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)                t.tuple @@ -419,11 +419,11 @@ module SiSU_DB_import                special_character_escape(@col[:body])                @col[:plaintext]=@col[:body].dup                strip_markup(@col[:plaintext]) -              if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last +              if @en[0]; @en_a,@en_z=@en[0].first,@en[0].last                end -              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last +              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last                end -              if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last +              if @en_pls[0]; @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last                end                t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)                t.tuple @@ -459,11 +459,11 @@ module SiSU_DB_import                special_character_escape(@col[:body])                @col[:plaintext]=@col[:body].dup                strip_markup(@col[:plaintext]) -              if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last +              if @en[0]; @en_a,@en_z=@en[0].first,@en[0].last                end -              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last +              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last                end -              if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last +              if @en_pls[0]; @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last                end                t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)                t.tuple @@ -499,11 +499,11 @@ module SiSU_DB_import                special_character_escape(@col[:body])                @col[:plaintext]=@col[:body].dup                strip_markup(@col[:plaintext]) -              if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last +              if @en[0]; @en_a,@en_z=@en[0].first,@en[0].last                end -              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last +              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last                end -              if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last +              if @en_pls[0]; @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last                end                t=SiSU_DB_tuple::Load_tuple.new(@conn,@col,@opt)                t.tuple @@ -538,11 +538,11 @@ module SiSU_DB_import                  end                  txt=%{\n\nLARGE TEXT BLOCK OMITTED\n\n}                end -              if @en[0]; @en_a,@en_z = @en[0].first,@en[0].last +              if @en[0]; @en_a,@en_z=@en[0].first,@en[0].last                end -              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk = @en_ast[0].first,@en_ast[0].last +              if @en_ast[0]; @en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last                end -              if @en_pls[0]; @en_a_plus,@en_z_plus = @en_pls[0].first,@en_pls[0].last +              if @en_pls[0]; @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last                end                @col[:body]=if txt=~/<!T[h]?¡.+?!~\d+;\w\d+;\w\d+>/ #watch                  SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns]).html_table @@ -567,7 +567,7 @@ module SiSU_DB_import                endnote_array.each do |inf|                  if inf[/~\{\d+.+?<[0-9a-f]{#{@@dl}}>\}~/]                                       # dal new endnotes 2003w31/1                    if inf[/~\{(\d+)(.+?)<([0-9a-f]{#{@@dl}})>\}~/]                                       # dal new endnotes 2003w31/1 -                    en,txt,digest_clean=$1,$2,$3  +                    en,txt,digest_clean=$1,$2,$3                    end                    @id_n+=1                    body=SiSU_Format_Shared::CSS_Format.new(txt,@col[:ocn],@col[:ocnd],@col[:ocns],en).endnote @@ -585,7 +585,7 @@ module SiSU_DB_import                      #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes                      @conn.execute(%{                        INSERT INTO endnotes (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}'); -                    })  +                    })                    end                  end                end @@ -614,7 +614,7 @@ module SiSU_DB_import                      #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes                      @conn.execute(%{                        INSERT INTO endnotes_asterisk (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}'); -                    })  +                    })                    end                  end                end @@ -643,7 +643,7 @@ module SiSU_DB_import                      #puts "'#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}'" #% endnotes                      @conn.execute(%{                        INSERT INTO endnotes_plus (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) VALUES ('#{@id_n}', '#{@col[:lid]}', '#{en}', '#{txt}', '#{body}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@@id_t}', '#{digest_clean}'); -                    })  +                    })                    end                  end                end diff --git a/lib/sisu/0.52/db_indexes.rb b/lib/sisu/v0/db_indexes.rb index cd9b6e87..221c77ac 100644 --- a/lib/sisu/0.52/db_indexes.rb +++ b/lib/sisu/v0/db_indexes.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. diff --git a/lib/sisu/0.52/db_load_tuple.rb b/lib/sisu/v0/db_load_tuple.rb index 1be35e5a..9d513fda 100644 --- a/lib/sisu/0.52/db_load_tuple.rb +++ b/lib/sisu/v0/db_load_tuple.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,7 +48,7 @@  =end  module SiSU_DB_tuple    class Load_tuple                                                               #% main database populate -    require SiSU_lib + '/param' +    require "#{SiSU_lib}/param"      include SiSU_Param      def initialize(conn,col,opt)        @conn,@col,@opt=conn,col,opt @@ -70,8 +70,8 @@ module SiSU_DB_tuple            INSERT INTO documents (lid, metadata_tid, lev, clean, body, ocn, ocnd, ocns, seg, lev1, lev2, lev3, lev4, lev5, lev6, digest_clean, digest_all) VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');          })          end -        if @opt.cmd =~/v/  -          if @col[:lev].to_s =~/[1235678]/  +        if @opt.cmd =~/v/ +          if @col[:lev].to_s =~/[1235678]/              lev=case @col[:lev].to_s              when /1/; ':A'              when /2/; ':B' @@ -81,7 +81,7 @@ module SiSU_DB_tuple              end              puts %{#{lev}>\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}}            elsif @col[:lev].to_s =~/[4]/ -            puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}\t#{@col[:seg]}}  +            puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}\t#{@col[:seg]}}            end          end        rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error diff --git a/lib/sisu/0.52/db_remove.rb b/lib/sisu/v0/db_remove.rb index 81ec3643..0f955abb 100644 --- a/lib/sisu/0.52/db_remove.rb +++ b/lib/sisu/v0/db_remove.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -57,7 +57,7 @@ module SiSU_DB_remove      def remove        del=@conn.select_one(%{ SELECT tid FROM metadata WHERE filename LIKE '#{@opt.fns}'; })        if del -        del_id=del.join  +        del_id=del.join          #@conn.execute("BEGIN")          @conn.execute(%{            DELETE FROM endnotes WHERE metadata_tid LIKE '#{del_id}'; diff --git a/lib/sisu/0.52/db_select.rb b/lib/sisu/v0/db_select.rb index a6db4bfa..bfddd323 100644 --- a/lib/sisu/0.52/db_select.rb +++ b/lib/sisu/v0/db_select.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,7 +48,7 @@  =end  module SiSU_DB_select    class Case -    def initialize(opt,conn='',sql_type='pg')  +    def initialize(opt,conn='',sql_type='pg')        @opt,@conn,@sql_type=opt,conn,sql_type        #@sdb=Create.new(@conn)        @sdb=SiSU_DB::Create.new(@opt,@conn,@sql_type) diff --git a/lib/sisu/0.52/db_tests.rb b/lib/sisu/v0/db_tests.rb index 8d6d7caf..b39b96dd 100644 --- a/lib/sisu/0.52/db_tests.rb +++ b/lib/sisu/v0/db_tests.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -53,7 +53,7 @@ module SiSU_DB_tests        unless @opt.cmd =~/q/          puts @ck.tp[:fns]          puts @ck.tp[:title] -        puts @ck.tp[:creator] if @ck.tp[:creator]  +        puts @ck.tp[:creator] if @ck.tp[:creator]        end      end      def verify diff --git a/lib/sisu/0.52/dbi.rb b/lib/sisu/v0/dbi.rb index 6c1b8adf..cf8b0884 100644 --- a/lib/sisu/0.52/dbi.rb +++ b/lib/sisu/v0/dbi.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,15 +47,15 @@                    ralph.amissah@gmail.com  =end  module  SiSU_DBI                                                                 #% database building -  require SiSU_lib + '/help' -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/help" +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Screen -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param -  require SiSU_lib + '/shared_db' +  require "#{SiSU_lib}/shared_db"    include SiSU_DB -  require SiSU_lib + '/shared_html_lite' +  require "#{SiSU_lib}/shared_html_lite"    include SiSU_Format_Shared    class SiSU_SQL      def initialize(opt) @@ -75,14 +75,14 @@ module  SiSU_DBI      def read_psql        begin          db,user,dbi=@db.db_psql,@db.user,@db.dbi_psql -        @conn=DBI.connect(dbi,user,db)  +        @conn=DBI.connect(dbi,user,db)        rescue          if @opt.mod.inspect=~/--(createall|create)/            puts %{manually create the database: "#{db}" if it does not yet exist}            #sudo su -p postgres;  createdb #{db}; #[createuser?]          end          SiSU_DB::Case.new(@opt,@conn,@sql_type).cases -        @conn=DBI.connect(dbi,user,db)  +        @conn=DBI.connect(dbi,user,db)        ensure        end      end @@ -90,7 +90,7 @@ module  SiSU_DBI        begin          sql_type='sqlite'          dbi=@db.dbi_sqlite -        @conn=DBI.connect(dbi)  +        @conn=DBI.connect(dbi)        rescue        ensure        end diff --git a/lib/sisu/0.52/defaults.rb b/lib/sisu/v0/defaults.rb index 29027b7b..c81b91d2 100644 --- a/lib/sisu/0.52/defaults.rb +++ b/lib/sisu/v0/defaults.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,9 +49,9 @@  $latex_run=nil  module SiSU_Viz    require 'uri' -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/css' +  require "#{SiSU_lib}/css"    include SiSU_Style    class Skin      #attr_accessor :glyph,:html,:php,:javascript,:path,:text,:url,:color,:icon,:font,:markup,:paragraph,:table,:table_do,:indent,:margin,:png,:nav_txt,:nav_png,:banner,:widget @@ -214,7 +214,7 @@ module SiSU_Viz        %{<body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">}      end      def color_white -      '"#ffffff"'       +      '"#ffffff"'      end      def color_black        '#000000' @@ -253,7 +253,7 @@ module SiSU_Viz      #  '#423a27'      #end      def color_beige -      '#f1e8de'  +      '#f1e8de'        #'#fff3b6'#custard      end      def color_subtleglow @@ -332,7 +332,7 @@ module SiSU_Viz        'c0d0f0'      end      def color_band1 -      '"#ffffff"'       +      '"#ffffff"'      end      def color_band2        '"#ffffff"' @@ -405,7 +405,7 @@ module SiSU_Viz        'b_new.png'      end      def icon_book -      'b_amber.png'  +      'b_amber.png'        # b_book.png      end      def icon_dot_clear @@ -452,16 +452,16 @@ module SiSU_Viz        @fonts      end      def font_face -      %{face="#{font_fonts}"}   +      %{face="#{font_fonts}"}      end      def font_lmtoc_face -      %{face="#{font_fonts}"}  +      %{face="#{font_fonts}"}      end      def font_ebook_face -      %{face="#{font_fonts}"}  +      %{face="#{font_fonts}"}      end      def font_face_lmtoc -      %{face="#{font_fonts}"}  +      %{face="#{font_fonts}"}      end      def font_color        'color="#000000"' @@ -595,7 +595,7 @@ module SiSU_Viz        '"90%"'      end      def table_width_txt -      '"94%"'   +      '"94%"'      end      def table_width_txt_avgo        '"100%"' @@ -717,7 +717,7 @@ module SiSU_Viz        %{  <link rel="shortcut icon" href="../_sisu/image/#{icon_ico}" />}      end      def png_sisu #check url path -      %{  <a href="#{@url.sisu}">  +      %{  <a href="#{@url.sisu}">      <img border="0" width="160" height="60" src="#{url_path_image}/#{icon_sisu}" alt="SiSU" />      </a>}      end @@ -890,7 +890,7 @@ module SiSU_Viz      def nav_txt_previous        '  <font face="" size="2">        <b><<</b> Previous   -  </font>  +  </font>    Full Text '      end      def nav_txt_next @@ -940,7 +940,7 @@ module SiSU_Viz        %{  <br />      <a href="#{url_site}/" target="_top" #{js_home}>        #{png_doc} LM toc -    </a>  +    </a>      <a href="../treaties.and.organisations/lm.chronological" target="_top" #{js_instruments}>        #{png_doc} LM 20**      </a> @@ -1210,10 +1210,10 @@ WOK  <tr><td>    <p class="center">    <font color="#666666" size="1"> -    & for  +    & for      <a href="http://www.adobe.com/products/acrobat/adobepdf.html" target="external">        pdf -    </a>  +    </a>      viewings of this site we recommend stand alone viewers      <br />      (rather than web browser plugins): @@ -1245,11 +1245,11 @@ WOK  <td>    <p class="center"><font color="#666666" size="1">      <a href="http://www.cs.wisc.edu/~ghost/gv/" target="external"> -     GhostView<sup>®</sup> </a>,  +     GhostView<sup>®</sup> </a>,      <a href="http://wwwthep.physik.uni-mainz.de/~plass/gv/" target="external">        GV<sup>®</sup>      </a> -    &  +    &      <a href="http://www.cs.wisc.edu/~ghost/gsview/" target="external">        GSview<sup>®</sup>      </a> @@ -1281,7 +1281,7 @@ WOK  </tr>  <form action="http://groups-beta.google.com/group/SiSU_e-docs/boxsubscribe">    <tr><td> -    Email:  +    Email:      <input type=text name=email>    </td>    <td> @@ -1295,7 +1295,7 @@ WOK  <tr><td colspan=2 align=center>    <a href="http://groups-beta.google.com/group/SiSU_e-docs">      Browse Archives -  </a> at  +  </a> at    <a href="http://groups-beta.google.com/">      groups-beta.google.com</a>    </td></tr> @@ -1331,7 +1331,7 @@ WOK  <tr align="center"><td align="left">    <p class="left">    <font color="#666666" size="2"> -    Generated by  +    Generated by      <a href="#{url_sisu}" #{js_sisu}>        SiSU      </a> @@ -1357,11 +1357,11 @@ WOK      SiSU is the result of several years of research and development in electronic      publishing, commenced in 1993 and under active development since 1997.    <br /> -    <b>SiSU is released under  +    <b>SiSU is released under      <a href="http://www.gnu.org/copyleft/gpl.html">        GPL 2 -    </a>  -    or later</b>  +    </a> +    or later</b>      <a href="http://www.gnu.org/copyleft/gpl.html">        http://www.gnu.org/copyleft/gpl.html      </a> @@ -1394,15 +1394,15 @@ WOK    <font color="#666666" size="2">      Developed    <br /> -    using  +    using      <a href="http://www.ruby-lang.org/en/">        Ruby      </a>    <br /> -    on  +    on      <a href="http://www.debian.org/">        Debian/Gnu/Linux -    </a>  +    </a>      software infrastructure,    <br />      & with the usual GPL (or OSS) suspects. @@ -1650,7 +1650,7 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQ  <p class="small">    <a href="http://www.jus.uio.no/sisu/syntax_highlight" target="_top" >      Syntax highlighting -  </a>  +  </a>  </p>  <p class="tiny">    ============= diff --git a/lib/sisu/0.52/digests.rb b/lib/sisu/v0/digests.rb index 8aedbc62..8c54649b 100644 --- a/lib/sisu/0.52/digests.rb +++ b/lib/sisu/v0/digests.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,9 +49,9 @@                    ralph.amissah@gmail.com  =end  module SiSU_Digest_view -  require SiSU_lib + '/dal' -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/i18n' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/i18n"    include SiSU_Env    include SiSU_Param    include SiSU_Viz @@ -194,7 +194,7 @@ module SiSU_Digest_view                      @img << /\S+\.(png|jpg|gif)/.match(i)[1]                      not_found_msg='image not found'                      if image_source -                      para_image = image_source + '/' + i  +                      para_image = image_source + '/' + i                        @image_name << i                        @image_dgst << if @dg =~/^sha(?:2|256)$/; sys.sha256(para_image)                        else                                      sys.md5(para_image) @@ -207,7 +207,7 @@ module SiSU_Digest_view                    end                    line= "\n" + '  '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all + "\n"                    line_image=[] -                  c=0  +                  c=0                    @image_name.each do |ok|                      line_image << %{                     #{@img[c]}       #{@image_dgst[c][1]}                                  #{@image_name[c]}}                      c +=1 @@ -297,7 +297,7 @@ module SiSU_Digest_view          ocn,endnotes=nil,nil          data.each do |para|            x=case para -          when /^0~/; l[0] +=1  +          when /^0~/; l[0] +=1              if para =~/^0~title/; '' #'  '*0 +'@ == headers' + "\n" + '  '*0 +'headings:'              end            when /^1~/; l[1] +=1 @@ -325,7 +325,7 @@ module SiSU_Digest_view          dal_structure1("  [*] heading levels\n")          dal_structure2("------------\n")          dal_structure2("document structure[*]\n") -        [0,1,2,3,4,5,6].each do |y|  +        [0,1,2,3,4,5,6].each do |y|            v=case y.to_s            when /0/; '@ '            when /1/; ':A' diff --git a/lib/sisu/0.52/docbook.rb b/lib/sisu/v0/docbook.rb index a58eb17d..e8675f45 100644 --- a/lib/sisu/0.52/docbook.rb +++ b/lib/sisu/v0/docbook.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,18 +49,18 @@   * Notes: tidy -xml dom.xml >> index.tidy  =end  module SiSU_Docbook -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/dal' -  require SiSU_lib + '/shared_xml' -  require SiSU_lib + '/xml_format' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/shared_xml" +  require "#{SiSU_lib}/xml_format"    include SiSU_XML_format    include SiSU_XML_munge -  require SiSU_lib + '/rexml' +  require "#{SiSU_lib}/rexml"    include SiSU_Rexml    @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0    @@tablefoot='' @@ -118,7 +118,7 @@ module SiSU_Docbook        Contents[3]='sect2'        @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=[] }        @@dp=nil -      require SiSU_lib + '/shared_txt' +      require "#{SiSU_lib}/shared_txt"        include SiSU_text_utils        def initialize(data='',md='')          @data,@md=data,md @@ -137,7 +137,7 @@ module SiSU_Docbook        end      protected        def xml_markup(para='') -        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,  +        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,            '<footnote><para>\1 \2</para></footnote> ')        end        def xml_head(meta) @@ -192,7 +192,7 @@ WOK            @copen[2]=true            @copen[3]=false          elsif lv == 6 -          @copen[3]=true  +          @copen[3]=true          end        end        def xml_structure(lv='',ocn='',para='',hname='' ) @@ -228,7 +228,7 @@ WOK                  @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"                end                @copen[1]=@copen[2]=@copen[3]=false -            elsif @copen[1] # 4~  +            elsif @copen[1] # 4~                [1].each do |v|                  @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"                end @@ -238,10 +238,10 @@ WOK              @level[x]=false            end          when 4..6 -          6.downto(lv) do |x|  +          6.downto(lv) do |x|              y=x - 1              if @level[x] == true -              u=x - 3;  +              u=x - 3;                @xml_contents_close[x]=''              end            end @@ -270,7 +270,7 @@ WOK                [2,1].each do |v|                  @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"                end -            elsif @copen[1] == true # 4~  +            elsif @copen[1] == true # 4~                [1].each do |v|                  @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"                end @@ -296,7 +296,7 @@ WOK          end          xml_element(lv,ocn,para,hname,tag,xml_element)          @level[lv]=true -        ((lv+1)..6).each { |x| @level[x]=false }  +        ((lv+1)..6).each { |x| @level[x]=false }        end        def group_structure(para='',ocn='')          para.gsub!(/<:group(?:-end)?>/,'') @@ -334,15 +334,15 @@ WOK          xml_sc(@md)          @rcdc=false          @level,@cont,@copen,@xml_contents_close=[],[],[],[] -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @xml_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @xml_contents_close[x]='' }          data.each do |para|            wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17            para=tidywords(wordlist).join(' ').strip            para.gsub!(/<[-~]#>/,'')            para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'')            para.gsub!(/<:pb>\s*/,'') -          para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,  +          para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,              %{<imagedata fileref="#{dir.url.images_local}\/\\1"/>})            #para.gsub!(/\{(\S+?\.png) \d+x\d+ \".+?\" \}(?:http:\/\/\S+|image)/,'<image>\1</image>')            para.gsub!(/ /,' ') @@ -353,7 +353,7 @@ WOK  	          end            end            @rcdc=true if @rcdc ==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/) -          if para !~/(^0~|<ENDNOTES>|<EOF>)/  +          if para !~/(^0~|<ENDNOTES>|<EOF>)/              if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/                paranum=para[@regx, 3]                @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum) diff --git a/lib/sisu/0.52/errors.rb b/lib/sisu/v0/errors.rb index a6646c8a..12e67b76 100644 --- a/lib/sisu/0.52/errors.rb +++ b/lib/sisu/v0/errors.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,9 +47,9 @@                    ralph.amissah@gmail.com  =end  module SiSU_Errors -  require SiSU_lib + '/sysenv' -  include SiSU_Env  -  include SiSU_Screen  +  require "#{SiSU_lib}/sysenv" +  include SiSU_Env +  include SiSU_Screen    class Info_error <Create_file      def initialize(error,errorlist,cmd,fns='')        @fns,@cmd,@error,@errorlist=fns,cmd,error,errorlist @@ -61,7 +61,7 @@ module SiSU_Errors        file=if @fns; SiSU_Env::Create_file.new(@cmd,@fns).file_error        else          File.new('/tmp/errorlog.sisu','w+')        end -      file << @fns << "\n" << @error << "\n" << @errorlist  +      file << @fns << "\n" << @error << "\n" << @errorlist        file.close        if @cmd=~/[vVM]/; STDERR.puts SiSU_Screen::Ansi.new('',$!,$@).rescue        else             SiSU_Screen::Ansi.new('',"rescued, exception reaised, silenced").puts_grey diff --git a/lib/sisu/0.52/help.rb b/lib/sisu/v0/help.rb index a8f1a5ce..b2b0a3fe 100644 --- a/lib/sisu/0.52/help.rb +++ b/lib/sisu/v0/help.rb @@ -47,8 +47,8 @@                    ralph.amissah@gmail.com  =end  module SiSU_Help -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/param"    include SiSU_Screen    class Help      def initialize(request='',color='') @@ -137,7 +137,7 @@ module SiSU_Help            print help_list            print help_prompt            gotten=nil -          gotten=gets  +          gotten=gets          end        rescue          #STDERR.puts Ansi.new($!, $@).rescue @@ -198,7 +198,7 @@ Features:  #{@cX.cyan}(xix)#{@cX.off} tied to revision control system, only code and marked up file need be backed up, to be sure of the much larger document set  #{@cX.cyan}(xx)#{@cX.off} syntax highlighting files for markup, primarily (g)vim so far. -SiSU was developed in relation to legal documents, and so is strong across a wide variety of texts (law, literature...), though weak on formulae/statistics, it does handle images. An assumption has been document sets that are to be preserved and maintained over time (also a result of the legal text origin). SiSU has been developed and used over a number of years, and the requirements to cover a wide range of documents have been thoroughly explored.  +SiSU was developed in relation to legal documents, and so is strong across a wide variety of texts (law, literature...), though weak on formulae/statistics, it does handle images. An assumption has been document sets that are to be preserved and maintained over time (also a result of the legal text origin). SiSU has been developed and used over a number of years, and the requirements to cover a wide range of documents have been thoroughly explored.  There is more detailed information available on it from:    #{@cX.blue}http://www.jus.uio.no/sisu#{@cX.off} @@ -224,14 +224,14 @@ WOK      end      def commands        print <<WOK -  +   #{@cX.ruby}-A#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces  plaintext  with  dos  linefeeds.  Without  markup, (object numbers are omitted), has footnotes at end of each para‐ graph that contains them [ -a for equivalent Unix (ascii) output file] [see -E for endnotes]   #{@cX.ruby}-a#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces plaintext  with Unix linefeeds.  Without  markup, (object numbers are omitted), has footnotes at end of each para‐ graph that contains them [ -A for equivalent dos (ascii)  output file] [see -e for endnotes]    #{@cX.ruby}-b#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces xhtml/XML output for browser viewing (sax parsing) - #{@cX.ruby}-C#{@cX.off} initialise shared output directory (config files such as css and dtd files are not updated if they  already  exist  unless modifier is used) #{@cX.ruby}-C --init=site#{@cX.off} configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files  are updated if this modifier is used.  in a new markup document working directory should initialise the corresponding output directory, though SiSU will automatically do this, the first time it is run (for processing) in a given directory.   + #{@cX.ruby}-C#{@cX.off} initialise shared output directory (config files such as css and dtd files are not updated if they  already  exist  unless modifier is used) #{@cX.ruby}-C --init=site#{@cX.off} configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files  are updated if this modifier is used.  in a new markup document working directory should initialise the corresponding output directory, though SiSU will automatically do this, the first time it is run (for processing) in a given directory.   #{@cX.ruby}-c#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} screen toggle ansi screen colour on or off depending on default set (unless -c flag is used: if sisurc colour default is set to ´true´, output to screen will  be  with colour,  if  sisurc  colour default is set to ´false´ or is undefined screen output will be without colour) @@ -240,9 +240,9 @@ WOK   #{@cX.ruby}-d#{@cX.off} #{@cX.green}[instruction]#{@cX.off} #{@cX.green}[filename]#{@cX.off} database instruction, see database section below [only -D currently available]   #{@cX.ruby}-E#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces plaintext with dos linefeeds, and without markup,  endnotes follow the main text (in -a endnotes follow the paragraphs that contain them). There are no object numbers [see -e for Unix (ascii) output file] [see -A for footnotes] -  +   #{@cX.ruby}-e#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces plaintext with Unix linefeeds, and without markup, endnotes follow the main text. Object numbers are omitted. [ -E for equivalent dos (ascii) output file] [ -a for footnotes] -  +   #{@cX.ruby}-F#{@cX.off} generate examples of (naive) cgi  search  form  for  sqlite  and  pgsql depends  on  your already having used sisu to populate an sqlite and/or pgsql database, (the sqlite version scans the  output  directories  for existing  sisu_sqlite  databases,  so  it  is first necessary to create them, before generating the search form) see -d  -D  and  the  database section  below.   If  the optional parameter webrick is passed, the cgi examples created will be set up to use the default port set for use  by the  webrick  server,  (otherwise the port is left blank and the system setting used, usually 80). The samples are dumped in the present work directory which must be writable, (with screen instructions given that they be copied to the cgi-bin directory).   #{@cX.ruby}-H#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces html (css version) (creates html (using css)), with url link suffixes (.html .pdf etc.) omitted ("Hide"). For web servers that are confireud so as not to require file extensions to locate and serve files. [behaviour switched see -h] @@ -252,11 +252,11 @@ WOK   #{@cX.ruby}-I#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces texinfo file with its myriad of possibilities   #{@cX.ruby}-L#{@cX.off} prints license information -  +   #{@cX.ruby}-M#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} maintenance mode, files created for processing are not deleted, and their locations are indicated (also see -V)   #{@cX.ruby}-m#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} create (new)metaVerse (used in all subsequent processing). Produce a meta file, the first step in processing, and the file all subsequent processing utilize.  (Should usually be run together with other commands to ensure that the lated version of markup source document is used, i.e. add -m flag to other flags required). -  +   #{@cX.ruby}-N#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} document content certificate as md5 digest tree of document produced  (as digest.txt), the digest for the document, and digests for each object contained within  the  document  (together  with information on software versions that produced it). Try -mNV for verbose digest output to screen   #{@cX.ruby}-n#{@cX.off} #{@cX.green}[filename/wildcard/url]#{@cX.off} skip meta-markup (building of "metaverse"), this skips the equivalent of -m @@ -270,18 +270,18 @@ WOK   #{@cX.ruby}-S#{@cX.off} #produces a sisupod, a zipped sisu directory of markup files including sisu markup source files and the directories local configuration file,  images  and skins. Note: this only includes the configuration files or skins contained in ./_sisu not those in ~/.sisu The resulting tar gzip file has a .zip suffix added to the markup source directory name. To tar and gzip individual files see the -Z [filename/wildcard] option.  Note: (this option is tested only with zsh)   #{@cX.ruby}-S#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces a sisupod a zipped sisu of the content assocated with the specified sisu markup documnt, i.e. including sisu markup source file, (and associated documents if a master file, or available in multilingual versions), together with related images and skin. The resulting zipped file has a .zip suffix added to the markup source file name by default, though a .ssp suffix is also recognised. The directory structure of the unzipped file is understood by sisu, and sisu commands can be run  within it. SiSU commands can be run against a sisupod contained in a local directory, or provided as a url on a remote site. As there is a security issue with skins provided by other users, they are not applied unless the flag --trust  or --trusted  is  added  to  the  command  instruction,  it  is recommended that file that are not your own are treated as untrusted. This provides a convenient way of packing documents files for sending Note: if you wish to send multiple files, it quickly becomes more space efficient to tar and gzip the sisu markup directory, (without the _sisu_processing subdirectory) rather than the individual files for sending). See the -S option without [filename/wildcard] -  +   #{@cX.ruby}-t#{@cX.off} #{@cX.green}[filename/wildcard (*.termsheet.rb)]#{@cX.off} standard form document builder, preprocessing feature   #{@cX.ruby}-U#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} prints url list/map for the available processing flags options and resulting files that could be requested, (can be used to get a list of processing options in  relation to a file, together with information on the output that would be produced), -u provides url mapping for those flags requested for processing. The default assumes sisu_webrick is running and provides webrick url mappings where appropriate, but these can be switched to file system paths in sisurc.yml   #{@cX.ruby}-u#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} provides url mapping of output files for the flags requested for processing, also see -U -  +   #{@cX.ruby}-V#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} on its own provides SiSU version and environment information (sisu --help env)   #{@cX.ruby}-V#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} even more verbose than -v the -V flag provides some additional information, also see -M - #{@cX.ruby}-v#{@cX.off} on its own, provides SiSU version information.   + #{@cX.ruby}-v#{@cX.off} on its own, provides SiSU version information.   #{@cX.ruby}-v#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} provides more verbose output of what is being built, where it is being  built  (and error messages if any), as with -u flag provides a url mapping of files created for each of the processing flag requests @@ -293,8 +293,8 @@ WOK   #{@cX.ruby}-w#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces concordance, a rudimentary index of all the words in a document - #{@cX.ruby}-Z#{@cX.off} Zap, if used with other processing flags #{@cX.green}deletes output files#{@cX.off} of the type about to be processed, prior to processing.  If -Z is used as  the lone  processing  related flag (or in conjunction with a combination of -[mMvVq]), will remove the related document output directory.   -  + #{@cX.ruby}-Z#{@cX.off} Zap, if used with other processing flags #{@cX.green}deletes output files#{@cX.off} of the type about to be processed, prior to processing.  If -Z is used as  the lone  processing  related flag (or in conjunction with a combination of -[mMvVq]), will remove the related document output directory. +   #{@cX.ruby}-z#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off} produces php (zend) [feature disabled, depreciated]   #{@cX.ruby}-0#{@cX.off} [with -h or -H or -p] turn display of text object numbering off (implemented for html (css) and LaTeX/pdf output) [digit not uppercase o] @@ -312,7 +312,7 @@ WOK   #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--remove#{@cX.off} #{@cX.green}[filename/wildcard]#{@cX.off}  removes  specified  data  to postgresql db (rb.dbi) [#{@cX.ruby}-d --remove#{@cX.off} sqlite equivalent]   #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--dropall#{@cX.off} kills data" and drops (postgresql) db, tables & indexes [#{@cX.ruby}-d --dropall#{@cX.off} sqlite equivalent] -  +   #{@cX.ruby}-D#{@cX.off} #{@cX.ruby}--recreate#{@cX.off} kills data" and drops (postgresql or sqlite) db, tables & indexes, then creates an empty db with tables and indexes [#{@cX.ruby}-d --recreate#{@cX.off} sqlite equivalent]    also see command  #{@cX.green}shortcuts#{@cX.off}, and shorthand mappings for multiple flags @@ -323,7 +323,7 @@ WOK        print <<WOK   #{@cX.ruby}Shorthand for multiple flags#{@cX.off} -  +          #{@cX.ruby}--update#{@cX.off}  #{@cX.green}[filename/wildcard]#{@cX.off} Checks  existing file output and runs the flags required to update this output. This means that if only html and pdf output  was  requested  on previous  runs, only the -hp files will be applied, and only these will be generated this time, together with the summary.  This  can  be  very convenient, if you offer different outputs of different files, and just want to do the same again.         #{@cX.ruby}-1#{@cX.off} to #{@cX.ruby}-5#{@cX.off} #{@cX.green}[filename or wildcard]#{@cX.off} @@ -347,7 +347,7 @@ WOK        print <<WOK   #{@cX.ruby}Command flag modifiers#{@cX.off} -  +    #{@cX.ruby}--no-ocn#{@cX.off} [with -h -H or -p] switches off object citation numbering. Produce  output without identifying numbers in margins of html or LaTeX/pdf output.    #{@cX.ruby}--no-annotate#{@cX.off} strips output text of editor endnotes~[* square brackets ]~ denoted by asterisk or dagger/plus sign @@ -363,11 +363,11 @@ WOK    #{@cX.cyan}misc#{@cX.off}    #{@cX.green}-s#{@cX.off} [filename or wildcard]          #{@cX.green}spellcheck#{@cX.off} (aspell previously ispell    \t#{@cX.green}mailer examples#{@cX.off} -  from vim mail.er10 (not gvim) issue command  +  from vim mail.er10 (not gvim) issue command    \t:! ruby -S mailer.rb instruction/landscape|a4l|portrait|a4p/ email@address/alias subject line    \t:! ruby -S mailer.rb a4l ralph@amissah.com testing continues    from vim mail.er10 use your vim alias \\mail or \\mutt (modify command line as required) -  #{@cX.green}feeds rss/rdf#{@cX.off}  +  #{@cX.green}feeds rss/rdf#{@cX.off}    #{@cX.blue}-R #{@cX.off} (yaml|rss)  extraction of semantic data into yaml file for auto build of xml feeds (rss, rdf) #{@cX.fuschia}[work area]#{@cX.off}    #{@cX.green}-R #{@cX.off} yaml  extraction of semantic data into yaml file for auto build of xml feeds (rss, rdf)    #{@cX.green}-R #{@cX.off} rss   creates rss2.0 feed @@ -422,13 +422,13 @@ sisu      #{@cX.green}{#{@cX.off} SiSU Geek Writer #{@cX.green}}#{@cX.off}http://www.jus.uio.no/sisu/                   url example      #{@cX.green}{#{@cX.off}tux.png 64#{@cX.green}x#{@cX.off}80 "a better way" #{@cX.green}}#{@cX.off}http://www.jus.uio.no/sisu/    image example with all options (width x height)      Note: png and jpg support only (no gif support) -  +    shortcut - hyper-linked text with endnote providing the url information      #{@cX.green}{~^#{@cX.off} [text to link] #{@cX.green}}#{@cX.off}http://url.org         maps to   #{@cX.green}{#{@cX.off} [text to link] #{@cX.green}}#{@cX.off}http://url.org #{@cX.green}~{#{@cX.off} http://url.org #{@cX.green}}~#{@cX.off}       produces hyper-linked text within a document/paragraph, with an endnote providing the url for the text location used in the hyperlink    shortcut: -    #{@cX.green}{#{@cX.off} [text to link] #{@cX.green}[3sS]}#{@cX.off}markup_source_filename.sst  +    #{@cX.green}{#{@cX.off} [text to link] #{@cX.green}[3sS]}#{@cX.off}markup_source_filename.sst      if  a  server host name has been provided/configured, will provide a list of available output types that would be generated using the shortcut command and the markup file provided, i.e. output generated using the command (as configured):         "sisu -3sS markup_source_filename.sst"      using server host, directory stub, filename to compose the link. @@ -445,8 +445,8 @@ sisu    Note: page breaks are usually introduced to pdfs either as header instructions, indicating that pages should break at given levels    ------------------------------------------    #{@cX.cyan}Composite documents#{@cX.off} -    It is possible to build a document by requiring other documents. The documents required may complete documents that could be generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other documents), by convention it should be named with the suffix .ssc or .ssm The documents called if complete documents would have the suffix .sst, [.ssf, or .ssd], and if markup snippets .ssi. A temporary file of the composite document is built prior to processing with the same prefix and the suffix ._sst There are a number of alternative syntaxes for requiring external documents in order to permit use of ascii hypertext linking available in the vim editor. They are as follows (place at start of line):   -  +    It is possible to build a document by requiring other documents. The documents required may complete documents that could be generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built mainly from other documents), by convention it should be named with the suffix .ssc or .ssm The documents called if complete documents would have the suffix .sst, [.ssf, or .ssd], and if markup snippets .ssi. A temporary file of the composite document is built prior to processing with the same prefix and the suffix ._sst There are a number of alternative syntaxes for requiring external documents in order to permit use of ascii hypertext linking available in the vim editor. They are as follows (place at start of line): +      #{@cX.cyan}#basic sisu markup alternatives#{@cX.off}        #{@cX.green}{#{@cX.off}filename.si#{@cX.green}}require#{@cX.off}        #{@cX.green}<< {#{@cX.off}filename.si#{@cX.green}}#{@cX.off} @@ -467,10 +467,10 @@ sisu    ------------------------------------------    #{@cX.green}%#{@cX.off}#{@cX.off}       add a comment to text, that will be removed prior to processing (place marker at beginning of line) -  #{@cX.green}\\#{@cX.off}#{@cX.off}       escape a sepcial character, whether general: { } < > or contextual special characters, (in combination with  other  characters) ~  - _ / % ^ and occasionally ! # + ,  +  #{@cX.green}\\#{@cX.off}#{@cX.off}       escape a sepcial character, whether general: { } < > or contextual special characters, (in combination with  other  characters) ~  - _ / % ^ and occasionally ! # + ,    #{@cX.green}%%#{@cX.off}#{@cX.off}      same as above but recognised by vim folds for placing fold in document text, in addition to headers and headings    ------------------------------------------ -   +    #{@cX.ruby}More HELP on Markup#{@cX.off} markup help is available on:      document wide instructions: headers (document structure)      general text markup: headings; endnotes; tables (which also includes a note on preformatted text) @@ -494,9 +494,9 @@ WOK  0~creator Ralph Amissah -0~date  +0~date -0~markup num_top=4  +0~markup num_top=4  0~bold [regular expression of words/phrases to be made bold] @@ -505,9 +505,9 @@ WOK  0~links { SiSU }http://www.jus.uio.no/sisu { FSF }http://www.fsf.org  1~ A Sample Document -   -2~ just for fun  -     + +2~ just for fun +  4~ This is Chapter One or Article One  Ordinary Text follows here. The Title would be a Chapter or Article depending on the type of document you were working to produce. @@ -516,13 +516,13 @@ Ordinary Text follows here. The Title would be a Chapter or Article depending on  And so on. -Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .sst if saved as example.sst, by typing sisu -mhwxp example.sst while in the directory in which the file is saved.  +Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .sst if saved as example.sst, by typing sisu -mhwxp example.sst while in the directory in which the file is saved.  _1 -m initial processing, -h html (css based), -w concordance for html, -x xml, -p pdf output, generated via latex, there are of course additional options  _1 for a listing type: sisu ~ commands -_1 for an outline of sisu markup type: sisu ~ markup  +_1 for an outline of sisu markup type: sisu ~ markup  The example ends here.  WOK @@ -538,9 +538,9 @@ WOK  @creator: Ralph Amissah -@date:  +@date: -@markup: num_top=4  +@markup: num_top=4  @bold: [regular expression of words/phrases to be made bold] @@ -549,9 +549,9 @@ WOK  @links: { SiSU }http://www.jus.uio.no/sisu { FSF }http://www.fsf.org  :A~ A Sample Document -   -:B~ just for fun  -     + +:B~ just for fun +  1~ This is Chapter One or Article One  Ordinary Text follows here. The Title would be a Chapter or Article depending on the type of document you were working to produce. @@ -560,13 +560,13 @@ Ordinary Text follows here. The Title would be a Chapter or Article depending on  And so on. -Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .sst if saved as example.sst, by typing sisu -mhwxp example.sst while in the directory in which the file is saved.  +Assuming sisu is configured properly so it has been instructed where to put the work files and ouput files, you would generate this text once saved, with the suffix .sst if saved as example.sst, by typing sisu -mhwxp example.sst while in the directory in which the file is saved.  _1 -m initial processing, -h html (css based), -w concordance for html, -x xml, -p pdf output, generated via latex, there are of course additional options  _1 for a listing type: sisu ~ commands -_1 for an outline of sisu markup type: sisu ~ markup  +_1 for an outline of sisu markup type: sisu ~ markup  The example ends here.  WOK @@ -591,11 +591,11 @@ This is a sample header (#{@cX.fuschia}Dublin Core in fuschia,#{@cX.off} #{@cX.c  #{@cX.fuschia}@subject:#{@cX.off} (whatever your subject) -#{@cX.fuschia}@description:#{@cX.off}  +#{@cX.fuschia}@description:#{@cX.off} -#{@cX.fuschia}@publisher:#{@cX.off}  +#{@cX.fuschia}@publisher:#{@cX.off} -#{@cX.fuschia}@contributor:#{@cX.off}  +#{@cX.fuschia}@contributor:#{@cX.off}  #{@cX.fuschia}@translator:#{@cX.off} [or ~translated_by] @@ -650,13 +650,13 @@ This is a sample header (#{@cX.fuschia}Dublin Core in fuschia,#{@cX.off} #{@cX.c   structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^)   can be used within text instead, without this header tag, and may be used to suppliment the instructions provided in this header tag if provided -#{@cX.ruby}@level:#{@cX.off} newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage]  +#{@cX.ruby}@level:#{@cX.off} newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage]  #{@cX.ruby}@markup:#{@cX.off} num_top=4 [various markup instructions, eg: num_top=4 headings tobe numbered, starting at heading level 4... the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level] -#{@cX.ruby}@bold:#{@cX.off} [list of words to make bold with semi colon separator]  +#{@cX.ruby}@bold:#{@cX.off} [list of words to make bold with semi colon separator] -#{@cX.ruby}@italics:#{@cX.off} [list of words to italize with semi colon separator]  +#{@cX.ruby}@italics:#{@cX.off} [list of words to italize with semi colon separator]  #{@cX.ruby}@vocabulary:#{@cX.off} name of taxonomy/vocabulary/wordlist to use against document @@ -704,11 +704,11 @@ This is a sample header (#{@cX.fuschia}Dublin Core in fuschia,#{@cX.off} #{@cX.c  #{@cX.green}0~#{@cX.off}#{@cX.fuschia}subject#{@cX.off} (whatever your subject) -#{@cX.green}0~#{@cX.off}#{@cX.fuschia}description#{@cX.off}  +#{@cX.green}0~#{@cX.off}#{@cX.fuschia}description#{@cX.off} -#{@cX.green}0~#{@cX.off}#{@cX.fuschia}publisher#{@cX.off}  +#{@cX.green}0~#{@cX.off}#{@cX.fuschia}publisher#{@cX.off} -#{@cX.green}0~#{@cX.off}#{@cX.fuschia}contributor#{@cX.off}  +#{@cX.green}0~#{@cX.off}#{@cX.fuschia}contributor#{@cX.off}  #{@cX.green}0~#{@cX.off}#{@cX.fuschia}translator#{@cX.off} [or ~translated_by] @@ -761,13 +761,13 @@ This is a sample header (#{@cX.fuschia}Dublin Core in fuschia,#{@cX.off} #{@cX.c  optional, where document structure can be defined by a match words or regular expression (the regular expression is assumed to start at the beginning of a line of text i.e. ^)  default markers 1~ to 6~ can be used within text instead, without this header tag, and may be used to suppliment the instructions provided in this header tag if provided -#{@cX.green}0~#{@cX.off}#{@cX.ruby}level#{@cX.off} newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage]  +#{@cX.green}0~#{@cX.off}#{@cX.ruby}level#{@cX.off} newpage=3; breakpage=4 [paragraph level, used by latex to breakpages, the page is optional eg. in newpage]  #{@cX.green}0~#{@cX.off}#{@cX.ruby}markup#{@cX.off} num_top=4 [various markup instructions, eg: num_top=4 headings tobe numbered, starting at heading level 4... the default is to provide 3 levels, as in 1 level 4, 1.1 level 5, 1.1.1 level 6, markup to be merged within level] -#{@cX.green}0~#{@cX.off}#{@cX.ruby}bold#{@cX.off} [list of words to make bold with semi colon separator]  +#{@cX.green}0~#{@cX.off}#{@cX.ruby}bold#{@cX.off} [list of words to make bold with semi colon separator] -#{@cX.green}0~#{@cX.off}#{@cX.ruby}italics#{@cX.off} [list of words to italize with semi colon separator]  +#{@cX.green}0~#{@cX.off}#{@cX.ruby}italics#{@cX.off} [list of words to italize with semi colon separator]  #{@cX.green}0~#{@cX.off}#{@cX.ruby}vocabulary#{@cX.off} name of taxonomy/vocabulary/wordlist to use against document @@ -802,11 +802,11 @@ WOK          skins are placed in a configuration directory beneath the markup directory ./_sisu/skin/doc or in ~/.sisu/skin/doc          if a skin is also to be used for a directory or site wide presentations, rather than being called for a single document then a softlink is placed from ~/.sisu/skin/dir or ~/.sisu/skin/site respectively to the relevant skin within ~/.sisu/skin/doc -         +          rules for skin loading are in #{@cX.green}sysenv.rb#{@cX.off}          the skin loading heuristics / hierarchy is currently as follows: -          a. if there is a skin requested within a document, thent that skin is used  +          a. if there is a skin requested within a document, thent that skin is used              0~skin skin_lm (would load skin ~/.sisu/skin/doc/skin_lm.rb)            b. use it if there is a "dir" skin with the same name as the source directory "stub" i.e. @@ -816,9 +816,9 @@ WOK            x. [additionally though discouraged a special rule can be set up in sysenv  AddSkin.select (which could override b if desired)]          #{@cX.green}skin_site_#{@cX.off}#{@cX.cyan}[name of site skin in use]#{@cX.off}#{@cX.green}.rb#{@cX.off}  this file is called by skin.rb -          if there are several such files, site appearance may be changed by  +          if there are several such files, site appearance may be changed by            requesting the skin_site desired from skin.rb -    and  +    and      #{@cX.blue}(ii)#{@cX.off} presentation maintenance:            if you have a body of documents the easiest way to give them a particular appearance/skin, is to associate that directory with a skin, all files in that directory take on the specified appearance, changing appearance of documents once directories are set up is as simple as copying the files from one directory to another (or renaming the directory); or associating the directory with a different skin. @@ -842,7 +842,7 @@ WOK  If you have problems check permissions (and if in home directory ownership). -#{@cX.green}directory paths as currently set#{@cX.off}:       +#{@cX.green}directory paths as currently set#{@cX.off}:    output docs:                 #{@cX.blue}#{@env.path.webserv}#{@cX.off}    cgi scripts:                 #{@cX.blue}#{@env.path.cgi}#{@cX.off}    processing:                  #{@cX.blue}#{@env.path.processing}#{@cX.off} @@ -861,7 +861,7 @@ If you have problems check permissions (and if in home directory ownership).     under the home directory ~/.sisu:             #{@cX.blue}#{@env.path.home}/.sisu/sisurc.yml#{@cX.off}     in the "/etc" directory:                      #{@cX.blue}#{@env.path.etc}/sisurc.yml#{@cX.off}     default file paths are set by the program SiSU -   +   #{@cX.green}skins#{@cX.off} for document appearances on a site, directory or per document basis are located in subdirectories #{@cX.blue}doc/#{@cX.off}  #{@cX.blue}dir/#{@cX.off} and #{@cX.blue}site/#{@cX.off} within:     #{@cX.blue}#{Dir.pwd}/_sisu/skin#{@cX.off}     #{@cX.blue}#{@env.path.home}/.sisu/skin#{@cX.off} @@ -874,7 +874,7 @@ If you have problems check permissions (and if in home directory ownership).          the output files will be placed in a sub-directory named after the processed text within #{@cX.blue}#{@env.path.webserv}/ebook#{@cX.off}     ( Within this major sub-directory, a sub-directory is made with the name of each document processed, into which output files - html, pdf, xml, plaintext etc. are placed (texinfo being an exception at present) ) -    #{@cX.green}sisu -C#{@cX.off} [#{@cX.green}--init=site#{@cX.off}] configure/initialise shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used).  -C --init=site configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files  are updated if this modifier is used.  in a new markup document working directory should initialise the corresponding output directory, though SiSU will automatically do this, the first time it is run (for processing) in a given directory.   +    #{@cX.green}sisu -C#{@cX.off} [#{@cX.green}--init=site#{@cX.off}] configure/initialise shared output directory files initialize shared output directory (config files such as css and dtd files are not updated if they already exist unless modifier is used).  -C --init=site configure/initialise site more extensive than -C on its own, shared output directory files/force update, existing shared output config files such as css and dtd files  are updated if this modifier is used.  in a new markup document working directory should initialise the corresponding output directory, though SiSU will automatically do this, the first time it is run (for processing) in a given directory.     There are additional details, ... this should get you started. @@ -893,18 +893,18 @@ WOK      (a) #{@cX.green}data directories#{@cX.off}        the directories in which you place the SiSU marked-up data files that are to be processed -      there may be as many directories and files as you choose to have,  +      there may be as many directories and files as you choose to have,        you are currently in:                                    #{@cX.blue}#{Dir.pwd}#{@cX.off} -    (b) #{@cX.green}output directory#{@cX.off}      -      by default files in the data directory are output to  +    (b) #{@cX.green}output directory#{@cX.off} +      by default files in the data directory are output to        a sub-directory within the output directory (usually the web document directory), or to an sql database        of the same name as the stub or last portion of the data directory name -      by way of example  +      by way of example        you are currently in:                                    #{@cX.blue}#{Dir.pwd}#{@cX.off}        the document output directory is set to:                 #{@cX.blue}#{@env.path.webserv}#{@cX.off}        documents from your current directory will be placed in: #{@cX.blue}#{@env.path.output}#{@cX.off} -     +        the final output is placed in subdirectories either as configured by default in the program or as modified by SiSU configuration files        subdirectories are created within the main output directory, based on the name of the data directory        subsubdirectories are created the sub-directory contained in the main output directory based on the name of the file @@ -918,10 +918,10 @@ WOK          a document in the current directory  #{@cX.blue}#{Dir.pwd}#{@cX.off}              will have its output placed in:  #{@cX.blue}#{@env.path.output}/#@output_stub#{@cX.off} -      NB: the verbose flag v included in the generate command string, should  +      NB: the verbose flag v included in the generate command string, should        result in a list of output filenames together with their paths. -      The flag U on its own (e.g. sisu -U gpl2.fsf.sst) should provide a list  -      of output files that could be generated together with their paths.  +      The flag U on its own (e.g. sisu -U gpl2.fsf.sst) should provide a list +      of output files that could be generated together with their paths.      (c) #{@cX.green}configuration files#{@cX.off}         SiSU program defaults are set within the program, and may be adjusted in the yml file #{@cX.blue}sisurc.yml#{@cX.off} which is searched for in the following paths, which are prioritized as listed (the first one found is loaded): @@ -930,7 +930,7 @@ WOK         under the home directory ~/.sisu:             #{@cX.blue}#{@env.path.home}/.sisu/sisurc.yml#{@cX.off}         in the "/etc" directory:                      #{@cX.blue}#{@env.path.etc}/sisurc.yml#{@cX.off} -    (d) #{@cX.green}processing directories#{@cX.off}     sisu creates a number of processing directories,  +    (d) #{@cX.green}processing directories#{@cX.off}     sisu creates a number of processing directories,        where these should be located can be modified in #{@cX.green}~/.sisu/sisurc.yml#{@cX.off}        work directories include the following:            root working directory                               #{@cX.blue}#{@env.path.processing}#{@cX.off} @@ -942,26 +942,26 @@ WOK        These files are usually used only for processing and removed. There is a maintenance flag to keep them.      (e) #{@cX.green}images#{@cX.off} -      there are a number of categories of images,  +      there are a number of categories of images,        NB the document markup directory is initialised by issuing the command          sisu -C --init=site -      this creates the output sub-directory, and makes necessary image links, and  +      this creates the output sub-directory, and makes necessary image links, and        copies images specific to the markup directory if there are any. -       -      general images for the sisu program that come with the package,  + +      general images for the sisu program that come with the package,        that are the defaults used by sisu, these are installed with the program -      images that the author wishes to include within documents,  -      these should be placed in a sub-directory  +      images that the author wishes to include within documents, +      these should be placed in a sub-directory        within the current document markup directory called #{@cX.green}_sisu/sisu/image_local#{@cX.off}        if an instruction is given to process a remote document which contains        downloadable images, they are included in a sub-directory of the current        markup directory #{@cX.green}_sisu/sisu/image_external#{@cX.off} that is created        if necessary for the purpose. -     +        finally skins may specify/indicate other image directories. see sisu --help skin -      any site images required by the skin instruction must be copied in to the  +      any site images required by the skin instruction must be copied in to the        site image directory (it may be necessary to do manual configuration depending        on what you are trying to achieve). @@ -975,7 +975,7 @@ WOK        help_env      end      def program_found?(program) -      rc=if SiSU_Env::Info_settings.new.program?(program)  +      rc=if SiSU_Env::Info_settings.new.program?(program)          "rc: #{SiSU_Env::Info_settings.new.program?(program)}  "        else ''        end @@ -1027,13 +1027,13 @@ WOK    odf viewer:                                    #{@cX.blue}#{@env.program.odf_viewer}#{@cX.off}                                                    (default selections can be changed in sisurc.yml under program_select:)    #{@cX.green}programs used if available#{@cX.off} -  word count:                                    #{@cX.blue}#{@env.program.wc}#{@cX.off}  #{program_found?(@env.program.wc)}   -  imagemagick/rmagick:                           #{program_found?('rmagick')}  -  tidy:                                          #{@cX.blue}#{@env.program.tidy}#{@cX.off}  #{program_found?(@env.program.tidy)}   -  rexml:                                         #{@cX.blue}#{@env.program.rexml}#{@cX.off}  #{program_found?(@env.program.rexml)}   -  latex to pdf:                                  #{@cX.blue}#{@env.program.pdflatex}#{@cX.off}  #{program_found?(@env.program.pdflatex)}   -  postgresql:                                    #{@cX.blue}#{@env.program.postgresql}#{@cX.off}  #{program_found?(@env.program.postgresql)}   -  sqlite:                                        #{@cX.blue}#{@env.program.sqlite}#{@cX.off}  #{program_found?(@env.program.sqlite)}   +  word count:                                    #{@cX.blue}#{@env.program.wc}#{@cX.off}  #{program_found?(@env.program.wc)} +  imagemagick/rmagick:                           #{program_found?('rmagick')} +  tidy:                                          #{@cX.blue}#{@env.program.tidy}#{@cX.off}  #{program_found?(@env.program.tidy)} +  rexml:                                         #{@cX.blue}#{@env.program.rexml}#{@cX.off}  #{program_found?(@env.program.rexml)} +  latex to pdf:                                  #{@cX.blue}#{@env.program.pdflatex}#{@cX.off}  #{program_found?(@env.program.pdflatex)} +  postgresql:                                    #{@cX.blue}#{@env.program.postgresql}#{@cX.off}  #{program_found?(@env.program.postgresql)} +  sqlite:                                        #{@cX.blue}#{@env.program.sqlite}#{@cX.off}  #{program_found?(@env.program.sqlite)}                                                    (these can be turned off if unavailable in sisurc.yaml under program_set:)    #{@cX.green}processing shortcut defaults set to:#{@cX.off}    color defaut set (on==true)                    #{@cX.blue}#{cf_defaults.color}#{@cX.off} @@ -1046,7 +1046,7 @@ WOK                                                    (defaults may be changed in active sisurc.yml file under flag:)    #{@cX.green}special powers, risky operations set:#{@cX.off}    zap (delete output directories)                #{@cX.blue}#{SiSU_Env::Info_settings.new.permission?('zap')}#{@cX.off} -  css copy (copy over css files)                 #{@cX.blue}#{SiSU_Env::Info_settings.new.permission?('css_modify')}#{@cX.off}  +  css copy (copy over css files)                 #{@cX.blue}#{SiSU_Env::Info_settings.new.permission?('css_modify')}#{@cX.off}                                                    (true/false defaults may be changed in active sisurc.yml file under permissions_set:)  WOK  print x @@ -1055,7 +1055,7 @@ print x      print <<WOK  @title: -@subtitle: [is added to title for purposes of Dublin Core description]  +@subtitle: [is added to title for purposes of Dublin Core description]  @creator: @@ -1110,9 +1110,9 @@ Heading tags take either of the forms above, ranging from 1-6  They appear at the beginning of the line on which a heading appears,  the number indicates the level of the heading with level 1 being a title, -segments (in html output) are by default created on level 4  -(segmented text is split/segmented on level 4, and  -assigned a file name automatically according to the title number,  +segments (in html output) are by default created on level 4 +(segmented text is split/segmented on level 4, and +assigned a file name automatically according to the title number,  unless you explicitly specify otherwise)  eg. @@ -1129,7 +1129,7 @@ eg.  5~ Heading -6~ sub-heading  +6~ sub-heading  in the 0.38 notation this maps to: @@ -1145,20 +1145,20 @@ in the 0.38 notation this maps to:  2~ Heading -3~ sub-heading  +3~ sub-heading  (a conversion script provided in sisu-examples, modify.rb makes conversion between 0.37 and 0.38 markup simple)  Normal text would follow each heading level as appropriate, though it is most usual to start with ordinary writing beneath level 4 as it is at this level that segments are created. -Automatic numbering of paragraphs is usually set to start at level 4 trough level 6 and takes the form 1. then 1.1 then 1.1.1 this being given as a Header tag 0~ There may be up to 6 levels in a document,  +Automatic numbering of paragraphs is usually set to start at level 4 trough level 6 and takes the form 1. then 1.1 then 1.1.1 this being given as a Header tag 0~ There may be up to 6 levels in a document, -If auto-numbering is on, then for html output the segments created  (on level 4 headings) are automatically assigned the name of the title number.  +If auto-numbering is on, then for html output the segments created  (on level 4 headings) are automatically assigned the name of the title number.  However, you may indicate an alternative set of key/title words, with one of the following instructions:  4~filename This is a Section or Subject Heading -If there is a strictly discernable word appearing at the beginning of the line in a document that identifies the level,  -the words can be used to identify the levels in a header tag:  +If there is a strictly discernable word appearing at the beginning of the line in a document that identifies the level, +the words can be used to identify the levels in a header tag:  0~toc Part; Chapter; Section; Article; none; none  instead of providing individual heading tags @@ -1187,15 +1187,15 @@ WOK      puts <<WOK      Multi-language Document File Naming and Directory Mapping -     +      If the same document exists in different language versions, and it is desired that the published language versions should reside in the same output directory, the following filenaming convention should be observed, using Spannish as the sample language code (es) [it is very likley the use of country codes as language codes will be changed or extended in future] [filename]~[language code].sst    filename~es.sst -  within sisurc.yml under the heading  +  within sisurc.yml under the heading      default:        language file: [at 1, 2 or 3] -       +    determines the output filenaming convention used, as follows:      (1) [output directory path]/filename/es.index.html @@ -1295,11 +1295,11 @@ WOK        print <<WOK        #{@cX.ruby}DATED NOT CURRENT - IGNORE#{@cX.off} -     +      This file is to contain some information the different programs that form sisu:        their inter-relationship (for which see sisu-chart.pdf) -     +      and        what they do @@ -1309,13 +1309,13 @@ WOK        ~/.sisu\tconfiguration directory, contains sisu configuration, and skins for alternative appearances        param\tgathers parameters from the sourcefile, when called by metaverse parameters are saved to pstore file        sysenv\tgets system information, and builds directory structure -       +        init\tintialised defaults for appearance        skin\tsite wide skin        format\tformatting instructions assosciated with and used by calling module -       +        metaverse\tinitial processing stage, preliminary file on which subsequent processing is done is created [-m] -       +        plaintext\tplaintext creating module [-a]        html\thtml creating modules [-h]        texpdf\tlatex and pdf creating modules [-p] @@ -1335,7 +1335,7 @@ WOK                                                                   #% system configuration        print <<WOK    #{@cX.green}Install SiSU#{@cX.off} -   +    SiSU does require setup, the file sisu is placed in the equivalent of #{@cX.blue}/usr/bin#{@cX.off} or #{@cX.blue}/usr/local/bin#{@cX.off} and the REWRITE files where ruby libraries are kept, on my debian system #{@cX.blue}/usr/local/lib/site_ruby/1.8#{@cX.off}    For information on download and installation, see #{@cX.blue}http://www.jus.uio.no/sisu/sisu_download/download#{@cX.off} or #{@cX.blue}http://www.jus.uio.no/sisu/SiSU/download#{@cX.off} @@ -1345,7 +1345,7 @@ WOK    Host      host:             #{@cX.blue}#{@env.hostname}#{@cX.off}      arch:             #{@cX.blue}#{@env.arch}#{@cX.off} -    +    Directories for installation      bin:                                          #{@cX.blue}[FIX]#{@cX.off}      lib (site-ruby):                              #{@cX.blue}#{Config::CONFIG['sitelibdir']}/#{SiSU_lib}#{@cX.off} @@ -1372,7 +1372,7 @@ WOK    Again, refer to '#{@cX.blue}man 8 sisu#{@cX.off}'    For additional help on using SiSU once installed type: -     +      sisu --help  WOK @@ -1382,7 +1382,7 @@ WOK        [provide some setup information] -      also see http://www.jus.uio.no/sisu/SiSU   +      also see http://www.jus.uio.no/sisu/SiSU  WOK      end @@ -1395,20 +1395,20 @@ WOK    #{@cX.green}termsheet.rb#{@cX.off} files:    (i) are named after the facility    (ii) contain instructions as to which standard forms to use for the agreement (standard_form.rb) -     there may be several, eg. the termsheet, and the resulting:  +     there may be several, eg. the termsheet, and the resulting:       main agreement; collection account charge; and deed of assignment -  (iii) contain the variable terms of the agreement, borrower, interest etc.  +  (iii) contain the variable terms of the agreement, borrower, interest etc. -  for a new loan agreement fill out a new termsheet specifying  -  what standard forms are to be used,  +  for a new loan agreement fill out a new termsheet specifying +  what standard forms are to be used,    and the terms of the agreement.    #{@cX.green}standard_form.rb#{@cX.off} files:    contain the standard terms of the agreement -  there is a standard form for each variation of agreement  +  there is a standard form for each variation of agreement      (so eg. there are as many facility agreements as there are variations in standard facility)    these may be prepared for any agreement that is to be reused. -  (preparation takes the form of formating and  +  (preparation takes the form of formating and    placing variable holders for the variables that are to be provided by the termsheet.rb file)    it is necessary to purge the directory ~facilityData when old files are removed @@ -1417,7 +1417,7 @@ WOK      end      def help_commands        print <<WOK -     +      also see:        sisu --help commands        man sisu @@ -1425,7 +1425,7 @@ WOK      end      def help_env        print <<WOK -     +      for sisu environment information see:        sisu --help env  WOK @@ -1458,7 +1458,7 @@ WOK        end      def convert        print <<WOK -     +        for information on the markup version used within a sisu markup file:          sisu --inspect [filename] @@ -1469,7 +1469,7 @@ WOK        convert an sst file with footnotes following text to (preferred) inline footnotes          sisu --convert-footnotes  [filename/wildcard] -         +        to convert from sst to simple xml representations (sax, dom and node):          sisu --to-sax [filename/wildcard]          sisu --to-sxs [filename/wildcard] @@ -1491,50 +1491,50 @@ WOK      end      def dal        print <<WOK -     +      sisu -m [filename/wildcard]    creates the metaverse, used by all other modules for downstream processing  WOK        help_commands      end      def utf8        print <<WOK -       +        documents prepared for sisu processing should be stored in utf8  WOK      end      def plaintext        print <<WOK -     +      sisu -A [filename/wildcard]    plaintext with dos linefeeds (footnotes follow paragraphs)      sisu -a [filename/wildcard]    plaintext with Unix linefeeds (footnotes follow paragraphs) -     +      sisu -E [filename/wildcard]    plaintext with dos linefeeds (endnotes follow document)      sisu -e [filename/wildcard]    plaintext with Unix linefeeds (endnotes follow document) -    sisu -ho [filename/wildcard]   exclude ocn, object numbers  +    sisu -ho [filename/wildcard]   exclude ocn, object numbers  WOK        help_commands      end      def html        print <<WOK -     +      sisu -h [filename/wildcard]    html document type suffixes included      sisu -H [filename/wildcard]    html without document type suffixes -    sisu -ho [filename/wildcard]   exclude ocn, object numbers  +    sisu -ho [filename/wildcard]   exclude ocn, object numbers  WOK        help_commands      end      def xhtml        print <<WOK -     +      sisu -b [filename/wildcard]    xhtml document  WOK        help_commands      end      def xml        print <<WOK -     +      sisu -x [filename/wildcard]    xml document (sax type parsing)      sisu -X [filename/wildcard]    xml document (dom type parsing) @@ -1544,14 +1544,14 @@ WOK      end      def odf        print <<WOK -     +      sisu -o [filename/wildcard]    odt document, (odf open document format)  WOK        help_commands      end      def php        print <<WOK -     +      not supported      [php output has been removed]  WOK @@ -1559,14 +1559,14 @@ WOK      end      def pdf        print <<WOK -     +      sisu -p [filename/wildcard]     produces pdf files from LaTeX output  WOK        help_commands      end      def latex        print <<WOK -     +      sisu -p [filename/wildcard]     produces pdf files from LaTeX output  WOK        help_commands @@ -1583,14 +1583,14 @@ WOK      pinfo, requires you to be within the work/output directory        cd [work/output directory] -    and then to point at the file using  +    and then to point at the file using        pinfo ./[filename]  WOK        help_commands      end      def lout        print <<WOK -     +      sisu -l [filename/wildcard]      not currently supported, revisit someday? @@ -1599,7 +1599,7 @@ WOK      end      def concordance        print <<WOK -     +      sisu -W        starts the sisu webrick server, default port 8081  WOK        help_commands @@ -1607,7 +1607,7 @@ WOK      def help_search        print <<WOK -      SiSU searches,  +      SiSU searches,        depending on how you wish to implement search,        the following may bre of interest:          sisu --help sql @@ -1624,7 +1624,7 @@ WOK        sisu -F --webserv=webrick  generates a sample search form for use with the webrick server        sisu -Fv               as above, and provides some information on setting up hyperestraier        sisu -W                starts the webrick server -       +        the generated search form must be copied to the webserver directory as instructed  WOK        help_search @@ -1632,9 +1632,9 @@ WOK      end      def sql        print <<WOK -     +      Mappings to two databases are provided by default, -    postgresql and sqlite,  +    postgresql and sqlite,      the same commands are used within sisu to construct and populate databases      however -d (lowercase) denotes sqlite and -D (uppercase) denotes postgresql      the examples here will used -d (lowercase) @@ -1670,7 +1670,7 @@ WOK      end      def webrick        print <<WOK -     +      sisu -W        starts the sisu webrick server, default port 8081  WOK        help_commands @@ -1678,7 +1678,7 @@ WOK      def hyperestraier        out_dir='(' + `ls #{@env.path.webserv}`.split("\n").join('|') + ')'        print <<WOK -   See the documentation for hyperestraier       +   See the documentation for hyperestraier     #{@cX.blue}     http://hyperestraier.sourceforge.net/     http://hyperestraier.sourceforge.net/intro-en.html @@ -1710,8 +1710,8 @@ WOK       as sisu duplicates output in multiple file formats,       it it is probably preferable to limit the estraier index -     to html output, and as it may also be desireable to  -     exclude files 'doc.html' and 'concordance.html', as these  +     to html output, and as it may also be desireable to +     exclude files 'doc.html' and 'concordance.html', as these       duplicate information held in other html output e.g. #{@cX.green}       find /home/ralph/sisu_www -type f | egrep '/sisu_www/(sisu|bookmarks)/.+?\.html$' | egrep -v '(doc|concordance)\.html$' |estcmd gather -sd casket - #{@cX.off} @@ -1723,7 +1723,7 @@ WOK   (B) to set up the search form     (i) copy #{@cX.green}estseek.cgi#{@cX.off} to your cgi directory and set file permissions to 755: #{@cX.green} -     sudo cp -vi /usr/lib/estraier/estseek.cgi /usr/lib/cgi-bin  +     sudo cp -vi /usr/lib/estraier/estseek.cgi /usr/lib/cgi-bin       sudo chmod -v 755 /usr/lib/cgi-bin/estseek.cgi       sudo cp -v /usr/share/hyperestraier/estseek.* /usr/lib/cgi-bin #{@cX.off}       [see estraier documentation for paths] @@ -1763,7 +1763,7 @@ WOK      def sitemap        print <<WOK -      SiSU sitemaps,  +      SiSU sitemaps,        an experimental feature (following g,y,m announcement to use them this week)          sisu -Y [filename/wildcard]        it may be necessary run -m first (generate the the metaverse) @@ -1774,13 +1774,13 @@ WOK  WOK      end      def license -       +        print <<WOK  * License: GPL 2 or later    #{@cX.ruby}GPL2 summary#{@cX.off}: -   +    This program is free software; you can redistribute it and/or modify it    under the terms of the GNU General Public License      #{@cX.blue}http://www.gnu.org/copyleft/gpl.html#{@cX.off} @@ -1788,16 +1788,16 @@ WOK      #{@cX.blue}http://www.gnu.org/fsf/fsf.html#{@cX.off}    either version 2 of the License, or (at your option)    any later version. -   +    This program is distributed in the hope that it will be useful, but WITHOUT    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for    more details. -   +    You should have received a copy of the GNU General Public License along    with this program; if not, write to the Free Software Foundation, Inc.,    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -   +    If you have Internet connection, the latest version of the GPL should be    available at these locations:      #{@cX.blue}http://www.fsf.org/licenses/gpl.html#{@cX.off} @@ -1872,12 +1872,12 @@ WOK      end      def scratch        print <<WOK -Types of tag,  +Types of tag,  then there are various tags which occur within the document. -Structural tags, which consist of:  -  heading tags that identify headings within text, and;  -  footnote/endnote tags ...  +Structural tags, which consist of: +  heading tags that identify headings within text, and; +  footnote/endnote tags ...  Markup instructions: giving information as to what is to be done to the presentation of the text @@ -1889,7 +1889,7 @@ _1 at the beginning of a line indents the paragraph  _2 at the beginning of a line double indents the paragraph -Others include  +Others include  Other things to note: diff --git a/lib/sisu/0.52/html.rb b/lib/sisu/v0/html.rb index cb6718d3..1d9491dd 100644 --- a/lib/sisu/0.52/html.rb +++ b/lib/sisu/v0/html.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,22 +48,22 @@  =end  module SiSU_HTML    require 'pstore' -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/html_table' -  require SiSU_lib + '/html_format_css' -  require SiSU_lib + '/html_segments' -  require SiSU_lib + '/html_scroll' -  require SiSU_lib + '/html_promo' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/html_table" +  require "#{SiSU_lib}/html_format_css" +  require "#{SiSU_lib}/html_segments" +  require "#{SiSU_lib}/html_scroll" +  require "#{SiSU_lib}/html_promo"    include SiSU_HTML_seg    include SiSU_HTML_Format_type    include SiSU_HTML_promo -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/html_tune' +  require "#{SiSU_lib}/html_tune"    include SiSU_Tune -  require SiSU_lib + '/dal' -  require SiSU_lib + '/shared_xml' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/shared_xml"    class Source      def initialize(opt)        @opt=opt @@ -97,10 +97,9 @@ module SiSU_HTML          end          scr_endnotes=SiSU_HTML::Source::Endnotes.new(data,@md).scroll unless @md.markup =~/url_png/          toc=SiSU_HTML::Source::Toc.new(data,@md).songsheet -        doc_ver=SiSU_HTML::Source::Links_guide.new(data,@md).doc_versions          links_guide=SiSU_HTML::Source::Links_guide.new(data,@md).toc          data=@tuned_file_array -        scr_toc=SiSU_HTML::Source::Scroll_head_and_segtoc.new(data,@md,toc,links_guide,doc_ver).in_common +        scr_toc=SiSU_HTML::Source::Scroll_head_and_segtoc.new(data,@md,toc,links_guide).in_common #watch          SiSU_HTML::Source::Seg.new(data,@md).songsheet #if not_scroll_only          data=@tuned_file_array          scr=SiSU_HTML::Source::Scroll.new(data,@md).songsheet @@ -109,8 +108,8 @@ module SiSU_HTML        rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error        ensure          unless @opt.cmd =~/[MV]/ #check maintenance flag -          texfiles = Dir["#{@env.path.tune}/#{@opt.fns}*"] -          texfiles.each do |f|  +          texfiles=Dir["#{@env.path.tune}/#{@opt.fns}*"] +          texfiles.each do |f|              if FileTest.file?(f)                File.unlink(f)              end @@ -137,15 +136,15 @@ module SiSU_HTML          end        end        def link_images -        @symlnk.images  +        @symlnk.images        end        def directories          my_make=SiSU_Env::Create_file.new(@md.cmd,@md.fns)          @path={ :root=>my_make.html_root }          title=File.basename(@md.fns,'.rb')          SiSU_Env::SiSU_file.new(@md).mkdir -      end   -      def tuned_file_instructions  +      end +      def tuned_file_instructions          @env=SiSU_Env::Info_env.new(@md.fns)          @tell=SiSU_Screen::Ansi.new(@md.cmd)          if @md @@ -176,7 +175,7 @@ module SiSU_HTML          else            SiSU_HTML_nav_tune::Tune.new(@file_array,@md).songsheet #no doc passed originally... 2004w35, revist changes in conditional 2006          end -        require SiSU_lib + '/param' +        require "#{SiSU_lib}/param"          @tuned_file_array        end      end @@ -195,9 +194,9 @@ module SiSU_HTML          if @para =~/^\d~.+?<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/            if @para[/^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m]              @format,segname,@text,@ocn=$1,$2,$3,$4 -            @format="#@format~#{segname}" #  +            @format="#@format~#{segname}" #            elsif @para[/^([1-6]~)\s+(\S.+?)<~(\d+);(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] -            @format,@text,@ocn=$1,$2,$3 #,$4 +            @format,@text,@ocn=$1,$2,$3            end          else            if @para[/^(?:_1\*|<:i[12]>\s*_\*)\s+(.+?)<~(\d+);(?:[ohu]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m] @@ -232,10 +231,6 @@ module SiSU_HTML        def initialize(data,md)          @data,@md=data,md        end -      def doc_versions -        format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) -        @doc_versions_toc=format_head_toc.document_versions_toc -      end        def toc          @links_guide_toc=[]          format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) @@ -282,8 +277,8 @@ module SiSU_HTML              if pg=~/~\[[\d+]+\s.+?\]\~/m                endnote_array << pg.scan(/~\[[\d+]+(.+?)\]\~/m)              end -            endnote_array.flatten.each do |note|  -              format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,note)  +            endnote_array.flatten.each do |note| +              format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,note)                @scr_endnotes << format_scroll.endnote_body              end            end @@ -315,7 +310,7 @@ module SiSU_HTML              when /^\s*1~(\S+)?/; Toc.new(para_toc,@md).level_1              when /^\s*2~(\S+)?/; Toc.new(para_toc,@md).level_2              when /^\s*3~(\S+)?/; Toc.new(para_toc,@md).level_3 -            when /^\s*4~(\S+)?/; Toc.new(para_toc,@md).level_4  +            when /^\s*4~(\S+)?/; Toc.new(para_toc,@md).level_4              when /^\s*5~(\S+)?/; Toc.new(para_toc,@md).level_5              when /^\s*6~(\S+)?/; Toc.new(para_toc,@md).level_6              when /^\s*4~!/;      Toc.new(para_toc).level_crosslink @@ -554,8 +549,8 @@ WOK        end      end      class Scroll_head_and_segtoc < Toc -      def initialize(data,md='',toc='',links_guide_toc='',doc_versions_toc='') -        @data,@md,@toc,@links_guide_toc,@doc_versions_toc=data,md,toc,links_guide_toc,doc_versions_toc +      def initialize(data,md='',toc='',links_guide_toc='') +        @data,@md,@toc,@links_guide_toc=data,md,toc,links_guide_toc          @env=SiSU_Env::Info_env.new(@md.fns)          @vz=SiSU_Env::Get_init.instance.skin        end @@ -573,7 +568,7 @@ WOK          @segtoc << format_head_toc.toc_head_escript if SiSU_HTML_Format_type::Head_toc.method_defined? :toc_head_escript          toc_shared << format_head_toc.scroll_head_navigation_band          if @md.dc_rights -          rights=format_head_toc.rights  +          rights=format_head_toc.rights            rights=SiSU_Tune::Clean_html.new(rights).clean          end          if @md.prefix_b @@ -615,13 +610,11 @@ WOK            @segtoc << tmp_head.dup          end          tmp_head=nil -        toc_shared << @doc_versions_toc          toc_shared << @links_guide_toc          toc_shared << rights if @md.dc_rights          toc_shared << prefix_b if @md.prefix_b          #Table of Contents added/appended here          toc_shared << @toc[:scr] -        @segtoc << @doc_versions_toc          @segtoc << @links_guide_toc          @segtoc << @toc[:seg]          @segtoc << rights if @md.dc_rights @@ -631,7 +624,8 @@ WOK          @segtoc << @seg_toc_band          ads=SiSU_HTML_promo::Ad.new(@md)          @segtoc << format_head_toc.seg_navigation_tail << ads.div.close << ads.display << format_head_toc.html_close -        Output.new(@segtoc.to_s,@md).segtoc +        @segtoc.flatten!.compact! +        Output.new(@segtoc,@md).segtoc          @segtoc=[]          @toc[:scr],@toc[:seg]=[],[]          toc_shared @@ -648,7 +642,7 @@ WOK        def publish          scroll=[]          scroll << @scr_toc << @scr_body << @scr_endnotes << @scr_metadata << @scr_owner_details << @scr_tails -        scroll.to_s +        scroll.flatten!.compact!        end      end      class Seg < SiSU_HTML_seg::Seg @@ -663,53 +657,40 @@ WOK        end        def scroll          begin -          @sisu=[] +          @filename_html_scroll=@my_make.file_html_scroll(@md)            @data.each do |para|              para.strip!              para.gsub!(/<:.+?>/,'') -            unless para =~/^\s*$/ -              para="#{para}\n"  -              @sisu << para +            unless para =~/\A\s*\Z/ +              @filename_html_scroll.puts para,"\n"              end            end -          @filename_html_scroll=@my_make.file_html_scroll(@md) -          new_file_data=@sisu.to_s -          @sisu=new_file_data.split(/\n\n/) -          @sisu.each {|para| @filename_html_scroll.puts para,"\n"}          rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error          end        end        def segtoc          begin -          @sisu=[] +          @filename_html_segtoc=@my_make.file_html_segtoc(@md) +          @filename_html_index=@my_make.file_html_index(@md)            @data.each do |para|              para.strip!              para.gsub!(/<!.+?!>|<~\d+;(?:[ohm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'') -            unless para =~/^\s*$/ -              para="#{para}\n" -              @sisu << para +            unless para =~/\A\s*\Z/ +              @filename_html_segtoc.puts para,"\n" +              @filename_html_index.puts para,"\n"              end            end -          new_file_data=@sisu.to_s -          @filename_html_segtoc=@my_make.file_html_segtoc(@md) -          @filename_html_index=@my_make.file_html_index(@md) -          @sisu=new_file_data.split(/\n\n/) -          @sisu.each {|para| @filename_html_segtoc.puts para,"\n"} -          @sisu.each {|para| @filename_html_index.puts para,"\n"}          rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error          end        end        def seg          begin -          @sisu=[]            @data.each do |para|              para.strip! -            unless para =~/^\s*$/; @sisu << para +            unless para =~/\A\s*\Z/ +              @newfile.puts para,"\n"              end            end -          new_file_data=@sisu.to_s -          @sisu=new_file_data.split(/\n\n/) -          @sisu.each {|para| @newfile.puts para,"\n"}          rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error          end        end diff --git a/lib/sisu/0.52/html_format.rb b/lib/sisu/v0/html_format.rb index 780b3253..73c97358 100644 --- a/lib/sisu/0.52/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_HTML_Format -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    class Paragraph_number @@ -148,7 +148,7 @@ module SiSU_HTML_Format      def toc_head_escript #embedded script in this case PHP        # %{<p>PHP or other embedded script for object persistence may go HERE</p>}      end -    def seg_head_escript #embedded script in this case PHP  +    def seg_head_escript #embedded script in this case PHP        # %{<p>PHP or other embedded script for object persistence may go HERE</p>}      end      def table_close @@ -309,7 +309,7 @@ WOK      def make_seg_scroll_pdf        wgt=Widget.new(@md)        scroll=%{<td align="center" bgcolor=#{@vz.color_band2} border="0"> -  #{@vz.nav_txt_doc_link}  +  #{@vz.nav_txt_doc_link}  </td>  }        %{<table summary="toc segment and scroll with pdf" border="0" cellpadding="3" cellspacing="0"> @@ -355,10 +355,7 @@ WOK    <a name="top" id="top"></a>    <a name="up" id="up"></a>    <a name="start" id="start"></a> -  #{@vz.js_top}}  -    end -    def document_versions_toc -      #document_version_hold +  #{@vz.js_top}}      end      def links_guide_vertical_open #???        url=(defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/ ? @vz.url_hp : @vz.url_home @@ -482,7 +479,7 @@ WOK        %{#{@vz.margin_txt_3}    #{@vz.paragraph_font_small}     #{manifest} -    </font>  +    </font>  #{@vz.table_close}}      end      def concordance #check structure @@ -490,7 +487,7 @@ WOK        %{#{@vz.margin_txt_3}    #{@vz.paragraph_font_small}     #{concord} -    </font>  +    </font>  #{@vz.table_close}}      end      def metadata @@ -636,7 +633,7 @@ WOK    #{@md.title*10}  </font>  </body> -</html>}  +</html>}      end    end    class Head_seg < Head_information @@ -647,7 +644,7 @@ WOK        %{#{doc_type}  <head>    <title> -    #{@seg_name_html[@seg_name_html_tracker]} -  +    #{@seg_name_html[@seg_name_html_tracker]} -      #{@md.html_title}    </title>  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> @@ -659,7 +656,7 @@ WOK  <a name="top" id="top"></a>  <a name="up" id="up"></a>  <a name="start" id="start"></a> -#{@vz.js_top}}  +#{@vz.js_top}}      end      def title_banner(title,subtitle,creator)      end @@ -722,7 +719,7 @@ WOK  #{toc}  #{nxt}  <td> -#{@vz.table_close}}  +#{@vz.table_close}}      end      def toc_next2        pre,nxt=false,true @@ -784,7 +781,7 @@ WOK    <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_next}>      #{@vz.png_nav_next}    </a> -#{@vz.table_close}}  +#{@vz.table_close}}      end      def toc_next3 #used with seg_doc_types in seg_nav_band #with pdf & other doc types #knxjs        %{<table summary="segment navigation next" border="0" cellpadding="3" cellspacing="0"> @@ -798,7 +795,7 @@ WOK    <a href="#{@md.fnl[:pre]}#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_next}>      #{@vz.png_nav_next}    </a> -#{@vz.table_close}}  +#{@vz.table_close}}      end      def toc_pre3 #used with seg_doc_types in seg_nav_band #with pdf and other doc types #knxjs      # note endnotes is now two back, with insertion between end of text and metadata, but what happens where no endnote? @@ -811,7 +808,7 @@ WOK    <a href="#{@md.fnl[:pre]}#@index#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" #{@vz.js_toc}>      #{@vz.png_nav_toc}    </a> -#{@vz.table_close}}  +#{@vz.table_close}}      end      def toc_endnote      end diff --git a/lib/sisu/0.52/html_format_css.rb b/lib/sisu/v0/html_format_css.rb index 4e519a41..641a1258 100644 --- a/lib/sisu/0.52/html_format_css.rb +++ b/lib/sisu/v0/html_format_css.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,8 +47,8 @@                    ralph.amissah@gmail.com  =end  module SiSU_HTML_Format_type -  require SiSU_lib + '/html_format' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/html_format" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    include SiSU_HTML_Format @@ -71,7 +71,7 @@ module SiSU_HTML_Format_type  <a name="top" id="top"></a>  <a name="up" id="up"></a>  <a name="start" id="start"></a> -#{@vz.js_top}}  +#{@vz.js_top}}      end      def concordance        if @md.concord_make @@ -105,7 +105,7 @@ module SiSU_HTML_Format_type        %{#{doc_type}  <head>    <title> -    #{@seg_name_html[@seg_name_html_tracker]} -  +    #{@seg_name_html[@seg_name_html_tracker]} -      #{@md.html_title}    </title>  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> @@ -117,7 +117,7 @@ module SiSU_HTML_Format_type  <a name="top" id="top"></a>  <a name="up" id="up"></a>  <a name="start" id="start"></a> -#{@vz.js_top}}  +#{@vz.js_top}}      end      def toc_metadata        @metalink=%{./#{@md.fn[:meatadata]}} @@ -134,11 +134,11 @@ module SiSU_HTML_Format_type      #{creator}    </p>    <p class="tiny"> -    copy @  +    copy @      <a href="#{@vz.url_home}">        #{@vz.txt_home}      </a> -  </p>}  +  </p>}      end    end    class Head_scroll < SiSU_HTML_Format::Head_scroll @@ -434,10 +434,10 @@ module SiSU_HTML_Format_type        %{  <li class="doc">      <a href="#@link" target="_top">        #@linkname -    </a>  +    </a>    </li>  } -    end     +    end      def lev    %{<#@tag class="#@class">      #@one diff --git a/lib/sisu/0.52/html_promo.rb b/lib/sisu/v0/html_promo.rb index b41b1ffa..a9a6d71f 100644 --- a/lib/sisu/0.52/html_promo.rb +++ b/lib/sisu/v0/html_promo.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_HTML_promo -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    class Ad      def initialize(md) @@ -143,7 +143,7 @@ module SiSU_HTML_promo          else nil          end          #target=@prod['target']=~/^\S+/ ? @prod['target'] : '_top' -        action=if @prod['action']=~/^http:\/\//  +        action=if @prod['action']=~/^http:\/\//            @prod['action']          elsif defined? @rc['search']['action'] and @rc['search']['action'] =~/^http:\/\//            @rc['search']['action'] @@ -240,7 +240,7 @@ WOK      def output_form_sponsor(type,id)        cell=cell(@ad[:promo][type][id],prod_id)        prod_type=id=~/id_(?:[0-9x]){10,13}/i ? 'isbn' : 'id' -      id_detail = %{<p class="pane">#{prod_type}: #{prod_id}</p>} +      id_detail=%{<p class="pane">#{prod_type}: #{prod_id}</p>}         <<WOK  <br />  #{cell.site_link} @@ -269,7 +269,7 @@ WOK        prod_id=id.gsub(/id_/,'')        cell=cell(@ad[:promo][type][id],prod_id)        prod_type=id=~/id_(?:[0-9x]){10,13}/i ? 'isbn' : 'id' -      id_detail = %{<p class="pane">#{prod_type}: #{prod_id}</p>} +      id_detail=%{<p class="pane">#{prod_type}: #{prod_id}</p>}         <<WOK  <br />  #{cell.site_link} diff --git a/lib/sisu/0.52/html_scroll.rb b/lib/sisu/v0/html_scroll.rb index 51a7a6c8..bc03fc7d 100644 --- a/lib/sisu/0.52/html_scroll.rb +++ b/lib/sisu/v0/html_scroll.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,9 +47,9 @@                    ralph.amissah@gmail.com  =end  module SiSU_HTML_scroll -  require SiSU_lib + '/shared_html' -  require SiSU_lib + '/html' -  require SiSU_lib + '/html_promo' +  require "#{SiSU_lib}/shared_html" +  require "#{SiSU_lib}/html" +  require "#{SiSU_lib}/html_promo"    class Scroll      @@dp=nil      def initialize(data='',md='') @@ -79,7 +79,7 @@ module SiSU_HTML_scroll            para.gsub!(/(MetaData)/,'\1<a name="metadata"></a>')          end          @rcdc=true if @rcdc==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/) -        if para !~/(^0~|<ENDNOTES>|<EOF>)/  +        if para !~/(^0~|<ENDNOTES>|<EOF>)/            para.gsub!(/~[{\[].+?[}\]]~\s+/m,' ')            if para =~/.+?<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/              paranum=para[/.+?<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,1] @@ -212,7 +212,8 @@ module SiSU_HTML_scroll            para.gsub!(/<!.+!>/,' ')            para.gsub!(/^<:\S?>/,'')            para.gsub!(/<:\S?>/,' ') -          unless meta; @scr[:body] << para +          para.strip! +          unless meta; @scr[:body] << para unless para =~/\A\s*\Z/            else         @scr[:metadata] << meta            end          end @@ -222,7 +223,7 @@ module SiSU_HTML_scroll      def tails        scr_tail=[]        format_head_scroll=SiSU_HTML_Format_type::Head_toc.new(@md) -      ads = SiSU_HTML_promo::Ad.new(@md) +      ads=SiSU_HTML_promo::Ad.new(@md)        scr_tail << format_head_scroll.scroll_tail << ads.div.close << ads.display << format_head_scroll.html_close        scr_tail      end diff --git a/lib/sisu/0.52/html_segments.rb b/lib/sisu/v0/html_segments.rb index 765c012e..96b9a970 100644 --- a/lib/sisu/0.52/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,21 +47,21 @@                    ralph.amissah@gmail.com  =end  module SiSU_HTML_seg -  require SiSU_lib + '/shared_html' -  require SiSU_lib + '/html' -  require SiSU_lib + '/html_promo' +  require "#{SiSU_lib}/shared_html" +  require "#{SiSU_lib}/html" +  require "#{SiSU_lib}/html_promo"    class Seg      @@seg,@@seg_subtoc,@@seg_endnotes,@@seg_ad={},{},{},{} -    @@seg_name,@@seg_name_html,@@seg_name_php,@@segtocband=[],[],[],[] +    @@seg_name,@@seg_name_html,@@seg_name_php=[],[],[]      @@filename_seg=@@filename_segphp=@@seg_url=@@fn=@@to_lev4=@@get_hash_to=@@get_hash_fn=''      @@loop_count=@@seg_total=@@tracker=0      @@is4=@@is3=@@is2=@@is1=0      @@header1=@@header2=@@header3=@@header4=0 -    @@seg[:dot_nav],@@seg[:tocband],@@seg[:title],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@heading_endnotes_array,@@seg[:endnote_all]=Array.new(11){[]} +    @@seg[:tocband],@@seg[:title],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@heading_endnotes_array,@@seg[:endnote_all]=Array.new(10){[]}      @@seg[:header_endnotes]=''      @@tablehead,@@number_of_cols=0,0      @@flag_group=false -    @@dp=nil +    @@dp,@@segtocband=nil,nil      attr_reader :seg_name_html,:seg_name_html_tracker      def initialize(data='',md='')        @data,@md=data,md @@ -72,8 +72,8 @@ module SiSU_HTML_seg      end      def songsheet        begin -        Seg.new(@data,@md).get_subtoc_endnotes -        Seg.new(@data,@md).articles +        data=get_subtoc_endnotes(@data) +        data=articles(data)          Seg.new.cleanup # (((( added ))))          #### (((( END )))) ####        rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error @@ -82,8 +82,7 @@ module SiSU_HTML_seg        end      end    protected -    def articles -      data=@data +    def articles(data)        track,tracking,newfile=0,0,0        @@is4=@@is3=@@is2=@@is1=0        printed_endnote_seg='n' @@ -141,8 +140,8 @@ module SiSU_HTML_seg                  else Seg.new.output('endnotes')                  end                  Seg.new.reinitialise -                Seg.new(para,@md).header_art -                Seg.new(para,@md).head +                header_art(para) +                head(para)                  if @@seg_name_html[tracking] =~/metadata/ # this is for metadata                    segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}"                    @@filename_seg=File.new(segfilename,'w') @@ -152,20 +151,26 @@ module SiSU_HTML_seg                  end                end                if  tracking == 0 -                Seg.new(para,@md).header_art -                Seg.new(para,@md).head +                header_art(para) +                head(para)                end              end              tracking=tracking + 1            end            m=para[/.+?<a name="(\d+)">.*/]; @@get_hash_to=$1 if m              # changed 2002w42, again w44 ! & again 2003w16            m=para[/^4~(\S+)/]; @@get_hash_fn=$1 if m -          if testforartnum[tracking-1] !~/endnote/ -            Seg.new(para,@md).markup -            Seg.new(para,@md).txt -          else -            Seg.new(para,@md).markup -            Seg.new(para,@md).txt +          para=if para =~/<!Th?¡\s+c|<:(?:code|alt|verse|group)>/; para.split(/\n/) +          else para +          end +          if para.class == String +            markup(para) +          elsif para.class == Array +            para.each do |pg| +              markup(pg) +            end +          end +          Seg.new(para,@md).txt +          if testforartnum[tracking-1] =~/endnote/              if printed_endnote_seg == 'n'                Seg.new(para,@md).endnote                printed_endnote_seg='y' @@ -174,37 +179,24 @@ module SiSU_HTML_seg          end        end      end -    def header_art -      @data.each do |para| -        format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) -        if para =~/^[0-6]~/ #2004w27/5 -          if @@tracker < @@seg_total-1; @@seg[:dot_nav] << format_head_seg.dot_control_pre_next -          else                          @@seg[:dot_nav] << format_head_seg.dot_control_pre -          end +    def header_art(para) +      format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) +      if para =~/^[0-6]~/ #2004w27/5 +        if @@tracker < @@seg_total-1; @@seg[:dot_nav]=format_head_seg.dot_control_pre_next #if format_head_seg.dot_control_pre_next +        else                          @@seg[:dot_nav]=format_head_seg.dot_control_pre #if format_head_seg.dot_control_pre          end -        ads=SiSU_HTML_promo::Ad.new(@md) -        @@seg[:title]=format_head_seg.head << ads.div.major        end +      ads=SiSU_HTML_promo::Ad.new(@md) +      @@seg[:title]=format_head_seg.head << ads.div.major      end -    def head -      data=@data +    def head(para)        clean=/<!.*?!>|<:.*?>|<~\d+;(?:[ohum]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/        format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) -      unless @md.flag_pdf -        if @@tracker < @@seg_total-1 -          if @@tracker == 0; @@segtocband << format_head_seg.toc_next3 -          else               @@segtocband << format_head_seg.toc_pre_next3 -          end -        elsif @@tracker == @@seg_total -          @@segtocband << format_head_seg.toc_pre3 -        end -      else  # identical code without .pdf -        if @@tracker < @@seg_total-1 -          if @@tracker == 0; @@segtocband << format_head_seg.toc_next2 -          else               @@segtocband << format_head_seg.toc_pre_next2 -          end -        else @@segtocband << format_head_seg.toc_pre2 +      if @@tracker < @@seg_total-1 +        if @@tracker == 0; @@segtocband=format_head_seg.toc_next2 #if format_head_seg.toc_next2 +        else               @@segtocband=format_head_seg.toc_pre_next2 #if format_head_seg.toc_pre_next2          end +      else @@segtocband=format_head_seg.toc_pre2 #if format_head_seg.toc_pre2        end        @p_num ||= ''        if @@is1 == 1 @@ -252,101 +244,98 @@ module SiSU_HTML_seg        @@seg[:header_endnotes]=format_head_seg.title_endnote(@md.title,@md.subtitle,@dc_creator,@@seg[:dot_nav])        @@tracker=@@tracker+1      end -    def markup +    def markup(para)        @debug=[] -      data=@data.dup #bugwatch tied -      @group_collect=[] -      data.each do |para| -        format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) -        if para !~/^0~/ -          m=para[/.+?<~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/] -          if m -            paranum=m[1].to_s -            @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) -          end -          if para =~/<:(?:code|alt|verse|group)>/ or @@flag_group==true -            if para =~/<:(?:code|alt|verse|group)>/  -              @group_collect << @vz.margin_txt_0 + para -              @@flag_group=true -            elsif @@flag_group==true -              unless para =~/<:(?:code|alt|verse|group)-end>/                  # neither ideal nor necessary sort later -                @group_collect << para  -              else @group_collect << para.gsub(/<:(?:code|alt|verse|group)-end>/,'') -              end -            end -            if para =~/<:(?:code|alt|verse|group)-end>/ -              para = @group_collect.join -              @@flag_group=false -              @group_collect=[] +      format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) +      if para !~/^0~/ +        m=para[/.+?<~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/] +        if m +          paranum=m[1].to_s +          @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) +        end +        if para =~/<:(?:code|alt|verse|group)>/ or @@flag_group==true +          if para =~/<:(?:code|alt|verse|group)>/ +            @group_collect=[] #unless @group_collect.class == Array +            @group_collect << @vz.margin_txt_0 + para +            @@flag_group=true +          elsif @@flag_group==true +            unless para =~/<:(?:code|alt|verse|group)-end>/                  # neither ideal nor necessary sort later +              @group_collect << para +            else @group_collect << para.gsub(/<:(?:code|alt|verse|group)-end>/,'')              end            end -          if para !~/^[0-9]~/ -            if para =~/(.*)<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/ -              one,two=$1,$2 -              format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) -              para=format_seg.no_paranum -            end +          if para =~/<:(?:code|alt|verse|group)-end>/ +            para=@group_collect.flatten.join +            @@flag_group=false +            @group_collect=[]            end -          if para[/<~(\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp)>$/] -            @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).lev_segname_para_ocn -            format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[12]|_1?\*|<:i[12]>\s*_\*|null/ -            para=case @sto.format # work area 2003w29 ||@|def lev_segname_para_ocn| -            when /^4~\S+/;       @sto.seg_lev_para_ocn.header4 # work on see Split_text_object -            when /^5~(?:~\S+)?/; @sto.seg_lev_para_ocn.header5 -            when /^6~(?:~\S+)?/; @sto.seg_lev_para_ocn.header6 -            when /^_\*$/;        @sto.seg_lev_para_ocn.bullet -            when /^_1\*$/ -              format_txt_obj.gsub_body -              @sto.seg_lev_para_ocn.bullet_indent1 -            when /^i1$/ -              format_txt_obj.gsub_body -              @sto.seg_lev_para_ocn.indent1 -            when /^i2$/ +        end +        if para !~/^[0-9]~/ +          if para =~/(.*)<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/ +            one,two=$1,$2 +            format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) +            para=format_seg.no_paranum +          end +        end +        if para[/<~(\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+><#@dp:#@dp)>$/] +          @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).lev_segname_para_ocn +          format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[12]|_1?\*|<:i[12]>\s*_\*|null/ +          para=case @sto.format # work area 2003w29 ||@|def lev_segname_para_ocn| +          when /^4~\S+/;       @sto.seg_lev_para_ocn.header4 # work on see Split_text_object +          when /^5~(?:~\S+)?/; @sto.seg_lev_para_ocn.header5 +          when /^6~(?:~\S+)?/; @sto.seg_lev_para_ocn.header6 +          when /^_\*$/;        @sto.seg_lev_para_ocn.bullet +          when /^_1\*$/ +            format_txt_obj.gsub_body +            @sto.seg_lev_para_ocn.bullet_indent1 +          when /^i1$/ +            format_txt_obj.gsub_body +            @sto.seg_lev_para_ocn.indent1 +          when /^i2$/ +            format_txt_obj.gsub_body +            @sto.seg_lev_para_ocn.indent2 +          when /^(?:verse|group|alt)$/ +            @sto.seg_lev_para_ocn.para +          when /^code$/ +            @sto.seg_lev_para_ocn.code +          when /null/ +            if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ and para !~/^<!TZ!>/                format_txt_obj.gsub_body -              @sto.seg_lev_para_ocn.indent2 -            when /^(?:verse|group|alt)$/                @sto.seg_lev_para_ocn.para -            when /^code$/ -              @sto.seg_lev_para_ocn.code -            when /null/ -              if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ and para !~/^<!TZ!>/ -                format_txt_obj.gsub_body -                @sto.seg_lev_para_ocn.para -              elsif para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ and para =~/^<!TZ!>/ -                format_txt_obj.gsub_body -                @sto.seg_lev_para_ocn.table_end -              else para -              end +            elsif para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ and para =~/^<!TZ!>/ +              format_txt_obj.gsub_body +              @sto.seg_lev_para_ocn.table_end              else para              end -          elsif para =~/¡|<!T[hZ]?/ -            table=SiSU_HTML_shared::Table.new(para) -            para=table.table -          end -          if @md.flag_separate_endnotes -            para.gsub!(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{@md.sfx}#_\\1">})       #endnote- twice #removed file type +          else para            end -          if para !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/ -            if para[/(.*)<~0;(?:u|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/] #% watch u & m? -              one,two=$1,$2 -              format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) -              para=format_seg.seg_no_paranum                                   #% undefined -            end -            para.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'')                   #potentially dagerous - removes all paragraphs with <!e_!> #?? workpoint -            if para =~/<a name="_\d+" href="#-\d+"> <sup>/                #endnote- note- -              format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,para) -              para=format_seg.no_paranum -            end +        elsif para =~/¡|<!T[hZ]?/ +          table=SiSU_HTML_shared::Table.new(para) +          para=table.table +        end +        if @md.flag_separate_endnotes +          para.gsub!(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{@md.sfx}#_\\1">})       #endnote- twice #removed file type +        end +        if para !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/ +          if para[/(.*)<~0;(?:u|[0-6]:)\d+;\w\d+><#@dp:#@dp>(.*)/] #% watch u & m? +            one,two=$1,$2 +            format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) +            para=format_seg.seg_no_paranum                                   #% undefined            end -          if para =~/^4~\S+|4~!/  -            para.gsub!(/4~\S+|<:[-_\w\d]?(-.+?-)?>|4~!.+/,'')              #sort seg headers -            @@seg[:main] << para  -            @@seg[:main] << @@seg_subtoc[@@get_hash_fn]                       #% insertion of sub-toc -          else -            para.gsub!(/<:[-_\w\d]?(-.+?-)?>|4~!.+/,'') -            @@seg[:main] << para unless @@flag_group==true +          para.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'')                   #potentially dagerous - removes all paragraphs with <!e_!> #?? workpoint +          if para =~/<a name="_\d+" href="#-\d+"> <sup>/                #endnote- note- +            format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,para) +            para=format_seg.no_paranum            end          end +        if para =~/^4~\S+|4~!/ +          para.gsub!(/4~\S+|<:[-_\w\d]?(-.+?-)?>|4~!.+/,'')              #sort seg headers +          @@seg[:main] << para +          @@seg[:main] << @@seg_subtoc[@@get_hash_fn]                       #% insertion of sub-toc +        else +          para.gsub!(/<:[-_\w\d]?(-.+?-)?>|4~!.+/,'') +          @@seg[:main] << para unless @@flag_group==true +        end        end      end      def txt @@ -360,29 +349,32 @@ module SiSU_HTML_seg          @@seg[:tail] << @@seg_endnotes[@@get_hash_fn] #endnotes deposited at end of individual segments||@|EXTRACTION OF ENDNOTES|        end        @@seg[:tail] << '<table summary="whitespace"><tr><td> </td></tr></table>' -      ads = SiSU_HTML_promo::Ad.new(@md) +      ads=SiSU_HTML_promo::Ad.new(@md)        @@seg[:credits] << format_head_seg.credit << ads.div.close << ads.display << format_head_seg.html_close      end      def output(type='') -      if @@seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or...  -        @@filename_seg << @@seg[:title]  -        #@@filename_seg << @@seg[:dot_nav] #places dot control at very top of segment -        @@filename_seg << @@seg[:tocband] +      if @@seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or... +        filename_seg=[] +        filename_seg << @@seg[:title] << @@seg[:tocband]          if type !~/endnote/ -          @@filename_seg << @@seg[:headers] -          @@filename_seg << @@seg[:main] +          filename_seg << @@seg[:headers] << @@seg[:main]          else -          @@filename_seg << @@seg[:header_endnotes] -          @@filename_seg << @@seg[:endnote_all] +          filename_seg << @@seg[:header_endnotes] << @@seg[:endnote_all] +        end +        filename_seg << @@seg[:tail] << @@seg[:tocband] << @@seg[:credits] +        filename_seg.flatten!.compact! +        filename_seg.each do |para| +          unless para =~/\A\s*\Z/ +            para.strip! +            @@filename_seg << para +          end          end -        @@filename_seg << @@seg[:tail] -        @@filename_seg << @@seg[:tocband] -        @@filename_seg << @@seg[:credits]          @@filename_seg.close        end      end      def reinitialise -      @@seg[:title],@@seg[:dot_nav],@@segtocband,@@seg[:tocband],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(8){[]} +      @@seg[:title],@@seg[:dot_nav],@@seg[:tocband],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(7){[]} +      @@segtocband=nil      end      def cleanup        reinitialise @@ -391,21 +383,21 @@ module SiSU_HTML_seg        @@seg_endnotes_array,@@seg_subtoc_array,@@heading_endnotes_array=[],[],[]        @@seg[:endnote_all]=[]      end -    def get_subtoc_endnotes #get endnotes & sub-table of contents subtoc -      @data.each do |para| +    def get_subtoc_endnotes(data) #get endnotes & sub-table of contents subtoc +      data.each do |para|          para.gsub!(/<a name=\"h\d.*?\">(.+?)<\/a>/mi,'\1')          if @md.flag_auto_endnotes            if para =~/^[1234]~/ and not @@fn.empty? -            @@seg_endnotes[@@fn] = [] +            @@seg_endnotes[@@fn]=[]              @@seg_endnotes[@@fn] << @@seg_endnotes_array              @@seg_endnotes_array=[] if para=~/^4~/            end          end -        if para =~/^4~/                                              #% EXTRACTION OF SUB-TOCs  +        if para =~/^4~/                                              #% EXTRACTION OF SUB-TOCs            @@seg_subtoc[@@fn]=@@seg_subtoc_array            @@seg_subtoc_array=[]          end -        if para =~/^4~/                                              #% SEGMENT NAME, after EXTRACTION OF ENDNOTES & SUB-TOCs  +        if para =~/^4~/                                              #% SEGMENT NAME, after EXTRACTION OF ENDNOTES & SUB-TOCs            m=para[/^4~(\S+).+?<~(\d+);(?:[oh]|4:)\d+;\w\d+><#@dp:#@dp>$/]            if m;  @@fn,@@to_lev4=$1,$2 if m # changed 2004w07          #endnotes and sub-tocs            else @@ -439,7 +431,8 @@ module SiSU_HTML_seg              if para=~/~\[[+]\d+\s.+?\]\~/m                endnote_array << para.scan(/~\[[+]\d+\s.+?\]\~/m)              end -            endnote_array.flatten.each do |note|  +            endnote_array.flatten!.compact! #check compacting +            endnote_array.each do |note|                note_match=note.dup                note_match_seg=note.dup                e_n=note_match_seg[/(?:~\{[\d*+]+|~\[[*+]\d+)\s+(.+?)[}\]]~/m,1] diff --git a/lib/sisu/0.52/html_table.rb b/lib/sisu/v0/html_table.rb index ade762eb..ebe98e0d 100644 --- a/lib/sisu/0.52/html_table.rb +++ b/lib/sisu/v0/html_table.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_HTML_table -  require SiSU_lib + '/defaults' +  require "#{SiSU_lib}/defaults"    class Table      @@tablehead=0      @@tablefoot=[] #watch @@ -88,7 +88,7 @@ module SiSU_HTML_table      end      def table        m=@parablock[/<!f(.+?)!>/,1] -      @@tablefoot << m if m  +      @@tablefoot << m if m        @parablock.gsub!(/<!f.+?!>/,'')        @@tablehead=1 if @parablock =~/<!Th¡/        if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/; @parablock=table_head($1) @@ -105,7 +105,7 @@ module SiSU_HTML_table            if @parablock =~/<!¡¡(\d+?)¡/              @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))            end -          if @parablock =~/¡¡(\d+?)¡/  +          if @parablock =~/¡¡(\d+?)¡/              @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))            end            if @parablock =~/!>/ diff --git a/lib/sisu/0.52/html_tune.rb b/lib/sisu/v0/html_tune.rb index 1043f310..2d295a6c 100644 --- a/lib/sisu/0.52/html_tune.rb +++ b/lib/sisu/v0/html_tune.rb @@ -35,23 +35,23 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved.   * Ralph Amissah: ralph@amissah.com                    ralph.amissah@gmail.com  =end -require SiSU_lib + '/param' +require "#{SiSU_lib}/param"  module SiSU_Tune -  #require SiSU_lib + '/defaults' -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/param' -  require SiSU_lib + '/html_format' #watch +  #require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/param" +  require "#{SiSU_lib}/html_format" #watch    include SiSU_Env    include SiSU_Screen    @@line_mode='' @@ -62,7 +62,7 @@ module SiSU_Tune   \;</td>  <td width="94%" valign="top" align="justify">'    @@table_align_close='</td> -<td width="4%" align="right" valign="top">  +<td width="4%" align="right" valign="top">  <font size="1" color="#777777">     </font> </td></tr></table>'    @@counter,@@column,@columns=0,0,0 @@ -91,7 +91,7 @@ module SiSU_Tune        @html=html      end      def clean -      @html.gsub!(/¢/,'¢')    # ¢  +      @html.gsub!(/¢/,'¢')    # ¢        @html.gsub!(/£/,'£')   # £        @html.gsub!(/¥/,'¥')     # ¥        @html.gsub!(/§/,'§')    # § @@ -174,7 +174,7 @@ module SiSU_Tune        @html.gsub!(/û/,'û')   # ü        @html.gsub!(/ü/,'ü')    # ý        @html.gsub!(/þ/,'þ')   # þ -      @html.gsub!(/ÿ/,'ÿ')    # ÿ    +      @html.gsub!(/ÿ/,'ÿ')    # ÿ        @html.gsub!(/ý/,'ý')        @html      end @@ -197,7 +197,7 @@ module SiSU_Tune          data=Tune.new(@data,@md).endnotes_html          data=Tune.new(data,@md).url_markup          if @sys.locale =~/utf-?8/i -          data=Tune.new(data,@md).utf8_markup  +          data=Tune.new(data,@md).utf8_markup          end          if @md.cmd =~/M/  #Hard Output Tune Optional on/off here            data=Output.new(data,@md).hard_output @@ -341,9 +341,9 @@ module SiSU_Tune            else m,u=/\{(.+?)\}((?:https?|ftp)\S+|image)/.match(word).captures              d=''            end -          case m  +          case m            when /\.png|\.jpg|\.gif|c=|\d+x\d+/ -            w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/  +            w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/              w=%{width="#{w}"} if w              h=%{height="#{h}"} if h              c=m[/"(.+?)"/m,1] @@ -352,7 +352,7 @@ module SiSU_Tune              image_path=if @md.fns =~/\.-ss[tm]$/; @env.url.images_external              else                                  @env.url.images_local              end -            ins=if u and u.strip !~/^image$/  +            ins=if u and u.strip !~/^image$/                %{<a href="#{u}"><img src="#{image_path}/#{png}" #{w} #{h} naturalsizeflag="0" align="bottom" border="0"></a>#{caption}}              else %{<img src="#{image_path}/#{png}" #{w} #{h} naturalsizeflag="0" align="bottom" border="0">#{caption}}              end diff --git a/lib/sisu/0.52/hub.rb b/lib/sisu/v0/hub.rb index 1f2df5f6..d8e99867 100644 --- a/lib/sisu/0.52/hub.rb +++ b/lib/sisu/v0/hub.rb @@ -35,7 +35,7 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Screen    @@pwd=Dir.pwd    class Remote_download @@ -106,7 +106,7 @@ module SiSU        Dir.chdir(@pwd)      end      def select -      require SiSU_lib + "/#@req" +      require "#{SiSU_lib}/#@req"        if @req =~/^conf$/;           SiSU_Initialize::Source.new(@opt).read    # -C        end        if not @opt.files.empty? @@ -127,7 +127,7 @@ module SiSU          	      when /\.(?:[_-]?sst|ssm)$/                    case @req                    when /^dal$/ -        	          if fns =~ /\.ssm$/; require SiSU_lib + '/composite'  #pre-processing +        	          if fns =~ /\.ssm$/; require "#{SiSU_lib}/composite"  #pre-processing                        SiSU_Assemble::Composite.new(@opt).read                        @opt.fns=fns.gsub(/\.ssm$/,'._sst')                      end @@ -191,30 +191,30 @@ module SiSU      end      def remote_put_base_site_rsync                                   # -CR  p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ -      require SiSU_lib + '/remote_put' +      require "#{SiSU_lib}/remote_put"        SiSU_Remote::Put.new(@opt).rsync_base      end      def remote_put_base_site_rsync_match                             # -CCRZ  p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ -      require SiSU_lib + '/remote_put' +      require "#{SiSU_lib}/remote_put"        SiSU_Remote::Put.new(@opt).rsync_base_sync      end      def remote_put_base_site                                         # -Cr  p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ -      require SiSU_lib + '/remote_put' +      require "#{SiSU_lib}/remote_put"        SiSU_Remote::Put.new(@opt).scp_base      end      def remote_put_base_site_all                                     # -CCr  p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ -      require SiSU_lib + '/remote_put' +      require "#{SiSU_lib}/remote_put"        SiSU_Remote::Put.new(@opt).scp_base_all      end      def cgi                                                          # -F -      require SiSU_lib + '/cgi' +      require "#{SiSU_lib}/cgi"        SiSU_CGI::SiSU_search.new(@opt).read      end      def encoding                                                     # -K build character encoding db (uses KirbyBase) -      require SiSU_lib + '/character_encoding' +      require "#{SiSU_lib}/character_encoding"        SiSU_character_encode::Create.new.db      end      def termsheet                                                    # -t @@ -225,7 +225,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/      end      def webrick                                                      # -W        port=prt=@fns -      prt=if prt !~/\d+/; 'webrick default (sysenv)'  +      prt=if prt !~/\d+/; 'webrick default (sysenv)'        else                "webrick port set to #{prt}"        end      	puts 	%{#{@cX.blue}<<#{@cX.off}#{@cX.green}Start Webrick web server on port: #{prt}#{@cX.off}#{@cX.blue}>> #{@cX.off*2} } @@ -271,7 +271,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/        Op.new(@opt,req,msg).select if req and msg      end      def actions -      if @opt.mod.inspect =~/--convert|--to|--from/; require SiSU_lib + '/sst_convert_markup' +      if @opt.mod.inspect =~/--convert|--to|--from/; require "#{SiSU_lib}/sst_convert_markup"        end        if @opt.cmd =~/([AabCcDdEeFfgGHhIiLMmNnoprRSsTtQqUuVvwWXxYyZ_0-9])/ and           @opt.cmd =~/^-/ and @@ -296,7 +296,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/            else ''            end          end -        @opt.cmd=@opt.cmd + extra   +        @opt.cmd=@opt.cmd + extra          if @opt.cmd =~/[vVM]/                                                             #% version information            version=SiSU_Env::Info_version.new.get_version            rb_ver=SiSU_Env::Info_version.new.rbversion @@ -365,41 +365,41 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/              re_p=/(http:\/\/\S+?(?:\/sisupod(?:\.zip)?|\.ssp))/          	  @opt.files.each do |fns|                if fns =~re_s -                @get_s << re_s.match(fns)[1] if re_s  +                @get_s << re_s.match(fns)[1] if re_s                end                if fns =~re_p -                @get_p << re_p.match(fns)[1] if re_p  +                @get_p << re_p.match(fns)[1] if re_p                end              end              if @get_s.length > 0                                     #% remote markup file .sst                require 'open-uri'                require 'pp' -              require SiSU_lib + '/composite' +              require "#{SiSU_lib}/composite"                @rgx_image=/\{\s*(\S+?\.(?:png|jpg|gif))/                @rgx_skin=/^0~skin\s+(\S+)/ -              threads = [] +              threads=[]                for requested_page in @get_s                  threads << Thread.new(requested_page) do |url|                    open(url) do |f|                      raise "#{url} not found" unless f                      re_fnb=/(http:\/\/[^\/ ]+?\/[^\/ ]+?)\/\S+?\/([^\/]+?)\.ss(t)/ #revisit and remove DO                      base_uri,fnb,instr=re_fnb.match(url)[1..3] if re_fnb -                    imagedir = base_uri + '/_sisu/image_local' #check on +                    imagedir= base_uri + '/_sisu/image_local' #check on                      doc_skin_dir = /(http:\/\/\S+?)\/[^\/]+?\.sst$/.match(url).captures.join + '/_sisu/skin/doc'                      #"Got file, and ready to process: #{fnb}.t#{instr}"                      downloaded_file=File.new("#{fnb}.-sst",'w+')                      images=SiSU_Assemble::Remote_image.new.image(imagedir)                      skin=SiSU_Assemble::Remote_image.new.image(doc_skin_dir)                      f.collect.each do |r|                            # work area -                      skin << r.scan(@rgx_skin).uniq if r =~@rgx_skin      -                      images << r.scan(@rgx_image).uniq if r =~@rgx_image      +                      skin << r.scan(@rgx_skin).uniq if r =~@rgx_skin +                      images << r.scan(@rgx_image).uniq if r =~@rgx_image                        downloaded_file << r                      end                      if skin and skin.length > 0                        SiSU_Assemble::Remote_image.new.download_doc_skin(skin)                      end                      if images and images.length > 1 -                      images.flatten!.uniq!  +                      images.flatten!.uniq!                        @msg,@msgs='downloading images:', [ images.join(',') ]                        @tell.call.warn unless @opt.cmd =~/q/                        SiSU_Assemble::Remote_image.new.download_images(images) @@ -419,7 +419,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/                  pod_info=Remote_download.new(requested_pod)                  @opt.fns=pod_info.pod.name                  Net::HTTP.start(pod_info.pod.site) do |http| -                  resp = http.get("#{pod_info.pod.path}/#{pod_info.pod.name_source}") +                  resp=http.get("#{pod_info.pod.path}/#{pod_info.pod.name_source}")                    open(pod_info.pod.name,'wb') do |file|                      file.write(resp.body)                     end @@ -463,7 +463,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/          if @opt.cmd =~/w/; op('concordance','Concordance')           #% -w concordance          end          if @opt.cmd =~/t/                                            #% -t termsheet/standard form -          SiSU_Help::Help.new('termsheet').help_request  +          SiSU_Help::Help.new('termsheet').help_request          	@opt.files.each do |fns|              if FileTest.file?(fns)                @opt.fns=fns @@ -504,26 +504,26 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/            end          end        elsif @opt.mod.inspect =~/--query/ -        require SiSU_lib + '/sst_identify_markup' +        require "#{SiSU_lib}/sst_identify_markup"          puts SiSU_Markup::Markup_history.new(@opt).query        elsif @opt.mod.inspect =~/--identify/ -        require SiSU_lib + '/sst_identify_markup' +        require "#{SiSU_lib}/sst_identify_markup"          markup_version=SiSU_Markup::Markup_identify.new(@opt).markup_version?        elsif  @opt.mod.inspect =~/--about/                            #% help instructions -        if @opt.mod.inspect =~/--about/ and not @opt.what.empty?; SiSU_Help::Help.new(@opt.what,'color_off').help_request  -        else SiSU_Help::Help.new('list','color_off').help_request  +        if @opt.mod.inspect =~/--about/ and not @opt.what.empty?; SiSU_Help::Help.new(@opt.what,'color_off').help_request +        else SiSU_Help::Help.new('list','color_off').help_request          end        elsif  @opt.mod.inspect =~/--sitemaps/                         #% sitemaps -        require SiSU_lib + '/sitemaps' +        require "#{SiSU_lib}/sitemaps"          SiSU_Sitemaps::Source.new(@opt).read          if @opt.cmd =~/R/ -          require SiSU_lib + '/remote_put' +          require "#{SiSU_lib}/remote_put"            SiSU_Remote::Put.new(@opt).rsync_sitemaps          end        else                                                           #% help instructions          unless @opt.mod.inspect =~/--convert|--to|--from/ -          if @opt.mod.inspect =~/--help/ and not @opt.what.empty?; SiSU_Help::Help.new(@opt.what).help_request  -          else SiSU_Help::Help.new('list').help_request  +          if @opt.mod.inspect =~/--help/ and not @opt.what.empty?; SiSU_Help::Help.new(@opt.what).help_request +          else SiSU_Help::Help.new('list').help_request            end          end        end @@ -550,15 +550,15 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/    begin                                                              #% select what to do      require 'jcode'      $KCODE='UTF8' -    require SiSU_lib + '/options' -    require SiSU_lib + '/sysenv' +    require "#{SiSU_lib}/options" +    require "#{SiSU_lib}/sysenv"      include SiSU_Env      include SiSU_Screen -    require SiSU_lib + '/param' +    require "#{SiSU_lib}/param"      include SiSU_Param -    require SiSU_lib + '/defaults' +    require "#{SiSU_lib}/defaults"      include SiSU_Viz -    require SiSU_lib + '/help' +    require "#{SiSU_lib}/help"      include SiSU_Help      require 'uri'      home=ENV['HOME'] diff --git a/lib/sisu/0.52/i18n.rb b/lib/sisu/v0/i18n.rb index 311b90ee..8a9bec57 100644 --- a/lib/sisu/0.52/i18n.rb +++ b/lib/sisu/v0/i18n.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,41 +49,41 @@                    ralph.amissah@gmail.com  =end  module SiSU_Translate -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Param    class Source      def initialize(md,doc_lang,trans_str='')        @md,@doc_lang,@trans_str=md,doc_lang,trans_str        @lang_class=case @doc_lang -      when /American/i;                  English.new(md,doc_lang,trans_str)    # tag depreciated, see iso 639-2  -      when /English/i;                   English.new(md,doc_lang,trans_str)  -      when /French/i;                    French.new(md,doc_lang,trans_str)  -      when /German/i;                    German.new(md,doc_lang,trans_str)   -      when /Italian/i;                   Italian.new(md,doc_lang,trans_str)   -      when /Spanish/i;                   Spanish.new(md,doc_lang,trans_str)   -      when /Brazilian(?: Portuguese)?/i; Portuguese.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2  -      when /Portuguese/i;                Portuguese.new(md,doc_lang,trans_str)  -      when /Swedish/i;                   Swedish.new(md,doc_lang,trans_str)  -      when /Danish/i;                    Danish.new(md,doc_lang,trans_str)   -      when /Finnish/i;                   Finnish.new(md,doc_lang,trans_str)  -      when /Norwegian/i;                 Norwegian.new(md,doc_lang,trans_str)  -      when /Icelandic/i;                 Icelandic.new(md,doc_lang,trans_str)  -      when /Dutch/i;                     Dutch.new(md,doc_lang,trans_str)  -      when /Estonian/i;                  Estonian.new(md,doc_lang,trans_str)  -      when /Hungarian/i;                 Hungarian.new(md,doc_lang,trans_str)  -      when /Polish/i;                    Polish.new(md,doc_lang,trans_str)  -      when /Romanian/i;                  Romanian.new(md,doc_lang,trans_str)  -      when /Russian/i;                   Russian.new(md,doc_lang,trans_str)  -      when /Greek/i;                     Greek.new(md,doc_lang,trans_str)  -      when /Ukranian/i;                  Ukranian.new(md,doc_lang,trans_str)  -      when /Turkish/i;                   Turkish.new(md,doc_lang,trans_str)  -      when /Slovenian/i;                 Slovenian.new(md,doc_lang,trans_str)  -      when /Croatian/i;                  Croatian.new(md,doc_lang,trans_str)  -      when /Slovak(?:ian)?/i;            Slovak.new(md,doc_lang,trans_str)  -      when /Czech/i;                     Czech.new(md,doc_lang,trans_str)  -      when /Bulgarian/i;                 Bulgarian.new(md,doc_lang,trans_str)  -      else                               English.new(md,doc_lang,trans_str)  +      when /American/i;                  English.new(md,doc_lang,trans_str)    # tag depreciated, see iso 639-2 +      when /English/i;                   English.new(md,doc_lang,trans_str) +      when /French/i;                    French.new(md,doc_lang,trans_str) +      when /German/i;                    German.new(md,doc_lang,trans_str) +      when /Italian/i;                   Italian.new(md,doc_lang,trans_str) +      when /Spanish/i;                   Spanish.new(md,doc_lang,trans_str) +      when /Brazilian(?: Portuguese)?/i; Portuguese.new(md,doc_lang,trans_str) # tag depreciated, see iso 639-2 +      when /Portuguese/i;                Portuguese.new(md,doc_lang,trans_str) +      when /Swedish/i;                   Swedish.new(md,doc_lang,trans_str) +      when /Danish/i;                    Danish.new(md,doc_lang,trans_str) +      when /Finnish/i;                   Finnish.new(md,doc_lang,trans_str) +      when /Norwegian/i;                 Norwegian.new(md,doc_lang,trans_str) +      when /Icelandic/i;                 Icelandic.new(md,doc_lang,trans_str) +      when /Dutch/i;                     Dutch.new(md,doc_lang,trans_str) +      when /Estonian/i;                  Estonian.new(md,doc_lang,trans_str) +      when /Hungarian/i;                 Hungarian.new(md,doc_lang,trans_str) +      when /Polish/i;                    Polish.new(md,doc_lang,trans_str) +      when /Romanian/i;                  Romanian.new(md,doc_lang,trans_str) +      when /Russian/i;                   Russian.new(md,doc_lang,trans_str) +      when /Greek/i;                     Greek.new(md,doc_lang,trans_str) +      when /Ukranian/i;                  Ukranian.new(md,doc_lang,trans_str) +      when /Turkish/i;                   Turkish.new(md,doc_lang,trans_str) +      when /Slovenian/i;                 Slovenian.new(md,doc_lang,trans_str) +      when /Croatian/i;                  Croatian.new(md,doc_lang,trans_str) +      when /Slovak(?:ian)?/i;            Slovak.new(md,doc_lang,trans_str) +      when /Czech/i;                     Czech.new(md,doc_lang,trans_str) +      when /Bulgarian/i;                 Bulgarian.new(md,doc_lang,trans_str) +      else                               English.new(md,doc_lang,trans_str)        end      end      def filename @@ -131,43 +131,43 @@ module SiSU_Translate      def prepared_by        @lang_class.prepared_by      end -    def digitized_by  +    def digitized_by        @lang_class.digitized_by      end -    def subject  +    def subject        @lang_class.subject      end -    def dc_description  +    def dc_description        @lang_class.dc_description      end -    def abstract  +    def abstract        @lang_class.abstract      end -    def type  +    def type        @lang_class.type      end -    def rights  +    def rights        @lang_class.rights      end -    def digitized_by  +    def digitized_by        @lang_class.digitized_by      end -    def date  +    def date        @lang_class.date      end -    def date_created  +    def date_created        @lang_class.date_created      end -    def date_available  +    def date_available        @lang_class.date_available      end -    def date_valid  +    def date_valid        @lang_class.date_valid      end -    def date_modified  +    def date_modified        @lang_class.date_modified      end -    def date_issued  +    def date_issued        @lang_class.date_issued      end      def language @@ -259,13 +259,13 @@ module SiSU_Translate      end      def language_list        lang=case @trans_str -      when /American/i;                  'American English'                    # tag depreciated, see iso 639-2  +      when /American/i;                  'American English'                    # tag depreciated, see iso 639-2        when /English/i;                   'English'        when /French/i;                    'français'        when /German/i;                    'Deutsch'        when /Italian/i;                   'Italiano'        when /Spanish/i;                   'español' -      when /Brazilian(?: Portuguese)?/i; 'Brazilian Português'                 # tag depreciated, see iso 639-2  +      when /Brazilian(?: Portuguese)?/i; 'Brazilian Português'                 # tag depreciated, see iso 639-2        when /Portuguese/i;                'Português'        when /Swedish/i;                   'svenska'        when /Danish/i;                    'dansk' @@ -462,13 +462,13 @@ module SiSU_Translate      end      def language_list_translated        lang=case @trans_str -      when /American/i;                  'American English'                    # tag depreciated, see iso 639-2  +      when /American/i;                  'American English'                    # tag depreciated, see iso 639-2        when /English/i;                   'English'        when /French/i;                    'French'        when /German/i;                    'German'        when /Italian/i;                   'Italian'        when /Spanish/i;                   'Spanish' -      when /Brazilian(?: Portuguese)?/i; 'Brazilian Portuguese'                # tag depreciated, see iso 639-2  +      when /Brazilian(?: Portuguese)?/i; 'Brazilian Portuguese'                # tag depreciated, see iso 639-2        when /Portuguese/i;                'Portuguese'        when /Swedish/i;                   'Swedish'        when /Danish/i;                    'Danish' @@ -661,13 +661,13 @@ module SiSU_Translate      end      def language_list_translated        lang=case @trans_str -      when /American/i;                  'Anglais americain'                   # tag depreciated, see iso 639-2  +      when /American/i;                  'Anglais americain'                   # tag depreciated, see iso 639-2        when /English/i;                   'Anglais'        when /French/i;                    'Français'        when /German/i;                    'Allemand'        when /Italian/i;                   'Italien'        when /Spanish/i;                   'Espagnol' -      when /Brazilian(?: Portuguese)?/i; 'Portugais brésilien'                 # tag depreciated, see iso 639-2  +      when /Brazilian(?: Portuguese)?/i; 'Portugais brésilien'                 # tag depreciated, see iso 639-2        when /Portuguese/i;                'Portugais'        when /Swedish/i;                   'Suédois'        when /Danish/i;                    'Danois' @@ -860,13 +860,13 @@ module SiSU_Translate      end      def language_list_translated        lang=case @trans_str -      when /American/i;                  'Amerikanisch-Englisch'               # tag depreciated, see iso 639-2  +      when /American/i;                  'Amerikanisch-Englisch'               # tag depreciated, see iso 639-2        when /English/i;                   'Englisch'        when /French/i;                    'Französisch'        when /German/i;                    'Deutsch'        when /Italian/i;                   'Italienisch'        when /Spanish/i;                   'Spanisch' -      when /Brazilian(?: Portuguese)?/i; 'Brasilianisch-Portugiesisch'         # tag depreciated, see iso 639-2  +      when /Brazilian(?: Portuguese)?/i; 'Brasilianisch-Portugiesisch'         # tag depreciated, see iso 639-2        when /Portuguese/i;                'Portugiesisch'        when /Swedish/i;                   'Schwedisch'        when /Danish/i;                    'Dänisch' @@ -1059,13 +1059,13 @@ module SiSU_Translate     end     def language_list_translated       lang=case @trans_str -     when /American/i;                  'Inglés Americano'                     # tag depreciated, see iso 639-2  +     when /American/i;                  'Inglés Americano'                     # tag depreciated, see iso 639-2       when /English/i;                   'Inglés'       when /French/i;                    'Francés'       when /German/i;                    'Alemán'       when /Italian/i;                   'Italiano'       when /Spanish/i;                   'Español' -     when /Brazilian(?: Portuguese)?/i; 'Portugués de Brasil'                  # tag depreciated, see iso 639-2  +     when /Brazilian(?: Portuguese)?/i; 'Portugués de Brasil'                  # tag depreciated, see iso 639-2       when /Portuguese/i;                'Portugués'       when /Swedish/i;                   'Sueco'       when /Danish/i;                    'Danés' @@ -1258,13 +1258,13 @@ module SiSU_Translate      end      def language_list_translated        lang=case @trans_str -      when /American/i;                  'Inglese USA'                         # tag depreciated, see iso 639-2  +      when /American/i;                  'Inglese USA'                         # tag depreciated, see iso 639-2        when /English/i;                   'Inglese'        when /French/i;                    'Francese'        when /German/i;                    'Tedesco'        when /Italian/i;                   'Italiano'        when /Spanish/i;                   'Spagnolo' -      when /Brazilian(?: Portuguese)?/i; 'Portoguese (Brasile)'                # tag depreciated, see iso 639-2  +      when /Brazilian(?: Portuguese)?/i; 'Portoguese (Brasile)'                # tag depreciated, see iso 639-2        when /Portuguese/i;                'Portoguese'        when /Swedish/i;                   'Svedese'        when /Danish/i;                    'Danese' @@ -1457,13 +1457,13 @@ module SiSU_Translate      end      def language_list_translated        lang=case @trans_str -      when /American/i;                  'Amerikanenglanti'                    # tag depreciated, see iso 639-2  +      when /American/i;                  'Amerikanenglanti'                    # tag depreciated, see iso 639-2        when /English/i;                   'Englanti'        when /French/i;                    'Ranska'        when /German/i;                    'Saksa'        when /Italian/i;                   'Italia'        when /Spanish/i;                   'Espanja' -      when /Brazilian(?: Portuguese)?/i; 'Brasilian portugali'                 # tag depreciated, see iso 639-2  +      when /Brazilian(?: Portuguese)?/i; 'Brasilian portugali'                 # tag depreciated, see iso 639-2        when /Portuguese/i;                'Portugali'        when /Swedish/i;                   'Ruotsi'        when /Danish/i;                    'Tanska' diff --git a/lib/sisu/0.52/manifest.rb b/lib/sisu/v0/manifest.rb index 3bc04235..2d8066f9 100644 --- a/lib/sisu/0.52/manifest.rb +++ b/lib/sisu/v0/manifest.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,8 +49,8 @@                    ralph.amissah@gmail.com  =end  module SiSU_Manifest -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/i18n' +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/i18n"    include SiSU_Env    include SiSU_Param    include SiSU_Viz @@ -143,7 +143,7 @@ module SiSU_Manifest        def links(url,lnk,target)          static=if url =~/^\.\//; url.gsub(/^\.(\.)?/,@base_url)          elsif url =~/^\.\.\//;   url.gsub(/^\.(\.)?/,@env.url.root) -        else                     url                             +        else                     url          end          @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny"><a href="#{static}">#{static}</a></p></th></tr>\n}        end @@ -456,7 +456,7 @@ WOK            @manifest[:html] <<<<WOK  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml">           +<html xmlns="http://www.w3.org/1999/xhtml">  <head>  <title>  SiSU manifest: #{@md.title} diff --git a/lib/sisu/0.52/odf.rb b/lib/sisu/v0/odf.rb index bfa6d716..caf86a39 100644 --- a/lib/sisu/0.52/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,14 +49,14 @@                    ralph.amissah@gmail.com  =end  module SiSU_ODF -  require SiSU_lib + '/dal' -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/odf_format' +  require "#{SiSU_lib}/odf_format"    include OD_format -  require SiSU_lib + '/shared_txt' +  require "#{SiSU_lib}/shared_txt"    @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0    class Source      require 'zlib' @@ -91,7 +91,7 @@ module SiSU_ODF      end      private      class Split_text_object <Source -      require SiSU_lib + '/odf_format' +      require "#{SiSU_lib}/odf_format"        include SiSU_Viz        include OD_format        @@dp=nil @@ -103,7 +103,7 @@ module SiSU_ODF          #@format,@ocn=nil,nil          @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern        end -      def lev_segname_para_ocn  +      def lev_segname_para_ocn          @text=nil          if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/            if /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para) @@ -111,7 +111,7 @@ module SiSU_ODF            elsif  /^(([1-6])~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)              @format,@lev,@text,@ocn=$1,$2,$3,$4            elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para) -            @format,@text,@ocn=$1,$2,$3,$4 +            @format,@text,@ocn=$1,$2,$3            elsif /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;[um]\d+><#@dp:#@dp>$/m.match(@para)              @@alt_id_count+=1              @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,"x#{@@alt_id_count}" @@ -140,7 +140,7 @@ module SiSU_ODF        end      end      class Scroll <Source -      require SiSU_lib + '/shared_txt' +      require "#{SiSU_lib}/shared_txt"        @@img_count=0        @@odf={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] }        @@docstart=true @@ -172,7 +172,7 @@ module SiSU_ODF            if n =~/<br(?: \/)?>/              fix=n.split(/<br(?: \/)?>/) #watch #added              fix.each do |x| -              if x =~/\S+/; @n << x  +              if x =~/\S+/; @n << x                end              end            else              @n << n @@ -228,13 +228,13 @@ module SiSU_ODF          # divide pixel dimension by 37.79485 and retain 3 decimal places          # x=str.scan(/(aa[^a]+)/)          m,u=img[1],img[2] -        i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures if m =~/^(\S+?\.(?:png|jpg|gif))/ -        c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/ -        w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/      +        i=/^(\S+?\.(?:png|jpg|gif))/.match(m).captures.join if m =~/^(\S+?\.(?:png|jpg|gif))/ +        c=/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/.match(m).captures.join if m =~/^\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"/ +        w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/          w=(w.to_i/37.79485).to_s          h=(h.to_i/37.79485).to_s -        h=/([0-9]+\.\d{0,3})/.match(h).captures -        w=/([0-9]+\.\d{0,3})/.match(w).captures +        h=/([0-9]+\.\d{0,3})/.match(h).captures.join +        w=/([0-9]+\.\d{0,3})/.match(w).captures.join          image_source=image_src(i)          pwd=Dir.pwd          cp("#{image_source}/#{i}","#{@env.path.odf}/Pictures/#{i}") if image_source @@ -267,7 +267,7 @@ module SiSU_ODF        def text_link(para)          para.gsub!(@serial,'')          m=para.scan(/(\{([^}]+?)\}((?:https?|ftp)\S+))/) #sort -        if m  +        if m            m.each do |i|              txt,url=i[1],i[2]              txt.gsub!(/([)(\]\[])/,"\\\\\\1") @@ -289,7 +289,7 @@ module SiSU_ODF            %{<text:p text:style-name="P2">#{para}</text:p>}          when /^<:i2>\s/m; para.gsub!(/^<:i2>\s/m,'')            %{<text:p text:style-name="P3">#{para}</text:p>} -        else %{<text:p text:style-name="P1">#{para}</text:p>} #%{<text:p text:style-name="Standard">#{para}</text:p>}  +        else %{<text:p text:style-name="P1">#{para}</text:p>} #%{<text:p text:style-name="Standard">#{para}</text:p>}          end          para=par #+ %{<text:p text:style-name="Standard"/>}        end @@ -398,7 +398,7 @@ module SiSU_ODF          elsif para =~ /<:code(?:-end)?>/            @@odf[:body] << code(para)            @@odf[:body] << @br*2 -        elsif para =~ /<!Th?/ #elsif para =~ /<!Th?¡/  +        elsif para =~ /<!Th?/ #elsif para =~ /<!Th?¡/            @@odf[:body] << table(para)            @@odf[:body] << @br*2          else @@ -420,8 +420,8 @@ module SiSU_ODF          dir=SiSU_Env::Info_env.new(@md.fns)          @data_mod,@endnotes,@level,@cont,@copen,@odf_contents_close=Array.new(6){[]}          @rcdc=false -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @odf_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @odf_contents_close[x]='' }          odf_tail #($1,$2)          fix=[]          bullet=image_src('bullet_red.png') @@ -456,11 +456,11 @@ module SiSU_ODF            para.gsub!(/<u>(.+?)<\/u>/,'<text:span text:style-name="T3">\1</text:span>')            para.gsub!(/<sup>(.+?)<\/sup>/,'<text:span text:style-name="T4">\1</text:span>')            para.gsub!(/<sub>(.+?)<\/sub>/,'<text:span text:style-name="T5">\1</text:span>') -          para.gsub!(/`/,"'")    -          para.gsub!(//,'-')    -          para.gsub!(/·/,'*')    -          para.gsub!(/[“”]/,'""')    -          para.gsub!(/[–—]/,'-')   #— – chk  +          para.gsub!(/`/,"'") +          para.gsub!(//,'-') +          para.gsub!(/·/,'*') +          para.gsub!(/[“”]/,'""') +          para.gsub!(/[–—]/,'-')   #— – chk            para.gsub!(/ < /i,'<')            para.gsub!(/\\copy(?:right)?\b/,'©')            para.gsub!(/\\trademark\b|\\tm\b/,'®') @@ -477,7 +477,7 @@ module SiSU_ODF            #para.gsub!(/ /,' ')                                            # decide on            #para.gsub!(/\{(\S+?\.(?:png|jpg)) .+?\}(?:http:\/\/\S+|image)/,"    [ \\1 ]") #"[ #{@env.url.images_local}\/\\1 ]")            #para.gsub!(/<!TZ.+/,'') -          #para.gsub!(/^<!T.+/,"#@br[table: ] <~#>");  +          #para.gsub!(/^<!T.+/,"#@br[table: ] <~#>");            #p para if para =~safe_characters and @md.cmd =~/M/ #KEEP            #para.gsub!(/^(\{\S+?\.(?:png|jpg)\s+.+?"(.*?)"\s*\}\S+)/,"\\1 \n [image: \"\\2\"]")            wordlist=para.scan(/\S+/) @@ -488,7 +488,7 @@ module SiSU_ODF  	          end            end            @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/) -          if para !~/(^0~|<ENDNOTES>|<EOF>)/  +          if para !~/(^0~|<ENDNOTES>|<EOF>)/              if para =~@regx #/.+?<~\d+;\w\d+;\w\d+>.*/ #watch change                paranum=para[@regx,3]                @p_num=OD_format::Paragraph_number.new(paranum) @@ -506,7 +506,7 @@ module SiSU_ODF                    para                  when /^(3)~(?:(\S+))?/; odf_structure(para,$1,@sto.ocn,$2)                    para -                when /^(4)~(\S+)/;      odf_structure(para,$1,@sto.ocn,$2)  +                when /^(4)~(\S+)/;      odf_structure(para,$1,@sto.ocn,$2)                    # work on see SiSU_text_parts::Split_text_object                    para                  when /^(5)~(?:(\S+))?/; odf_structure(para,$1,@sto.ocn,$2) @@ -564,7 +564,7 @@ module SiSU_ODF                end              else                if para =~ /^(4)~(\S+)/ -                odf_structure(para,$1,@sto.ocn,$2)  +                odf_structure(para,$1,@sto.ocn,$2)                  para                elsif para =~/<~(\d+);m\d+;[mdv]\d+><#@dp:#@dp>$/                  odf_structure(para,nil,nil,nil) #watch may be problematic @@ -647,7 +647,7 @@ module SiSU_ODF          content << @@odf[:metadata]          content << @@odf[:owner_details] if @md.stmp =~/\w+/ #not used?          content << @@odf[:tail] -        Output.new(content.to_s,@md).odf +        Output.new(content,@md).odf          @@odf[:head],@@odf[:body],@@odf[:tail],@@odf[:metadata]=[],[],[],[]        end      end @@ -663,14 +663,8 @@ module SiSU_ODF          #filename_odf=SiSU_Env::SiSU_file.new(@md,'content.xml').mkfile          filename="#{@env.path.odf}/content.xml"          od=File.new(filename,'w+') -        @sisu=[]          @content.each do |para|                                                # this is a hack -          if para =~/^\S/ -            if para !~/^([*=-]|\.){5}/; od.puts para           #unix odf -            else                        od.puts para           #unix odf -            end -          else od.puts para # if para =~/^\s/ -          end +          od.puts para unless para =~/\A\s*\Z/          end          od.close          opendoc=@md.fn[:odf] diff --git a/lib/sisu/0.52/odf_format.rb b/lib/sisu/v0/odf_format.rb index edb202d8..5e348947 100644 --- a/lib/sisu/0.52/odf_format.rb +++ b/lib/sisu/v0/odf_format.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module OD_format -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    class Paragraph_number @@ -168,7 +168,7 @@ module OD_format        @parablock='' if @parablock =~/^<!$/        @parablock.gsub!(/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>/,'')        m=@parablock[/<!f(.+?)!>/,1] -      @@tablefoot << m if m  +      @@tablefoot << m if m        @parablock.gsub!(/<!f.+?!>/,'')        @@tablehead=1 if @parablock =~/<!Th¡/        @@table_counter+=1  if @parablock =~/<!Th?¡/ @@ -187,7 +187,7 @@ module OD_format            if @parablock =~/<!¡¡(\d+?)¡/              @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))            end -          if @parablock =~/¡¡(\d+?)¡/  +          if @parablock =~/¡¡(\d+?)¡/              @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))            end            if @parablock =~/!>/ diff --git a/lib/sisu/0.52/options.rb b/lib/sisu/v0/options.rb index b253aab1..23b48d3e 100644 --- a/lib/sisu/0.52/options.rb +++ b/lib/sisu/v0/options.rb @@ -35,7 +35,7 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system @@ -48,7 +48,7 @@  =end  module SiSU_commandline -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    class Options      attr_accessor :cmd,:mod,:files,:fns,:fnb,:what      def initialize(a) @@ -103,7 +103,7 @@ module SiSU_commandline            if FileTest.file?(x); f << x            else  puts "file not found: #{x}"            end -        else w=x  +        else w=x            puts "#{x} in #{a.join(' ')}?"          end        end diff --git a/lib/sisu/0.52/param.rb b/lib/sisu/v0/param.rb index eb99d15b..ecf5ca25 100644 --- a/lib/sisu/0.52/param.rb +++ b/lib/sisu/v0/param.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -50,10 +50,10 @@ module SiSU_Param    require 'uri'    require 'pstore'    require 'ftools' -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/param_identify_markup' -  require SiSU_lib + '/help' +  require "#{SiSU_lib}/param_identify_markup" +  require "#{SiSU_lib}/help"    include SiSU_Help    @@date=SiSU_Env::Info_date.new    @@symlnk=Create_system_link.new @@ -83,7 +83,7 @@ module SiSU_Param          if File.exist?(@pstorefile)            param_msg='Parameters from pstore'            store=PStore.new(@pstorefile) -          store.transaction do |s|  +          store.transaction do |s|              @md=s['md']              s.commit            end @@ -123,7 +123,7 @@ module SiSU_Param        protected        def determine_papersize(l)          l=case l -        when /eu|europe|uk/i;           'A4'                 #European default, SiSU default  +        when /eu|europe|uk/i;           'A4'                 #European default, SiSU default          when /(?:us-)?legal|legal/i;    'US_legal'           #U.S. alternative          when /(?:us-)?letter|u.s.|us/i; 'US_letter'          #U.S. default          when /book_a5|a5/i;             'book_a5' @@ -230,7 +230,7 @@ module SiSU_Param          fns_array.each do |par|                                                                     #% Scan document            para=par.gsub(/\n/,' ')            if para !~/^\%+\s/ and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included -            raise "Old markup style in file #@fns, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n"  +            raise "Old markup style in file #@fns, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n"            end  	        regx_header=/^(?:0~|@\S+?:[+-]?\s)/            if para =~regx_header #or para=~/^(?:1|:?A)~/ @@ -275,7 +275,7 @@ module SiSU_Param              when /^(?:0~publisher|@publisher:)\s+(.+?)$/m                                           #% metainfo DC                @dc_publisher=$1              when /^(?:0~|@)date.+?$/m                                                               #% metainfo DC -              if para =~/(?:0~date|@date:)\s+(.+?)$/m  +              if para =~/(?:0~date|@date:)\s+(.+?)$/m                  @dc_date=$1.strip                  if @dc_date !~regx_date and not @dc_date.empty?                    tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',@dc_date) @@ -283,7 +283,7 @@ module SiSU_Param                  end                  @date_scheme='scheme="ISO-8601"' if @dc_date =~/\d{4}-\d{2}-\d{2}/                end -              if para =~/(?:0~date\.created|@date\.created:)\s*(.+?)$/m  +              if para =~/(?:0~date\.created|@date\.created:)\s*(.+?)$/m                  date=$1.strip                  if date !~regx_date and not date.empty?                    tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) @@ -292,7 +292,7 @@ module SiSU_Param                  @dc_date_created=date                  @date_created_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/                end -              if para =~/(?:0~date\.issued|@date\.issued:)\s*(.+?)$/m  +              if para =~/(?:0~date\.issued|@date\.issued:)\s*(.+?)$/m                  date=$1.strip                  if date !~regx_date and not date.empty?                    tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) @@ -301,7 +301,7 @@ module SiSU_Param                  @dc_date_issued=date                  @date_issued_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/                end -              if para =~/(?:0~date\.available|@date\.available:)\s*(.+?)$/m  +              if para =~/(?:0~date\.available|@date\.available:)\s*(.+?)$/m                  date=$1.strip                  if date !~regx_date and not date.empty?                    tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) @@ -310,7 +310,7 @@ module SiSU_Param                  @dc_date_available=date                  @date_available_scheme='scheme="ISO-8601"' if date =~/\d{4}-\d{2}-\d{2}/                end -              if para =~/^(?:0~date\.valid|@date\.valid:)\s*(.+?)$/m  +              if para =~/^(?:0~date\.valid|@date\.valid:)\s*(.+?)$/m                  date=$1.strip                  if date !~regx_date and not date.empty?                    tell=SiSU_Screen::Ansi.new(@cmd,'Date Format should be','YYYY-MM-DD','please correct document','Date','field, current value:',date) @@ -332,7 +332,7 @@ module SiSU_Param              when /^(?:0~format|@format:)\s+(.+?)$/m;         @dc_format=$1                          #% metainfo DC              when /^(?:0~identifier|@identifier:)\s+(.+?)$/m; @dc_identifier=$1                      #% metainfo DC              when /^(?:0~source|@source:)\s+(.+?)$/m;         @dc_source=$1                          #% metainfo DC -            when /^(?:0~language(?:\.document)?|@language(?:\.document)?:)\s+(.+?)$/m               #% metainfo DC  +            when /^(?:0~language(?:\.document)?|@language(?:\.document)?:)\s+(.+?)$/m               #% metainfo DC                x=$1.strip                lang=SiSU_Env::Standardise_language.new(x.dup)                @dc_language[:code]=lang.code @@ -355,26 +355,20 @@ module SiSU_Param              when /^(?:0~abstract|@abstract)\s+(.+?)$/m;      @abstract=$1                           #% metainfo DC              when /^(?:0~tags?|@tags?:)\s+\S/m                                                       #% metainfo                tags=par.match(/^(?:0~tags?|@tags?:)\s+(.+)$/m)[1] -              tags.split(/,|$/).each do |tag|  +              tags.split(/,|$/).each do |tag|                  tag.strip!                  @tags << tag                  @tag_array << tag.split(/:/) -                tag_a = tag.downcase.gsub(/\s+/,'_').gsub(/(.+)/,'[\1]') +                tag_a=tag.downcase.gsub(/\s+/,'_').gsub(/(.+)/,'[\1]')                  tag_a=tag_a.split(/:/).join('][')                  @tag_a << tag_a                end              when /^(?:0~catalogue|@catalogue:)\s+(.+)?$/m                                           #% metainfo                m=$1 -              m.split(/;?\s+/) #spaces within a catalogue category not permitted, e.g. isbn -              #tags=par.match(/^(?:0~tags?|@tags?:)\s+(.+)$/im)[1] -              m.each do |c| -                case c -                when /pg=/; @cls_pg=c.match(/pg=(\S+)/)[1] -                when /isbn=/; @cls_isbn=c.match(/isbn=(\S+)/)[1] -                when /dewey=/; @cls_dewey=c.match(/dewey=(\S+)/)[1] -                when /loc=/; @cls_loc=c.match(/loc=(\S+)/)[1] -                end -              end +              @cls_pg=m.match(/pg=(\S+)/)[1] if m =~/pg=/ +              @cls_isbn=m.match(/isbn=(\S+)/)[1] if m =~/isbn=/ +              @cls_dewey=m.match(/dewey=(\S+)/)[1] if m =~/dewey=/ +              @cls_loc=m.match(/loc=(\S+)/)[1] if m =~/loc=/              when /^(?:0~class(?:ify)?_loc|@class(?:ify)?_loc:)\s+(.+?)$/m;             @cls_loc=$1  #% metainfo              when /^(?:0~class(?:ify)?_dewey|@class(?:ify)?_dewey:)\s+(.+?)$/m;         @cls_dewey=$1 #% metainfo              when /^(?:0~class(?:ify)?_pg|@class(?:ify)?_pg)\s+(.+?)$/m;                @cls_pg=$1   #% metainfo @@ -383,6 +377,7 @@ module SiSU_Param              when /^(?:0~(?:toc|structure)|@(?:toc|structure):)\s+(.+?)$/m                           #% processing                doc_toc_str=$1                @toc=doc_toc_str.split(/;\s*/) +              @toc=[ @toc ] if @toc == String                #@toc.each {|x| x.gsub!(/\{/,'\{') } #FIX~                lv1=@toc[0] ||='1~ '                                        #some arbitrary changes made                @lv1=/^#{lv1}\b/ @@ -400,9 +395,10 @@ module SiSU_Param                if para =~/(?:0~|@)(?:markup|level|page):?\s+(.+?)$/m                  page_break_str=$1                  pagebreaks=page_break_str.split(/;\s*/) +                #pagebreaks=[ pagebreaks ] if pagebreaks == String                  page_new,page_break,num_top=toc_lev_limit=nil                  pagebreaks.each do |x| -                  page_new = x[/(:?[\dA-C],?)+/] if x=~/new|clear/  +                  page_new = x[/(:?[\dA-C],?)+/] if x=~/new|clear/                    page_break = x[/(:?[\dA-C],?)+/] if x =~/break/                    num_top = x[/:?[\dA-C]/].to_i if x =~/num_top/                    toc_lev_limit = x[/:?[\dA-C]/].to_i if x =~/toc_limit/ @@ -456,13 +452,14 @@ module SiSU_Param                if doc_links_str=~/\{.+?\}(?:(?:https?|ftp):\/|\.\.)\/\S+(?:\s|$)/                  doc_links=doc_links_str.scan(/\{.+?\}(?:(?:https?|ftp):\/|\.\.)\/\S+/)                  count=1 -                doc_links.each do |x|  +                doc_links.each do |x|                    @lnk[count]={}                    @lnk[count][:say],@lnk[count][:url]=/\{\s*(.+?)\s*\}((?:(?:https?|ftp):\/|\.\.)\/\S+)/im.match(x)[1,2]                    count +=1                  end                else                  lnks=doc_links_str.split(/;\s+/) +                #lnks=[ lnks ] if lnks == String                  count=1                  lnks.each do |x|                    @lnk[count]={} @@ -501,7 +498,7 @@ module SiSU_Param                  filename,vnumber,date,time,operator=contains.match(ver).captures                  @sc_filename,@sc_number,@sc_date,@sc_time=filename,vnumber,date,time                end -              @sc_info=true if para[/(?:0~(?:rcs|cvs)|@(?:rcs|cvs):)\+/]  +              @sc_info=true if para[/(?:0~(?:rcs|cvs)|@(?:rcs|cvs):)\+/]              when /^@base_program:\s+(.+?)$/;                   @base_program=$1                                       #% processing                #% break - break, not necessary to process headers further :-) but necessary to extract endnotes etc. ;-(              end @@ -514,10 +511,10 @@ module SiSU_Param              if @dc_creator                @dc_rights ||=if @dc_date =~/([12][890]\d{2})/                     #matches years 1800 through 20\d\d 2004w19                  ('Copyright ' + @dc_creator) + ' ' + $1 -              else 'Copyright ' + @dc_creator  +              else 'Copyright ' + @dc_creator                end              end -          else                                                                   #%  +          else                                                                   #%              if para =~ /^(?:1|:?A)~/                                                                      #% processing                if para=~/^:?A~/                  if @markup.nil? or @markup.empty?;  @markup=@markup_version.to_s @@ -584,7 +581,7 @@ module SiSU_Param            translated=[]            translate_list=[@pagenew,@pagebreak,@num_top,@toc_lev_limit]            translate_list.each do |t| -            translate = t.to_s if t +            translate=t.to_s if t              translated << if translate                #translate.gsub!(/6/,'9')                #translate.gsub!(/5/,'8') @@ -627,7 +624,7 @@ module SiSU_Param              end            end          end -        @dc_publisher ||= "#@@publisher (this copy)"  +        @dc_publisher ||= "#@@publisher (this copy)"          fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(@fns)          unless @dc_language[:code] and @dc_language[:name]            lang=@env.i18n.language #default language settings for directory by name, or in sysrc.yml @@ -748,7 +745,7 @@ module SiSU_Param            tell.txt_grey if @cmd =~/v/          end          @data=nil                                                                #else whole file's contents are stored in md pstore & is not required to be... big waste actually -        Store.new(self,@env).store                                           #% pstore  +        Store.new(self,@env).store                                           #% pstore          self        end        private @@ -762,8 +759,8 @@ module SiSU_Param            tell=SiSU_Screen::Ansi.new(@md.cmd,"PStore -> #@pstorefile")            tell.txt_grey if @md.cmd =~/v/            store=PStore.new(@pstorefile) -          store.transaction do |s|  -            s['md']=@md  +          store.transaction do |s| +            s['md']=@md              #doc.each{|x,y| puts "#{x}, #{y}; "}              s.commit            end diff --git a/lib/sisu/0.52/param_identify_markup.rb b/lib/sisu/v0/param_identify_markup.rb index cba6d39d..673993bc 100644 --- a/lib/sisu/0.52/param_identify_markup.rb +++ b/lib/sisu/v0/param_identify_markup.rb @@ -36,7 +36,7 @@      http://www.fsf.org/licenses/gpl.html      http://www.gnu.org/copyleft/gpl.html      http://www.jus.uio.no/sisu/gpl2.fsf -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -53,9 +53,9 @@ module SiSU_Markup      def identify        @version_determined,@version_declared,@declared_doc_type=@@version_determined,@@version_declared,@@declared_doc_type        if @opt.fns != @@fns -        if @cont[0] =~ /^(?:%\s+)?SiSU\s+(text|master|insert)\s+([0-9](?:\.[0-9]+){1,2})/ or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/  +        if @cont[0] =~ /^(?:%\s+)?SiSU\s+(text|master|insert)\s+([0-9](?:\.[0-9]+){1,2})/ or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/            @declared_doc_type,@version_declared=$1,$2 -        elsif @cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/  +        elsif @cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/            @version_declared=$1          end          @flag_38=false diff --git a/lib/sisu/0.52/plaintext.rb b/lib/sisu/v0/plaintext.rb index eb43dfa8..c39cba14 100644 --- a/lib/sisu/0.52/plaintext.rb +++ b/lib/sisu/v0/plaintext.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,14 +49,14 @@                    ralph.amissah@gmail.com  =end  module SiSU_Plaintext -  require SiSU_lib + '/dal' -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/plaintext_format' +  require "#{SiSU_lib}/plaintext_format"    include Format -  require SiSU_lib + '/shared_txt' +  require "#{SiSU_lib}/shared_txt"    pwd=Dir.pwd    @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0    @@tablefoot='' @@ -95,7 +95,7 @@ module SiSU_Plaintext      end      private      class Split_text_object <Source -      require SiSU_lib + '/plaintext_format' +      require "#{SiSU_lib}/plaintext_format"        include SiSU_Viz        include Format        @@alt_id_count=0 @@ -106,7 +106,7 @@ module SiSU_Plaintext          @format,@ocn='null','null'          @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern        end -      def lev_segname_para_ocn  +      def lev_segname_para_ocn          @text=nil          if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/            if /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para) @@ -114,7 +114,7 @@ module SiSU_Plaintext            elsif  /^(([1-6])~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)              @format,@lev,@text,@ocn=$1,$2,$3,$4            elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para) -            @format,@text,@ocn=$1,$2,$3,$4 +            @format,@text,@ocn=$1,$2,$3            elsif /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;[um]\d+><#@dp:#@dp>$/m.match(@para)              @@alt_id_count+=1              @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,"x#{@@alt_id_count}" @@ -143,7 +143,7 @@ module SiSU_Plaintext        end      end      class Scroll <Source -      require SiSU_lib + '/shared_txt' +      require "#{SiSU_lib}/shared_txt"        include SiSU_text_utils        @@endnotes_para=[]        @@plaintext={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] } @@ -184,14 +184,14 @@ module SiSU_Plaintext            if n =~/<br(?: \/)?>/              fix = n.split(/<br(?: \/)?>/) #watch #added              fix.each do |x| -              unless x.empty?; @n << x  +              unless x.empty?; @n << x                end              end            else                 @n << n            end          end          notes=@n.flatten -        notes.each do |e|  +        notes.each do |e|            util=if e.to_s =~/^\[[\d*+]+\]:/; SiSU_text_utils::Wrap.new(e.to_s,70,4,1)            else                              SiSU_text_utils::Wrap.new(e.to_s,70,1,1)            end @@ -285,7 +285,7 @@ WOK          end          if @@endnotes_para and @@dostype =~/footnote/ #edit out to switch off endnotes following paragraph to which they belong            @@plaintext[:body] << @br -          @@endnotes_para.each {|e| @@plaintext[:body] << e << @br}  +          @@endnotes_para.each {|e| @@plaintext[:body] << e << @br}          elsif @@endnotes_para and @@dostype =~/endnote/            @@plaintext[:body] << @br*2          end @@ -295,24 +295,11 @@ WOK          data=@data          dir=SiSU_Env::Info_env.new(@md.fns)          @data_mod,@endnotes,@level,@cont,@copen,@plaintext_contents_close=Array.new(6){[]} -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @plaintext_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @plaintext_contents_close[x]='' }          plaintext_tail #($1,$2)          table_message='[table omitted, see other document formats]'          fix=[] -        #data.each do |para| #high cost to deal with <br> appropriately within plaintext, consider -        #  para=para.dup -        #  if para =~/<br(?: \/)?>/ -        #    puts para -        #    fix = para.split(/<br(?: \/)?>/) #watch #added -        #    fix.each do |x| -        #      if x =~/\S+/; @data_mod << x -        #      end -        #    end -        #  else              @data_mod << para -        #  end -        #end -        #data=@data_mod.flatten          data.each do |para|            para.gsub!(/<!Th?¡.+/m,"#@br#{table_message}")            para.gsub!(/.+?<-#>/,'')                                           # remove dummy headings (used by html) #check @@ -438,13 +425,13 @@ WOK          content << @@plaintext[:open]          content << @@plaintext[:head]          content << @@plaintext[:body] -        content << @@plaintext[:endnotes] if @@dostype =~/endnotes/  +        content << @@plaintext[:endnotes] if @@dostype =~/endnotes/          content << "#@br#{divider*70}#@br"          content << @@plaintext[:metadata]          content << "#@br#{divider*70}#@br" if @md.stmp =~/\w+/ #not used?          content << @@plaintext[:owner_details] if @md.stmp =~/\w+/ #not used?          content << @@plaintext[:tail] -        Output.new(content.to_s,@md).plaintext +        Output.new(content,@md).plaintext          @@plaintext[:head],@@plaintext[:body],@@plaintext[:tail],@@plaintext[:metadata]=[],[],[],[]        end      end diff --git a/lib/sisu/0.52/plaintext_format.rb b/lib/sisu/v0/plaintext_format.rb index 9ceb3867..c44c5a06 100644 --- a/lib/sisu/0.52/plaintext_format.rb +++ b/lib/sisu/v0/plaintext_format.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module Format -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    class Paragraph_number diff --git a/lib/sisu/0.52/relaxng.rb b/lib/sisu/v0/relaxng.rb index b68747a5..cb79773d 100644 --- a/lib/sisu/0.52/relaxng.rb +++ b/lib/sisu/v0/relaxng.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_relaxng -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    class RelaxNG      def gpl2_or_later        @gpl2_or_later =<<RELAXNG @@ -87,11 +87,11 @@ module SiSU_relaxng   # SiSU was first released to the public on January 4th 2005   # SiSU uses: - #  + #   #   Standard SiSU markup syntax,   #   Standard SiSU meta-markup syntax, and the   #   Standard SiSU object citation numbering and system - #  + #   # © Ralph Amissah 1997, current 2007.   # All Rights Reserved. @@ -252,7 +252,7 @@ element-head =    }  # body text/contents  # includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc. -element-txt =  +element-txt =    element txt {      text*      & element b { text }* @@ -397,7 +397,7 @@ element-head =    }  # body text/contents  # includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc. -element-txt =  +element-txt =    element txt {      text*      & element b { text }* diff --git a/lib/sisu/0.52/remote_put.rb b/lib/sisu/v0/remote_put.rb index 19bfbe80..1d7c303a 100644 --- a/lib/sisu/0.52/remote_put.rb +++ b/lib/sisu/v0/remote_put.rb @@ -35,26 +35,26 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved.   * Notes: this operation should probably be threaded & run at its own pace,       independent of rest of program -     primary problem will be with notification of progress,  +     primary problem will be with notification of progress,       implement naively to start with   * Ralph Amissah: ralph@amissah.com                    ralph.amissah@gmail.com  =end  module SiSU_Remote -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    pwd=Dir.pwd -  class Put  +  class Put      def initialize(opt)        @opt=opt        @dir=SiSU_Env::Info_env.new(@opt.fns) @@ -63,22 +63,22 @@ module SiSU_Remote        end        @remote=SiSU_Env::Info_remote.new(@opt)      end -    def scp  +    def scp        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->',@put)        tell.dark_grey_title_hi unless @opt.cmd =~/q/        @remote.scp      end -    def rsync  +    def rsync        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->',@put)        tell.dark_grey_title_hi unless @opt.cmd =~/q/        @remote.rsync      end -    def scp_base  +    def scp_base        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement of base site ->','excluding images')        tell.dark_grey_title_hi unless @opt.cmd =~/q/        @remote.scp_base      end -    def scp_base_all  +    def scp_base_all        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->','complete')        tell.dark_grey_title_hi unless @opt.cmd =~/q/        @remote.scp_base_all diff --git a/lib/sisu/0.52/response.rb b/lib/sisu/v0/response.rb index 7748343f..dfe040d0 100644 --- a/lib/sisu/0.52/response.rb +++ b/lib/sisu/v0/response.rb @@ -34,7 +34,7 @@      http://www.fsf.org/licenses/gpl.html      http://www.gnu.org/copyleft/gpl.html      http://www.jus.uio.no/sisu/gpl2.fsf -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -51,7 +51,7 @@ module SiSU_Response        ans=if response == 'yes'; true        elsif response == 'no'; false        elsif response =~/^quit|exit$/; exit -      else puts "[please type: 'yes', 'no' or 'quit']"  +      else puts "[please type: 'yes', 'no' or 'quit']"          answer?(ask)        end        ans diff --git a/lib/sisu/0.52/rexml.rb b/lib/sisu/v0/rexml.rb index cfedaed9..960b1682 100644 --- a/lib/sisu/0.52/rexml.rb +++ b/lib/sisu/v0/rexml.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -51,10 +51,10 @@  module SiSU_Rexml    # load XML file for REXML parsing    require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir'] -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    class Rexml      require 'rexml/document' if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir'] @@ -64,7 +64,7 @@ module SiSU_Rexml        @prog=SiSU_Env::Info_program.new #(md.fns) #if md        if File.file?"#{@env.path.output}/#{@md.fnb}/#@fno"          @fnap="#{@env.path.output}/#{@md.fnb}/#@fno" #index.xml causes problems with index.html in server config -      elsif File.file?"#{Dir.pwd}/#@fno"  +      elsif File.file?"#{Dir.pwd}/#@fno"          @fnap="#{Dir.pwd}/#@fno"        end        @e_head='/document/head' diff --git a/lib/sisu/0.52/screen_text_color.rb b/lib/sisu/v0/screen_text_color.rb index 7fe6b39d..cbe19ef3 100644 --- a/lib/sisu/0.52/screen_text_color.rb +++ b/lib/sisu/v0/screen_text_color.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -198,10 +198,10 @@ module SiSU_Screen        %{\t   #{@cX.orange}Rescued#{@cX.off} #{@cX.grey}An#{@cX.off} #{@cX.fuschia}ERROR#{@cX.off} #{@cX.grey}occurred, message:"#{@cX.off} #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.brown}#{@txt[2]}#{@cX.off}}      end      def warn -      puts "\t  #{@cX.brown}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"  +      puts "\t  #{@cX.brown}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"      end      def error -      puts "\t  #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off}"  +      puts "\t  #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off}"      end      def error2        puts "\t  #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.fuschia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" @@ -252,31 +252,31 @@ module SiSU_Screen          %{php_nav only: #{@txt[4]}}      end      def txt_white -      puts "\t#{@cX.white}#{@txt[0]}#{@cX.off} #{@cX.white}#{@txt[1]}#{@cX.off}"  +      puts "\t#{@cX.white}#{@txt[0]}#{@cX.off} #{@cX.white}#{@txt[1]}#{@cX.off}"      end      def txt_grey -      puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off}"  +      puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off}"      end      def txt_cyan -      puts "\t#{@cX.cyan}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"  +      puts "\t#{@cX.cyan}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"      end      def txt_blue -      puts "\t#{@cX.blue}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"  +      puts "\t#{@cX.blue}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"      end      def txt_red -      puts "\t#{@cX.red}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off}"  +      puts "\t#{@cX.red}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off}"      end      def txt_green -      puts "\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"  +      puts "\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}"      end      def url #clean        blue      end      def result -      puts "\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.blue}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"  +      puts "\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.blue}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"      end      def maintenance -      puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"  +      puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}"      end      def instruct        puts %{\t  #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.cyan}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off} #{@cX.cyan}#{@txt[3]}#{@cX.off} #{@cX.grey}#{@txt[4]}#{@cX.off} "#{@cX.brown}#@f#{@cX.off}"} @@ -371,7 +371,7 @@ module SiSU_Screen        puts %{ #{@cX.grey_hi}#{@cX.black}reserved#{@cX.off*2}}      end      def meta_verse_title -      puts %{#{@cX.green_hi}#{@cX.black}MetaVerse#{@cX.off*2} }  +      puts %{#{@cX.green_hi}#{@cX.black}MetaVerse#{@cX.off*2} }      end      def meta_verse_title_v        b=sourcename(@txt[0]) diff --git a/lib/sisu/0.52/semantics.rb b/lib/sisu/v0/semantics.rb index 2d827f52..29f860f7 100644 --- a/lib/sisu/0.52/semantics.rb +++ b/lib/sisu/v0/semantics.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module Semantic -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    class YamlInfoCreate      def initialize(file='')        @file=file @@ -127,12 +127,12 @@ module Semantic        @sisu=[]      end      def loadfile -      if FileTest.file?("#@pwd/semantic.yml")  +      if FileTest.file?("#@pwd/semantic.yml")          @yaml||=YAML::load(File::open("#@pwd/semantic.yml"))        end      end      def printscreen -      @yaml.each do |y|  +      @yaml.each do |y|          puts y['title'] if y['title']          puts y['subtitle'] if y['subtitle']          puts y['creator'] if y['creator'] @@ -174,7 +174,7 @@ module Semantic  <language>en-us</language>  -  } -      @yaml.each do |y|  +      @yaml.each do |y|          if y['title'] and ((y['subject'] and "#{y['subject']}"[match]) or (y['keywords'] and "#{y['keywords']}"[match]))            puts y['subject']            @sisu <<  %{- @@ -187,7 +187,7 @@ module Semantic    -    }            @sisu << %{<description>} -          @sisu << %{<h1 id="#{y['title'].gsub(/\s+/, '-')}">#{y['title']}</h1>}  +          @sisu << %{<h1 id="#{y['title'].gsub(/\s+/, '-')}">#{y['title']}</h1>}            @sisu << %{#{y['title']} } if y['title']            @sisu << %{#{y['subtitle']} } if y['subtitle']            @sisu << %{#{y['creator'] }} if y['creator'] @@ -260,7 +260,7 @@ module Semantic      end      def dummy        @sisu <<  %{<doc>} -      @yaml.each do |y|  +      @yaml.each do |y|          @sisu <<  %{<content>}          @sisu <<  %{#{y['title']}} if y['title']          @sisu <<  %{#{y['subtitle']}} if y['subtitle'] @@ -331,9 +331,9 @@ module Semantic    end  end                                                                                   #% start -require SiSU_lib + '/param' -require SiSU_lib + '/defaults' -require SiSU_lib + '/sysenv' +require "#{SiSU_lib}/param" +require "#{SiSU_lib}/defaults" +require "#{SiSU_lib}/sysenv"  include SiSU_Param  include SiSU_Env  include SiSU_Viz diff --git a/lib/sisu/0.52/share_src.rb b/lib/sisu/v0/share_src.rb index 9574de18..6f85c899 100644 --- a/lib/sisu/0.52/share_src.rb +++ b/lib/sisu/v0/share_src.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,7 +49,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Markup -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    pwd=Dir.pwd    class Source @@ -70,7 +70,7 @@ module SiSU_Markup        File.mkpath(@output_path) unless FileTest.directory?(@output_path)        if FileTest.directory?(@output_path)          unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@output_path) -        else  +        else            req=@opt.fns.gsub(/(.+)?\.ssm$/,'\1.composite.sst')            file=@opt.fns.gsub(/(.+)?\.ssm$/,'\1._sst')            if FileTest.file?(file);  cp(file,"#@output_path/#{req}") diff --git a/lib/sisu/0.52/share_src_kdissert.rb b/lib/sisu/v0/share_src_kdissert.rb index a6a2e968..f9c51d66 100644 --- a/lib/sisu/0.52/share_src_kdissert.rb +++ b/lib/sisu/v0/share_src_kdissert.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,7 +49,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Kdi_source -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    pwd=Dir.pwd    class Source diff --git a/lib/sisu/0.52/shared_db.rb b/lib/sisu/v0/shared_db.rb index ba98e195..24f6432a 100644 --- a/lib/sisu/0.52/shared_db.rb +++ b/lib/sisu/v0/shared_db.rb @@ -35,27 +35,27 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved.   * Ralph Amissah: ralph@amissah.com                    ralph.amissah@gmail.com  =end -module  SiSU_DB  -  require SiSU_lib + '/db_columns' -  require SiSU_lib + '/db_tests' -  require SiSU_lib + '/db_create' -  require SiSU_lib + '/db_select' -  require SiSU_lib + '/db_indexes' -  require SiSU_lib + '/db_drop' -  require SiSU_lib + '/db_remove' -  require SiSU_lib + '/db_load_tuple' -  require SiSU_lib + '/db_import' +module  SiSU_DB +  require "#{SiSU_lib}/db_columns" +  require "#{SiSU_lib}/db_tests" +  require "#{SiSU_lib}/db_create" +  require "#{SiSU_lib}/db_select" +  require "#{SiSU_lib}/db_indexes" +  require "#{SiSU_lib}/db_drop" +  require "#{SiSU_lib}/db_remove" +  require "#{SiSU_lib}/db_load_tuple" +  require "#{SiSU_lib}/db_import"    class Column_size < SiSU_DB_columns::Column_size    end    class Test < SiSU_DB_tests::Test diff --git a/lib/sisu/0.52/shared_html.rb b/lib/sisu/v0/shared_html.rb index a236783f..64d7436d 100644 --- a/lib/sisu/0.52/shared_html.rb +++ b/lib/sisu/v0/shared_html.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,8 +47,8 @@                    ralph.amissah@gmail.com  =end  module SiSU_HTML_shared -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/html_table' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/html_table"    class Table < SiSU_HTML_table::Table    end  end diff --git a/lib/sisu/0.52/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb index 4d4e03b1..93e77db7 100644 --- a/lib/sisu/0.52/shared_html_lite.rb +++ b/lib/sisu/v0/shared_html_lite.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Format_Shared -  require SiSU_lib + '/defaults' +  require "#{SiSU_lib}/defaults"    include SiSU_Viz    class CSS_Format      def initialize(content=nil,id=nil,ocnd='',ocns='',lv='',hname=nil) @@ -85,16 +85,16 @@ GSUB        %{#{@tab*1}<p class="h#@lv" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}  << "\n"      end      def norm_comment -      %{#{@tab*1}<p class="norm" id="none" type="comment">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}  +      %{#{@tab*1}<p class="norm" id="none" type="comment">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}      end      def norm -      %{#{@tab*1}<p class="norm" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}  +      %{#{@tab*1}<p class="norm" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}      end      def indent1 -      %{#{@tab*1}<p class="indent1" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}  +      %{#{@tab*1}<p class="indent1" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}      end      def indent2 -      %{#{@tab*1}<p class="indent2" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}  +      %{#{@tab*1}<p class="indent2" id="#@ocn" type="substantive">\n#{@tab*2}#@content\n#{@tab*1}</p>\n}      end      def para_table        %{<p class="norm" align="left"><font #{@vz.font_small} #{@vz.font_color} #{@vz.font_face}>} @@ -106,7 +106,7 @@ GSUB        @new_content=[]        @content.split(/\n/).each do |parablock|          m=parablock[/<!f(.+?)!>/,1] -        @@tablefoot<<m if m  +        @@tablefoot<<m if m          parablock.gsub!(/<!f.+?!>/,'')          @@tablehead=1 if parablock =~/<!Th¡/          parablock.gsub!(/<!Th?¡.+?!~(\d+)>/, diff --git a/lib/sisu/0.52/shared_txt.rb b/lib/sisu/v0/shared_txt.rb index bd0b41cc..ddf2b275 100644 --- a/lib/sisu/0.52/shared_txt.rb +++ b/lib/sisu/v0/shared_txt.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -75,7 +75,7 @@ module SiSU_text_utils          end          out[line]="#{out[line]} #{word}" if word        end -      out.join(spaces_indent).gsub(/\A\n+/m,'').insert(0,spaces_hang)  +      out.join(spaces_indent).gsub(/\A\n+/m,'').insert(0,spaces_hang)      end      def line_wrap_indent1        @n_indent,@n_hang=2,2 @@ -259,19 +259,19 @@ module SiSU_text_parts_flatfile        #@format,@ocn=nil,nil        @@dl ||=SiSU_Env::Info_env.new.digest.length      end -    def lev_segname_para_ocn  +    def lev_segname_para_ocn        if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>.*/          if /^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)            @format,segname,@text,@ocn=$1,$2,$3,$4 -          @format="#@format~#{segname}" #  +          @format="#@format~#{segname}" #          elsif  /^([1-6]~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para) -          @format,@text,@ocn=$1,$2,$3 #,$4 +          @format,@text,@ocn=$1,$2,$3          elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)            @format,@text,@ocn=$1,$2,$3          elsif /^([1-6])~(\S+)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)            @@alt_id_count+=1            @format,segname,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}" -          @format="#@format~#{segname}" #  +          @format="#@format~#{segname}" #          elsif /^([1-6]~)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para)            @@alt_id_count+=1            @format,@text,@ocn=$1,$2,"x#{@@alt_id_count}" diff --git a/lib/sisu/0.52/shared_xml.rb b/lib/sisu/v0/shared_xml.rb index a3b4b07f..6cb6f991 100644 --- a/lib/sisu/0.52/shared_xml.rb +++ b/lib/sisu/v0/shared_xml.rb @@ -35,21 +35,21 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved.   * Ralph Amissah: ralph@amissah.com                    ralph.amissah@gmail.com  =end -module SiSU_text_parts  +module SiSU_text_parts    class Split_text_object -    require SiSU_lib + '/param' -    require SiSU_lib + '/xml_format' +    require "#{SiSU_lib}/param" +    require "#{SiSU_lib}/xml_format"      include SiSU_Viz      include SiSU_XML_format      @@alt_id_count=0 @@ -65,15 +65,15 @@ module SiSU_text_parts        if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/          if /^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)            @format,segname,@text,@ocn=$1,$2,$3,$4 -          @format="#@format~#{segname}" #  +          @format="#@format~#{segname}" #          elsif  /^([1-6]~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para) -          @format,@text,@ocn=$1,$2,$3 #,$4 +          @format,@text,@ocn=$1,$2,$3          elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)            @format,@text,@ocn=$1,$2,$3          elsif /^([1-6])~(\S+)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)            @@alt_id_count+=1            @format,segname,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}" -          @format="#@format~#{segname}" #  +          @format="#@format~#{segname}" #          elsif  /^([1-6]~)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)            @@alt_id_count+=1            @format,@text,@ocn=$1,$2,"x#{@@alt_id_count}" @@ -100,7 +100,7 @@ module SiSU_text_parts        if @para =~/^(\d~|<:.+?>).+/          if /^([1-6])~(\S+)\s+(\S.+)/m.match(@para)            @format,segname,@text=$1,$2,$3 -          @format="#@format~#{segname}" #  +          @format="#@format~#{segname}" #          elsif /^([1-6]~)\s+(\S.+)/m.match(@para)            @format,@text=$1,$2          elsif /<:(.+?)>\s*(\S.+?)/m.match(@para) @@ -108,7 +108,7 @@ module SiSU_text_parts          elsif /^([1-6])~(\S+)\s+(\S.+?)/m.match(@para)            @@alt_id_count+=1            @format,segname,@text=$1,$2,$3 -          @format="#@format~#{segname}" #  +          @format="#@format~#{segname}" #          elsif /^([1-6]~)\s+(\S.+?)/m.match(@para)            @@alt_id_count+=1            @format,@text=$1,$2 @@ -142,12 +142,12 @@ module SiSU_XML_munge      end      def char_enc #character encode        def utf8(para='') -        if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn  +        if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn            #¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûü            #¢£¥§©ª«®°±²³µ¶¹º»¼½¾×÷            ##para.gsub!(//, '&#;')            ##para.gsub!(//, '&;') -          para.gsub!(/¢/, '¢') # '¢'   # ¢  +          para.gsub!(/¢/, '¢') # '¢'   # ¢            para.gsub!(/£/, '£') # '£'  # £            para.gsub!(/¥/, '¥') # '¥'    # ¥            para.gsub!(/§/, '§') # '§'   # § @@ -230,12 +230,12 @@ module SiSU_XML_munge            para.gsub!(/û/, 'ü') # 'û'  # ü            para.gsub!(/ü/, 'ý') # 'ü'   # ý            para.gsub!(/þ/, 'þ') # 'þ'  # þ -          para.gsub!(/ÿ/, 'ÿ') # 'ÿ'   # ÿ    +          para.gsub!(/ÿ/, 'ÿ') # 'ÿ'   # ÿ          end        end        def html(para='') -        if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn  -          para.gsub!(/¢/, '¢')      # ¢  +        if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn +          para.gsub!(/¢/, '¢')      # ¢            para.gsub!(/£/, '£')     # £            para.gsub!(/¥/, '¥')       # ¥            para.gsub!(/§/, '§')      # § @@ -318,7 +318,7 @@ module SiSU_XML_munge            para.gsub!(/û/, 'û')     # ü            para.gsub!(/ü/, 'ü')      # ý            para.gsub!(/þ/, 'þ')     # þ -          para.gsub!(/ÿ/, 'ÿ')      # ÿ    +          para.gsub!(/ÿ/, 'ÿ')      # ÿ          end        end        self @@ -355,7 +355,7 @@ module SiSU_XML_munge        para.gsub!(/<[-~]#>/,'')        para.gsub!(/(^|\s)&\s+/,'\1& ') #sort        para.gsub!(/&([^;]{1,5})/,'&\1') #sort, rough estimate, revisit #WATCH found in node not sax -      para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,  +      para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,          "<image.path>#{@dir.url.images_local}\/\\1</image.path>")        para.gsub!(/ /,' ')        wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17 @@ -371,7 +371,7 @@ module SiSU_XML_munge    end  end  module SiSU_XML_tags #Format -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    class RDF @@ -380,101 +380,101 @@ module SiSU_XML_tags #Format        #seg_name=%{#{@@seg_name[@@tracker]} - } if @@seg_name[@@tracker]        @md=md        @sfx,@pdf=@md.sfx,@md.pdf -      @rdfurl=%{  rdf:about="http://www.jus.uio.no/lm/toc"\n}  +      @rdfurl=%{  rdf:about="http://www.jus.uio.no/lm/toc"\n}        if @md.dc_title                                                            # DublinCore 1 - title -        @rdf_title=%{    dc.title="#{seg_name}#{@md.dc_title}"\n}  +        @rdf_title=%{    dc.title="#{seg_name}#{@md.dc_title}"\n}          @dc_title=%{  <meta name="dc.title" content="#{seg_name}#{@md.dc_title}" />\n}          #if @md.subtitle -        #  @rdf_title=%{    dc.title="#{seg_name}#{@md.title} - #{@md.subtitle}"\n}  +        #  @rdf_title=%{    dc.title="#{seg_name}#{@md.title} - #{@md.subtitle}"\n}          #  @title=%{<meta name="dc.title" } +          #    %{content="#{seg_name}#{@md.title} - #{@md.subtitle}" />\n}          #else -        #  @rdf_title=%{    dc.title="#{seg_name}#{@md.title}"\n}  +        #  @rdf_title=%{    dc.title="#{seg_name}#{@md.title}"\n}          #  @title=%{<meta name="dc.title" } +          #    %{content="#{seg_name}#{@md.title}" />\n}          #end        end        if @md.dc_creator                                                          # DublinCore 2 - creator/author (author) -        @rdf_creator=%{    dc.creator="#{@md.dc_creator}"\n}  +        @rdf_creator=%{    dc.creator="#{@md.dc_creator}"\n}          content=meta_content_clean(@md.dc_creator)          @dc_creator=%{  <meta name="dc.creator" content="#{content}" />\n}        end        if @md.dc_subject                                                          # DublinCore 3 - subject (us library of congress, eric or udc, or schema???) -        @rdf_subject=%{    dc.subject="#{@md.dc_subject}"\n}  +        @rdf_subject=%{    dc.subject="#{@md.dc_subject}"\n}          content=meta_content_clean(@md.dc_subject) -        @dc_subject=%{  <meta name="dc.subject" content="#{content}" />\n}  +        @dc_subject=%{  <meta name="dc.subject" content="#{content}" />\n}        end        if @md.dc_description                                                      # DublinCore 4 - description -        @rdf_description=%{    dc.description="#{@md.dc_description}"\n}  +        @rdf_description=%{    dc.description="#{@md.dc_description}"\n}          content=meta_content_clean(@md.dc_description) -        @dc_description=%{  <meta name="dc.description" content="#{content}" />\n}  +        @dc_description=%{  <meta name="dc.description" content="#{content}" />\n}        end        if @md.dc_publisher                                                        # DublinCore 5 - publisher (current copy published by) -        @rdf_publisher=%{    dc.publisher="#{@md.dc_publisher}"\n}  +        @rdf_publisher=%{    dc.publisher="#{@md.dc_publisher}"\n}          content=meta_content_clean(@md.dc_publisher)          @dc_publisher=%{  <meta name="dc.publisher" content="#{content}" />\n}        end        if @md.dc_contributor                                                      # DublinCore 6 - contributor -        @rdf_contributor=%{    dc.contributor="#{@md.dc_contributor}"\n}  +        @rdf_contributor=%{    dc.contributor="#{@md.dc_contributor}"\n}          content=meta_content_clean(@md.dc_contributor)          @dc_contributor=%{  <meta name="dc.contributor" content="#{content}" />\n}        end        if @md.dc_date                                                             # DublinCore 7 - date year-mm-dd -        @rdf_date=%{    dc.date="#{@md.dc_date}"\n}  +        @rdf_date=%{    dc.date="#{@md.dc_date}"\n}          @dc_date=%{  <meta name="dc.date" content="#{@md.dc_date}" #{@md.date_scheme} />\n}        end        if @md.dc_date_created                                                     # DublinCore 7 - date.created year-mm-dd -        @rdf_date_created=%{    dc.date.created="#{@md.dc_date_created}"\n}  +        @rdf_date_created=%{    dc.date.created="#{@md.dc_date_created}"\n}          @dc_date_created=%{  <meta name="dc.date.created" content="#{@md.dc_date_created}" #{@md.date_created_scheme} />\n}        end        if @md.dc_date_issued                                                      # DublinCore 7 - date.issued year-mm-dd -        @rdf_date_issued=%{    dc.date.issued="#{@md.dc_date_issued}"\n}  +        @rdf_date_issued=%{    dc.date.issued="#{@md.dc_date_issued}"\n}          @dc_date_issued=%{  <meta name="dc.date.issued" content="#{@md.dc_date_issued}" #{@md.date_issued_scheme} />\n}        end        if @md.dc_date_available                                                   # DublinCore 7 - date.available year-mm-dd -        @rdf_date_available=%{    dc.date.available="#{@md.dc_date_available}"\n}  +        @rdf_date_available=%{    dc.date.available="#{@md.dc_date_available}"\n}          @dc_date_available=%{  <meta name="dc.date.available" content="#{@md.dc_date_available}" #{@md.date_available_scheme} />\n}        end        if @md.dc_date_valid                                                       # DublinCore 7 - date.valid year-mm-dd -        @rdf_date_valid=%{    dc.date.valid="#{@md.dc_date_valid}"\n}  +        @rdf_date_valid=%{    dc.date.valid="#{@md.dc_date_valid}"\n}          @dc_date_valid=%{  <meta name="dc.date.valid" content="#{@md.dc_date_valid}" #{@md.date_valid_scheme} />\n}        end        if @md.dc_date_modified                                                    # DublinCore 7 - date.modified year-mm-dd -        @rdf_date_modified=%{    dc.date.modified="#{@md.dc_date_modified}"\n}  +        @rdf_date_modified=%{    dc.date.modified="#{@md.dc_date_modified}"\n}          @dc_date_modified=%{  <meta name="dc.date.modified" content="#{@md.dc_date_modified}" #{@md.date_modified_scheme} />\n}        end        if @md.dc_type                                                             # DublinCore 8 - type (genre eg. report, convention etc) -        @rdf_type=%{    dc.type="#{@md.dc_type}"\n}  +        @rdf_type=%{    dc.type="#{@md.dc_type}"\n}          content=meta_content_clean(@md.dc_type)          @dc_type=%{  <meta name="dc.type" content="#{content}" />\n}        end        if @md.dc_format                                                           # DublinCore 9 - format (use your mime type) -        @rdf_format=%{    dc.format="#{@md.dc_format}"\n}  +        @rdf_format=%{    dc.format="#{@md.dc_format}"\n}          content=meta_content_clean(@md.dc_format)          @dc_format=%{  <meta name="dc.format" content="#{content}" />\n}        end        if @md.dc_identifier                                                       # DublinCore 10 - identifier (your identifier, could use urn which is free) -        @rdf_identifier=%{    dc.identifier="#{@md.dc_identifier}"\n}  +        @rdf_identifier=%{    dc.identifier="#{@md.dc_identifier}"\n}          content=meta_content_clean(@md.dc_identifier)          @dc_identifier=%{  <meta name="dc.identifier" content="#{content}" />\n}        end        if @md.dc_source                                                           # DublinCore 11 - source (document source) -        @rdf_source=%{    dc.source="#{@md.dc_source}"\n}  +        @rdf_source=%{    dc.source="#{@md.dc_source}"\n}          content=meta_content_clean(@md.dc_source)          @dc_source=%{  <meta name="dc.source" content="#{content}" />\n}        end        if @md.dc_language[:name]                                                  # DublinCore 12 - language (English) -        @rdf_language=%{    dc.language="#{@md.dc_language[:name]}"\n}  +        @rdf_language=%{    dc.language="#{@md.dc_language[:name]}"\n}          @dc_language=%{  <meta name="dc.language" content="#{@md.dc_language[:name]}" />\n}        end -      if @md.language_original[:name]                                             -        @rdf_language_original=%{    dc.language="#{@md.language_original[:name]}"\n}  +      if @md.language_original[:name] +        @rdf_language_original=%{    dc.language="#{@md.language_original[:name]}"\n}          @language_original=%{  <meta name="dc.language" content="#{@md.language_original[:name]}" />\n}        end        if @md.dc_relation                                                         # DublinCore 13 - relation          @rdf_relation=%{    dc.relation="#{@md.dc_relation}"\n}          content=meta_content_clean(@md.dc_relation) -        @dc_relation=%{  <meta name="dc.relation" content="#{content}" />\n}  +        @dc_relation=%{  <meta name="dc.relation" content="#{content}" />\n}        end        if @md.dc_coverage                                                         # DublinCore 14 - coverage          @rdf_coverage=%{    dc.coverage="#{@md.dc_coverage}"\n} @@ -503,7 +503,7 @@ module SiSU_XML_tags #Format        #      dc:creator="Author"        #      dc:title="Title"        #      dc:description="Description if any" -      #      dc:date="Publication Date"  +      #      dc:date="Publication Date"        #  />        #</rdf:RDF>        #Dublin Core @@ -564,7 +564,7 @@ WOK        comment_xml(desc)      end      def metatag_html #values strung together, because some empty, and resulting output (line breaks) is much better -#{@vz.js_head}  +#{@vz.js_head}  <<WOK  #@dc_title#@dc_subtitle#@dc_creator#@dc_subject#@dc_description#@dc_publisher#@dc_contributor#@dc_date#@dc_date_created#@dc_date_issued#@dc_date_available#@dc_date_valid#@dc_date_modified#@dc_type#@dc_format#@dc_identifier#@dc_source#@dc_language#@dc_relation#@dc_coverage#@dc_rights#@copyright#@owner  #{@vz.txt_generator} @@ -574,7 +574,7 @@ WOK    end  end  module SiSU_Tables -  require SiSU_lib + '/xml_tables' +  require "#{SiSU_lib}/xml_tables"  end  __END__ diff --git a/lib/sisu/0.52/sisupod_make.rb b/lib/sisu/v0/sisupod_make.rb index 21e35e64..2d5aa550 100644 --- a/lib/sisu/0.52/sisupod_make.rb +++ b/lib/sisu/v0/sisupod_make.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -53,8 +53,8 @@ module SiSU_Doc    include SiSU_Env    class Source      include FileUtils #::Verbose -    require SiSU_lib + '/sysenv' -    require SiSU_lib + '/response' +    require "#{SiSU_lib}/sysenv" +    require "#{SiSU_lib}/response"      def initialize(opt)        @opt=opt        m=/.+\/(\S+)/m @@ -121,7 +121,7 @@ module SiSU_Doc        SiSU_Env::Info_env.new.sisupod      end      def select(skin='')                                                       # skin loading logic here -      load SiSU_lib + '/defaults.rb' +      load "#{SiSU_lib}/defaults.rb"        @skin={}        skin_path = [          "#{@env.path.pwd}/_sisu/skin", @@ -177,7 +177,7 @@ module SiSU_Doc          docskin='skin_sisupod'        end        if skin_source and docskin -        cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb")  +        cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb")          #if skin_source[:type] =~/dir/          #  File.symlink("#{docskin_place}/#{docskin}.rb","#{docskin_place}/skin_#{@env.stub_pwd}.rb")          #end @@ -185,7 +185,7 @@ module SiSU_Doc          para_images=[]          skinfile_array.each do |f|                                            #% work area            unless f =~/^%+ / #hmmm -            images << f.scan(@rgx_rb_image).uniq if f =~@rgx_rb_image #and FileTest.file?(f.scan(@rgx_rb_image).uniq)     +            images << f.scan(@rgx_rb_image).uniq if f =~@rgx_rb_image #and FileTest.file?(f.scan(@rgx_rb_image).uniq)              #does not really discriminate, may duplicate images in sisu file, and may take images from default image pool            end          end @@ -193,7 +193,7 @@ module SiSU_Doc        #1. mapping in doc dir?        #2. need images used by skin, scan skin??        if images and images.length > 1 -        images.flatten!.uniq!  +        images.flatten!.uniq!          image_path_pwd='_sisu/image'          path_pod_conf="#{@env.path.processing}/sisupod/_sisu"          images_path_pod="#{path_pod_conf}/image" @@ -220,17 +220,17 @@ module SiSU_Doc        x=@env.document_language_versions_found   #check multiple document language versions (param not used)        if doc_import.flatten.length > 0 and @opt.fns =~/\._sst$/          doc_import.flatten.each do |f| -          cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")  +          cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")          end        end        if x[:f] and x[:f].length > 1             #store multiple document language versions, sisupod          x[:f].each do |f| -          cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")  +          cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")          end        elsif @opt.fns =~/\._sst/          ssm=@opt.fns.gsub(/\._sst/,'.ssm') -        cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}")  -      else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}")  +        cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}") +      else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}")        end #NB not all possibilies met, revisit, also in case of composite file may wish to add README      end      def sisupod_7zip #look at later @@ -278,7 +278,7 @@ question?:                   should you permit the packing of multiple files in     remove previously existing contents of _/sisu/sisupod &     make directory structure: -    +     _sisu       sisupod         sisu diff --git a/lib/sisu/0.52/sitemaps.rb b/lib/sisu/v0/sitemaps.rb index 71956b03..7b6adbab 100644 --- a/lib/sisu/0.52/sitemaps.rb +++ b/lib/sisu/v0/sitemaps.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,9 +47,9 @@                    ralph.amissah@gmail.com  =end  module SiSU_Sitemaps -  require SiSU_lib + '/param' -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/shared_xml' +  require "#{SiSU_lib}/param" +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/shared_xml"    include SiSU_Env    include SiSU_Param    include SiSU_XML_munge @@ -88,8 +88,8 @@ module SiSU_Sitemaps      end      def make_file(path,filename)        if File.writable?("#{path}/."); File.new("#{path}/#{filename}",'w+') -      else  -        SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn  +      else +        SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn        end      end      def make_path(path) @@ -206,7 +206,7 @@ __END__  <!-- Document processing information:       * Generated by: SiSU 0.48.6 of 2006w45/6 (20061111)       * Ruby version: ruby 1.8.5 (2006-08-25) [i486-linux] -     *  +     *       * Last Generated on: Sat Nov 18 15:28:08 +0000 2006       * SiSU http://www.jus.uio.no/sisu  --> diff --git a/lib/sisu/0.52/spell.rb b/lib/sisu/v0/spell.rb index f3e264de..0266bc1c 100644 --- a/lib/sisu/0.52/spell.rb +++ b/lib/sisu/v0/spell.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -55,8 +55,8 @@ module Utility        @allwords=[]        puts @filename        @speller='aspell' # 'ispell' -      @dictionary = 'british' -      @lang = 'en_GB' +      @dictionary='british' +      @lang='en_GB'      end      def check        @input.each do |data| @@ -82,7 +82,7 @@ module Utility          end          @allwords.each { |y| puts y.inspect; system(%{cat #{y} | /usr/bin/#@speller -l -d #@dictionary >> ~/spell_error })}        else -        @allwords.each { |y| sp = %x{echo #{y}|#@speller -l }; puts sp unless sp.empty?} +        @allwords.each { |y| sp=%x{echo #{y}|#@speller -l }; puts sp unless sp.empty?}        end      end    end diff --git a/lib/sisu/0.52/sst_convert_markup.rb b/lib/sisu/v0/sst_convert_markup.rb index bf1c10c8..6cdc76b0 100644 --- a/lib/sisu/0.52/sst_convert_markup.rb +++ b/lib/sisu/v0/sst_convert_markup.rb @@ -36,7 +36,7 @@      http://www.fsf.org/licenses/gpl.html      http://www.gnu.org/copyleft/gpl.html      http://www.jus.uio.no/sisu/gpl2.fsf -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -44,13 +44,13 @@                    ralph.amissah@gmail.com  =end  module SiSU_Modify -  require SiSU_lib + '/sst_identify_markup' -  require SiSU_lib + '/sst_from_kdissert' -  require SiSU_lib + '/sst_to_s_xml_sax' -  require SiSU_lib + '/sst_to_s_xml_dom' -  require SiSU_lib + '/sst_to_s_xml_node' -  require SiSU_lib + '/sst_from_xml' -  require SiSU_lib + '/response' +  require "#{SiSU_lib}/sst_identify_markup" +  require "#{SiSU_lib}/sst_from_kdissert" +  require "#{SiSU_lib}/sst_to_s_xml_sax" +  require "#{SiSU_lib}/sst_to_s_xml_dom" +  require "#{SiSU_lib}/sst_to_s_xml_node" +  require "#{SiSU_lib}/sst_from_xml" +  require "#{SiSU_lib}/response"    class Convert_markup      require 'fileutils'      include FileUtils #::Verbose @@ -59,7 +59,7 @@ module SiSU_Modify        @description='This is a script that contains canned text conversions for reuse'        @response=SiSU_Response::Response.new        @ask=SiSU_Response::Response.new -      @warn='WARNING, PROCEED AT YOUR OWN RISK, will make file changes.'  +      @warn='WARNING, PROCEED AT YOUR OWN RISK, will make file changes.'      end      def current_match_and_replace        convert_37_to_38 @@ -101,7 +101,7 @@ WOK      def convert_37_to_38        message("#@warn\nConvert sisu markup from 0.37 to 0.38")        [ -        [/^0~(\S+?)([+-])\s+/,    '@\1:\2 ',               //],           +        [/^0~(\S+?)([+-])\s+/,    '@\1:\2 ',               //],          [/^0~(\S+)\s+/,           '@\1: ',                 //],          [/^@toc:\s+/,             '@structure: ',          //],          [/^1~/,                   ':A~',                   //], @@ -156,7 +156,7 @@ WOK          unless f == s            unless File.exist?("#{pwd}/#{s}")              puts "./#{f} -> ./#{s}" -            cp("#{pwd}/#{f}","#{pwd}/#{s}")  +            cp("#{pwd}/#{f}","#{pwd}/#{s}")            else "File already exists, < #{s} >  will not overwrite"            end          end @@ -178,7 +178,7 @@ WOK        SiSU_sst_from_xml::Convert.new(@opt).read      end      def convert_footnotes -      require SiSU_lib + '/sst_do_inline_footnotes'  +      require "#{SiSU_lib}/sst_do_inline_footnotes"        SiSU_Convert_footnotes::Source.new(@opt).read      end      def conversion @@ -280,18 +280,18 @@ WOK    end  end  #%% files to match for this conversion set  -------------------------> -require SiSU_lib + '/options' +require "#{SiSU_lib}/options"  argv=$*  @opt=SiSU_commandline::Options.new(argv)  case @opt.mod.inspect  when /=kdi/ -  SiSU_Modify::Convert_markup.new(@opt).conversion  +  SiSU_Modify::Convert_markup.new(@opt).conversion  when /(?:36|37|38)?to-?(?:37|38)|--convert|--to|--from|default/  @opt.files.each do |fns|    @opt.fns=fns -  SiSU_Modify::Convert_markup.new(@opt).conversion  +  SiSU_Modify::Convert_markup.new(@opt).conversion  end -else  +else    @opt.mod='--help'   SiSU_Modify::Convert_markup.new(@opt).help  end diff --git a/lib/sisu/0.52/sst_do_inline_footnotes.rb b/lib/sisu/v0/sst_do_inline_footnotes.rb index 90102d7c..f5e1d604 100644 --- a/lib/sisu/0.52/sst_do_inline_footnotes.rb +++ b/lib/sisu/v0/sst_do_inline_footnotes.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,11 +47,11 @@                    ralph.amissah@gmail.com  =end  module SiSU_Convert_footnotes -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/sysenv' -  require SiSU_lib + '/param' -  require SiSU_lib + '/dal_syntax' -  require SiSU_lib + '/i18n' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/sysenv" +  require "#{SiSU_lib}/param" +  require "#{SiSU_lib}/dal_syntax" +  require "#{SiSU_lib}/i18n"    include SiSU_Env    include SiSU_Param    include SiSU_Viz @@ -109,7 +109,7 @@ module SiSU_Convert_footnotes        tell=SiSU_Screen::Ansi.new(@opt.cmd,'convert footnotes')        tell.green_title_hi unless @opt.cmd =~/q/        file_array=IO.readlines(@opt.fns,'') -      file_array.each do |l|  +      file_array.each do |l|          if l =~/\r\n/; l.gsub!(/\r\n/,"\n")          end        end @@ -124,7 +124,7 @@ module SiSU_Convert_footnotes          tell.txt_red unless @md.cmd =~/q/          dal.each{|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?}          dal_array -      else  +      else          tell=SiSU_Screen::Ansi.new(@md.cmd,'no footnote conversion done, problem with source file','to override use --convert=footnote-force (this is not advised)')          tell.warn if @cmd !~/q/          '' @@ -194,7 +194,7 @@ module SiSU_Convert_footnotes        reset        data      end -  protected  +  protected      def vocabulary        data=@data        tuned_file,vocab_insert=[],[] @@ -225,13 +225,13 @@ module SiSU_Convert_footnotes          para.gsub!(/(~\{ )\s+/,'\1')          para.gsub!(/ \/\//,'<br />')                                           #added 2004w29          para.gsub!(/<br>/,'<br />')                                            #needed by xml, xhtml etc. -        para.gsub!(/`/,"'")    +        para.gsub!(/`/,"'")          para.gsub!(/\342\200\231/,"'") #if para =~/’/  #Avoid #‘ ’ #“ ” -        para.gsub!(/\t/,' ')    +        para.gsub!(/\t/,' ')          para.gsub!(/�/,' ') #watch, replace with char code -        para.gsub!(/[“”]/,'""')    -        para.gsub!(/[–—]/,'-')   #— – chk  -        para.gsub!(/·/,'*')    +        para.gsub!(/[“”]/,'""') +        para.gsub!(/[–—]/,'-')   #— – chk +        para.gsub!(/·/,'*')          para.gsub!(/\\copy(?:right)?\b/,'©')          para.gsub!(/\\trademark\b|\\tm\b/,'®')          para.gsub!(/\44/,'$') #$ watch @@ -337,7 +337,7 @@ module SiSU_Convert_footnotes        else para.gsub!(/^#{num}~ /,"#{num}~#{title_no} #{title_no} ") #main        end        if @md.toc_lev_limit and @md.toc_lev_limit < num -        para.gsub!(/^[2-6]~(?:~\S+)?\s*/,'!_ ')  +        para.gsub!(/^[2-6]~(?:~\S+)?\s*/,'!_ ')        end        para      end @@ -403,7 +403,7 @@ module SiSU_Convert_footnotes        data=@data        @tuned_file=[]        endnote_no,endnote_ref=1,1 -       +        data.each do |para|          case para                                                                               # manually numbered endnotes <!e(\d)!> <!e_(\d)!> -->          when /~\{\s+.+?\}~/                                                                               # auto-numbered endnotes <!e!> <!e_!> --> diff --git a/lib/sisu/0.52/sst_from_kdissert.rb b/lib/sisu/v0/sst_from_kdissert.rb index 9dc80bb5..b911f4db 100644 --- a/lib/sisu/0.52/sst_from_kdissert.rb +++ b/lib/sisu/v0/sst_from_kdissert.rb @@ -32,7 +32,7 @@      http://www.fsf.org/licenses/gpl.html      http://www.gnu.org/copyleft/gpl.html      http://www.jus.uio.no/sisu/gpl2.fsf -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -40,7 +40,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Kdissert -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    class Convert      require 'rexml/document'      include REXML @@ -66,7 +66,7 @@ module SiSU_Kdissert  @skin: skin_kdissert -% @date:  +% @date:  @rcs:+ $Id$ @@ -115,7 +115,7 @@ WOK                    @top=id                  end                end -            end   +            end              @doc=[]              @title=@el[@top][:sum]              puts @el[@top][:sum].inspect @@ -141,7 +141,7 @@ WOK                  end                end              end -      # regexs strip most kdissert markup, and provide minimal info for sisu markup -->        +      # regexs strip most kdissert markup, and provide minimal info for sisu markup -->              @doc.each do |c,idx|                c.gsub!(/<\/summary>/,'')                c.gsub!(/<html>.+?\n|<\/body>|<\/html>|<p>/m,'') @@ -159,7 +159,7 @@ WOK                c.gsub!(/"/,'"')                c.gsub!(/ \s+/,' ')                @sisu_base << c.strip + "\n\n" -            end   +            end            else puts ".kdi extension expected, filename not recognised: << #{kdi} >>"            end            @output << sisu_head << @sisu_base diff --git a/lib/sisu/0.52/sst_from_xml.rb b/lib/sisu/v0/sst_from_xml.rb index 1b2651e3..fc2a9478 100644 --- a/lib/sisu/0.52/sst_from_xml.rb +++ b/lib/sisu/v0/sst_from_xml.rb @@ -32,7 +32,7 @@      http://www.fsf.org/licenses/gpl.html      http://www.gnu.org/copyleft/gpl.html      http://www.jus.uio.no/sisu/gpl2.fsf -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -40,7 +40,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_sst_from_xml -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    class Convert      require 'rexml/document'      include REXML diff --git a/lib/sisu/0.52/sst_identify_markup.rb b/lib/sisu/v0/sst_identify_markup.rb index 8dbca059..9e212f2d 100644 --- a/lib/sisu/0.52/sst_identify_markup.rb +++ b/lib/sisu/v0/sst_identify_markup.rb @@ -36,7 +36,7 @@      http://www.fsf.org/licenses/gpl.html      http://www.gnu.org/copyleft/gpl.html      http://www.jus.uio.no/sisu/gpl2.fsf -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -87,11 +87,11 @@ WOK          links,oldlinks='',''          markup=nil          @declared_type,@declared_markup='[text?]','' -        if cont[0] =~ /^(?:%\s+)?SiSU\s+(text|master|insert)\s+([0-9](?:\.[0-9]+){1,2})/ or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/  +        if cont[0] =~ /^(?:%\s+)?SiSU\s+(text|master|insert)\s+([0-9](?:\.[0-9]+){1,2})/ or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/            @declared_type,@declared_markup=$1,$2            #puts "SiSU #@declared_markup (declared markup version)"          #else puts 'markup version not declared' -        elsif cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/  +        elsif cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/            @declared_markup=$1          end          @flag_38=false @@ -193,11 +193,11 @@ WOK    * for example for describing an author    ** for describing a second author -   +    and ~[* my note ]~ or ~[+ another note ]~ which numerically increments an    asterisk and plus respectively -  *1 my note  +  *1 my note    +1 another note  WOK @@ -206,7 +206,7 @@ WOK        <<WOK    SiSU 0.38 introduced alternative experimental header and heading/structure markers, -   +    @headername: and headers :A~ :B~ :C~ 1~ 2~ 3~    as the equivalent of @@ -270,7 +270,7 @@ WOK      def help_query        <<WOK -  sisu --query=[sisu version [0.38] or 'history]  +  sisu --query=[sisu version [0.38] or 'history]    provides a short history of changes to SiSU markup  WOK @@ -278,7 +278,7 @@ WOK      def help_identify        <<WOK -  sisu --identify [filename]  +  sisu --identify [filename]    attempts to identify the SiSU markup used in a file  WOK diff --git a/lib/sisu/0.52/sst_to_s_xml_dom.rb b/lib/sisu/v0/sst_to_s_xml_dom.rb index 9665250b..5ed309e6 100644 --- a/lib/sisu/0.52/sst_to_s_xml_dom.rb +++ b/lib/sisu/v0/sst_to_s_xml_dom.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,18 +49,18 @@   * Notes: tidy -xml sax.xml >> index.tidy  =end  module SiSU_simple_xml_model_dom -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/dal_doc_str' -  require SiSU_lib + '/shared_xml' -  require SiSU_lib + '/xml_format' +  require "#{SiSU_lib}/dal_doc_str" +  require "#{SiSU_lib}/shared_xml" +  require "#{SiSU_lib}/xml_format"    include SiSU_XML_format    include SiSU_XML_munge -  require SiSU_lib + '/rexml' +  require "#{SiSU_lib}/rexml"    include SiSU_Rexml    @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0    @@tablefoot='' @@ -117,8 +117,8 @@ module SiSU_simple_xml_model_dom        end      end      class Scroll -      require SiSU_lib + '/shared_txt' -      require SiSU_lib + '/css' +      require "#{SiSU_lib}/shared_txt" +      require "#{SiSU_lib}/css"        include SiSU_text_utils        @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] }        def initialize(data='',md=nil) @@ -140,17 +140,17 @@ module SiSU_simple_xml_model_dom        end      protected        def embedded_endnotes(para='') -        para.gsub!(/~\{(.+?)\}~/,  +        para.gsub!(/~\{(.+?)\}~/,            '<endnote><note>\1</note></endnote> ') -        para.gsub!(/~\[([*+])\s+(.+?)\]~/,  +        para.gsub!(/~\[([*+])\s+(.+?)\]~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')        end        def xml_markup(para='') -        para.gsub!(/~\[([*+])\s+(.+?)\]~/,  +        para.gsub!(/~\[([*+])\s+(.+?)\]~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') -        para.gsub!(/~\{([*+]+)\s+(.+?)\}~/,  +        para.gsub!(/~\{([*+]+)\s+(.+?)\}~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') -        para.gsub!(/~\{(.+?)\}~/,  +        para.gsub!(/~\{(.+?)\}~/,            '<endnote><note>\2</note></endnote> ')        end        def xml_head(meta) @@ -212,7 +212,7 @@ WOK            @copen[2]=true            @copen[3]=false          elsif lv == 6 -          @copen[3]=true  +          @copen[3]=true          end        end        def xml_structure(lv='',para='',hname='' ) @@ -241,7 +241,7 @@ WOK              elsif @copen[2] # 5{                [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }                @copen[1]=@copen[2]=@copen[3]=false -            elsif @copen[1] # 4{  +            elsif @copen[1] # 4{                [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }                @copen[1]=@copen[2]=@copen[3]=false              end @@ -249,10 +249,10 @@ WOK              @level[x]=false            end          when 4..6 -          6.downto(lv) do |x|  +          6.downto(lv) do |x|              y=x - 1              if @level[x] == true -              u=x - 3;  +              u=x - 3;                @xml_contents_close[x]=''              end            end @@ -266,7 +266,7 @@ WOK                [3,2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }              elsif @copen[2] == true # 5{                [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" } -            elsif @copen[1] == true # 4{  +            elsif @copen[1] == true # 4{                [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }              end              @cont[1]=true @@ -286,7 +286,7 @@ WOK          end          xml_element(lv,para,hname,tag,xml_element,xml_content)          @level[lv]=true -        ((lv+1)..6).each { |x| @level[x]=false }  +        ((lv+1)..6).each { |x| @level[x]=false }        end        def group_structure(para='')          para.gsub!(/<:group(?:-end)?>/,'') @@ -332,15 +332,15 @@ WOK          xml_sc(@md)          @rcdc=false          @level,@cont,@copen,@xml_contents_close=[],[],[],[] -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @xml_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @xml_contents_close[x]='' }          data.each do |para|            wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17            para=tidywords(wordlist).join(' ').strip            para.gsub!(/<[-~]#>/,'')            para.gsub!(/<br\/?>/,'<br />')            para.gsub!(/<:pb>\s*/,'') -          para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,  +          para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,              "<image.path>#{dir.url.images_local}/\\1</image.path>")            para.gsub!(/ /,' ')            para=SiSU_document_structure::Structure.new(@md,para).structure @@ -351,7 +351,7 @@ WOK  	          end            end            @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/) -          if para !~/(^0~|^@\S+?:|<ENDNOTES>|<EOF>)/  +          if para !~/(^0~|^@\S+?:|<ENDNOTES>|<EOF>)/              @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para              unless @rcdc                if para !~/^(?:%\s|0~|@\S+?:)/ @@ -473,7 +473,7 @@ WOK            y=x - 1            @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }  +        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }        end        def pre          rdf=SiSU_XML_tags::RDF.new(@md) @@ -542,7 +542,7 @@ WOK      class Tidy        def initialize(md,dir)          @md,@env=md,dir -        @prog=SiSU_Env::Info_program.new  +        @prog=SiSU_Env::Info_program.new        end        def xml          if @prog.tidy !=false #note values can be other than true diff --git a/lib/sisu/0.52/sst_to_s_xml_node.rb b/lib/sisu/v0/sst_to_s_xml_node.rb index 3ff58c2b..8882da67 100644 --- a/lib/sisu/0.52/sst_to_s_xml_node.rb +++ b/lib/sisu/v0/sst_to_s_xml_node.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,19 +49,19 @@   * Notes: tidy -xml sax.xml >> index.tidy  =end  module SiSU_simple_xml_model_node -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/dal_syntax' -  require SiSU_lib + '/dal_doc_str' -  require SiSU_lib + '/shared_xml' -  require SiSU_lib + '/xml_format' +  require "#{SiSU_lib}/dal_syntax" +  require "#{SiSU_lib}/dal_doc_str" +  require "#{SiSU_lib}/shared_xml" +  require "#{SiSU_lib}/xml_format"    include SiSU_XML_format    include SiSU_XML_munge -  require SiSU_lib + '/rexml' +  require "#{SiSU_lib}/rexml"    include SiSU_Rexml    @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0    @@tablefoot='' @@ -118,8 +118,8 @@ module SiSU_simple_xml_model_node        end      end      class Scroll -      require SiSU_lib + '/shared_txt' -      require SiSU_lib + '/css' +      require "#{SiSU_lib}/shared_txt" +      require "#{SiSU_lib}/css"        include SiSU_text_utils        @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] }        @@parent={ :ocn=>[],:node=>[] } @@ -243,9 +243,9 @@ WOK            if @node[:ocn][lv-1] != nil              @@parent[:ocn][o.ocn]=@node[:ocn][lv-1]            elsif @node[:ocn][lv-2] != nil -            @@parent[:ocn][o.ocn]=@node[:ocn][lv-2]  +            @@parent[:ocn][o.ocn]=@node[:ocn][lv-2]            elsif @node[:ocn][lv-3] != nil: -            @@parent[:ocn][o.ocn]=@node[:ocn][lv-3]  +            @@parent[:ocn][o.ocn]=@node[:ocn][lv-3]            else puts 'error'            end          elsif lv == nil @@ -282,13 +282,13 @@ WOK                puts "#{o.node}::#{parent.node[o.node]}"              end            end -          @@xml[:body] << "#{@tab*0}<object>" if para[@regx]  +          @@xml[:body] << "#{@tab*0}<object>" if para[@regx]            #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv            @@xml[:body] << "#{@tab*1}" << "\n" if para[@regx]            if @md.mod.inspect =~/odf/ #condition not currently present, but consider              @@xml[:body] << %{#{@tab*1}<ocn>#{o.ocn}</ocn>\n}            end -          @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"  +          @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"            elsif wrapped =~/\A%%?\s+/; %{<!--\n#{@tab*1}<text class="comment">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n-->\n} # comments [not included, review]            else                   %{#{@tab*1}<text class="norm">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} # main text, contents, body KEEP            end @@ -388,15 +388,15 @@ WOK          end          data=Syntax::Markup.new(@md,data).songsheet          data=SiSU_document_structure::Tables.new(@md,data).tables -        obj=SiSU_document_structure::OCN.new(@md,data).ocn      +        obj=SiSU_document_structure::OCN.new(@md,data).ocn          obj.compact!          data=nil          dir=SiSU_Env::Info_env.new(@md.fns)          xml_sc(@md)          @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]          @rcdc=false -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @xml_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @xml_contents_close[x]='' }          obj.each do |o|            para=o.txt unless o.txt =~/^%% / #comments are lost, consider            if para @@ -413,7 +413,7 @@ WOK            para=o.txt unless o.txt =~/^%% / #comments are lost, consider            if para              @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/) -            if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/  +            if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/                @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para                unless @rcdc                  format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/ @@ -452,7 +452,7 @@ WOK            para=o.txt unless o.txt =~/^%% / #comments are lost, consider            if para              @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/) -            if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/  +            if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/                @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para                unless @rcdc                  format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/ @@ -524,7 +524,7 @@ WOK            y=x - 1            @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }  +        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }        end        def pre          rdf=SiSU_XML_tags::RDF.new(@md) @@ -587,7 +587,7 @@ WOK      class Tidy        def initialize(md,dir)          @md,@env=md,dir -        @prog=SiSU_Env::Info_program.new  +        @prog=SiSU_Env::Info_program.new        end        def xml          if @prog.tidy !=false #note values can be other than true @@ -619,7 +619,7 @@ nodes are required for a node/tree based representation of content, e.g. a docum  nodes are given to all structural divisions/headings whether or not they are given an ocn  why arn't all structural divisions given an ocn? -sometimes to structure documents correctly, it is necessary to introduce a dummy level, e.g. using a marker like  +sometimes to structure documents correctly, it is necessary to introduce a dummy level, e.g. using a marker like  4~ [Preamble]-#  these are heading items that are not in the original text, and do not warrant an ocn  they do however require a node value diff --git a/lib/sisu/0.52/sst_to_s_xml_sax.rb b/lib/sisu/v0/sst_to_s_xml_sax.rb index f94fbc9f..e3958df0 100644 --- a/lib/sisu/0.52/sst_to_s_xml_sax.rb +++ b/lib/sisu/v0/sst_to_s_xml_sax.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,18 +49,18 @@   * Notes: tidy -xml sax.xml >> index.tidy  =end  module SiSU_simple_xml_model_sax -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/dal_doc_str' -  require SiSU_lib + '/shared_xml' -  require SiSU_lib + '/xml_format' +  require "#{SiSU_lib}/dal_doc_str" +  require "#{SiSU_lib}/shared_xml" +  require "#{SiSU_lib}/xml_format"    include SiSU_XML_format    include SiSU_XML_munge -  require SiSU_lib + '/rexml' +  require "#{SiSU_lib}/rexml"    include SiSU_Rexml    @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0    @@tablefoot='' @@ -116,8 +116,8 @@ module SiSU_simple_xml_model_sax        end      end      class Scroll -      require SiSU_lib + '/shared_txt' -      require SiSU_lib + '/css' +      require "#{SiSU_lib}/shared_txt" +      require "#{SiSU_lib}/css"        include SiSU_text_utils        @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] }        def initialize(data='',md=nil) @@ -188,10 +188,10 @@ WOK            util=SiSU_text_utils::Wrap.new(paragraph,70)            wrapped=util.line_wrap          end -        @@xml[:body] << "#{@tab*0}<object>" if para[@regx]  +        @@xml[:body] << "#{@tab*0}<object>" if para[@regx]          #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv          @@xml[:body] << "#{@tab*1}" << "\n" if para[@regx] -        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"  +        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"          elsif wrapped =~/\A%%?\s+/; %{<!--\n#{@tab*1}<text class="comment">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n-->\n} # comments          else                   %{#{@tab*1}<text class="norm">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} # main text, contents, body KEEP          end @@ -246,8 +246,8 @@ WOK          xml_sc(@md)          @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]          @rcdc=false -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @xml_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @xml_contents_close[x]='' }          @data.each do |para|            data << SiSU_document_structure::Structure.new(@md,para).structure          end @@ -260,7 +260,7 @@ WOK  	          end            end            @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~\s+Document Information/) -          if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/  +          if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/              @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para              unless @rcdc                format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/ @@ -350,7 +350,7 @@ WOK            y=x - 1            @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }  +        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }        end        def pre          rdf=SiSU_XML_tags::RDF.new(@md) @@ -413,7 +413,7 @@ WOK      class Tidy        def initialize(md,dir)          @md,@env=md,dir -        @prog=SiSU_Env::Info_program.new  +        @prog=SiSU_Env::Info_program.new        end        def xml          if @prog.tidy !=false #note values can be other than true diff --git a/lib/sisu/0.52/sysenv.rb b/lib/sisu/v0/sysenv.rb index 56171c06..a0e519b3 100644 --- a/lib/sisu/0.52/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -214,8 +214,8 @@ module SiSU_Env        end        if load_prog; require @prog        else -        tell=if @mandatory; SiSU_Screen::Ansi.new(@cmd,"module required: #@prog")  -        else                SiSU_Screen::Ansi.new(@cmd,"#@prog load requested")  +        tell=if @mandatory; SiSU_Screen::Ansi.new(@cmd,"module required: #@prog") +        else                SiSU_Screen::Ansi.new(@cmd,"#@prog load requested")          end          tell.warn        end @@ -283,7 +283,7 @@ module SiSU_Env            @@noyaml=true            break          else -          #tell=SiSU_Screen::Ansi.new('','promo off (file not found): list.yml')  +          #tell=SiSU_Screen::Ansi.new('','promo off (file not found): list.yml')            if FileTest.exist?("#{v}/list.yml")              unless @@ad[:promo_list]                require 'yaml' @@ -302,7 +302,7 @@ module SiSU_Env            @@noyaml=true            break          else -          #tell=SiSU_Screen::Ansi.new('','promo off (file not found): promo.yml')  +          #tell=SiSU_Screen::Ansi.new('','promo off (file not found): promo.yml')            if FileTest.exist?("#{v}/promo.yml")              unless @@ad[:promo]                require 'yaml' @@ -1104,7 +1104,7 @@ module SiSU_Env        end        def webserv_image                                                         #web/presentation directory, subdirectories are created within it, depending on markup directory stub-name (last segment of markup directory name)          images=if defined? @rc['webserv']['images'] -          @rc['webserv']['images']  +          @rc['webserv']['images']          else defaults[:images]          end          "#{path.webserv}/#{images}" @@ -1116,7 +1116,7 @@ module SiSU_Env          "#{path.output}/sitemaps"        end        def encoding -        pth="#{processing}/#{defaults[:processing_encoding]}"  +        pth="#{processing}/#{defaults[:processing_encoding]}"          File.mkpath(pth) unless FileTest.directory?(pth)          pth        end @@ -1137,7 +1137,7 @@ module SiSU_Env              @processing=v              unless FileTest.directory?(@processing)                puts "a processing directory (#@processing) is being created for use by sisu" -              File.mkpath(@processing)  +              File.mkpath(@processing)              end              break            #end @@ -1146,14 +1146,14 @@ module SiSU_Env        end        def dal          pth=if defined? @rc['processing']['dal']; "#{processing}/#{@rc['processing']['dal']}" -        else                                             "#{processing}/#{defaults[:processing_dal]}"  +        else                                             "#{processing}/#{defaults[:processing_dal]}"          end          File.mkpath(pth) unless FileTest.directory?(pth)          pth        end        def tune          pth=if defined? @rc['processing']['tune'];      "#{processing}/#{@rc['processing']['tune']}" -        else                                             "#{processing}/#{defaults[:processing_tune]}"  +        else                                             "#{processing}/#{defaults[:processing_tune]}"          end          File.mkpath(pth) unless FileTest.directory?(pth)          pth @@ -1163,14 +1163,14 @@ module SiSU_Env        end        def tex          pth=if defined? @rc['processing']['latex'];     "#{processing}/#{@rc['processing']['latex']}" -        else                                             "#{processing}/#{defaults[:processing_latex]}"  +        else                                             "#{processing}/#{defaults[:processing_latex]}"          end          File.mkpath(pth) unless FileTest.directory?(pth)          pth        end        def texi          pth=if defined? @rc['processing']['texinfo'];   "#{processing}/#{@rc['processing']['texinfo']}" -        else                                             "#{processing}/#{defaults[:processing_texinfo]}"  +        else                                             "#{processing}/#{defaults[:processing_texinfo]}"          end          File.mkpath(pth) unless FileTest.directory?(pth)          pth @@ -1180,7 +1180,7 @@ module SiSU_Env        end        def lout          pth=if defined? @rc['processing']['lout'];      "#{processing}/#{@rc['processing']['lout']}" -        else                                             "#{processing}/#{defaults[:processing_lout]}"  +        else                                             "#{processing}/#{defaults[:processing_lout]}"          end          File.mkpath(pth) unless FileTest.directory?(pth)          pth @@ -1415,7 +1415,7 @@ module SiSU_Env            '../_sisu/image_local'          else            if @@local_image==true -            cmd=if @cmd; @cmd  +            cmd=if @cmd; @cmd              else ''              end              tell=SiSU_Screen::Ansi.new(cmd,"WARNING - no local image directory or images:", defaults[:image_local] ) @@ -1469,7 +1469,7 @@ module SiSU_Env          end        end        def pattern -        "[0-9a-f]{#{digest.length}}" +        "[0-9a-f]{#{digest.length}}" #/[0-9a-f]{#{digest.length}}/        end        self      end @@ -1527,7 +1527,7 @@ module SiSU_Env        end        def file_encoding #file encoding          is='' -        if defined? @rc['program_set']['file_encoding'];  is=@rc['program_set']['encoding']  +        if defined? @rc['program_set']['file_encoding'];  is=@rc['program_set']['encoding']          end          if is.nil? or is==true;                           is='encoding'          end @@ -1535,14 +1535,14 @@ module SiSU_Env        end        def wc #wordcount          is='' -        if defined? @rc['program_set']['wc'];             is=@rc['program_set']['wc']  +        if defined? @rc['program_set']['wc'];             is=@rc['program_set']['wc']          end          if is.nil? or is==true;                           is='wc'          end          is        end        def tidy -        if defined? @rc['program_set']['tidy'];           is=@rc['program_set']['tidy']  +        if defined? @rc['program_set']['tidy'];           is=@rc['program_set']['tidy']          end          if is.nil? or is==true;                           is='tidy'          end @@ -1553,7 +1553,7 @@ module SiSU_Env            true          else false          end -        is=if defined? @rc['program_set']['rexml'];      @rc['program_set']['rexml']  +        is=if defined? @rc['program_set']['rexml'];      @rc['program_set']['rexml']          else ''          end          if is.nil? or is==true;                           is='rexml' @@ -1561,7 +1561,7 @@ module SiSU_Env          is        end        def pdflatex -        is=if defined? @rc['program_set']['pdflatex'];   @rc['program_set']['pdflatex']  +        is=if defined? @rc['program_set']['pdflatex'];   @rc['program_set']['pdflatex']          else ''          end          if is.nil? or is==true;                           is='pdflatex' @@ -1569,7 +1569,7 @@ module SiSU_Env          is        end        def postgresql -        is=if defined? @rc['program_set']['postgresql'];  @rc['program_set']['postgresql']  +        is=if defined? @rc['program_set']['postgresql'];  @rc['program_set']['postgresql']          else ''          end          if is.nil? or is==true;                            is='postgresql' @@ -1577,7 +1577,7 @@ module SiSU_Env          is        end        def sqlite -        is=if defined? @rc['program_set']['sqlite'];      @rc['program_set']['sqlite']  +        is=if defined? @rc['program_set']['sqlite'];      @rc['program_set']['sqlite']          else ''          end          if is.nil? or is==true;                           is='sqlite' @@ -1627,7 +1627,7 @@ module SiSU_Env      end      def file_encoding        is='' -      if defined? @rc['program_set']['file_encoding'];  is=@rc['program_set']['encoding']  +      if defined? @rc['program_set']['file_encoding'];  is=@rc['program_set']['encoding']        end        if is.nil? or is==true;                           is='encoding'        end @@ -1650,7 +1650,7 @@ module SiSU_Env        if FileTest.file?("#{Dir.pwd}/#{fns_pod}")          system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{path.processing}")        else -        tell=SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}")  +        tell=SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}")          tell.warn unless @cmd=~/q/        end        sisupod_processing_path @@ -1729,7 +1729,7 @@ module SiSU_Env        #@file=@opt.fns #not always fns        @env=if @opt.fns and not @opt.fns.empty?          SiSU_Env::Info_env.new(@opt.fns) -      else  +      else          SiSU_Env::Info_env.new('dummy.sst')        end        if @opt.cmd =~/m/; @md=SiSU_Param::Parameters.new(@opt).get @@ -1850,12 +1850,12 @@ module SiSU_Env          r[:user]=@rc['remote']['user']          r[:host]=@rc['remote']['host']          r[:path]=if defined? @rc['remote']['path'] -          @rc['remote']['path']  +          @rc['remote']['path']          else ''          end          r[:name]="#{r[:user]}@#{r[:host]}:#{r[:path]}"          r -      else  +      else          r[:name]='.'          r[:user]=''          r[:host]='' @@ -1885,10 +1885,10 @@ module SiSU_Env      end      def scp                                                                    #sort out later using ruby libraries #not ideal, first time each file is sent, -r must be called separately for subdir to be built        input=@local_sisu_source -      output=case @opt.cmd  +      output=case @opt.cmd        when /u/;                "#{self.remote_host_base}/#{@env.path.stub_pwd}/."             #creates remote directory tree, this is not the usual function of u -      when /[aAbeEhHNopwxXy]/; "#{self.remote_host_base}/#{@env.path.stub_pwd}/#{@fnb}/."  -      else                     "#{self.remote_host_base}/#{@env.path.stub_pwd}/."  +      when /[aAbeEhHNopwxXy]/; "#{self.remote_host_base}/#{@env.path.stub_pwd}/#{@fnb}/." +      else                     "#{self.remote_host_base}/#{@env.path.stub_pwd}/."        end        if (input =~/\S/ and input !~/\/\//) and (output =~/\S/ and output !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/            System_call.new(input,output).scp @@ -1904,7 +1904,7 @@ module SiSU_Env        elsif  @opt.cmd =~/U/          puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/          puts "#{input} -> #{output}" -      else  +      else          puts 'suspect rsync request, ignored'          puts "#{input} -> #{output} remote flag: #@@flag_remote"          puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ @@ -2114,7 +2114,7 @@ module SiSU_Env        @env=SiSU_Env::Info_env.new      end      def select                                                                 # skin loading logic here -      load SiSU_lib + '/defaults.rb' +      load "#{SiSU_lib}/defaults.rb"        skin_path=[]        @env.sys.rc_path.each{|x| skin_path << "#{x}/skin"}        skin_path << "#{@env.path.processing}/external_document/skin" @@ -2261,16 +2261,16 @@ module SiSU_Env      end      def make_file(path,filename)        if File.writable?("#{path}/."); File.new("#{path}/#{filename}",'w+') -      else  -        SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn  +      else +        SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn        end      end      def touch_file(path,filename) -      if File.writable?("#{path}/.");  +      if File.writable?("#{path}/.");          system("touch #{path}/#{filename}")          #File.new("#{path}/#{filename}",'w+') -      else  -        SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn  +      else +        SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn        end      end      def make_path(path) @@ -2391,7 +2391,7 @@ module SiSU_Env      end    end    class Create_site < Info_env -    require SiSU_lib + '/css' +    require "#{SiSU_lib}/css"      include SiSU_Style      def initialize(cmd)        @cmd=cmd @@ -2435,7 +2435,7 @@ module SiSU_Env          source=Dir.glob("*.{png,jpg,gif,ico}")          File.mkpath(dest_path) unless FileTest.directory?(dest_path)          chmod(0755,dest_path) -        source.each do |i|  +        source.each do |i|            cp_r(i,"#{dest_path}/#{i}")            chmod(0644,"#{dest_path}/#{i}")          end @@ -2467,7 +2467,7 @@ module SiSU_Env        File.mkpath("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}")        css_path=['/etc/sisu/css',"#@home/.sisu/css","#@pwd/_sisu/css"] #BROKEN        if defined? @rc['permission_set']['css_modify'] and @rc['permission_set']['css_modify'] -        tell=SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}")  +        tell=SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}")          css_path.each do |x|            if FileTest.directory?(x)              cd(x) @@ -2478,7 +2478,7 @@ module SiSU_Env              cd(@pwd)            end          end -      else tell=SiSU_Screen::Ansi.new(@cmd,"modify css is not set or is set to: false")  +      else tell=SiSU_Screen::Ansi.new(@cmd,"modify css is not set or is set to: false")        end        tell.warn if @cmd=~/[MV]/        fn_css=SiSU_Env::CSS_default.new @@ -2491,27 +2491,27 @@ module SiSU_Env        style=File.new("#{path_style}/#{fn_css.html_tables}",'w')        style << css.html_tables        style.close -      style=File.new("#{path_style}/#{fn_css.html}",'w')  +      style=File.new("#{path_style}/#{fn_css.html}",'w')        style << css.html        style.close -      style=File.new("#{path_style}/#{fn_css.xml_sax}",'w')  +      style=File.new("#{path_style}/#{fn_css.xml_sax}",'w')        style << css.xml_sax        style.close -      style=File.new("#{path_style}/#{fn_css.xml_dom}",'w')  +      style=File.new("#{path_style}/#{fn_css.xml_dom}",'w')        style << css.xml_dom -      style=File.new("#{path_style}/#{fn_css.docbook_xml}",'w')  +      style=File.new("#{path_style}/#{fn_css.docbook_xml}",'w')        style << css.docbook_xml        style.close -      style=File.new("#{path_style}/#{fn_css.xhtml}",'w')  +      style=File.new("#{path_style}/#{fn_css.xhtml}",'w')        style << css.xhtml        style.close      end    end  end  module SiSU_Screen -  require SiSU_lib + '/screen_text_color' +  require "#{SiSU_lib}/screen_text_color"  end  module SiSU_Errors -  require SiSU_lib + '/errors' +  require "#{SiSU_lib}/errors"  end  __END__ diff --git a/lib/sisu/0.52/termsheet.rb b/lib/sisu/v0/termsheet.rb index 6e87a0b8..d1fb4343 100644 --- a/lib/sisu/0.52/termsheet.rb +++ b/lib/sisu/v0/termsheet.rb @@ -37,11 +37,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,13 +49,13 @@     Ralph Amissah mailto:amissah@gmail.com  =end -require SiSU_lib + '/sysenv' -require SiSU_lib + '/param' +require "#{SiSU_lib}/sysenv" +require "#{SiSU_lib}/param"  include SiSU_Param  @do,@done,@used,@html_output,@txt_input,@txt_output,@@report=Array.new(7){[]}  @@info=nil  @c=0 -@cX=SiSU_Screen::Ansi.new('yes').cX  +@cX=SiSU_Screen::Ansi.new('yes').cX  @done << "\n#{@cX.blue_hi}#{@cX.black}Summary#{@cX.off*2}"  def talent(termsheet,flag)    no_ocn='0' if flag =~/0/ #flag to request switch off of text object numbering @@ -95,7 +95,7 @@ WOK        file_array=IO.readlines(v,"\n")        @do << %{#{k}}        @filename_new << @document -        # "require v" pulls in the composite @document  +        # "require v" pulls in the composite @document          # "termsheet" having all the variables required to complete the standard form @document        @filename_new.close      end @@ -112,7 +112,7 @@ WOK    @@report << @done << @used << "\n"    @done,@used=[],[]  end -require SiSU_lib + '/param' +require "#{SiSU_lib}/param"  @argv=$*  @proc="#{@argv[0].to_s}"  if @proc =~  /^-?[wft]/ diff --git a/lib/sisu/0.52/texinfo.rb b/lib/sisu/v0/texinfo.rb index ca62710b..1aa469d5 100644 --- a/lib/sisu/0.52/texinfo.rb +++ b/lib/sisu/v0/texinfo.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,12 +47,12 @@                    ralph.amissah@gmail.com  =end  module SiSU_TexInfo -  require SiSU_lib + '/html' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/html" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    #include Stamp ... needed removed arbitrarily 2005w05/1 (warnings about undefined flags) -  require SiSU_lib + '/texinfo_format' +  require "#{SiSU_lib}/texinfo_format"    include TexInfoFormat    @tex_file=[]    @@tex_backslash="\\\\" @@ -214,7 +214,7 @@ module SiSU_TexInfo      def code_lines        data=@data        data.each do |line| -        if line =~ /\S/ and line !~ /<:(code|verse).+/  +        if line =~ /\S/ and line !~ /<:(code|verse).+/            if @@flag['code']==1              line.gsub!(/^\s*(.+)/m, "\\noindent \\marginpar\[left-text\]{\\begin{tiny}#{@@counting}\\end{tiny}}\\1\\")              @@counting+=1 if @@flag['code']==1 @@ -232,7 +232,7 @@ module SiSU_TexInfo            do_mono=TexInfoFormat::Texinfo.new(para,@md)            para=do_mono.longtable # using longtable latex package          end -        @tex_file << para  +        @tex_file << para        end      end      def markup @@ -253,9 +253,9 @@ module SiSU_TexInfo          if para =~ /^[4-6]\\+~\S+\s*(.+?)\s*$/            toc=TexInfoFormat::Texinfo.new($1,@md)            texinfo_menu << toc.menu -          case para  +          case para            when /^[4]\\+~\S+\s+(.+?)\s*$/ -            n_menu+=1  +            n_menu+=1              @submenu[n_menu]=[]            when /^[5]\\+~\S+\s+(.+?)\s*$/              n_submenu+=1 @@ -315,7 +315,7 @@ module SiSU_TexInfo          #    mono.http          else            if para !~/\S/ -            para=nil  +            para=nil            else              para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'~[\1]')              #para.gsub!(/[1-3]\\\\\{\\\\\{\\\\\{\s+/, '') diff --git a/lib/sisu/0.52/texinfo_format.rb b/lib/sisu/v0/texinfo_format.rb index dc070647..c47eb2be 100644 --- a/lib/sisu/0.52/texinfo_format.rb +++ b/lib/sisu/v0/texinfo_format.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,7 +48,7 @@  =end  module TexInfoFormat    @@table_pg_break_counter=1 -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    class Texinfo @@ -65,7 +65,7 @@ module TexInfoFormat      end      def head        t=Time.now -      year = t.year +      year=t.year        filename=%{#{@md.fns}}[/(.+?)\.\w\w\d\d$/,1]        title=Texinfo.new(@md.title).spec_char        title=title.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{@@tex_backslash*2} ") @@ -153,17 +153,17 @@ WOK        title=Texinfo.new(@md.title).spec_char if @md.title        subtitle=Texinfo.new(@md.subtitle).spec_char if @md.subtitle        dc_title="#{title} - #{subtitle}" -      dc_creator=Texinfo.new(@md.dc_creator).spec_char if @md.dc_creator  -      dc_subject=Texinfo.new(@md.dc_subject).spec_char if @md.dc_subject   +      dc_creator=Texinfo.new(@md.dc_creator).spec_char if @md.dc_creator +      dc_subject=Texinfo.new(@md.dc_subject).spec_char if @md.dc_subject        dc_description=Texinfo.new(@md.dc_description).spec_char if @md.dc_description        dc_publisher=Texinfo.new(@md.dc_publisher).spec_char if @md.dc_publisher        dc_contributor=Texinfo.new(@md.dc_contributor).spec_char if @md.dc_contributor -      dc_date=Texinfo.new(@md.dc_date).spec_char if @md.dc_date   +      dc_date=Texinfo.new(@md.dc_date).spec_char if @md.dc_date        dc_date_created=Texinfo.new(@md.dc_date_created).spec_char if @md.dc_date_created -      dc_date_issued=Texinfo.new(@md.dc_date_issued).spec_char if @md.dc_date_issued   +      dc_date_issued=Texinfo.new(@md.dc_date_issued).spec_char if @md.dc_date_issued        dc_date_available=Texinfo.new(@md.dc_date_available).spec_char if @md.dc_date_available        dc_date_valid=Texinfo.new(@md.dc_date_valid).spec_char if @md.dc_date_valid -      dc_date_modified=Texinfo.new(@md.dc_date_modified).spec_char if @md.dc_date_modified   +      dc_date_modified=Texinfo.new(@md.dc_date_modified).spec_char if @md.dc_date_modified        dc_type=Texinfo.new(@md.dc_type).spec_char if @md.dc_type        dc_format=Texinfo.new(@md.dc_format).spec_char if @md.dc_format        dc_identifier=Texinfo.new(@md.dc_identifier).spec_char if @md.dc_identifier @@ -476,7 +476,7 @@ WOK        z=@para[/\\\{(.+?)\}(?:image|png)/,1] # match operator for z \\ fragile !        image,w,x,y=z.scan(/\S+/)        image.gsub!(/\\/,'') -      @para.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,"<image #{image} not available>")  # fragile match operator\\ fragile !  +      @para.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,"<image #{image} not available>")  # fragile match operator\\ fragile !      end      def http        # very messy clean up ! - work area, testing @@ -486,7 +486,7 @@ WOK          image,w,x,y=z.scan(/\S+/)          image.gsub!(/\\/,'')          width=200 -        width=z[/w=(\d+)/im,1] if z =~/w=(\d+)/  +        width=z[/w=(\d+)/im,1] if z =~/w=(\d+)/          width=width.to_i*0.8          width=400 if width > 400          c=z[/``(.+?)''/im,1] @@ -494,11 +494,11 @@ WOK        end        if image          dir=SiSU_Env::Info_env.new(@md.fns) -        @para.gsub!(/\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/, # fragile match operator\\ fragile !  +        @para.gsub!(/\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/, # fragile match operator\\ fragile !            "\n\\href{#{url}}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_tex}/#{image}}}#{caption}")        else          link=z[/(.+?)\\/im,1] -        @para.gsub!(/\{.+?\}(?:https?|ftp):\/\/\S+/,"\n\\noindent\\href{#{url}}{#{link}}")  # fragile match operator\\ fragile !  +        @para.gsub!(/\{.+?\}(?:https?|ftp):\/\/\S+/,"\n\\noindent\\href{#{url}}{#{link}}")  # fragile match operator\\ fragile !        end      end    end diff --git a/lib/sisu/0.52/texpdf.rb b/lib/sisu/v0/texpdf.rb index c4df0611..7440289d 100644 --- a/lib/sisu/0.52/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,11 +48,11 @@  =end  module SiSU_TeX    require 'pstore' -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/texpdf_format' +  require "#{SiSU_lib}/texpdf_format"    include SiSU_TeX_Pdf    @tex_file=@@tex_footnote_array=@@tex_col_w=[]    @@tex_backslash ||="\\\\" @@ -66,12 +66,12 @@ module SiSU_TeX    @@date ||=SiSU_Env::Info_date.new    class Source #Songsheet #<SiSU_Param::MyFiles      require 'pstore' -    require SiSU_lib + '/sysenv' -    require SiSU_lib + '/param' +    require "#{SiSU_lib}/sysenv" +    require "#{SiSU_lib}/param"      include SiSU_Env      include SiSU_Param      include SiSU_Viz -    require SiSU_lib + '/dal' +    require "#{SiSU_lib}/dal"      include SiSU_DAL      include SiSU_TeX      def initialize(opt) @@ -104,7 +104,6 @@ module SiSU_TeX          tell.flow if @opt.cmd =~/[MVv]/          tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{path}/#{@md.fnb}/#{@md.fn[:pdf_p]}")          tell.flow if @opt.cmd =~/[MVv]/ -        data=IO.readlines(@opt.fns,'')                                             #wasteful, revisit          @md=SiSU_Param::Parameters.new(@opt).get          my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)          if @md.flag_pdf @@ -129,8 +128,8 @@ module SiSU_TeX        rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error        ensure          unless @opt.cmd =~/[MV]/ #check maintenance flag -          texfiles = Dir["#{@env.path.tex}/#{@opt.fns}*"] -          texfiles.each do |f|  +          texfiles=Dir["#{@env.path.tex}/#{@opt.fns}*"] +          texfiles.each do |f|              if FileTest.file?(f)                File.unlink(f)              end @@ -227,7 +226,7 @@ module SiSU_TeX        include SiSU_Param        @@tex_backslash ||="\\\\"        @@tilde='\\\\\\~' #?? debug crazy -      @@tex_head_portrait,@@tex_head_landscape=[],[] +      @@tex_head_portrait,@@tex_head_landscape=nil,nil        @@flag_group,@@flag_code=false,false        @@dp,@@prefix_b=nil,nil        def initialize(data,md,orientation) @@ -240,8 +239,8 @@ module SiSU_TeX        end        def songsheet          begin -          @@tex_footnote_array=[] #check            data=@data +          @@tex_footnote_array=[]            @@rights=nil            tell=SiSU_Screen::Ansi.new(@md.cmd,"pdfTex #@orientation")            tell.txt_grey unless @md.cmd =~/q/ @@ -260,42 +259,45 @@ module SiSU_TeX              @@prefix_b="\n #{@@tex_backslash*2}[3]\\ \\linebreak \\ #{prefix_b}\n" unless @@prefix_b            end            if @md.markup.to_s !~/url_png/ -            @data=pre -            @data=footnote +            data=pre(data) +            data=footnote(data)              if @md.flag_tables -              @data=tables +             data=tables(data)              end -            @data=numbering -            @data=markup -            output +            data=number_paras(data) if @md.markup !~/not_to/ #check +            data=markup(data) +            output(data)            end          rescue; SiSU_Errors::Info_error.new($!,$@,@md.fns,@md.cmd).error          ensure          end        end      protected -      def pre +      def pre(data)          @tex_file=[] -        data=@data          data.each do |para|            # DEBUG 2003w16 this is a kludge, because i could not get parameters            # from param, Sort out ... revert to more elegant solution -          # even more of a kludge as had to insert newlines where code is used not satisfactory, think about  -          pg=if para =~/<:br>/; para.split(/<:br>/) -          else                   para -          end -          pg.each do |pg| -          if pg =~/<!Th?¡\s+c/; @md.flag_tables=true # KLUDGE get from param +          # even more of a kludge as had to insert newlines where code is used not satisfactory, think about +          para=if para =~/<:br>|\n/; para.split(/<:br>|\n/) +          else para            end -          do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,pg) -          @tex_file << do_mono.special_characters +          if para.class == String +            @md.flag_tables=true if para =~/<!Th?¡\s+c/  +            do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para) +            @tex_file << do_mono.special_characters +          elsif para.class == Array +            para.each do |grp| +              @md.flag_tables=true if grp =~/<!Th?¡\s+c/  +              do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,grp) +              @tex_file << do_mono.special_characters +            end            end          end          data=@tex_file.delete_if {|x| x =~/^\s*0#{@@tilde}/}          @tex_file        end -      def footnote -        data=@data.dup +      def footnote(data)          @tex_file=[]          data.each do |para|            para2=para.dup @@ -310,17 +312,18 @@ module SiSU_TeX          end          @tex_file        end -      def tables -        data=@data +      def tables(data)          @tex_file=[]          @@tableheader=0          data.each do |para|            if para =~/¡|<!T/              do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para) -            para=do_mono.longtable_landscape if @orientation =~/landscape/ # using longtable latex package -            para=do_mono.longtable_portrait if @orientation =~/portrait/ # using longtable latex package +            case @orientation                                                   # using longtable latex package +            when /landscape/; para=do_mono.longtable_landscape +            when /portrait/; para=do_mono.longtable_portrait +            end            end -          @tex_file << para  +          @tex_file << para          end        end        def enclose(para,type='') @@ -332,19 +335,18 @@ module SiSU_TeX          else para          end        end -      def markup -        data=@data +      def markup(data)          @tex_file=[]          md={} -        #% document headers watch special characters in title & subtitle: glark "\{\{~(sub)?title.+?[$&%#_\{\}]" *.(lm|er)??   +        #% document headers watch special characters in title & subtitle: glark "\{\{~(sub)?title.+?[$&%#_\{\}]" *.(lm|er)??          home=@vz.txt_home.gsub(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>|\\\\/,' - ') #no line splitting in heading neither html nor latex -        title=@md.title.gsub(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>|\\\\/,' - ') #no line splitting in heading neither html nor latex  +        title=@md.title.gsub(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>|\\\\/,' - ') #no line splitting in heading neither html nor latex          subtitle=@md.subtitle.gsub(/<(br|p)>|<\/\s*(br|p)>|<(br|p)\s*\/>|\\\\/,' - ') if @md.subtitle #no line splitting in heading neither html nor latex          orient=SiSU_TeX_Pdf::Format_text_object.new(@md,@orientation,"#{home}: - #{title} #{subtitle}") #.new          if @orientation =~/portrait/ -          @@tex_head_portrait << orient.document_head_with_orientation +          @@tex_head_portrait=orient.document_head_with_orientation          elsif @orientation =~/landscape/ -          @@tex_head_landscape << orient.document_head_with_orientation +          @@tex_head_landscape=orient.document_head_with_orientation          end          @tex_file <<<<WOK  #{@tex.header}#{@tex.footer} @@ -368,7 +370,7 @@ WOK  \\author{\\href{#{@md.creator_home}}{#@copymark \\textnormal{#{creator}}}}  WOK -            else "\n\\author{#@copymark \\textnormal{#{creator}}}"  +            else "\n\\author{#@copymark \\textnormal{#{creator}}}"              end            end            @tex_file << unless @md.fnb =~/^mail\s*$/ @@ -384,7 +386,7 @@ WOK  \\author{\\href{#{@md.creator_home}}{#@copymark \\textnormal{#{creator}}}}  WOK -            else "\n\\author{#@copymark \\textnormal{#{creator}}}"  +            else "\n\\author{#@copymark \\textnormal{#{creator}}}"              end             end            @tex_file << unless @md.fnb =~/^mail\s*$/; "\n\\date{copy @ #{@tex.site} #{sisu_rc_footnote}}" @@ -404,7 +406,7 @@ WOK          else                         @tex.doc_no_sc_info          end          @tex_file << @tex.manifest_info -        @tex_file << @tex.newpage  +        @tex_file << @tex.newpage          @tex_file <<<<WOK  \\pagestyle{fancy}  \\tableofcontents @@ -412,7 +414,7 @@ WOK  \\pagenumbering{arabic}  #{@tex.paraskip_normal}  WOK -        @tex_file << @tex.newpage  +        @tex_file << @tex.newpage          @group_collect=[]          data.each do |para|                                                      #% case follows with levels 1-6 indents & graphics            mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para) @@ -470,7 +472,7 @@ WOK              when /^4#{@@tilde}/;       mono.level4              when /^5#{@@tilde}/;       mono.level5              when /^6#{@@tilde}/;       mono.level6 -            when /^<:i1>/;             mono.indent1  +            when /^<:i1>/;             mono.indent1              when /^<:i2>/;             mono.indent2              when /<:=/;                mono.symbol_graphic #watch              when /^\s*<:image\s+/;     mono.image @@ -491,7 +493,7 @@ WOK          @tex_file << "\n\\newpage\n" # was \\pagebreak\n          @md.subtitle_tex=@md.subtitle.dup if @md.subtitle          # kludge ... look again later -        @tex_file << if @md.doc_skin !~/skin_mail/; @tex.doc_tail  +        @tex_file << if @md.doc_skin !~/skin_mail/; @tex.doc_tail          else                                        @tex.mail_tail          end          if defined? @md.lnk and @md.lnk @@ -516,7 +518,7 @@ WOK              end            end          end -        @tex_file << " #{@tex.sitename} home: \\\\  +        @tex_file << " #{@tex.sitename} home: \\\\  \\begin{bfseries}#{@tex.site}\\end{bfseries}  "          #Stamp.stamp #removed 200408 but watch @@ -535,23 +537,7 @@ WOK          end          @tex_file << "\n\\end{document}"        end -      def footnote_call_number -        data=@data -        data.each do |word| -          if word =~/<:e>/ -            @@tex_footnote_array[@@tex_footnote_call_counter].strip!  if @@tex_footnote_array[@@tex_footnote_call_counter] -            word.gsub!(/<:e>/, -              " \\footnote{%\n #{@@tex_footnote_array[@@tex_footnote_call_counter]}} ") -            @@tex_footnote_call_counter+=1 -          end -        end -      end -      def numbering -        data=@data -        LaTeX_create.new(data,@md,@orientation).number_paras if @md.markup !~/not_to/ -      end -      def number_paras -        data=@data +      def number_paras(data)          @tex_file=[]          data.each do |para|            if para =~/<\\~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ and para !~/\\end\{longtable\}|<EOF>/ #catch <!TZ!> @@ -569,7 +555,7 @@ WOK            #elsif para =~/<!T.+?!~\d+?>/            elsif para =~/^<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+>/ #extra 2005 this is added for tables, rationalise              m=/<~(\d+);[oh]\d+;\w\d+>/m -            paranum=para[m, 1] +            paranum=para[m,1]              para.gsub!(/<~\d+;(?:[oh]|[0-6]:)\d+;\w\d+>/,'')              para="\\marginpar{\\begin{tiny}#{paranum}\\end{tiny}}" + para            elsif para =~/\\end\{longtable\}/ #catch <!TZ!> @@ -580,30 +566,30 @@ WOK          end          @tex_file        end -      def output -        data=@data -        @tex_file=[] +      def output(data)          data.flatten!          data.compact! -        data.each do |para| -          para.gsub!(/^\s+/,'') -          @tex_file << para -        end          fns_l=@md.fns.gsub(/~/,'-') #this is a sorry fix, but necessary as it appears latex programs like not ~ -        if @orientation =~/landscape/    #@tex_file << "\n<!EOF!>" +        if @orientation =~/landscape/            filename_tex_landscape=File.new("#{@env.path.tex}/#{fns_l}.landscape.tex",'w+') -          filename_tex_landscape << @@tex_head_landscape  -          @tex_file.each {|para| filename_tex_landscape.puts para,"\n" unless para.empty?} +          filename_tex_landscape << @@tex_head_landscape +          data.each do |para| +            para.gsub!(/^\s+/,'') +            filename_tex_landscape.puts para,"\n" if para !~/\A\s*\Z/ +          end            filename_tex_landscape.close            @@tex_head_landscape=[]          elsif @orientation =~/portrait/            filename_tex_portrait=File.new("#{@env.path.tex}/#{fns_l}.tex",'w+')            filename_tex_portrait << @@tex_head_portrait -          @tex_file.each {|para| filename_tex_portrait.puts para,"\n" unless para.empty?}  +          data.each do |para| +            para.gsub!(/^\s+/,'') +            filename_tex_portrait.puts para,"\n" if para !~/\A\s*\Z/ +          end            filename_tex_portrait.close            @@tex_head_portrait=[]          end -        @tex_file=[] +        data=[]        end      end    end diff --git a/lib/sisu/0.52/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb index 50945af4..ea418dd2 100644 --- a/lib/sisu/0.52/texpdf_format.rb +++ b/lib/sisu/v0/texpdf_format.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,7 +48,7 @@  =end  module SiSU_TeX_Pdf    @@table_pg_break_counter=1 -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    class Use_TeX @@ -126,7 +126,7 @@ WOK        v=SiSU_Env::Info_version.new.get_version        base_prog_txt=if @md.base_program          case @md.base_program -        when /kdissert/i; "\n\\\\ This document prepared using \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert \\ http://freehackers.org/~tnagy/kdissert/ } \\\\ Kdissert is Document Mapping software by Thomas Nagy"  +        when /kdissert/i; "\n\\\\ This document prepared using \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert \\ http://freehackers.org/~tnagy/kdissert/ } \\\\ Kdissert is Document Mapping software by Thomas Nagy"          else ''          end        else '' @@ -134,12 +134,12 @@ WOK  <<WOK  \\\\ ~  {\\begin{footnotesize}#{base_prog_txt} -\\\\ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU \\ www.jus.uio.no/sisu } \\begin{tiny}[ #{v[:project]} #{v[:version]} of #{v[:date_stamp]} ]\\end{tiny}  -\\\\ using SiSU: object citation numbering, markup, meta-markup, and system  +\\\\ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU \\ www.jus.uio.no/sisu } \\begin{tiny}[ #{v[:project]} #{v[:version]} of #{v[:date_stamp]} ]\\end{tiny} +\\\\ using SiSU: object citation numbering, markup, meta-markup, and system  \\\\ #@copymark Ralph Amissah 1997, current #{@date.year}, All Rights Reserved.  \\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 2 } or later, \\href{http://www.fsf.org/licenses/gpl.html}{http://www.fsf.org/licenses/gpl.html}.  {\\end{footnotesize} -\\\\  +\\\\  WOK      end      def doc_sc_info_footnote_full @@ -154,10 +154,10 @@ WOK        v=SiSU_Env::Info_version.new.get_version  <<WOK  \\\\ -{\\begin{footnotesize}  +{\\begin{footnotesize}  Document version information: \\\\  \\emph{sourcefile} \\uline{#{@md.fnstex}}; \\emph{version} \\uline{#{@md.sc_number}}; \\emph{date} \\uline{#{@md.sc_date}}; \\emph{time} \\uline{#{@md.sc_time}} \\\\ -Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- version information: \\\\  +Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- version information: \\\\  \\uline{ #{v[:project]} #{v[:version]} of #{v[:date_stamp]}}  \\end{footnotesize}}&  WOK @@ -166,10 +166,10 @@ WOK        v=SiSU_Env::Info_version.new.get_version  <<WOK  \\\\ -{\\begin{small}  +{\\begin{small}  Document information: \\\\  \\emph{sourcefile} \\uline{#{@md.fnstex}} \\\\ -Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- version information: \\\\  +Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- version information: \\\\  \\uline{ #{v[:project]} #{v[:version]} of #{v[:date_stamp]}}  \\end{small}}& @@ -179,7 +179,7 @@ WOK        url=@md.fnb.gsub(/(?:\\)*([$&~%_#}{^])/,'\\\\\1')        fn=@md.fn[:manifest].gsub(/(?:\\)*([$&~%_#}{^])/,'\\\\\1')  <<WOK -{\\begin{footnotesize}  +{\\begin{footnotesize}  \\\\ For alternative output formats of this document check:  \\\\ \\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{fn}}{#{@vz.url_root_http}/#{url}/#{fn}}\\end{scriptsize}  \\end{footnotesize}}& @@ -211,12 +211,12 @@ WOK  \\\\  \"Support Open Standards and Open Sources for the Information Technology Infrastructure\" RA\\subsubsection*{Information on this document copy #{site}}  \\addcontentsline{toc}{subsection}{Information on this document copy} -{\\begin{footnotesize}  +{\\begin{footnotesize}  \\\\ Generated by \\href{http://www.jus.uio.no/sisu/}{SiSU} found at \\href{http://www.jus.uio.no/sisu/}{www.jus.uio.no/sisu} \\begin{tiny}[ #{v[:project]} #{v[:version]} #{v[:date_stamp]} ]\\end{tiny} (using SiSU: object citation numbering, markup, meta-markup, and system) #@copymark Ralph Amissah 1997, current #{@date.year}, All Rights Reserved. -\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 2 } or later (\\href{http://www.fsf.org/licenses/gpl.html}{www.fsf.org/licenses/gpl.html}). {\\end{footnotesize}  -{\\begin{small}  +\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 2 } or later (\\href{http://www.fsf.org/licenses/gpl.html}{www.fsf.org/licenses/gpl.html}). {\\end{footnotesize} +{\\begin{small}  \\\\ W3 since October 3 1993 \\href{http://www.jus.uio.no/sisu/}{#{sisu_ico}}SiSU 1997, current #{@date.year}. \\\\ #{sitename} presentations at \\begin{bfseries}#{site}\\end{bfseries} \\\\ \\\\ #{@md.title} \\textbf{pdf} versions can be found at:  \\\\ -{\\end{small}  +{\\end{small}  \\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_p]}}{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_p]}}\\end{scriptsize}  \\\\  \\begin{scriptsize}\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_l]}}{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_l]}}\\end{scriptsize}  \\\\  \\\\\n#{@md.title} \\textbf{html} versions may be found at: \\\\ @@ -275,7 +275,7 @@ WOK        if @string[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/]          no_of_cols,cols_width,ocn=$1,$2,$3          tw=case @md.papersize -        when /a4/i;      @tx.a4.landscape.w     #European default, SiSU default  +        when /a4/i;      @tx.a4.landscape.w     #European default, SiSU default          when /letter/i;  @tx.letter.landscape.w #U.S. default          when /legal/i;   @tx.legal.landscape.w  #U.S. alternative          when /book|b5/i; @tx.b5.landscape.w     #book default - larger @@ -327,7 +327,7 @@ WOK        if @string[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/]          no_of_cols,cols_width,ocn=$1,$2,$3          tw=case @md.papersize -        when /a4/i;      @tx.a4.portrait.w     #European default, SiSU default  +        when /a4/i;      @tx.a4.portrait.w     #European default, SiSU default          when /letter/i;  @tx.letter.portrait.w #U.S. default          when /legal/i;   @tx.legal.portrait.w  #U.S. alternative          when /book|b5/i; @tx.b5.portrait.w     #book default - larger @@ -375,7 +375,7 @@ WOK        @string="<~#{ocn}>" + @string      end      def scopedtable -      # some features related to headers have been incorporated in longtable that are not included yet here,  +      # some features related to headers have been incorporated in longtable that are not included yet here,        # so until synced is broken on some input files, work needs to be done if is to work as before        @end_table="\\end{tabular}"        @row_break='\\\\\\\\' @@ -397,7 +397,7 @@ WOK        end        if @string =~/<!¡/          if @@table_pg_break_counter == 28 # taken from 34 ideal for portrait to 28 which suits landscape -          @string = "\n\n#@end_table \n#@break_page#@start_table\n" +          @string="\n\n#@end_table \n#@break_page#@start_table\n"            @@table_pg_break_counter=1          else            @string.gsub!(/<!¡/,'') @@ -595,8 +595,8 @@ WOK        cont_ln.gsub!(/#{@@tex_pattern_margin_number}/,'')        cont_ln.gsub!(/#{lev}#{@@tilde}\s+/,'')        if para =~/\\[Ff]ootnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings! -        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')  -        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')  +        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ') +        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')        end        para.gsub!(/(#{@md.lev}.*)\n?$/m,"\\part*{\\1}  \\addcontentsline{toc}{section}{#{cont_ln}} @@ -604,7 +604,7 @@ WOK        para.gsub!(/^#{lev}#{@@tilde}\s*(.*)\n?$/m,          "\\part*{\\1}  \\addcontentsline{toc}{section}{#{cont_ln}} -\\markboth{#{title}}\n")  +\\markboth{#{title}}\n")      end      def level1        heading_major(@string,1) @@ -626,22 +626,22 @@ WOK        cont_ln.gsub!(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22        title=@md.title        @string.gsub!(/#{@md.lv4}\s+(#{@md.lv4})/m,'\1') -      if @string =~/4#{@@tilde}endnotes|<:4-endnotes>/   +      if @string =~/4#{@@tilde}endnotes|<:4-endnotes>/          # watch exclusion removes endnotes marker from pdf 2003w03          @string.gsub!(/.+/m,'')        end        if @string =~/\\footnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings! -        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')  -        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')  +        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ') +        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')        end        if @string !~/4#{@@tilde}/          @string.gsub!(/(#{@md.lv4}.*)\n?$/m,"\\subsubsection*{\\1}  \\addcontentsline{toc}{subsection}{#{cont_ln}} -\\markright{#{title}}")  +\\markright{#{title}}")        else          @string.gsub!(/^\s*4#{@@tilde}\S+\s*(.*)?\n?$/m,"\\subsubsection*{\\1}  \\addcontentsline{toc}{subsection}{#{cont_ln}} -\\markright{#{title}}")  +\\markright{#{title}}")        end        @string.gsub!(/#{@md.lv4}\s*(.marginpar)/m,'\1')      end @@ -657,8 +657,8 @@ WOK        cont_ln.gsub!(/\\\&/,' and ') #revisit: tmp bugfix 200507, substitutes & with 'and' in toc, needed e.g. for AT&T, see ffa        @string.gsub!(/#{@md.lv5}\s+(#{@md.lv5})/m,'\1')        if @string =~/\\footnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings! -        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')  -        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')  +        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ') +        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')        end        if @string !~/5#{@@tilde}/          @string.gsub!(/(#{@md.lv5}.*?)\n?$/m,"\\subsubsection*{\\1} @@ -682,8 +682,8 @@ WOK        cont_ln.gsub!(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22        @string.gsub!(/#{@md.lv6}\s+(#{@md.lv6})/m,'\1')        if @string =~/\\footnote/ #and para =~/^[1-6]#{@@tilde}/ # removing footnotes from headings! -        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ')  -        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')  +        cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ') +        cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ')        end        @string.gsub!(/(#{@md.lv6}.*)\n?$/m,          "\\subsubsection*{\\1}") if (@string !~/6#{@@tilde}/) @@ -702,7 +702,7 @@ WOK        @string.gsub!(/<:i2>(.*)/m,          '\begin{ParagraphIndent}{0.02\columnwidth} \1  \end{ParagraphIndent} -')  +')      end      def symbol_graphic        dir=SiSU_Env::Info_env.new(@md.fns) @@ -713,7 +713,7 @@ WOK        else          tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search path: #{dir.path.image_source_tex}")          tell.error2 unless @md.cmd =~/q/ -        @string.gsub!(/\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/,'') # fragile match operator\\ fragile !  +        @string.gsub!(/\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/,'') # fragile match operator\\ fragile !        end      end      def image @@ -736,7 +736,7 @@ WOK          @string.gsub!(/<:image\s+((?:https?|ftp)\S+)\s+(\S+)\s+.+\s+?>/,            @center_begin + "\\href{\\1}{\\includegraphics*[width=#{width}pt]{#{image_source}/\\2}}" + @center_end )          @string.gsub!(/<:image\s+(\S+)\s+.+\s+?>/, -          @center_begin + "\\includegraphics*[width=#{width}pt]{#{image_source}/\\1}" + @center_end )           +          @center_begin + "\\includegraphics*[width=#{width}pt]{#{image_source}/\\1}" + @center_end )        else @string.gsub!(/<:image\s+(\S+)\s+.+\s+?>/,'\1}')        end      end @@ -772,10 +772,10 @@ WOK          nil        end        if image_source -        @string.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/, # fragile match operator\\ fragile !  +        @string.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/, # fragile match operator\\ fragile !            "#@center_begin\n\\includegraphics*[width=#{width}pt]{#{image_source}/#{image}}#{caption}#@center_end")        else -        @string.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,'') # fragile match operator\\ fragile !  +        @string.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,'') # fragile match operator\\ fragile !        end      end      def http_word_mode(orientation='') @@ -791,7 +791,7 @@ WOK              r=%r/\\\{(.+?)\\?\}((?:https?|ftp):\S+)/              d=''            end -          z,url=r.match(word).captures if word =~r  +          z,url=r.match(word).captures if word =~r            url=url.strip            if word =~/\{\s*\S+\.?(?:png|jpg|gif)/ and word=~/\s+\d+x\d+\s+/              image,x,y=z.scan(/\S+/) @@ -826,21 +826,21 @@ WOK            end            ins=if image #most images fc etc. #% clean up !              out=if @md.fns =~/\._?sst$/ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}") -              @center_begin +           +              @center_begin +                "\\\n\\href{#{url}}" + #not satisfactory: \\ added to ^line to mimic reference file output                "{\\includegraphics*[width=#{width}pt]" +                "{#{dir.path.image_source_local_tex}/#{image}}}" +                "#{caption}" +                @center_end if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+)/              elsif @md.fns =~/\.-ss[tm]$/ and FileTest.file?("#{dir.path.image_source_remote_tex}/#{image}") -              @center_begin +           +              @center_begin +                "\\\n\\href{#{url}}" + #not satisfactory: \\ added to ^line to mimic reference file output                "{\\includegraphics*[width=#{width}pt]" +                "{#{dir.path.image_source_remote_tex}/#{image}}}"  +                "#{caption}" +                @center_end if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+)/              elsif FileTest.file?("#{dir.path.image_source_tex}/#{image}") -              @center_begin +           +              @center_begin +                "\\\n\\href{#{url}}\n" + #not satisfactory: \\ added to ^line to mimic reference file output, mirror above ... not tested                "{\\includegraphics*[width=#{width}pt]" +                "{#{dir.path.image_source_tex}/#{image}}}" + @@ -849,7 +849,7 @@ WOK              else                tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_local_tex},#{dir.path.image_source_remote_tex} and #{dir.path.image_source_tex}")                tell.error2 unless @md.cmd =~/q/ -              '' if word =~ /\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/  +              '' if word =~ /\{\S+\.(png|jpg|gif).+?\}(?:https?|ftp):\/\/\S+/              end            else              link=z.strip #[/(.+?)\\/m,1] @@ -860,7 +860,7 @@ WOK        end        @words.join      end -    def http(orientation)  +    def http(orientation)        wm=@string.dup.scan(/\\\{.+?\\\}(?:(?:https?|ftp):\S+|image)|\w+\s*|./m) #first match of interest others passed through        @string=SiSU_TeX_Pdf::Format_text_object.new(@md,wm).http_word_mode(orientation)      end @@ -924,11 +924,11 @@ WOK      def tex_head_encode        case @md.file_encoding        when /iso-?8859/i                                                         #% iso8859 -      <<WOK  +      <<WOK  \\usepackage[latin1]{inputenc}  WOK        else                                                                      #% utf-8 assumed -      <<WOK  +      <<WOK  \\usepackage{babel}  \\usepackage{ucs}  \\usepackage[utf8x]{inputenc} @@ -951,7 +951,7 @@ WOK      def tex_head_paper_portrait(d)        <<WOK  #{tex_head_info} -\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang},titlepage]{scrartcl}        %with titlepage  +\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang},titlepage]{scrartcl}        %with titlepage  \\setlength{\\textheight}{#{d[:textheight]}mm}  \\setlength{\\textwidth}{#{d[:textwidth]}mm}  \\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}}  \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}  \\setlength{\\topmargin}{#{d[:topmargin]}}  \\setlength{\\headheight}{#{d[:headheight]}} @@ -983,7 +983,7 @@ WOK          d[:headheight],d[:headsep],d[:columnsep]='12pt','35pt',''          d[:marginparsep],d[:marginparwidth]='4mm','8mm'          case @md.papersize -        when /a4/i           #European default, SiSU default  +        when /a4/i           #European default, SiSU default            d[:papertype],d[:fontsize]='a4paper','12pt'            d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w          when /letter/i   #U.S. default @@ -1009,7 +1009,7 @@ WOK          d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt'          d[:marginparsep],d[:marginparwidth]='4mm','8mm'          case @md.papersize -        when /a4/i                            #European default, SiSU default  +        when /a4/i                            #European default, SiSU default            d[:papertype],d[:fontsize]='a4paper','12pt'            d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w          when /letter/i                    #U.S. default @@ -1035,9 +1035,9 @@ WOK        d={}        case @string        when /portrait/ -        tex_head_paper_portrait(tex_head_paper_dimensions)  +        tex_head_paper_portrait(tex_head_paper_dimensions)        when /landscape/ -        tex_head_paper_landscape(tex_head_paper_dimensions)  +        tex_head_paper_landscape(tex_head_paper_dimensions)        end      end      def tex_head_pdftex @@ -1045,7 +1045,7 @@ WOK        when /portrait/        <<WOK    colorlinks=true, -  urlcolor=myblack,  +  urlcolor=myblack,    filecolor=myblack,    linkcolor=myblack,  WOK @@ -1137,7 +1137,8 @@ WOK  \\item[]  }  {\\end{list}} -\\usepackage{fancyhdr}\n\\lhead{} +\\usepackage{fancyhdr} +\\lhead{}  \\renewcommand{\\part}{\\\@startsection  {part}%  {1}% @@ -1179,7 +1180,7 @@ WOK  {-2mm}%  {-\\baselineskip}%  {0.5\\baselineskip}% -{\\normalfont\\normalsize\\itshape}}%\n +{\\normalfont\\normalsize\\itshape}}%  \\selectlanguage{#{language}}  WOK      end @@ -1205,18 +1206,6 @@ WOK        end        @string      end -    def lev1 -    end -    def lev2 -    end -    def lev3 -    end -    def lev4 -    end -    def lev5 -    end -    def lev6 -    end    end  end  __END__ diff --git a/lib/sisu/0.52/update.rb b/lib/sisu/v0/update.rb index 811e0946..1b33ef92 100644 --- a/lib/sisu/0.52/update.rb +++ b/lib/sisu/v0/update.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,7 +49,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Update_control_flag -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Param    class Check diff --git a/lib/sisu/0.52/urls.rb b/lib/sisu/v0/urls.rb index 22f929e8..a1e72850 100644 --- a/lib/sisu/0.52/urls.rb +++ b/lib/sisu/v0/urls.rb @@ -5,7 +5,7 @@     * http://www.jus.uio.no/sisu/SiSU/download.html   * Description: urls for output files -  +   * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Ralph Amissah   * License: GPL 2 or later @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,10 +47,10 @@                    ralph.amissah@gmail.com  =end  module SiSU_urls -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Screen -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    class Source      attr_reader :opt diff --git a/lib/sisu/0.52/webrick.rb b/lib/sisu/v0/webrick.rb index b6f2bd67..d7565c24 100644 --- a/lib/sisu/0.52/webrick.rb +++ b/lib/sisu/v0/webrick.rb @@ -38,7 +38,7 @@    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -57,7 +57,7 @@ def brick(port,get='')        :DocumentRoot => Dir::pwd + '/htdocs',        :CGIPathEnv   => ENV['PATH']      ) -    cgi_dir = File.expand_path(cgidir) +    cgi_dir=File.expand_path(cgidir)      @mount.each { |x,y|                                                        # mount subdirectories        s.mount(x, HTTPServlet::FileHandler, y, true)      } @@ -69,13 +69,13 @@ def brick(port,get='')    ensure    end  end -begin                                                                          #%  +begin                                                                          #%    require 'webrick'    include WEBrick    require 'time'    require 'fileutils'    include FileUtils -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Screen    @cX=SiSU_Screen::Ansi.new('yes').cX @@ -83,7 +83,7 @@ begin                                                                          #    port=SiSU_Env::Info_port.new    @argv=$*    @host=@env.url.webrick -  #@host=ENV['HOSTNAME']  +  #@host=ENV['HOSTNAME']    host='localhost'    @port="#{@argv[0].to_i}"    @port="#{port.webrick}" if @port =~ /^0$/ @@ -123,13 +123,13 @@ begin                                                                          #        page.head { page.title {"#@host Webrick Report"} } +        page.body {          page.h1 {"Webrick #@host"} + -        page.p {"Webrick is Ruby's built in webserver."} +  -        page.center {"Host name: " + page.b{"#@host "} + "(#@host)  port: " + page.b{"#@port"}} +  -        page.center {"#{Time.now}"} +  -        page.center {"#{Time.now.strftime(%{%Yw%W})}"} +  +        page.p {"Webrick is Ruby's built in webserver."} + +        page.center {"Host name: " + page.b{"#@host "} + "(#@host)  port: " + page.b{"#@port"}} + +        page.center {"#{Time.now}"} + +        page.center {"#{Time.now.strftime(%{%Yw%W})}"} +          #page.center { "Center " + page.em{"emphasise "} + page.i{"italicise " } + page.b{"bold "} + page.u{"underline "}} + -        page.p {''} +  -        page.p {''} +  +        page.p {''} + +        page.p {''} +          page.p {page.b{"Webrick Served Directories: "}} +  WOK                                                             #% wb_s2 (mounts) @@ -140,7 +140,7 @@ end                                                             #% wb_end    wb_end=<<WOK          page.p {page.b{"Contents of PWD (see URL): "}} + -        page.p {"#\{dir_contents}"}  +        page.p {"#\{dir_contents}"}        }      }    } diff --git a/lib/sisu/0.52/wikispeak.rb b/lib/sisu/v0/wikispeak.rb index a8ae64f1..8e8100fc 100644 --- a/lib/sisu/0.52/wikispeak.rb +++ b/lib/sisu/v0/wikispeak.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,14 +49,14 @@                    ralph.amissah@gmail.com  =end  module SiSU_Wikispeak -  require SiSU_lib + '/dal' -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/plaintext_format' +  require "#{SiSU_lib}/plaintext_format"    include Format -  require SiSU_lib + '/shared_txt' +  require "#{SiSU_lib}/shared_txt"    pwd=Dir.pwd    @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0    @@tablefoot='' @@ -87,7 +87,7 @@ module SiSU_Wikispeak      end      private      class Split_text_object <Source -      require SiSU_lib + '/plaintext_format' +      require "#{SiSU_lib}/plaintext_format"        include SiSU_Viz        include Format        @@alt_id_count=0 @@ -98,7 +98,7 @@ module SiSU_Wikispeak          @format,@ocn='null','null'          @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern        end -      def lev_segname_para_ocn  +      def lev_segname_para_ocn          @text=nil          if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/            if /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para) @@ -106,7 +106,7 @@ module SiSU_Wikispeak            elsif  /^(([1-6])~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para)              @format,@lev,@text,@ocn=$1,$2,$3,$4            elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/m.match(@para) -            @format,@text,@ocn=$1,$2,$3,$4 +            @format,@text,@ocn=$1,$2,$3            elsif /^(([1-6])~(\S+))\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;[um]\d+><#@dp:#@dp>$/m.match(@para)              @@alt_id_count+=1              @format,@lev,segname,@text,@ocn=$1,$2,$3,$4,"x#{@@alt_id_count}" @@ -135,7 +135,7 @@ module SiSU_Wikispeak        end      end      class Scroll <Source -      require SiSU_lib + '/shared_txt' +      require "#{SiSU_lib}/shared_txt"        include SiSU_text_utils        @@endnotes_para=[]        @@wiki={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] } @@ -227,8 +227,8 @@ WOK          data=@data          dir=SiSU_Env::Info_env.new(@md.fns)          @data_mod,@endnotes,@level,@cont,@copen,@wiki_contents_close=Array.new(6){[]} -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @wiki_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @wiki_contents_close[x]='' }          wiki_tail          table_message='[table omitted, see other document formats]'          fix=[] diff --git a/lib/sisu/0.52/xhtml.rb b/lib/sisu/v0/xhtml.rb index 7bf4e451..44293919 100644 --- a/lib/sisu/0.52/xhtml.rb +++ b/lib/sisu/v0/xhtml.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -48,23 +48,22 @@   * Notes: tidy -xml scroll.xhtml >> index.tidy  =end -module SiSU_XHTML #XML_SAX derivative -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +module SiSU_XHTML +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/shared_xml' -  require SiSU_lib + '/xml_format' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/shared_xml" +  require "#{SiSU_lib}/xml_format"    include SiSU_XML_format    include SiSU_XML_munge -  require SiSU_lib + '/rexml' +  require "#{SiSU_lib}/rexml"    include SiSU_Rexml -  @@alt_id_count=0 -  @@tablehead=0 +  @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0    @@tablefoot='' -  @@number_of_cols=0    class Source      def initialize(opt)        @opt=opt @@ -81,17 +80,17 @@ module SiSU_XHTML #XML_SAX derivative          end          SiSU_Screen::Ansi.new(@opt.cmd,'invert','XHTML',tool).colorize unless @opt.cmd =~/q/          SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:xhtml]}").flow if @opt.cmd =~/[MV]/ -        my_make=SiSU_Env::Create_file.new(@opt.cmd,@opt.fns)          @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here -        SiSU_XHTML::Source::Songsheet.new(@md,@dal_array,@env).songsheet +        SiSU_XHTML::Source::Songsheet.new(@dal_array,@md,@env).songsheet        rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error        ensure          #file closed in songsheet        end      end +    private      class Songsheet -      def initialize(md,data,dir) -        @md,@data,@env=md,data,dir +      def initialize(data,md,dir) +        @data,@md,@env=data,md,dir        end        def songsheet          begin @@ -105,8 +104,8 @@ module SiSU_XHTML #XML_SAX derivative      end      class Scroll        @@xml={ :body=>[],:sisu=>[],:open=>[],:close=>[],:head=>[] } -      require SiSU_lib + '/shared_txt' -      require SiSU_lib + '/css' +      require "#{SiSU_lib}/shared_txt" +      require "#{SiSU_lib}/css"        include SiSU_text_utils        @@dp=nil        def initialize(md=nil,data='') @@ -127,16 +126,16 @@ module SiSU_XHTML #XML_SAX derivative        end      protected        def embedded_endntoes(para='') -        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,  +        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,            '<endnote><number>\1</number><note>\2</note></endnote> ') -        para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,  +        para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') -        para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,  +        para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')        end        def extract_endnotes(para='')          notes=para.scan(/~[{\[]([\d*+]+\s+.+?)\s*<#@dp>[}\]]~/) -        notes.each do |e|  +        notes.flatten.each do |e|            s=e.to_s            util=SiSU_text_utils::Wrap.new(s,70)            wrap=util.line_wrap @@ -145,26 +144,26 @@ module SiSU_XHTML #XML_SAX derivative  #{@tab*2}\\1. \\2  #{@tab*1}</endnote>  WOK -)  +)            wrap.gsub!(/^([*+]\d+)\s+(.+?)\s*\Z/m, <<WOK  #{@tab*1}<endnote symbol="\\1">  #{@tab*2}\\1 \\2  #{@tab*1}</endnote>  WOK -)  +)            wrap.gsub!(/^([*+]+)\s+(.+?)\s*\Z/m, <<WOK  #{@tab*1}<endnote symbol="\\1.length">  #{@tab*2}\\1 \\2  #{@tab*1}</endnote>  WOK -)  +)  #KEEP alternative presentation of endnotes  #        wrap.gsub!(/^(\d+)\s+(.+?)\s*\Z/m, <<WOK  ##{@tab*1}<p class="endnote" notenumber="\\1">  ##{@tab*2}\\1. \\2  ##{@tab*1}</p>  #WOK -#)  +#)            @endnotes << wrap          end        end @@ -196,9 +195,9 @@ WOK            util=SiSU_text_utils::Wrap.new(paragraph,70)            wrapped=util.line_wrap          end -        @@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]  +        @@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]          @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3] -        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">#{wrapped}</text>\n} << "\n"  +        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">#{wrapped}</text>\n} << "\n"          else                   %{#{@tab*1}<text class="norm">#{wrapped}</text>\n} # main text, contents, body KEEP          end          ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP @@ -210,22 +209,21 @@ WOK          n3=lv + 2          lv=nil if lv == 0          extract_endnotes(para) -        #puts @endnotes          para.gsub!(/~[{\[]([\d*+]+)\s+(?:.+?)\s*<#@dp>[}\]]~/,'<en>\1</en>') #footnote/endnote clean          if para[@regx]            paragraph="#{para[@regx,2]}"            util=SiSU_text_utils::Wrap.new(paragraph,70)            wrapped=util.line_wrap          end -        @@xml[:body] << if para[@regx,3]; %{#{@tab*0}<object id="#{para[@regx,3]}">} << "\n"  -        else                              "#{@tab*0}<object>" << "\n" if para[@regx]  +        @@xml[:body] << if para[@regx,3]; %{#{@tab*0}<object id="#{para[@regx,3]}">} << "\n" +        else                              "#{@tab*0}<object>" << "\n" if para[@regx]          end -        #@@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]  +        #@@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]          #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv          @@xml[:body] << %{#{@tab*1}<text class="#{type}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} unless lv  # main text, contents, body KEEP          @@xml[:body] << %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n}  << "\n" if lv # main text, contents, body KEEP          #@@xml[:body] << %{#{@tab*1}<text heading="#{lv}">\n} << "\n" if lv -        @@xml[:body] << "#{@endnotes}" if @endnotes # main text, endnotes KEEP +        @@xml[:body] << @endnotes.compact.join if @endnotes.length > 0 # main text, endnotes KEEP          @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3]          ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP          @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx] @@ -266,7 +264,7 @@ WOK          @@xml[:body] << "#{@tab*0}</object>" << "\n"        end        def table_structure(table='',ocn='') #tables -        @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]  +        @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]          @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv  # main text, contents, body KEEP          @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]          @endnotes=[] @@ -276,8 +274,8 @@ WOK          @endnotes=[]          @rcdc=false          @level,@cont,@copen,@xml_contents_close=[],[],[],[] -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @xml_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @xml_contents_close[x]='' }          data.each do |para|            para=@trans.markup(para)            @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8 @@ -285,9 +283,9 @@ WOK              d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta              if d_meta; xml_head(d_meta)  	          end -	        end +          end            @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/) -          if para !~/(^0~|<ENDNOTES>|<EOF>)/  +          if para !~/(^0~|<ENDNOTES>|<EOF>)/              if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/                paranum=para[@regx,3]                @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum) @@ -382,8 +380,7 @@ WOK                end              else #              end -            para.gsub!(/<:\S+?>/,'') if para ## Clean Prepared Text #bugwatch reinstate -            para.gsub!(/<!.+!>/,'') if para ## Clean Prepared Text #bugwatch reinstate +            para.gsub!(/<:\S+?>|<!.+!>/,'') if para            end          end          6.downto(4) do |x| @@ -394,7 +391,7 @@ WOK            y=x - 1            @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }  +        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }        end        def pre          rdf=SiSU_XML_tags::RDF.new(@md) @@ -426,37 +423,32 @@ WOK          content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]          content << @@xml[:owner_details] if @md.stmp =~/\w\w/          content << @@xml[:tail] << @@xml[:close] -        Output.new(@md,content.to_s).xml +        content.flatten!.compact! +        Output.new(content,@md).xml          @@xml={} # check whether should be nil        end      end      class Output        include SiSU_Param        include SiSU_Env -      def initialize(md,data) -        @md,@data=md,data +      def initialize(data,md) +        @data,@md=data,md        end        def xml -        @sisu=[] -        @data.each do |para| -          #para.strip! -          para.gsub!(/<:\S+?>/,'') -          para.gsub!(/<!.+?!>/,'') -          para="#{para}\n" unless para.empty? -          @sisu << para -        end -        new_file_data=@sisu.to_s -        @sisu=new_file_data.scan(/.+/)          SiSU_Env::SiSU_file.new(@md).mkdir          filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:xhtml]).mkfile -        @sisu.each {|para| filename_xml.puts para} +        @data.each do |para| +          para.gsub!(/<:\S+?>|<!.+?!>/,'') +          para.gsub!(/^\s*\n$/,'') +          filename_xml.puts para unless para.empty? +        end          filename_xml.close        end      end      class Tidy        def initialize(md,dir)          @md,@env=md,dir -        @prog=SiSU_Env::Info_program.new #(md.fns) #if md +        @prog=SiSU_Env::Info_program.new        end        def xml          if @prog.tidy !=false diff --git a/lib/sisu/0.52/xml.rb b/lib/sisu/v0/xml.rb index f6a1623f..20c5f80e 100644 --- a/lib/sisu/0.52/xml.rb +++ b/lib/sisu/v0/xml.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,18 +49,18 @@   * Notes: tidy -xml sax.xml >> index.tidy  =end  module SiSU_XML_SAX -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/dal' -  require SiSU_lib + '/shared_xml' -  require SiSU_lib + '/xml_format' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/shared_xml" +  require "#{SiSU_lib}/xml_format"    include SiSU_XML_format    include SiSU_XML_munge -  require SiSU_lib + '/rexml' +  require "#{SiSU_lib}/rexml"    include SiSU_Rexml    @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0    @@tablefoot='' @@ -103,8 +103,8 @@ module SiSU_XML_SAX        end      end      class Scroll -      require SiSU_lib + '/shared_txt' -      require SiSU_lib + '/css' +      require "#{SiSU_lib}/shared_txt" +      require "#{SiSU_lib}/css"        include SiSU_text_utils        @@dp,@@env=nil,nil        @@xml={ :body=>[],:open=>[],:close=>[],:head=>[] } @@ -126,16 +126,16 @@ module SiSU_XML_SAX        end      protected        def embedded_endntoes(para='') -        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,  +        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,            '<endnote><number>\1</number><note>\2</note></endnote> ') -        para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,  +        para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') -        para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,  +        para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')        end        def extract_endnotes(para='')          notes=para.scan(/~[{\[]([\d*+]+\s+.+?)\s*<#@dp>[}\]]~/) -        notes.each do |e|  +        notes.flatten.each do |e|            s=e.to_s            util=SiSU_text_utils::Wrap.new(s,70)            wrap=util.line_wrap @@ -147,7 +147,7 @@ module SiSU_XML_SAX  #{@tab*2}</note>  #{@tab*1}</endnote>  WOK -)  +)            wrap.gsub!(/^([*+]\d+)\s+(.+?)\s*\Z/m, <<WOK  #{@tab*1}<endnote symbol="\\1">  #{@tab*2}<symbol>\\1</symbol> @@ -156,7 +156,7 @@ WOK  #{@tab*2}</note>  #{@tab*1}</endnote>  WOK -)  +)            wrap.gsub!(/^([*+]+)\s+(.+?)\s*\Z/m, <<WOK  #{@tab*1}<endnote symbol="\\1.length">  #{@tab*2}<symbol>\\1</symbol> @@ -165,7 +165,7 @@ WOK  #{@tab*2}</note>  #{@tab*1}</endnote>  WOK -)  +)            @endnotes << wrap          end        end @@ -206,8 +206,7 @@ WOK  WOK          else ''          end -        @@xml[:sc]=sc   #<<<<WOK -#WOK +        @@xml[:sc]=sc        end        def xml_structure_ee(para='',lv='',ocn='',hname='') #embedded endnotes          lv=lv.to_i @@ -220,9 +219,9 @@ WOK            util=SiSU_text_utils::Wrap.new(paragraph,70)            wrapped=util.line_wrap          end -        @@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]  +        @@xml[:body] << "#{@tab*0}<object>" << "\n" if para[@regx]          @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3] -        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">#{wrapped}</text>\n} << "\n"  +        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">#{wrapped}</text>\n} << "\n"          else                   %{#{@tab*1}<text class="norm">#{wrapped}</text>\n} # main text, contents, body KEEP          end          #@@xml[:body] << "#{@tab*1}<text>#{wrapped}</text>\n" # main text, contents, body KEEP @@ -235,22 +234,21 @@ WOK          n3=lv + 2          lv=nil if lv == 0          extract_endnotes(para) -        #puts @endnotes          para.gsub!(/~[{\[]([\d*+]+)\s+(?:.+?)\s*<#@dp>[}\]]~/,'<en>\1</en>') #footnote/endnote clean          if para[@regx]            paragraph="#{para[@regx,2]}"            util=SiSU_text_utils::Wrap.new(paragraph,70)            wrapped=util.line_wrap          end -        @@xml[:body] << if para[@regx,3]; %{#{@tab*0}<object id="#{para[@regx,3]}">} << "\n"  -        else                              "#{@tab*0}<object>" << "\n" if para[@regx]  +        @@xml[:body] << if para[@regx,3]; %{#{@tab*0}<object id="#{para[@regx,3]}">} << "\n" +        else                              "#{@tab*0}<object>" << "\n" if para[@regx]          end          #@@xml[:body] << "#{@tab*1}<heading>#{lv}</heading>" << "\n" if lv          @@xml[:body] << "#{@tab*1}<ocn>#{para[@regx,3]}</ocn>" << "\n" if para[@regx,3] -        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n"  -        else                   %{#{@tab*1}<text class="#{type}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} # main text, contents, body KEEP  +        @@xml[:body] << if lv; %{#{@tab*1}<text class="h#{lv}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} << "\n" +        else                   %{#{@tab*1}<text class="#{type}">\n#{@tab*2}#{wrapped}\n#{@tab*1}</text>\n} # main text, contents, body KEEP          end -        @@xml[:body] << "#{@endnotes}" if @endnotes # main text, endnotes KEEP +        @@xml[:body] << @endnotes if @endnotes # main text, endnotes KEEP          ##@@xml[:body] << "#{@tab*1}<text>#{para[@regx,2]}</text>\n" if para[@regx,2] # old unwrapped main text, contents, body KEEP          @@xml[:body] << "#{@tab*0}</object>" << "\n" if para[@regx]          @endnotes=[] @@ -290,7 +288,7 @@ WOK          @@xml[:body] << "#{@tab*0}</object>" << "\n"        end        def table_structure(table='',ocn='') #tables -        @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]  +        @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]          @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv  # main text, contents, body KEEP          @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]          @endnotes=[] @@ -300,8 +298,8 @@ WOK          xml_sc(@md)          @endnotes,@level,@cont,@copen,@xml_contents_close=[],[],[],[],[]          @rcdc=false -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @xml_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @xml_contents_close[x]='' }          data.each do |para|            para=@trans.markup(para)            @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8 @@ -311,7 +309,7 @@ WOK  	          end            end            @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/) -          if para !~/(^0~|<ENDNOTES>|<EOF>)/  +          if para !~/(^0~|<ENDNOTES>|<EOF>)/              if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/                paranum=para[@regx,3]                @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum) @@ -369,8 +367,6 @@ WOK                    #@@xml[:body] << "#{@tab*6}</object>" << "\n" if para[@regx]                  end                elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ -                #format_scroll=MonoSiSU.new('<br /><a name="notes">Note</a>') -                #para=format_scroll.boldPara                elsif para =~/(MetaData)/ and para =~/<~(\d+);[m]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info                  format_scroll=Format_scroll.new(@md,'<br /><a name="metadata">MetaData</a>')                  para=format_scroll.bold_para @@ -404,8 +400,7 @@ WOK                end              else #              end -            para.gsub!(/<:\S+?>/,'') -            para.gsub!(/<!.+!>/,'') ## Clean Prepared Text #bugwatch reinstate +            para.gsub!(/<:\S+?>|<!.+!>/,'') if para            end          end          6.downto(4) do |x| @@ -416,7 +411,7 @@ WOK            y=x - 1            @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }  +        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }        end        def pre          rdf=SiSU_XML_tags::RDF.new(@md) @@ -447,7 +442,8 @@ WOK          content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]          content << @@xml[:owner_details] if @md.stmp =~/\w\w/          content << @@xml[:tail] << @@xml[:close] -        Output.new(content.to_s,@md).xml +        content.flatten!.compact! +        Output.new(content,@md).xml          @@xml={} # check whether should be nil        end      end @@ -458,25 +454,20 @@ WOK          @data,@md=data,md        end        def xml -        @sisu=[] -        @data.each do |para| -          para.gsub!(/<:\S+?>/,'') -          para.gsub!(/<!.+?!>/,'') -          para="#{para}\n" unless para.empty? -          @sisu << para -        end -        new_file_data=@sisu.to_s -        @sisu=new_file_data.scan(/.+/)          SiSU_Env::SiSU_file.new(@md).mkdir          filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:sax]).mkfile -        @sisu.each {|para| filename_xml.puts para} +        @data.each do |para| +          para.gsub!(/<:\S+?>|<!.+?!>/,'') +          para.gsub!(/^\s*\n$/,'') +          filename_xml.puts para unless para.empty? +        end          filename_xml.close        end      end      class Tidy        def initialize(md,dir)          @md,@env=md,dir -        @prog=SiSU_Env::Info_program.new  +        @prog=SiSU_Env::Info_program.new        end        def xml          if @prog.tidy !=false #note values can be other than true @@ -485,14 +476,12 @@ WOK              tell.colorize unless @md.cmd =~/q/              tell.grey_open unless @md.cmd =~/q/              tidyfile='/dev/null' #don't want one or screen output, check for alternative flags -            tidy =SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:sax]}",tidyfile) +            tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:sax]}",tidyfile)              tidy.well_formed?              tell.p_off unless @md.cmd =~/q/            end          end        end -      def xmlexp #possibly use to decide whether to call rexml -      end      end    end  end diff --git a/lib/sisu/0.52/xml_dom.rb b/lib/sisu/v0/xml_dom.rb index f600a15d..9c13dcc1 100644 --- a/lib/sisu/0.52/xml_dom.rb +++ b/lib/sisu/v0/xml_dom.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,18 +49,18 @@   * Notes: tidy -xml dom.xml >> index.tidy  =end  module SiSU_XML_DOM -  require SiSU_lib + '/defaults' -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/defaults" +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env -  require SiSU_lib + '/dal' -  require SiSU_lib + '/shared_xml' -  require SiSU_lib + '/xml_format' +  require "#{SiSU_lib}/dal" +  require "#{SiSU_lib}/shared_xml" +  require "#{SiSU_lib}/xml_format"    include SiSU_XML_format    include SiSU_XML_munge -  require SiSU_lib + '/rexml' +  require "#{SiSU_lib}/rexml"    include SiSU_Rexml    @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0    @@tablefoot='' @@ -104,14 +104,14 @@ module SiSU_XML_DOM      end      class Scroll        @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=>[] } -      require SiSU_lib + '/shared_txt' +      require "#{SiSU_lib}/shared_txt"        include SiSU_text_utils        @@dp=nil        def initialize(data='',md='')          @data,@md=data,md          @vz=SiSU_Env::Get_init.instance.skin          @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern -        @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #  +        @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #          @tab="\t"          @trans=SiSU_XML_munge::Trans.new(@md)          @sys=SiSU_Env::System_call.new @@ -124,11 +124,11 @@ module SiSU_XML_DOM        end      protected        def xml_markup(para='') -        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,  +        para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,            '<endnote><number>\1</number><note>\2</note></endnote> ') -        para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,  +        para.gsub!(/~\[([*+]\d+)\s+(.+?)\s*<#@dp>\]~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ') -        para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,  +        para.gsub!(/~\{([*+]+)\s+(.+?)\s*<#@dp>\}~/,            '<endnote><symbol>\1</symbol><note>\2</note></endnote> ')        end        def xml_head(meta) @@ -197,7 +197,7 @@ WOK            @copen[2]=true            @copen[3]=false          elsif lv == 6 -          @copen[3]=true  +          @copen[3]=true          end        end        def xml_structure(lv='',ocn='',para='',hname='' ) @@ -231,7 +231,7 @@ WOK              elsif @copen[2] # 5{                [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }                @copen[1]=@copen[2]=@copen[3]=false -            elsif @copen[1] # 4{  +            elsif @copen[1] # 4{                [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }                @copen[1]=@copen[2]=@copen[3]=false              end @@ -239,10 +239,10 @@ WOK              @level[x]=false            end          when 4..6 -          6.downto(lv) do |x|  +          6.downto(lv) do |x|              y=x - 1              if @level[x] == true -              u=x - 3;  +              u=x - 3;                @xml_contents_close[x]=''              end            end @@ -256,7 +256,7 @@ WOK                [3,2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }              elsif @copen[2] == true # 5~                [2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" } -            elsif @copen[1] == true # 4~  +            elsif @copen[1] == true # 4~                [1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }              end              @cont[1]=true @@ -276,7 +276,7 @@ WOK          end          xml_element(lv,ocn,para,hname,tag,xml_element,xml_content)          @level[lv]=true -        ((lv+1)..6).each { |x| @level[x]=false }  +        ((lv+1)..6).each { |x| @level[x]=false }        end        def group_structure(para='',ocn='')          para.gsub!(/<:group(?:-end)?>/,'') @@ -313,7 +313,7 @@ WOK          @@xml[:body] << "#{@tab*6}</object>" << "\n"        end        def table_structure(table='',ocn='') #tables -        @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]  +        @@xml[:body] << %{#{@tab*0}<object id="#{ocn}">} << "\n" #if para[@regx]          @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv  # main text, contents, body KEEP          @@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]          @endnotes=[] @@ -323,8 +323,8 @@ WOK          xml_sc(@md)          @rcdc=false          @level,@cont,@copen,@xml_contents_close=[],[],[],[] -        (0..6).each { |x| @cont[x]=@level[x]=false }  -        (4..6).each { |x| @xml_contents_close[x]='' }  +        (0..6).each { |x| @cont[x]=@level[x]=false } +        (4..6).each { |x| @xml_contents_close[x]='' }          data.each do |para|            para=@trans.markup(para)            @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8 @@ -334,7 +334,7 @@ WOK  	          end            end            @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/1~\s+Document Information/) -          if para !~/(^0~|<ENDNOTES>|<EOF>)/  +          if para !~/(^0~|<ENDNOTES>|<EOF>)/              if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/                paranum=para[@regx,3]                @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum) @@ -455,7 +455,7 @@ WOK            y=x - 1            @@xml[:body] << "#{@tab*y}</heading#{x}>\n" if @level[x] == true          end -        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }  +        #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}</level #{x}>\n" if @level[x] == true }        end        def pre          rdf=SiSU_XML_tags::RDF.new(@md) @@ -485,7 +485,8 @@ WOK          content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]          content << @@xml[:owner_details] if @md.stmp =~/\w\w/          content << @@xml[:tail] << @@xml[:close] -        Output.new(content.to_s,@md).xml +        content.flatten!.compact! +        Output.new(content,@md).xml          @@xml[:head],@@xml[:body],@@xml[:tail]=[],[],[] # check whether should be nil        end      end @@ -495,27 +496,22 @@ WOK          @data,@md=data,md        end        def xml -        @sisu=[] -        @data.each do |para| #p +        SiSU_Env::SiSU_file.new(@md).mkdir +        filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:dom]).mkfile +        @data.each do |para|            #para.strip!            para.gsub!(/<:\S+?>/,'')            para.gsub!(/<!.+?!>/,'')            para="#{para}\n" unless para.empty? -          @sisu << para +          filename_xml.puts para          end -        new_file_data=@sisu.to_s -        @sisu=new_file_data.scan(/.+/) -        #@sisu.compact! -        SiSU_Env::SiSU_file.new(@md).mkdir -        filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:dom]).mkfile -        @sisu.each {|para| filename_xml.puts para}          filename_xml.close        end      end      class Tidy        def initialize(md,dir)          @md,@env=md,dir -        @prog=SiSU_Env::Info_program.new #(md.fns) #if md +        @prog=SiSU_Env::Info_program.new        end        def xml          if @prog.tidy !=false diff --git a/lib/sisu/0.52/xml_format.rb b/lib/sisu/v0/xml_format.rb index 111e2bee..2db28b25 100644 --- a/lib/sisu/0.52/xml_format.rb +++ b/lib/sisu/v0/xml_format.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,7 +49,7 @@   * Notes: tidy -xml index.xml >> index.tidy  =end  module SiSU_XML_format -  require SiSU_lib + '/param' +  require "#{SiSU_lib}/param"    include SiSU_Param    include SiSU_Viz    class Paragraph_number @@ -77,88 +77,88 @@ module SiSU_XML_format        @dc_title=@dc_subtitle=@dc_creator=@dc_subject=@dc_description=@dc_publisher=@dc_contributor=@dc_date=@dc_type=@dc_format=@dc_identifier=@dc_source=@dc_language=@dc_relation=@dc_coverage=@dc_rights=@copyright=@owner=@keywords=''        @sfx,@pdf,@md=@@md.sfx,@@md.pdf,@@md        # DublinCore 1 - title -      @rdfurl=%{  rdf:about="http://www.jus.uio.no/lm/toc"\n}  +      @rdfurl=%{  rdf:about="http://www.jus.uio.no/lm/toc"\n}        if @md.dc_title          @dc_title=%{<meta name="dc.title" content="#{seg_name}#{@md.dc_title}" />\n}          #if @md.subtitle -        #  #@rdf_title=%{    dc.title="#{seg_name}#{@md.title} - #{@md.subtitle}"\n}  +        #  #@rdf_title=%{    dc.title="#{seg_name}#{@md.title} - #{@md.subtitle}"\n}          #  @dc_title=%{<meta name="dc.title" content="#{seg_name}#{@md.title} - #{@md.subtitle}" />\n}          #else -        #  #@rdf_title=%{    dc.title="#{seg_name}#{@md.title}"\n}  +        #  #@rdf_title=%{    dc.title="#{seg_name}#{@md.title}"\n}          #  @dc_title=%{<meta name="dc.title" content="#{seg_name}#{@md.dc_title}" />\n}          #end        end        if @md.dc_creator                                                          # DublinCore 2 - creator/author (author) -        @rdf_creator=%{    dc.creator="#{@md.dc_creator}"\n}  +        @rdf_creator=%{    dc.creator="#{@md.dc_creator}"\n}          @dc_creator=%{<meta name="dc.creator" content="#{@md.dc_creator}" />\n}        end        if @md.dc_subject                                                          # DublinCore 3 - subject (us library of congress, eric or udc, or schema???) -        @rdf_subject=%{    dc.subject="#{@md.dc_subject}"\n}  -        @dc_subject=%{<meta name="dc.subject" content="#{@md.dc_subject}" />\n}  +        @rdf_subject=%{    dc.subject="#{@md.dc_subject}"\n} +        @dc_subject=%{<meta name="dc.subject" content="#{@md.dc_subject}" />\n}        end        if @md.dc_description                                                      # DublinCore 4 - description -        @rdf_description=%{    dc.description="#{@md.description}"\n}  -        @dc_description=%{<meta name="dc.dc_description" content="#{@md.description}" />\n}  +        @rdf_description=%{    dc.description="#{@md.description}"\n} +        @dc_description=%{<meta name="dc.dc_description" content="#{@md.description}" />\n}        end        if @md.dc_publisher                                                        # DublinCore 5 - publisher (current copy published by) -        @rdf_publisher=%{    dc.publisher="#{@md.dc_publisher}"\n}  +        @rdf_publisher=%{    dc.publisher="#{@md.dc_publisher}"\n}          @dc_publisher=%{<meta name="dc.publisher" content="#{@md.dc_publisher}" />\n}        end        if @md.dc_contributor                                                      # DublinCore 6 - contributor -        @rdf_contributor=%{    dc.contributor="#{@md.dc_contributor}"\n}  +        @rdf_contributor=%{    dc.contributor="#{@md.dc_contributor}"\n}          @dc_contributor=%{<meta name="dc.contributor" content="#{@md.dc_contributor}" />\n}        end        if @md.dc_date                                                             # DublinCore 7 - date year-mm-dd -        @rdf_date=%{    dc.date="#{@md.dc_date}"\n}  +        @rdf_date=%{    dc.date="#{@md.dc_date}"\n}          @dc_date=%{<meta name="dc.date" content="#{@md.dc_date}" #{@md.date_scheme} />\n}        end        if @md.dc_date_created                                                     # DublinCore 7 - date.created year-mm-dd -        @rdf_date_created=%{    dc.date.created="#{@md.dc_date_created}"\n}  +        @rdf_date_created=%{    dc.date.created="#{@md.dc_date_created}"\n}          @dc_date_created=%{<meta name="dc.date.created" content="#{@md.dc_date_created}" #{@md.date_created_scheme} />\n}        end        if @md.dc_date_issued                                                      # DublinCore 7 - date.issued year-mm-dd -        @rdf_date_issued=%{    dc.date.issued="#{@md.dc_date_issued}"\n}  +        @rdf_date_issued=%{    dc.date.issued="#{@md.dc_date_issued}"\n}          @dc_date_issued=%{<meta name="dc.date.issued" content="#{@md.dc_date_issued}" #{@md.date_issued_scheme} />\n}        end        if @md.dc_date_available                                                   # DublinCore 7 - date.available year-mm-dd -        @rdf_date_available=%{    dc.date.available="#{@md.dc_date_available}"\n}  +        @rdf_date_available=%{    dc.date.available="#{@md.dc_date_available}"\n}          @dc_date_available=%{<meta name="dc.date.available" content="#{@md.dc_date_available}" #{@md.date_available_scheme} />\n}        end        if @md.dc_date_valid                                                       # DublinCore 7 - date.valid year-mm-dd -        @rdf_date_valid=%{    dc.date.valid="#{@md.dc_date_valid}"\n}  +        @rdf_date_valid=%{    dc.date.valid="#{@md.dc_date_valid}"\n}          @dc_date_valid=%{<meta name="dc.date.valid" content="#{@md.dc_date_valid}" #{@md.date_valid_scheme} />\n}        end        if @md.dc_date_modified                                                    # DublinCore 7 - date.modified year-mm-dd -        @rdf_date_modified=%{    dc.date.modified="#{@md.dc_date_modified}"\n}  +        @rdf_date_modified=%{    dc.date.modified="#{@md.dc_date_modified}"\n}          @dc_date_modified=%{<meta name="dc.date.modified" content="#{@md.dc_date_modified}" #{@md.date_modified_scheme} />\n}        end        if @md.dc_type                                                             # DublinCore 8 - type (genre eg. report, convention etc) -        @rdf_type=%{    dc.type="#{@md.dc_type}"\n}  +        @rdf_type=%{    dc.type="#{@md.dc_type}"\n}          @dc_type=%{<meta name="dc.type" content="#{@md.dc_type}" />\n}        end        if @md.dc_format                                                           # DublinCore 9 - format (use your mime type) -        @rdf_format=%{    dc.format="#{@md.dc_format}"\n}  +        @rdf_format=%{    dc.format="#{@md.dc_format}"\n}          @dc_format=%{<meta name="dc.format" content="#{@md.dc_format}" />\n}        end        if @md.dc_identifier                                                       # DublinCore 10 - identifier (your identifier, could use urn which is free) -        @rdf_identifier=%{    dc.identifier="#{@md.dc_identifier}"\n}  +        @rdf_identifier=%{    dc.identifier="#{@md.dc_identifier}"\n}          @dc_identifier=%{<meta name="dc.identifier" content="#{@md.dc_identifier}" />\n}        end        if @md.dc_source                                                           # DublinCore 11 - source (document source) -        @rdf_source=%{    dc.source="#{@md.dc_source}"\n}  +        @rdf_source=%{    dc.source="#{@md.dc_source}"\n}          @dc_source=%{<meta name="dc.source" content="#{@md.dc_source}" />\n}        end        if @md.dc_language[:name]                                                  # DublinCore 12 - language (English) -        @rdf_language=%{    dc.language="#{@md.dc_language[:name]}"\n}  +        @rdf_language=%{    dc.language="#{@md.dc_language[:name]}"\n}          @dc_language=%{<meta name="dc.language" content="#{@md.dc_language[:name]}" />\n}        end        if @md.language_original[:name]                                                  # DublinCore 12 - language (English) -        @rdf_language_original=%{    dc.language="#{@md.language_original[:name]}"\n}  +        @rdf_language_original=%{    dc.language="#{@md.language_original[:name]}"\n}          @language_original=%{<meta name="dc.language" content="#{@md.language_original[:name]}" />\n}        end        if @md.dc_relation                                                         # DublinCore 13 - relation          @rdf_relation=%{    dc.relation="#{@md.dc_relation}"\n} -        @dc_relation=%{<meta name="dc.relation" content="#{@md.dc_relation}" />\n}  +        @dc_relation=%{<meta name="dc.relation" content="#{@md.dc_relation}" />\n}        end        if @md.dc_coverage                                                         # DublinCore 14 - coverage          @rdf_coverage=%{    dc.coverage="#{@md.dc_coverage}"\n} @@ -168,7 +168,7 @@ module SiSU_XML_format          @rdf_rights=%{    dc.rights="#{@md.dc_rights}"\n}          @dc_rights=%{<meta name="dc.rights" content="#{@md.dc_rights}" />\n}        end -      @copyright=%{<meta name="copyright" content="#{@md.dc_rights}" />\n} if @md.rights # possibly redundant see dc.rights  +      @copyright=%{<meta name="copyright" content="#{@md.dc_rights}" />\n} if @md.rights # possibly redundant see dc.rights        @owner=%{<meta name="owner" content="#{@md.owner}" />\n} if @md.owner        @keywords=%{<meta name="keywords" content="#{@md.keywords}" />\n} if @md.keywords        @vz=SiSU_Env::Get_init.instance.skin #margin,paragraph,table,banner,url,png,txt,color,font,nav_txt,nav_png,credits,js,php @@ -180,7 +180,7 @@ module SiSU_XML_format      def toc_head_escript #embedded script in this case PHP        # %{<p>PHP or other embedded script for object persistence may go HERE</p>}      end -    #def seg_head_escript #embedded script in this case PHP  +    #def seg_head_escript #embedded script in this case PHP      #  # %{<p>PHP or other embedded script for object persistence may go HERE</p>}      #end      def table_close @@ -199,7 +199,7 @@ module SiSU_XML_format        #      dc:creator="Author"        #      dc:title="Title"        #      dc:description="Description if any" -      #      dc:date="Publication Date"  +      #      dc:date="Publication Date"        #  />        #</rdf:RDF>        #Dublin Core diff --git a/lib/sisu/0.52/xml_tables.rb b/lib/sisu/v0/xml_tables.rb index 5f48c3f7..f6df5268 100644 --- a/lib/sisu/0.52/xml_tables.rb +++ b/lib/sisu/v0/xml_tables.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -47,7 +47,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Tables -  require SiSU_lib + '/defaults' +  require "#{SiSU_lib}/defaults"    include SiSU_Viz    class Table #_xml      @@tablehead=0 @@ -74,7 +74,7 @@ module SiSU_Tables      end      def table        m=@parablock[/<!f(.+?)!>/,1] -      @@tablefoot << m if m  +      @@tablefoot << m if m        @parablock.gsub!(/<!f.+?!>/,'')        @@tablehead=1 if @parablock =~/<!Th¡/        if @parablock =~/<!Th?¡/ @@ -157,7 +157,7 @@ module SiSU_Tables      end      def table        m=@parablock[/<!f(.+?)!>/,1] -      @@tablefoot << m if m  +      @@tablefoot << m if m        @parablock.gsub!(/<!f.+?!>/,'')        @@tablehead=1 if @parablock =~/<!Th¡/        if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/; @parablock=table_head($1) @@ -174,7 +174,7 @@ module SiSU_Tables            if @parablock =~/<!¡¡(\d+?)¡/              @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))            end -          if @parablock =~/¡¡(\d+?)¡/  +          if @parablock =~/¡¡(\d+?)¡/              @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))            end            if @parablock =~/!>/ diff --git a/lib/sisu/0.52/zap.rb b/lib/sisu/v0/zap.rb index 42ee840d..0a97f11b 100644 --- a/lib/sisu/0.52/zap.rb +++ b/lib/sisu/v0/zap.rb @@ -35,11 +35,11 @@    SiSU was first released to the public on January 4th 2005    SiSU uses: -   +    *  Standard SiSU markup syntax,    *  Standard SiSU meta-markup syntax, and the    *  Standard SiSU object citation numbering and system -   +    © Ralph Amissah 1997, current 2007.    All Rights Reserved. @@ -49,7 +49,7 @@                    ralph.amissah@gmail.com  =end  module SiSU_Zap -  require SiSU_lib + '/sysenv' +  require "#{SiSU_lib}/sysenv"    include SiSU_Env    pwd=Dir.pwd    class Source | 
