diff options
author | Marcin Chrzanowski <m@m-chrzan.xyz> | 2021-09-12 14:17:19 +0200 |
---|---|---|
committer | Marcin Chrzanowski <m@m-chrzan.xyz> | 2021-09-12 14:17:19 +0200 |
commit | f3039744d72454e7e3b8cb1032266bcc172ce488 (patch) | |
tree | 5a92a698056e2cbec6f0b121a9ce31596e4a4581 /lib/latex.rb |
Initial commit
Diffstat (limited to 'lib/latex.rb')
-rw-r--r-- | lib/latex.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/latex.rb b/lib/latex.rb new file mode 100644 index 0000000..e17a6ef --- /dev/null +++ b/lib/latex.rb @@ -0,0 +1,17 @@ +def render_latex song + template = tex_template 'song' + templated = template.result binding + File.write(tmp(song_tex song.id), templated) +end + +def render_pdf song + render_latex song + system "lualatex --shell-escape -output-directory=#{TmpDir}/#{SongsDir} #{tmp (song_tex song.id)}" + system "mv #{tmp (song_pdf song.id)} #{build (song_pdf song.id)}" +end + +def make_pdfs songs + songs.each_value do |song| + render_pdf song + end +end |