Start architecturing new default theme

This commit is contained in:
Samy Pessé
2016-09-05 12:14:37 +02:00
parent 0e74c9bad5
commit 839904a704
4 changed files with 91 additions and 0 deletions
@@ -0,0 +1,10 @@
const React = require('react');
const { InjectedComponent } = require('./components/InjectedComponent');
const Application = React.createClass({
render() {
return <InjectedComponent matching={{ role: 'Body' }} />
}
});
module.exports = Application;
@@ -0,0 +1,64 @@
{
"name": "gitbook-plugin-theme-default",
"description": "Default theme for GitBook",
"main": "./index.js",
"version": "1.0.5",
"engines": {
"gitbook": ">=3.0.0"
},
"dependencies": {},
"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
}
}
}
}
@@ -0,0 +1,16 @@
const React = require('react');
const GitBook = require('gitbook-core');
const ThemeBody = React.createClass({
render() {
return (
<div>
My Base theme for gitbook
</div>
);
}
});
module.exports = GitBook.createPlugin((dispatch, state) => {
dispatch(GitBook.registerComponent(ThemeBody, { role: 'Body' }));
});
+1
View File
@@ -22,6 +22,7 @@
"fresh-require": "1.0.3",
"front-matter": "^2.1.0",
"gitbook-asciidoc": "1.2.2",
"gitbook-core": "*",
"gitbook-markdown": "2.0.1",
"gitbook-plugin-fontsettings": "2.0.0",
"gitbook-plugin-highlight": "2.0.2",