diff --git a/node_modules/gitbook-plugin-layout/.npmignore b/node_modules/gitbook-plugin-layout/.npmignore new file mode 100644 index 00000000..ba0286ff --- /dev/null +++ b/node_modules/gitbook-plugin-layout/.npmignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +.idea +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Deployed apps should consider commenting this line out: +# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git +node_modules diff --git a/node_modules/gitbook-plugin-layout/LICENSE b/node_modules/gitbook-plugin-layout/LICENSE new file mode 100644 index 00000000..8ab70c02 --- /dev/null +++ b/node_modules/gitbook-plugin-layout/LICENSE @@ -0,0 +1 @@ +MIT \ No newline at end of file diff --git a/node_modules/gitbook-plugin-layout/README.md b/node_modules/gitbook-plugin-layout/README.md new file mode 100644 index 00000000..02f41400 --- /dev/null +++ b/node_modules/gitbook-plugin-layout/README.md @@ -0,0 +1,57 @@ +<<<<<<< HEAD +gitbook-plugin-layout +============== +#### gitbook install gitbook-plugin-layout +#### book.json +````` + "plugins": ["layout"], + "pluginsConfig": { + "layout": { + "headerPath" : "layouts/header.html", + "footerPath" : "layouts/footer.html" + } + }, + +````` +======= +GitBook Sample Plugin +============== + +This is a model for GitBook plugins. + +## How GitBook plugin works? + +A plugin for GitBook is a node package that can be published on [NPM](http://www.npmjs.org). It has to follow the name convention: `gitbook-plugin-*name*`. + +### package.json + +#### name + +The package name should begin with ```gitbook-plugin-```. + +Examples: `gitbook-plugin-mixpanel`, `gitbook-plugin-googleanalytics`. +>>>>>>> a61a89e2f73e5cd1ce9b40a6df653bd82832a2ce + +#### engine + +The package.json should contain a `engine` field using [the standard norm](https://www.npmjs.org/doc/json.html#engines). + +``` +"engines": { + "gitbook": "*" +} +``` + +For example if you want your plugin to supports only GitBook version supperior to 0.3.1: + +``` +"engines": { + "gitbook": ">=0.3.1" +} +``` + +### entry point + +The plugin entry point should return an object with some metadata. + + diff --git a/node_modules/gitbook-plugin-layout/index.js b/node_modules/gitbook-plugin-layout/index.js new file mode 100644 index 00000000..69eb91df --- /dev/null +++ b/node_modules/gitbook-plugin-layout/index.js @@ -0,0 +1,64 @@ +var fs = require('fs'); +//var cacheObj = {}; //{bodyStart: {pathFile: xxx,content: xxxx,timer:xxx}} +module.exports = { + + // Extend ebook resources and html + website: { + /* + assets: "./book", + js: [ + "test.js" + ], + css: [ + "test.css" + ],*/ + html: { + "body:start": function () { + var pathFile = this.options.pluginsConfig && this.options.pluginsConfig.layout && this.options.pluginsConfig.layout.headerPath; + if (pathFile && fs.existsSync(pathFile)){ + return fs.readFileSync(pathFile, {encoding: 'utf-8'}); + } + return ''; + }, + "body:end": function () { + if (this.options.pluginsConfig && this.options.pluginsConfig.layout && this.options.pluginsConfig.layout.footerPath && fs.existsSync(this.options.pluginsConfig.layout.footerPath)) { + return fs.readFileSync(this.options.pluginsConfig.layout.footerPath, {encoding: 'utf-8'}) + } + return ''; + } + } + }, + + /* // Extend templating blocks + blocks: { + // Author will be able to write "{% myTag %}World{% endMyTag %}" + myTag: { + process: function(blk) { + return "Hello "+blk.body; + } + } + }, + + // Extend templating filters + filters: { + // Author will be able to write "{{ 'test'|myFilter }}" + myFilter: function(s) { + return "Hello "+s; + } + },*/ + + // Hook process during build +/* hooks: { + // For all the hooks, this represent the current generator + + // This is called before the book is generated + "init": function () { + console.log("init!"); + }, + + // This is called after the book generation + "finish": function () { + console.log("finish!"); + } + }*/ +}; diff --git a/node_modules/gitbook-plugin-layout/package.json b/node_modules/gitbook-plugin-layout/package.json new file mode 100644 index 00000000..e61f4879 --- /dev/null +++ b/node_modules/gitbook-plugin-layout/package.json @@ -0,0 +1,38 @@ +{ + "name": "gitbook-plugin-layout", + "description": "layout add header footer plugin for GitBook", + "main": "index.js", + "version": "0.0.1", + "engines": { + "gitbook": "*" + }, + "homepage": "http://gitlab.alibaba-inc.com/jianlin.zjl/gitbook-plugin-layout.git", + "repository": { + "type": "git", + "url": "http://gitlab.alibaba-inc.com/jianlin.zjl/gitbook-plugin-layout.git" + }, + "license": "MIT", + "gitHead": "92332d1b97f44a535dceedd3a226e444bae509e1", + "_id": "gitbook-plugin-layout@0.0.1", + "scripts": {}, + "_shasum": "575ae39a521f911edbcaab9d4579031ad326b088", + "_from": "gitbook-plugin-layout@0.0.1", + "_npmVersion": "2.11.3", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "zhoujianlin", + "email": "zhoujianlin8@gmail.com" + }, + "dist": { + "shasum": "575ae39a521f911edbcaab9d4579031ad326b088", + "tarball": "http://registry.npmjs.org/gitbook-plugin-layout/-/gitbook-plugin-layout-0.0.1.tgz" + }, + "maintainers": [ + { + "name": "zhoujianlin", + "email": "zhoujianlin8@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/gitbook-plugin-layout/-/gitbook-plugin-layout-0.0.1.tgz" +}