Sha256: 0b57007305b4e09c4a983e441e18bf2ff0c1f7049618b16e298fceaed78c433d
Contents?: true
Size: 646 Bytes
Versions: 3
Compression:
Stored size: 646 Bytes
Contents
require 'fileutils' require 'rails-latex/latex_to_pdf' require 'action_view' module ActionView # :nodoc: all module Template::Handlers class ERBLatex < ERB def self.call(template) new.compile(template) end def compile(template) erb = "<% __in_erb_template=true %>#{template.source}" out=self.class.erb_implementation.new(erb, :trim=>(self.class.erb_trim_mode == "-")).src out + ";LatexToPdf.generate_pdf(@output_buffer.to_s,@latex_config||{},@latex_parse_twice)" end end end Template.register_template_handler :erbtex, Template::Handlers::ERBLatex end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rails-latex-1.0.8 | lib/rails-latex/erb_latex.rb |
rails-latex-1.0.7 | lib/rails-latex/erb_latex.rb |
rails-latex-1.0.6 | lib/rails-latex/erb_latex.rb |