aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-07-07 09:21:47 +0100
committerRalph Amissah <ralph@amissah.com>2007-07-07 09:21:47 +0100
commit52f8b9c0b1e1606a4260ef2e0df4d525497691b1 (patch)
treecfb189e2c1dce1af31fc4eb9c414b3bbc6128202
parent0.55.1 sync (diff)
cgi-sample search form; texinfo fix; xml scaffold; help, man pages etc. visited; screen output, color set to true; docbook entries removed
* cgi generated sample search form * order results on files of the same title, in multiple files (with different filenames) * postgresql, character case sensitivity, control, on/off * tail decoration, gplv3 & sisu info * texinfo/info (pinfo) module starts to do something vaguely useful again [not a much used module, testing required] * print XML rendition of document structure to screen -T * sisurc.yml default, color set to true [apologies if this causes anyone any inconvenience, it is configurable in sisurc.yml] * help, man pages, README (man(8) related and env, 'sisu -V') * docbook entries removed for the present time * sisu-install (install ruby rant script renamed) and permissions set to executable
-rw-r--r--CHANGELOG30
-rw-r--r--README59
-rw-r--r--Rantfile19
-rw-r--r--conf/sisu/sisurc.yml7
-rw-r--r--data/doc/sisu/copyright46
-rw-r--r--data/doc/sisu/html/sisu.1.html58
-rw-r--r--data/doc/sisu/html/sisu.8.html195
-rw-r--r--lib/sisu/v0/cgi_pgsql.rb28
-rw-r--r--lib/sisu/v0/cgi_sql_common.rb196
-rw-r--r--lib/sisu/v0/cgi_sqlite.rb11
-rw-r--r--lib/sisu/v0/docbook.rb567
-rw-r--r--lib/sisu/v0/help.rb98
-rw-r--r--lib/sisu/v0/hub.rb14
-rw-r--r--lib/sisu/v0/sysenv.rb23
-rw-r--r--lib/sisu/v0/texinfo.rb29
-rw-r--r--lib/sisu/v0/texinfo_format.rb133
-rw-r--r--lib/sisu/v0/urls.rb6
-rw-r--r--lib/sisu/v0/xml_scaffold.rb203
-rw-r--r--man/man1/sisu.18
-rw-r--r--man/man8/sisu.8141
-rwxr-xr-x[-rw-r--r--]sisu-install (renamed from install)2
21 files changed, 890 insertions, 983 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 78bd3c4d..9108d041 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,36 @@ Reverse Chronological:
%% STABLE MANIFEST
+%% 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
+ sisu_0.55.2.orig.tar.gz
+ sisu_0.55.2-1.dsc
+ sisu_0.55.2-1.diff.gz
+
+ * cgi generated sample search form
+ * order results on files of the same title, in multiple files (with
+ different filenames)
+ * postgresql, character case sensitivity, control, on/off
+ * tail decoration, gplv3 & sisu info
+
+ * texinfo/info (pinfo) module starts to do something vaguely useful again
+ [not a much used module, testing required]
+
+ * print XML rendition of document structure to screen -T
+
+ * help on environment visited, sisu -V
+
+ * sisurc.yml default, color set to true
+ [apologies if this causes anyone any inconvenience, it is configurable in
+ sisurc.yml]
+
+ * help and man pages, some work man(8) related
+
+ * docbook entries removed for the present time
+
+ * sisu-install (install ruby rant script renamed) and permissions set to
+ executable
+
%% sisu_0.55.1.orig.tar.gz (2007-07-02:27/1)
http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.1.orig.tar.gz
cabdec70ded52ea7a0f3da45987169de 1265187 sisu_0.55.1.orig.tar.gz
diff --git a/README b/README
index b2f8a69f..789f95e2 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-SiSU 0.49 2007w08/5 20070223
-homepage: http://www.jus.uio.no/sisu
+SiSU 0.55 2007w27/6 2007-07-07
+homepage: <http://www.jus.uio.no/sisu>
%% Description
---------------
@@ -42,7 +42,7 @@ homepage: http://www.jus.uio.no/sisu
the substantive content of the marked up documents provided is that provided
by the author or original publisher.
- Homepage: http://www.jus.uio.no/sisu
+ Homepage: <http://www.jus.uio.no/sisu>
-----
@@ -87,14 +87,11 @@ Once set up it is simple to use.
%% Online Information, places to look
---------------
-http://www.jus.uio.no/sisu
+<http://www.jus.uio.no/sisu>
Download Sources:
- http://www.jus.uio.no/sisu/SiSU/download.html#current
- http://www.jus.uio.no/sisu/SiSU/download.html#debian
-or the same:
- http://www.jus.uio.no/sisu/sisu_download/download.html#current
- http://www.jus.uio.no/sisu/sisu_download/download.html#debian
+ <http://www.jus.uio.no/sisu/SiSU/download.html#current>
+ <http://www.jus.uio.no/sisu/SiSU/download.html#debian>
%% Installation
---------------
@@ -104,8 +101,7 @@ NB. Platform is Unix / Linux.
---------------
If you use Debian use the Debian packages,
check the information at:
- http://www.jus.uio.no/sisu/SiSU/download.html#debian
- http://www.jus.uio.no/sisu/sisu_download/download.html#debian
+ <http://www.jus.uio.no/sisu/SiSU/download.html#debian>
(A) SiSU is available directly off the Debian archives for Sid and testing. It
should necessary only to run as root:
@@ -135,13 +131,12 @@ RPMs are provided though untested, they are prepared by running alien against th
source package, and against the debs.
They may be downloaded from:
- http://www.jus.uio.no/sisu/SiSU/download.html#rpm
+ <http://www.jus.uio.no/sisu/SiSU/download.html#rpm>
%% Source package .tgz
---------------
Otherwise to install SiSU from source, check information at:
- http://www.jus.uio.no/sisu/SiSU/download.html#current
- http://www.jus.uio.no/sisu/sisu_download/download.html#current
+ <http://www.jus.uio.no/sisu/SiSU/download.html#current>
two alternative modes of installation from source are provided,
setup.rb (by Minero Aoki) and a rant(by Stefan Lang) built install file,
@@ -149,7 +144,7 @@ in either case: the first steps are the same, download and unpack the
source file:
1. Download the latest source (information available) from:
- http://www.jus.uio.no/sisu/SiSU/download.html#current
+ <http://www.jus.uio.no/sisu/SiSU/download.html#current>
2. Unpack the source
@@ -164,16 +159,16 @@ in the root directory of the unpacked SiSU as root type:
ruby setup.rb install
further information:
- http://i.loveruby.net/en/projects/setup/
- http://i.loveruby.net/en/projects/setup/doc/usage.html
+ <http://i.loveruby.net/en/projects/setup/>
+ <http://i.loveruby.net/en/projects/setup/doc/usage.html>
%% to use install (prapared with "Rant")
---------------
in the root directory of the unpacked SiSU as root type:
- ruby install
+ ruby ./sisu-install
or
- ruby install base
+ ruby ./sisu-install base
This makes use of Rant (by Stefan Lang) and the provided Rantfile. It has been
configured to do post installation setup setup configuration and generation of
@@ -181,12 +176,12 @@ first test file. Note however, that additional external package dependencies,
such as tetex-extra are not taken care of for you.
further information:
- http://make.rubyforge.org/
- http://rubyforge.org/frs/?group_id=615
+ <http://make.rubyforge.org/>
+ <http://rubyforge.org/frs/?group_id=615>
For a list of alternative actions you may type:
- ruby install help
- ruby install -T
+ ruby ./sisu-install help
+ ruby ./sisu-install -T
Dependencies
--------------
@@ -262,7 +257,7 @@ examine source document, vim has syntax support
gvim free_as_in_freedom.rms_and_free_software.sam_williams.sst
additional markup samples in
-http://www.jus.uio.no/sisu/SiSU/2.html
+<http://www.jus.uio.no/sisu/SiSU/2.html>
For help
man sisu
@@ -353,12 +348,15 @@ for questions about mappings, output paths etc.
---------------
Once installed, type:
sisu --help env
+or
+ sisu -V
%% Configuration File
---------------
The defaults can be changed via SiSU's configure file sisurc.yml which the
-program expects to find in ./_sisu ~/.sisu or /etc/sisu
+program expects to find in ./_sisu ~/.sisu or /etc/sisu (searched in that
+order, stopping on the first one found)
%% Markup
---------------
@@ -366,6 +364,8 @@ program expects to find in ./_sisu ~/.sisu or /etc/sisu
See man pages.
man sisu
+ man 8 sisu
+
Once installed there is some information on SiSU Markup in its help:
sisu --help markup
and
@@ -379,9 +379,10 @@ These are installed on the system usually at:
/usr/share/doc/sisu/sisu_markup_samples/dfsg
More markup samples are available in the package sisu-markup-samples
+ <http://www.jus.uio.no/sisu/SiSU/download.html#sisu-markup-samples>
Many more are available online off:
- http://www.jus.uio.no/sisu/SiSU/2.html
+ <http://www.jus.uio.no/sisu/SiSU/2.html>
%% Additional Things
---------------
@@ -419,4 +420,8 @@ All Rights Reserved.
* however note the License section
-
+CHANGELOG
+ ./CHANGELOG
+and see
+ <http://www.jus.uio.no/sisu/SiSU/changelog.html>
+ <http://www.jus.uio.no/sisu/SiSU/changelog_markup_samples.html>
diff --git a/Rantfile b/Rantfile
index 04063df5..f46c89ec 100644
--- a/Rantfile
+++ b/Rantfile
@@ -189,7 +189,7 @@ task :default => [:default_notice,:project]
desc "Setup/Install #{@proj[:name]} and try generate a file"
task :project=> [:setup_bin,:setup_lib,:setup_conf,:setup_share,:setup_data,:setup_man,:setup_vim,:post_install_note]
desc "Setup/Install #{@proj[:name]}"
-task :setup=> [:setup_bin, :setup_lib,:setup_conf,:setup_share,:setup_data,:post_install] #, :help]
+task :setup=> [:setup_bin, :setup_lib,:setup_conf,:setup_share,:setup_data] #, :help]
desc "Setup/Install #{@proj[:name]}: bin, lib and conf (no data)"
task :setup_base=> [:setup_bin,:setup_lib,:setup_conf,:setup_share,:setup_man,:setup_vim]
desc "Setup/Install #{@proj[:name]} bin, lib and conf (no data and no attempt to do postinstall setup)"
@@ -290,8 +290,6 @@ if File.directory?('man') #man
end
desc "Setup Note"
task :setup_note => [:help]
-desc "Note on post installation" #remove conf
-task :post_install_note => [:post_install_note]
desc "System information used by #{@proj[:name]}"
task :system => [:system_info,:project_help,:post_install_note]
desc "show all system info available - parameters found"
@@ -307,24 +305,19 @@ task :create_rant_independent_task_file => [:rant_independence]
task :rant_independence do #notice
resp=''
while resp.length < 4
- resp='install' #default name install
+ resp='sisu-install' #default name install
print %{#{@proj[:rant]}
Create a rant dependency independent file
provide filename default name is "install"
[Warning, will overwrite file of name provided
provide name or "quit" to exit]: }
- #res=File.new('/dev/tty').gets.strip
- #resp=res if res =~/\S{4,30}/
exit if resp =~/^(?:n|quit|exit)$/
end
remove='y' #remove='n'
- #remove=if FileTest.file?(resp)
- # print "a file of the same name #{resp} exists, [y] to replace: "
- # File.new('/dev/tty').gets.strip
- #else 'y'
- #end
- if remove =~/y/; system("rant-import --force --auto #{resp}\n")
- #puts "#{resp} updated"
+ if remove =~/y/
+ system("rant-import --force --auto #{resp};
+ chmod 755 #{resp}
+ ")
else #puts "#{resp} not replaced"
end
end
diff --git a/conf/sisu/sisurc.yml b/conf/sisu/sisurc.yml
index bdc20329..ab07108e 100644
--- a/conf/sisu/sisurc.yml
+++ b/conf/sisu/sisurc.yml
@@ -1,4 +1,4 @@
-# Name: SiSU - Simple information Structuring Universe - Structured information, Serialized Units
+# Name: SiSU - Simple information Structuring Universe
# Author: Ralph@Amissah.com
# Description: Site wide envionment defaults set here
# system environment info / resource configuration file, for sisu
@@ -53,8 +53,8 @@ show_output_on: 'filesystem_url'
# concord_max: 400000
#% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default)
flag:
- color: false # colour now off by default (does not suit all terms/consoles) -c is color (on/f) toggle (note: set default true/false here, if -c is added to the shortuct defaults below, then another -c added to the command line won't toggle on/off)
- default: '-mNhwpoabxXyYv' # includes verbose; -m would in any event be run by default
+ color: true # making colour default -c is toggle, and will now toggle colour off
+ default: '-NhwpoabxXyYv' # includes verbose; -m would in any event be run by default
i: '-Nhwpoayv' # includes verbose; -m run by default
ii: '-NhwpoabxXyv' # includes verbose; -m run by default
iii: '-NhwpoabxXyYv' # includes verbose; -m run by default
@@ -115,3 +115,4 @@ program_set:
# action: http://localhost:8081/cgi-bin/sisu_sqlite.cgi
## action: http://search.sisudoc.org
# db: sisu
+# title: sample search form
diff --git a/data/doc/sisu/copyright b/data/doc/sisu/copyright
index c15699c4..6b129a77 100644
--- a/data/doc/sisu/copyright
+++ b/data/doc/sisu/copyright
@@ -8,33 +8,31 @@ The original source can always be found at:
<http://www.jus.uio.no/sisu/SiSU/download>
<http://www.jus.uio.no/sisu/pkg/src>
-Copyright (C) 1997, 1998, 1999, 2000, 20001, 2002, 2003, 2004, 2005
-Ralph Amissah
+License: GPL 3 or later:
-License: GPL v3 or later
+ SiSU, a framework for document structuring, publishing and search
- GPL3 summary:
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007 Ralph Amissah
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or (at your option)
+ any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
- You should have received a copy of the GNU General Public License
- along with this package; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see <http://www.gnu.org/licenses/>.
If you have Internet connection, the latest version of the GPL should be
- available from these locations:
- <http://www.fsf.org/licenses/gpl.html>
- <http://www.gnu.org/copyleft/gpl.html>
- <http://www.jus.uio.no/sisu/gpl3.fsf>
+ available at these locations:
+ <http://www.fsf.org/licenses/gpl.html>
+ <http://www.gnu.org/copyleft/gpl.html>
+ <http://www.jus.uio.no/sisu/gpl.fsf>
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
@@ -42,7 +40,7 @@ License: GPL v3 or later
The Free Software Foundation:
<http://www.fsf.org/>
-For installation purposes the SiSU tarball includes
+For installation purposes the SiSU tarball includes:
setup.rb by Minero Aoki
@@ -52,9 +50,9 @@ Hompepage:
License:
LGPL
-and
+and
-install, an installer generated by
+sisu-install, an installer generated by
Rant which is by Stefan Lang
Homepage:
@@ -64,4 +62,4 @@ License:
LGPL
NB: Rant is not included in the SiSU tarball, and is not itself required for
- the Rant generated install file to work
+ the Rant generated install file to work, (ruby will suffice)
diff --git a/data/doc/sisu/html/sisu.1.html b/data/doc/sisu/html/sisu.1.html
index 61d0ab0d..968f8eb1 100644
--- a/data/doc/sisu/html/sisu.1.html
+++ b/data/doc/sisu/html/sisu.1.html
@@ -12,7 +12,7 @@
<b>SiSU</b> - Structured information, Serialized Units - a document
publishing system
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
-<b>sisu</b> <b>[</b> <i>-AabcDdEeFHhIMmNnopqrRSstUuVvwXxYyZz0-9</i>
+<b>sisu</b> <b>[</b> <i>-AabcDdEeFHhIMmNnopqRrSsTtUuVvwXxYyZz0-9</i>
<b>] [</b> <i>filename/</i> wildcard <b>]</b> <p>
<b>sisu</b> <b>[</b> <i>-Ddcv</i> <b>] [</b> <i>instruction</i> <b>]</b> <p>
<b>sisu</b> <b>[</b> <i>-CcFLSVvW</i>
@@ -130,37 +130,37 @@ most web servers). [behaviour switched after 0.35 see -H]. </dd>
<dt><b>-I</b><i>&nbsp;[filename/wildcard]</i>
</dt>
-<dd>produces <i>texinfo</i> file. </dd>
+<dd>produces <i>texinfo</i> and <i>info</i> file, (view with pinfo). </dd>
<dt><b>-L</b> </dt>
-<dd>prints license information. </dd>
+<dd>prints license information.
+</dd>
+
+<dt><b>-M</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
+<dd><i>maintenance</i> mode files created for processing
+preserved and their locations indicated. (also see -V) </dd>
+
+<dt><b>-m</b><i>&nbsp;[filename/wildcard/url]</i>
+</dt>
+<dd>assumed for most other flags, creates new meta-markup file, (the <i>metaverse</i>
+) that is used in all subsequent processing of other output. This step is
+assumed for most processing flags. To skip it see <i>-n</i> </dd>
+
+<dt><b>-N</b><i>&nbsp;[filename/wildcard/url]</i>
+</dt>
+<dd>document <i>digest</i> or <i>document</i> content certificate ( <i>DCC</i> ) as <i>md5</i> digest tree
+of the document: the digest for the document, and digests for each object
+contained within the document (together with information on software versions
+that produced it) (digest.txt). <i>-NV</i> for verbose digest output to screen. </dd>
+
+<dt><b>-n</b><i>&nbsp;[filename/wildcard/url]</i>
+</dt>
+<dd>skip meta-markup (building of "metaverse"), this skips the equivalent of
+<i>-m</i> which is otherwise assumed by most processing flags. </dd>
-<dt><b>-M</b><i>&nbsp;[filename/wildcard/url]</i>
+<dt><b>-o</b><i>&nbsp;[filename/wildcard/url]</i>
</dt>
-<dd><i>maintenance</i> mode files created for processing preserved and their locations
-indicated. (also see -V) </dd>
-
-<dt><b>-m</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
-<dd>assumed for most other
-flags, creates new meta-markup file, (the <i>metaverse</i> ) that is used in all
-subsequent processing of other output. This step is assumed for most processing
-flags. To skip it see <i>-n</i> </dd>
-
-<dt><b>-N</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
-<dd>document <i>digest</i> or <i>document</i>
-content certificate ( <i>DCC</i> ) as <i>md5</i> digest tree of the document: the digest
-for the document, and digests for each object contained within the document
-(together with information on software versions that produced it) (digest.txt).
-<i>-NV</i> for verbose digest output to screen. </dd>
-
-<dt><b>-n</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
-<dd>skip meta-markup
-(building of "metaverse"), this skips the equivalent of <i>-m</i> which is otherwise
-assumed by most processing flags. </dd>
-
-<dt><b>-o</b><i>&nbsp;[filename/wildcard/url]</i> </dt>
-<dd>output basic
-document in <i>opendocument</i> file format (opendocument.odt). </dd>
+<dd>output basic document in <i>opendocument</i> file format (opendocument.odt). </dd>
<dt><b>-p</b><i>&nbsp;[filename/wildcard]</i>
</dt>
@@ -1161,7 +1161,7 @@ set up, and first time must be run without other flags ie sisu <i>-mrv</i> [file
<b>sisu</b> <i>-mhwprv</i> example_file.sst other_example_file.sst <p>
to process a remote sisu
marked up file (html,pdf,concordance), provide the url(s) (works for text
-only files, will be downloaded and processed locally): <b>sisu</b> <i>-mhwpv</i> <a href='http://www.jus.uio.no/sisu/gpl3.fsf/gpl3.fsf.sst'>http://www.jus.uio.no/sisu/gpl3.fsf/gpl3.fsf.sst</a>
+only files, will be downloaded and processed locally): <b>sisu</b> <i>-mhwpv</i> <a href='http://www.jus.uio.no/sisu/sample/markup/gpl3.fsf.sst'>http://www.jus.uio.no/sisu/sample/markup/gpl3.fsf.sst</a>
http://www.jus.uio.no/sisu/sample/markup/autonomy_markup0.sst <p>
one file is local
diff --git a/data/doc/sisu/html/sisu.8.html b/data/doc/sisu/html/sisu.8.html
index b79b71b1..c6134b33 100644
--- a/data/doc/sisu/html/sisu.8.html
+++ b/data/doc/sisu/html/sisu.8.html
@@ -19,65 +19,72 @@ document publishing system, that from a simple single marked-up document,
produces a multitude of output formats including: html, latex, pdf, info,
and sql output, which can be cross referenced as having the same document
structure and text object numbering, "object citation numbering". Features
-include its&rsquo; simple syntax; the semantic identification of documents using
-the Dublin Core; document management; built to be associated with a revision
-control system; text object numbering for the identification of a texts
-location in any of the output formats, easy skinning on a site wide, or
-per document basis, ... for more see <i>man</i> 1 sisu or <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+include its&rsquo; simple syntax; the semantic tagging of documents; document
+management; built to be associated with a revision control system; text
+object numbering for the identification of a texts location in any of the
+output formats, easy skinning on a site wide, or per document basis; granular
+search; a degree of future proofing ... for more see <i>man</i> 1 sisu or <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
&gt;</i>
<p>
-<b>SiSU is an alternative way of publishing and managing documents.</b>
+<b>SiSU is a way of preparing, publishing, managing and searching documents.</b>
+
<h2><a name='sect3' href='#toc3'>Installation</a></h2>
<p>
-Up
-to date information on SiSU downloads, and their installation should be
-available from: <i>&lt;<a href='http://www.jus.uio.no/sisu/SiSU/download.html'>http://www.jus.uio.no/sisu/SiSU/download.html</a>
-&gt;</i> or at: <i>&lt;<a href='http://www.jus.uio.no/sisu/sisu_download/download.html'>http://www.jus.uio.no/sisu/sisu_download/download.html</a>
+Up to date information on SiSU downloads, and their installation
+should be available from: <i>&lt;<a href='http://www.jus.uio.no/sisu/SiSU/download.html'>http://www.jus.uio.no/sisu/SiSU/download.html</a>
+&gt;</i> or
+at: <i>&lt;<a href='http://www.jus.uio.no/sisu/sisu_download/download.html'>http://www.jus.uio.no/sisu/sisu_download/download.html</a>
+&gt;</i> <p>
+There you should
+find links to the latest source tarball, and instructions on how to install
+SiSU. <p>
+Sample marked up documents are are available at <i>/usr/share/doc/sisu/sisu_markup_samples/dfsg</i>
+or equivalent directory, or online, see <i>&lt;<a href='http://www.jus.uio.no/sisu/SiSU/2.html'>http://www.jus.uio.no/sisu/SiSU/2.html</a>
&gt;</i>
<p>
-There you should find links to the latest source tarball, and instructions
-on how to install SiSU. <p>
-Sample marked up documents are are available at
-<i>/usr/share/doc/sisu/sisu_markup_samples/dfsg</i> or equivalent directory, or
-online at <i>&lt;<a href='http://www.jus.uio.no/sisu/sample/markup.html'>http://www.jus.uio.no/sisu/sample/markup.html</a>
-&gt;</i> or for viewing in html
-with syntax highlighting from <i>&lt;<a href='http://www.jus.uio.no/sisu/sample/syntax'>http://www.jus.uio.no/sisu/sample/syntax</a>
-&gt;</i> <p>
-A syntax
-table is provided at <i>/usr/share/doc/sisu/on_markup.txt</i> or equivalent, and
-online at <i>&lt;<a href='http://www.jus.uio.no/sisu/sample/on_markup.txt'>http://www.jus.uio.no/sisu/sample/on_markup.txt</a>
-&gt;</i> <p>
-<i>man</i> 1 sisu has a
-syntax table along with processing commands. <p>
-SiSU also provides some help
-via the command: <i>sisu</i> --help and selecting an appropriate subject, e.g. <p>
-<i>sisu</i>
---help commands <p>
+<i>man</i> 1 sisu has a syntax table along with processing commands. <p>
+SiSU also
+provides some help via the command: <i>sisu</i> --help and selecting an appropriate
+subject, e.g. <p>
+<i>sisu</i> --help commands <p>
<i>sisu</i> --help markup <p>
<i>sisu</i> --help headers <p>
-<i>sisu</i> --help env <p>
-The rest
-of this note is on post installation setup
-<h2><a name='sect4' href='#toc4'>Post Installation Setup - Quick
-start</a></h2>
-<p>
-After installation of sisu-complete, move to the document samples directory
+<i>sisu</i>
+--help env <p>
+The rest of this note is on post installation setup
+<h2><a name='sect4' href='#toc4'>Post Installation
+Setup - Quick start</a></h2>
<p>
+
+<p> After installation of sisu-complete, move to the document
+samples directory, <p>
cd /usr/share/doc/sisu/sisu_markup_samples/dfsg<br>
<p>
-and run <p>
- sisu -1 free_as_in_freedom.rms_and_free_software.sam_williams.sst<br>
- <p>
+[this is not where you would normally work but provides sample documents
+for testing, you may prefer instead to copy the contents of that directory
+to a local directory before proceeding] <p>
+and in that directory, initialise
+the output directory with the command <p>
+<i>sisu</i> -CC <p>
+then run: <p>
+<i>sisu</i> -1 free_as_in_freedom.rms_and_free_software.sam_williams.sst
+<p>
or the same: <p>
- sisu -NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst<br>
- <p>
+<i>sisu</i> -NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst
+<p>
look at output results, see the "sisu_manifest" page created for the document
<p>
-To generate an online document move to a writable directory, (create a
-work directory and cd into it) as the file will be downloaded there and
-e.g. <p>
+for an overview of your current sisu setup, type: <p>
+<i>sisu</i> --help env <p>
+or <p>
+<i>sisu</i>
+-V <p>
+To generate a document from a remote url accessible location move to
+a writable directory, (create a work directory and cd into it) as the file
+will be downloaded there and e.g. <p>
<i>sisu</i> -1 <a href='http://www.jus.uio.no/sisu/gpl3.fsf/gpl3.fsf.sst'>http://www.jus.uio.no/sisu/gpl3.fsf/gpl3.fsf.sst</a>
- <p>
+
+<p>
<i>sisu</i> -3 <a href='http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst'>http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/free_culture.lawrence_lessig.sst</a>
<p>
@@ -140,39 +147,76 @@ gives an idea of additional packages that SiSU can make use of if available,
(the use/requirement of some of which are interdependent for specific actions
by SiSU): <p>
Package: sisu <p>
-Depends: ruby (&gt;= 1.8.4), libwebrick-ruby <p>
+Depends: ruby (&gt;= 1.8.2), libwebrick-ruby, unzip, zip
+<p>
+Conflicts: vim-sisu, sisu-vim, sisu-remote <p>
+Replaces: vim-sisu, sisu-vim <p>
Recommends:
-sisu-pdf, sisu-sqlite, sisu-postgresql, librmagick-ruby, trang, tidy, librexml-ruby,
-zip, unzip, openssl, rsync, openssh-client lsh-client,<br>
- keychain, hyperestraier, kdissert<br>
- <p>
-Suggests: libfcgi-ruby1.8, rcs cvs, lv, texinfo, pinfo, rename <p>
-Package:
-sisu-complete <p>
-Depends: ruby (&gt;= 1.8.4), sisu, sisu-pdf, sisu-postgresql, sisu-sqlite
+sisu-pdf, sisu-sqlite, sisu-postgresql, librmagick-ruby, trang, tidy, librexml-ruby,
+openssl, rsync, openssh-client lsh-client, keychain, hyperestraier, kdissert
+Suggests: rcs cvs, lv, texinfo, pinfo <p>
+Package: sisu-complete <p>
+Depends: ruby
+(&gt;= 1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-sqlite <p>
+Recommends: hyperestraier
<p>
-Recommends: hyperestraier <p>
Package: sisu-pdf <p>
-Depends: sisu, tetex-bin texlive-base-bin,
-tetex-extra texlive-latex-extra, texlive-latex-extra, latex-ucs<br>
- <p>
+Depends: sisu, texlive-latex-base, texlive-fonts-recommended,
+texlive-latex-recommended, texlive-latex-extra <p>
Suggests: evince, xpdf <p>
-Package: sisu-postgresql <p>
-Depends: sisu, postgresql-8.1,
-libdbi-ruby, libdbm-ruby, libdbd-pg-ruby <p>
-Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1
+Package:
+sisu-postgresql <p>
+Depends: sisu, libdbd-pg-ruby, libdbi-ruby, libdbm-ruby, postgresql
<p>
+Recommends: libfcgi-ruby <p>
Package: sisu-sqlite <p>
-Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
+Depends: sisu, sqlite, libdbd-sqlite-ruby,
+libdbi-ruby, libdbm-ruby <p>
+Recommends: libfcgi-ruby <p>
+Package: sisu-markup-samples
<p>
-Suggests: libdbd-sqlite <p>
-Package: sisu-markup-samples <p>
Depends: sisu <p>
+
+<h2><a name='sect6' href='#toc6'>Package Description</a></h2>
+<b>sisu</b> <p>
+Description: documents - structuring,
+publishing in multiple formats and search <p>
+SiSU is a lightweight markup
+based, command line oriented, document structuring, publishing and search
+framework for document collections. <p>
+With minimal preparation of a plain-text,
+(UTF-8) file, using its native markup syntax in your text editor of choice,
+SiSU can generate various document formats (most of which share a common
+object numbering system for locating content), including plain text, HTML,
+XHTML, XML, OpenDocument text (ODF:ODT), LaTeX, PDF files, and populate
+an SQL database with objects (roughly paragraph-sized chunks) so searches
+may be performed and matches returned with that degree of granularity:
+your search criteria is met by these documents and at these locations within
+each document. Object numbering is particularly suitable for "published"
+works (finalized texts as opposed to works that are frequently changed
+or updated) for which it provides a fixed means of reference of content.
+Document outputs also share semantic meta-data provided. <p>
+SiSU also provides
+concordance files, document content certificates and manifests of generated
+output. <p>
+A vim syntax highlighting file and an ftplugin with folds for sisu
+markup is provided, as are syntax highlighting files for kate, kwrite,
+gedit and diakonos. Vim 7 includes syntax highlighting for SiSU. <p>
+man pages,
+and interactive help are provided. <p>
+Dependencies for various features are
+taken care of in sisu related packages. The package sisu-complete installs
+the whole of SiSU. <p>
+Additional document markup samples are provided in the
+package sisu-markup-samples which is found in the non-free archive the licenses
+for the substantive content of the marked up documents provided is that
+provided by the author or original publisher. <p>
+Homepage: &lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
+&gt;
</pre>
-<h2><a name='sect6' href='#toc6'>Document
-Resource Configuration</a></h2>
-<b>sisu</b> resource configuration information is obtained
-from sources (where they exist): <br>
+<h2><a name='sect7' href='#toc7'>Document Resource Configuration</a></h2>
+<b>sisu</b> resource configuration information
+is obtained from sources (where they exist): <br>
<pre>~/.sisu/sisurc.yaml/etc/sisu/[sisu version]/sisurc.yamlsisu program defaults</pre><p>
<b>Skins</b> <p>
@@ -190,16 +234,16 @@ of documents. <p>
Usually all skin files are placed in the document skin directory:
<i>~/.sisu/skin/doc</i> with softlinks being made to the skins contained there
from other skin directories as required.
-<h2><a name='sect7' href='#toc7'>Further Information</a></h2>
+<h2><a name='sect8' href='#toc8'>Further Information</a></h2>
<p>
For more information
on <i>SiSU</i> see: <i>&lt;<a href='http://www.jus.uio.no/sisu'>http://www.jus.uio.no/sisu</a>
&gt;</i> <p>
or <i>man</i> sisu
-<h2><a name='sect8' href='#toc8'>Author</a></h2>
+<h2><a name='sect9' href='#toc9'>Author</a></h2>
Ralph Amissah <i>&lt;ralph@amissah.com&gt;</i>
or <i>&lt;ralph.amissah@gmail.com&gt;</i>
-<h2><a name='sect9' href='#toc9'>See Also</a></h2>
+<h2><a name='sect10' href='#toc10'>See Also</a></h2>
<a href='http:~/bin/man2html?sisu:1'><b>sisu(1)</a>
,</b> <a href='http:~/bin/man2html?sisu_examples:1'><b>sisu_examples(1)</a>
,</b> <a href='http:~/bin/man2html?sisu_webrick:1'><b>sisu_webrick(1)</a>
@@ -219,10 +263,11 @@ or <i>&lt;ralph.amissah@gmail.com&gt;</i>
<li><a name='toc3' href='#sect3'>Installation</a></li>
<li><a name='toc4' href='#sect4'>Post Installation Setup - Quick start</a></li>
<li><a name='toc5' href='#sect5'>Debian INSTALLATION Note</a></li>
-<li><a name='toc6' href='#sect6'>Document Resource Configuration</a></li>
-<li><a name='toc7' href='#sect7'>Further Information</a></li>
-<li><a name='toc8' href='#sect8'>Author</a></li>
-<li><a name='toc9' href='#sect9'>See Also</a></li>
+<li><a name='toc6' href='#sect6'>Package Description</a></li>
+<li><a name='toc7' href='#sect7'>Document Resource Configuration</a></li>
+<li><a name='toc8' href='#sect8'>Further Information</a></li>
+<li><a name='toc9' href='#sect9'>Author</a></li>
+<li><a name='toc10' href='#sect10'>See Also</a></li>
</ul>
</body>
</html>
diff --git a/lib/sisu/v0/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb
index e5260a5f..0032a927 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 << 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
+ 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
a=%{ generated sisu_pgsql.cgi,
BASED ON ALREADY EXISTING directories that could potentially be used to populate postgresql db, (-D)
}
@@ -139,8 +139,8 @@ module SiSU_CGI_pgsql
def search_statement
<<-'WOK_SQL'
class Dbi_search_string
- def initialize(l,t,q)
- @l,@t,@q=l,t,q
+ def initialize(l,t,q,cse=false)
+ @l,@t,@q,@c=l,t,q,cse
end
def string
search={ :search => [],:flag => false }
@@ -149,8 +149,13 @@ module SiSU_CGI_pgsql
elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q)
end
search_construct=[]
- unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~\( '")
- unescaped_search.gsub!(/(.+)/,"#@l~\( '\\1' \)")
+ if @c
+ unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~\( '")
+ unescaped_search.gsub!(/(.+)/,"#@l~\( '\\1' \)")
+ else
+ unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~*\( '")
+ unescaped_search.gsub!(/(.+)/,"#@l~*\( '\\1' \)")
+ end
search_construct << unescaped_search
search_construct=search_construct.join(' ')
search[:search] << search_construct
@@ -162,9 +167,6 @@ module SiSU_CGI_pgsql
end
WOK_SQL
end
- def buttons_note
- ' <font size="2" color="#666666">case sensitive</font>'
- end
def search_query1
<<-'WOK_SQL'
@search_text,@search_endnotes=[],[]
@@ -183,7 +185,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, metadata.filename, documents.ocn}
@sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
select=@sql_statement[:body] + ' ' + @sql_statement[:range]
select
@@ -191,7 +193,7 @@ module SiSU_CGI_pgsql
def sql_select_endnotes
limit ||=@@limit
offset ||=@@offset
- @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, endnotes.nr}
+ @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr}
@sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range]
select
@@ -211,6 +213,12 @@ module SiSU_CGI_pgsql
end
WOK_SQL
end
+ def buttons2_pgsql
+ <<-'WOK_SQL'
+ <font size="2" color="#222222">
+ <input type="checkbox" name="casesense" #@checked_case> case sensitive
+ WOK_SQL
+ end
def dbi_connect
<<-'WOK_SQL'
dbi="dbi:Pg:database=#{@db};port=#{@port}"
diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb
index 6045bf10..37ca67b8 100644
--- a/lib/sisu/v0/cgi_sql_common.rb
+++ b/lib/sisu/v0/cgi_sql_common.rb
@@ -131,11 +131,11 @@ 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_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_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can='')
search_note='' if checked_searched !~/\S/
the_can='' if checked_url !~/\S/
search_field='' if checked_echo !~/\S/
- @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can
+ @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
@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 ''
@@ -205,8 +205,13 @@ module SiSU_CGI_sql
#@tip
#@search_note
#@the_can
- </td></tr></table><table><tr><td>
- <font size="2" color="#222222">
+ </td></tr></table>
+ <table><tr><td>
+ WOK_SQL
+ end
+ def buttons3
+ <<-'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
@@ -319,106 +324,109 @@ module SiSU_CGI_sql
<<-'WOK_SQL'
class Dbi_search_statement
attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit
- def initialize(conn,search_for,q)
+ def initialize(conn,search_for,q,c)
@conn=conn
@text_search_flag=false
@sql_statement={ :body=>'',:endnotes=>'',:range=>'' }
#@offset||=@@offset
#@offset+=@@limit
search={ :text => [],:endnotes => [] }
- st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1']).string
- se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1']).string
+ cse=if c =~/\S/; true
+ else false
+ end
+ st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string
+ se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string
@text_search_flag=st[:flag]
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << se[:search]
end
- st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key']).string
+ st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.title',search_for.title,q['ti']).string
+ st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.creator',search_for.author,q['au']).string
+ st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj']).string
+ st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc']).string
+ st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb']).string
+ st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr']).string
+ st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.date',search_for.date,q['dt']).string
+ st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.type',search_for.type,q['ty']).string
+ st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id']).string
+ st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.source',search_for.source,q['src']).string
+ st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.language',search_for.language,q['lang']).string
+ st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel']).string
+ st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov']).string
+ st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr']).string
+ st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co']).string
+ st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab']).string
+ st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
end
- st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns']).string
+ st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string
if st[:flag]
search[:text] << st[:search]
search[:endnotes] << st[:search]
@@ -479,32 +487,99 @@ module SiSU_CGI_sql
WOK_SQL
end
def tail
+ v=SiSU_Env::Info_version.new.get_version
<<-WOK_SQL
def tail
<<-'WOK'
<br /><hr /><br />
- <center><table align="center"bgcolor="#ffffff"><tr><td><font color="#666666"><table summary="" bgcolor="#ffffff" cellpadding="4" border="0" align="center">
-
- <tr align="center">
- <td align="center"><p class="center"><font color="#666666" size="2">
- presentations' look and feel<br />
- generated by<br />
- <a href="http://www.jus.uio.no/sisu" ><img border="0" src="#@image_src/sisu.png" alt="SiSU in Ruby with the usual GPL (or OSS) suspects - Way Better!" width="120" height="38"></a><br />
- <a href="http://www.jus.uio.no/sisu" >SiSU</a><br />
- version 0.50<br />2007w11/1 (2007-03-12)<br />
-
- <table summary="SiSU rights" bgcolor="#ffffff" cellpadding="4" border="0" align="center" width="40%">
- <sup>&copy;</sup> Ralph Amissah<br />
- 1993, current 2007<br />
- GPL 3<br />
- <i>w3 since October 3 1993</i><br />
- <a href="mailto://ralph@amissah.com" >ralph@amissah.com</a><br />
- </font></p>
- </td></tr></table>
-
- <p><center><font color="#666666" size="2">the usual GPL (or OSS) suspects:<br />Better - "performance, reliability, scalability, security<br />& total cost of ownership"<br /><i>[not to mention flexibility &amp; choice]</i><br /><br />&lt;&lt;<a href="http://www.jus.uio.no/sisu/">Way Better!</a>&gt;&gt;</font></center></p><tr align="center"><td align="center">
-
- </font></center></td></tr></table></center> <a name="bottom" id="bottom"></a><a name="down" id="down"></a><a name="end" id="end"></a><a name="finish" id="finish"></a><a name="stop" id="stop"></a><a name="credits" id="credits"></a>
+<table summary="SiSU summary" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+ <!-- widget way better -->
+<tr><td valign="top" width="10%">
+ <p class="tiny_left"><font color="#666666" size="2">
+
+ <a href="http://www.gnu.org/licenses/gpl.html">
+ <img border="0" src="#@image_src/gplv3_free_software.png" alt="GPLv3" width="127" height="51" />
+ </a>
+ </font></p>
+</td><td valign="top" width="45%">
+ <p class="tiny_left"><font color="#666666" size="2">
+ <b>SiSU</b> <sup>&copy;</sup> Ralph Amissah
+ 1993, current 2007
+ All Rights Reserved.
+ <br />
+ <b>SiSU is released under
+ <a href="http://www.gnu.org/licenses/gpl.html">GPL v3</a>
+ or later</b>
+ <a href="http://www.gnu.org/licenses/gpl.html">
+ http://www.gnu.org/licenses/gpl.html
+ </a>
+ </font></p>
+</td><td valign="top" width="45%">
+ <p class="tiny_left"><font color="#666666" size="2">
+ Developed using
+ <a href="http://www.ruby-lang.org/en/">
+ Ruby
+ </a>
+ on
+ <a href="http://www.debian.org/">
+ Debian/Gnu/Linux
+ </a>
+ software infrastructure,
+ &amp; with the usual GPL (or OSS) suspects.
+ <br />
+ Better - "performance, reliability, scalability, security &amp; total cost of ownership"
+ [not to mention flexibility &amp; choice]
+ <br />
+ Get With the Future
+ <a href="http://www.jus.uio.no/sisu/">
+ Way Better!
+ </a>
+ </font></p>
+</td></tr>
+ <!-- widget sisu -->
+<tr><td valign="top" width="10%">
+ <p class="tiny_left"><font color="#666666" size="2">
+ <a href="http://www.jus.uio.no/sisu" >
+ <img border="0" src="#@image_src/sisu.png" alt="SiSU" width="120" height="39" />
+ </a>
+ </font></p>
+</td><td valign="top" width="45%">
+<!-- SiSU Rights -->
+ <p class="tiny_left"><font color="#666666" size="2">
+ Generated by
+ <a href="http://www.jus.uio.no/sisu" >
+ SiSU
+ </a>
+ #{v[:project]} #{v[:version]} #{v[:date]} (#{v[:date_stamp]})
+ <br />
+ <a href="http://www.jus.uio.no/sisu" >
+ www.jus.uio.no/sisu
+ </a>
+ and
+ <a href="http://www.sisudoc.org" >
+ www.sisudoc.org
+ </a>
+ <br />
+ <br />
+ <i>w3 since October 3 1993</i>
+ <a href="mailto://ralph@amissah.com" >
+ ralph@amissah.com
+ </a>
+ </font></p>
+</td><td valign="top" width="45%">
+ <p class="tiny_left"><font color="#666666" size="2">
+ Using:
+ <br />Standard SiSU markup syntax,
+ <br />Standard SiSU meta-markup syntax, and the
+ <br />Standard SiSU <u>object citation numbering</u> and system, (object/text positioning system)
+ <br />
+ <sup>&copy;</sup> Ralph Amissah 1997, current 2007.
+ All Rights Reserved.
+ </font></p>
+</td></tr>
+</table>
+ <a name="bottom" id="bottom"></a><a name="down" id="down"></a><a name="end" id="end"></a><a name="finish" id="finish"></a><a name="stop" id="stop"></a><a name="credits" id="credits"></a>
</body></html>
WOK
end
@@ -526,13 +601,14 @@ module SiSU_CGI_sql
@stub='sisu'
'SiSU_sisu'
end
- checked_url,checked_searched,checked_tip,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,selected_db='','','','','','','',''
+ checked_url,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,selected_db='','','','','','','','',''
if cgi['view']=~/text/; checked_index,checked_text='','checked'
else checked_index,checked_text='checked',''
end
checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1
checked_searched='checked' if cgi['searched'] =~/\S/
checked_tip='checked' if cgi['tip'] =~/\S/
+ checked_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
@@ -580,8 +656,13 @@ module SiSU_CGI_sql
"#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1"
else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1"
end
- @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
- @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
+ if checked_case=~/\S/
+ @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1
+ @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1
+ else
+ @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1
+ @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1
+ end
canned_note='previous search url:'
else
@@canned_search_url="#@base?s1=United+Nations&db=documents&view=index"
@@ -635,7 +716,7 @@ module SiSU_CGI_sql
WOK
#eg = %{canned search e.g.:<br /> <a href="#{url}">#{url}</a><br />find: #{analyze}<br />database: #{database}}
#dbi_canning
- @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form
+ @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
unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
print "Content-type: text/html\n\n"
puts (@header+@tail)
@@ -644,10 +725,15 @@ module SiSU_CGI_sql
@search_for.text1
else 'Unavailable'
end
- @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
- @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
+ if checked_case=~/\S/
+ @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'}
+ @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'}
+ else
+ @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'}
+ @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'}
+ end
#dbi_request
- dbi_statement=Dbi_search_statement.new(@conn,@search_for,q)
+ dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case)
@text_search_flag=false
@text_search_flag=dbi_statement.text_search_flag
s_contents=dbi_statement.contents
@@ -710,7 +796,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)/,%{<span style="background-color: #@color_match">\\1</span>}))
end
matched
else c['body']
diff --git a/lib/sisu/v0/cgi_sqlite.rb b/lib/sisu/v0/cgi_sqlite.rb
index 1113403a..4565ebe2 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 << 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 << buttons3 << 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)
}
@@ -134,12 +134,11 @@ module SiSU_CGI_sqlite
def search_statement
<<-'WOK_SQL'
class Dbi_search_string
- def initialize(l,t,q)
+ def initialize(l,t,q,cse=false)
@l,@t,@q=l,t,q
end
def string
- search={ :search => [] }
- search[:flag]=false
+ search={ :search => [],:flag => false }
if @t =~/\S+/ or @q =~/\S+/
if @t =~/\S+/; unescaped_search=CGI.unescape(@t)
elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q)
@@ -176,7 +175,7 @@ module SiSU_CGI_sqlite
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, metadata.filename, documents.ocn}
@sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
select=@sql_statement[:body] + ' ' + @sql_statement[:range]
select
@@ -184,7 +183,7 @@ module SiSU_CGI_sqlite
def sql_select_endnotes
limit ||=@@limit
offset ||=@@offset
- @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, endnotes.nr}
+ @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr}
@sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;}
select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range]
select
diff --git a/lib/sisu/v0/docbook.rb b/lib/sisu/v0/docbook.rb
deleted file mode 100644
index 6324cc28..00000000
--- a/lib/sisu/v0/docbook.rb
+++ /dev/null
@@ -1,567 +0,0 @@
-=begin
-
- * Name: SiSU
-
- * Description: a framework for document structuring, publishing and search
-
- * Author: Ralph Amissah
-
- * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007 Ralph Amissah All Rights Reserved.
-
- * License: GPL 3 or later:
-
- SiSU, a framework for document structuring, publishing and search
-
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007 Ralph Amissah
-
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program. If not, see <http://www.gnu.org/licenses/>.
-
- If you have Internet connection, the latest version of the GPL should be
- available at these locations:
- <http://www.fsf.org/licenses/gpl.html>
- <http://www.gnu.org/copyleft/gpl.html>
- <http://www.jus.uio.no/sisu/gpl.fsf>
-
- * SiSU uses:
- * Standard SiSU markup syntax,
- * Standard SiSU meta-markup syntax, and the
- * Standard SiSU object citation numbering and system
-
- * Hompages:
- <http://www.jus.uio.no/sisu>
- <http://www.sisudoc.org>
-
- * Download:
- <http://www.jus.uio.no/sisu/SiSU/download.html>
-
- * Ralph Amissah
- <ralph@amissah.com>
- <ralph.amissah@gmail.com>
-
- ** Description: docbook, ... not developed
-
-=end
-module SiSU_Docbook
- require "#{SiSU_lib}/defaults"
- require "#{SiSU_lib}/param"
- include SiSU_Param
- include SiSU_Viz
- require "#{SiSU_lib}/sysenv"
- include SiSU_Env
- require "#{SiSU_lib}/dal"
- require "#{SiSU_lib}/shared_xml"
- require "#{SiSU_lib}/xml_format"
- include SiSU_XML_format
- include SiSU_XML_munge
- require "#{SiSU_lib}/rexml"
- include SiSU_Rexml
- @@alt_id_count,@@tablehead,@@number_of_cols=0,0,0
- @@tablefoot=''
- class Source
- def initialize(opt)
- @opt=opt
- end
- def read
- begin
- @md=SiSU_Param::Parameters.new(@opt).get
- @env=SiSU_Env::Info_env.new(@opt.fns)
- path=@env.path.output_tell
- loc=@env.url.output_tell
- tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:docbook]}\n\t#{@env.program.xml_viewer} #{path}/#{@md.fnb}/#{@md.fn[:docbook]}"
- elsif @opt.cmd =~/v/; "#{@env.program.web_browser} #{loc}/#{@md.fnb}/#{@md.fn[:docbook]}"
- else ''
- end
- tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',tool)
- tell.colorize unless @opt.cmd =~/q/
- tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output_tell}/#{@md.fnb}/#{@md.fn[:docbook]}")
- tell.flow if @opt.cmd =~/[MV]/
- @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
- SiSU_Docbook::Source::Songsheet.new(@dal_array,@md,@env).songsheet
- rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
- ensure #file closed in songsheet
- end
- end
- private
- class Songsheet
- def initialize(data,md='',dir='')
- @data,@md,@env=data,md,dir
- end
- def songsheet
- begin
- SiSU_Docbook::Source::Scroll.new(@data,@md).songsheet
- SiSU_Docbook::Source::Tidy.new(@md,@env).xml if @md.cmd =~/[vVM]/i # test wellformedness, comment out when not in use
- SiSU_Rexml::Rexml.new(@md,@md.fn[:docbook]).xml if @md.cmd =~/M/ # test rexml parsing, comment out when not in use #debug
- rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
- ensure
- end
- end
- end
- class Scroll
- Heading,Heading_close,Contents=[],[],[]
- Heading[0]='part'
- Heading[1]='part level="1"'
- Heading[2]='part level="2"'
- Heading[3]='part level="3"'
- Heading_close[1]=Heading[0]
- Heading_close[2]=Heading[0]
- Heading_close[3]=Heading[0]
- #Contents[0]='preface'
- Contents[1]='chapter'
- Contents[2]='sect1'
- Contents[3]='sect2'
- @@xml={ :body=>[],:open=>[],:close=>[],:head=>[],:sc=[] }
- @@dp=nil
- require "#{SiSU_lib}/shared_txt"
- include SiSU_text_utils
- def initialize(data='',md='')
- @data,@md=data,md
- @vz=SiSU_Env::Get_init.instance.skin
- @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
- @regx=/^(?:(?:<:p[bn]>\s*)?\d~(?:(\S+))?\s+)?(.+?)\s*<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
- @tab="\t"
- @trans=SiSU_XML_munge::Trans.new(@md)
- @sys=SiSU_Env::System_call.new
- end
- def songsheet
- pre
- markup
- post
- publish
- end
- protected
- def xml_markup(para='')
- para.gsub!(/~\{(\d+)\s+(.+?)\s*<#@dp>\}~/,
- '<footnote><para>\1 \2</para></footnote> ')
- end
- def xml_head(meta)
- txt=meta.text
- txt.gsub!(/<br(?: \/)?>/,'')
- txt.gsub!(/ & /,' and ')
- @@xml[:head] <<=if meta.type == 'meta'
- <<WOK
-#{@tab}<#{meta.el}>
-#{@tab*2}#{txt}
-#{@tab}</#{meta.el}>
-WOK
- else ''
- end
- end
- def xml_sc(md='')
- sc=if @md.sc_info
- <<WOK
- <source_control>
- <sc class="sourcefile">
- #{@md.sc_filename}
- </sc>
- <sc class="number">
- #{@md.sc_number}
- </sc>
- <sc class="date">
- #{@md.sc_date}
- </sc>
- </source_control>
-WOK
- else ''
- end
- @@xml[:sc]=sc
- end
- def xml_element(lv='',ocn='',para='',hname='',tag='',xml_element='')
- lv=lv.to_i
- n=lv - 1
- n1=lv
- n2=lv + 1
- n3=lv + 2
- v=lv - 3
- tag=''
- tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname
- @@xml[:body] <<<<WOK
-#{@tab*n}#{xml_element}
-#{@tab*n1}<title>#{para[@regx, 2]}</title>
-WOK
- if lv == 4
- @copen[1]=true
- @copen[2]=@copen[3]=false
- elsif lv == 5
- @copen[2]=true
- @copen[3]=false
- elsif lv == 6
- @copen[3]=true
- end
- end
- def xml_structure(lv='',ocn='',para='',hname='' )
- lv=lv.to_i
- n=lv - 1
- n1=lv
- n2=lv + 1
- n3=lv + 2
- v=lv - 3
- tag=''
- tag="\n#{@tab*n3}<nametag>#{hname}</nametag>\n" if hname !=nil
- #if para[@regx]
- # paragraph="#{para[@regx, 2]}"
- # util=SiSU_text_utils::Paragraph.new(paragraph, 70)
- # wrapped=util.line_wrap
- #end
- case lv
- when 1..3
- xml_element="<#{Heading[lv]}>"
- 3.downto(lv) do |x|
- y=x - 1
- @cont[1]=false if @cont[1]
- @cont[2]=false if @cont[2]
- @cont[3]=false if @cont[3]
- ####### attempt to close contents
- if @copen[3] # 6~
- [3,2,1].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- @copen[1]=@copen[2]=@copen[3]=false
- elsif @copen[2] # 5~
- [2,1].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- @copen[1]=@copen[2]=@copen[3]=false
- elsif @copen[1] # 4~
- [1].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- @copen[1]=@copen[2]=@copen[3]=false
- end
- @@xml[:body] << "#{@tab*y}</#{Heading_close[x]}>\n" if @level[x]
- @level[x]=false
- end
- when 4..6
- 6.downto(lv) do |x|
- y=x - 1
- if @level[x] == true
- u=x - 3;
- @xml_contents_close[x]=''
- end
- end
- cv=lv - 3
- if para =~/^4~\S+/
- m=/^4~(\S+)/.match(para)[1]
- id=if m =~/^\d+$/; 'ch' + m
- else 'ch_' + m
- end
- elsif para =~/^5~\S+/
- m=/^5~(\S+)/.match(para)[1]
- id= 'sec_' + m
- elsif para =~/^6~\S+/
- m=/^6~(\S+)/.match(para)[1]
- id= 'subsec_' + m
- else ''
- end
- xml_element=%{<#{Contents[cv]} id="#{id}">} #hmmm gsub were it possible
- case lv
- when 4
- if @copen[3] == true # 6~
- [3,2,1].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- elsif @copen[2] == true # 5~
- [2,1].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- elsif @copen[1] == true # 4~
- [1].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- end
- @cont[1]=true
- when 5
- if @copen[3] == true #6~
- [3,2].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- elsif @copen[2] == true #5~
- [2].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n"
- end
- end
- @cont[2]=true
- when 6
- [3].each do |v|
- @@xml[:body] << "#{@tab*n}</#{Contents[v]}>\n" if @copen[3] #watch should possibly be outside...
- end
- @cont[3]=true
- end
- end
- xml_element(lv,ocn,para,hname,tag,xml_element)
- @level[lv]=true
- ((lv+1)..6).each { |x| @level[x]=false }
- end
- def group_structure(para='',ocn='')
- para.gsub!(/<:group(?:-end)?>/,'')
- para.strip!
- @@xml[:body] << %{#{@tab*7}<para class="group">#{@tab*1}\n}
- @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
- @@xml[:body] << %{#{@tab*7}</para>\n}
- end
- def poem_structure(para='',ocn='')
- para.gsub!(/<:verse(?:-end)?>/,'')
- para.strip!
- @@xml[:body] << %{#{@tab*7}<para class="verse">#{@tab*1}\n}
- @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
- @@xml[:body] << %{#{@tab*7}</para>\n}
- end
- def code_structure(para='',ocn='')
- para.gsub!(/<:code(?:-end)?>/,'')
- para.strip!
- @@xml[:body] << %{#{@tab*7}<para class="code">#{@tab*1}\n}
- @@xml[:body] << %{#{@tab*8}#{para}#{@tab*1}\n}
- @@xml[:body] << %{#{@tab*7}</para>\n}
- end
- #def table_structure(table='',ocn='') #tables
- # @@xml[:body] << %{#{@tab*1}#{table}\n#{@tab*1}\n} # unless lv # main text, contents, body KEEP #{ocn}
- # @endnotes=[]
- #end
- def tidywords(wordlist)
- wordlist.each do |x|
- x.gsub!(/&/,'&amp;') unless x =~/&\S+;/
- end
- end
- def markup
- data=@data
- dir=SiSU_Env::Info_env.new(@md.fns)
- xml_sc(@md)
- @rcdc=false
- @level,@cont,@copen,@xml_contents_close=[],[],[],[]
- (0..6).each { |x| @cont[x]=@level[x]=false }
- (4..6).each { |x| @xml_contents_close[x]='' }
- data.each do |para|
- wordlist=para.scan(/\S+|\n/) #\n needed for tables, check though added 2005w17
- para=tidywords(wordlist).join(' ').strip
- para.gsub!(/<[-~]#>/,'')
- para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'')
- para.gsub!(/<:pb>\s*/,'')
- para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|ftp):\/\/\S+|image)/,
- %{<imagedata fileref="#{dir.url.images_local}\/\\1"/>})
- #para.gsub!(/\{(\S+?\.png) \d+x\d+ \".+?\" \}(?:http:\/\/\S+|image)/,'<image>\1</image>')
- para.gsub!(/&nbsp;/,' ')
- @trans.char_enc.utf8(para) if @sys.locale =~/utf-?8/i #% utf8
- if para =~/^0~(\S+)\s+(.+?)\Z/m # for headers
- d_meta=SiSU_text_utils::Header_scan.new(@md,para).meta
- if d_meta; xml_head(d_meta)
- end
- end
- @rcdc=true if @rcdc ==false and (para =~/^\d~metadata/ or para =~/^1~\s+Document Information/)
- if para !~/(^0~|<ENDNOTES>|<EOF>)/
- if para =~/.+?<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
- paranum=para[@regx, 3]
- @p_num=SiSU_XML_format::Paragraph_number.new(@md,paranum)
- end
- @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para_ocn
- ### problem in scroll, it appears tables are getting paragraph numbers
- unless @rcdc
- m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
- if para =~m
- format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
- case @sto.format
- when /^(1)~(?:(\S+))?/
- xml_markup(para)
- xml_structure($1,@sto.ocn,para,$2)
- para=@sto.lev_para_ocn.heading_body1
- when /^(2)~(?:(\S+))?/
- xml_markup(para)
- xml_structure($1,@sto.ocn,para,$2)
- para=@sto.lev_para_ocn.heading_body2
- when /^(3)~(?:(\S+))?/
- xml_markup(para)
- xml_structure($1,@sto.ocn,para,$2)
- para=@sto.lev_para_ocn.heading_body3
- when /^(4)~(\S+)/ # work on see SiSU_text_parts::Split_text_object
- xml_markup(para)
- xml_structure($1,@sto.ocn,para,$2)
- para=@sto.lev_para_ocn.heading_body4
- when /^(5)~(?:(\S+))?/
- xml_markup(para)
- xml_structure($1,@sto.ocn,para,$2)
- para=@sto.lev_para_ocn.heading_body5
- when /^(6)~(?:(\S+))?/
- xml_markup(para)
- xml_structure($1,@sto.ocn,para,$2)
- para=@sto.lev_para_ocn.heading_body6
- #when /^(i1)$/
- # #format_scroll.gsubBody
- # #para=@sto.lev_para_ocn.scrIndent1
- #when /^(i2)$/
- # format_scroll.gsubBody
- # para=@sto.lev_para_ocn.scrIndent2
- #when /^(center)$/
- # para.gsub!(/(.+)/,
- # %{<center>(\\1)</center>})
- # para=@sto.lev_para_ocn.scrPara
- #when /^(b|bold)$/
- # para.gsub!(/(.+)/,
- # %{<b>(\\1)</b>})
- # para=@sto.lev_para_ocn.scrPara
- #when /null/ # see whether u can improve
- # if (para !~/#{@margin.txt_0}|#{@margin.txt_1}|#{@margin.txt_2}/)
- # #format_scroll.gsubBody
- # #para=@sto.lev_para_ocn.scrPara
- # end
- else
- matched=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/mi.match(para)
- stamp,ocn=matched[0],matched[1]
- if para =~ /<:verse>/
- para.gsub!(/#{stamp}/,'')
- poem_structure(para,ocn)
- elsif para =~ /<:group>/
- para.gsub!(/#{stamp}/,'')
- group_structure(para,ocn)
- elsif para =~ /<:code>/
- para.gsub!(/#{stamp}/,'')
- code_structure(para,ocn)
- elsif para =~/<!Th?.+/ # tables come as single block #work area 2005w13
- table=SiSU_Tables::Table_xml.new(para,ocn)
- para=table.table_split
- @@xml[:body] << para
- #@@xml[:body] << table_structure(para,ocn)
- else #xml_structure(para, nil, nil, nil)
- xml_markup(para)
- @@xml[:body] << "#{@tab*7}<para>#{para[@regx, 2]}</para>\n" if para[@regx, 2] # main text, contents, body KEEP ocn = #{para[@regx, 3]} == #{ocn}
- end
- end
- elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
- #format_scroll=MonoSiSU.new('<br /><a name="notes">Note</a>')
- #para=format_scroll.boldPara
- elsif para =~/(MetaData)/ and para =~/<~\d+;[m]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info
- format_scroll=Format_scroll.new(@md,'<br /><a name="metadata">MetaData</a>')
- para=format_scroll.bold_para
- elsif para =~/(Owner Details)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/
- format_scroll=Format_scroll.new(@md,'<br /><a name="owner.details">Owner Details</a>')
- @@xml[:owner_details]=format_scroll.bold_para
- para=''
- elsif para =~/(.*)<:#>(.*)/
- one, two=$1,$2
- format_text=Format_text_object.new(one,two)
- para=format_text.seg_no_paranum
- end
- para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
- if para =~/.*<:#>.*$/
- para=case para
- when /<:i1>/
- format_text=Format_text_object.new(para,'')
- format_text.scr_inden_ocn_e_no_paranum
- when /<:i2>/
- format_text=Format_text_object.new(para,'')
- format_text.scr_inden_ocn_e_no_paranum
- end
- end
- if para =~/<:center>/
- one, two=/(.*)<:center>(.*)/.match(para)[1,2]
- format_text=Format_text_object.new(one, two)
- para=format_text.center
- end
- else
- end
- para.gsub!(/<:\S+?>/,'')
- para.gsub!(/<!.+!>/,' ')
- end
- end
- @content_flag=true
- 6.downto(4) do |x|
- y=x - 1; v=x - 3
- if @level[x] == true #2004w36 bug fix? watch/test previous logic broke on free.for.all @coontent_flag introduced
- if @content_flag==true
- @@xml[:body] << "\n#{@tab*y}</#{Contents[v]}>\n"
- @content_flag=false
- else
- @@xml[:body] << "\n#{@tab*y}</#{Contents[v]}>\n"
- end
- end
- end
- 3.downto(1) do |x|
- y=x - 1
- @@xml[:body] << "#{@tab*y}</#{Heading_close[x]}>\n" if @level[x] == true
- end
- end
- def pre
- rdf=SiSU_XML_tags::RDF.new(@md)
- dir=SiSU_Env::Info_env.new
- css=SiSU_Env::CSS_select.new(@md).docbook_xml
- encoding='<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V5.0//EN"
- "http://www.oasis-open.org/docbook/xml/5.0/docbook.dtd">'
- #encoding='<?xml version="1.0" encoding="utf-8"?>'
- @@xml[:open] =<<WOK
-#{encoding}
-<?xml-stylesheet type="text/css" href="../#{dir.path.style}/#{css}"?>
-#{rdf.comment_xml}
-<book>
-WOK
- @@xml[:head] << "<bookinfo>\n"
- end
- def post
- @@xml[:head] << @@xml[:sc]
- @@xml[:head] << "</bookinfo>\n"
- @@xml[:close] = "</book>\n"
- end
- def publish
- content=[]
- data=@data
- content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
- content << @@xml[:owner_details] if @md.stmp =~/\w\w/
- content << @@xml[:tail] << @@xml[:close]
- Output.new(content.to_s,@md).xml
- @@xml[:head],@@xml[:body],@@xml[:tail]=[],[],[]
- end
- end
- class Output
- include SiSU_Param
- def initialize(data,md)
- @data,@md=data,md
- end
- def xml
- @sisu=[]
- @data.each do |para|
- para.gsub!(/<:\S+?>/,'')
- para.gsub!(/<!.+?!>/,'')
- para="#{para}\n" unless para.empty?
- @sisu << para
- end
- new_file_data=@sisu.to_s
- @sisu=new_file_data.scan(/.+/)
- SiSU_Env::SiSU_file.new(@md).mkdir
- filename_xml=SiSU_Env::SiSU_file.new(@md,@md.fn[:docbook]).mkfile
- @sisu.each {|para| filename_xml.puts para}
- filename_xml.close
- end
- end
- class Tidy
- def initialize(md,dir)
- @md,@env=md,dir
- @prog=SiSU_Env::Info_program.new
- end
- def xml
- if @prog.tidy !=false
- if @md.cmd =~/[VM]/
- tell=SiSU_Screen::Ansi.new(@md.cmd,'invert','Using XML Tidy','check document structure')
- tell.colorize unless @md.cmd =~/q/
- tell.grey_open unless @md.cmd =~/q/
- tidyfile='/dev/null' #don't want one or screen output, check for alternative flags
- tidy=SiSU_Env::System_call.new("#{@env.path.output}/#{@md.fnb}/#{@md.fn[:docbook]}",tidyfile)
- tidy.well_formed?
- tell.p_off unless @md.cmd =~/q/
- end
- end
- end
- end
- end
-end
-__END__
-
diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb
index 23cccc04..9c10c27e 100644
--- a/lib/sisu/v0/help.rb
+++ b/lib/sisu/v0/help.rb
@@ -988,15 +988,22 @@ WOK
help_env
end
def program_found?(program)
- rc=if SiSU_Env::Info_settings.new.program?(program)
- "rc: #{SiSU_Env::Info_settings.new.program?(program)} "
- else ''
+ if program
+ rc=if SiSU_Env::Info_settings.new.program?(program)
+ SiSU_Env::Info_settings.new.program?(program)
+ else ''
+ end
+ if program =='rmagick'; program='identify' #rmagick is ruby lib uses imagemagick's identify
+ end
+ bin=if SiSU_Env::System_call.new.program_found?(program)
+ SiSU_Env::System_call.new.program_found?(program)
+ else 'false'
+ end
+ else bin,rc='false','false'
end
- bin=if SiSU_Env::System_call.new.program_found?(program)
- "bin: #{SiSU_Env::System_call.new.program_found?(program)}"
- else ''
+ if program; "#{@cX.blue}#{program}#{@cX.off} bin: #{@cX.brown}#{bin}#{@cX.off} rc: #{@cX.brown}#{rc}#{@cX.off}"
+ else "bin: #{@cX.brown}#{bin}#{@cX.off} rc: #{@cX.brown}#{rc}#{@cX.off}"
end
- "#{@cX.brown}#{rc}#{bin}#{@cX.off}"
end
def environment
cf_defaults=SiSU_Env::Info_processing_flag.new
@@ -1010,7 +1017,6 @@ WOK
current directory: #{@cX.blue}#{@env.path.pwd}#{@cX.off}
document output root directory set to: #{@cX.blue}#{@env.path.webserv}#{@cX.off}
documents from current directory placed in: #{@cX.blue}#{@env.path.output}#{@cX.off}
- sisurc.yml used: #{@cX.blue}#{@env.path.yamlrc}#{@cX.off}
webrick url: #{@cX.blue}#{@env.url.webserv_base_cgi}#{@cX.off}
(to start webrick server 'sisu -W')
sqlite db for present directory: #{@cX.blue}sqlite #{@env.path.output}/sisu_sqlite.db#{@cX.off}
@@ -1022,7 +1028,7 @@ WOK
[generated postgresql cgi search form]: #{@cX.blue}#{@env.url.webserv_base_cgi}/cgi-bin/sisu_pgsql.cgi#{@cX.off}
(to generate 'sisu -F' or 'sisu -F webrick')
#{@cX.green}configuration files#{@cX.off}
- sisurc.yml used: #{@cX.blue}#{@env.path.yamlrc}#{@cX.off}
+ sisurc.yml used: #{@cX.blue}#{@env.path.yamlrc}#{@cX.off}
configuration information search path: #{@cX.blue}#{@env.path.rc.join(', ')}#{@cX.off}
(directory also relevant for skins and images)
digest (md5 or sha256): #{@cX.blue}#{@env.digest.type}#{@cX.off}
@@ -1040,13 +1046,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: #{program_found?(@env.program.wc)}
+ imagemagick/rmagick: #{program_found?(@env.program.rmagick)}
+ tidy: #{program_found?(@env.program.tidy)}
+ rexml: #{program_found?(@env.program.rexml)}
+ 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:)
#{@cX.green}processing shortcut defaults set to:#{@cX.off}
color defaut set (on==true) #{@cX.blue}#{cf_defaults.color}#{@cX.off}
@@ -1349,9 +1355,25 @@ WOK
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}
+ Presumably if you are reading this interactively you have a copy of SiSU already installed, nevertheless here are a few notes.
- 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}
+ SiSU does require setup, the executable file #{@cX.blue}sisu#{@cX.off} is placed in #{@cX.blue}#{Config::CONFIG['bindir']}#{@cX.off} or #{@cX.blue}#{Config::CONFIG['sitelibdir']}#{@cX.off} and the library files, in #{@cX.blue}#{Config::CONFIG['rubylibdir']}/#{SiSU_lib}#{@cX.off}
+ or in #{@cX.blue}#{Config::CONFIG['sitelibdir']}/#{SiSU_lib}#{@cX.off}
+
+ SiSU comes with a number of installers, including #{@cX.blue}setup.rb#{@cX.off}, #{@cX.blue}install#{@cX.off} and a #{@cX.blue}Rantfile#{@cX.off} if rant is installed on your system, you may need to be root to install sisu on your system. After unpacking the tarball, in the top directory of the tarball which contains the named files type, one of:
+ sudo ./sisu-install base
+ sudo ./sisu-install setup
+ if that does not work try
+ sudo ruby ./sisu-install setup
+ if rant is installed on your system you may instead run:
+ sudo rant base
+
+ for further options:
+ ./sisu-install -T
+
+ SiSU is pre-packaged for some GNU/Linux distributions such as Debian.
+
+ For information on download and installation, see #{@cX.blue}http://www.jus.uio.no/sisu/SiSU/download#{@cX.off}
For post installation help it is best you refer to '#{@cX.blue}man 8 sisu#{@cX.off}'
@@ -1360,18 +1382,17 @@ WOK
arch: #{@cX.blue}#{@env.arch}#{@cX.off}
Directories for installation
- bin: #{@cX.blue}[FIX]#{@cX.off}
- lib (site-ruby): #{@cX.blue}#{Config::CONFIG['sitelibdir']}/#{SiSU_lib}#{@cX.off}
- conf [etc]: #{@cX.blue}#{@env.path.etc}/sisu{@cX.off}
- data (document samples, images, README): #{@cX.blue}#{@env.path.sample_data}/sisu#{@cX.off} and #{@cX.blue}#{@env.path.sample_data}/doc/sisu#{@cX.off}
- man (manual pages): #{@cX.blue}#{@env.path.man}#{@cX.off}
- processing: #{@cX.blue}#{@env.path.processing}#{@cX.off}
- output www: #{@cX.blue}#{@env.path.output}#{@cX.off}
+ bin: #{@cX.blue}#{Config::CONFIG['bindir']}#{@cX.off} or #{@cX.blue}#{Config::CONFIG['sitelibdir']}#{@cX.off}
+ lib (site-ruby): #{@cX.blue}#{Config::CONFIG['rubylibdir']}/#{SiSU_lib}#{@cX.off} or #{@cX.blue}#{Config::CONFIG['sitelibdir']}/#{SiSU_lib}#{@cX.off}
+ conf [etc]: #{@cX.blue}#{@env.path.etc}/sisu#{@cX.off}
+ data (document samples, images, README): #{@cX.blue}#{@env.path.sample_data}#{@cX.off}
+ processing: #{@cX.blue}#{@env.path.processing}#{@cX.off}
+ output www: #{@cX.blue}#{@env.path.output}#{@cX.off}
Output files, are currently set to be produced in:
- processed document output: #{@cX.blue}#{@env.path.output}#{@cX.off}
- a document in the current directory #{@cX.blue}#{Dir.pwd}#{@cX.off}
- will have its output placed in: #{@cX.blue}#{@env.path.output}/#@output_stub#{@cX.off}
+ processed document output: #{@cX.blue}#{@env.path.output}#{@cX.off}
+ a document in the current directory #{@cX.blue}#{Dir.pwd}#{@cX.off}
+ will have its output placed in: #{@cX.blue}#{@env.path.output}/#@output_stub#{@cX.off}
Install any additional programs of interest (that SiSU makes use of, that are not already on your system)
@@ -1393,10 +1414,25 @@ WOK
def setup
print <<WOK
- [provide some setup information]
+ #{@cX.green}configuration files#{@cX.off}
+ sisurc.yml used:
+ #{@cX.blue}#{@env.path.yamlrc}#{@cX.off}
+ configuration information search path:
+ #{@cX.blue}#{@env.path.rc.join(', ')}#{@cX.off}
+ (directory also relevant for skins and images)
+
+ to initialise the mapped output directory, from within the markup document directory type:
+ #{@cX.blue}sisu -CC#{@cX.off}
- also see http://www.jus.uio.no/sisu/SiSU
+ for information on your current sisu configuration settings, type:
+ #{@cX.blue}sisu --help env#{@cX.off}
+ or
+ #{@cX.blue}sisu -V#{@cX.off}
+ see also
+ #{@cX.blue}man 8 sisu#{@cX.off}
+ and
+ #{@cX.blue}http://www.jus.uio.no/sisu/SiSU#{@cX.off}
WOK
end
def termsheet
@@ -1587,7 +1623,7 @@ WOK
def texinfo
print <<WOK
- sisu -i [filename] produces texinfo and info files
+ sisu -I [filename] produces texinfo and info files
info and texinfo files are currently left in a separate work/output directory... have not decided what to do with them
diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb
index e4ae72a2..35160d23 100644
--- a/lib/sisu/v0/hub.rb
+++ b/lib/sisu/v0/hub.rb
@@ -51,7 +51,8 @@
<ralph@amissah.com>
<ralph.amissah@gmail.com>
- ** Description: SiSU information Structuring Universe, processing
+ ** Description: SiSU information Structuring Universe, text structuring,
+ processing, publishing, search
=end
module SiSU
@@ -145,12 +146,13 @@ module SiSU
when /^sisupod_make$/; SiSU_Doc::Source.new(@opt).read # -S
when /^source_kdissert$/; SiSU_Kdi_source::Source.new(@opt).read ## -S
when /^digests$/; SiSU_Digest_view::Source.new(@opt).read # -N
+ when /^xml_scaffold$/; SiSU_XML_scaffold::Source.new(@opt).read # -T
when /^plaintext$/; SiSU_Plaintext::Source.new(@opt).read # -a -A -e -E -f
when /^wikispeak$/; SiSU_Wikispeak::Source.new(@opt).read # -g
when /^odf$/; SiSU_ODF::Source.new(@opt).read # -o
when /^texpdf$/; SiSU_TeX::Source.new(@opt).read # -p
when /^texinfo$/; SiSU_TexInfo::Source.new(@opt).read # -I
- when /^docbook$/; SiSU_Docbook::Source.new(@opt).read # -B
+ #when /^docbook$/; SiSU_Docbook::Source.new(@opt).read # -B
when /^html$/; SiSU_HTML::Source.new(@opt).read # -h -H
when /^xml$/; SiSU_XML_SAX::Source.new(@opt).read # -x
when /^xml_dom$/; SiSU_XML_DOM::Source.new(@opt).read # -X
@@ -290,7 +292,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
flag=SiSU_Env::Info_processing_flag.new
extra=''
if @opt.cmd !~/[mn]/
- extra+=if @opt.cmd =~/[abBeghHhINoptwXxz]/ and @opt.cmd !~/[mn]/; 'm' #% add dal
+ extra+=if @opt.cmd =~/[abeghHhINoptTwXxz]/ and @opt.cmd !~/[mn]/; 'm' #% add dal
elsif ((@opt.cmd =~/[Dd]/ or (@opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/)) \
and @opt.mod.inspect !~/(?:remove|(?:(?:re)?create(?:all)?|dropall|drop)$)/) \
and @opt.cmd !~/[mn]/
@@ -466,8 +468,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
end
if @opt.cmd =~/b/; op('xhtml','xhtml sax') #% -b xhtml sax type
end
- if @opt.cmd =~/B/; op('docbook','docbook xml') #% -B docbook xml
- end
+ #if @opt.cmd =~/B/; op('docbook','docbook xml') #% -B docbook xml
+ #end
if @opt.cmd =~/w/; op('concordance','Concordance') #% -w concordance
end
if @opt.cmd =~/t/ #% -t termsheet/standard form
@@ -484,6 +486,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
end
Operations.new.counter
end
+ if @opt.cmd =~/T/; op('xml_scaffold','XML scaffold') #% -T temporary tests
+ end
if @opt.cmd =~/p/; op('texpdf','LaTeX pdf') #% -p latex/ texpdf
end
if @opt.cmd =~/I/; op('texinfo','TeX Info') #% -I texinfo (i taken by db import)
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index f1aa19fc..c2d694f2 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -92,7 +92,7 @@ module SiSU_Env
out=Config::CONFIG['localstatedir']
etc=Config::CONFIG['sysconfdir'] + '/sisu'
share=Config::CONFIG['datadir'] + '/sisu'
- data=Config::CONFIG['datadir'] + '/sisu-examples/sample'
+ data=Config::CONFIG['datadir'] + '/doc/sisu'
m=/.+\/(\S+)/m
@stub_pwd ||=@@pwd[m,1]
prcss_dir='_sisu_processing'
@@ -506,7 +506,7 @@ module SiSU_Env
def rcs #rcs for document markup data
program='rcs'
program_ref="\n\t\tdocument version information requested"
- if program_found?(rcs); true
+ if program_found?(program); true
else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
@@ -514,7 +514,7 @@ module SiSU_Env
def cvs #cvs for document markup data
program='cvs'
program_ref="\n\t\tdocument version information requested"
- if program_found?(cvs); true
+ if program_found?(program); true
else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
@@ -574,6 +574,14 @@ module SiSU_Env
else puts "\tWARN: #{program} is not installed #{program_ref}" if cmd =~/V/
end
end
+ def rmagick #rmagick is a ruby library
+ program='identify'
+ program_ref="\n\t\tsee http://www.imagemagick.org/"
+ if program_found?(program); true
+ else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ false
+ end
+ end
def well_formed? #tidy - check for well formed xml xhtml etc.
program=@prog.tidy
program_ref="\n\t\tsee http://tidy.sourceforge.net/"
@@ -610,7 +618,7 @@ module SiSU_Env
def makeinfo #texinfo
program='makeinfo'
program_ref="\n\t\tsee http://www.gnu.org/software/texinfo/"
- if program_found?(program); system("makeinfo #@input\n")
+ if program_found?(program); system("#{program} #@input\n")
else puts "\tWARN: #{program} is not installed #{program_ref}"
end
end
@@ -1556,6 +1564,13 @@ module SiSU_Env
end
is
end
+ def rmagick
+ if defined? @rc['program_set']['rmagick']; is=@rc['program_set']['rmagick']
+ end
+ if is.nil? or is==true; is='rmagick'
+ end
+ is
+ end
def rexml #should be part of ruby 1.8 but apparently not always
is=if FileTest.directory?("#{Config::CONFIG['rubylibdir']}/rexml") #Config::CONFIG['sitedir']
true
diff --git a/lib/sisu/v0/texinfo.rb b/lib/sisu/v0/texinfo.rb
index 29f31421..88f91d7d 100644
--- a/lib/sisu/v0/texinfo.rb
+++ b/lib/sisu/v0/texinfo.rb
@@ -87,7 +87,7 @@ module SiSU_TexInfo
when /\.[_-]?sst$/
Dir.mkdir(@env.path.output) unless FileTest.directory?("#{@env.path.output}")
Dir.mkdir(@env.path.texi) unless FileTest.directory?(@env.path.tex)
- @@filename_texinfo=File.new(%{#{@env.path.texi}/#@opt.fnb.texinfo},'w+')
+ @@filename_texinfo=File.new(%{#{@env.path.texi}/#{@opt.fnb}.texinfo},'w+')
end
rescue; STDERR.puts SiSU_Screen::Ansi.new(@opt.cmd,$!,$@).rescue
ensure
@@ -158,13 +158,13 @@ module SiSU_TexInfo
@tex_file=[]
data=@data
data.each do |para|
- para.gsub!(/&/,'<=and>')
# DEBUG 2003w16 this is a kludge, because i could not get parameters
# from param, Sort out ... revert to more elegant solution
if para =~ /<!Th?¡\s+c/
@@flag['tables']='y' # KLUDGE get from param
end
para.gsub!(/<:p[bn]>/,'')
+ para.gsub!(/(^|\s)\{(.+?)\}(http:\/\/\S+)/,'\1(\2 [linked to:] \3)')
do_mono=TexInfoFormat::Texinfo.new(para,@md)
@tex_file << do_mono.spec_char
end
@@ -176,8 +176,10 @@ module SiSU_TexInfo
@tex_file=[]
data.each do |para|
# BUG bug -> have problems with endnotes in headers
- if para =~ /\\~\\\{\d+\s+/ #if para =~ /<!e\s+/ # watch
- para.gsub!(/\s*\\~\\\{(\d+)\s+(.+?)<#@dp>\\\}\\~/m,' @footnote{ \2} ')
+ if para =~ /\\~@\{\d+\s+/ #if para =~ /<!e\s+/ # watch
+ para.gsub!(/\s*\\~@\{(?:\d+)\s+(.+?)<#@dp>@\}\\~/m,' @footnote{ \1} ')
+ elsif para =~ /\\~@\{\*+\s+/ #if para =~ /<!e\s+/ # watch
+ para.gsub!(/\s*\\~@\{(\*+)\s+(?:.+?)<#@dp>@\}\\~/m,' @footnote{ \1} ')
end
@tex_file << para
end
@@ -226,7 +228,7 @@ module SiSU_TexInfo
if @@flag['code']==1
line.gsub!(/^\s*(.+)/m, "\\noindent \\marginpar\[left-text\]{\\begin{tiny}#{@@counting}\\end{tiny}}\\1\\")
@@counting+=1 if @@flag['code']==1
- else line.gsub!(/(.+)/m,'\noindent\1\')
+ else line.gsub!(/(.+)/m,'\noindent\1')
end
end
end
@@ -258,7 +260,7 @@ module SiSU_TexInfo
toc=TexInfoFormat::Texinfo.new($1,@md)
texinfo_menu << toc.menu
end
- if para =~ /^[4-6]\\+~\S+\s*(.+?)\s*$/
+ if para =~ /^[4-6]\\+~(?:\S+)?\s+(.+?)\s*$/
toc=TexInfoFormat::Texinfo.new($1,@md)
texinfo_menu << toc.menu
case para
@@ -270,6 +272,8 @@ module SiSU_TexInfo
@subsubmenu[n_menu]=[]
@submenu[n_menu] << toc.menu
when /^[6]\\+~\S+\s+(.+?)\s*$/
+ n_submenu+=1
+ @subsubmenu[n_submenu]=[]
@subsubmenu[n_submenu] << toc.menu
end
end
@@ -279,7 +283,7 @@ module SiSU_TexInfo
@tex_file << texinfo_menu
@tex_file << "* Index::\n" +
"@end menu\n\n" +
- "@c {{{ 5\n\n"
+ "@c %% 5\n\n"
n_menu,n_submenu=0,0
@@do_submenu,@@do_subsubmenu=1,1
data.each do |para|
@@ -325,14 +329,13 @@ module SiSU_TexInfo
if para !~/\S/
para=nil
else
- para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'~[\1]')
- #para.gsub!(/[1-3]\\\\\{\\\\\{\\\\\{\s+/, '')
- #para.gsub!(/[1-3]\\\\\{\s+/, '')
+ para.gsub!(/<\\~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'<\1>')
+ #para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'<\1>')
+ #para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'<\1>')
para=para
end
- #para.gsub!(/^\s+$/mi, "")
end
-#%case with endnotes
+ #%case with endnotes
para.gsub!(/\s*[0-8]\\+(\S+)?\s+/,' ') if para
@tex_file << para if para
end
@@ -397,7 +400,7 @@ module SiSU_TexInfo
end
def makeinfo
if @md.fns =~/\.[_-]?sst$/
- m=/(.+?)\.[_-]?sst$/.match(@md.fns)
+ m=/(.+?)\.([_-]?sst)$/.match(@md.fns)
fnb,sfx=m[1],m[2]
pwd=Dir.pwd
case sfx
diff --git a/lib/sisu/v0/texinfo_format.rb b/lib/sisu/v0/texinfo_format.rb
index bb60895d..3184ee80 100644
--- a/lib/sisu/v0/texinfo_format.rb
+++ b/lib/sisu/v0/texinfo_format.rb
@@ -90,6 +90,8 @@ module TexInfoFormat
author=@md.dc_creator if @md.dc_creator
author ||=''
author.gsub!(/[\*]/,'') #if author
+ v=SiSU_Env::Info_version.new.get_version
+ #(version @value{VERSION} #{v[:version]}, @value{UPDATED} #{v[:date]})
head =<<WOK
\\input texinfo @c -*-texinfo-*-
@comment $Id$
@@ -98,10 +100,9 @@ module TexInfoFormat
@settitle #{title} @value{VERSION}
@syncodeindex pg cp
@comment %**end of header
-@c {{{ 2
+@c %% 2
@copying
-SiSU in texinfo version of #{title}
-(version @value{VERSION}, @value{UPDATED})
+SiSU texinfo of #{title}
Copyright @copyright{} #{year} #{author}.
@@ -117,7 +118,7 @@ Copyright #{author}, generated by ``SiSU''
WOK
if @md.subtitle
titlepage=<<WOK
-@c {{{ 3
+@c %% 3
@titlepage
@title #{title} #{subtitle}
@author #{author}
@@ -129,7 +130,7 @@ WOK
WOK
else
titlepage=<<WOK
-@c {{{ 3
+@c %% 3
@titlepage
@title #{title}
@value{VERSION}, @value{UPDATED}
@@ -149,7 +150,7 @@ WOK
@one=@one.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{@@tex_backslash*2} ")
@one.gsub!(/\$/,"\\$")
@one.gsub!(/[,]\s*/,' - ')
- "@c {{{ 4\n" +
+ "@c %% 4\n" +
"@ifnottex\n" +
"@node Top\n" +
"@top #@one\n\n" +
@@ -201,7 +202,7 @@ WOK
dc_coverage="Coverage: #{dc_coverage}\n\n" if dc_coverage
dc_rights="Rights: #{dc_rights}\n\n" if dc_rights
"@node Dublin Core\n" +
- "@chapter Dublin Core\n" +
+ "@unnumbered Dublin Core\n" +
"@cindex chapter, Dublin Core\n\n" +
"#{dc_title}" +
"#{dc_creator}" +
@@ -225,91 +226,80 @@ WOK
"\n\n"
end
def tail
- "@c {{{ 6\n" +
+ "@c %% 6\n" +
"@node Index\n" +
"@unnumbered Index\n" +
"@printindex cp\n\n" +
"@bye"
end
+ def clean(para)
+ para.gsub!(/<\\~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'<\1>')
+ para.gsub!(/\s*[,:]\s*/,' - ')
+ para.gsub!(/<:#>/,'')
+ para.strip!
+ para
+ end
def menu
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,:]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- "* #@para::"
+ para=clean(@para)
+ para=para.gsub(/@footnote\{.+?\}\s+/,'')
+ "* #{para}::"
end
def level1
@para.gsub!(/[1]\\+~/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,:]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ para=clean(@para)
+ nd=para.gsub(/@footnote\{.+?\}\s+/,'')
+ para="@node #{nd}\n@unnumbered #{para}\n@cindex chapter, #{nd}\n"
@para.gsub!(/.+/,"#{para}")
end
def level2
@para.gsub!(/[2]\\+~/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,:]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ para=clean(@para)
+ nd=para.gsub(/@footnote\{.+?\}\s+/,'')
+ para="@node #{nd}\n@unnumbered #{para}\n@cindex chapter, #{nd}\n"
@para.gsub!(/.+/,"#{para}")
end
def level3
@para.gsub!(/[3]\\+\~/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,:]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ para=clean(@para)
+ nd=para.gsub(/@footnote\{.+?\}\s+/,'')
+ #para=para.gsub(/(.+?)\s*(@footnote\{.+?\})\s*(.+)$/,"\\1 \\3\n\\2")
+ #para=para.gsub(/(.+?)\s*(@footnote\{.+?\})\s*(.+)$/,'\1 \3 \2')
+ para="@node #{nd}\n@unnumbered #{para}\n@cindex chapter, #{nd}\n"
@para.gsub!(/.+/,"#{para}")
end
def level4
@para.gsub!(/[4]\\+~\S+/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,:]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ para=clean(@para)
+ nd=para.gsub(/@footnote\{.+?\}\s+/,'')
+ para="@node #{nd}\n@unnumbered #{para}\n@cindex chapter, #{nd}\n"
@para.gsub!(/.+/,"#{para}")
end
def level5
@para.gsub!(/[5]\\+~\S+/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,:]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ para=clean(@para)
+ nd=para.gsub(/@footnote\{.+?\}\s+/,'')
+ para="@node #{nd}\n@unnumbered #{para}\n@cindex chapter, #{nd}\n"
@para.gsub!(/.+/,"#{para}")
end
def level6
@para.gsub!(/[6]\\+~\S+/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,:]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@node #@para\n@chapter #@para\n@cindex chapter, #@para\n"
+ para=clean(@para)
+ nd=para.gsub(/@footnote\{.+?\}\s+/,'')
+ para="@node #{nd}\n@unnumbered #{para}\n@cindex chapter, #{nd}\n"
@para.gsub!(/.+/,"#{para}")
end
def submenu
@para=@para.join("\n")
@para.gsub!(/[5]\\+~\S+/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@menu\n#@para\n@end menu\n\n"
+ para=clean(@para)
+ para="@menu\n#{para}\n@end menu\n\n"
@para.gsub!(/.+/m,"#{para}")
end
def subsubmenu
@para=@para.join("\n")
@para.gsub!(/[6]\\+~\S+/,'')
- @para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>$/,'~[\1]')
- @para.gsub!(/\s*[,]\s*/,' - ')
- @para.gsub!(/<:#>/,'')
- @para.strip!
- para="@menu\n#@para\n@menu\n\n"
+ para=clean(@para)
+ para="@menu\n#{para}\n@end menu\n\n"
@para.gsub!(/.+/m,"#{para}")
end
def indent1
@@ -320,12 +310,15 @@ WOK
end
def spec_char # special characters
@para.gsub!(/<EOF>/i,'')
- @para.gsub!(/@/i,'@@')
- @para.gsub!(/&(lt|#060);/,'\<&nbsp;')
- @para.gsub!(/&(gt|#062);/,'&nbsp;\>')
- @para.gsub!(/&#123;/,'\{&nbsp;')
- @para.gsub!(/&#125;/,'\}&nbsp;')
- @para.gsub!(/&#(126|152);/i,'~&nbsp;')
+ @para.gsub!(/&#169;/,'(c)')
+ @para.gsub!(/&(lt|#060);/,'<'); @para.gsub!(/&(gt|#062);/,'>')
+ @para.gsub!(/&#123;/,'{'); @para.gsub!(/&#125;/,'}')
+ @para.gsub!(/&#(126|152);/i,'~')
+ @para.gsub!(/&#033;/,'!')
+ @para.gsub!(/&#035;/,'#')
+ @para.gsub!(/&#042;/,'*')
+ @para.gsub!(/&#047;/,'/')
+ @para.gsub!(/&#095;/,'_')
@para.gsub!(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ')
@para.gsub!(/\\/,'\\backslash ')
@para.gsub!(/<:pb>/,'\\newpage')
@@ -337,13 +330,6 @@ WOK
if @para !~ /^\s*<:image|\}:image\s/
@para.gsub!(/_/,'\_')
end
- @para.gsub!(/\{/,"\\{")
- @para.gsub!(/\}/,"\\}")
- @para.gsub!(/&nbsp;&nbsp;/,' ') # ~ character for hardspace
- @para.gsub!(/&nbsp;/,' ') # ~ character for hardspace
- @para.gsub!(/&(\S+?);/,'')
- @para.gsub!(/(\s+&\s+)/,' and ')
- @para.gsub!(/(\&)/,"\\&")
@para.gsub!(/§/i,'\S')
@para.gsub!(/£/i,'\pounds')
@para.gsub!(/å/i,'\aa')
@@ -352,7 +338,6 @@ WOK
@para.gsub!(/Å/i,'\AA')
@para.gsub!(/Æ/i,'\AE')
@para.gsub!(/Ø/i,'\O')
- @para.gsub!(/&(.+?);/i,' ')
@para.gsub!(/<a href=".+?">/i,' ')
@para.gsub!(/<\/a>/i,' ')
@para.gsub!(/<:ee>/i,'')
@@ -360,6 +345,15 @@ WOK
@para.gsub!(/<b>(.+?)<\/b>/,'\*\1\*')
@para.gsub!(/<i>(.+?)<\/i>/,'\/\1\/')
@para.gsub!(/<u>(.+?)<\/u>/,'\_\1\_')
+ @para.gsub!(/@/i,'@@')
+ @para.gsub!(/\{/,'@{'); @para.gsub!(/\}/,'@}')
+ #@para.gsub!(/(^|[\s*!\/#_-])\{/,'\1@{'); @para.gsub!(/\}([\s*!\/#_-]|$)/,'@}\1')
+ @para.gsub!(/&nbsp;&nbsp;/,' ') # ~ character for hardspace
+ @para.gsub!(/&nbsp;/,' ') # ~ character for hardspace
+ @para.gsub!(/&(\S+?);/,' ')
+ @para.gsub!(/&/,'<=and>')
+ @para.gsub!(/(\s+&\s+)/,' and ')
+ @para.gsub!(/(\&)/,"\\&")
@para.gsub!(/"(.+?)"/,"`\\1'") # open & close "
@para.gsub!(/\s+"/," `") # open "
@para.gsub!(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*"/,'\1`') # open "
@@ -368,11 +362,6 @@ WOK
@para.gsub!(/"(\.|,)/,"'") # close "
@para.gsub!(/\s+'/," `") # open '
@para.gsub!(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*'/,'\1`') # open '
- #if @para=~/#{@@tex_1}/
- #end
- #@para.gsub!(/^([1-6-](?:#{@@tex_2}|#{@@tex_1})(?:\\~\S+)?|<.+?>)?\s*"/i,"\\1`") # open "
- #@para.gsub!(/"([1-6-](?:#{@@tex_2}|#{@@tex_1})(?:\\~\S+)?|<.+?>)?\s*$/i,"'\\1") # close "
- #@para.gsub!(/^([1-6-](?:#{@@tex_2}|#{@@tex_1})(?:\\~\S+)?|<.+?>)?\s*'/i,"\\1`") # open '
@para.gsub!(/(<font.*?>|<\/font>)/,'')
@para.gsub!(/\s*<sup>(\S+?)<\/sup>/,'^\1')
@para.gsub!(/(<sup>|<\/sup>)/,'')
diff --git a/lib/sisu/v0/urls.rb b/lib/sisu/v0/urls.rb
index a18cdc2f..09b15f2d 100644
--- a/lib/sisu/v0/urls.rb
+++ b/lib/sisu/v0/urls.rb
@@ -103,7 +103,7 @@ module SiSU_urls
'a (Plain-text (footnotes))'=>@fn[:plain],
'A (Plain-text (footnotes) dos)'=>@fn[:plain],
'b (XHTML)'=>@fn[:xhtml],
- 'B (Docbook XML)'=>@fn[:docbook],
+ #'B (Docbook XML)'=>@fn[:docbook],
'D[iu] (DBI import/update postgresql)'=>'dbi psql',
'd[iu] (DBI import/update sqlite)'=>'dbi sqlite',
'e (Plain-text (endnotes))'=>@fn[:plain],
@@ -137,7 +137,7 @@ module SiSU_urls
end
end
def urls_maintenance(opt,x,y)
- if x=~/^([aAbBceEhHmNopwxXy])/ and opt.cmd =~/[aAbBceEhHmNopwxXy]/ and x=~/^[#{opt.cmd}]/
+ if x=~/^([aAbceEhHmNopwxXy])/ and opt.cmd =~/[aAbceEhHmNopwxXy]/ and x=~/^[#{opt.cmd}]/
m=$1
f=y
tool=@editor
@@ -180,7 +180,7 @@ module SiSU_urls
@pwd_stub="#@webserv_url"[m,1]
@u.each do |x,y|
if @opt.fns =~ @m_regular
- if x=~/^([aAbBceEhHNopsSwxXyY])/ and @opt.cmd=~/[aAbBceEhHNopsSwxXyY]/ and x=~/^[#{@opt.cmd}]/
+ if x=~/^([aAbceEhHNopsSwxXyY])/ and @opt.cmd=~/[aAbceEhHNopsSwxXyY]/ and x=~/^[#{@opt.cmd}]/
m=$1
tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/#@fnb/#{y}")
tell.result unless @opt.cmd =~/q/
diff --git a/lib/sisu/v0/xml_scaffold.rb b/lib/sisu/v0/xml_scaffold.rb
new file mode 100644
index 00000000..93987840
--- /dev/null
+++ b/lib/sisu/v0/xml_scaffold.rb
@@ -0,0 +1,203 @@
+=begin
+
+ * Name: SiSU
+
+ * Description: extract and print an XML rendition of document structure to screen
+
+ * Author: Ralph Amissah
+
+ * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007 Ralph Amissah All Rights Reserved.
+
+ * License: GPL 3 or later:
+
+ SiSU, a framework for document structuring, publishing and search
+
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007 Ralph Amissah
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see <http://www.gnu.org/licenses/>.
+
+ If you have Internet connection, the latest version of the GPL should be
+ available at these locations:
+ <http://www.fsf.org/licenses/gpl.html>
+ <http://www.gnu.org/copyleft/gpl.html>
+ <http://www.jus.uio.no/sisu/gpl.fsf>
+
+ * SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ * Hompages:
+ <http://www.jus.uio.no/sisu>
+ <http://www.sisudoc.org>
+
+ * Download:
+ <http://www.jus.uio.no/sisu/SiSU/download.html>
+
+ * Ralph Amissah
+ <ralph@amissah.com>
+ <ralph.amissah@gmail.com>
+
+ ** Description: SiSU information Structuring Universe, processing
+
+=end
+module SiSU_XML_scaffold
+ require "#{SiSU_lib}/dal"
+ require "#{SiSU_lib}/sysenv"
+ include SiSU_Env
+ include SiSU_Param
+ pwd=Dir.pwd
+ class Source
+ def initialize(opt)
+ @opt=opt
+ @sp=' '
+ end
+ def read
+ begin
+ @md=SiSU_Param::Parameters.new(@opt).get
+ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here
+ SiSU_XML_scaffold::Source::Scroll.new(@dal_array,@md).songsheet
+ rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error
+ ensure
+ end
+ end
+ private
+ class Scroll <Source
+ def initialize(data='',md='')
+ @data,@md=data,md
+ end
+ def songsheet
+ @t='docbook' #@t='fictionbook'
+ @s=['book', #@s=['body',
+ 'part', # 'section',
+ 'subpart N/A', # 'section',
+ 'sub-subpart N/A', # 'section',
+ 'chapter', # 'section',
+ 'sect1', # 'section',
+ 'sect2' # 'section'
+ ] #]
+ structure
+ end
+ def structure_outline(ds)
+ puts "\ninfo outline --->\n\n"
+ ds.each {|x| puts "#{x[:ocn]} #{x[:lev]} #{x[:hdr]}" }
+ end
+ def structure_simple(ds)
+ puts "\nheading outline --->\n\n"
+ ds.each_with_index do |x,i|
+ #puts "#{x[:ocn]} #{x[:lev]} #{x[:hdr]}"
+ if x[:lev] =~ /^([1-6])/; puts "<#{@s[$1.to_i]}>#{x[:ocn]} #{x[:lev]} #{x[:hdr]}</#{@s[$1.to_i]}>"
+ end
+ end
+ end
+ def structure_build_tag_close(lev,h)
+ @sp=' '
+ case h[0]
+ when 1
+ puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) and h[1]
+ puts "</#{@s[0]}>" if (lev == 0)
+ when 2
+ puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) and h[2]
+ puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) and h[1]
+ puts "</#{@s[0]}>" if (lev == 0)
+ when 3
+ puts "#{@sp*3}</#{@s[3]}>" if (lev <= 3) and h[3]
+ puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) and h[2]
+ puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) and h[1]
+ puts "</#{@s[0]}>" if (lev == 0)
+ when 4
+ puts "#{@sp*4}</#{@s[4]}>" if (lev <= 4)
+ puts "#{@sp*3}</#{@s[3]}>" if (lev <= 3) and h[3]
+ puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) and h[2]
+ puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) and h[1]
+ puts "</#{@s[0]}>" if (lev == 0)
+ when 5
+ puts "#{@sp*5}</#{@s[5]}>" if (lev <= 5)
+ puts "#{@sp*4}</#{@s[4]}>" if (lev <= 4)
+ puts "#{@sp*3}</#{@s[3]}>" if (lev <= 3) and h[3]
+ puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) and h[2]
+ puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) and h[1]
+ puts "</#{@s[0]}>" if (lev == 0)
+ when 6
+ puts "#{@sp*6}</#{@s[6]}>" if (lev <= 6)
+ puts "#{@sp*5}</#{@s[5]}>" if (lev <= 5)
+ puts "#{@sp*4}</#{@s[4]}>" if (lev <= 4)
+ puts "#{@sp*3}</#{@s[3]}>" if (lev <= 3) and h[3]
+ puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) and h[2]
+ puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) and h[1]
+ puts "</#{@s[0]}>" if (lev == 0)
+ end
+ end
+ def structure_build(ds)
+ puts "\nXML [#@t type] structure outline --->\n\n"
+ @h=[0,false,false,false]
+ puts "<#{@s[0]}>"
+ ds.each_with_index do |x,i|
+ case x[:lev]
+ when /^1/
+ structure_build_tag_close(x[:lev].to_i,@h)
+ puts "#{@sp*1}<#{@s[1]}>\n#{@sp*1} #{x[:ocn]} #{x[:lev]} #{x[:hdr]}"
+ @h=[1,true,false,false]
+ when /^2/
+ structure_build_tag_close(x[:lev].to_i,@h)
+ puts "#{@sp*2}<#{@s[2]}>\n#{@sp*2} #{x[:ocn]} #{x[:lev]} #{x[:hdr]}"
+ @h=[2,true,true,false]
+ when /^3/
+ structure_build_tag_close(x[:lev].to_i,@h)
+ puts "#{@sp*3}<#{@s[3]}>\n#{@sp*3} #{x[:ocn]} #{x[:lev]} #{x[:hdr]}"
+ @h=[3,true,true,true]
+ when /^4/
+ structure_build_tag_close(x[:lev].to_i,@h)
+ puts "#{@sp*4}<#{@s[4]}>\n#{@sp*4} #{x[:ocn]} #{x[:lev]} #{x[:hdr]}"
+ @h[0]=4
+ when /^5/
+ structure_build_tag_close(x[:lev].to_i,@h)
+ puts "#{@sp*5}<#{@s[5]}>\n#{@sp*5} #{x[:ocn]} #{x[:lev]} #{x[:hdr]}"
+ @h[0]=5
+ when /^6/
+ structure_build_tag_close(x[:lev].to_i,@h)
+ puts "#{@sp*6}<#{@s[6]}>\n#{@sp*6} #{x[:ocn]} #{x[:lev]} #{x[:hdr]}"
+ @h[0]=6
+ end
+ end
+ structure_build_tag_close(0,@h)
+ end
+ def structure
+ data=@data
+ @ds=[]
+ c=0
+ data.each do |para|
+ if para =~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+>/
+ x=(/<~(\d+);((?:\w|[0-6]:)\d+);(\w\d+)>/).match(para)
+ if x[3] =~/^[hu]\d+/
+ @ds[c]={}
+ @ds[c][:ocn]=x[1]
+ @ds[c][:lev]=x[2]
+ @ds[c][:hdr]=x[3]
+ c+=1
+ #puts "#{x[1]} #{x[2]} #{x[3]}"
+ end
+ end
+ end
+ structure_outline(@ds) if @md.cmd =~/V/
+ structure_simple(@ds) if @md.cmd =~/V/
+ structure_build(@ds)
+ @ds
+ end
+ end
+ end
+end
+__END__
diff --git a/man/man1/sisu.1 b/man/man1/sisu.1
index ce47abce..7af13c9d 100644
--- a/man/man1/sisu.1
+++ b/man/man1/sisu.1
@@ -9,14 +9,14 @@
.\" /[^\\][-']
.\" :%s/\([^\\]\)\([-']\)/\1\\\2/c
.\" |sisu.1|@|^|<url:sisu.1>
-.TH "sisu" "1" "June 29, 2007" "version 0.54" "USER COMMANDS and basic Markup"
+.TH "sisu" "1" "July 7, 2007" "version 0.55" "USER COMMANDS and basic Markup"
.SH "NAME"
.B SiSU
\- Structured information, Serialized Units \- a document publishing system
.SH "SYNOPSIS"
.B sisu
.B [
-.I \-AabcDdEeFHhIMmNnopqrRSstUuVvwXxYyZz0\-9
+.I \-AabcDdEeFHhIMmNnopqRrSsTtUuVvwXxYyZz0\-9
.B ] [
.I filename/ wildcard
.B ]
@@ -186,7 +186,9 @@ html, with internal document links that include the document suffix, i.e. whethe
.BI \-I \ [filename/wildcard]
produces
.I texinfo
-file.
+and
+.I info
+file, (view with pinfo).
.TP
.BI \-L
prints license information.
diff --git a/man/man8/sisu.8 b/man/man8/sisu.8
index 005759fa..e3e676ae 100644
--- a/man/man8/sisu.8
+++ b/man/man8/sisu.8
@@ -22,16 +22,16 @@ A document publishing system, that from a simple single marked\-up document,
produces a multitude of output formats including: html, latex, pdf, info, and
sql output, which can be cross referenced as having the same document structure
and text object numbering, "object citation numbering". Features include its\'
-simple syntax; the semantic identification of documents using the Dublin Core;
-document management; built to be associated with a revision control system;
-text object numbering for the identification of a texts location in any of the
-output formats, easy skinning on a site wide, or per document basis, ... for
-more see
+simple syntax; the semantic tagging of documents; document management; built to
+be associated with a revision control system; text object numbering for the
+identification of a texts location in any of the output formats, easy skinning
+on a site wide, or per document basis; granular search; a degree of future
+proofing ... for more see
.I man 1 sisu
or
.I <http://www.jus.uio.no/sisu>
.PP
-.B SiSU is an alternative way of publishing and managing documents.
+.B SiSU is a way of preparing, publishing, managing and searching documents.
.\"%% Installation
.SH INSTALLATION
.PP
@@ -46,15 +46,8 @@ how to install SiSU.
.PP
Sample marked up documents are are available at
.I /usr/share/doc/sisu/sisu_markup_samples/dfsg
-or equivalent directory, or online at
-.I <http://www.jus.uio.no/sisu/sample/markup.html>
-or for viewing in html with syntax highlighting from
-.I <http://www.jus.uio.no/sisu/sample/syntax>
-.PP
-A syntax table is provided at
-.I /usr/share/doc/sisu/on_markup.txt
-or equivalent, and online at
-.I <http://www.jus.uio.no/sisu/sample/on_markup.txt>
+or equivalent directory, or online, see
+.I <http://www.jus.uio.no/sisu/SiSU/2.html>
.PP
.I man 1 sisu
has a syntax table along with processing commands.
@@ -75,22 +68,40 @@ The rest of this note is on post installation setup
.\"%% Post Installation Setup
.SH Post Installation Setup \- Quick start
.PP
-After installation of sisu-complete, move to the document samples directory
+
+After installation of sisu\-complete, move to the document samples directory,
.PP
cd /usr/share/doc/sisu/sisu_markup_samples/dfsg
.PP
-and run
+[this is not where you would normally work but provides sample documents for
+testing, you may prefer instead to copy the contents of that directory to a local
+directory before proceeding]
+.PP
+and in that directory, initialise the output directory with the command
.PP
- sisu \-1 free_as_in_freedom.rms_and_free_software.sam_williams.sst
+.I sisu \-CC
+.PP
+then run:
+.PP
+.I sisu \-1 free_as_in_freedom.rms_and_free_software.sam_williams.sst
.PP
or the same:
.PP
- sisu \-NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst
+.I sisu \-NhwpoabxXyv free_as_in_freedom.rms_and_free_software.sam_williams.sst
.PP
look at output results, see the "sisu_manifest" page created for the document
.PP
-To generate an online document move to a writable directory, (create a work
-directory and cd into it) as the file will be downloaded there and e.g.
+for an overview of your current sisu setup, type:
+.PP
+.I sisu \-\-help env
+.PP
+or
+.PP
+.I sisu \-V
+.PP
+To generate a document from a remote url accessible location move to a
+writable directory, (create a work directory and cd into it) as the file will
+be downloaded there and e.g.
.PP
.I sisu \-1 http://www.jus.uio.no/sisu/gpl3.fsf/gpl3.fsf.sst
.PP
@@ -103,11 +114,15 @@ gvim free_as_in_freedom.rms_and_free_software.sam_williams.sst
additional markup samples in
.I <http://www.jus.uio.no/sisu/SiSU/2.html>
.PP
-it should also be possible to run sisu against sisupods (prepared zip files, created by running the command sisu -S [filename]), whether stored locally or remotely.
+it should also be possible to run sisu against sisupods (prepared zip files,
+created by running the command sisu \-S [filename]), whether stored locally or
+remotely.
.PP
.I sisu \-3 http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip
.PP
-there is a security issue associated with the running of document skins that are not your own, so these are turned of by default, and the use of the following command, which switches on the associated skin is not recommended:
+there is a security issue associated with the running of document skins that
+are not your own, so these are turned of by default, and the use of the
+following command, which switches on the associated skin is not recommended:
.PP
.I sisu \-3 \-\-trust http://www.jus.uio.no/sisu/free_culture.lawrence_lessig/sisupod.zip
.PP
@@ -174,43 +189,83 @@ SiSU):
.PP
Package: sisu
.PP
-Depends: ruby (>= 1.8.4), libwebrick-ruby
+Depends: ruby (>= 1.8.2), libwebrick\-ruby, unzip, zip
.PP
-Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, librmagick-ruby, trang,
- tidy, librexml-ruby, zip, unzip, openssl, rsync, openssh-client \| lsh-client,
- keychain, hyperestraier, kdissert
+Conflicts: vim\-sisu, sisu\-vim, sisu\-remote
.PP
-Suggests: libfcgi-ruby1.8, rcs \| cvs, lv, texinfo, pinfo, rename
+Replaces: vim\-sisu, sisu\-vim
.PP
-Package: sisu-complete
+Recommends: sisu\-pdf, sisu\-sqlite, sisu\-postgresql, librmagick\-ruby, trang,
+tidy, librexml\-ruby, openssl, rsync, openssh\-client \| lsh\-client, keychain,
+hyperestraier, kdissert Suggests: rcs \| cvs, lv, texinfo, pinfo
.PP
-Depends: ruby (>= 1.8.4), sisu, sisu-pdf, sisu-postgresql, sisu-sqlite
+Package: sisu\-complete
+.PP
+Depends: ruby (>= 1.8.2), sisu, sisu\-pdf, sisu\-postgresql, sisu\-sqlite
.PP
Recommends: hyperestraier
.PP
-Package: sisu-pdf
+Package: sisu\-pdf
.PP
-Depends: sisu, tetex-bin \| texlive-base-bin, tetex-extra \| texlive-latex-extra,
- texlive-latex-extra, latex-ucs
+Depends: sisu, texlive\-latex\-base, texlive\-fonts\-recommended,
+texlive\-latex\-recommended, texlive\-latex\-extra
.PP
Suggests: evince, xpdf
.PP
-Package: sisu-postgresql
+Package: sisu\-postgresql
.PP
-Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
+Depends: sisu, libdbd\-pg\-ruby, libdbi\-ruby, libdbm\-ruby, postgresql
.PP
-Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1
+Recommends: libfcgi\-ruby
.PP
-Package: sisu-sqlite
+Package: sisu\-sqlite
.PP
-Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
+Depends: sisu, sqlite, libdbd\-sqlite\-ruby, libdbi\-ruby, libdbm\-ruby
.PP
-Suggests: libdbd-sqlite
+Recommends: libfcgi\-ruby
.PP
-Package: sisu-markup-samples
+Package: sisu\-markup\-samples
.PP
Depends: sisu
.PP
+.SH Package Description
+.B sisu
+.PP
+Description: documents \- structuring, publishing in multiple formats and search
+.PP
+SiSU is a lightweight markup based, command line oriented, document
+structuring, publishing and search framework for document collections.
+.PP
+With minimal preparation of a plain\-text, (UTF\-8) file, using its native markup
+syntax in your text editor of choice, SiSU can generate various document
+formats (most of which share a common object numbering system for locating
+content), including plain text, HTML, XHTML, XML, OpenDocument text (ODF:ODT),
+LaTeX, PDF files, and populate an SQL database with objects (roughly
+paragraph\-sized chunks) so searches may be performed and matches returned with
+that degree of granularity: your search criteria is met by these documents and
+at these locations within each document. Object numbering is particularly
+suitable for "published" works (finalized texts as opposed to works that are
+frequently changed or updated) for which it provides a fixed means of reference
+of content. Document outputs also share semantic meta\-data provided.
+.PP
+SiSU also provides concordance files, document content certificates and
+manifests of generated output.
+.PP
+A vim syntax highlighting file and an ftplugin with folds for sisu markup is
+provided, as are syntax highlighting files for kate, kwrite, gedit and
+diakonos. Vim 7 includes syntax highlighting for SiSU.
+.PP
+man pages, and interactive help are provided.
+.PP
+Dependencies for various features are taken care of in sisu related packages.
+The package sisu\-complete installs the whole of SiSU.
+.PP
+Additional document markup samples are provided in the package
+sisu\-markup\-samples which is found in the non\-free archive the licenses for
+the substantive content of the marked up documents provided is that provided
+by the author or original publisher.
+.PP
+Homepage: <http://www.jus.uio.no/sisu>
.fi
.\"%% Configuration Files
.SH DOCUMENT RESOURCE CONFIGURATION
@@ -235,7 +290,8 @@ sub\-directories located at the following paths:
.I /etc/sisu/skin
.fi
.PP
-more specifically, the following locations (or their /etc/sisu equivalent) should be used:
+more specifically, the following locations (or their /etc/sisu equivalent)
+should be used:
.PP
.I ~/.sisu/skin/doc
skins for individual documents;
@@ -249,7 +305,8 @@ modifying the site\-wide appearance of documents.
.PP
Usually all skin files are placed in the document skin directory:
.I ~/.sisu/skin/doc
-with softlinks being made to the skins contained there from other skin directories as required.
+with softlinks being made to the skins contained there from other skin
+directories as required.
.\"%% Further Information
.SH FURTHER INFORMATION
.PP
diff --git a/install b/sisu-install
index 78ad16a4..3d78c6c1 100644..100755
--- a/install
+++ b/sisu-install
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
-# install - Monolithic rant script, autogenerated by rant-import 0.5.8.
+# sisu-install - Monolithic rant script, autogenerated by rant-import 0.5.8.
#
# Copyright (C) 2005 Stefan Lang <langstefan@gmx.at>
#