Permalink
Browse files

v2.5.0. Properly fixed #111. Split html2jade out of the jade plugin, …

…and disabled by default. Disabled a few other plugins by default too. Changed haml and npm dep verison numbers to support node 0.4.
  • Loading branch information...
1 parent 8577129 commit c34371243e676d6e2e59b212417f3ae6f0eab83a @balupton balupton committed Dec 15, 2011
View
@@ -192,8 +192,9 @@ _Getting errors? [Try troubleshooting](https://github.com/balupton/docpad/wiki/T
- Swapped out [Dominic Baggott's](https://github.com/evilstreak) [Markdown.js](http://github.com/evilstreak/markdown-js) for [Isaac Z. Schlueter's](https://github.com/isaacs) [Github-Flavored-Markdown](https://github.com/isaacs/github-flavored-markdown)
- Now adds support for inline html in markdown files
- Closes #107
- - Fixed plugins installing on windows
- - Had to upgrade NPM from 1.0.x to 1.1.x
+ - Fixed plugin installation on windows
+ - Had to disable the AutoUpdate and Html2Jade plugins
+ - Had to use the global npm instance on windows
- Closes #111
- Fixed the error: `Object #<Object> has no method 'error'`
- Fixes #106
@@ -202,6 +203,13 @@ _Getting errors? [Try troubleshooting](https://github.com/balupton/docpad/wiki/T
- Can now pass over options to the coffeekup renderer inside the coffee plugin
- E.g. set `docpad: plugins: coffee: coffeekup: format: true` to have tidy html output
- Thanks to [Changwoo Park](https://github.com/pismute)
+ - Disabled the following plugins by default
+ - Admin
+ - Authenticate
+ - Rest
+ - AutoUpdate
+ - Buildr
+ - Html2Jade
- Updated depdencies
- Commander 0.3.x -> 0.5.x [- changelog](https://github.com/visionmedia/commander.js/blob/master/History.md)
- Growl 1.1.x -> 1.2.x [- changelog](https://github.com/visionmedia/node-growl/blob/master/History.md)
@@ -402,6 +410,9 @@ DocPad wouldn't be possible if it wasn't for the following libaries _(in alphabe
- [Don Park's](https://github.com/donpark) [Html2Jade](https://github.com/donpark/html2jade) - HTML to Jade Converter
+- [Isaac Z. Schlueter's](https://github.com/isaacs) [Github-Flavored-Markdown](https://github.com/isaacs/github-flavored-markdown) - Github's flavor of markdown
+- [Isaac Z. Schlueter's](https://github.com/isaacs) [NPM](https://github.com/isaacs/npm) - The node package manager
+
- [James Campos'](https://github.com/aeosynth) [CCSS](https://github.com/aeosynth/ccss) - CSS as CoffeeScript
- [Jeremy Ashkenas'](https://github.com/jashkenas) [CoffeeScript](http://jashkenas.github.com/coffee-script) - JavaScript made easy
- [Jeremy Ashkenas/DocumentCloud's](https://github.com/documentcloud/underscore) [Underscore](https://github.com/documentcloud/underscore) - The utility-belt library for JavaScript
@@ -82,10 +82,15 @@ class PluginLoader
# So until it does, then we have to spawn it instead
# next(err)
install: (next) ->
- # Fetch the npm path
- nodePath = if /node$/.test(process.execPath) then process.execPath else 'node'
- npmPath = path.resolve @docpad.config.corePath,'node_modules','npm','bin','npm-cli.js'
- command = "#{nodePath} #{npmPath} install"
+ # Global NPM on Windows
+ if /^win/.test(process.platform)
+ command = "npm install"
+
+ # Local NPM on everything else
+ else
+ nodePath = if /node$/.test(process.execPath) then process.execPath else 'node'
+ npmPath = path.resolve @docpad.config.corePath,'node_modules','npm','bin','npm-cli.js'
+ command = "\"#{nodePath}\" \"#{npmPath}\" install"
# Execute npm install inside the pugin directory
child = exec(
@@ -44,7 +44,7 @@
"url": "http://github.com/balupton/docpad.git"
},
"dependencies": {
- "haml": "0.4.x"
+ "haml": ">=0.4.0"
},
"engines" : {
"node": ">=0.4.0"
@@ -0,0 +1,35 @@
+# Requires
+DocpadPlugin = require "#{__dirname}/../../plugin.coffee"
+path = null
+html2jade = null
+
+# Define Plugin
+class Html2JadePlugin extends DocpadPlugin
+ # Plugin name
+ name: 'html2jade'
+
+ # Plugin priority
+ priority: 725
+
+ # Render some content
+ render: ({inExtension,outExtension,templateData,file}, next) ->
+ try
+ if outExtension is 'jade' and inExtension is 'html'
+ path = require 'path' unless path
+ try
+ unless html2jade
+ html2jade = require 'html2jade'
+ catch err
+ unless html2jade
+ html2jade = require path.resolve(__dirname, 'node_modules', 'html2jade', 'lib', 'html2jade.coffee')
+ html2jade.convertHtml file.content, {}, (err,result) ->
+ return next(err) if err
+ file.content = result
+ next()
+ else
+ next()
+ catch err
+ return next(err)
+
+# Export Plugin
+module.exports = Html2JadePlugin
@@ -0,0 +1,59 @@
+{
+ "name": "docpad-html2jade",
+ "version": "0.1.0",
+ "description": "Adds support for HTML to the Jade templating engine in DocPad.",
+ "homepage": "https://github.com/balupton/docpad",
+ "keywords": [
+ "docpad",
+ "jade",
+ "templating",
+ "templates",
+ "render",
+ "rendering"
+ ],
+ "author": {
+ "name": "Benjamin Lupton",
+ "email": "b@lupton.cc",
+ "url": "http://balupton.com"
+ },
+ "maintainers": [
+ {
+ "name": "Benjamin Lupton",
+ "email": "b@lupton.cc",
+ "url": "http://balupton.com"
+ }
+ ],
+ "contributors": [
+ {
+ "name": "Benjamin Lupton",
+ "email": "b@lupton.cc",
+ "url": "http://balupton.com"
+ }
+ ],
+ "bugs": {
+ "url": "https://github.com/balupton/docpad/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://creativecommons.org/licenses/MIT/"
+ }
+ ],
+ "repository" : {
+ "type": "git",
+ "url": "http://github.com/balupton/docpad.git"
+ },
+ "dependencies": {
+ "html2jade": "0.1.x"
+ },
+ "engines" : {
+ "node": ">=0.4.0"
+ },
+ "bin": {
+ "docpad": "./bin/docpad"
+ },
+ "directories": {
+ "lib": "."
+ },
+ "main": "./html2jade.plugin.coffee"
+}
@@ -1,7 +1,6 @@
# Requires
DocpadPlugin = require "#{__dirname}/../../plugin.coffee"
jade = null
-html2jade = null
# Define Plugin
class JadePlugin extends DocpadPlugin
@@ -20,17 +19,6 @@ class JadePlugin extends DocpadPlugin
filename: file.fullPath
})(templateData)
next()
- else if outExtension is 'jade' and inExtension is 'html'
- try
- unless html2jade
- html2jade = require 'html2jade'
- catch err
- unless html2jade
- html2jade = require path.resolve(__dirname, 'node_modules', 'html2jade', 'lib', 'html2jade.coffee')
- html2jade.convertHtml file.content, {}, (err,result) ->
- return next(err) if err
- file.content = result
- next()
else
next()
catch err
@@ -1,6 +1,6 @@
{
"name": "docpad-jade",
- "version": "0.1.0",
+ "version": "0.2.0",
"description": "Adds support for the Jade templating engine to DocPad.",
"homepage": "https://github.com/balupton/docpad",
"keywords": [
@@ -44,8 +44,7 @@
"url": "http://github.com/balupton/docpad.git"
},
"dependencies": {
- "jade": "0.19.x",
- "html2jade": "0.1.x"
+ "jade": "0.19.x"
},
"engines" : {
"node": ">=0.4.0"
View
@@ -55,7 +55,7 @@
"coffee-script": "1.1.3",
"js2coffee": "0.1.x",
"underscore": "1.2.x",
- "npm": "1.1.x"
+ "npm": ">=1.0.x"
},
"engines" : {
"node": ">=0.4.0"
@@ -66,5 +66,15 @@
"directories": {
"lib": "lib"
},
- "main": "./lib/docpad.coffee"
+ "main": "./lib/docpad.coffee",
+ "docpad": {
+ "enabledPlugins": {
+ "admin": false,
+ "authenticate": false,
+ "rest": false,
+ "autoupdate": false,
+ "buildr": false,
+ "html2jade": false
+ }
+ }
}

0 comments on commit c343712

Please sign in to comment.