Class: Typst::HtmlDocument

Inherits:
Document show all
Defined in:
lib/formats/html.rb

Instance Attribute Summary collapse

Attributes inherited from Document

#bytes

Instance Method Summary collapse

Methods inherited from Document

#pages, #write

Constructor Details

#initialize(bytes, title) ⇒ HtmlDocument

Returns a new instance of HtmlDocument.



13
14
15
16
# File 'lib/formats/html.rb', line 13

def initialize(bytes, title)
  super(bytes)
  self.title = title
end

Instance Attribute Details

#titleObject

Returns the value of attribute title.



11
12
13
# File 'lib/formats/html.rb', line 11

def title
  @title
end

Instance Method Details

#markupObject Also known as: document



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/formats/html.rb', line 18

def markup
  %{
  <!DOCTYPE html>
  <html>
  <head>
  <title>#{title}</title>
  </head>
  <body>
  #{pages.join("<br />")}
  </body>
  </html>
  }
end