aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/texinfo_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4/texinfo_format.rb')
-rw-r--r--lib/sisu/v4/texinfo_format.rb76
1 files changed, 24 insertions, 52 deletions
diff --git a/lib/sisu/v4/texinfo_format.rb b/lib/sisu/v4/texinfo_format.rb
index 04fb06f6..7bfa4e39 100644
--- a/lib/sisu/v4/texinfo_format.rb
+++ b/lib/sisu/v4/texinfo_format.rb
@@ -68,8 +68,8 @@ module SiSU_TexInfoFormat
@@tex_1='\\\\~' #?? debug
@@tabular="{tabular}"
@@tex_pattern_margin_number="\\\\marginpar.+?\s+"
- def initialize(md,dob=nil)
- @md,@dob=md,dob
+ def initialize(md,dob=nil,up='')
+ @md,@dob,@up=md,dob,up
if dob.is_a?(Hash)
p dob.class
p caller
@@ -91,7 +91,7 @@ module SiSU_TexInfoFormat
subtitle=subtitle.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{Tex[:backslash]*2} ").
gsub(/\$/,"\\$").
gsub(/[,]\s*/,' - ')
- subtitle="@subtitle @value{VERSION}, @value{UPDATED}\n" #bugwatch
+ subtitle="\n@subtitle #{subtitle}\n"
end
subtitle ||=''
author=@md.author if @md.author
@@ -102,7 +102,7 @@ module SiSU_TexInfoFormat
\\input texinfo @c -*-texinfo-*-
@comment %**start of header
@setfilename #{@md.fnb}.info
-@settitle #{title} @value{VERSION}
+@settitle #{title}
@syncodeindex pg cp
@comment %**end of header
@c %% 2
@@ -138,7 +138,6 @@ WOK
@c %% 3
@titlepage
@title #{title}
-@value{VERSION}, @value{UPDATED}
@author #{author}
@page
@vskip 0pt plus 1filll
@@ -293,66 +292,41 @@ WOK
end
def menu
dob=clean(@dob)
- m=dob.obj
- m=m.gsub(/[:,]\s*/,' - ').
+ m=dob.obj.gsub(/[:,]\s*/,' - ').
gsub(/@footnote\{.+?\}\s+/,'')
m="* #{m}::"
end
- def level1
+ def level_common
dob=clean(@dob)
- nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'')
- dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n"
+ nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'').
+ gsub(/: \s*/,' - ')
+ dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n\n"
dob
end
- def level2
+ def level_sub(up)
dob=clean(@dob)
- nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'')
- dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n"
+ nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'').
+ gsub(/: \s*/,' - ')
+ dob.obj="@node #{nd}, #{up}\n@comment node-name, up\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n\n"
dob
end
+ def level1
+ level_common
+ end
+ def level2
+ level_common
+ end
def level3
- dob=clean(@dob)
- nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'')
- dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n"
- dob
+ level_common
end
def level4
- dob=clean(@dob)
- nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'')
- dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n"
- dob
+ level_common
end
def level5
- dob=clean(@dob)
- nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'')
- dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n"
- dob
+ level_sub(@up)
end
def level6
- dob=clean(@dob)
- nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'')
- dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n"
- dob
- end
- def submenu
- @dob.obj=@dob.obj.join("\n")
- @dob.obj=@dob.obj.gsub(/[5]\\+~\S+/,'')
- dob=clean(@dob)
- dob.obj="@menu\n#{dob.obj}\n@end menu\n\n".
- gsub(/.+/m,"#{dob.obj}")
- end
- def subsubmenu
- @dob.obj=@dob.obj.join("\n")
- @dob.obj=@dob.obj.gsub(/[6]\\+~\S+/,'')
- dob=clean(@dob)
- dob.obj="@menu\n#{dob.obj}\n@end menu\n\n".
- gsub(/.+/m,"#{dob.obj}")
- end
- def indent1
- @dob.obj=@dob.obj.gsub(/<:i1>(.*)/,'\1')
- end
- def indent2
- @dob.obj=@dob.obj.gsub(/<:i2>(.*)/,'\1')
+ level_sub(@up)
end
def spec_char(txt) # special characters
txt=txt.gsub(/#{Mx[:br_eof]}/i,'').
@@ -554,16 +528,14 @@ WOK
end
def submenu
txt=@txt.join("\n")
- txt=txt.gsub(/[5]\\+~\S+/,'')
txt=clean(@dob,txt)
txt="@menu\n#{txt}\n@end menu\n\n"
txt=txt.gsub(/.+/m,"#{txt}")
end
def subsubmenu
txt=@txt.join("\n")
- txt=txt.gsub(/[6]\\+~\S+/,'')
txt=clean(@dob,txt)
- txt="@menu\n#{dob.obj}\n@end menu\n\n"
+ txt="@menu\n#{txt}\n@end menu\n\n"
txt=txt.gsub(/.+/m,"#{txt}")
end
end