diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-09-19 11:33:19 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-09-19 11:33:23 +0200 |
commit | 2796065886d824ae7fe7060dafa6fdcbd26d5f93 (patch) | |
tree | 4df39fe6e88d88c187623e505fb4e8a8103fa13b /packages/gitbook-plugin-sharing | |
parent | 82c2c214eb5179538c925460f1d3e823dbba47e2 (diff) | |
download | gitbook-2796065886d824ae7fe7060dafa6fdcbd26d5f93.zip gitbook-2796065886d824ae7fe7060dafa6fdcbd26d5f93.tar.gz gitbook-2796065886d824ae7fe7060dafa6fdcbd26d5f93.tar.bz2 |
Add base for gitbook-plugin builder
Diffstat (limited to 'packages/gitbook-plugin-sharing')
-rw-r--r-- | packages/gitbook-plugin-sharing/index.js | 9 | ||||
-rw-r--r-- | packages/gitbook-plugin-sharing/package.json | 72 | ||||
-rw-r--r-- | packages/gitbook-plugin-sharing/src/Button.js | 17 | ||||
-rw-r--r-- | packages/gitbook-plugin-sharing/src/index.js | 6 |
4 files changed, 104 insertions, 0 deletions
diff --git a/packages/gitbook-plugin-sharing/index.js b/packages/gitbook-plugin-sharing/index.js new file mode 100644 index 0000000..5217cad --- /dev/null +++ b/packages/gitbook-plugin-sharing/index.js @@ -0,0 +1,9 @@ + +module.exports = { + website: { + assets: './assets', + plugins: [ + './src/index.js' + ] + } +}; diff --git a/packages/gitbook-plugin-sharing/package.json b/packages/gitbook-plugin-sharing/package.json new file mode 100644 index 0000000..0ca8dc5 --- /dev/null +++ b/packages/gitbook-plugin-sharing/package.json @@ -0,0 +1,72 @@ +{ + "name": "gitbook-plugin-sharing", + "description": "Sharing buttons in GitBooks website", + "main": "index.js", + "version": "1.0.2", + "dependencies": { + + }, + "engines": { + "gitbook": ">=3.0.0" + }, + "homepage": "https://github.com/GitbookIO/plugin-sharing", + "repository": { + "type": "git", + "url": "https://github.com/GitbookIO/plugin-sharing.git" + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/GitbookIO/plugin-sharing/issues" + }, + "gitbook": { + "properties": { + "facebook": { + "type": "boolean", + "default": true, + "title": "Facebook" + }, + "twitter": { + "type": "boolean", + "default": true, + "title": "Twitter" + }, + "google": { + "type": "boolean", + "default": false, + "title": "Google" + }, + "weibo": { + "type": "boolean", + "default": false, + "description": "Weibo" + }, + "instapaper": { + "type": "boolean", + "default": false, + "description": "Instapaper" + }, + "vk": { + "type": "boolean", + "default": false, + "description": "VK" + }, + "all": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "facebook", + "google", + "twitter", + "weibo", + "instapaper" + ], + "uniqueItems": true + } + } + }, + "devDependencies": { + "eslint": "^2.7.0" + } +} diff --git a/packages/gitbook-plugin-sharing/src/Button.js b/packages/gitbook-plugin-sharing/src/Button.js new file mode 100644 index 0000000..0cfce7c --- /dev/null +++ b/packages/gitbook-plugin-sharing/src/Button.js @@ -0,0 +1,17 @@ +const React = require('react'); +const GitBook = require('gitbook-core'); + +const ShareButton = React.createClass({ + render() { + return ( + <button>Share</button> + ); + } +}); + +function mapStateToProps(state) { + +} + + +module.exports = GitBook.connect(ShareButton, mapStateToProps); diff --git a/packages/gitbook-plugin-sharing/src/index.js b/packages/gitbook-plugin-sharing/src/index.js new file mode 100644 index 0000000..e33a470 --- /dev/null +++ b/packages/gitbook-plugin-sharing/src/index.js @@ -0,0 +1,6 @@ +const GitBook = require('gitbook-core'); +const ShareButton = require('./Button'); + +module.exports = GitBook.createPlugin((dispatch, state) => { + dispatch(GitBook.registerComponent(ShareButton, { role: 'Toolbar:ActionButton' })); +}); |