From 4b51bc00cda70d3c118401a74f1704df38c947a3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Feb 2011 09:48:30 -0500 Subject: v3 introduced as development branch, invoked using "sisu --v3 [instructions] --- lib/sisu/v3/epub_format.rb | 2030 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2030 insertions(+) create mode 100644 lib/sisu/v3/epub_format.rb (limited to 'lib/sisu/v3/epub_format.rb') diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb new file mode 100644 index 00000000..c189eb3a --- /dev/null +++ b/lib/sisu/v3/epub_format.rb @@ -0,0 +1,2030 @@ +# coding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved. + + * License: GPL 3 or later: + + SiSU, a framework for document structuring, publishing and search + + Copyright (C) Ralph Amissah + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program. If not, see . + + If you have Internet connection, the latest version of the GPL should be + available at these locations: + + + + + + + + * SiSU uses: + * Standard SiSU markup syntax, + * Standard SiSU meta-markup syntax, and the + * Standard SiSU object citation numbering and system + + * Hompages: + + + + * Download: + + + * Ralph Amissah + + + + ** Description: epub formating, css template + +=end +module SiSU_EPUB_Format + include SiSU_Viz + class Paragraph_number + def initialize(md,ocn) + @md,@ocn=md,ocn.to_s + @ocn ||='' + vz=SiSU_Env::Get_init.instance.skin + @skin_no_ocn=if defined? vz.ocn_display_off \ + and vz.ocn_display_off==true + true + else false + end + end + def ocn_display + if @md.markup.inspect =~/no_ocn/ \ + or @md.mod.inspect =~/--no-ocn/ \ + or @skin_no_ocn + ocn_class='ocn_off' + @ocn.gsub(/^(\d+|)$/, + %{}) + elsif @ocn.to_i==0 + @ocn.gsub(/^(\d+|)$/, + %{}) + else + ocn_class='ocn' + @ocn.gsub(/^(\d+|)$/, + %{}) + end + end + def name + %{} + end + def id #w3c? "tidy" complains about numbers as identifiers ! annoying + %{id="o#{@ocn}"} + end + def goto + %{} + end + end + class Css + def css_epub_xhtml +< + + +WOK + end +=begin +~/epub + |-- META-INF + | `-- container.xml #✓ simple, make sure full-path of rootfile points to metadata.opf + |-- content + | |-- 1.xhtml + | |-- 2.xhtml + | |-- 3.xhtml + | |-- ... .xhtml + | |-- concordance.xhtml + | |-- css + | | `-- xhtml.css + | |-- endnotes.xhtml + | |-- image + | | |-- arrow_next_red.png + | | |-- arrow_prev_red.png + | | |-- arrow_up_red.png + | | `-- bullet_09.png + | |-- index.xhtml + | |-- meta.xhtml + | |-- metadata.xhtml + | `-- toc.xhtml + |-- metadata.opf #(i) metadata dc; (ii) manifest (contents); (iii) spine (mimetypes) + |-- mimetype #✓ application/epub+zip + `-- toc.ncx #✓ (i) head (ii) doc title (iii) navmap, list of navigation points (like chapters) +=end + def doc_type + doc_type_xhtml + end + def mimetype + < + + + + + +WOK + end + def toc_ncx #list of navigation points (like chapters), table of contents, listing each navigation point (chapters and such) under the navigation map + def structure + open + head_open + head + head_close + doc_title + doc_author + navmap_open + #navmap ... + navmap_close + close + end + def open + < +WOK + end + def close + < +WOK + end + def head_open + < +WOK + end + def head + depth=@md.lvs[2] + @md.lvs[3] + @md.lvs[4] + < + + + + + +WOK + end + def head_close + < +WOK + end + def doc_title + < + #{@md.title.full} + +WOK + end + def doc_author + < + #{@md.author} + +WOK + end + def navmap_open + < +WOK + end + def navmap_sisu_toc(no) + < + + Table of Contents + + + +WOK + end + def navpoint(dob,no) + < + + #{dob.obj} + + +WOK + end + def navpoint_top3(dob,no,name) + < + + #{dob.obj} + + +WOK + end + def navpoint_close + < +WOK + end + def navmap_close + < +WOK + end + self + end + def metadata_opf #(i) metadata dc; (ii) manifest (contents); (iii) spine (mimetypes) + def structure + package_open + metadata_open + metadata_close + manifest_open + manifest_close + spine_open + spine_close + package_close + end + def package_open + < + +WOK + end + def package_close + < +WOK + end + def metadata #metadata dc + author=if defined? @md.creator.author \ + and @md.creator.author =~/\S+/ + x=@md.creator.author.gsub!(//,'>') + @md.creator.author.gsub!(/<br(?: \/)?>/,'
') + %{\n #{x}} + else '' + end + illustrator=if defined? @md.creator.illustrator \ + and @md.creator.illustrator =~/\S+/ + x=@md.creator.illustrator.gsub!(//,'>') + @md.creator.illustrator.gsub!(/<br(?: \/)?>/,'
') + %{\n #{x}} + else '' + end + rights=if defined? @md.rights.all \ + and @md.rights.all =~/\S+/ + rights=@md.rights.all.gsub(/
/,'
') + %{\n #{rights}} + else '' + end + < + #{@md.title.full} + #{author}#{illustrator} + en-US + ... + #{rights} + urn:uuid:#{@md.dgst[1]} + +WOK + end + def manifest_open + < + + + + + +WOK + end + def manifest_content_sisu_toc + < +WOK + end + def manifest_content(dob) + < +WOK + end + def manifest_images(imgs) + imgs=imgs + ['arrow_next_red.png','arrow_prev_red.png','arrow_up_red.png','bullet_09.png'] + images=[" \n"] + imgs.each do |i| + image,type=/(\S+?)\.(png|jpg|gif)/.match(i)[1,2] + images<<< +WOK + end + images=images.join('') + images + end + def manifest_close + < +WOK + end + def spine_open + #spine: reading order of HTML files from manifest, idref attribute refers back to id in manifest (exclude images, CSS etc.). + < +WOK + end + def spine_sisu_toc + < +WOK + end + def spine(dob) + < +WOK + end + def spine_close + < +WOK + end + self + end + def toc_head_escript + end + def seg_head_escript + end + def table_close + %{ +#{@vz.table_close}} + end + def buttons_home + %{ + #{@vz.banner_home_and_index_buttons} +} + end + def copyat + %{

