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.
120 121 122 123 124 125 |
# File 'lib/typst.rb', line 120 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.
118 119 120 |
# File 'lib/typst.rb', line 118 def html @html end |
#svg ⇒ Object
Returns the value of attribute svg.
117 118 119 |
# File 'lib/typst.rb', line 117 def svg @svg end |
#title ⇒ Object
Returns the value of attribute title.
116 117 118 |
# File 'lib/typst.rb', line 116 def title @title end |
Instance Method Details
#markup ⇒ Object Also known as: document
127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/typst.rb', line 127 def markup %{ <!DOCTYPE html> <html> <head> <title>#{title}</title> </head> <body> #{svg.pages.join("<br />")} </body> </html> } end |