aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-01-12 21:25:51 -0500
committerRalph Amissah <ralph@amissah.com>2014-01-12 21:25:51 -0500
commit4aa58e16055fd24b7958c50397a27795105743e6 (patch)
tree73337afbfd59a9e501b88bebaf06c4c3014e43e8 /lib
parentv5: ao, counter for various grouped / blocked texts & tables (diff)
v5: heading recalibration, code (downstream) changes, continue
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v5/constants.rb4
-rw-r--r--lib/sisu/v5/manpage.rb12
-rw-r--r--lib/sisu/v5/manpage_format.rb14
-rw-r--r--lib/sisu/v5/texinfo.rb3
-rw-r--r--lib/sisu/v5/texinfo_format.rb3
-rw-r--r--lib/sisu/v5/txt_asciidoc.rb4
-rw-r--r--lib/sisu/v5/txt_markdown.rb2
-rw-r--r--lib/sisu/v5/txt_rst.rb1
-rw-r--r--lib/sisu/v5/txt_textile.rb1
-rw-r--r--lib/sisu/v5/xml_docbook5.rb23
10 files changed, 25 insertions, 42 deletions
diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb
index 1b7cccea..b89f9be8 100644
--- a/lib/sisu/v5/constants.rb
+++ b/lib/sisu/v5/constants.rb
@@ -102,6 +102,7 @@ Xx={
}
Mx={
meta_o: '〔@', meta_c: '〕',
+ lv_o_0: 0,
lv_o_1: 1,
lv_o_2: 2,
lv_o_3: 3,
@@ -175,7 +176,8 @@ Hx={
#Mx[:sm_subset_o]='∈ '; Mx[:sm_subset_c]='∋ '
Rx={
mx_fa_clean: /#{Mx[:fa_o]}.+?#{Mx[:fa_c]}|#{Mx[:pa_o]}.+?#{Mx[:pa_c]}|#{Mx[:mk_o]}.+?#{Mx[:mk_c]}/,
- lv: /〔([1-9]):(\S*?)〕/,
+ lv: /〔([0-9]):(\S*?)〕/,
+ lv_0: /#{Mx[:lv_o_0]}(\S*?)#{Mx[:lv_c]}/,
lv_1: /#{Mx[:lv_o_1]}(\S*?)#{Mx[:lv_c]}/,
lv_2: /#{Mx[:lv_o_2]}(\S*?)#{Mx[:lv_c]}/,
lv_3: /#{Mx[:lv_o_3]}(\S*?)#{Mx[:lv_c]}/,
diff --git a/lib/sisu/v5/manpage.rb b/lib/sisu/v5/manpage.rb
index 0fe2b0b1..e675da3b 100644
--- a/lib/sisu/v5/manpage.rb
+++ b/lib/sisu/v5/manpage.rb
@@ -238,8 +238,8 @@ WOK
times=wrapped.length
times=78 if times > 78
@manpage[:body] << case lv
- when 1 then '.SH ' << wrapped.upcase << break_line << break_line
- when 2..3 then '.SH ' << wrapped.upcase << break_line << break_line
+ when 0 then '.SH ' << wrapped.upcase << break_line << break_line
+ when 1..3 then '.SH ' << wrapped.upcase << break_line << break_line
when 4 then '.SH ' << wrapped.upcase << break_line << break_line
when 5..6 then '.SH ' << wrapped.upcase << break_line << break_line
end
@@ -340,14 +340,6 @@ WOK
x=SiSU_ManpageFormat::FormatTextObject.new(@md,dob)
if dob.is==:heading
manpage_structure(dob)
- dob.obj=case dob.ln
- when 1 then x.heading_body1
- when 2 then x.heading_body2
- when 3 then x.heading_body3
- when 4 then x.heading_body4
- when 5 then x.heading_body5
- when 6 then x.heading_body6
- end
elsif dob.is==:para
manpage_structure(dob)
else
diff --git a/lib/sisu/v5/manpage_format.rb b/lib/sisu/v5/manpage_format.rb
index dae1d6b3..7a9ea98b 100644
--- a/lib/sisu/v5/manpage_format.rb
+++ b/lib/sisu/v5/manpage_format.rb
@@ -88,20 +88,6 @@ module SiSU_ManpageFormat
def scr_endnote_body
"<endnote>#{@dob.obj}</endnote> "
end
- def heading_body1
- end
- def heading_body2
- end
- def heading_body3
- end
- def heading_body4
- end
- def heading_body5
- end
- def heading_body6
- end
- end
- class XML
end
end
__END__
diff --git a/lib/sisu/v5/texinfo.rb b/lib/sisu/v5/texinfo.rb
index c18b4b1e..955b1060 100644
--- a/lib/sisu/v5/texinfo.rb
+++ b/lib/sisu/v5/texinfo.rb
@@ -272,7 +272,7 @@ module SiSU_TexInfo
@submenu,@subsubmenu={},{}
data.each do |dob|
if dob.is ==:heading \
- && (dob.ln.to_s =~ /^[1-3]$/)
+ && (dob.ln.to_s =~ /^[0-3]$/)
toc=SiSU_TexInfoFormat::Texinfo.new(@md,dob)
texinfo_menu << toc.menu
elsif dob.is ==:heading \
@@ -313,6 +313,7 @@ module SiSU_TexInfo
end
if dob.is==:heading
case dob.ln
+ when 0 then dob=mono.level0
when 1 then dob=mono.level1
when 2 then dob=mono.level2
when 3 then dob=mono.level3
diff --git a/lib/sisu/v5/texinfo_format.rb b/lib/sisu/v5/texinfo_format.rb
index 5d513041..4286f50b 100644
--- a/lib/sisu/v5/texinfo_format.rb
+++ b/lib/sisu/v5/texinfo_format.rb
@@ -311,6 +311,9 @@ WOK
dob.obj="@node #{nd}, #{up}\n@comment node-name, up\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n\n"
dob
end
+ def level0
+ level_common
+ end
def level1
level_common
end
diff --git a/lib/sisu/v5/txt_asciidoc.rb b/lib/sisu/v5/txt_asciidoc.rb
index 07b8832f..8bdca1a2 100644
--- a/lib/sisu/v5/txt_asciidoc.rb
+++ b/lib/sisu/v5/txt_asciidoc.rb
@@ -258,7 +258,7 @@ WOK
'+'
end
def l5
- '' #'.' #proposed
+ '.' #'.' #proposed
end
self
end
@@ -368,6 +368,7 @@ WOK
def heading_decorated_inline(dob)
if dob.is==:heading
heading_inline = case dob.lc
+ when 0 then decorate.heading.inline.l0
when 1 then decorate.heading.inline.l1
when 2 then decorate.heading.inline.l2
when 3 then decorate.heading.inline.l3
@@ -382,6 +383,7 @@ WOK
if dob.is==:heading
#times=@wrap_width if times > @wrap_width
case dob.lc
+ when 0 then decorate.heading.underscore.l0*times + p_num << break_line*2
when 1 then decorate.heading.underscore.l1*times + p_num << break_line*2
when 2 then decorate.heading.underscore.l2*times + p_num << break_line*2
when 3 then decorate.heading.underscore.l3*times + p_num << break_line*2
diff --git a/lib/sisu/v5/txt_markdown.rb b/lib/sisu/v5/txt_markdown.rb
index 96aca820..8b081349 100644
--- a/lib/sisu/v5/txt_markdown.rb
+++ b/lib/sisu/v5/txt_markdown.rb
@@ -368,6 +368,7 @@ WOK
def heading_decorated_inline(dob)
if dob.is==:heading
heading_inline = case dob.lc
+ when 0 then decorate.heading.inline.l0
when 1 then decorate.heading.inline.l1
when 2 then decorate.heading.inline.l2
when 3 then decorate.heading.inline.l3
@@ -382,6 +383,7 @@ WOK
if dob.is==:heading
#times=@wrap_width if times > @wrap_width
case dob.lc
+ when 0 then decorate.heading.underscore.l0*times + p_num << break_line*2
when 1 then decorate.heading.underscore.l1*times + p_num << break_line*2
when 2 then decorate.heading.underscore.l2*times + p_num << break_line*2
when 3 then decorate.heading.underscore.l3*times + p_num << break_line*2
diff --git a/lib/sisu/v5/txt_rst.rb b/lib/sisu/v5/txt_rst.rb
index 56a34de2..8565de5f 100644
--- a/lib/sisu/v5/txt_rst.rb
+++ b/lib/sisu/v5/txt_rst.rb
@@ -348,6 +348,7 @@ WOK
if dob.is==:heading
#times=@wrap_width if times > @wrap_width
case dob.lc
+ when 0 then decorate.heading.underscore.l0*times + p_num << break_line*2
when 1 then decorate.heading.underscore.l1*times + p_num << break_line*2
when 2 then decorate.heading.underscore.l2*times + p_num << break_line*2
when 3 then decorate.heading.underscore.l3*times + p_num << break_line*2
diff --git a/lib/sisu/v5/txt_textile.rb b/lib/sisu/v5/txt_textile.rb
index 5645f490..7b9f10a8 100644
--- a/lib/sisu/v5/txt_textile.rb
+++ b/lib/sisu/v5/txt_textile.rb
@@ -346,6 +346,7 @@ WOK
end
def heading_decorated_inline(dob)
heading_inline = case dob.lc
+ when 0 then decorate.heading.inline.l0
when 1 then decorate.heading.inline.l1
when 2 then decorate.heading.inline.l2
when 3 then decorate.heading.inline.l3
diff --git a/lib/sisu/v5/xml_docbook5.rb b/lib/sisu/v5/xml_docbook5.rb
index 0dddf264..be9ad802 100644
--- a/lib/sisu/v5/xml_docbook5.rb
+++ b/lib/sisu/v5/xml_docbook5.rb
@@ -136,20 +136,13 @@ module SiSU_XML_Docbook_Book
end
def docbook(lc,chlv='')
case lc
- when 0
- 'book'
- when 1
- lc==chlv ? 'chapter' : 'section'
- when 2
- lc==chlv ? 'chapter' : 'section'
- when 3
- lc==chlv ? 'chapter' : 'section'
- when 4
- 'section'
- when 5
- 'section'
- when 6
- 'section'
+ when 0 then 'book'
+ when 1 then lc==chlv ? 'chapter' : 'section'
+ when 2 then lc==chlv ? 'chapter' : 'section'
+ when 3 then lc==chlv ? 'chapter' : 'section'
+ when 4 then 'section'
+ when 5 then 'section'
+ when 6 then 'section'
end
end
self
@@ -181,7 +174,7 @@ module SiSU_XML_Docbook_Book
put(tail)
end
def output(o,comment='')
- puts o.lc == 0..6 \
+ puts o.lc == (0..6) \
? "#{space*o.lc}<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}"
: "<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}"
end