copy @ + + #{@vz.txt_home} +

} + end + def xhtml_close + %{#{@vz.credits_sisu_epub} + +} + end + end + class Widget < Head_information + def initialize(md) + super(md) + @md=md + @cf_defaults=SiSU_Env::Info_processing_flag.new + end + def home + %{ + + #{@vz.png_homepage} + +} + end + def search + env=SiSU_Env::Info_env.new(@md.fns,@md) + env.widget.search_form('sisusearch',nil,nil,true) + end + def manifest + %{ + + #{@vz.nav_txt_manifest} + +} + end + end + class XML + end + class Head_toc < Head_information + def initialize(md) + super(md) + @md=md + @tocband_segtoc=make_seg + end + def concordance_navigation_band(type='') + if type=~/pdf/ + @tocband_concordance=make_concordance + end + %{

+ + #{@vz.epub_png_nav_toc} + +

+} + end + def seg_head_navigation_band + firstseg=%{ + #{@vz.epub_png_nav_nxt} + } if @md.firstseg =~/\S+/ + %{

#{firstseg}

} + end + def seg_head_navigation_band_bottom + firstseg=%{ + #{@vz.epub_png_nav_nxt} + } if @md.firstseg =~/\S+/ + %{

#{firstseg}

} + end + def manifest_link(text) #watch fix removed font size 2 + %{ #{text}} + end + def concordance_link(text) #watch fix removed font size 2 + if @md.concord_make + %{ + #{text} + } + else '' + end + end + def make_concordance + manifest=scroll=seg='' + wgt=Widget.new(@md) + %{ + + #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf} +
+ #{wgt.concordance(@vz.nav_txt_concordance)} + #{wgt.manifest} + #{wgt.search} + #{wgt.home} +
} + end + def head + %{#{doc_type} + + +#{@css.xhtml_epub} + +#{@vz.color_body} +#{@vz.js_top}} + end + def concordance + if @md.concord_make + %{#{@vz.margin_css} +

+ + Concordance + +

+#{@vz.table_close}} + else + %{#{@vz.margin_css} +#{@vz.table_close}} + end + end + def links_guide_open(type='horizontal') + if type=='vertical'; links_guide_vertical_open + else links_guide_horizontal_open + end + end + def prefix_a + end + def rights + def all + rghts=@md.rights.all.gsub(/
/,'
') + rghts=rghts.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ') + %{

Rights: #{rghts}

} + end + self + end + def prefix_b + %{

Prefix: #{@md.prefix_b}} + end + def make_seg + concord=concordance_link(@vz.nav_txt_concordance) + %{ + +
+ #{@vz.nav_txt_toc_link} + + + #{concord} +#{@vz.table_close}} + end + def manifest #check structure + manifest=manifest_link(@vz.nav_txt_manifest) + %{#{@vz.margin_txt_3} + #{@vz.paragraph_font_small} + #{manifest} + +#{@vz.table_close}} + end + def concordance #check structure + concord=concordance_link(@vz.nav_txt_concordance) + %{#{@vz.margin_txt_3} + #{@vz.paragraph_font_small} + #{concord} + +#{@vz.table_close}} + end + def metadata + %{#{@vz.margin_css} +

+ + MetaData + +

+#{@vz.table_close}} + end + def seg_metadata + @metalink=%{./#{@md.fn[:metadata]}} + metadata + end + end + class Head_seg < Head_information + def initialize(md) + super(md) + end + def head + %{#{doc_type} + + + #{@seg_name_xhtml[@seg_name_xhtml_tracker]} - + #{@md.html_title} + + +#{@vz.font_css_table_file} + +#{@vz.color_body} +#{@vz.js_top}} + end + def title_banner(title,subtitle,creator) + end + def dot_control_pre_next + %{ + + +
+ + #{@vz.png_nav_dot_pre} + + + + #{@vz.png_nav_dot_toc} + + + + #{@vz.png_nav_dot_nxt} + +#{@vz.table_close}} + end + def dot_control_pre + %{ + + +
+ + #{@vz.png_nav_dot_pre} + + + + #{@vz.png_nav_dot_toc} + + + + #{@vz.png_nav_dot_nxt} + +#{@vz.table_close}} + end + def toc_nav(f_pre=false,f_nxt=false,use=1) + pre=nxt='' + toc=%{ + #{@vz.epub_png_nav_toc} + +} + pre=%{ + #{@vz.epub_png_nav_pre} + +} if f_pre==true + nxt=%{ + #{@vz.epub_png_nav_nxt} + +} if f_nxt==true + %{

+#{pre} +#{toc} +#{nxt} +

+} + end + def toc_next2 + pre,nxt=false,true + toc_nav(false,true).dup + end + def toc_pre_next2 + toc_nav(true,true).dup + end + def toc_pre2 + toc_nav(true,false).dup + end + def manifest_link(text) + %{ + #{text} + } + end + def concordance_link(text) + if @md.concord_make + %{ + #{text} + } + else '' + end + end + def doc_types #used in seg_nav_band ### + scroll=seg='' + wgt=Widget.new(@md) + x=if @md.concord_make + %{ + + + #{wgt.seg(@vz.nav_txt_toc_link)} + #{wgt.scroll(@vz.nav_txt_doc_link)} + #{wgt.pdf}#{wgt.odf} +
+ #{wgt.concordance(@vz.nav_txt_concordance)} + #{wgt.manifest} + #{wgt.search} + #{wgt.home} +
} + else + %{ + + + #{wgt.seg(@vz.nav_txt_toc_link)} + #{wgt.scroll(@vz.nav_txt_doc_link)} + #{wgt.pdf}#{wgt.odf} +
+ #{wgt.manifest} + #{wgt.search} + #{wgt.home} +
} + end + end + def navigation_table + %{ +
+ + + } + end + def navigation_table1 + %{ +
+ } + end + def navigation_table2 + %{ +
+ } + end + def heading_advert_local_1 + dir=SiSU_Env::Info_env.new(@fns) + %{

+ +
+ + #{@md.ad_alt} + +#{@vz.table_close} +

} + end + def heading_advert_local_2 + dir=SiSU_Env::Info_env.new(@fns) + %{

+ +
+ + #{@md.ad_alt} + +#{@vz.table_close} +

} + end + def heading_advert_external + dir=SiSU_Env::Info_env.new(@fns) + %{

+ +
+ + #{@md.ad_alt} + +#{@vz.table_close} +

} + end + def navigation_band(segtocband) #change name to navigaion_band_banner + %{#{segtocband} +} + end + def navigation_band_bottom(segtocband,seg_table_top_control) #change name to navigaion_band_bannerless + %{ +
+ + + +
+ #{doc_types} + + #{segtocband} +
+ #{seg_table_top_control} +
+} + end + def endnote_mark +%{ +
+} + end + def endnote_section_open +%{ +
+} + end + def endnote_section_close +%{ +
+} #revisit + end + def head + %{#{doc_type} + + + #{@seg_name_xhtml[@seg_name_xhtml_tracker]} - + #{@md.html_title} + + +#{@css.xhtml_epub} + +#{@vz.color_body} +#{@vz.js_top}} + end + def toc_metadata + @metalink=%{./#{@md.fn[:metadata]}} + toc_metadata + end + def title_banner(title,subtitle,creator) + end + end + class Head_scroll < Head_toc + def initialize(md) + super(md) + end + def toc_owner_details + %{#{@vz.margin_txt_3} +#{@vz.paragraph_font_small} + + Owner Details + +     + + + +#{@vz.table_close}} + end + end + class Format_text_object + @vz=SiSU_Env::Get_init.instance.skin + attr_accessor :md,:t_o,:txt,:ocn,:format,:table,:link,:linkname,:paranum,:p_num,:headname,:banner,:url + def initialize(md,t_o) + @md,@t_o=md,t_o + if t_o.class==Hash + @txt =t_o[:txt] || nil + @ocn =t_o[:ocn] || nil + @ocn_display =t_o[:ocn_display] || nil + @headname =t_o[:headname] || nil + @trailer =t_o[:trailer] || nil + @endnote_part_a =t_o[:endnote_part_a] || nil + @endnote_part_b =t_o[:endnote_part_b] || nil + @lnk_url =t_o[:lnk_url] || nil + @lnk_txt =t_o[:lnk_txt] || nil + @format =t_o[:format] || nil + @target =t_o[:target] || nil #occasionally passed but not used + if @format and not @format.empty? + if @format=~/^\d:(\S+)/ #need more reliable marker #if @format =~ /#{Rx[:lv]}/ + headname=$1 #format[/\d~(\S+)/m,1] + @headname=if headname =~/^[a-zA-Z]/; %{} #consider: h_#{headname} + else %{} + end + @headname=if headname =~/^[a-zA-Z]/; %{} #consider: h_#{headname} + else %{} + end + end + end + elsif t_o.class.inspect =~/Object/ + @dob=t_o if defined? t_o.is + @named=nametags_seg(@dob) + @txt=((defined? t_o.obj) ? t_o.obj : nil) + @ocn=((defined? t_o.ocn) ? t_o.ocn.to_s : nil) + @headname=((t_o.is=='heading' and defined? t_o.name) ? t_o.name : nil) + else + if @md.cmd =~/M/ + p __FILE__ +':'+ __LINE__.to_s + p t_o.class + p caller + end + end + if @txt and not @txt.empty? + @txt.gsub!(/#{Mx[:mk_o]}[-~]##{Mx[:mk_c]}/,'') + end + @p_num=Paragraph_number.new(@md,@ocn) + @vz=SiSU_Env::Get_init.instance.skin + end + def nametags_seg(dob) #FIX + tags='' + if defined? dob.tags \ + and dob.tags.length > 0 # insert tags "hypertargets" + dob.tags.each do |t| + tags=tags +%{} + end + end + tags + end + def endnote_body + %{ +

