A Marktab parser written in CoffeeScript. See the original Marktab project here: cknadler/marktab.
Marktab is a concise guitar tab syntax in the spirit of Markdown created by cknadler.
Basic usage (written in CoffeeScript):
# initialize marktab-coffee
marktab = new Marktab
# input some marktabs
marktab.parse "6:3 5 5:2 3 5 4:2 4 5 3:2 4 5 2:3 5 1:2 3 5"
# generate tabs
tabs = marktab.generateTab
Output:
e|----------------------------------------2--3--5--|
B|----------------------------------3--5-----------|
G|-------------------------2--4--5-----------------|
D|----------------2--4--5--------------------------|
A|-------2--3--5-----------------------------------|
E|-3--5--------------------------------------------|
See the specs in the tests
directory for more examples.
Basic Marktab syntax is simply: string:fret
. For example, 6:5
equates to a note on the 5th fret of the 6th string.
See the full syntax specificaton here: cknadler's marktab grammer page
Marktab-coffee's only dependency is Underscore.js >= 1.4.2
Marktab-coffee runs in a web browser (or in a headless browser such as phantomjs). There are a few ways that you can "install" it.
Installation options:
a. Include coffee-script.js and underscore.js before you include marktab-coffee. Simple.
b. Use npm install
to install the grunt.js dependencies, then run grunt
to compile and run tests. Great for TDD.
c. Use the command-line CoffeeScript compiler to compile marktab-coffee to Javascript, then include underscore.js on the page before marktab.js. Should perform better than dynamically compiling the CoffeeScript.
Tests must be run from a web server context, not a file:// url. Alternatively, you may use gruntjs to compile and run the tests using the grunt
command.