Sha256: a0deb5ba1d1e55e29fc864f443551ab91dc650f26e304ba34bb369ed41c606b9
Contents?: true
Size: 1.83 KB
Versions: 2
Compression:
Stored size: 1.83 KB
Contents
module EPUB module ContentDocument class Navigation module Type TOC = 'toc' PAGE_LIST = 'page_list' LANDMARKS = 'landmarks' end attr_accessor :navs alias navigations navs alias navigations= navs= def toc navs.selector {|nav| nav.type == Type::TOC}.first end def page_list navs.selector {|nav| nav.type == Type::PAGE_LIST}.first end def landmarks navs.selector {|nav| nav.type == Type::LANDMARKS}.first end # Enumerator version of toc # Usage: nagivation.enum_for(:contents) def contents end # Enumerator version of page_list # Usage: navigation.enum_for(:pages) def pages end # iterator for #toc def each_content end # iterator for #page_list def each_page end # iterator for #landmark def each_landmark end class Nav attr_accessor :heading, :ol, :items, # children of ol, thus li :type, # toc, page-list, landmarks or other :hidden # #show method and #hide are unneccessary # because this is for parser, not for builder nor manipulator def hidden? end class Ol # list-style :none attr_accessor :hidden def hidden? end # may be followed by ol or be a leaf node class A attr_accessor :ol, # optional :hidden def hidden? end end # must be followed by ol, or must not be a leaf node class Span attr_accessor :ol, # required :hidden def hidden? end end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
epub-parser-0.1.2 | lib/epub/content_document/navigation.rb |
epub-parser-0.1.1 | lib/epub/content_document/navigation.rb |