diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-10-13 00:18:47 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-10-13 00:18:47 +0200 |
commit | ba56801352359e606e261b1fc066af4e394c47c9 (patch) | |
tree | 20c26cfd18f30858baf7527f3720e9011e3b6f57 | |
parent | 48ee0e35b0a9f77cfc66b2ec35a45e487020c847 (diff) | |
download | gitbook-ba56801352359e606e261b1fc066af4e394c47c9.zip gitbook-ba56801352359e606e261b1fc066af4e394c47c9.tar.gz gitbook-ba56801352359e606e261b1fc066af4e394c47c9.tar.bz2 |
Add base for new fontsettings plugin
25 files changed, 560 insertions, 400 deletions
@@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - *Performances*: Git conrefs are faster over large books - *Website Feature:* new default plugin `copy-code` to copy code blocks content in one click - *Website Feature:* new default plugin `heading-anchors` to have clickable headings +- *Website Feature:* `fontsettings` is now only controlling the font size, and can work on multiple themes ## 3.2.0 - Switch markdown parser from `kramed` to `markup-it` diff --git a/packages/gitbook-core/package.json b/packages/gitbook-core/package.json index 8e25548..b5b2d3f 100644 --- a/packages/gitbook-core/package.json +++ b/packages/gitbook-core/package.json @@ -1,49 +1,49 @@ { - "name": "gitbook-core", - "version": "4.0.0", - "description": "Core for GitBook plugins API", - "main": "./lib/index.js", - "dependencies": { - "bluebird": "^3.4.6", - "classnames": "^2.2.5", - "entities": "^1.1.1", - "history": "^4.3.0", - "html-tags": "^1.1.1", - "immutable": "^3.8.1", - "react": "^15.3.1", - "react-dom": "^15.3.1", - "react-helmet": "^3.1.0", - "react-immutable-proptypes": "^2.1.0", - "react-intl": "^2.1.5", - "react-redux": "^4.4.5", - "react-safe-html": "0.4.0", - "redux": "^3.5.2", - "redux-thunk": "^2.1.0", - "reflexbox": "^2.2.2", - "whatwg-fetch": "^1.0.0" - }, - "devDependencies": { - "babel-cli": "^6.14.0", - "babel-preset-es2015": "^6.14.0", - "babel-preset-react": "^6.11.1", - "babel-preset-stage-2": "^6.13.0", - "browserify": "^13.1.0", - "envify": "^3.4.1", - "uglify-js": "^2.7.3" - }, - "scripts": { - "dist-lib": "rm -rf lib/ && babel -d lib/ src/", - "dist-standalone": "mkdir -p dist && browserify -r ./lib/index.js:gitbook-core -r react -r react-dom ./lib/index.js | uglifyjs -c > ./dist/gitbook.core.min.js", - "dist": "npm run dist-lib && npm run dist-standalone", - "prepublish": "npm run dist" - }, - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "author": "GitBook Inc. <contact@gitbook.com>", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - } + "name": "gitbook-core", + "version": "4.0.0", + "description": "Core for GitBook plugins API", + "main": "./lib/index.js", + "dependencies": { + "bluebird": "^3.4.6", + "classnames": "^2.2.5", + "entities": "^1.1.1", + "history": "^4.3.0", + "html-tags": "^1.1.1", + "immutable": "^3.8.1", + "react": "^15.3.1", + "react-dom": "^15.3.1", + "react-helmet": "^3.1.0", + "react-immutable-proptypes": "^2.1.0", + "react-intl": "^2.1.5", + "react-redux": "^4.4.5", + "react-safe-html": "0.4.0", + "redux": "^3.5.2", + "redux-thunk": "^2.1.0", + "reflexbox": "^2.2.2", + "whatwg-fetch": "^1.0.0" + }, + "devDependencies": { + "babel-cli": "^6.14.0", + "babel-preset-es2015": "^6.14.0", + "babel-preset-react": "^6.11.1", + "babel-preset-stage-2": "^6.13.0", + "browserify": "^13.1.0", + "envify": "^3.4.1", + "uglify-js": "^2.7.3" + }, + "scripts": { + "dist-lib": "rm -rf lib/ && babel -d lib/ src/", + "dist-standalone": "mkdir -p dist && browserify -r ./lib/index.js:gitbook-core -r react -r react-dom ./lib/index.js | uglifyjs -c > ./dist/gitbook.core.min.js", + "dist": "npm run dist-lib && npm run dist-standalone", + "prepublish": "npm run dist" + }, + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "author": "GitBook Inc. <contact@gitbook.com>", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-core/src/components/InjectedComponent.js b/packages/gitbook-core/src/components/InjectedComponent.js index ca6e0b0..f02516c 100644 --- a/packages/gitbook-core/src/components/InjectedComponent.js +++ b/packages/gitbook-core/src/components/InjectedComponent.js @@ -54,7 +54,7 @@ const InjectedComponentSet = React.createClass({ render() { const { components, props, ...divProps } = this.props; - const inner = components.map(Comp => <Injection key={Comp.displayName} component={Comp} props={props} />); + const inner = components.map((Comp, i) => <Injection key={i} component={Comp} props={props} />); return ( <div {...divProps}> diff --git a/packages/gitbook-plugin-copy-code/package.json b/packages/gitbook-plugin-copy-code/package.json index 97147b1..bfc9f93 100644 --- a/packages/gitbook-plugin-copy-code/package.json +++ b/packages/gitbook-plugin-copy-code/package.json @@ -1,29 +1,29 @@ { - "name": "gitbook-plugin-copy-code", - "description": "Button to copy code blocks", - "main": "index.js", - "browser": "./_assets/plugin.js", - "version": "4.0.0", - "dependencies": { - "copy-to-clipboard": "^3.0.5", - "gitbook-core": "4.0.0" - }, - "devDependencies": { - "gitbook-plugin": "4.0.0" - }, - "engines": { - "gitbook": ">=3.0.0" - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitbookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - } + "name": "gitbook-plugin-copy-code", + "description": "Button to copy code blocks", + "main": "index.js", + "browser": "./_assets/plugin.js", + "version": "4.0.0", + "dependencies": { + "copy-to-clipboard": "^3.0.5", + "gitbook-core": "4.0.0" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitbookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-fontsettings/.gitignore b/packages/gitbook-plugin-fontsettings/.gitignore new file mode 100644 index 0000000..ef47881 --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/.gitignore @@ -0,0 +1,31 @@ +# Logs +logs +*.log + +# 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 + +# vim swapfile +*.swp + +# Plugin assets +_assets/plugin.js diff --git a/packages/gitbook-plugin-fontsettings/.npmignore b/packages/gitbook-plugin-fontsettings/.npmignore new file mode 100644 index 0000000..a0e53cf --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/.npmignore @@ -0,0 +1,2 @@ +# Publish assets on NPM +!_assets/plugin.js diff --git a/packages/gitbook-plugin-fontsettings/index.js b/packages/gitbook-plugin-fontsettings/index.js new file mode 100644 index 0000000..e542ae8 --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/index.js @@ -0,0 +1,10 @@ + +module.exports = { + blocks: { + + }, + + hooks: { + + } +}; diff --git a/packages/gitbook-plugin-fontsettings/package.json b/packages/gitbook-plugin-fontsettings/package.json new file mode 100644 index 0000000..c11e23d --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/package.json @@ -0,0 +1,28 @@ +{ + "name": "gitbook-plugin-fontsettings", + "description": "Let readers controls the font size", + "main": "index.js", + "browser": "./_assets/plugin.js", + "version": "4.0.0", + "dependencies": { + "gitbook-core": "4.0.0" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitbookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } +}
\ No newline at end of file diff --git a/packages/gitbook-plugin-fontsettings/src/actions/font.js b/packages/gitbook-plugin-fontsettings/src/actions/font.js new file mode 100644 index 0000000..9034701 --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/src/actions/font.js @@ -0,0 +1,25 @@ + +const TYPES = { + INCREASE: 'font/increase', + DECREASE: 'font/decrease', + RESET: 'font/reset' +}; + +function increase() { + return { type: TYPES.INCREASE }; +} + +function decrease() { + return { type: TYPES.DECREASE }; +} + +function reset() { + return { type: TYPES.RESET }; +} + +module.exports = { + TYPES, + increase, + decrease, + reset +}; diff --git a/packages/gitbook-plugin-fontsettings/src/components/FontButton.js b/packages/gitbook-plugin-fontsettings/src/components/FontButton.js new file mode 100644 index 0000000..f1ea78b --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/src/components/FontButton.js @@ -0,0 +1,16 @@ +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +const FontButton = React.createClass({ + render() { + return ( + <GitBook.Button> + <GitBook.Icon id="font"/> + </GitBook.Button> + ); + } +}); + +module.exports = GitBook.connect(FontButton, (state) => { + return { font: state.font }; +}); diff --git a/packages/gitbook-plugin-fontsettings/src/index.js b/packages/gitbook-plugin-fontsettings/src/index.js new file mode 100644 index 0000000..6ef7ba9 --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/src/index.js @@ -0,0 +1,13 @@ +const GitBook = require('gitbook-core'); +const FontButton = require('./components/FontButton'); +const font = require('./actions/font'); +const reduce = require('./reducers'); + +module.exports = GitBook.createPlugin({ + activate: (dispatch, getState, { Components }) => { + // Dispatch initialization actions + dispatch(Components.registerComponent(FontButton, { role: 'toolbar:buttons:left' })); + }, + actions: { font }, + reduce +}); diff --git a/packages/gitbook-plugin-fontsettings/src/reducers/font.js b/packages/gitbook-plugin-fontsettings/src/reducers/font.js new file mode 100644 index 0000000..fff582d --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/src/reducers/font.js @@ -0,0 +1,29 @@ +const GitBook = require('gitbook-core'); +const { Record } = GitBook.Immutable; + +const { TYPES } = require('../actions/font'); + +const FontState = Record({ + fontSize: 1 +}); + +module.exports = (state = FontState(), action) => { + switch (action.type) { + + case TYPES.RESET: + return FontState(); + + case TYPES.INCREASE: + return state.merge({ + fontSize: state.fontSize + 1 + }); + + case TYPES.DECREASE: + return state.merge({ + fontSize: state.fontSize + 1 + }); + + default: + return state; + } +}; diff --git a/packages/gitbook-plugin-fontsettings/src/reducers/index.js b/packages/gitbook-plugin-fontsettings/src/reducers/index.js new file mode 100644 index 0000000..64d60c9 --- /dev/null +++ b/packages/gitbook-plugin-fontsettings/src/reducers/index.js @@ -0,0 +1,3 @@ +const GitBook = require('gitbook-core'); + +module.exports = GitBook.createReducer('font', require('./font')); diff --git a/packages/gitbook-plugin-headings/package.json b/packages/gitbook-plugin-headings/package.json index a733958..59802e8 100644 --- a/packages/gitbook-plugin-headings/package.json +++ b/packages/gitbook-plugin-headings/package.json @@ -1,38 +1,38 @@ { - "name": "gitbook-plugin-headings", - "description": "Automatically add anchors to headings", - "main": "index.js", - "browser": "./_assets/plugin.js", - "version": "4.0.0", - "dependencies": { - "classnames": "^2.2.5", - "gitbook-core": "4.0.0" - }, - "devDependencies": { - "gitbook-plugin": "4.0.0" - }, - "engines": { - "gitbook": ">=3.0.0" - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitbookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - }, - "gitbook": { - "properties": { - "position": { - "type": "string", - "title": "Position of anchors", - "default": "left" - } + "name": "gitbook-plugin-headings", + "description": "Automatically add anchors to headings", + "main": "index.js", + "browser": "./_assets/plugin.js", + "version": "4.0.0", + "dependencies": { + "classnames": "^2.2.5", + "gitbook-core": "4.0.0" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitbookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + }, + "gitbook": { + "properties": { + "position": { + "type": "string", + "title": "Position of anchors", + "default": "left" } - } + } + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-highlight/package.json b/packages/gitbook-plugin-highlight/package.json index 03d2af7..bd18e26 100644 --- a/packages/gitbook-plugin-highlight/package.json +++ b/packages/gitbook-plugin-highlight/package.json @@ -1,29 +1,29 @@ { - "name": "gitbook-plugin-highlight", - "description": "Syntax highlighter for Gitbook", - "main": "index.js", - "browser": "./_assets/plugin.js", - "version": "4.0.0", - "dependencies": { - "gitbook-core": "4.0.0", - "highlight.js": "9.7.0" - }, - "devDependencies": { - "gitbook-plugin": "4.0.0" - }, - "engines": { - "gitbook": ">=3.0.0" - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitbookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - } + "name": "gitbook-plugin-highlight", + "description": "Syntax highlighter for Gitbook", + "main": "index.js", + "browser": "./_assets/plugin.js", + "version": "4.0.0", + "dependencies": { + "gitbook-core": "4.0.0", + "highlight.js": "9.7.0" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitbookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-hints/package.json b/packages/gitbook-plugin-hints/package.json index 66dedd0..c436561 100644 --- a/packages/gitbook-plugin-hints/package.json +++ b/packages/gitbook-plugin-hints/package.json @@ -1,29 +1,29 @@ { - "name": "gitbook-plugin-hints", - "description": "Defines four types of styled hint blocks: info, danger, tip, working.", - "main": "index.js", - "browser": "./_assets/plugin.js", - "version": "4.0.0", - "dependencies": { - "classnames": "^2.2.5", - "gitbook-core": "4.0.0" - }, - "devDependencies": { - "gitbook-plugin": "4.0.0" - }, - "engines": { - "gitbook": ">=4.0.0" - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitBookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitBookIO/gitbook.git" - }, - "bugs": { - "url": "https://github.com/GitBookIO/gitbook/issues" - } + "name": "gitbook-plugin-hints", + "description": "Defines four types of styled hint blocks: info, danger, tip, working.", + "main": "index.js", + "browser": "./_assets/plugin.js", + "version": "4.0.0", + "dependencies": { + "classnames": "^2.2.5", + "gitbook-core": "4.0.0" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=4.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitBookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitBookIO/gitbook.git" + }, + "bugs": { + "url": "https://github.com/GitBookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-livereload/package.json b/packages/gitbook-plugin-livereload/package.json index 132ef95..58ab612 100644 --- a/packages/gitbook-plugin-livereload/package.json +++ b/packages/gitbook-plugin-livereload/package.json @@ -1,26 +1,26 @@ { - "name": "gitbook-plugin-livereload", - "description": "Live reloading for your gitbook", - "main": "index.js", - "browser": "./_assets/plugin.js", - "version": "4.0.0", - "engines": { - "gitbook": "*" - }, - "dependencies": { - "gitbook-core": "4.0.0" - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitbookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "license": "Apache 2", - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - } + "name": "gitbook-plugin-livereload", + "description": "Live reloading for your gitbook", + "main": "index.js", + "browser": "./_assets/plugin.js", + "version": "4.0.0", + "engines": { + "gitbook": "*" + }, + "dependencies": { + "gitbook-core": "4.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitbookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "license": "Apache 2", + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-lunr/package.json b/packages/gitbook-plugin-lunr/package.json index 7093e7f..9193dd9 100644 --- a/packages/gitbook-plugin-lunr/package.json +++ b/packages/gitbook-plugin-lunr/package.json @@ -1,44 +1,44 @@ { - "name": "gitbook-plugin-lunr", - "description": "Static and local index for search in GitBook", - "main": "index.js", - "browser": "./_assets/theme.js", - "version": "4.0.0", - "dependencies": { - "gitbook-core": "4.0.0", - "html-entities": "1.2.0", - "lunr": "0.5.12" - }, - "devDependencies": { - "gitbook-plugin": "4.0.0" - }, - "engines": { - "gitbook": ">=3.0.0" - }, - "gitbook": { - "properties": { - "maxIndexSize": { - "type": "number", - "title": "Limit size for the index", - "default": 1000000 - }, - "ignoreSpecialCharacters": { - "type": "boolean", - "title": "Ignore special characters in words", - "default": false - } + "name": "gitbook-plugin-lunr", + "description": "Static and local index for search in GitBook", + "main": "index.js", + "browser": "./_assets/theme.js", + "version": "4.0.0", + "dependencies": { + "gitbook-core": "4.0.0", + "html-entities": "1.2.0", + "lunr": "0.5.12" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "gitbook": { + "properties": { + "maxIndexSize": { + "type": "number", + "title": "Limit size for the index", + "default": 1000000 + }, + "ignoreSpecialCharacters": { + "type": "boolean", + "title": "Ignore special characters in words", + "default": false } - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/theme.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitBookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitBookIO/gitbook.git" - }, - "bugs": { - "url": "https://github.com/GitBookIO/gitbook/issues" - } + } + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/theme.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitBookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitBookIO/gitbook.git" + }, + "bugs": { + "url": "https://github.com/GitBookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-search/package.json b/packages/gitbook-plugin-search/package.json index 2a5c610..a57596a 100644 --- a/packages/gitbook-plugin-search/package.json +++ b/packages/gitbook-plugin-search/package.json @@ -1,29 +1,29 @@ { - "name": "gitbook-plugin-search", - "description": "Search integration in GitBook", - "main": "index.js", - "browser": "./_assets/theme.js", - "version": "4.0.0", - "dependencies": { - "gitbook-core": "4.0.0" - }, - "devDependencies": { - "gitbook-plugin": "4.0.0" - }, - "engines": { - "gitbook": ">=3.0.0" - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/theme.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitbookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - } + "name": "gitbook-plugin-search", + "description": "Search integration in GitBook", + "main": "index.js", + "browser": "./_assets/theme.js", + "version": "4.0.0", + "dependencies": { + "gitbook-core": "4.0.0" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/theme.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitbookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-sharing/package.json b/packages/gitbook-plugin-sharing/package.json index 9586ae3..7f85575 100644 --- a/packages/gitbook-plugin-sharing/package.json +++ b/packages/gitbook-plugin-sharing/package.json @@ -1,28 +1,28 @@ { - "name": "gitbook-plugin-sharing", - "description": "Sharing buttons in the toolbar", - "main": "index.js", - "browser": "./_assets/plugin.js", - "version": "4.0.0", - "dependencies": { - "gitbook-core": "4.0.0" - }, - "devDependencies": { - "gitbook-plugin": "4.0.0" - }, - "engines": { - "gitbook": ">=3.0.0" - }, - "scripts": { - "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", - "prepublish": "npm run build-js" - }, - "homepage": "https://github.com/GitbookIO/gitbook", - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - } + "name": "gitbook-plugin-sharing", + "description": "Sharing buttons in the toolbar", + "main": "index.js", + "browser": "./_assets/plugin.js", + "version": "4.0.0", + "dependencies": { + "gitbook-core": "4.0.0" + }, + "devDependencies": { + "gitbook-plugin": "4.0.0" + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "scripts": { + "build-js": "gitbook-plugin build ./src/index.js ./_assets/plugin.js", + "prepublish": "npm run build-js" + }, + "homepage": "https://github.com/GitbookIO/gitbook", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin-theme-default/package.json b/packages/gitbook-plugin-theme-default/package.json index 599f64c..5ca0852 100644 --- a/packages/gitbook-plugin-theme-default/package.json +++ b/packages/gitbook-plugin-theme-default/package.json @@ -1,79 +1,79 @@ { - "name": "gitbook-plugin-theme-default", - "description": "Default theme for GitBook", - "main": "./index.js", - "browser": "./_assets/theme.js", - "version": "4.0.0", - "engines": { - "gitbook": ">=3.0.0" - }, - "dependencies": { - "gitbook-core": "4.0.0" - }, - "devDependencies": { - "classnames": "^2.2.5", - "font-awesome": "^4.6.3", - "gitbook-markdown-css": "^1.0.1", - "gitbook-plugin": "4.0.0", - "less": "^2.7.1", - "less-plugin-clean-css": "^1.5.1", - "preboot": "git+https://github.com/mdo/preboot.git#4aab4edd85f076d50609cbe28e4fe66cc0771701" - }, - "scripts": { - "prepublish": "./prepublish.sh" - }, - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "author": "GitBook Inc. <contact@gitbook.com>", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - }, - "contributors": [ - { - "name": "Samy Pessé", - "email": "samy@gitbook.com" + "name": "gitbook-plugin-theme-default", + "description": "Default theme for GitBook", + "main": "./index.js", + "browser": "./_assets/theme.js", + "version": "4.0.0", + "engines": { + "gitbook": ">=3.0.0" + }, + "dependencies": { + "gitbook-core": "4.0.0" + }, + "devDependencies": { + "classnames": "^2.2.5", + "font-awesome": "^4.6.3", + "gitbook-markdown-css": "^1.0.1", + "gitbook-plugin": "4.0.0", + "less": "^2.7.1", + "less-plugin-clean-css": "^1.5.1", + "preboot": "git+https://github.com/mdo/preboot.git#4aab4edd85f076d50609cbe28e4fe66cc0771701" + }, + "scripts": { + "prepublish": "./prepublish.sh" + }, + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "author": "GitBook Inc. <contact@gitbook.com>", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + }, + "contributors": [ + { + "name": "Samy Pessé", + "email": "samy@gitbook.com" + } + ], + "gitbook": { + "properties": { + "styles": { + "type": "object", + "title": "Custom Stylesheets", + "properties": { + "website": { + "title": "Stylesheet for website output", + "default": "styles/website.css" + }, + "pdf": { + "title": "Stylesheet for PDF output", + "default": "styles/pdf.css" + }, + "epub": { + "title": "Stylesheet for ePub output", + "default": "styles/epub.css" + }, + "mobi": { + "title": "Stylesheet for Mobi output", + "default": "styles/mobi.css" + }, + "ebook": { + "title": "Stylesheet for ebook outputs (PDF, ePub, Mobi)", + "default": "styles/ebook.css" + }, + "print": { + "title": "Stylesheet to replace default ebook css", + "default": "styles/print.css" + } + } + }, + "showLevel": { + "type": "boolean", + "title": "Show level indicator in TOC", + "default": false } - ], - "gitbook": { - "properties": { - "styles": { - "type": "object", - "title": "Custom Stylesheets", - "properties": { - "website": { - "title": "Stylesheet for website output", - "default": "styles/website.css" - }, - "pdf": { - "title": "Stylesheet for PDF output", - "default": "styles/pdf.css" - }, - "epub": { - "title": "Stylesheet for ePub output", - "default": "styles/epub.css" - }, - "mobi": { - "title": "Stylesheet for Mobi output", - "default": "styles/mobi.css" - }, - "ebook": { - "title": "Stylesheet for ebook outputs (PDF, ePub, Mobi)", - "default": "styles/ebook.css" - }, - "print": { - "title": "Stylesheet to replace default ebook css", - "default": "styles/print.css" - } - } - }, - "showLevel": { - "type": "boolean", - "title": "Show level indicator in TOC", - "default": false - } - } - } + } + } }
\ No newline at end of file diff --git a/packages/gitbook-plugin/package.json b/packages/gitbook-plugin/package.json index 64cbf6b..3927023 100644 --- a/packages/gitbook-plugin/package.json +++ b/packages/gitbook-plugin/package.json @@ -1,39 +1,39 @@ { - "name": "gitbook-plugin", - "version": "4.0.0", - "description": "CLI for compiling and testing plugins", - "main": "./lib/index.js", - "dependencies": { - "babel-preset-es2015": "^6.14.0", - "babel-preset-react": "^6.11.1", - "babelify": "^7.3.0", - "browserify": "^13.1.0", - "commander": "^2.9.0", - "fs-extra": "^0.30.0", - "inquirer": "^1.1.3", - "q": "^1.4.1", - "winston": "^2.2.0" - }, - "devDependencies": { - "babel-cli": "^6.14.0", - "babel-preset-es2015": "^6.14.0", - "babel-preset-react": "^6.11.1", - "babel-preset-stage-2": "^6.13.0" - }, - "bin": { - "gitbook-plugin": "./lib/cli.js" - }, - "scripts": { - "dist": "rm -rf lib/ && babel -d lib/ src/ && chmod +x ./lib/cli.js", - "prepublish": "npm run dist" - }, - "repository": { - "type": "git", - "url": "https://github.com/GitbookIO/gitbook.git" - }, - "author": "GitBook Inc. <contact@gitbook.com>", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitbookIO/gitbook/issues" - } + "name": "gitbook-plugin", + "version": "4.0.0", + "description": "CLI for compiling and testing plugins", + "main": "./lib/index.js", + "dependencies": { + "babel-preset-es2015": "^6.14.0", + "babel-preset-react": "^6.11.1", + "babelify": "^7.3.0", + "browserify": "^13.1.0", + "commander": "^2.9.0", + "fs-extra": "^0.30.0", + "inquirer": "^1.1.3", + "q": "^1.4.1", + "winston": "^2.2.0" + }, + "devDependencies": { + "babel-cli": "^6.14.0", + "babel-preset-es2015": "^6.14.0", + "babel-preset-react": "^6.11.1", + "babel-preset-stage-2": "^6.13.0" + }, + "bin": { + "gitbook-plugin": "./lib/cli.js" + }, + "scripts": { + "dist": "rm -rf lib/ && babel -d lib/ src/ && chmod +x ./lib/cli.js", + "prepublish": "npm run dist" + }, + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/gitbook.git" + }, + "author": "GitBook Inc. <contact@gitbook.com>", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/GitbookIO/gitbook/issues" + } }
\ No newline at end of file diff --git a/packages/gitbook/package.json b/packages/gitbook/package.json index 7d0a382..2baf818 100644 --- a/packages/gitbook/package.json +++ b/packages/gitbook/package.json @@ -33,6 +33,7 @@ "gitbook-plugin-search": "4.0.0", "gitbook-plugin-sharing": "4.0.0", "gitbook-plugin-theme-default": "4.0.0", + "gitbook-plugin-fontsettings": "4.0.0", "github-slugid": "1.0.1", "graceful-fs": "4.1.4", "i18n-t": "1.0.1", @@ -107,4 +108,4 @@ "babel-register": "^6.14.0", "mocha": "^3.0.2" } -} +}
\ No newline at end of file diff --git a/packages/gitbook/src/constants/defaultPlugins.js b/packages/gitbook/src/constants/defaultPlugins.js index 326ad3a..a2c0fef 100644 --- a/packages/gitbook/src/constants/defaultPlugins.js +++ b/packages/gitbook/src/constants/defaultPlugins.js @@ -27,5 +27,6 @@ module.exports = Immutable.List([ 'hints', 'headings', 'copy-code', - 'theme-default' + 'theme-default', + 'fontsettings' ]).map(createFromDependency); diff --git a/packages/gitbook/src/plugins/__tests__/listDependencies.js b/packages/gitbook/src/plugins/__tests__/listDependencies.js index 002f0e9..2310015 100644 --- a/packages/gitbook/src/plugins/__tests__/listDependencies.js +++ b/packages/gitbook/src/plugins/__tests__/listDependencies.js @@ -10,7 +10,7 @@ describe('listDependencies', () => { expect(names).toEqual([ 'ga', 'great', 'highlight', 'search', 'lunr', - 'sharing', 'hints', 'headings', 'copy-code', 'theme-default' + 'sharing', 'hints', 'headings', 'copy-code', 'fontsettings', 'theme-default' ]); }); @@ -22,7 +22,7 @@ describe('listDependencies', () => { expect(names).toEqual([ 'ga', 'highlight', 'search', 'lunr', 'sharing', 'hints', 'headings', - 'copy-code', 'theme-default' + 'copy-code', 'fontsettings', 'theme-default' ]); }); @@ -33,7 +33,7 @@ describe('listDependencies', () => { expect(names).toEqual([ 'ga', 'highlight', 'lunr', 'sharing', - 'hints', 'headings', 'copy-code', 'theme-default' + 'hints', 'headings', 'copy-code', 'fontsettings', 'theme-default' ]); }); }); |