Class: Epuber::Compiler::OPFGenerator
- Defined in:
- lib/epuber/compiler/opf_generator.rb
Constant Summary collapse
- EPUB2_NAMESPACES =
{ 'xmlns' => 'http://www.idpf.org/2007/opf', 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/', 'xmlns:opf' => 'http://www.idpf.org/2007/opf', }.freeze
- EPUB3_NAMESPACES =
{ 'prefix' => 'rendition: http://www.idpf.org/vocab/rendition/', 'xmlns:epub' => 'http://www.idpf.org/2007/ops', }.freeze
- IBOOKS_NAMESPACES =
{ 'prefix' => 'rendition: http://www.idpf.org/vocab/rendition/# ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/', 'xmlns:ibooks' => 'http://apple.com/ibooks/html-extensions', }.freeze
- LANDMARKS_MAP =
resource page www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#TOC2.6
{ # my favorite landmark_cover: 'cover', landmark_start_page: 'text', landmark_copyright: 'copyright-page', landmark_toc: 'toc', # others landmark_title: 'title-page', landmark_index: 'index', landmark_glossary: 'glossary', landmark_acknowledgements: 'acknowledgements', landmark_bibliography: 'bibliography', landmark_colophon: 'colophon', landmark_dedication: 'dedication', landmark_epigraph: 'epigraph', landmark_foreword: 'foreword', landmark_list_of_illustrations: 'loi', landmark_list_of_tables: 'lot', landmark_notes: 'notes', landmark_preface: 'preface', }.freeze
- PROPERTIES_MAP =
{ cover_image: 'cover-image', navigation: 'nav', scripted: 'scripted', remote_resources: 'remote-resources', mathml: 'mathml', }.freeze
- OPF_UNIQUE_ID =
'bookid'
Instance Attribute Summary
Attributes inherited from Generator
Instance Method Summary collapse
-
#generate_opf ⇒ Nokogiri::XML::Document
Generates XML for opf document.
Methods inherited from Generator
Constructor Details
This class inherits a constructor from Epuber::Compiler::Generator
Instance Method Details
#generate_opf ⇒ Nokogiri::XML::Document
Generates XML for opf document
Use method #to_s to generate nice string from XML document
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/epuber/compiler/opf_generator.rb', line 72 def generate_opf generate_xml do |xml| xml.package(package_namespaces, :version => @target.epub_version, 'unique-identifier' => OPF_UNIQUE_ID) do generate_manifest generate_spine generate_guide end end end |