diff options
author | Johan Preynat <johan.preynat@gmail.com> | 2016-10-05 20:14:08 +0200 |
---|---|---|
committer | Johan Preynat <johan.preynat@gmail.com> | 2016-10-05 20:14:08 +0200 |
commit | 6faf6a53f08d65f7e51724911473ad1832dcb2ba (patch) | |
tree | da095dcca7700329e639e019362f9668be69f864 /packages/gitbook-plugin-headings/src | |
parent | bced415a50d3031040a42cdc2cd3b02a2a241ff0 (diff) | |
download | gitbook-6faf6a53f08d65f7e51724911473ad1832dcb2ba.zip gitbook-6faf6a53f08d65f7e51724911473ad1832dcb2ba.tar.gz gitbook-6faf6a53f08d65f7e51724911473ad1832dcb2ba.tar.bz2 |
Replace plugin fontsettings by creating plugin headings :hammer:
Diffstat (limited to 'packages/gitbook-plugin-headings/src')
-rw-r--r-- | packages/gitbook-plugin-headings/src/index.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/gitbook-plugin-headings/src/index.js b/packages/gitbook-plugin-headings/src/index.js new file mode 100644 index 0000000..00bc790 --- /dev/null +++ b/packages/gitbook-plugin-headings/src/index.js @@ -0,0 +1,27 @@ +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +const Heading = React.createClass({ + propTypes: { + children: React.PropTypes.node + }, + + render() { + return ( + <div className="Headings-Container"> + {this.props.children} + </div> + ); + } +}); + +module.exports = GitBook.createPlugin({ + activate: (dispatch, getState, { Components }) => { + // Dispatch initialization actions + dispatch(Components.registerComponent(Heading, { role: 'html:h1' })); + }, + deactivate: (dispatch, getState) => { + // Dispatch cleanup actions + }, + reduce: (state, action) => state +}); |