Class: Coradoc::Reference::Presentation::SingleDocument

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/reference/presentation/single_document.rb

Overview

One page = the whole document. Use for fixed-structure output (single HTML, single PDF, EPUB chapter). Cross-references always resolve to the single page.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#key

Class Method Details

.keyObject



10
11
12
# File 'lib/coradoc/reference/presentation/single_document.rb', line 10

def self.key
  :single_document
end

Instance Method Details

#layout(resolved_graph) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/coradoc/reference/presentation/single_document.rb', line 14

def layout(resolved_graph)
  [Page.new(
    id: page_id_for(resolved_graph),
    title: resolved_graph.title,
    content: resolved_graph,
    order: 0
  )]
end

#locate_page(_edge, _target_content, pages:) ⇒ Object



23
24
25
# File 'lib/coradoc/reference/presentation/single_document.rb', line 23

def locate_page(_edge, _target_content, pages:)
  pages.first
end