diff options
Diffstat (limited to 'packages/gitbook-plugin-theme-default')
60 files changed, 2133 insertions, 0 deletions
diff --git a/packages/gitbook-plugin-theme-default/.gitignore b/packages/gitbook-plugin-theme-default/.gitignore new file mode 100644 index 0000000..dfd90dc --- /dev/null +++ b/packages/gitbook-plugin-theme-default/.gitignore @@ -0,0 +1 @@ +_assets diff --git a/packages/gitbook-plugin-theme-default/.npmignore b/packages/gitbook-plugin-theme-default/.npmignore new file mode 100644 index 0000000..75e0923 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/.npmignore @@ -0,0 +1 @@ +!_assets diff --git a/packages/gitbook-plugin-theme-default/index.js b/packages/gitbook-plugin-theme-default/index.js new file mode 100644 index 0000000..f4d6253 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/index.js @@ -0,0 +1,3 @@ +module.exports = { + +}; diff --git a/packages/gitbook-plugin-theme-default/less/Body.less b/packages/gitbook-plugin-theme-default/less/Body.less new file mode 100644 index 0000000..4bc33db --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Body.less @@ -0,0 +1,9 @@ +.Body-Flex { + .flex(1 0 auto); +} + +.Body { + overflow: auto; + width: 100%; + height: 100%; +} diff --git a/packages/gitbook-plugin-theme-default/less/Button.less b/packages/gitbook-plugin-theme-default/less/Button.less new file mode 100644 index 0000000..336d16e --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Button.less @@ -0,0 +1,22 @@ +.GitBook-Button { + border: 0; + background-color: transparent; + background: @button-background; + color: @button-color; + text-align: center; + line-height: @line-height-base; + outline: none; + padding: @button-padding; + + &:hover { + color: @button-hover-color; + } + + &:focus, &:hover { + outline: none; + } +} + +.GitBook-ButtonGroup { + display: inline-block; +} diff --git a/packages/gitbook-plugin-theme-default/less/Dropdown.less b/packages/gitbook-plugin-theme-default/less/Dropdown.less new file mode 100644 index 0000000..2c341e4 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Dropdown.less @@ -0,0 +1,56 @@ +.GitBook-Dropdown { + display: inline-block; + position: relative; +} + +.GitBook-DropdownMenu { + position: absolute; + top: 100%; + right: 0; + z-index: 300; + border: 1px solid @dropdown-border-color; + margin: 5px; + margin-top: 0px; + border-radius: 3px; + background: @dropdown-background; + + &:before { + content: " "; + width: 0; + height: 0; + border-left: @dropdown-arrow-width solid transparent; + border-right: @dropdown-arrow-width solid transparent; + border-bottom: @dropdown-arrow-width solid @dropdown-border-color; + position: absolute; + top: -@dropdown-arrow-width; + right: 10px; + } + + &:after { + content: " "; + width: 0; + height: 0; + border-left: (@dropdown-arrow-width - 1) solid transparent; + border-right: (@dropdown-arrow-width - 1) solid transparent; + border-bottom: (@dropdown-arrow-width - 1) solid @dropdown-background; + position: absolute; + top: -(@dropdown-arrow-width - 1); + right: 11px; + } +} + +.GitBook-DropdownItem { + padding: @dropdown-padding-v @dropdown-padding-h; +} + +.GitBook-DropdownItemLink { + width: 100%; + display: inline-block; + padding: @dropdown-padding-v @dropdown-padding-h; + text-align: center; + color: @dropdown-color; + + &:hover { + color: @dropdown-hover-color; + } +} diff --git a/packages/gitbook-plugin-theme-default/less/LoadingBar.less b/packages/gitbook-plugin-theme-default/less/LoadingBar.less new file mode 100644 index 0000000..1fca2ea --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/LoadingBar.less @@ -0,0 +1,30 @@ +.LoadingBar { + pointer-events: none; + transition: 400ms linear all; + + .LoadingBar-Bar { + background: @color-primary; + height: 2px; + + position: fixed; + top: 0; + left: 0; + z-index: 10000; + display: none; + width: 100%; + border-radius: 0 1px 1px 0; + transition: width 350ms; + } + + .LoadingBar-Shadow { + content: ''; + position: absolute; + top: 0; + right: 0; + width: 70px; + height: 2px; + border-radius: 50%; + opacity: .45; + box-shadow: @color-primary 1px 0 6px 1px; + } +} diff --git a/packages/gitbook-plugin-theme-default/less/Page.less b/packages/gitbook-plugin-theme-default/less/Page.less new file mode 100644 index 0000000..6011533 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Page.less @@ -0,0 +1,16 @@ +.PageContainer { + position: relative; + outline: none; + width: 100%; + max-width: @page-width; + margin: 0px auto; + padding: 20px 15px 40px 15px; + font-size: @page-font-size; + .gitbook-markdown(@md-color: @page-color, @md-line-height: @page-line-height); + overflow: visible; + + .glossary-term { + cursor: help; + text-decoration: underline; + } +} diff --git a/packages/gitbook-plugin-theme-default/less/Panel.less b/packages/gitbook-plugin-theme-default/less/Panel.less new file mode 100644 index 0000000..507396c --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Panel.less @@ -0,0 +1,7 @@ +.GitBook-Panel { + border: 2px solid #f5f5f5; + padding: 10px; + background: #fafafa; + border-radius: 2px; + margin-top: 20px; +} diff --git a/packages/gitbook-plugin-theme-default/less/Search.less b/packages/gitbook-plugin-theme-default/less/Search.less new file mode 100644 index 0000000..faa871f --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Search.less @@ -0,0 +1,38 @@ +.Search-Input { + padding: 6px; + background: transparent; + transition: top 0.5s ease; + background: #fff; + border-bottom: 1px solid @sidebar-border-color; + border-top: 1px solid @sidebar-border-color; + margin-bottom: 10px; + + // Move top to hide top border + margin-top: -1px; + + input, input:focus, input:hover { + width: 90%; // 10% room for clear input X + background: transparent; + border: 1px solid transparent; + box-shadow: none; + outline: none; + line-height: 22px; + padding: 7px 7px; + color: inherit; + } +} + +.Search-Clear { + width: 10%; + display: inline-block; + text-align: center; + font-size: 14px; + line-height: 22px; + color: @search-clear-color; + cursor: pointer; +} + + +.Search-MatchSpan { + background: @search-highlight-color; +} diff --git a/packages/gitbook-plugin-theme-default/less/Sidebar.less b/packages/gitbook-plugin-theme-default/less/Sidebar.less new file mode 100644 index 0000000..1689b9f --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Sidebar.less @@ -0,0 +1,29 @@ +.Sidebar-Flex { + .flex(0 0 @sidebar-width); + + &.Layout-enter { + margin-left: -@sidebar-width; + + &.Layout-enter-active { + margin-left: 0; + transition: margin-left 250ms ease-in-out; + } + } + + &.Layout-leave { + margin-left: 0; + + &.Layout-leave-active { + margin-left: -@sidebar-width; + transition: margin-left 250ms ease-in-out; + } + } +} + +.Sidebar { + height: 100%; + background: @sidebar-background; + background: rgb(250, 250, 250); + border-right: 1px solid @sidebar-border-color; + overflow-y: auto; +} diff --git a/packages/gitbook-plugin-theme-default/less/Summary.less b/packages/gitbook-plugin-theme-default/less/Summary.less new file mode 100644 index 0000000..1e1e8ba --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Summary.less @@ -0,0 +1,51 @@ +.Summary { + +} + +.SummaryPart { + +} + +.SummaryPart-Title { + margin: 0px; + padding: 2*@summary-article-padding-v @summary-article-padding-h; + text-transform: uppercase; + color: @summary-header-color; + font-size: inherit; + font-weight: inherit; +} + +.SummaryArticles { + list-style: none; + margin: 0px; + padding: 0px; +} + +.SummaryArticle { + list-style: none; + + a, span { + display: block; + padding: @summary-article-padding-v @summary-article-padding-h; + border-bottom: none; + color: @summary-article-color; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + position: relative; + text-decoration: none; + outline: none; + } + + a:hover { + text-decoration: none; + color: @summary-article-hover-color; + } + + &.active, &.active:hover { + a { + color: @summary-article-active-color; + background: @summary-article-active-background; + } + } +} diff --git a/packages/gitbook-plugin-theme-default/less/Toolbar.less b/packages/gitbook-plugin-theme-default/less/Toolbar.less new file mode 100644 index 0000000..8c59d96 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Toolbar.less @@ -0,0 +1,27 @@ +.Toolbar { + .Toolbar-Title { + padding: 0px 20px; + margin: 0; + font-size: 20px; + font-weight: 200; + text-align: center; + line-height: 50px; + opacity: 0; + .transition(~"opacity ease .2s"); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: @button-hover-color; + + a, a:hover { + text-decoration: none; + color: inherit; + } + } + + &:hover { + .Toolbar-Title { + opacity: 1; + } + } +} diff --git a/packages/gitbook-plugin-theme-default/less/Tooltipped.less b/packages/gitbook-plugin-theme-default/less/Tooltipped.less new file mode 100644 index 0000000..126daab --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/Tooltipped.less @@ -0,0 +1,100 @@ +.GitBook-Tooltipped { + display: inline-block; + position: relative; + + &:hover, &.Tooltipped-o { + &:after { + line-height: 1em; + background: @tooltip-background; + border-radius: @tooltip-radius; + bottom: auto; + top: ~"calc(100% + 10px)"; + color: @tooltip-color; + content: attr(aria-label); + display: block; + left: 50%; + padding: 5px 5px; + position: absolute; + white-space: nowrap; + z-index: @zindex-tooltip; + font-size: 13px; + text-transform: none; + font-weight: @font-size-base; + pointer-events: none; + transform: translateX(-50%); + } + + &:before { + border: solid; + border-color: @tooltip-background transparent; + bottom:auto; + top: ~"calc(100% + 5px)"; + border-width: 0px 5px 5px 5px; + content: ""; + display: block; + left: 50%; + position: absolute; + z-index: @zindex-tooltip+1; + transform: translateX(-50%); + } + } + + .north() { + &:after { + top: auto; + bottom: ~"calc(100% + 10px)"; + transform: translateX(0%); + } + &:before { + top: auto; + border-width: 5px 5px 0px 5px; + bottom: ~"calc(100% + 5px)"; + transform: translateX(0%); + } + } + .west() { + &:after { + left: auto; + right: 5px; + transform: translateX(0%); + } + &:before { + left: auto; + right: 10px; + transform: translateX(0%); + } + } + .east() { + &:after { + right: auto; + left: 5px; + transform: translateX(0%); + } + &:before { + right: auto; + left: 10px; + transform: translateX(0%); + } + } + + &.Tooltipped-e { + .east() + } + + &.Tooltipped-n { + .north(); + } + + &.Tooltipped-ne { + .north(); + .east(); + } + + &.Tooltipped-nw { + .north(); + .west(); + } + &.Tooltipped-sw, &.Tooltipped-w { + .west(); + } +} diff --git a/packages/gitbook-plugin-theme-default/less/main.less b/packages/gitbook-plugin-theme-default/less/main.less new file mode 100644 index 0000000..d3c0dd5 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/main.less @@ -0,0 +1,50 @@ +@import "../node_modules/preboot/less/preboot.less"; +@import "../node_modules/gitbook-markdown-css/less/mixin.less"; +@import "../node_modules/font-awesome/less/font-awesome.less"; + +@import "mixins.less"; +@import "reset.less"; +@import "variables.less"; + +@import "Button.less"; +@import "Sidebar.less"; +@import "Summary.less"; +@import "Page.less"; +@import "Toolbar.less"; +@import "Search.less"; +@import "Body.less"; +@import "Dropdown.less"; +@import "LoadingBar.less"; +@import "Tooltipped.less"; +@import "Panel.less"; + +* { + .box-sizing(border-box); + -webkit-overflow-scrolling: touch; + -webkit-tap-highlight-color: transparent; + -webkit-text-size-adjust: none; + -webkit-touch-callout: none; + -webkit-font-smoothing: antialiased; +} + +a { + text-decoration: none; +} + +html, body { + margin: 0px; + height: 100%; +} + +html { + font-size: 62.5%; +} + +body { + text-rendering: optimizeLegibility; + font-smoothing: antialiased; + font-family: @font-family-base; + font-size: @font-size-base; + letter-spacing: .2px; + .text-adjust(100%); +} diff --git a/packages/gitbook-plugin-theme-default/less/mixins.less b/packages/gitbook-plugin-theme-default/less/mixins.less new file mode 100644 index 0000000..e4308b9 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/mixins.less @@ -0,0 +1,15 @@ +.text-adjust(@value) { + text-size-adjust: @value; + -ms-text-size-adjust: @value; + -webkit-text-size-adjust: @value; +} + +// The 'flex' shorthand +// - applies to: flex items +// <positive-number>, initial, auto, or none +.flex(@columns: initial) { + -webkit-flex: @columns; + -moz-flex: @columns; + -ms-flex: @columns; + flex: @columns; +} diff --git a/packages/gitbook-plugin-theme-default/less/reset.less b/packages/gitbook-plugin-theme-default/less/reset.less new file mode 100644 index 0000000..a9c6f52 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/reset.less @@ -0,0 +1,396 @@ +/*! normalize.css v2.1.0 | MIT License | git.io/normalize */ + +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined in IE 8/9. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 8/9. + */ + +audio, +canvas, +video { + display: inline-block; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -ms-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari 5, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9, Safari 5, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Correct font family set oddly in Safari 5 and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre-wrap; +} + +/** + * Set consistent quote types. + */ + +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9. + */ + +img { + border: 0; +} + +/** + * Correct overflow displayed oddly in IE 9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari 5. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Correct font family not being inherited in all browsers. + * 2. Correct font size not being inherited in all browsers. + * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. + */ + +button, +input, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to `content-box` in IE 8/9. + * 2. Remove excess padding in IE 8/9. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 8/9. + * 2. Improve readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/packages/gitbook-plugin-theme-default/less/variables.less b/packages/gitbook-plugin-theme-default/less/variables.less new file mode 100644 index 0000000..5c6842d --- /dev/null +++ b/packages/gitbook-plugin-theme-default/less/variables.less @@ -0,0 +1,55 @@ +// Colors +@color-primary: hsl(207, 100%, 50%); // rgb(44, 106, 254); +// Fonts +@font-family-serif: Georgia, serif; +@font-family-sans: "Helvetica Neue", Helvetica, Arial, sans-serif; +@font-family-base: @font-family-sans; +// Font sizes +@font-size-base: 14px; +@font-size-large: ceil(@font-size-base * 1.25); // ~18px +@font-size-small: ceil(@font-size-base * 0.85); // ~12px +@line-height-base: 1.428571429; // 20/14 +@line-height-computed: floor(@font-size-base * @line-height-base); +// Sidebar +@sidebar-background: rgb(250, 250, 250); +@sidebar-border-color: rgba(0, 0, 0, 0.0666667); +@sidebar-width: 300px; +// Summary +@summary-header-color: #939da3; +@summary-article-padding-v: 10px; +@summary-article-padding-h: 15px; +@summary-article-color: hsl(207, 15%, 25%); +@summary-article-hover-color: @color-primary; +@summary-article-active-color: @summary-article-color; +@summary-article-active-background: #f5f5f5; +// Page +@page-width: 800px; +@page-color: #333333; +@page-line-height: 1.7; +@page-font-size: 16px; +// Button +@button-padding: 19px; +@button-background: transparent; +@button-color: #bbb; +@button-hover-color: #a1a1a1; +// Dropdown +@dropdown-padding-v: 10px; +@dropdown-padding-h: 15px; +@dropdown-arrow-width: 8px; +@dropdown-border-color: #e5e5e5; +@dropdown-color: @button-color; +@dropdown-hover-color: @button-hover-color; +@dropdown-background: #fff; +// Tooltip +@tooltip-background: rgba(0,0,0,.8); +@tooltip-radius: 3px; +@tooltip-color: #fff; +// Search +@search-highlight-color: rgba(255, 220, 0, 0.4); +@search-clear-color: @button-color; +// Font awesome +@path-assets: '.'; +@path-fonts: '@{path-assets}/fonts'; +@fa-font-path: '@{path-fonts}/fontawesome'; +// Z-indexes +@zindex-tooltip: 300; diff --git a/packages/gitbook-plugin-theme-default/package.json b/packages/gitbook-plugin-theme-default/package.json new file mode 100644 index 0000000..7c44305 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/package.json @@ -0,0 +1,80 @@ +{ + "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": { + "debounce": "^1.0.0", + "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 + } + } + } +} diff --git a/packages/gitbook-plugin-theme-default/prepublish.sh b/packages/gitbook-plugin-theme-default/prepublish.sh new file mode 100755 index 0000000..458df9b --- /dev/null +++ b/packages/gitbook-plugin-theme-default/prepublish.sh @@ -0,0 +1,11 @@ +#! /bin/bash +# +# Compile LESS To CSS +lessc -clean-css ./less/main.less ./_assets/website/theme.css + +# Compile JS +gitbook-plugin build ./src/index.js ./_assets/theme.js + +# Copy fonts +mkdir -p _assets/website/fonts +cp -R node_modules/font-awesome/fonts/ _assets/website/fonts/fontawesome/ diff --git a/packages/gitbook-plugin-theme-default/src/actions/sidebar.js b/packages/gitbook-plugin-theme-default/src/actions/sidebar.js new file mode 100644 index 0000000..52f8422 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/actions/sidebar.js @@ -0,0 +1,13 @@ +const ActionTypes = require('./types'); + +/** + * Toggle the sidebar + * @return {Action} + */ +function toggle() { + return { type: ActionTypes.TOGGLE_SIDEBAR }; +} + +module.exports = { + toggle +}; diff --git a/packages/gitbook-plugin-theme-default/src/actions/types.js b/packages/gitbook-plugin-theme-default/src/actions/types.js new file mode 100644 index 0000000..9f8a80f --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/actions/types.js @@ -0,0 +1,4 @@ + +module.exports = { + TOGGLE_SIDEBAR: 'theme-default/sidebar/toggle' +}; diff --git a/packages/gitbook-plugin-theme-default/src/components/Body.js b/packages/gitbook-plugin-theme-default/src/components/Body.js new file mode 100644 index 0000000..c61a2f3 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/components/Body.js @@ -0,0 +1,121 @@ +const debounce = require('debounce'); +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +const Page = require('./Page'); +const Toolbar = require('./Toolbar'); + +const HEADINGS_SELECTOR = 'h1[id],h2[id],h3[id],h4[id]'; + +/** + * Get offset of an element relative to a parent container. + * @param {DOMElement} container + * @param {DOMElement} element + * @return {Number} offset + */ +function getOffset(container, element, type = 'Top') { + const parent = element.parentElement; + let base = 0; + + if (parent != container) { + base = getOffset(container, parent, type); + } + + return base + element[`offset${type}`]; +} + +/** + * Find the current heading anchor for a scroll position. + * @param {DOMElement} container + * @param {Number} top + * @return {String} + */ +function getHeadingID(container, top) { + let id; + const headings = container.querySelectorAll(HEADINGS_SELECTOR); + + headings.forEach(heading => { + if (id) { + return; + } + + const offset = getOffset(container, heading); + + if (offset > top) { + id = heading.getAttribute('id'); + } + }); + + return id; +} + +const Body = React.createClass({ + propTypes: { + page: GitBook.PropTypes.Page, + readme: GitBook.PropTypes.Readme, + history: GitBook.PropTypes.History, + updateURI: React.PropTypes.func + }, + + getInitialState() { + this.debouncedOnScroll = debounce(this.onScroll, 300); + return {}; + }, + + /** + * User is scrolling the page, update the location with current section's ID. + */ + onScroll() { + const { scrollContainer } = this; + const { history, updateURI } = this.props; + const { location } = history; + + // Find the id matching the current scroll position + const hash = getHeadingID(scrollContainer, scrollContainer.scrollTop); + + // Update url if changed + if (hash !== location.hash) { + updateURI(location.merge({ hash })); + } + }, + + /** + * Component has been updated with a new location, + * scroll to the right anchor. + */ + componentDidUpdate() { + + }, + + render() { + const { page, readme } = this.props; + + return ( + <GitBook.InjectedComponent matching={{ role: 'body:wrapper' }}> + <div + className="Body page-wrapper" + onScroll={this.debouncedOnScroll} + ref={div => this.scrollContainer = div} + > + <GitBook.InjectedComponent matching={{ role: 'toolbar:wrapper' }}> + <Toolbar title={page.title} readme={readme} /> + </GitBook.InjectedComponent> + <GitBook.InjectedComponent matching={{ role: 'page:wrapper' }}> + <Page page={page} /> + </GitBook.InjectedComponent> + </div> + </GitBook.InjectedComponent> + ); + } +}); + +module.exports = GitBook.connect(Body, + () => { + return {}; + }, + ({ History }, dispatch) => { + return { + updateURI: (location) => dispatch(History.replace(location)) + }; + } +); diff --git a/packages/gitbook-plugin-theme-default/src/components/LoadingBar.js b/packages/gitbook-plugin-theme-default/src/components/LoadingBar.js new file mode 100644 index 0000000..11e1ddb --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/components/LoadingBar.js @@ -0,0 +1,124 @@ +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +/** + * Displays a progress bar (YouTube-like) at the top of container + * Based on https://github.com/lonelyclick/react-loading-bar/blob/master/src/Loading.jsx + */ +const LoadingBar = React.createClass({ + propTypes: { + show: React.PropTypes.bool + }, + + getDefaultProps() { + return { + show: false + }; + }, + + getInitialState() { + return { + size: 0, + disappearDelayHide: false, // when dispappear, first transition then display none + percent: 0, + appearDelayWidth: 0 // when appear, first display block then transition width + }; + }, + + componentWillReceiveProps(nextProps) { + const { show } = nextProps; + + if (show) { + this.show(); + } else { + this.hide(); + } + }, + + shouldComponentUpdate(nextProps, nextState) { + return true; // !shallowEqual(nextState, this.state) + }, + + show() { + let { size, percent } = this.state; + + const appearDelayWidth = size === 0; + percent = calculatePercent(percent); + + this.setState({ + size: ++size, + appearDelayWidth, + percent + }); + + if (appearDelayWidth) { + setTimeout(() => { + this.setState({ + appearDelayWidth: false + }); + }); + } + }, + + hide() { + let { size } = this.state; + + if (--size < 0) { + this.setState({ size: 0 }); + return; + } + + this.setState({ + size: 0, + disappearDelayHide: true, + percent: 1 + }); + + setTimeout(() => { + this.setState({ + disappearDelayHide: false, + percent: 0 + }); + }, 500); + }, + + getBarStyle() { + const { disappearDelayHide, appearDelayWidth, percent } = this.state; + + return { + width: appearDelayWidth ? 0 : percent * 100 + '%', + display: disappearDelayHide || percent > 0 ? 'block' : 'none' + }; + }, + + getShadowStyle() { + const { percent, disappearDelayHide } = this.state; + + return { + display: disappearDelayHide || percent > 0 ? 'block' : 'none' + }; + }, + + render() { + return ( + <div className="LoadingBar"> + <div className="LoadingBar-Bar" style={this.getBarStyle()}> + <div className="LoadingBar-Shadow" + style={this.getShadowStyle()}> + </div> + </div> + </div> + ); + } +}); + +function calculatePercent(percent) { + percent = percent || 0; + + // How much of remaining bar we advance + const progress = 0.1 + Math.random() * 0.3; + + return percent + progress * (1 - percent); +} + +module.exports = LoadingBar; diff --git a/packages/gitbook-plugin-theme-default/src/components/Page.js b/packages/gitbook-plugin-theme-default/src/components/Page.js new file mode 100644 index 0000000..cbce704 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/components/Page.js @@ -0,0 +1,30 @@ +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +const Page = React.createClass({ + propTypes: { + page: GitBook.PropTypes.Page + }, + + render() { + const { page } = this.props; + + return ( + <div className="PageContainer"> + <GitBook.InjectedComponent matching={{ role: 'search:container:results' }} props={this.props}> + <div className="Page"> + <GitBook.InjectedComponentSet matching={{ role: 'page:header' }} props={this.props} /> + + <GitBook.InjectedComponent matching={{ role: 'page:container' }} props={this.props}> + <GitBook.HTMLContent html={page.content} /> + </GitBook.InjectedComponent> + + <GitBook.InjectedComponentSet matching={{ role: 'page:footer' }} props={this.props} /> + </div> + </GitBook.InjectedComponent> + </div> + ); + } +}); + +module.exports = Page; diff --git a/packages/gitbook-plugin-theme-default/src/components/Sidebar.js b/packages/gitbook-plugin-theme-default/src/components/Sidebar.js new file mode 100644 index 0000000..ab628df --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/components/Sidebar.js @@ -0,0 +1,25 @@ +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +const Summary = require('./Summary'); + +const Sidebar = React.createClass({ + propTypes: { + summary: GitBook.PropTypes.Summary + }, + + render() { + const { summary } = this.props; + + return ( + <div className="Sidebar-Flex"> + <div className="Sidebar book-summary"> + <GitBook.InjectedComponent matching={{ role: 'search:container:input' }} /> + <Summary summary={summary} /> + </div> + </div> + ); + } +}); + +module.exports = Sidebar; diff --git a/packages/gitbook-plugin-theme-default/src/components/Summary.js b/packages/gitbook-plugin-theme-default/src/components/Summary.js new file mode 100644 index 0000000..ef6ab3f --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/components/Summary.js @@ -0,0 +1,111 @@ +const classNames = require('classnames'); +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +let SummaryArticle = React.createClass({ + propTypes: { + active: React.PropTypes.bool, + article: GitBook.PropTypes.SummaryArticle + }, + + render() { + const { article, active } = this.props; + const className = classNames('SummaryArticle', { + active + }); + + return ( + <GitBook.InjectedComponent matching={{ role: 'summary:article' }} props={this.props}> + <li className={className}> + {article.ref ? + <GitBook.Link to={article}>{article.title}</GitBook.Link> + : <span>{article.title}</span>} + </li> + </GitBook.InjectedComponent> + ); + } +}); +SummaryArticle = GitBook.connect(SummaryArticle, ({page}, {article}) => { + return { + active: page.level === article.level + }; +}); + +const SummaryArticles = React.createClass({ + propTypes: { + articles: GitBook.PropTypes.listOf(GitBook.PropTypes.SummaryArticle) + }, + + render() { + const { articles } = this.props; + + return ( + <GitBook.InjectedComponent matching={{ role: 'summary:articles' }} props={this.props}> + <ul className="SummaryArticles"> + {articles.map(article => <SummaryArticle key={article.level} article={article} />)} + </ul> + </GitBook.InjectedComponent> + ); + } +}); + +const SummaryPart = React.createClass({ + propTypes: { + part: GitBook.PropTypes.SummaryPart + }, + + render() { + const { part } = this.props; + const { title, articles } = part; + + const titleEL = title ? <h2 className="SummaryPart-Title">{title}</h2> : null; + + return ( + <GitBook.InjectedComponent matching={{ role: 'summary:part' }} props={this.props}> + <div className="SummaryPart"> + {titleEL} + <SummaryArticles articles={articles} /> + </div> + </GitBook.InjectedComponent> + ); + } +}); + +const SummaryParts = React.createClass({ + propTypes: { + parts: GitBook.PropTypes.listOf(GitBook.PropTypes.SummaryPart) + }, + + render() { + const { parts } = this.props; + + return ( + <GitBook.InjectedComponent matching={{ role: 'summary:parts' }} props={this.props}> + <div className="SummaryParts"> + {parts.map((part, i) => <SummaryPart key={i} part={part} />)} + </div> + </GitBook.InjectedComponent> + ); + } +}); + +const Summary = React.createClass({ + propTypes: { + summary: GitBook.PropTypes.Summary + }, + + render() { + const { summary } = this.props; + const { parts } = summary; + + return ( + <GitBook.InjectedComponent matching={{ role: 'summary:container' }} props={this.props}> + <div className="Summary book-summary"> + <SummaryParts parts={parts} /> + </div> + </GitBook.InjectedComponent> + ); + } +}); + +module.exports = Summary; diff --git a/packages/gitbook-plugin-theme-default/src/components/Theme.js b/packages/gitbook-plugin-theme-default/src/components/Theme.js new file mode 100644 index 0000000..b323fc4 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/components/Theme.js @@ -0,0 +1,57 @@ +const GitBook = require('gitbook-core'); +const { React, ReactCSSTransitionGroup } = GitBook; + +const Sidebar = require('./Sidebar'); +const Body = require('./Body'); +const LoadingBar = require('./LoadingBar'); + +const Theme = React.createClass({ + propTypes: { + // State + page: GitBook.PropTypes.Page, + summary: GitBook.PropTypes.Summary, + readme: GitBook.PropTypes.Readme, + history: GitBook.PropTypes.History, + sidebar: React.PropTypes.object, + // Other props + children: React.PropTypes.node + }, + + render() { + const { page, summary, children, sidebar, readme, history } = this.props; + + return ( + <GitBook.FlexLayout column className="GitBook book"> + <LoadingBar show={history.loading} /> + <GitBook.Head + title={page.title} + titleTemplate="%s - GitBook" /> + <GitBook.ImportCSS href="gitbook/theme-default/theme.css" /> + + <GitBook.FlexBox> + <ReactCSSTransitionGroup + component={GitBook.FlexLayout} + transitionName="Layout" + transitionEnterTimeout={300} + transitionLeaveTimeout={300}> + {sidebar.open ? ( + <Sidebar key={0} summary={summary} /> + ) : null} + <div key={1} className="Body-Flex"> + <Body + page={page} + readme={readme} + history={history} + /> + </div> + </ReactCSSTransitionGroup> + </GitBook.FlexBox> + {children} + </GitBook.FlexLayout> + ); + } +}); + +module.exports = GitBook.connect(Theme, ({page, summary, sidebar, readme, history}) => { + return { page, summary, sidebar, readme, history }; +}); diff --git a/packages/gitbook-plugin-theme-default/src/components/Toolbar.js b/packages/gitbook-plugin-theme-default/src/components/Toolbar.js new file mode 100644 index 0000000..d426a40 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/components/Toolbar.js @@ -0,0 +1,43 @@ +const GitBook = require('gitbook-core'); +const { React } = GitBook; + +const sidebar = require('../actions/sidebar'); + +const Toolbar = React.createClass({ + propTypes: { + title: React.PropTypes.string.isRequired, + dispatch: React.PropTypes.func, + readme: GitBook.PropTypes.Readme + }, + + onToggle() { + const { dispatch } = this.props; + dispatch(sidebar.toggle()); + }, + + render() { + const { title, readme } = this.props; + + return ( + <GitBook.FlexLayout className="Toolbar"> + <GitBook.FlexBox className="Toolbar-left"> + <GitBook.InjectedComponentSet align="flex-end" matching={{ role: 'toolbar:buttons:left' }}> + <GitBook.Button onClick={this.onToggle}> + <GitBook.Icon id="align-justify" /> + </GitBook.Button> + </GitBook.InjectedComponentSet> + </GitBook.FlexBox> + <GitBook.FlexBox auto> + <h1 className="Toolbar-Title"> + <GitBook.Link to={readme.file}>{title}</GitBook.Link> + </h1> + </GitBook.FlexBox> + <GitBook.FlexBox className="Toolbar-right"> + <GitBook.InjectedComponentSet align="flex-end" matching={{ role: 'toolbar:buttons:right' }} /> + </GitBook.FlexBox> + </GitBook.FlexLayout> + ); + } +}); + +module.exports = GitBook.connect(Toolbar); diff --git a/packages/gitbook-plugin-theme-default/src/i18n/ar.json b/packages/gitbook-plugin-theme-default/src/i18n/ar.json new file mode 100644 index 0000000..f652c1a --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/ar.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "اختيار اللغة", + "GLOSSARY": "قاموس مصطلحات", + "GLOSSARY_INDEX": "مؤشر المصطلحات", + "GLOSSARY_OPEN": "قاموس مصطلحات", + "GITBOOK_LINK": "نشرت مع GitBook", + "SUMMARY": "جدول المحتويات", + "SUMMARY_INTRODUCTION": "مقدمة", + "SUMMARY_TOGGLE": "جدول المحتويات", + "SEARCH_TOGGLE": "بحث", + "SEARCH_PLACEHOLDER": "اكتب للبحث", + "FONTSETTINGS_TOGGLE": "إعدادات الخط", + "SHARE_TOGGLE": "حصة", + "SHARE_ON": "على {{platform}} حصة", + "FONTSETTINGS_WHITE": "أبيض", + "FONTSETTINGS_SEPIA": "بني داكن", + "FONTSETTINGS_NIGHT": "ليل", + "FONTSETTINGS_SANS": "بلا", + "FONTSETTINGS_SERIF": "الرقيق" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/bn.json b/packages/gitbook-plugin-theme-default/src/i18n/bn.json new file mode 100644 index 0000000..24baec3 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/bn.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "ভাষা নির্বাচন করুন", + "GLOSSARY": "গ্লোসারি", + "GLOSSARY_INDEX": "ইন্ডেক্স", + "GLOSSARY_OPEN": "গ্লোসারি", + "GITBOOK_LINK": "গিটবুকের মাধ্যমে প্রকাশিত", + "SUMMARY": "সূচিপত্র", + "SUMMARY_INTRODUCTION": "সূচনা", + "SUMMARY_TOGGLE": "সূচিপত্র", + "SEARCH_TOGGLE": "অনুসন্ধান", + "SEARCH_PLACEHOLDER": "অনুসন্ধান", + "FONTSETTINGS_TOGGLE": "ফন্ট সেটিংস", + "SHARE_TOGGLE": "শেয়ার", + "SHARE_ON": "{{platform}}-এ শেয়ার", + "FONTSETTINGS_WHITE": "সাদা", + "FONTSETTINGS_SEPIA": "সেপিয়া", + "FONTSETTINGS_NIGHT": "রাত", + "FONTSETTINGS_SANS": "স্যান্স", + "FONTSETTINGS_SERIF": "শেরিফ" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/ca.json b/packages/gitbook-plugin-theme-default/src/i18n/ca.json new file mode 100644 index 0000000..d26edb6 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/ca.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Selecciona un idioma", + "GLOSSARY": "Glossari", + "GLOSSARY_INDEX": "Índex", + "GLOSSARY_OPEN": "Glossari", + "GITBOOK_LINK": "Publicat amb GitBook", + "SUMMARY": "Taula de contingut", + "SUMMARY_INTRODUCTION": "Introducció", + "SUMMARY_TOGGLE": "Taula de contingut", + "SEARCH_TOGGLE": "Cercar", + "SEARCH_PLACEHOLDER": "Escriu per cercar", + "FONTSETTINGS_TOGGLE": "Configuració de font", + "SHARE_TOGGLE": "Compartir", + "SHARE_ON": "Compartir en {{platform}}", + "FONTSETTINGS_WHITE": "Clar", + "FONTSETTINGS_SEPIA": "Sèpia", + "FONTSETTINGS_NIGHT": "Nit", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/cs.json b/packages/gitbook-plugin-theme-default/src/i18n/cs.json new file mode 100644 index 0000000..b2e19c0 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/cs.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Zvolte jazyk", + "GLOSSARY": "Slovníček", + "GLOSSARY_INDEX": "Rejstřík", + "GLOSSARY_OPEN": "Slovníček", + "GITBOOK_LINK": "Publikováno pomocí GitBook", + "SUMMARY": "Obsah", + "SUMMARY_INTRODUCTION": "Úvod", + "SUMMARY_TOGGLE": "Obsah", + "SEARCH_TOGGLE": "Hledání", + "SEARCH_PLACEHOLDER": "Vyhledat", + "FONTSETTINGS_TOGGLE": "Nastavení písma", + "SHARE_TOGGLE": "Sdílet", + "SHARE_ON": "Sdílet na {{platform}}", + "FONTSETTINGS_WHITE": "Bílá", + "FONTSETTINGS_SEPIA": "Sépie", + "FONTSETTINGS_NIGHT": "Noc", + "FONTSETTINGS_SANS": "Bezpatkové", + "FONTSETTINGS_SERIF": "Patkové" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/de.json b/packages/gitbook-plugin-theme-default/src/i18n/de.json new file mode 100644 index 0000000..b51732e --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/de.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Sprache auswählen", + "GLOSSARY": "Glossar", + "GLOSSARY_INDEX": "Index", + "GLOSSARY_OPEN": "Glossar", + "GITBOOK_LINK": "Veröffentlicht mit GitBook", + "SUMMARY": "Inhaltsverzeichnis", + "SUMMARY_INTRODUCTION": "Einleitung", + "SUMMARY_TOGGLE": "Inhaltsverzeichnis", + "SEARCH_TOGGLE": "Suche", + "SEARCH_PLACEHOLDER": "Suchbegriff eingeben", + "FONTSETTINGS_TOGGLE": "Schrifteinstellungen", + "SHARE_TOGGLE": "Teilen", + "SHARE_ON": "Auf {{platform}} teilen", + "FONTSETTINGS_WHITE": "Hell", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Nacht", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +}
\ No newline at end of file diff --git a/packages/gitbook-plugin-theme-default/src/i18n/el.json b/packages/gitbook-plugin-theme-default/src/i18n/el.json new file mode 100644 index 0000000..5198e60 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/el.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Επιλογή γλώσσας", + "GLOSSARY": "Γλωσσάρι", + "GLOSSARY_INDEX": "Ευρετήριο", + "GLOSSARY_OPEN": "Γλωσσάρι", + "GITBOOK_LINK": "Δημοσιεύτηκε με το GitBook", + "SUMMARY": "Πίνακας Περιεχομένων", + "SUMMARY_INTRODUCTION": "Εισαγωγή", + "SUMMARY_TOGGLE": "Πίνακας Περιεχομένων", + "SEARCH_TOGGLE": "Αναζήτηση", + "SEARCH_PLACEHOLDER": "Αναζήτηση για ...", + "FONTSETTINGS_TOGGLE": "Επιλογές γραμματοσειράς", + "SHARE_TOGGLE": "Κοινοποίηση", + "SHARE_ON": "Κοινοποίηση σε {{platform}}", + "FONTSETTINGS_WHITE": "Λευκό", + "FONTSETTINGS_SEPIA": "Καστανόχρους", + "FONTSETTINGS_NIGHT": "Βραδινό", + "FONTSETTINGS_SANS": "Χωρίς πατούρες", + "FONTSETTINGS_SERIF": "Με πατούρες" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/en.json b/packages/gitbook-plugin-theme-default/src/i18n/en.json new file mode 100644 index 0000000..b6504d3 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/en.json @@ -0,0 +1,21 @@ +{ + "LANGS_CHOOSE": "Choose a language", + "GLOSSARY": "Glossary", + "GLOSSARY_INDEX": "Index", + "GLOSSARY_OPEN": "Glossary", + "GITBOOK_LINK": "Published with GitBook", + "SUMMARY": "Table of Contents", + "SUMMARY_INTRODUCTION": "Introduction", + "SUMMARY_TOGGLE": "Table of Contents", + "SEARCH_TOGGLE": "Search", + "SEARCH_PLACEHOLDER": "Type to search", + "SEARCH_RESULTS_TITLE": "{count, plural, =0 {No results} one {1 result} other {{count} results}} matching \"{query}\"", + "FONTSETTINGS_TOGGLE": "Font Settings", + "SHARE_TOGGLE": "Share", + "SHARE_ON": "Share on {{platform}}", + "FONTSETTINGS_WHITE": "White", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Night", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/es.json b/packages/gitbook-plugin-theme-default/src/i18n/es.json new file mode 100644 index 0000000..36159be --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/es.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Selecciona un idioma", + "GLOSSARY": "Glosario", + "GLOSSARY_INDEX": "Índice", + "GLOSSARY_OPEN": "Glosario", + "GITBOOK_LINK": "Publicado con GitBook", + "SUMMARY": "Tabla de contenido", + "SUMMARY_INTRODUCTION": "Introducción", + "SUMMARY_TOGGLE": "Tabla de contenido", + "SEARCH_TOGGLE": "Buscar", + "SEARCH_PLACEHOLDER": "Escribe para buscar", + "FONTSETTINGS_TOGGLE": "Configuración de fuente", + "SHARE_TOGGLE": "Compartir", + "SHARE_ON": "Compartir en {{platform}}", + "FONTSETTINGS_WHITE": "Claro", + "FONTSETTINGS_SEPIA": "Sépia", + "FONTSETTINGS_NIGHT": "Noche", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/fa.json b/packages/gitbook-plugin-theme-default/src/i18n/fa.json new file mode 100644 index 0000000..56ded4f --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/fa.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "انتخاب زبان", + "GLOSSARY": "واژهنامه", + "GLOSSARY_INDEX": "فهرست واژهها", + "GLOSSARY_OPEN": "واژهنامه", + "GITBOOK_LINK": "انتشار یافته توسط GitBook", + "SUMMARY": "فهرست مطالب", + "SUMMARY_INTRODUCTION": "مقدمه", + "SUMMARY_TOGGLE": "فهرست مطالب", + "SEARCH_TOGGLE": "جستجو", + "SEARCH_PLACEHOLDER": "چیزی برای جستجو بنویسید", + "FONTSETTINGS_TOGGLE": "تنظیمات فونت", + "SHARE_TOGGLE": "اشتراک", + "SHARE_ON": "در {{platform}} به اشتراک بگذارید", + "FONTSETTINGS_WHITE": "سفید", + "FONTSETTINGS_SEPIA": "سپیا", + "FONTSETTINGS_NIGHT": "شب", + "FONTSETTINGS_SANS": "سنس", + "FONTSETTINGS_SERIF": "سریف" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/fi.json b/packages/gitbook-plugin-theme-default/src/i18n/fi.json new file mode 100644 index 0000000..a8476ca --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/fi.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Valitse kieli", + "GLOSSARY": "Sanasto", + "GLOSSARY_INDEX": "Hakemisto", + "GLOSSARY_OPEN": "Sanasto", + "GITBOOK_LINK": "Julkaistu GitBookilla", + "SUMMARY": "Sisällysluettelo", + "SUMMARY_INTRODUCTION": "Johdanto", + "SUMMARY_TOGGLE": "Sisällysluettelu", + "SEARCH_TOGGLE": "Etsi", + "SEARCH_PLACEHOLDER": "Kirjoita hakusana", + "FONTSETTINGS_TOGGLE": "Fonttivalinnat", + "SHARE_TOGGLE": "Jaa", + "SHARE_ON": "Jaa {{platform}}ssa", + "FONTSETTINGS_WHITE": "Valkoinen", + "FONTSETTINGS_SEPIA": "Seepia", + "FONTSETTINGS_NIGHT": "Yö", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/fr.json b/packages/gitbook-plugin-theme-default/src/i18n/fr.json new file mode 100644 index 0000000..8cc10e2 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/fr.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Choisissez une langue", + "GLOSSARY": "Glossaire", + "GLOSSARY_INDEX": "Index", + "GLOSSARY_OPEN": "Glossaire", + "GITBOOK_LINK": "Publié avec GitBook", + "SUMMARY": "Table des matières", + "SUMMARY_INTRODUCTION": "Introduction", + "SUMMARY_TOGGLE": "Table des matières", + "SEARCH_TOGGLE": "Recherche", + "SEARCH_PLACEHOLDER": "Tapez pour rechercher", + "FONTSETTINGS_TOGGLE": "Paramètres de Police", + "SHARE_TOGGLE": "Partage", + "SHARE_ON": "Partager sur {{platform}}", + "FONTSETTINGS_WHITE": "Clair", + "FONTSETTINGS_SEPIA": "Sépia", + "FONTSETTINGS_NIGHT": "Nuit", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +}
\ No newline at end of file diff --git a/packages/gitbook-plugin-theme-default/src/i18n/he.json b/packages/gitbook-plugin-theme-default/src/i18n/he.json new file mode 100644 index 0000000..353d3b5 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/he.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "בחר שפה", + "GLOSSARY": "מונחים", + "GLOSSARY_INDEX": "מפתח", + "GLOSSARY_OPEN": "מונחים", + "GITBOOK_LINK": "הוצאה לאור באמצעות גיט-בוק GITBOOK", + "SUMMARY": "תוכן העניינים", + "SUMMARY_INTRODUCTION": "הוראות", + "SUMMARY_TOGGLE": "תקציר", + "SEARCH_TOGGLE": "חיפוש", + "SEARCH_PLACEHOLDER": "סוג החיפוש", + "FONTSETTINGS_TOGGLE": "הגדרת אותיות", + "SHARE_TOGGLE": "שתף", + "SHARE_ON": "{{platform}} שתף ב", + "FONTSETTINGS_WHITE": "בהיר", + "FONTSETTINGS_SEPIA": "חום כהה", + "FONTSETTINGS_NIGHT": "מצב לילה", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/index.js b/packages/gitbook-plugin-theme-default/src/i18n/index.js new file mode 100644 index 0000000..d09de1b --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/index.js @@ -0,0 +1,30 @@ + +module.exports = { + ar: require('./ar'), + bn: require('./bn'), + ca: require('./ca'), + cs: require('./cs'), + de: require('./de'), + el: require('./el'), + en: require('./en'), + es: require('./es'), + fa: require('./fa'), + fi: require('./fi'), + fr: require('./fr'), + he: require('./he'), + it: require('./it'), + ja: require('./ja'), + ko: require('./ko'), + nl: require('./nl'), + no: require('./no'), + pl: require('./pl'), + pt: require('./pt'), + ro: require('./ro'), + ru: require('./ru'), + sv: require('./sv'), + tr: require('./tr'), + uk: require('./uk'), + vi: require('./vi'), + 'zh-hans': require('./zh-hans'), + 'zh-tw': require('./zh-tw'), +}; diff --git a/packages/gitbook-plugin-theme-default/src/i18n/it.json b/packages/gitbook-plugin-theme-default/src/i18n/it.json new file mode 100644 index 0000000..3f5e95d --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/it.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Scegli una lingua", + "GLOSSARY": "Glossario", + "GLOSSARY_INDEX": "Indice", + "GLOSSARY_OPEN": "Glossario", + "GITBOOK_LINK": "Pubblicato con GitBook", + "SUMMARY": "Sommario", + "SUMMARY_INTRODUCTION": "Introduzione", + "SUMMARY_TOGGLE": "Sommario", + "SEARCH_TOGGLE": "Cerca", + "SEARCH_PLACEHOLDER": "Scrivi per cercare", + "FONTSETTINGS_TOGGLE": "Impostazioni dei caratteri", + "SHARE_TOGGLE": "Condividi", + "SHARE_ON": "Condividi su {{platform}}", + "FONTSETTINGS_WHITE": "Bianco", + "FONTSETTINGS_SEPIA": "Seppia", + "FONTSETTINGS_NIGHT": "Notte", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +}
\ No newline at end of file diff --git a/packages/gitbook-plugin-theme-default/src/i18n/ja.json b/packages/gitbook-plugin-theme-default/src/i18n/ja.json new file mode 100644 index 0000000..b1afd02 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/ja.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "言語を選択", + "GLOSSARY": "用語集", + "GLOSSARY_INDEX": "索引", + "GLOSSARY_OPEN": "用語集", + "GITBOOK_LINK": "GitBookで公開 ", + "SUMMARY": "目次", + "SUMMARY_INTRODUCTION": "はじめに", + "SUMMARY_TOGGLE": "目次", + "SEARCH_TOGGLE": "検索", + "SEARCH_PLACEHOLDER": "検索すると入力", + "FONTSETTINGS_TOGGLE": "フォント設定", + "SHARE_TOGGLE": "シェア", + "SHARE_ON": "{{platform}}でシェア", + "FONTSETTINGS_WHITE": "白", + "FONTSETTINGS_SEPIA": "セピア", + "FONTSETTINGS_NIGHT": "夜", + "FONTSETTINGS_SANS": "ゴシック体", + "FONTSETTINGS_SERIF": "明朝体" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/ko.json b/packages/gitbook-plugin-theme-default/src/i18n/ko.json new file mode 100644 index 0000000..5015a93 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/ko.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "언어를 선택하세요", + "GLOSSARY": "어휘", + "GLOSSARY_INDEX": "색인", + "GLOSSARY_OPEN": "어휘", + "GITBOOK_LINK": "GitBook에 게시", + "SUMMARY": "차례", + "SUMMARY_INTRODUCTION": "소개", + "SUMMARY_TOGGLE": "차례", + "SEARCH_TOGGLE": "검색", + "SEARCH_PLACEHOLDER": "검색어 입력", + "FONTSETTINGS_TOGGLE": "글꼴 설정", + "SHARE_TOGGLE": "공유", + "SHARE_ON": "{{platform}}에 공유", + "FONTSETTINGS_WHITE": "화이트", + "FONTSETTINGS_SEPIA": "세피아", + "FONTSETTINGS_NIGHT": "나이트", + "FONTSETTINGS_SANS": "고딕", + "FONTSETTINGS_SERIF": "명조" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/nl.json b/packages/gitbook-plugin-theme-default/src/i18n/nl.json new file mode 100644 index 0000000..da4f59e --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/nl.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Kies een taal", + "GLOSSARY": "Begrippenlijst", + "GLOSSARY_INDEX": "Index", + "GLOSSARY_OPEN": "Begrippenlijst", + "GITBOOK_LINK": "Gepubliceerd met GitBook", + "SUMMARY": "Inhoudsopgave", + "SUMMARY_INTRODUCTION": "Inleiding", + "SUMMARY_TOGGLE": "Inhoudsopgave", + "SEARCH_TOGGLE": "Zoeken", + "SEARCH_PLACEHOLDER": "Zoeken", + "FONTSETTINGS_TOGGLE": "Lettertype instellingen", + "SHARE_TOGGLE": "Delen", + "SHARE_ON": "Delen op {{platform}}", + "FONTSETTINGS_WHITE": "Wit", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Zwart", + "FONTSETTINGS_SANS": "Schreefloos", + "FONTSETTINGS_SERIF": "Schreef" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/no.json b/packages/gitbook-plugin-theme-default/src/i18n/no.json new file mode 100644 index 0000000..1ed6236 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/no.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Velg språk", + "GLOSSARY": "Register", + "GLOSSARY_INDEX": "Indeks", + "GLOSSARY_OPEN": "Register", + "GITBOOK_LINK": "Publisert med GitBook", + "SUMMARY": "Innholdsfortegnelse", + "SUMMARY_INTRODUCTION": "Innledning", + "SUMMARY_TOGGLE": "Innholdsfortegnelse", + "SEARCH_TOGGLE": "Søk", + "SEARCH_PLACEHOLDER": "Skriv inn søkeord", + "FONTSETTINGS_TOGGLE": "Tekstinnstillinger", + "SHARE_TOGGLE": "Del", + "SHARE_ON": "Del på {{platform}}", + "FONTSETTINGS_WHITE": "Lys", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Mørk", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/pl.json b/packages/gitbook-plugin-theme-default/src/i18n/pl.json new file mode 100644 index 0000000..4f009fc --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/pl.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Wybierz język", + "GLOSSARY": "Glosariusz", + "GLOSSARY_INDEX": "Indeks", + "GLOSSARY_OPEN": "Glosariusz", + "GITBOOK_LINK": "Opublikowano dzięki GitBook", + "SUMMARY": "Spis treści", + "SUMMARY_INTRODUCTION": "Wstęp", + "SUMMARY_TOGGLE": "Spis treści", + "SEARCH_TOGGLE": "Szukaj", + "SEARCH_PLACEHOLDER": "Wpisz szukaną frazę", + "FONTSETTINGS_TOGGLE": "Ustawienia czcionki", + "SHARE_TOGGLE": "Udostępnij", + "SHARE_ON": "Udostępnij na {{platform}}", + "FONTSETTINGS_WHITE": "Jasny", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Noc", + "FONTSETTINGS_SANS": "Bezszeryfowa", + "FONTSETTINGS_SERIF": "Szeryfowa" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/pt.json b/packages/gitbook-plugin-theme-default/src/i18n/pt.json new file mode 100644 index 0000000..9d6bde0 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/pt.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Escolher sua língua", + "GLOSSARY": "Glossário", + "GLOSSARY_INDEX": "Índice", + "GLOSSARY_OPEN": "Glossário", + "GITBOOK_LINK": "Publicado com GitBook", + "SUMMARY": "Tabela de conteúdos", + "SUMMARY_INTRODUCTION": "Introdução", + "SUMMARY_TOGGLE": "Tabela de conteúdos", + "SEARCH_TOGGLE": "Pesquise", + "SEARCH_PLACEHOLDER": "Escreva para pesquisar", + "FONTSETTINGS_TOGGLE": "Configurações de fonte", + "SHARE_TOGGLE": "Compartilhar", + "SHARE_ON": "Compartilhar no {{platform}}", + "FONTSETTINGS_WHITE": "Claro", + "FONTSETTINGS_SEPIA": "Sépia", + "FONTSETTINGS_NIGHT": "Noite", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/ro.json b/packages/gitbook-plugin-theme-default/src/i18n/ro.json new file mode 100644 index 0000000..24295a4 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/ro.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Alege o limba", + "GLOSSARY": "Glosar", + "GLOSSARY_INDEX": "Index", + "GLOSSARY_OPEN": "Glosar", + "GITBOOK_LINK": "Publicata cu GitBook", + "SUMMARY": "Cuprins", + "SUMMARY_INTRODUCTION": "Introducere", + "SUMMARY_TOGGLE": "Cuprins", + "SEARCH_TOGGLE": "Cauta", + "SEARCH_PLACEHOLDER": "Ce cauti", + "FONTSETTINGS_TOGGLE": "Setari de font", + "SHARE_TOGGLE": "Distribuie", + "SHARE_ON": "Distribuie pe {{platform}}", + "FONTSETTINGS_WHITE": "Alb", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Noapte", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/ru.json b/packages/gitbook-plugin-theme-default/src/i18n/ru.json new file mode 100644 index 0000000..9e6b9dd --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/ru.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Выберите язык", + "GLOSSARY": "Алфавитный указатель", + "GLOSSARY_INDEX": "Алфавитный указатель", + "GLOSSARY_OPEN": "Алфавитный указатель", + "GITBOOK_LINK": "Опубликовано с помощью GitBook", + "SUMMARY": "Содержание", + "SUMMARY_INTRODUCTION": "Введение", + "SUMMARY_TOGGLE": "Содержание", + "SEARCH_TOGGLE": "Поиск", + "SEARCH_PLACEHOLDER": "Введите условия поиска", + "FONTSETTINGS_TOGGLE": "Шрифт", + "SHARE_TOGGLE": "Поделиться", + "SHARE_ON": "Поделиться в {{platform}}", + "FONTSETTINGS_WHITE": "Светлый", + "FONTSETTINGS_SEPIA": "Сепия", + "FONTSETTINGS_NIGHT": "Тёмный", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +}
\ No newline at end of file diff --git a/packages/gitbook-plugin-theme-default/src/i18n/sv.json b/packages/gitbook-plugin-theme-default/src/i18n/sv.json new file mode 100644 index 0000000..2e2f6ac --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/sv.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Välj språk", + "GLOSSARY": "Gloslista", + "GLOSSARY_INDEX": "Index", + "GLOSSARY_OPEN": "Gloslista", + "GITBOOK_LINK": "Publicera med GitBook", + "SUMMARY": "Innehållsförteckning", + "SUMMARY_INTRODUCTION": "Inledning", + "SUMMARY_TOGGLE": "Innehållsförteckning", + "SEARCH_TOGGLE": "Sök", + "SEARCH_PLACEHOLDER": "Skriv sökord", + "FONTSETTINGS_TOGGLE": "Textinställningar", + "SHARE_TOGGLE": "Dela", + "SHARE_ON": "Dela på {{platform}}", + "FONTSETTINGS_WHITE": "Ljus", + "FONTSETTINGS_SEPIA": "Sepia", + "FONTSETTINGS_NIGHT": "Mörk", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/tr.json b/packages/gitbook-plugin-theme-default/src/i18n/tr.json new file mode 100644 index 0000000..d92d5a2 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/tr.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Dil seçimi", + "GLOSSARY": "Sözlük", + "GLOSSARY_INDEX": "Dizin", + "GLOSSARY_OPEN": "Sözlük", + "GITBOOK_LINK": "GitBook ile yayınla", + "SUMMARY": "İçindekiler", + "SUMMARY_INTRODUCTION": "Giriş", + "SUMMARY_TOGGLE": "İçindekiler", + "SEARCH_TOGGLE": "Arama", + "SEARCH_PLACEHOLDER": "Aramak istediğiniz", + "FONTSETTINGS_TOGGLE": "Font Ayarları", + "SHARE_TOGGLE": "Paylaş", + "SHARE_ON": "{{platform}} ile paylaş", + "FONTSETTINGS_WHITE": "Beyaz", + "FONTSETTINGS_SEPIA": "Sepya", + "FONTSETTINGS_NIGHT": "Karanlık", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/uk.json b/packages/gitbook-plugin-theme-default/src/i18n/uk.json new file mode 100644 index 0000000..a582d6c --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/uk.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Виберіть мову", + "GLOSSARY": "Алфавітний покажчик", + "GLOSSARY_INDEX": "Алфавітний покажчик", + "GLOSSARY_OPEN": "Алфавітний покажчик", + "GITBOOK_LINK": "Опубліковано за допомогою GitBook", + "SUMMARY": "Зміст", + "SUMMARY_INTRODUCTION": "Вступ", + "SUMMARY_TOGGLE": "Зміст", + "SEARCH_TOGGLE": "Пошук", + "SEARCH_PLACEHOLDER": "Введіть для пошуку", + "FONTSETTINGS_TOGGLE": "Шрифт", + "SHARE_TOGGLE": "Поділитися", + "SHARE_ON": "Поділитися в {{platform}}", + "FONTSETTINGS_WHITE": "Світлий", + "FONTSETTINGS_SEPIA": "Сепія", + "FONTSETTINGS_NIGHT": "Темний", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +}
\ No newline at end of file diff --git a/packages/gitbook-plugin-theme-default/src/i18n/vi.json b/packages/gitbook-plugin-theme-default/src/i18n/vi.json new file mode 100644 index 0000000..0addb8e --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/vi.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "Lựa chọn ngôn ngữ", + "GLOSSARY": "Chú giải", + "GLOSSARY_INDEX": "Chỉ mục", + "GLOSSARY_OPEN": "Chú giải", + "GITBOOK_LINK": "Xuất bản với GitBook", + "SUMMARY": "Mục Lục", + "SUMMARY_INTRODUCTION": "Giới thiệu", + "SUMMARY_TOGGLE": "Mục Lục", + "SEARCH_TOGGLE": "Tìm kiếm", + "SEARCH_PLACEHOLDER": "Nhập thông tin cần tìm", + "FONTSETTINGS_TOGGLE": "Tùy chỉnh phông chữ", + "SHARE_TOGGLE": "Chia sẻ", + "SHARE_ON": "Chia sẻ trên {{platform}}", + "FONTSETTINGS_WHITE": "Sáng", + "FONTSETTINGS_SEPIA": "Vàng nâu", + "FONTSETTINGS_NIGHT": "Tối", + "FONTSETTINGS_SANS": "Sans", + "FONTSETTINGS_SERIF": "Serif" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/zh-hans.json b/packages/gitbook-plugin-theme-default/src/i18n/zh-hans.json new file mode 100644 index 0000000..8aa372c --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/zh-hans.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "选择一种语言", + "GLOSSARY": "术语表", + "GLOSSARY_INDEX": "索引", + "GLOSSARY_OPEN": "术语表", + "GITBOOK_LINK": "本书使用 GitBook 发布", + "SUMMARY": "目录", + "SUMMARY_INTRODUCTION": "介绍", + "SUMMARY_TOGGLE": "目录", + "SEARCH_TOGGLE": "搜索", + "SEARCH_PLACEHOLDER": "输入并搜索", + "FONTSETTINGS_TOGGLE": "字体设置", + "SHARE_TOGGLE": "分享", + "SHARE_ON": "分享到 {{platform}}", + "FONTSETTINGS_WHITE": "白色", + "FONTSETTINGS_SEPIA": "棕褐色", + "FONTSETTINGS_NIGHT": "夜间", + "FONTSETTINGS_SANS": "无衬线体", + "FONTSETTINGS_SERIF": "衬线体" +} diff --git a/packages/gitbook-plugin-theme-default/src/i18n/zh-tw.json b/packages/gitbook-plugin-theme-default/src/i18n/zh-tw.json new file mode 100644 index 0000000..d5ff1ad --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/i18n/zh-tw.json @@ -0,0 +1,20 @@ +{ + "LANGS_CHOOSE": "選擇一種語言", + "GLOSSARY": "術語表", + "GLOSSARY_INDEX": "索引", + "GLOSSARY_OPEN": "術語表", + "GITBOOK_LINK": "本書使用 GitBook 釋出", + "SUMMARY": "目錄", + "SUMMARY_INTRODUCTION": "介紹", + "SUMMARY_TOGGLE": "目錄", + "SEARCH_TOGGLE": "搜尋", + "SEARCH_PLACEHOLDER": "輸入並搜尋", + "FONTSETTINGS_TOGGLE": "字型設定", + "SHARE_TOGGLE": "分享", + "SHARE_ON": "分享到 {{platform}}", + "FONTSETTINGS_WHITE": "白色", + "FONTSETTINGS_SEPIA": "棕褐色", + "FONTSETTINGS_NIGHT": "夜間", + "FONTSETTINGS_SANS": "無襯線體", + "FONTSETTINGS_SERIF": "襯線體" +} diff --git a/packages/gitbook-plugin-theme-default/src/index.js b/packages/gitbook-plugin-theme-default/src/index.js new file mode 100644 index 0000000..ad96175 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/index.js @@ -0,0 +1,14 @@ +const GitBook = require('gitbook-core'); + +const Theme = require('./components/Theme'); +const reduceState = require('./reducers'); +const locales = require('./i18n'); + + +module.exports = GitBook.createPlugin({ + activate: (dispatch, state, { Components, I18n }) => { + dispatch(Components.registerComponent(Theme, { role: 'website:body' })); + dispatch(I18n.registerLocales(locales)); + }, + reduce: reduceState +}); diff --git a/packages/gitbook-plugin-theme-default/src/reducers/index.js b/packages/gitbook-plugin-theme-default/src/reducers/index.js new file mode 100644 index 0000000..ac53d3a --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/reducers/index.js @@ -0,0 +1,5 @@ +const GitBook = require('gitbook-core'); + +module.exports = GitBook.composeReducer( + GitBook.createReducer('sidebar', require('./sidebar')) +); diff --git a/packages/gitbook-plugin-theme-default/src/reducers/sidebar.js b/packages/gitbook-plugin-theme-default/src/reducers/sidebar.js new file mode 100644 index 0000000..eef68d4 --- /dev/null +++ b/packages/gitbook-plugin-theme-default/src/reducers/sidebar.js @@ -0,0 +1,18 @@ +const GitBook = require('gitbook-core'); +const { Record } = GitBook.Immutable; +const ActionTypes = require('../actions/types'); + +const SidebarState = Record({ + open: true +}); + +function reduceSidebar(state = SidebarState(), action) { + switch (action.type) { + case ActionTypes.TOGGLE_SIDEBAR: + return state.set('open', !state.get('open')); + default: + return state; + } +} + +module.exports = reduceSidebar; |