diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-20 15:20:21 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-20 15:20:21 +0200 |
commit | 4a380e9279d25749f4f3051844079e57d2b06409 (patch) | |
tree | e7da4cf50e64a0ec56000fb6542af9491cb3ba24 /lib/generate/plugin.js | |
parent | 878c105def7ee73648a79019311730a662c11144 (diff) | |
download | gitbook-4a380e9279d25749f4f3051844079e57d2b06409.zip gitbook-4a380e9279d25749f4f3051844079e57d2b06409.tar.gz gitbook-4a380e9279d25749f4f3051844079e57d2b06409.tar.bz2 |
Fix #36: add mathjax plugin as default
Diffstat (limited to 'lib/generate/plugin.js')
-rw-r--r-- | lib/generate/plugin.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/generate/plugin.js b/lib/generate/plugin.js index d1becd4..cd85402 100644 --- a/lib/generate/plugin.js +++ b/lib/generate/plugin.js @@ -2,6 +2,7 @@ var _ = require("lodash"); var Q = require("q"); var semver = require("semver"); var path = require("path"); +var url = require("url"); var fs = require("./fs"); var pkg = require("../../package.json"); @@ -42,9 +43,9 @@ Plugin.prototype.getResources = function(resource) { } return _.chain(this.infos.book[resource]) .map(function(resource) { - return { - "path": this.name+"/"+resource - } + var parsed = url.parse(resource); + if (parsed.protocol) return {"url": resource} + else return { "path": this.name+"/"+resource }; }.bind(this)) .value(); }; @@ -172,7 +173,8 @@ Plugin.fromList = function(names) { // Default plugins Plugin.defaults = [ - "mixpanel" + "mixpanel", + "mathjax" ]; module.exports = Plugin;
\ No newline at end of file |