summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-theme-default/src
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-09-21 15:54:58 +0200
committerSamy Pesse <samypesse@gmail.com>2016-09-21 15:54:58 +0200
commita18370551a1c3b9649d96199418251d3b6aaac24 (patch)
treea8ba076836695cd645ac795bf153873f3d3f42e2 /packages/gitbook-plugin-theme-default/src
parenta8aeab17d6ac2808f0fd6d6cff1626058c5323fe (diff)
downloadgitbook-a18370551a1c3b9649d96199418251d3b6aaac24.zip
gitbook-a18370551a1c3b9649d96199418251d3b6aaac24.tar.gz
gitbook-a18370551a1c3b9649d96199418251d3b6aaac24.tar.bz2
Prepare showing page html
Diffstat (limited to 'packages/gitbook-plugin-theme-default/src')
-rw-r--r--packages/gitbook-plugin-theme-default/src/Page.js20
-rw-r--r--packages/gitbook-plugin-theme-default/src/Sidebar.js13
-rw-r--r--packages/gitbook-plugin-theme-default/src/index.js23
3 files changed, 52 insertions, 4 deletions
diff --git a/packages/gitbook-plugin-theme-default/src/Page.js b/packages/gitbook-plugin-theme-default/src/Page.js
new file mode 100644
index 0000000..dda8eba
--- /dev/null
+++ b/packages/gitbook-plugin-theme-default/src/Page.js
@@ -0,0 +1,20 @@
+const React = require('react');
+const GitBook = require('gitbook-core');
+
+const Page = React.createClass({
+ propTypes: {
+ page: GitBook.Shapes.Page
+ },
+
+ render() {
+ const { page } = this.props;
+
+ return (
+ <div className="Page page-wrapper">
+ <GitBook.HTMLContent html={page.content} />
+ </div>
+ );
+ }
+});
+
+module.exports = Page;
diff --git a/packages/gitbook-plugin-theme-default/src/Sidebar.js b/packages/gitbook-plugin-theme-default/src/Sidebar.js
new file mode 100644
index 0000000..2ff8854
--- /dev/null
+++ b/packages/gitbook-plugin-theme-default/src/Sidebar.js
@@ -0,0 +1,13 @@
+const React = require('react');
+
+const Sidebar = React.createClass({
+ render() {
+ return (
+ <div className="Sidebar book-summary">
+
+ </div>
+ );
+ }
+});
+
+module.exports = Sidebar;
diff --git a/packages/gitbook-plugin-theme-default/src/index.js b/packages/gitbook-plugin-theme-default/src/index.js
index 3630bbe..f85e6bc 100644
--- a/packages/gitbook-plugin-theme-default/src/index.js
+++ b/packages/gitbook-plugin-theme-default/src/index.js
@@ -1,21 +1,36 @@
const React = require('react');
const GitBook = require('gitbook-core');
-const ThemeBody = React.createClass({
+const Sidebar = require('./Sidebar');
+const Page = require('./Page');
+
+let ThemeBody = React.createClass({
+ propTypes: {
+ page: GitBook.Shapes.Page
+ },
+
render() {
+ const { page } = this.props;
+
+ console.log('render theme', page);
return (
- <div>
+ <div className="GitBook book">
<GitBook.Head
- title={'Homepage'}
+ title={page.title}
titleTemplate="%s - GitBook"
/>
- My Base theme for gitbook
+ <Sidebar />
+ <Page page={page} />
</div>
);
}
});
+ThemeBody = GitBook.connect(ThemeBody, ({page}) => {
+ return { page };
+});
+
module.exports = GitBook.createPlugin((dispatch, state) => {
dispatch(GitBook.registerComponent(ThemeBody, { role: 'Body' }));
});