Class: SiSU_XHTML_EPUB2_Format::HeadToc

Inherits:
HeadInformation show all
Includes:
SiSU_Parts_XHTML
Defined in:
lib/sisu/xhtml_epub2_format.rb

Direct Known Subclasses

HeadScroll

Instance Attribute Summary

Attributes inherited from HeadInformation

#md, #rdf

Instance Method Summary collapse

Methods included from SiSU_Parts_XHTML

#css, #home, #num_css, #paragraph_font_small, #paragraph_font_tiny, #set_fonts, #set_small, #set_tiny, #site, #the_font, #the_line_break, #the_margin, #the_nav, #the_table_close, #the_url, #the_url_decoration, #txt_0, #txt_1, #txt_2, #txt_3, #txt_close, #txt_concordance, #txt_manifest, #txt_open, #txt_toc_link, #xml_close, #xml_open

Methods included from SiSU_Parts_Generic

#footer_signature, #home, #home_txt, #i_choice, #i_home_button, #i_ico, #i_new, #rl_root, #root_http, #sisu, #sisu_txt, #sisudoc, #site, #the_icon, #the_text, #the_url, #txt_home, #txt_hp, #txt_hp_alias, #txt_signature, #urify, #url_close, #url_open

Methods inherited from HeadInformation

#close, #doc_author, #doc_title, #doc_type, #doc_type_xhtml, #guide, #guide_close, #guide_cover_image, #guide_open, #guide_sisu_toc, #head_close, #head_open, #manifest_close, #manifest_content, #manifest_content_sisu_toc, #manifest_cover_image_information, #manifest_images, #manifest_open, #metadata_opf, #metainf_container, #mimetype, #navmap_close, #navmap_open, #navmap_sisu_toc, #navpoint, #navpoint_close, #open, #package_close, #package_open, #sections, #spine, #spine_close, #spine_cover_image, #spine_open, #spine_sisu_toc, #structure, #table_close, #toc_ncx, #xhtml_close

Constructor Details

#initialize(md) ⇒ HeadToc

Returns a new instance of HeadToc.



1729
1730
1731
1732
1733
# File 'lib/sisu/xhtml_epub2_format.rb', line 1729

def initialize(md)
  super(md)
  @md=md
  @tocband_segtoc=make_seg
end

Instance Method Details

#allObject



1775
1776
1777
1778
# File 'lib/sisu/xhtml_epub2_format.rb', line 1775

def all
  rights=SanitizeXML.xml(@md.rights.all)
  %{<p class="small_left">Rights: #{rights}</p>}
end

#concordanceObject

check structure



1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
# File 'lib/sisu/xhtml_epub2_format.rb', line 1803

def concordance
  if @md.concord_make
  %{#{the_margin.css}
  <h4 class="toc">
    <a href="./#{@md.file.base_filename.html_concordance}">
      <i>Concordance</i>
    </a>
  </h4>
#{the_table_close}}
  else
  %{#{the_margin.css}
#{the_table_close}}
  end
end


1737
1738
1739
1740
1741
1742
1743
1744
# File 'lib/sisu/xhtml_epub2_format.rb', line 1737

def concordance_link(text)
  if @md.concord_make
  %{<a href="#{@md.file.base_filename.html_concordance}" target="_top">
  #{text}
</a>}
  else ''
  end
end

#headObject



1745
1746
1747
1748
1749
1750
1751
1752
# File 'lib/sisu/xhtml_epub2_format.rb', line 1745

def head
  %{#{doc_type}
  <head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
#{@css.xhtml_epub}
  </head>
<body lang="#{@md.opt.lng}">}
end


1767
1768
1769
1770
1771
# File 'lib/sisu/xhtml_epub2_format.rb', line 1767

def links_guide_open(type='horizontal')
  (type=='vertical') \
  ? links_guide_vertical_open
  : links_guide_horizontal_open
end

#make_segObject



1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
# File 'lib/sisu/xhtml_epub2_format.rb', line 1784

def make_seg
  concord=concordance_link(the_nav.txt_concordance)
  %{<table summary="toc segment" border="0" cellpadding="3" cellspacing="0">
<tr><td align="center" bgcolor="white">
  #{the_nav.txt_toc_link}
</td>
<td align="center" bgcolor="white">
  <font size=2>
   #{concord}
#{the_table_close}}
end

#manifestObject

check structure



1795
1796
1797
1798
1799
1800
1801
1802
# File 'lib/sisu/xhtml_epub2_format.rb', line 1795

def manifest #check structure
  manifest=manifest_link(the_nav.txt_manifest)
  %{#{the_margin.txt_3}
  #{the_font.paragraph_font_small}
   #{manifest}
</font>
#{the_table_close}}
end


1734
1735
1736
# File 'lib/sisu/xhtml_epub2_format.rb', line 1734

def manifest_link(text)
  %{ <a href="#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" target="_top">#{text}</a>}
end

#metadataObject



1811
1812
1813
1814
1815
1816
1817
1818
1819
# File 'lib/sisu/xhtml_epub2_format.rb', line 1811

def 
  %{#{the_margin.css}
  <h4 class="toc">
<a href="#{@metalink}">
  <i>MetaData</i>
</a>
  </h4>
#{the_table_close}}
end

#prefix_aObject



1772
1773
# File 'lib/sisu/xhtml_epub2_format.rb', line 1772

def prefix_a
end

#prefix_bObject



1781
1782
1783
# File 'lib/sisu/xhtml_epub2_format.rb', line 1781

def prefix_b
  %{<p class="small_left">Prefix: #{@md.prefix_b}}
end

#rightsObject



1774
1775
1776
1777
1778
1779
1780
# File 'lib/sisu/xhtml_epub2_format.rb', line 1774

def rights
  def all
    rights=SanitizeXML.xml(@md.rights.all)
    %{<p class="small_left">Rights: #{rights}</p>}
  end
  self
end