diff options
author | EuAndreh <eu@euandre.org> | 2021-01-01 22:55:54 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-01-01 22:55:54 -0300 |
commit | 15db3f0980b64aba8ac0a51f5d28ef3a7f829a3d (patch) | |
tree | 5ff20ddf1e19cacd79136dde38b931429f839115 /_plugins | |
parent | TODOs.org: Add 720e79b4-9e38-41c6-9958-cdadd67d2298 (diff) | |
download | euandre.org-15db3f0980b64aba8ac0a51f5d28ef3a7f829a3d.tar.gz euandre.org-15db3f0980b64aba8ac0a51f5d28ef3a7f829a3d.tar.xz |
linter.rb: Add assert_lilypond
Diffstat (limited to '_plugins')
-rw-r--r-- | _plugins/linter.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/_plugins/linter.rb b/_plugins/linter.rb index 919a8bb..8078dae 100644 --- a/_plugins/linter.rb +++ b/_plugins/linter.rb @@ -192,11 +192,29 @@ module Jekyll end end + def assert_lilypond(site) + site.config['musics'].each do |music| + assert music['title'], "Missing 'title' in #{music}" + assert music['composer'], "Missing 'composer' in #{music}" + ref = assert music['ref'], "Missing 'ref' in #{music}" + ly = "music/#{ref}.ly" + unless File.exist? ly then + raise "Missing '#{ly}' file present in _config.yml." + end + + point_and_click_off = open(ly) { |f| f.include? "\\pointAndClickOff\n" } + unless point_and_click_off then + raise "Missing '\\pointAndClickOff' in '#{ly}'" + end + end + end + def generate(site) assert_unique_ids(site) assert_frontmatter(site) assert_media_metadata(site) assert_git_annex(site) + assert_lilypond(site) end def all_documents(site) |