aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/texinfo.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/texinfo.rb')
-rw-r--r--lib/sisu/v0/texinfo.rb29
1 files changed, 16 insertions, 13 deletions
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