Class: Typst::Html
Instance Attribute Summary collapse
-
#html ⇒ Object
Returns the value of attribute html.
-
#svg ⇒ Object
Returns the value of attribute svg.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(input, title: nil, root: ".", font_paths: []) ⇒ Html
constructor
A new instance of Html.
- #markup ⇒ Object (also: #document)
Methods inherited from Base
Constructor Details
#initialize(input, title: nil, root: ".", font_paths: []) ⇒ Html
Returns a new instance of Html.
146 147 148 149 150 151 |
# File 'lib/typst.rb', line 146 def initialize(input, title: nil, root: ".", font_paths: []) super(input, root: root, font_paths: font_paths) title = title || File.basename(input, File.extname(input)) self.title = CGI::escapeHTML(title) self.svg = Svg.new(self.input, root: self.root, font_paths: self.font_paths) end |
Instance Attribute Details
#html ⇒ Object
Returns the value of attribute html.
144 145 146 |
# File 'lib/typst.rb', line 144 def html @html end |
#svg ⇒ Object
Returns the value of attribute svg.
143 144 145 |
# File 'lib/typst.rb', line 143 def svg @svg end |
#title ⇒ Object
Returns the value of attribute title.
142 143 144 |
# File 'lib/typst.rb', line 142 def title @title end |
Instance Method Details
#markup ⇒ Object Also known as: document
153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/typst.rb', line 153 def markup %{ <!DOCTYPE html> <html> <head> <title>#{title}</title> </head> <body> #{svg.pages.join("<br />")} </body> </html> } end |