Skip to content

Commit

Permalink
Switch to Protagonist 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Oct 13, 2015
1 parent b2ed516 commit 43eccc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"aglio-theme-olio": "^1.2.0",
"chokidar": "^1.0.1",
"cli-color": "^1.0.0",
"drafter": "^0.2.7",
"pretty-error": "^1.1.2",
"protagonist": "^1.0.0",
"serve-static": "^1.9.3",
"socket.io": "^1.3.5",
"yargs": "^3.0.2"
Expand Down
5 changes: 2 additions & 3 deletions src/main.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fs = require 'fs'
path = require 'path'
Drafter = require 'drafter'
protagonist = require 'protagonist'

INCLUDE = /( *)<!-- include\((.*)\) -->/gmi
ROOT = path.dirname __dirname
Expand Down Expand Up @@ -91,8 +91,7 @@ exports.render = (input, options, done) ->
.replace(/\t/g, ' ')

benchmark.start 'parse'
drafter = new Drafter()
drafter.make filteredInput, (err, res) ->
protagonist.parse filteredInput, type: 'ast', (err, res) ->
benchmark.end 'parse'
if err
err.input = input
Expand Down
6 changes: 3 additions & 3 deletions test/basic.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin = require '../lib/bin'
fs = require 'fs'
http = require 'http'
path = require 'path'
drafter = require 'drafter'
protagonist = require 'protagonist'
sinon = require 'sinon'

root = path.dirname(__dirname)
Expand Down Expand Up @@ -164,13 +164,13 @@ describe 'API Blueprint Renderer', ->
done()

it 'Should error on drafter failure', (done) ->
sinon.stub drafter.prototype, 'make', (content, callback) ->
sinon.stub protagonist, 'parse', (content, options, callback) ->
callback 'error'

aglio.render blueprint, 'default', (err, html) ->
assert err

drafter.prototype.make.restore()
protagonist.parse.restore()

done()

Expand Down

0 comments on commit 43eccc1

Please sign in to comment.