Sha256: 57ef69b9672d59f65552aae31ed1aa36f60fad971b7a1d7d015458fc313f2edd
Contents?: true
Size: 1.3 KB
Versions: 1
Compression:
Stored size: 1.3 KB
Contents
require 'kramdown' require "awesome_print" module Verku class Exporter class PDF < Base def export! locals = config.merge({ :contents => content }) locals['copyright'].gsub!("(C)", "\\copyright{}") output = render_template(root_dir.join("_templates/pdf/layout.erb"), locals) File.open(root_dir.join(tex_file), 'w').write(output) puts "-- Exporting PDF" puts " - Pass 1"; spawn_command ["xelatex", tex_file.to_s,] puts " - Pass 2"; spawn_command ["xelatex", tex_file.to_s,] if config['status'] == 'final' puts " - Pass 3 - Indexing" spawn_command ["makeindex #{name}.idx"] spawn_command ["makeglossaries #{name}.glo"] if File.exist?("#{name}.glo") spawn_command ["xelatex", tex_file.to_s,] spawn_command ["rm *ilg *ind "] end spawn_command ["rm *.glo *.idx *.log *.out *.toc *aux *ist"] spawn_command ["mv #{base_name("pdf")}.pdf #{output_name("pdf")}"] true rescue Exception => error handle_error(error) false end private def content source_list.map do |file| PandocRuby.markdown(read_content(file)[0], :chapters).to_latex.fix_scenebreaks end.join("\n\n") end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
verku-0.16.0 | lib/verku/exporter/pdf.rb |