1 # vim: fileencoding=UTF-8 ft=ruby syn=ruby ts=2 sw=2 ai eol et si
3 # Copyright (c) 2009 Jörg W Mittag <mailto:JoergWMittag+Akkordarbeit@GoogleMail.Com>
4 # This code is licensed under the terms of the MIT License (see LICENSE.rdoc)
6 libdir = File.expand_path(File.dirname __FILE__).gsub(/(.*lib).*?/, '\1')
7 $LOAD_PATH.unshift libdir unless $LOAD_PATH.include? libdir
14 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
16 <meta http-equiv='Content-type' content='text/html; charset=UTF-8' />
17 <title>Song-Sheet</title>
18 <meta http-equiv='content-language' content='en' />
44 parsetree.each do |section|
45 output << "\t"*3 << "<p>\n"
46 section.each do |line|
50 regex = /(?:\[(.*?)\])/
57 token = ' ' if token =~ /^\s$/
58 output << "<span class='chord'><span><span class='brackets'>[</span>#{last_chord}<span class='brackets'>]</span></span>#{token}</span>"
65 output << "\t"*3 << "</p>\n"
67 return output << <<-'HERE'