aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-10-11 22:27:20 -0400
committerRalph Amissah <ralph@amissah.com>2010-10-11 22:27:20 -0400
commit3ca7f281d098dcc96ad89dba85839764856ac703 (patch)
treefe575226a7ed41d7a6caee38e422a0cf65fad985
parentCHANGELOG v2, recount where some requests came from (diff)
sisu_convert, basic conversion script, preliminary fix
-rw-r--r--CHANGELOG_v23
-rw-r--r--data/doc/sisu/v2/CHANGELOG3
-rw-r--r--data/sisu/v2/conf/convert/sisu_convert72
3 files changed, 42 insertions, 36 deletions
diff --git a/CHANGELOG_v2 b/CHANGELOG_v2
index 77e66fd0..16fabd8a 100644
--- a/CHANGELOG_v2
+++ b/CHANGELOG_v2
@@ -18,6 +18,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.6.orig.tar.gz
sisu_2.7.6-1.dsc
sisu_2.7.6-1.diff.gz
+ * sisu_convert, basic conversion script (seldom used/tested) start to get it
+ working again
+
* CHANGELOG v2 recount where some requests came from
%% 2.7.5.orig.tar.gz (2010-10-09:40/6)
diff --git a/data/doc/sisu/v2/CHANGELOG b/data/doc/sisu/v2/CHANGELOG
index 1415cd46..c70db845 100644
--- a/data/doc/sisu/v2/CHANGELOG
+++ b/data/doc/sisu/v2/CHANGELOG
@@ -18,6 +18,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.6.orig.tar.gz
sisu_2.7.6-1.dsc
sisu_2.7.6-1.diff.gz
+ * sisu_convert, basic conversion script (seldom used/tested) start to get it
+ working again
+
* CHANGELOG v2 recount where some requests came from
%% 2.7.5.orig.tar.gz (2010-10-09:40/6)
diff --git a/data/sisu/v2/conf/convert/sisu_convert b/data/sisu/v2/conf/convert/sisu_convert
index 7be075fc..a3a12189 100644
--- a/data/sisu/v2/conf/convert/sisu_convert
+++ b/data/sisu/v2/conf/convert/sisu_convert
@@ -8,16 +8,12 @@
# * Name: SiSU information Structuring Universe
# * Author: Ralph@Amissah.com
# * Description: document conversion tool, to sisu from other formats
-# * arch-tag: document conversion tool to sisu markup
-# * $Date: 2004/10/16 15:51:06 $
-# * $Id: sisu_convert,v 1.37 2004/10/16 15:51:06 ralph Exp $
# * License: GPL 3 or later
# * Notes: word conversion uses wvWare and wvSiSU.xml (a modified/stripped wvHtml.xml)
# * http://wvware.sourceforge.net/
# * http://sourceforge.net/projects/wvware
# * <url:sisu.lnk>|sisu.lnk|@|^|
# * <url:sisu>
-# * <url:zxy_param.rb>|zxy_param.rb|@|^|
module CONVERT
class MyOutput
def initialize(data, filename, instruct)
@@ -27,47 +23,45 @@ module CONVERT
end
def headerBasic
<<WOK
-@title:
+% SiSU 2.0
-@subtitle:
+@title:
+ :subtitle:
@creator:
+ :author:
-@type:
-
-@subject:
+@classify:
+ :topic_register:
@date:
-
-@date.available:
-
-@publisher: SiSU
+ :published:
@rights:
-
-@level:
+ :copyright:
+ :license:
WOK
end
def headerDefault
<<WOK
-@title:
+% SiSU 2.0
-@subtitle:
+@title:
+ :subtitle:
@creator:
+ :author:
-@type:
-
-@subject:
+@classify:
+ :topic_register:
@date:
-
-@date.available:
-
-@publisher: SiSU
+ :published:
@rights:
+ :copyright:
+ :license:
WOK
end
@@ -127,14 +121,14 @@ WOK
data.each do |para|
para.strip!
para.gsub!(/\s+/,' ')
- para.gsub!(/^<b>(Chapter|Article)(.+?)<\/b>/i,'4~ \1 \2') #watch case insensitivity
- para.gsub!(/^<b>(Part|Section|Book)(.+?)<\/b>/i,'3~ \1 \2') #watch case insensitivity
- para.gsub!(/^<b>(\d+\.\d+\.\d+\.?)(.+?)<\/b>/i,'6~ \1 \2') #numeric, decide what to do, can be different
- para.gsub!(/^<b>(\d+\.\d+\.?)(.+?)<\/b>/i,'5~ \1 \2') #numeric, decide what to do, can be different
+ para.gsub!(/^<b>(Chapter|Article)(.+?)<\/b>/i,'1~ \1 \2') #watch case insensitivity
+ para.gsub!(/^<b>(Part|Section|Book)(.+?)<\/b>/i,':C~ \1 \2') #watch case insensitivity
+ para.gsub!(/^<b>(\d+\.\d+\.\d+\.?)(.+?)<\/b>/i,'3~ \1 \2') #numeric, decide what to do, can be different
+ para.gsub!(/^<b>(\d+\.\d+\.?)(.+?)<\/b>/i,'2~ \1 \2') #numeric, decide what to do, can be different
para.gsub!(/^<b>(\d.+?)<\/b>/i,'4~ \1 \2') #numeric, decide what to do, can be different
#para.gsub!(/^<b>([\d.]+?)<\/b>/i,'4~ \1 \2') #numeric, decide what to do, can be different
para.gsub!(/<u>(.+?)<\/u>/,'_{\1}_')
- para.gsub!(/<b>(.+?)<\/b>/,'*{\1}*')
+ para.gsub!(/<b>(.+?)<\/b>/,'!{\1}!')
para.gsub!(/<i>(.+?)<\/i>/,'/{\1}/')
tuned_file << para unless para == nil
end
@@ -468,14 +462,19 @@ def do_word(argv, instruct)
end
def do_html(argv, instruct)
argv.each do |f|
- if f =~/.+?\.html$/
- @argv << f[/(.+?)\.html$/, 1]
+ if f =~/.+?\.html?$/
+ @argv << f[/(.+?)\.html?$/, 1]
else
print "not .html? << #{f} >> "
end
end
@argv.each do |filename|
- file_array=IO.readlines("#{filename}.html","\n\r")
+ file_end=if FileTest.file?("#{filename}.html")
+ 'html'
+ elsif FileTest.file?("#{filename}.htm")
+ 'htm'
+ end
+ file_array=IO.readlines("#{filename}.#{file_end}","\n\r")
CONVERT::Html.new(file_array,filename,instruct).songsheet # metaverse created here
end
end
@@ -505,13 +504,14 @@ def cases(argv, instruct)
end
end
$KCODE='u'
-branch='v0'
-SiSU_lib="sisu/#{branch}"
+branch='v2'
+@argv=Array.new
+argv=$*
+SiSU_version_dir=(argv.inspect=~/--v1/) ? 'v1' : 'v2'
+SiSU_lib="sisu/#{SiSU_version_dir}"
require "#{SiSU_lib}/sysenv"
include SiSU_Env
@dir=SiSU_Env::Info_env.new
-@argv=Array.new
-argv=$*
instruct = "#{argv[0].to_s}"
argv.shift
instruct.chomp!