Comparing version 0.4.6 to 0.4.7
@@ -22,2 +22,6 @@ var path = require("path"); | ||
parser: { | ||
markdown: {} | ||
}, | ||
publish: { | ||
@@ -24,0 +28,0 @@ generate: true |
@@ -122,3 +122,3 @@ var _ = require("underscore"); | ||
get: function(basepath, content_type, options, callback){ | ||
get: function(basepath, file_extension, options, callback){ | ||
var self = this; | ||
@@ -125,0 +125,0 @@ |
@@ -63,3 +63,3 @@ var helper_utils = require("../utils/helper_utils.js"); | ||
get: function(basepath, content_type, options, callback){ | ||
get: function(basepath, file_extension, options, callback){ | ||
var self = this; | ||
@@ -66,0 +66,0 @@ |
@@ -17,3 +17,3 @@ var fs = require("fs"); | ||
get: function(basepath, content_type, options, callback){ | ||
get: function(basepath, file_extension, options, callback){ | ||
var self = this; | ||
@@ -20,0 +20,0 @@ |
@@ -69,3 +69,3 @@ var helper_utils = require("../utils/helper_utils.js"); | ||
get: function(basepath, content_type, options, callback){ | ||
get: function(basepath, file_extension, options, callback){ | ||
var self = this; | ||
@@ -72,0 +72,0 @@ |
@@ -94,3 +94,3 @@ var helper_utils = require("../utils/helper_utils.js"); | ||
get: function(basepath, content_type, options, callback){ | ||
get: function(basepath, file_extension, options, callback){ | ||
var self = this; | ||
@@ -97,0 +97,0 @@ |
@@ -6,4 +6,8 @@ /* | ||
var marked = require("marked"); | ||
var _ = require("underscore"); | ||
module.exports = { | ||
markedOptions: {}, | ||
supportedExtensions: [".markdown", ".md"], | ||
@@ -16,7 +20,3 @@ | ||
//set default options | ||
marked.setOptions({ | ||
gfm: true, | ||
pedantic: false, | ||
sanitize: false | ||
}); | ||
marked.setOptions(self.markedOptions); | ||
@@ -30,4 +30,15 @@ try { | ||
return callback(err, output); | ||
}, | ||
setup: function(config) { | ||
var self = this; | ||
var default_marked_options = { gfm: true, pedantic: false, sanitize: false }; | ||
if (config.parser) { | ||
self.markedOptions = _.extend(default_marked_options, config.parser.markdown); | ||
} else { | ||
self.markedOptions = default_marked_options; | ||
} | ||
} | ||
}; |
@@ -5,3 +5,3 @@ { | ||
, "keywords": ["static site", "framework", "web publishing", "generator", "minfier", "server", "mustache", "json", "markdown"] | ||
, "version": "0.4.6" | ||
, "version": "0.4.7" | ||
, "homepage": "https://github.com/laktek/punch" | ||
@@ -25,3 +25,3 @@ , "author": "Lakshan Perera <lakshan@web2media.net> (http://laktek.com)" | ||
, "less" : ">= 1.3.0" | ||
, "marked" : ">= 0.2.3" | ||
, "marked" : ">= 0.2.5" | ||
, "mime" : ">= 1.2.5" | ||
@@ -28,0 +28,0 @@ , "mustache" : ">= 0.5.2" |
# Punch | ||
## A Fun and Easy Way to Build Modern Websites | ||
Punch is a modern web publishing framework, which is simple, intuitive and pleasure to use for both designers and developers. | ||
Punch is a simple, intuitive web publishing framework that will delight both designers and developers. | ||
@@ -6,0 +6,0 @@ ### With Punch you can... |
var markdown_parser = require("../../lib/parsers/markdown.js"); | ||
var marked = require("marked"); | ||
describe("setup", function() { | ||
it("extend the marked options with the options provided in the config", function(){ | ||
var custom_options = { "gfm": true, "pedantic": true, "sanitize": true } | ||
var config = { "parser": { "markdown": custom_options } }; | ||
markdown_parser.setup(config); | ||
expect(markdown_parser.markedOptions).toEqual(custom_options); | ||
}); | ||
it("keep the default marked options when no options are provided in the config", function(){ | ||
var default_options = { "gfm": true, "pedantic": false, "sanitize": false } | ||
markdown_parser.setup({}); | ||
expect(markdown_parser.markedOptions).toEqual(default_options); | ||
}); | ||
}); | ||
describe("parsing given content", function() { | ||
it("calls the callback with the result", function() { | ||
it("invoke the callback with the result", function() { | ||
spyOn(marked, "setOptions"); | ||
@@ -20,3 +40,3 @@ | ||
it("calls the callback with the result", function() { | ||
it("invoke the callback with the error on an error", function() { | ||
spyOn(marked, "setOptions"); | ||
@@ -23,0 +43,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1748790
10411
Updatedmarked@>= 0.2.5