aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-07-10 15:36:21 +0100
committerRalph Amissah <ralph@amissah.com>2007-07-10 15:36:21 +0100
commitce038ce1a78cfe1ecc8fbc50095a8e036880da72 (patch)
tree9005b4c7aa894b859880ce66d6d2b390b2e79105
parentsisu-0.55.2 md5s, and cosmetic fix to debian/copyright (diff)
parentcgi search form worked on and presentation, (an info button added and used) (diff)
Merge branch 'upstream' into debian/sid
-rw-r--r--CHANGELOG21
-rw-r--r--data/sisu/conf/syntax/sisu.xml39
-rw-r--r--data/sisu/image/b_info.pngbin0 -> 201 bytes
-rw-r--r--data/sisu/image/bluebell.pngbin410 -> 0 bytes
-rw-r--r--lib/sisu/v0/cgi_pgsql.rb5
-rw-r--r--lib/sisu/v0/cgi_sql_common.rb166
-rw-r--r--lib/sisu/v0/cgi_sqlite.rb2
-rw-r--r--lib/sisu/v0/dal_syntax.rb8
-rw-r--r--lib/sisu/v0/defaults.rb5
-rw-r--r--lib/sisu/v0/help.rb2
-rw-r--r--lib/sisu/v0/html_tune.rb18
-rw-r--r--lib/sisu/v0/odf.rb12
-rw-r--r--lib/sisu/v0/plaintext.rb3
-rw-r--r--lib/sisu/v0/shared_html_lite.rb17
-rw-r--r--lib/sisu/v0/shared_xml.rb11
-rw-r--r--lib/sisu/v0/sysenv.rb4
-rw-r--r--lib/sisu/v0/texinfo_format.rb7
-rw-r--r--lib/sisu/v0/texpdf.rb1
-rw-r--r--lib/sisu/v0/texpdf_format.rb46
-rw-r--r--lib/sisu/v0/xml_scaffold.rb2
20 files changed, 188 insertions, 181 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a0419694..e1f016ad 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,27 @@ Reverse Chronological:
%% STABLE MANIFEST
+%% sisu_0.55.3.orig.tar.gz (2007-07-14:28/6)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.3.orig.tar.gz
+ sisu_0.55.3.orig.tar.gz
+ sisu_0.55.3-1.dsc
+ sisu_0.55.3-1.diff.gz
+
+ * url
+ * matching improved
+ (plaintext, html, xml, odf, tex/pdf, db)
+ * possibility to escape decoration <http://url>
+ with \http://url or _http://url becomes http://url
+
+ * texpdf
+ * TeX line breaking tolerance altered, to deal with urls
+ better
+ * indentation levels reset
+
+ * cgi, generated sample search form, rearranged presentation
+
+ * editor syntax highlighting, kate, kwrite visited
+
%% sisu_0.55.2.orig.tar.gz (2007-07-07:27/6)
http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.2.orig.tar.gz
510b2648ada09f60241f0a6f7cb8d180 1265392 sisu_0.55.2.orig.tar.gz
diff --git a/data/sisu/conf/syntax/sisu.xml b/data/sisu/conf/syntax/sisu.xml
index 9467ec44..61135285 100644
--- a/data/sisu/conf/syntax/sisu.xml
+++ b/data/sisu/conf/syntax/sisu.xml
@@ -8,10 +8,20 @@
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#pop" name="Normal Text" >
+ <StringDetect String="&lt;br&gt;" attribute="Break" context="#pop" />
+ <RegExpr String="\s+$" attribute="Warn" context="#pop" />
+ <RegExpr String="&lt;\S+&gt;" attribute="Warn" context="#pop" />
+ <RegExpr String="&lt;a href=\S+&gt;" attribute="Warn" context="#pop" />
+ <RegExpr String="&lt;a href=" attribute="Warn" context="#pop" />
+ <RegExpr String="&lt;/a&gt;" attribute="Warn" context="#pop" />
+ <RegExpr String="&lt;https?:\/\/\S+&gt;" attribute="Warn" context="#pop"/>
+ <RegExpr String="&gt;https?:\/\/\S+" attribute="Warn" context="#pop"/>
+ <RegExpr String="&lt;&lt;\s+&#124;" attribute="Link" context="#pop"/>
+ <RegExpr String="https?:\/\/\S+&lt;" attribute="Warn" context="#pop"/>
<keyword attribute="Keyword" context="#stay" String="somename" />
<DetectChar attribute="String" context="string" char="&quot;" />
<RegExpr String="^(0~\S+|@\S+)\s.+$" attribute="Header" context="#pop" />
- <RegExpr String="^:?[A-C1-6]~.+$" attribute="Heading" context="#pop" />
+ <RegExpr String="^:?[A-C1-9]~.+$" attribute="Heading" context="#pop" />
<StringDetect String="~{" attribute="Endnote" context="footnote"/>
<StringDetect String="^~" attribute="Endnote" context="endnote"/>
<StringDetect String="!{" attribute="Bold" context="emphasis"/>
@@ -22,11 +32,13 @@
<StringDetect String=",{" attribute="Subscript" context="subscript"/>
<StringDetect String="-{" attribute="Strike" context="strike"/>
<StringDetect String="+{" attribute="Insert" context="insert"/>
- <StringDetect String="&lt;br&gt;" attribute="Break" context="#pop" />
- <RegExpr String="\{.+?\}(http:\/\/\S+|image)" attribute="Link" context="#stay"/>
- <RegExpr String="(^|\s)http:\/\/\S+" attribute="Link" context="#stay"/>
+ <RegExpr String="\{[\s\S]+\}https?:\/\/\S+(\s|$)" attribute="Link" context="#pop" minimal="true" />
+ <RegExpr String="\{[\s\S]+\}\.\.\/\S+(\s|$)" attribute="Link" context="#stay" minimal="true" />
+ <RegExpr String="\{[\s\S]+\}image(\s|$)" attribute="Link" context="#stay" minimal="true" />
+ <RegExpr String="\s_?https?:\/\/\S+" attribute="Link" context="#stay"/>
+ <RegExpr String="^_?https?:\/\/\S+" attribute="Link" context="#stay"/>
<RegExpr String="^!_ .+" attribute="Bold" context="boldline"/>
- <RegExpr String="^(_[12]|_\*|_[12]\*)\s" attribute="Indent" context="#stay"/>
+ <RegExpr String="^(_[1-9]|_\*|_[1-9]\*)\s" attribute="Indent" context="#stay"/>
<RegExpr String="~\^" attribute="Endnote" context="#stay"/>
<RegExpr String="^%+\s.+$" attribute="Comment" context="#stay" endRegion="regionMarker" firstNonSpace="true" />
</context>
@@ -35,6 +47,11 @@
</context>
<context attribute="Endnote" lineEndContext="#stay" name="footnote" >
<StringDetect attribute="Endnote" context="#pop" String="}~" />
+ <RegExpr String="\{[\s\S]+\}https?:\/\/\S+(\s|$)" attribute="Link" context="#pop" minimal="true" />
+ <RegExpr String="\{[\s\S]+\}\.\.\/\S+(\s|$)" attribute="Link" context="#stay" minimal="true" />
+ <RegExpr String="\{[\s\S]+\}image(\s|$)" attribute="Link" context="#stay" minimal="true" />
+ <RegExpr String="\s_?https?:\/\/\S+" attribute="Link" context="#stay"/>
+ <RegExpr String="^_?https?:\/\/\S+" attribute="Link" context="#stay"/>
<StringDetect String="!{" attribute="Bold" context="emphasis"/>
<StringDetect String="*{" attribute="Bold" context="bold"/>
<StringDetect String="/{" attribute="Italic" context="italic"/>
@@ -106,11 +123,11 @@
<StringDetect attribute="Strike" context="#pop" String="}-" />
<StringDetect String="!{" attribute="Bold" context="emphasis"/>
<StringDetect String="*{" attribute="Bold" context="bold"/>
- <StringDetect String="/{" attribute="Italic" context="italic"/>
+ <StringDetect String="/{" attribute="Italic" context="italic"/>
<StringDetect String="_{" attribute="Underscore" context="underscore"/>
- <StringDetect String="^{" attribute="Superscript" context="superscript"/>
- <StringDetect String=",{" attribute="Subscript" context="subscript"/>
- <StringDetect String="+{" attribute="Insert" context="insert"/>
+ <StringDetect String="^{" attribute="Superscript" context="superscript"/>
+ <StringDetect String=",{" attribute="Subscript" context="subscript"/>
+ <StringDetect String="+{" attribute="Insert" context="insert"/>
</context>
<context attribute="Insert" lineEndContext="#stay" name="insert" >
<StringDetect attribute="Insert" context="#pop" String="}+" />
@@ -125,6 +142,7 @@
<context attribute="Endnote" lineEndContext="#pop" name="endnote" />
<context attribute="Bold" lineEndContext="#pop" name="boldline" />
<context attribute="Indent" lineEndContext="#pop" name="indent" />
+ <context attribute="Warn" lineEndContext="#pop" name="warn" />
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
@@ -138,7 +156,7 @@
<itemData name="Strike" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
<itemData name="Insert" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
<itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="Endnote" defStyleNum="dsNormal" color="#086800" selColor="#60FFFF" bold="0" italic="0"/>
+ <itemData name="Endnote" defStyleNum="dsNormal" color="#0AAA00" selColor="#60FFFF" bold="0" italic="0"/>
<itemData name="Link" defStyleNum="dsNormal" color="#0000FF" selColor="#60FFFF" bold="0" italic="0"/>
<itemData name="String" defStyleNum="dsString" />
<itemData name="Comment" defStyleNum="dsComment"/>
@@ -146,6 +164,7 @@
<itemData name="Break" defStyleNum="dsNormal" color="#FF0000" selColor="#60FFFF" bold="0" italic="0"/>
<itemData name="Indent" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
<itemData name="Structure" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+ <itemData name="Warn" defStyleNum="dsError" color="#FF00FF" selColor="#000000" bold="1" italic="0"/>
</itemDatas>
</highlighting>
<general>
diff --git a/data/sisu/image/b_info.png b/data/sisu/image/b_info.png
new file mode 100644
index 00000000..133fd8b6
--- /dev/null
+++ b/data/sisu/image/b_info.png
Binary files differ
diff --git a/data/sisu/image/bluebell.png b/data/sisu/image/bluebell.png
deleted file mode 100644
index 99c572d4..00000000
--- a/data/sisu/image/bluebell.png
+++ /dev/null
Binary files differ
diff --git a/lib/sisu/v0/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb
index 0032a927..9a577337 100644
--- a/lib/sisu/v0/cgi_pgsql.rb
+++ b/lib/sisu/v0/cgi_pgsql.rb
@@ -92,7 +92,7 @@ module SiSU_CGI_pgsql
f2 << " end\n"
if FileTest.writable?('.')
output=File.open('sisu_pgsql.cgi','w')
- output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons2 << buttons2_pgsql << buttons3 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << dbi_connect << @common.main2
+ output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons1_pgsql << buttons2 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << dbi_connect << @common.main2
a=%{ generated sisu_pgsql.cgi,
BASED ON ALREADY EXISTING directories that could potentially be used to populate postgresql db, (-D)
}
@@ -213,9 +213,8 @@ module SiSU_CGI_pgsql
end
WOK_SQL
end
- def buttons2_pgsql
+ def buttons1_pgsql
<<-'WOK_SQL'
- <font size="2" color="#222222">
<input type="checkbox" name="casesense" #@checked_case> case sensitive
WOK_SQL
end
diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb
index 37ca67b8..fbb627db 100644
--- a/lib/sisu/v0/cgi_sql_common.rb
+++ b/lib/sisu/v0/cgi_sql_common.rb
@@ -131,13 +131,13 @@ module SiSU_CGI_sql
@color_heading='#DDFFAA'
@color_match='#ffff48'
class Form
- def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can='')
+ def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can='')
search_note='' if checked_searched !~/\S/
the_can='' if checked_url !~/\S/
search_field='' if checked_echo !~/\S/
- @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_searched,@checked_url,@checked_case,@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_case,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_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can
@tip=if checked_tip =~/\S/
- '<font size="2" color="#666666">text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;</font>'
+ '<font size="2" color="#666666">text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;</font><br />'
else ''
end
end
@@ -171,62 +171,53 @@ module SiSU_CGI_sql
end
def header2
<<-'WOK_SQL'
- <table cellpadding="0">
- <tr><td valign=\"top\">
- <form action="#@base" id="Test Form" method="post">
- <!input type="text" id="find" name="find" value="#@search_field" />
- <!input type="text" id="find" name="find" value="" />
- <font size="2" color="#222222">
- select which database to search
- </font>
- <br />
- <select name="db" size="1">
- #@selected_db
- WOK_SQL
- end
- def buttons1
- <<-'WOK_SQL'
- </select>
- <font size="2" color="#222222">
- <input type="radio" name="view" value="index" #@checked_index> index
- <input type="radio" name="view" value="text" #@checked_text> text / grep
- </font>
- </td></tr></table>
+ <form action="#@base" id="Test Form" method="post">
<table cellpadding="2">
<tr><td valign=\"top\">
- <textarea id="find" name="find" type="text" rows="4" cols="30" maxlength="256">#@search_field</textarea>
- <br /><input type="submit" value="SiSU search" />
- WOK_SQL
- end
- def buttons2
- <<-'WOK_SQL'
+ <textarea id="find" name="find" type="text" rows="4" cols="30" maxlength="256">#@search_field</textarea>
</td>
<td valign=\"top\">
#@tip
#@search_note
#@the_can
</td></tr></table>
- <table><tr><td>
+ <td valign=\"top\"><tr><td>
+ <!input type="text" id="find" name="find" value="#@search_field" />
+ <!input type="text" id="find" name="find" value="" />
+ <font size="2" color="#222222">
+ <b>to search:</b> select which database to search (drop-down menu below); enter your search query (in the form above); and <b>click on the search button</b> (below)
+ <br />
+ <select name="db" size="1">
+ #@selected_db
+ WOK_SQL
+ end
+ def buttons1
+ <<-'WOK_SQL'
+ </select>
+ <input type="submit" value="SiSU search" />
+ <input type="radio" name="view" value="index" #@checked_index> index
+ <input type="radio" name="view" value="text" #@checked_text> text / grep
WOK_SQL
end
- def buttons3
+ def buttons2
<<-'WOK_SQL'
- <br />
- <input type="checkbox" name="echo" #@checked_echo> echo previous search
- <input type="checkbox" name="searched" #@checked_searched> search result stats
- <input type="checkbox" name="url" #@checked_url> url for search
- <input type="checkbox" name="tip" #@checked_tip> available search fields
- <input type="checkbox" name="sql" #@checked_sql> sql statement
- <br />
- checks:
- <input type="radio" name="checks" value="check_ignore" #@checked_ignore> selected
- <input type="radio" name="checks" value="check_all" #@checked_all> all
- <input type="radio" name="checks" value="check_none" #@checked_none> none
- </font>
-
+ <br />
+ <input type="checkbox" name="echo" #@checked_echo> echo query
+ <input type="checkbox" name="stats" #@checked_stats> result stats
+ <input type="checkbox" name="url" #@checked_url> search url
+ <input type="checkbox" name="searched" #@checked_searched> searched
+ <input type="checkbox" name="tip" #@checked_tip> available fields
+ <input type="checkbox" name="sql" #@checked_sql> sql statement
+ <br />
+ checks:
+ <input type="radio" name="checks" value="check_default" #@checked_default> default
+ <input type="radio" name="checks" value="check_selected" #@checked_selected> selected
+ <input type="radio" name="checks" value="check_all" #@checked_all> all
+ <input type="radio" name="checks" value="check_none" #@checked_none> none
+ </font>
</td></tr>
</table>
- </form>
+ </form>
WOK
end
end
@@ -601,23 +592,34 @@ module SiSU_CGI_sql
@stub='sisu'
'SiSU_sisu'
end
- checked_url,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,selected_db='','','','','','','','',''
+ checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','',''
if cgi['view']=~/text/; checked_index,checked_text='','checked'
else checked_index,checked_text='checked',''
end
+ checked_echo='checked' if cgi['echo'] =~/\S/
+ checked_stats='checked' if cgi['stats'] =~/\S/
checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
checked_searched='checked' if cgi['searched'] =~/\S/
checked_tip='checked' if cgi['tip'] =~/\S/
checked_case='checked' if cgi['casesense'] =~/\S/
- checked_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_all='checked'
+ checked_echo=checked_stats=checked_url=checked_searched=checked_tip=checked_sql='checked'
checked_none=''
- elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0
+ elsif cgi['checks'] =~/check_none/
checked_none='checked'
- checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
- else checked_ignore='checked'
+ checked_all=checked_url=checked_stats=checked_searched=checked_tip=checked_echo=checked_sql=''
+ elsif cgi['checks'] =~/check_selected/
+ checked_selected='checked'
+ elsif cgi['checks'] =~/check_default/
+ checked_default='checked'
+ checked_echo=checked_stats=checked_url='checked'
+ checked_searched=checked_tip=checked_case=checked_sql=''
+ else
+ checked_selected='checked'
+ checked_echo=checked_stats=checked_url='checked'
+ checked_searched=checked_tip=checked_case=checked_sql=''
end
WOK_SQL
end
@@ -654,7 +656,7 @@ module SiSU_CGI_sql
fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/
@@canned_search_url=if checked_all =~/checked/
"#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1"
- else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1"
+ else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}"
end
if checked_case=~/\S/
@search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
@@ -663,7 +665,7 @@ module SiSU_CGI_sql
@search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1
@search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1
end
- canned_note='previous search url:'
+ canned_note='search url:'
else
@@canned_search_url="#@base?s1=United+Nations&db=documents&view=index"
canned_note='search url example:'
@@ -684,7 +686,7 @@ module SiSU_CGI_sql
end
green=%{<font size="2" color="#004000">}
canned_search_url_txt=CGI.escapeHTML(@@canned_search_url)
- the_can=%{<font size="2" color="#666666">#{canned_note}<br /> <a href="#{@@canned_search_url}">#{canned_search_url_txt}</a></font><br />}
+ the_can=%{<font size="2" color="#666666">#{canned_note} <a href="#{@@canned_search_url}">#{canned_search_url_txt}</a></font><br />}
p_text=p_keywords=p_title=p_author=p_subject=p_description=p_publisher=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_subject=p_filename=''
p_text=%{text: #{green}#{@search_for.text1}</font><br />} if @search_for.text1 =~/\S+/
p_keywords=%{keywords: #{green}#{@search_for.keywords}</font><br />} if @search_for.keywords =~/\S+/
@@ -708,15 +710,14 @@ module SiSU_CGI_sql
p_filename=%{filename: #{green}#{@search_for.filename}</font><br />} if @search_for.filename =~/\S+/
search_note=<<-WOK
<font size="2" color="#666666">
- <br /><b>previous selection</b>:<br />
- database: #{green}#@db</font>; selected view: #{green}#{cgi['view']}</font><br />
- search string: "#{green}#{analyze_format}</font>"<br />
+ <b>database:</b> #{green}#@db</font>; <b>selected view:</b> #{green}#{cgi['view']}</font>
+ <b>search string:</b> "#{green}#{analyze_format}</font>"<br />
#{p_text} #{p_keywords} #{p_title} #{p_author} #{p_subject} #{p_description} #{p_publisher} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename}
</font>
WOK
#eg = %{canned search e.g.:<br /> <a href="#{url}">#{url}</a><br />find: #{analyze}<br />database: #{database}}
#dbi_canning
- @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form
+ @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form
unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
print "Content-type: text/html\n\n"
puts (@header+@tail)
@@ -763,7 +764,7 @@ module SiSU_CGI_sql
end
#metadata_found_body
if c['tid'].to_i != oldtid.to_i
- title=%{<span style="background-color: #@color_heading"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html">#{c['title']}</a></span> by #{c['creator']} <a href="#@hosturl_files/#@stub/#{location}/portrait#{lang}.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl_files/#@stub/#{location}/landscape#{lang}.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="manifest"><font size="2">&nbsp;?</font></a><br />} if file_suffix=~/s/ #hmm watch file_suffix
+ title=%{<span style="background-color: #@color_heading"><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/b_info.png" alt="manifest"></a><br />} if file_suffix=~/s/ #hmm watch file_suffix
if @text_search_flag; title='<br /><hr>'+title
else title='<br />'+title
end
@@ -796,7 +797,7 @@ module SiSU_CGI_sql
end
matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/)
matched=if c['body'] =~/<a href="https?:\/\//mi; c['body']
- else (c['body'].gsub(/(#@search_regx)/,%{<span style="background-color: #@color_match">\\1</span>}))
+ else (c['body'].gsub(/(#@search_regx)/i,%{<span style="background-color: #@color_match">\\1</span>}))
end
matched
else c['body']
@@ -830,7 +831,10 @@ module SiSU_CGI_sql
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 />}
+ if checked_stats =~/\S/
+ %{<hr /><font size="2" color="#666666">Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.</font><br />}
+ else ''
+ end
else ''
end
@body_main << output #+ details
@@ -849,7 +853,7 @@ module SiSU_CGI_sql
#metadata_found_endnotes
if @text_search_flag
if e['metadata_tid'].to_i != oldtid.to_i
- title=%{<br /><hr><span style="background-color: #@color_heading"><a href="#@hosturl_files/#@stub/#{location}/toc#{lang}.html">#{e['title']}</a></span> by #{e['creator']} <a href="#@hosturl_files/#@stub/#{location}/portrait.pdf"><img border="0" width="15" height="18" src="#@image_src/b_pdf.png" alt="pdf portrait"></a><a href="#@hosturl_files/#@stub/#{location}/landscape.pdf"><img border="0" width="18" height="15" src="#@image_src/b_pdf.png" alt="pdf landscape"></a> <a href="#@hosturl_files/#@stub/#{location}/sisu_manifest#{lang}.html"><img border="0" width="12" height="12" src="#@image_src/bullet_red.png" alt="manifest"><font size="2">&nbsp;?</font></a><br />} if file_suffix=~/s/
+ title=%{<br /><hr><span style="background-color: #@color_heading"><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/b_info.png" alt="manifest"></a><br />} if file_suffix=~/s/
@counter_endn_doc+=1
oldtid=e['metadata_tid'].to_i
else title = ''
@@ -858,7 +862,7 @@ module SiSU_CGI_sql
@counter_endn_ocn+=1
matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/)
matched=if e['body'] =~/<a href="https?:\/\//mi; e['body']
- else e['body'].gsub(/(#@search_regx)/,%{<span style="background-color: #@color_match">\\1</span>})
+ else e['body'].gsub(/(#@search_regx)/i,%{<span style="background-color: #@color_match">\\1</span>})
#e['body']
end
matched
@@ -870,7 +874,10 @@ module SiSU_CGI_sql
output=%{#{title}<a href="#@hosturl_files/#@stub/#{location}/endnotes.html#_#{e['nr']}">#{e['nr']}</a> [&sect; <a href="#@hosturl_files/#@stub/#{location}/doc.html##{e['ocn']}">#{e['ocn']}</a>], }
end
@counters_endn=if @counter_endn_doc > 0
- %{<font size="2" color="#666666">Found in the endnotes of #@counter_endn_doc documents, and at #@counter_endn_ocn locations within.</font><br />}
+ if checked_stats =~/\S/
+ %{<font size="2" color="#666666">Found in the endnotes of #@counter_endn_doc documents, and at #@counter_endn_ocn locations within.</font><br />}
+ else ''
+ end
end
@endnotes << output #+ details
else @endnotes=[] #does not take out yet
@@ -896,32 +903,3 @@ module SiSU_CGI_sql
end
end
__END__
-#@counter_txt_ocn
-#@counter_endn_ocn
-
-
- if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1
- checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked'
- checked_none=''
- #elsif cgi['checks'] =~/check_fixed/ or cgi['check_fixed'] =~/\S/
- # #checked_ignore='checked'
- # checked_fixed='checked'
- # checked_url='checked'
- # checked_searched='checked'
- # checked_echo='checked'
- # #checked_tip='checked'
- # #checked_sql='checked'
- # checked_tip=checked_sql=checked_none=''
- #elsif cgi['checks'] =~/check_ignore/ or cgi['check_ignore'] =~/\S/
- # checked_ignore='checked'
- # checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
- # checked_searched='checked' if cgi['searched'] =~/\S/
- # checked_tip='checked' if cgi['tip'] =~/\S/
- # checked_echo='checked' if cgi['echo'] =~/\S/
- # checked_sql='checked' if cgi['sql'] =~/\S/
- # checked_none=''
- elsif cgi['checks'] =~/check_none/ or cgi['a'].to_i==0
- checked_none='checked'
- checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql=''
- else checked_ignore='checked'
- end
diff --git a/lib/sisu/v0/cgi_sqlite.rb b/lib/sisu/v0/cgi_sqlite.rb
index 4565ebe2..56b1e588 100644
--- a/lib/sisu/v0/cgi_sqlite.rb
+++ b/lib/sisu/v0/cgi_sqlite.rb
@@ -92,7 +92,7 @@ module SiSU_CGI_sqlite
f3 << " end\n"
if FileTest.writable?('.')
output=File.open('sisu_sqlite.cgi','w')
- output << header0 << header1 << header_desc << header2 << f1 << buttons1 << buttons2 << buttons3 << search_request << search_statement << search_statement_common << search_query1 << @common.pages << search_query2 << @common.tail << @common.main1 << f2 << f3 << dbi_connect << @common.main2
+ 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)
}
diff --git a/lib/sisu/v0/dal_syntax.rb b/lib/sisu/v0/dal_syntax.rb
index 42e911e5..a882a2c9 100644
--- a/lib/sisu/v0/dal_syntax.rb
+++ b/lib/sisu/v0/dal_syntax.rb
@@ -191,7 +191,7 @@ module Syntax
# # #numbered (list) level 1
# _# #numbered (list) level 2
line=line.dup
- unless line =~/^0~|<:codeline>|<:code-end>/
+ if line !~/^0~|<:codeline>|<:code-end>/
#special characters: ~ { } < > - _ / also used : ^ ! #
line_array=[]
line.gsub!(/^%{1,4} .+/mi,'') #remove comments
@@ -282,7 +282,9 @@ module Syntax
if line =~/(<:(?:verse|group)>)/; line.gsub!(/(<:(?:verse|group)>)/i,"\\1\n") #cosmetic
else line.gsub!(/(<br \/>)/i,"\\1\n")
end
- else
+ else #code blocks
+ line.gsub!(/(^|\s)(http:\/\/\S+)/,'\1_\2') #line.gsub!(/(^|\s)(http:\/\/\S+)/,"\\1\\\\\\2") #escape urls
+ line.gsub!(/(^|\s)<(http:\/\/\S+)>([\s,.]|$)/,'\1\2\3') #clean/unescape urls with decoration, re-apply decoration later
line.gsub!(/<:codeline>/,"\n")
end
line
@@ -337,3 +339,5 @@ module Syntax
end
end
__END__
+NOTE:
+downstream code blocks are not currently/yet honoured, e.g. stuff within angle brackets are removed
diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb
index 66333528..694b2e83 100644
--- a/lib/sisu/v0/defaults.rb
+++ b/lib/sisu/v0/defaults.rb
@@ -377,7 +377,7 @@ module SiSU_Viz
'sisu.png'
end
def icon_manifest
- 'bullet_red.png'
+ 'b_info.png'
end
def icon_doc
'b_doc.png'
@@ -911,7 +911,7 @@ module SiSU_Viz
end
def nav_txt_manifest
%{ <font face="#{font_fonts}" size="2">
- #{png_manifest}&nbsp;&nbsp;?&nbsp;
+ #{png_manifest}&nbsp;
</font> }
end
def nav_txt_concordance
@@ -1528,7 +1528,6 @@ outputs include: plaintext, html, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQ
<br />
<input type="submit" name="ignore" value="search" />
<input type="hidden" name="db" value="SiSU_sisu" />
-<input type="hidden" name="a" value="1" />
<input type="radio" name="view" value="index" checked="checked" /> idx
<input type="radio" name="view" value="text" /> txt
</form>
diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb
index 9c10c27e..768a52cf 100644
--- a/lib/sisu/v0/help.rb
+++ b/lib/sisu/v0/help.rb
@@ -1053,7 +1053,7 @@ WOK
latex to pdf: #{program_found?(@env.program.pdflatex)}
postgresql: #{program_found?(@env.program.postgresql)}
sqlite: #{program_found?(@env.program.sqlite)}
- (these can be turned off if unavailable in sisurc.yaml under program_set:)
+ (these can be turned off if unavailable in sisurc.yml under program_set:)
#{@cX.green}processing shortcut defaults set to:#{@cX.off}
color defaut set (on==true) #{@cX.blue}#{cf_defaults.color}#{@cX.off}
sisu -0 #{@cX.blue}#{cf_defaults.cf_0}#{@cX.off} [default]
diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb
index 1fb282de..1d3461c3 100644
--- a/lib/sisu/v0/html_tune.rb
+++ b/lib/sisu/v0/html_tune.rb
@@ -196,6 +196,7 @@ module SiSU_Tune
@sys=SiSU_Env::System_call.new
@dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
@env=SiSU_Env::Info_env.new(@md.fns)
+ @url_brace=SiSU_Viz::Skin.new.url_decoration
#@utf8=SiSU_character_encode::UTF8 #.new
end
def songsheet
@@ -324,20 +325,9 @@ module SiSU_Tune
if (para =~/\b\S+\@\S+?\.\S+/ and para !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/)
para.gsub!(/\b(\S+\@\S+?\.\S+)(\s)/,'&lt;<a href="mailto:\1">\1</a>&gt;\2')
end
- if (para !~/(\"\w+:\/\/\S+?\"|>\s*\w+:\/\/\w+?\S*<)/) #url markup http etc.
- if para=~/\w+:\/\/\S+?\.\S+?[.,] /
- para.gsub!(/(\w+:\/\/\S+?\.\S+?)([.,] )/,'&lt;<a href="\1" target="_top">\1</a>&gt;\2') #full stops ! have been a bother
- else
- para.gsub!(/(\w+:\/\/\S+?\.\S+)/, '&lt;<a href="\1" target="_top">\1</a>&gt;')
- end
- end
- if (para =~/[ ^](?:https?|ftp):\/\/\S+/) #url markup http leftovers watch carefully may accept too much 2004w46
- if para=~/([ ^])((?:https?|ftp):\/\/\S+?)([\.,] )/
- para.gsub!(/([ ^])((?:https?|ftp):\/\/\S+?)([\.,] )/,'\1&lt;<a href="\2" target="_top">\2</a>&gt;\3') #full stops ! have been a bother
- else
- para.gsub!(/([ ^])((?:https?|ftp):\/\/\S+)/,'\1&lt;<a href="\2" target="_top">\2</a>&gt;')
- end
- end
+ para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #http ftp matches escaped, no decoration
+ para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #special case \{ e.g. \}http://url
+ para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,%{\\1#{@url_brace.xml_open}<a href="\\2" target="_top">\\2</a>#{@url_brace.xml_close}\\3}) #http ftp matches with decoration
if (para =~/..\/\S+/ and para !~/(\"..\/\S+?\"|>\s*..\/\S+<)/)
para.gsub!(/(\.\.\/\S+)/,'<a href="\1">\1</a>')
end
diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb
index a5ed30a4..cff57888 100644
--- a/lib/sisu/v0/odf.rb
+++ b/lib/sisu/v0/odf.rb
@@ -295,8 +295,14 @@ module SiSU_ODF
end
def normal(para) #P1 - P3
para.gsub!(@serial,'')
- para.gsub!(/(^|\s)(https?:\/\/[^'">< ]+?)([\.,]?(?: |$))/,%{\\1#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="\\2">\\2</text:a>#{@url_brace.xml_close}\\3})
- para.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,%{#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@url_brace.xml_close}})
+ para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,
+ %{\\1<text:a xlink:type="simple" xlink:href="\\2">\\2</text:a>\\3}) #http ftp matches escaped, no decoration
+ para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,
+ %{\\1<text:a xlink:type="simple" xlink:href="\\2">\\2</text:a>\\3}) #special case \{ e.g. \}http://url
+ para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,
+ %{\\1#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="\\2">\\2</text:a>#{@url_brace.xml_close}\\3}) #http ftp matches with decoration
+ para.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,
+ %{#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@url_brace.xml_close}})
para=case para
when /^<:i([1-9])>\s/m
m=$1
@@ -369,6 +375,8 @@ module SiSU_ODF
parray=[]
para.split(/<:?br(?: \/)?>/).each do |parablock|
parablock=group_clean(parablock)
+ parablock.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,
+ %{\\1<text:a xlink:type="simple" xlink:href="\\2">\\2</text:a>\\3}) #http ftp matches escaped, no decoration
parray << %{<text:p text:style-name="P5">#{parablock}</text:p>} if parablock =~/\S+/
end
para=parray.join + '<text:p text:style-name="Standard"/>'
diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb
index 4bff976a..f08a0871 100644
--- a/lib/sisu/v0/plaintext.rb
+++ b/lib/sisu/v0/plaintext.rb
@@ -327,7 +327,8 @@ WOK
end
para.gsub!(/<:p[bn]>/,'') # remove page breaks
para.gsub!(/^\s*<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'') # remove empty lines - check
- para.gsub!(/(^|\s)(https?:\/\/[^"><]+?)([,.:;"><]?(?:\s|$))/,"\\1#{@url_brace.txt_open}\\2#{@url_brace.txt_close}\\3")
+ para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,"\\1#{@url_brace.txt_open}\\2#{@url_brace.txt_close}\\3")
+ para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1\2\3')
para.gsub!(/<a href=".+?">(.+?)<\/a>/m,'\1')
para.gsub!(/<:name#\S+?>/,'') # remove name links
para.gsub!(/&nbsp;/,' ') # decide on
diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb
index ed622fb8..5285b6db 100644
--- a/lib/sisu/v0/shared_html_lite.rb
+++ b/lib/sisu/v0/shared_html_lite.rb
@@ -120,20 +120,9 @@ module SiSU_Format_Shared
words=word_mode.join(' ')
para.gsub!(/.+/,words)
end
- if (para !~/(\"\w+:\/\/\S+?\"|>\s*\w+:\/\/\w+?\S*<)/) #url markup http etc.
- if para=~/\w+:\/\/\S+?\.\S+?[.,] /
- para.gsub!(/(\w+:\/\/\S+?\.\S+?)([.,] )/,%{#{@url_brace.xml_open}<a href="\\1" target="_top">\\1</a>#{@url_brace.xml_close}\\2}) #full stops ! have been a bother
- else
- para.gsub!(/(\w+:\/\/\S+?\.\S+)/,%{#{@url_brace.xml_open}<a href="\\1" target="_top">\\1</a>#{@url_brace.xml_close}})
- end
- end
- if (para =~/[ ^](?:https?|ftp):\/\/\S+/) #url markup http leftovers watch carefully may accept too much 2004w46
- if para=~/([ ^])((?:https?|ftp):\/\/\S+?)([\.,] )/
- para.gsub!(/([ ^])((?:https?|ftp):\/\/\S+?)([\.,] )/,%{\\1#{@url_brace.xml_open}<a href="\\2" target="_top">\\2</a>#{@url_brace.xml_close}\\3}) #full stops ! have been a bother
- else
- para.gsub!(/([ ^])((?:https?|ftp):\/\/\S+)/,%{\\1#{@url_brace.xml_open}<a href="\\2" target="_top">\\2</a>#{@url_brace.xml_close}})
- end
- end
+ para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #http ftp matches escaped, no decoration
+ para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #special case \{ e.g. \}http://url
+ para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,%{\\1#{@url_brace.xml_open}<a href="\\2" target="_top">\\2</a>#{@url_brace.xml_close}\\3}) #http ftp matches with decoration
para
end
def paragraph
diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb
index bcdf44f5..995044db 100644
--- a/lib/sisu/v0/shared_xml.rb
+++ b/lib/sisu/v0/shared_xml.rb
@@ -347,8 +347,7 @@ module SiSU_XML_munge
def markup(para='')
wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
para=tidywords(wordlist).join(' ').strip
- para.gsub!(/(^|\s+)<\s+/,'\1&lt; ')
- para.gsub!(/\s+>(\s+|$)/,' &gt;\1')
+ para.gsub!(/(^|\s+)<\s+/,'\1&lt; '); para.gsub!(/\s+>(\s+|$)/,' &gt;\1')
para.gsub!(/<:pb>\s*/,'')
para.gsub!(/<+[-~]#>+/,'')
para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'')
@@ -357,8 +356,12 @@ module SiSU_XML_munge
#para.gsub!(/^_\*\s+/,'<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="/usr/share/sisu/image/bullet_red.png" width="12" height="12" alt="*" /> ')
para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))\s+(\d+)x(\d+)(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\2" width="\\3" height="\\4" />[\\2] \\5})
para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\2"/>\\2})
- para.gsub!(/(^|\s)\{([^}]+)\}(https?:\/\/[^"><]+?)([,.:;"><]?(?:\s|$))/,'\1<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\3">\2</link>\4')
- para.gsub!(/(^|\s)(https?:\/\/[^"><]+?)([,.:;"><]?(?:\s|$))/,%{\\1#{@url_brace.xml_open}<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\\2">\\2</link>#{@url_brace.xml_close}\\3})
+ para.gsub!(/(^|\s)\{([^}]+)\}(https?:\/\/[^"><]+?)([,.:;"><]?(?:\s|$))/,
+ '\1<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\3">\2</link>\4') #watch, compare html_tune
+ para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,
+ %{\\1#{@url_brace.xml_open}<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\\2">\\2</link>#{@url_brace.xml_close}\\3})
+ para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1\2\3') #escaped urls not linked, deal with later
+ #para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\2">\2</link>\3') #escaped urls not linked, deal with later
para.gsub!(/&nbsp;/,' ') #clean
para
end
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index c2d694f2..ddd84aaa 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -881,7 +881,6 @@ module SiSU_Env
<input type="text" name="s1" size="24" maxlength="255" />
<br />
<input type="hidden" name="db" value="#{db}" />
-<input type="hidden" name="a" value="1" />
<input type="hidden" name="ltd" value="1000" />
<input type="hidden" name="off" value="0" />
<input type="radio" name="view" value="index" checked="checked" /> idx
@@ -917,7 +916,6 @@ module SiSU_Env
<input type="text" name="s1" size="24" maxlength="255" />
<br />
<input type="hidden" name="db" value="#{db}" />
-<input type="hidden" name="a" value="1" />
<input type="hidden" name="ltd" value="1000" />
<input type="hidden" name="off" value="0" />
<input type="radio" name="view" value="index" checked="checked" /> idx
@@ -995,7 +993,6 @@ module SiSU_Env
<input type="text" name="s1" size="24" maxlength="255" />
<br />
<input type="hidden" name="db" value="#{db}" />
-<input type="hidden" name="a" value="1" />
<input type="hidden" name="fns" value="#@fnb" />
<input type="radio" name="view" value="index" /> idx
<input type="radio" name="view" value="text" checked="checked" /> txt
@@ -1011,7 +1008,6 @@ module SiSU_Env
<input type="text" name="s1" size="24" maxlength="255" />
<br />
<input type="hidden" name="db" value="#{db}" />
-<input type="hidden" name="a" value="1" />
<input type="radio" name="view" value="index" checked="checked" /> idx
<input type="radio" name="view" value="text" /> txt
<input type="submit" />
diff --git a/lib/sisu/v0/texinfo_format.rb b/lib/sisu/v0/texinfo_format.rb
index 3184ee80..e4803d87 100644
--- a/lib/sisu/v0/texinfo_format.rb
+++ b/lib/sisu/v0/texinfo_format.rb
@@ -327,9 +327,10 @@ WOK
@para.gsub!(/(\$)/,"\\$")
@para.gsub!(/\~/,'\\~')
@para.gsub!(/%/,"\\%")
- if @para !~ /^\s*<:image|\}:image\s/
- @para.gsub!(/_/,'\_')
- end
+ #if @para !~ /^\s*<:image|\}:image\s/
+ # @para.gsub!(/_/,'\_')
+ #end
+ @para.gsub!(/_(http:\/\/)/,'\1')
@para.gsub!(/§/i,'\S')
@para.gsub!(/£/i,'\pounds')
@para.gsub!(/å/i,'\aa')
diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb
index 5eaf7311..6ac87240 100644
--- a/lib/sisu/v0/texpdf.rb
+++ b/lib/sisu/v0/texpdf.rb
@@ -358,6 +358,7 @@ module SiSU_TeX
end
@tex_file <<<<WOK
#{@tex.header}#{@tex.footer}
+\\tolerance=500
\\makeatother
\\makeatother
\\begin{document}
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index aafbe8a9..4d69c1ae 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -499,18 +499,10 @@ WOK
@string.gsub!(/&\S+?;/,' ')
@string.gsub!(/<a href=".+?">/,' ')
@string.gsub!(/<\/a>/,' ')
- if @string !~/^\s*<:image|\}image/ #watch carefully could introduce breaks ! removed \}http changed 0.1.1-4 200501
- if @string =~/(?:https?|ftp):\/\/\S+?<\/\S>/ #problems where have font attribute eg </u> (change substitution sequence?) # [^\}>] added for escaped curly brace <=curlyclose> watch
- @string.gsub!(/[^\}>]((?:https?|ftp):\/\/\S+?)(<\/\S>)/,' \begin{scriptsize}\href{\1}{ \1 } \end{scriptsize}\2')
- else # regular urls !! http:// href
- if @string=~/(?:https?|ftp):\/\/\S+?[,.]? /
- @string.gsub!(/(?:^|[^\}>])((?:https?|ftp):\/\/\S+?)([,.])? /," #{@url_brace.tex_open}\\begin{scriptsize}\\href{\\1}{ \\1}\\end{scriptsize}#{@url_brace.tex_close}\\2 ") #tamper
- else @string.gsub!(/(?:^|[^\}>])((?:https?|ftp):\/\/\S+)/,' \begin{scriptsize}\href{ \1 }{\1} \end{scriptsize}') #should not be necessary, not checked
- end
- end
- else #@string =~/\\~\\\{.+?\\\}\\~/ # \\~\\{1
- #@string.gsub!(/(?:\n)?(http:\/\/\S+)/," \\begin{scriptsize}\\href{\\1}{\\1} \\end{scriptsize}") #bug...
- end
+ @string.gsub!(/[^\}>_]((?:https?|ftp):\/\/\S+?)(<\/\S>)/,' \begin{scriptsize}\href{\1}{\1} \end{scriptsize}\2') #special case
+ @string.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1\begin{scriptsize}\\href{\2}{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url
+ @string.gsub!(/(^|\s)(?:\\_|\\)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1\begin{scriptsize}\\href{\2}{\2}\end{scriptsize}\3') #specially escaped url no decoration
+ @string.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,"\\1#{@url_brace.tex_open}\\begin{scriptsize}\\href{\\2}{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration <url>
@string.gsub!(/<:ee>/,'')
@string.gsub!(/<!>/,' ')
#proposed change, insert, but may be redundant
@@ -704,10 +696,20 @@ WOK
#end BUGWATCH
end
def indent(lev)
- @string.gsub!(/<:i#{lev}>(.*)/m,
- "\\begin{ParagraphIndent}{0.0#{lev}\\columnwidth} \\1
-\\end{ParagraphIndent}
-")
+ indent=case lev
+ when /1/; '0mm'
+ when /2/; '10mm'
+ when /3/; '20mm'
+ when /4/; '30mm'
+ when /5/; '40mm'
+ when /6/; '50mm'
+ when /7/; '60mm'
+ when /8/; '70mm'
+ when /9/; '80mm'
+ end
+ @string.gsub!(/<:i#{lev}>\s*(.*)/m,
+ "\\begin{ParagraphIndent}{#{indent}}\\1
+\\end{ParagraphIndent}}")
end
def symbol_graphic
dir=SiSU_Env::Info_env.new(@md.fns)
@@ -1192,21 +1194,17 @@ WOK
def a4generic
end
def para_num
- paranumber_display=if @md.mod.inspect =~/--no-ocn/; '' #!ocn no object citation numbering
+ paranumber_display=if @md.mod.inspect =~/--no-ocn/; '' #!ocn no object citation numbering
else "\\begin{tiny}~\\end{tiny}{\\marginpar{\\begin{tiny}#@string1\\end{tiny}}}" #ocn object citation numbering
end
if @string !~/^([1-6a-z-]#{@@tilde}\S*|<:.+?>|#{@md.lv1}|#{@md.lv2}|#{@md.lv3}|#{@md.lv4}|#{@md.lv5}|#{@md.lv6})/
@string.gsub!(/^\s*(.+)/m,"#{paranumber_display}\\1\n") #watch - in 1-6 is suspect
else
if (@string =~/^(?:[1-6a-z-]#{@@tilde}\S*|<:.+?>)/) #watch - in 1-6 is suspect
- @string.gsub!(/^([1-6a-z-]#{@@tilde}\S*|<:.+?>)\s*(.+)/m,"\\1 #{paranumber_display} \\2\n") #watch - in 1-6 is suspect
+ @string.gsub!(/^([1-6a-z-]#{@@tilde}\S*)\s*(.+)/m,"\\1 #{paranumber_display} \\2\n") #watch - in 1-6 is suspect
+ @string.gsub!(/^(<:.+?>)\s*(.+)/m,"\\1 #{paranumber_display}\\2\n")
else
- @string.gsub!(/(#{@md.lv1}.+)$/,"#{@md.lv1} #{paranumber_display}\\1\n")
- @string.gsub!(/(#{@md.lv2}.+)$/,"#{@md.lv2} #{paranumber_display}\\1\n")
- @string.gsub!(/(#{@md.lv3}.+)$/,"#{@md.lv3} #{paranumber_display}\\1\n")
- @string.gsub!(/(#{@md.lv4}.+)$/,"#{@md.lv4} #{paranumber_display}\\1\n")
- @string.gsub!(/(#{@md.lv5}.+)$/,"#{@md.lv5} #{paranumber_display}\\1\n")
- @string.gsub!(/(#{@md.lv6}.+)$/,"#{@md.lv6} #{paranumber_display}\\1\n")
+ @string.gsub!(/((#{@md.lv1}|#{@md.lv2}|#{@md.lv3}|#{@md.lv4}|#{@md.lv5}|#{@md.lv6}).+)$/,"\\2 #{paranumber_display}\\1\n")
end
end
@string
diff --git a/lib/sisu/v0/xml_scaffold.rb b/lib/sisu/v0/xml_scaffold.rb
index 93987840..21ce1231 100644
--- a/lib/sisu/v0/xml_scaffold.rb
+++ b/lib/sisu/v0/xml_scaffold.rb
@@ -68,7 +68,7 @@ module SiSU_XML_scaffold
def read
begin
@md=SiSU_Param::Parameters.new(@opt).get
- @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ @dal_array=SiSU_DAL::Source.new(@opt).get
SiSU_XML_scaffold::Source::Scroll.new(@dal_array,@md).songsheet
rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
ensure