leahvelleman / jekyll-lilypond Goto Github PK
View Code? Open in Web Editor NEWGenerate musical examples in a Jekyll post by writing Lilypond code
Home Page: https://www.velleman.org/jekyll-lilypond.html
License: MIT License
Generate musical examples in a Jekyll post by writing Lilypond code
Home Page: https://www.velleman.org/jekyll-lilypond.html
License: MIT License
Create a gem and metadata and an rspec test file. Write a trivial failing test and make it pass.
Per #13 , current code fails silently in confusing ways when inkscape is missing. Behavior when lilypond, timidity, etc are missing is untested. Also unclear what will happen when one of these tools does not produce an expected file. Mock system calls to make this testable, and produce informative error messages.
The stuff in the .ly file that isn't part of the tag contents does get included in the hash, so that when the template changes the image gets regenerated.
Unfortunately, when the baseurl:
is set (in the _config.yml
file), the music doesn't show up in the post and I get the following error in the terminal:
ERROR `/lilypond_files/44d290db15f1c705113158a2385bef75-trimmed.svg' not found.
I tried setting the baseurl
to an empty string, i.e. baseurl: ""
, and the music showed up fine without any errors (locally).
However, it's unfortunately not a satisfactory solution since setting the baseurl
to an empty string would in this case cause other links to not work properly.
The link https://www.velleman.org/jekyll-lilypond leads to a 404 not found
error; if I add .html
to the end of the address, it goes to the right place.
Fail Jekyll build on lilypond failure and pass along lilypond error message
I installed jekyll-lilypond
and tried inserting some sample lilypond code into a markdown file (post), however after running bundle exec jekyll serve
, I got the following error:
/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/static_file.rb:71:in `stat': No such file or directory @ rb_file_s_stat - /Users/michael/sites/music-template/lilypond_files/fcf5de3d1b7e3729f701ea41da6b1b71-trimmed.svg (Errno::ENOENT)
It turned out that the lilypond_files
directory included a file called fcf5de3d1b7e3729f701ea41da6b1b71.svg
, but without the '-trimmed'
.
After running rename -s '.svg' '-trimmed.svg' *.svg
in the lilypond_files
directory, everything worked and I could see the rendered music on the page in the browser.
However, Jekyll still gave me the following warning (I'm not quite sure why):
Conflict: The following destination is shared by multiple files.
The written file may end up with unexpected contents.
/Users/michael/sites/music-template/_site/lilypond_files/fcf5de3d1b7e3729f701ea41da6b1b71-trimmed.svg
- /Users/michael/sites/music-template/lilypond_files/fcf5de3d1b7e3729f701ea41da6b1b71-trimmed.svg
- /Users/michael/sites/music-template/lilypond_files/fcf5de3d1b7e3729f701ea41da6b1b71-trimmed.svg
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.