aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/texinfo.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/texinfo.rb')
-rw-r--r--lib/sisu/v3dv/texinfo.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/sisu/v3dv/texinfo.rb b/lib/sisu/v3dv/texinfo.rb
index 45af0550..121cf1ae 100644
--- a/lib/sisu/v3dv/texinfo.rb
+++ b/lib/sisu/v3dv/texinfo.rb
@@ -156,24 +156,24 @@ module SiSU_TexInfo
if dob.is =='table'
@@flag['tables']='y' # KLUDGE get from param
end
- dob.obj.gsub!(/<:p[bn]>/,'')
- dob.obj.gsub!(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1(\2 [linked to:] \3)')
- dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s)\{(.+?)\}((?:https?|file):\/\/\S+)/,'\1(\2 [linked to:] \3)')
+ dob.obj=dob.obj.gsub(/<:p[bn]>/,'').
+ gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1(\2 [linked to:] \3)').
+ gsub(/(^|#{Mx[:gl_c]}|\s)\{(.+?)\}((?:https?|file):\/\/\S+)/,'\1(\2 [linked to:] \3)')
do_mono=SiSU_TexInfoFormat::Texinfo.new(@md,dob)
dob.obj=do_mono.spec_char(dob.obj)
end
data
end
def endnote
- data=@data
+ data,data_new=@data,[]
data.each do |dob|
if dob.of=~/para|block/
- dob.obj.gsub!(/\s*#{Mx[:en_a_o]}(?:\d+)\s+(.+?)#{Mx[:en_a_c]}/m,' @footnote{ \1} ')
- dob.obj.gsub!(/\s*#{Mx[:en_a_o]}(\*+)\s+(.+?)#{Mx[:en_a_c]}/m,' @footnote{ \1} ')
+ dob.obj=dob.obj.gsub(/\s*#{Mx[:en_a_o]}(?:\d+)\s+(.+?)#{Mx[:en_a_c]}/m,' @footnote{ \1} ').
+ gsub(/\s*#{Mx[:en_a_o]}(\*+)\s+(.+?)#{Mx[:en_a_c]}/m,' @footnote{ \1} ')
end
- dob
+ data_new << dob
end
- data
+ data_new
end
def poem
data=@data
@@ -216,16 +216,17 @@ module SiSU_TexInfo
end
end
def code_lines
- data=@data
+ data,data_new=@data,[]
data.each do |line|
if line =~ /\S/ \
and line !~ /#{Mx[:gr_o]}(code|verse).+/ #fix
- if @@flag['code']
- line.gsub!(/^\s*(.+)/m,"\\noindent \\marginpar\[left-text\]{\\begin{tiny}#{@@counting}\\end{tiny}}\\1\\")
+ line=if @@flag['code']
+ line.gsub(/^\s*(.+)/m,"\\noindent \\marginpar\[left-text\]{\\begin{tiny}#{@@counting}\\end{tiny}}\\1\\")
@@counting+=1 if @@flag['code']
- else line.gsub!(/(.+)/m,'\noindent\1')
+ else line.gsub(/(.+)/m,'\noindent\1')
end
end
+ data_new << line
end
end
def tables
@@ -275,10 +276,10 @@ module SiSU_TexInfo
@subsubmenu[n_submenu] << toc.menu
end
else
- dob.obj.gsub!(/\s*(?:<:?br>|<br \/>)\s*/,"\n\n")
+ dob.obj=dob.obj.gsub(/\s*(?:<:?br>|<br \/>)\s*/,"\n\n")
end
end
- texinfo_menu.compact!
+ texinfo_menu=texinfo_menu.compact
texinfo_menu << "* Dublin Core::"
@tex_file << texinfo_menu
@tex_file << "* Index::\n" +
@@ -326,7 +327,7 @@ module SiSU_TexInfo
end
end
#%case with endnotes
- dob.obj.gsub!(/\s*[0-8]\\+(\S+)?\s+/,' ') if dob.obj
+ dob.obj=dob.obj.gsub(/\s*[0-8]\\+(\S+)?\s+/,' ') if dob.obj
@tex_file << dob.obj if dob.obj and dob.is !~/structure|comment/ #sort exceptions
end
data=@tex_file
@@ -343,13 +344,13 @@ module SiSU_TexInfo
and dob.obj !~ /#{Rx[:meta]}/
if dob.obj =~ /^[1-6]\\+(?:~\S+)?\s*<!h-.+?-!>/ \
and dob.obj !~ /<:\d-endnotes>/
- header=dob.obj[/<!h-(.+?)-!>/m, 1].gsub!(/-/m,'.')
- dob.obj.gsub!(/^(?:[1-6]\\+(?:~\S+)|<:([12356]|4-.+?-)>)\s*<!h-.+?-!>/,
+ header=dob.obj[/<!h-(.+?)-!>/m, 1].gsub(/-/m,'.')
+ dob.obj=dob.obj.gsub(/^(?:[1-6]\\+(?:~\S+)|<:([12356]|4-.+?-)>)\s*<!h-.+?-!>/,
"\\1 #{header} ")
end
elsif dob.obj=~ /<!h!>|<!h\d!>|<!h.+?!>|<!!h.+?!>/
if dob.obj=~ /<!h-.+?-!>/
- dob.obj.gsub!(/<!h-(.+?)-!>/,'\1 ')
+ dob.obj=dob.obj.gsub(/<!h-(.+?)-!>/,'\1 ')
end
end
@tex_file << dob.obj
@@ -363,8 +364,7 @@ module SiSU_TexInfo
data << tex.tail
end
def output
- data=@data
- data.compact!
+ data=@data.compact
filename_texinfo=%{#{@env.processing_path.texi}/#{@md.fnb}.texinfo}
file_texinfo=File.new(filename_texinfo,'w+')
puts filename_texinfo if @md.opt.cmd =~/M/