diff --git a/Makefile b/Makefile index 9c6000a..9d7d2a3 100644 --- a/Makefile +++ b/Makefile @@ -5,17 +5,17 @@ lib_objects:= $(subst src/, lib/, $(lib_sources:%.coffee=%.js)) default: build -build: $(lib_objects) lib/tumble.js +build: $(lib_objects) lib/parser.js -lib/tumble.js: src/tumble.peg - ./node_modules/.bin/pegjs src/tumble.peg lib/tumble.js +lib/parser.js: src/parser.peg + ./node_modules/.bin/pegjs src/parser.peg lib/parser.js $(lib_objects): lib/%.js: src/%.coffee @mkdir -p $(@D) coffee -o $(@D) -c $< test: test/[0-9]*_mocha.coffee lib/tumble.js lib/parser.js - ./node_modules/.bin/mocha -C --compilers coffee:coffee-script -u tdd $< + ./node_modules/.bin/mocha -R tap -C --compilers coffee:coffee-script -u tdd $< clean: diff --git a/README.md b/README.md index e9ef878..10cb600 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,11 @@ AuthorsURL # > Handle these first +{URL} +{SeriesTitle} +{AuthorName} +{AuthorDescription} + {block:IfSeries} {Title} {Description} diff --git a/src/tumble.peg b/src/parser.peg similarity index 100% rename from src/tumble.peg rename to src/parser.peg diff --git a/src/parser.coffee b/src/tumble.coffee similarity index 91% rename from src/parser.coffee rename to src/tumble.coffee index 60fd90d..48d47e5 100644 --- a/src/parser.coffee +++ b/src/tumble.coffee @@ -1,17 +1,16 @@ -tumble = require('./tumble') +tumble = require('./parser') util = require('util') module.exports = (template) -> ast = tumble.parse(template) - console.log(util.inspect(ast, null, null)) + # Using the AST, return a function that will render each component # of the AST out, as long as the data provided to the AST makes # sens. # (content) -> - console.log(content) subtypes = (name) -> return 'cond' diff --git a/test/01_basics_mocha.coffee b/test/01_basics_mocha.coffee index ed08e56..584b469 100644 --- a/test/01_basics_mocha.coffee +++ b/test/01_basics_mocha.coffee @@ -3,7 +3,7 @@ assert = chai.assert expect = chai.expect should = chai.should() -tumble = require('../lib/parser') +tumble = require('../lib/tumble') test_data = [ { @@ -43,5 +43,4 @@ describe "Basic Functionality", -> do (data) -> it "should work with #{data.description}", -> r = tumble(data.input)(data.data) - console.log("R:", r) r.should.equal data.output