Skip to content

Commit

Permalink
Switch to Remarkable
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Dec 17, 2014
1 parent 246a55a commit 4b0720b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Unreleased
* Switch to [Remarkable](https://github.com/jonschlinkert/remarkable)
Markdown parser, which is faster and supports the new CommonMark
specification. [GFM](https://help.github.com/articles/github-flavored-markdown/)
is supported.

# 1.17.0 - 2014-12-16
* New logo
* Add support for [including files]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"coffee-script": "^1.8.0",
"highlight.js": "^8.2.0",
"jade": "^1.5.0",
"marked": "~0.3.2",
"moment": "^2.8.1",
"protagonist": "~0.17.1",
"remarkable": "^1.5.0",
"socket.io": "^1.0.6",
"stylus": "~0.49.2",
"yargs": "^1.3.1"
Expand Down
10 changes: 6 additions & 4 deletions src/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ crypto = require 'crypto'
fs = require 'fs'
hljs = require 'highlight.js'
jade = require 'jade'
marked = require 'marked'
moment = require 'moment'
path = require 'path'
protagonist = require 'protagonist'
Remarkable = require 'remarkable'

INCLUDE = /( *)<!-- include\((.*)\) -->/gmi
ROOT = path.dirname __dirname
Expand Down Expand Up @@ -44,9 +44,11 @@ includeDirective = (includePath, input) ->
input.replace INCLUDE, includeReplace.bind(this, includePath)

# Setup marked with code highlighting and smartypants
marked.setOptions
md = new Remarkable 'full',
html: true
linkify: true
typographer: true
highlight: highlight
smartypants: true

# Get a list of available internal templates
exports.getTemplates = (done) ->
Expand Down Expand Up @@ -106,7 +108,7 @@ exports.render = (input, options, done) ->
fullWidth: options.fullWidth
date: moment
highlight: highlight
markdown: marked
markdown: (content) -> md.render content
slug: slug
hash: (value) ->
crypto.createHash('md5').update(value.toString()).digest('hex')
Expand Down

0 comments on commit 4b0720b

Please sign in to comment.