+ #{@txt} +

+} + end + def endnote_body_indent + %{ +

+ #{@txt} +

+} + end + def no_paranum + %{ +
+ +

+ #{@txt} +

+
+} + end + def para_form_css(tag,attrib) # regular paragraphs shaped here + ul=ulc='' + ul,ulc="
    \n ","\n
" if @tag =~/li/ + %{ +
+ #{@p_num.ocn_display} + #{ul}<#{tag} class="#{attrib}" #{@p_num.id}> + #{@named}#{@txt} + #{ulc} +
+} + end + def para + para_form_css('p','norm') + end + def group + para_form_css('p','group') + end + def block + para_form_css('p','block') + end + def alt + para_form_css('p','alt') + end + def verse + para_form_css('p','verse') + end + def code + para_form_css('p','code') + end + def center + para_form_css('p','center') + end + def bold + para_form_css('p','bold') + end + def bullet + para_form_css('li','bullet') + end + def table + @txt=if @t_o.obj !~/^
') + @txt.gsub!(/#{Mx[:br_obj]}/,'

') + para_form_css('p','norm') + end + def format(tag,attrib) + para_form_css(tag,attrib) + end + def title_heading(tag,attrib) + %{ +
+<#{tag} class="#{attrib}"> + #{@named}#{@txt} + +
+} + end + def title_heading1 + title_heading('h1','tiny') + end + def title_heading2 + title_heading('h2','tiny') + end + def title_heading3 + title_heading('h3','tiny') + end + def title_heading4 + '' + end + def seg_heading_sub(tag,attrib) + @txt.gsub!(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') + %{ +
+ #{@p_num.ocn_display} + <#{tag} class="#{attrib}" #{@p_num.id}>#{@p_num.name} + #{@named}#{@txt} + +
+} + end + def seg_heading4 + %{ +
+ #{@p_num.ocn_display} +

+ #{@txt} +

+
+} + end + def seg_heading5 + seg_heading_sub('p','bold') + end + def seg_heading6 + seg_heading_sub('p','bold') + end + def dl #check :trailer + "
#{@txt} #{@trailer}
" + end + def table_css_end + '
+

