m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/scripts/build.rb
blob: 1e4e30c1489b3ab2c462e3d7ea0ddf0080d8fc16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'erb'
require 'fileutils'

require './lib/song'
require './lib/songs'
require './lib/latex'
require './lib/pather'
require './lib/ly'
require './lib/html'
require './lib/statics'

statics = [ 'style.css' ]

FileUtils.mkdir_p(BuildDir)
FileUtils.mkdir_p(build SongsDir)
FileUtils.mkdir_p(TmpDir)
FileUtils.mkdir_p(tmp SongsDir)

P = Pather.new

P.add 'index', 'index.html'
P.add 'style', 'style.css'
P.add 'songbook', 'śpiewnik-tuturutu.pdf'

songs.each_key do |song_id|
  P.add(song_html(song_id), song_html(song_id))
  P.add(song_svg(song_id), song_svg(song_id))
  P.add(song_pdf(song_id), song_pdf(song_id))
end

write_templated_erb 'index.html.erb'
write_statics statics

P.cd SongsDir
make_sheets songs
make_pdfs songs
make_htmls songs