Class: Pocketbook::BookRenderer::Chapter::Compiled
- Inherits:
-
Struct
- Object
- Struct
- Pocketbook::BookRenderer::Chapter::Compiled
- Defined in:
- lib/pocketbook/book_renderer/chapter.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
Returns the value of attribute html.
-
#id ⇒ Object
Returns the value of attribute id.
-
#source ⇒ Object
Returns the value of attribute source.
-
#title ⇒ Object
Returns the value of attribute title.
-
#toc_headings ⇒ Object
Returns the value of attribute toc_headings.
Instance Method Summary collapse
Instance Attribute Details
#html ⇒ Object
Returns the value of attribute html
9 10 11 |
# File 'lib/pocketbook/book_renderer/chapter.rb', line 9 def html @html end |
#id ⇒ Object
Returns the value of attribute id
9 10 11 |
# File 'lib/pocketbook/book_renderer/chapter.rb', line 9 def id @id end |
#source ⇒ Object
Returns the value of attribute source
9 10 11 |
# File 'lib/pocketbook/book_renderer/chapter.rb', line 9 def source @source end |
#title ⇒ Object
Returns the value of attribute title
9 10 11 |
# File 'lib/pocketbook/book_renderer/chapter.rb', line 9 def title @title end |
#toc_headings ⇒ Object
Returns the value of attribute toc_headings
9 10 11 |
# File 'lib/pocketbook/book_renderer/chapter.rb', line 9 def toc_headings @toc_headings end |
Instance Method Details
#article_html(escape_html:) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/pocketbook/book_renderer/chapter.rb', line 10 def article_html(escape_html:) <<~HTML <article class="chapter" id="#{escape_html.call(id)}" data-source="#{escape_html.call(source)}" data-title="#{escape_html.call(title)}"> <p class="running-chapter-title" aria-hidden="true">#{escape_html.call(title)}</p> #{html} </article> HTML end |