+ ' + end + def gsub_body + case @txt + when /^(?:#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}\s*)?\((i+|iv|v|vi+|ix|x|xi+)\)/ + @txt.gsub!(/^\((i+|iv|v|vi+|ix|x|xi+)\)/,'(\1)') + @txt.gsub!(/^(#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]})\s*\((i+|iv|v|vi+|ix|x|xi+)\)/,'\1(\2)') + when /^(?:#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}\s*)?\(?(\d|[a-z])+\)/ + @txt.gsub!(/^\((\d+|[a-z])+\)/,'(\1)') + @txt.gsub!(/^(#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]})\s*\((\d+|[a-z])+\)/,'\1(\2)') + when /^\s*\d{1,3}\.\s/ + @txt.gsub!(/^\s*(\d+\.)/,'\1') + when /^\s*[A-Z]\.\s/ + @txt.gsub!(/^\s*([A-Z]\.)/,'\1') + end + end + def bold_para + %{#{@vz.margin_txt_0} +

+ #{@txt} +

+#{@vz.margin_num_css} +     +#{@vz.table_close}} + end + def bold_heading + @txt.gsub!(/[1-9]~\S+/,'') + @txt.gsub!(/[1-9]~/,'') + %{

+ #{@txt} +

+#{@vz.margin_num_css} +     +#{@vz.table_close}} + end + def toc_head_copy_at + %{

