m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/scripts/build.rb
blob: ee86b811b03493dbcc3cb50856c80fc779d94e2c (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
38
39
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 'about', 'about.html'
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_templated_file 'about.html', 'O Śpiewniku'
write_statics statics

P.cd SongsDir
make_sheets songs
make_pdfs songs
make_htmls songs