GithubHelp home page GithubHelp logo

chordpro's Introduction

Chordpro

A ruby parser for the chordpro song file format. It converts songs in the chordpro format like this…

{title: You Are My Sunshine}

{c:Verse 1}
[G]The other night dear as I lay sleeping
[G7]I dreamed I [C]held you in my [G]arms
[G7]But when I a[C]woke dear I was mis[G]taken
So I hung my [D7]head and [G]cried

{c:Chorus}
{soc}
You are my sunshine my only sunshine
[G7]You make me [C]happy when skies are [G]gray
[G7]You'll never [C]know dear how much I [G]love you
Please don't take [D7]my sunshine a[G]way
{eoc}

…to HTML, which can be styled to look something like this…

Screenshot of HTML rendering

Installation

Add this line to your application's Gemfile:

gem 'chordpro'

And then execute:

$ bundle

Or install it yourself as:

$ gem install chordpro

Usage

contents = File.read('spec/fixtures/sunshine.crd')

# Generate HTML from the chordpro song
File.write('sunshine.html', Chordpro.html(contents))

# Parse and inspect the chordpro song
song = Chordpro.parse(contents)
song.title # => "You Are My Sunshine"
song.metadata.to_h # => {"title" => "You Are My Sunshine", "key" => "G"}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

chordpro's People

Contributors

bkeepers avatar

Stargazers

Violet avatar Phillip Ridlen avatar  avatar  avatar Stuart Frost avatar Dawid Leszczyński avatar Preston Cabe avatar Taylor O'Brien avatar yao avatar Lionel Kubwimana avatar Brian Kelly avatar Josh Greenplate avatar Alexandre Narbonne avatar Daniel Nehemiah avatar Mark Anderson avatar Mines Chan avatar Dionysis Athinaios avatar Jerry G avatar Daniel Senff avatar Stanley Hansen avatar Matt Gillooly avatar Burin Choomnuan avatar Raimonds avatar Yanuar Waskito avatar Tyler Benziger avatar Will Sean Don avatar Mike English avatar Joel Glovier avatar Geoffrey Dagley avatar Wynn Netherland avatar Matt Graham avatar Andrew Bredow avatar Marcos Beirigo avatar

Watchers

 avatar Matt Graham avatar James Cloos avatar Marcel avatar Adam DeLong avatar Alexandre Narbonne avatar  avatar  avatar

chordpro's Issues

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.