#{@txt}

\n} + end + def center + %{

#{@txt}

\n} + end + def bold + %{

#{@txt}

\n} + end + def center_bold + %{

#{@txt}

\n} + end + end + class Format_scroll < Format_text_object + def initialize(md,txt) + super(md,txt) + @vz=SiSU_Env::Get_init.instance.skin + end + end + class Format_seg < Format_text_object + def initialize(md,txt) + super(md,txt) + end + def navigation_toc_lev1_advert + %{#{@banner.home_button}\n +

+#{@txt} +#{@two} +

} + end + def navigation_toc_lev1 + %{#{@banner.nav_toc}} + end + def navigation_toc_lev2 #change bold use css + %{ + +
+ + + #{@txt} + +

+#{@vz.table_close}} + end + def navigation_toc_lev3 #change bold use css + %{ + +
+ + + #{@txt} + +

+#{@vz.table_close}} + end + def navigation_toc_lev4 + %{ + +
+ +

+ #{@txt} +

+#{@vz.table_close}} + end + def navigation_toc_lev5 + end + def navigation_toc_lev6 + end + def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 + fn='doc' if fn.to_s.empty? #you may wish to reconsider, sends to 'doc' where no segment info + %{ +

+ #{@endnote_part_a}#{@md.fnl[:pre]}#{fn}#{@md.fnl[:mid]}#{Sfx[:epub_xhtml]}#{@md.fnl[:post]}#{@endnote_part_b} +

+} + end + def clean(txt) + txt.gsub!(/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}/,'') + txt.gsub!(/#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/,'') + txt + end + def subtoc_lev(tag,attrib) + @txt=clean(@txt) + txt=if @txt \ + and @txt =~/<\/?i>|/mi + @txt.gsub(/<\/?i>|/mi,'') #removes name markers from subtoc, go directly to substantive text + else @txt + end + note='' + if txt =~/(#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})/m # had \s* at end + note=$1 + note.gsub!(/[\n\s]+/m,' ') + txt.gsub!(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') + txt.gsub!(/ \d+<\/sup> /m,'') + txt.gsub!(/#{Mx[:nbsp]}\d+<\/sup>#{Mx[:nbsp]}/m,'') #remove + end + %{<#{tag} class="#{attrib}"> + #{txt} #{note} + } + end + def subtoc_lev5 + subtoc_lev('h5','subtoc') if @txt + end + def subtoc_lev6 + subtoc_lev('h6','subtoc') if @txt + end + def heading_sub(tag,attrib) + @txt.gsub!(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') + %{ +
+ #{@p_num.ocn_display} + <#{tag} class="#{attrib}" #{@p_num.id}> #{@headname} + #{@txt} + +
+} + end + def heading4 + %{ +
+ #{@p_num.ocn_display} +

+ #{@t_o[:format]} + #{@txt} +

+
+} + end + def heading5 + heading_sub('p','bold') + end + def heading6 + heading_sub('p','bold') + end + def navigation_heading4 + %{ +
+

+ #{@txt} +

+#{@vz.table_close}} + end + def navigation_heading5 + %{

+ #{@txt} +

} + end + def navigation_heading6 + %{

+ #{@txt} +

} + end + def navigation_center + %{

#{@txt}

} + end + end + class Format_toc < Format_text_object + def initialize(md,txt) + super(md,txt) + end + def links_guide + %{
  • + + #{@lnk_txt} + +
  • +} + end + def lev(tag,attrib) + if @txt + %{<#{tag} class="#{attrib}"> + #{@txt} + +} + else '' + end + end + def lev1 + lev('h1','toc') + end + def lev2 + lev('h2','toc') + end + def lev3 + lev('h3','toc') + end + def lev4 + lev('h4','toc') + end + def lev5 + lev('h5','toc') + end + def lev6 + lev('h6','toc') + end + def lev0 #docinfo + lev('h0','toc') + end + def mini_lev1 + lev('h1','minitoc') + end + def mini_lev2 + lev('h2','minitoc') + end + def mini_lev3 + lev('h3','minitoc') + end + def mini_lev4 + lev('h4','minitoc') + end + def mini_lev5 + lev('h5','minitoc') + end + def mini_lev6 + lev('h6','minitoc') + end + def mini_lev0 #docinfo + lev('h0','minitoc') + end + def mini_tail + %{ +

    + Manifest (alternative outputs) +

    +} + end + def mini_concord_tail + %{ +

    + Concordance (wordlist) +

    +

    + Manifest (alternative outputs) +

    +} + end + end +end +__END__ -- cgit v1.2.3