Class: Typst::Html

Inherits:
Base
  • Object
show all
Defined in:
lib/formats/html.rb

Instance Attribute Summary

Attributes inherited from Base

#compiled, #options

Instance Method Summary collapse

Methods inherited from Base

#bytes, #compile, #document, from_s, from_zip, #pages, #typst_args, #with_dependencies, #with_font_paths, #with_fonts, #with_inputs, #with_root, #write

Constructor Details

#initialize(*options) ⇒ Html



3
4
5
6
7
# File 'lib/formats/html.rb', line 3

def initialize(*options)
  super(*options)
  title = CGI::escapeHTML(@options[:title] || File.basename(@options[:file], ".*"))
  @compiled = HtmlDocument.new(Typst::_to_svg(*self.typst_args), title)
end