Coder Social home page Coder Social logo

leahvelleman / jekyll-lilypond Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 458 KB

Generate musical examples in a Jekyll post by writing Lilypond code

Home Page: https://www.velleman.org/jekyll-lilypond.html

License: MIT License

Ruby 96.37% LilyPond 2.37% HTML 1.26%
jekyll jekyll-plugin lilypond

jekyll-lilypond's People

Contributors

leahvelleman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

jekyll-lilypond's Issues

Framework

Create a gem and metadata and an rspec test file. Write a trivial failing test and make it pass.

Informative errors when a command line utility is missing

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.

.svg files not found/don't show on page when baseurl is set to something other than ""

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.

Error due to missing '-trimmed'

Error due to missing '-trimmed' in .svg file

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'.

Temporary solution/workaround:

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.