From b1725280c2c3280a629d68a7bf45207babff7361 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Fri, 26 Feb 2016 22:05:59 +0800 Subject: [PATCH] Add gitbook --- gitbook | 1 - gitbook/.editorconfig | 10 + gitbook/.eslintignore | 2 + gitbook/.eslintrc | 19 + gitbook/.gitbook | 1 + gitbook/.travis.yml | 10 + gitbook/AUTHORS.md | 67 ++ gitbook/CHANGES.md | 336 +++++++++ gitbook/LICENSE | 201 ++++++ gitbook/README.md | 51 ++ gitbook/app.js | 6 + gitbook/appveyor.yml | 29 + gitbook/bin/gitbook.js | 8 + gitbook/docs/README.md | 22 + gitbook/docs/_layouts/website/page.html | 23 + gitbook/docs/asciidoc.md | 60 ++ gitbook/docs/book.js | 11 + gitbook/docs/config.md | 37 + gitbook/docs/conrefs.md | 55 ++ gitbook/docs/examples.md | 27 + gitbook/docs/faq.md | 33 + gitbook/docs/languages.md | 15 + gitbook/docs/lexicon.md | 13 + gitbook/docs/pages.md | 50 ++ gitbook/docs/plugins.md | 26 + gitbook/docs/setup.md | 45 ++ gitbook/docs/structure.md | 62 ++ gitbook/docs/templating.md | 90 +++ gitbook/docs/themes.md | 26 + gitbook/docs/variables.md | 64 ++ gitbook/fonts/fontawesome/FontAwesome.otf | Bin 0 -> 109688 bytes .../fonts/fontawesome/fontawesome-webfont.eot | Bin 0 -> 70807 bytes .../fonts/fontawesome/fontawesome-webfont.svg | 655 ++++++++++++++++++ .../fonts/fontawesome/fontawesome-webfont.ttf | Bin 0 -> 142072 bytes .../fontawesome/fontawesome-webfont.woff | Bin 0 -> 83588 bytes .../fontawesome/fontawesome-webfont.woff2 | Bin 0 -> 66624 bytes gitbook/gitbook-plugin-edit-link/plugin.js | 30 + .../gitbook-plugin-fontsettings/buttons.js | 151 ++++ .../gitbook-plugin-fontsettings/website.css | 291 ++++++++ gitbook/gitbook-plugin-github/plugin.js | 14 + gitbook/gitbook-plugin-livereload/plugin.js | 11 + gitbook/gitbook-plugin-prism/prism-coy.css | 231 ++++++ gitbook/gitbook-plugin-prism/prism-dark.css | 126 ++++ gitbook/gitbook-plugin-prism/prism-funky.css | 115 +++ .../gitbook-plugin-prism/prism-okaidia.css | 119 ++++ .../gitbook-plugin-prism/prism-tomorrow.css | 119 ++++ .../gitbook-plugin-prism/prism-twilight.css | 199 ++++++ gitbook/gitbook-plugin-prism/prism.css | 135 ++++ gitbook/gitbook-plugin-search/lunr.min.js | 7 + gitbook/gitbook-plugin-search/search.css | 27 + gitbook/gitbook-plugin-search/search.js | 135 ++++ gitbook/gitbook-plugin-sharing/buttons.js | 93 +++ .../apple-touch-icon-precomposed-152.png | Bin 0 -> 4817 bytes gitbook/images/favicon.ico | Bin 0 -> 4286 bytes gitbook/lib/backbone/file.js | 69 ++ gitbook/lib/backbone/glossary.js | 99 +++ gitbook/lib/backbone/index.js | 8 + gitbook/lib/backbone/langs.js | 81 +++ gitbook/lib/backbone/readme.js | 26 + gitbook/lib/backbone/summary.js | 339 +++++++++ gitbook/lib/book.js | 358 ++++++++++ gitbook/lib/cli/helper.js | 139 ++++ gitbook/lib/cli/index.js | 187 +++++ gitbook/lib/cli/server.js | 95 +++ gitbook/lib/cli/watch.js | 42 ++ gitbook/lib/config/index.js | 132 ++++ gitbook/lib/config/plugins.js | 67 ++ gitbook/lib/config/schema.js | 188 +++++ gitbook/lib/config/validator.js | 28 + gitbook/lib/fs/index.js | 106 +++ gitbook/lib/fs/node.js | 66 ++ gitbook/lib/gitbook.js | 33 + gitbook/lib/index.js | 7 + gitbook/lib/output/assets-inliner.js | 140 ++++ gitbook/lib/output/base.js | 274 ++++++++ gitbook/lib/output/conrefs.js | 67 ++ gitbook/lib/output/ebook.js | 190 +++++ gitbook/lib/output/folder.js | 152 ++++ gitbook/lib/output/json.js | 47 ++ gitbook/lib/output/website.js | 270 ++++++++ gitbook/lib/page/html.js | 280 ++++++++ gitbook/lib/page/index.js | 250 +++++++ gitbook/lib/parsers.js | 60 ++ gitbook/lib/plugins/compatibility.js | 57 ++ gitbook/lib/plugins/index.js | 155 +++++ gitbook/lib/plugins/plugin.js | 300 ++++++++ gitbook/lib/plugins/registry.js | 115 +++ gitbook/lib/template/blocks.js | 16 + gitbook/lib/template/filters.js | 15 + gitbook/lib/template/index.js | 431 ++++++++++++ gitbook/lib/template/loader.js | 42 ++ gitbook/lib/utils/command.js | 80 +++ gitbook/lib/utils/error.js | 105 +++ gitbook/lib/utils/fs.js | 118 ++++ gitbook/lib/utils/git.js | 129 ++++ gitbook/lib/utils/images.js | 44 ++ gitbook/lib/utils/location.js | 70 ++ gitbook/lib/utils/logger.js | 128 ++++ gitbook/lib/utils/path.js | 58 ++ gitbook/lib/utils/promise.js | 62 ++ gitbook/package.json | 93 +++ gitbook/preview.png | Bin 0 -> 232224 bytes gitbook/style.css | 9 + gitbook/test/all.js | 27 + gitbook/test/assertions.js | 62 ++ gitbook/test/assets-inliner.js | 86 +++ gitbook/test/config.js | 137 ++++ gitbook/test/conrefs.js | 49 ++ gitbook/test/git.js | 61 ++ gitbook/test/glossary.js | 71 ++ gitbook/test/langs.js | 46 ++ gitbook/test/locate.js | 28 + gitbook/test/location.js | 55 ++ gitbook/test/mock.js | 116 ++++ gitbook/test/output-ebook.js | 33 + gitbook/test/output-json.js | 49 ++ gitbook/test/output-website.js | 99 +++ gitbook/test/page.js | 399 +++++++++++ gitbook/test/parse.js | 59 ++ gitbook/test/paths.js | 17 + gitbook/test/plugins.js | 195 ++++++ gitbook/test/readme.js | 43 ++ gitbook/test/summary.js | 300 ++++++++ gitbook/test/template.js | 54 ++ 124 files changed, 11670 insertions(+), 1 deletion(-) delete mode 160000 gitbook create mode 100644 gitbook/.editorconfig create mode 100644 gitbook/.eslintignore create mode 100644 gitbook/.eslintrc create mode 100644 gitbook/.gitbook create mode 100644 gitbook/.travis.yml create mode 100644 gitbook/AUTHORS.md create mode 100644 gitbook/CHANGES.md create mode 100644 gitbook/LICENSE create mode 100644 gitbook/README.md create mode 100644 gitbook/app.js create mode 100644 gitbook/appveyor.yml create mode 100644 gitbook/bin/gitbook.js create mode 100644 gitbook/docs/README.md create mode 100644 gitbook/docs/_layouts/website/page.html create mode 100644 gitbook/docs/asciidoc.md create mode 100644 gitbook/docs/book.js create mode 100644 gitbook/docs/config.md create mode 100644 gitbook/docs/conrefs.md create mode 100644 gitbook/docs/examples.md create mode 100644 gitbook/docs/faq.md create mode 100644 gitbook/docs/languages.md create mode 100644 gitbook/docs/lexicon.md create mode 100644 gitbook/docs/pages.md create mode 100644 gitbook/docs/plugins.md create mode 100644 gitbook/docs/setup.md create mode 100644 gitbook/docs/structure.md create mode 100644 gitbook/docs/templating.md create mode 100644 gitbook/docs/themes.md create mode 100644 gitbook/docs/variables.md create mode 100644 gitbook/fonts/fontawesome/FontAwesome.otf create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.eot create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.svg create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.ttf create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.woff create mode 100644 gitbook/fonts/fontawesome/fontawesome-webfont.woff2 create mode 100644 gitbook/gitbook-plugin-edit-link/plugin.js create mode 100644 gitbook/gitbook-plugin-fontsettings/buttons.js create mode 100644 gitbook/gitbook-plugin-fontsettings/website.css create mode 100644 gitbook/gitbook-plugin-github/plugin.js create mode 100644 gitbook/gitbook-plugin-livereload/plugin.js create mode 100644 gitbook/gitbook-plugin-prism/prism-coy.css create mode 100644 gitbook/gitbook-plugin-prism/prism-dark.css create mode 100644 gitbook/gitbook-plugin-prism/prism-funky.css create mode 100644 gitbook/gitbook-plugin-prism/prism-okaidia.css create mode 100644 gitbook/gitbook-plugin-prism/prism-tomorrow.css create mode 100644 gitbook/gitbook-plugin-prism/prism-twilight.css create mode 100644 gitbook/gitbook-plugin-prism/prism.css create mode 100644 gitbook/gitbook-plugin-search/lunr.min.js create mode 100644 gitbook/gitbook-plugin-search/search.css create mode 100644 gitbook/gitbook-plugin-search/search.js create mode 100644 gitbook/gitbook-plugin-sharing/buttons.js create mode 100644 gitbook/images/apple-touch-icon-precomposed-152.png create mode 100644 gitbook/images/favicon.ico create mode 100644 gitbook/lib/backbone/file.js create mode 100644 gitbook/lib/backbone/glossary.js create mode 100644 gitbook/lib/backbone/index.js create mode 100644 gitbook/lib/backbone/langs.js create mode 100644 gitbook/lib/backbone/readme.js create mode 100644 gitbook/lib/backbone/summary.js create mode 100644 gitbook/lib/book.js create mode 100644 gitbook/lib/cli/helper.js create mode 100644 gitbook/lib/cli/index.js create mode 100644 gitbook/lib/cli/server.js create mode 100644 gitbook/lib/cli/watch.js create mode 100644 gitbook/lib/config/index.js create mode 100644 gitbook/lib/config/plugins.js create mode 100644 gitbook/lib/config/schema.js create mode 100644 gitbook/lib/config/validator.js create mode 100644 gitbook/lib/fs/index.js create mode 100644 gitbook/lib/fs/node.js create mode 100644 gitbook/lib/gitbook.js create mode 100644 gitbook/lib/index.js create mode 100644 gitbook/lib/output/assets-inliner.js create mode 100644 gitbook/lib/output/base.js create mode 100644 gitbook/lib/output/conrefs.js create mode 100644 gitbook/lib/output/ebook.js create mode 100644 gitbook/lib/output/folder.js create mode 100644 gitbook/lib/output/json.js create mode 100644 gitbook/lib/output/website.js create mode 100644 gitbook/lib/page/html.js create mode 100644 gitbook/lib/page/index.js create mode 100644 gitbook/lib/parsers.js create mode 100644 gitbook/lib/plugins/compatibility.js create mode 100644 gitbook/lib/plugins/index.js create mode 100644 gitbook/lib/plugins/plugin.js create mode 100644 gitbook/lib/plugins/registry.js create mode 100644 gitbook/lib/template/blocks.js create mode 100644 gitbook/lib/template/filters.js create mode 100644 gitbook/lib/template/index.js create mode 100644 gitbook/lib/template/loader.js create mode 100644 gitbook/lib/utils/command.js create mode 100644 gitbook/lib/utils/error.js create mode 100644 gitbook/lib/utils/fs.js create mode 100644 gitbook/lib/utils/git.js create mode 100644 gitbook/lib/utils/images.js create mode 100644 gitbook/lib/utils/location.js create mode 100644 gitbook/lib/utils/logger.js create mode 100644 gitbook/lib/utils/path.js create mode 100644 gitbook/lib/utils/promise.js create mode 100644 gitbook/package.json create mode 100644 gitbook/preview.png create mode 100644 gitbook/style.css create mode 100644 gitbook/test/all.js create mode 100644 gitbook/test/assertions.js create mode 100644 gitbook/test/assets-inliner.js create mode 100644 gitbook/test/config.js create mode 100644 gitbook/test/conrefs.js create mode 100644 gitbook/test/git.js create mode 100644 gitbook/test/glossary.js create mode 100644 gitbook/test/langs.js create mode 100644 gitbook/test/locate.js create mode 100644 gitbook/test/location.js create mode 100644 gitbook/test/mock.js create mode 100644 gitbook/test/output-ebook.js create mode 100644 gitbook/test/output-json.js create mode 100644 gitbook/test/output-website.js create mode 100644 gitbook/test/page.js create mode 100644 gitbook/test/parse.js create mode 100644 gitbook/test/paths.js create mode 100644 gitbook/test/plugins.js create mode 100644 gitbook/test/readme.js create mode 100644 gitbook/test/summary.js create mode 100644 gitbook/test/template.js diff --git a/gitbook b/gitbook deleted file mode 160000 index 294951f2..00000000 --- a/gitbook +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 294951f22af41edbbe758fdcd0903195a332b524 diff --git a/gitbook/.editorconfig b/gitbook/.editorconfig new file mode 100644 index 00000000..8f960391 --- /dev/null +++ b/gitbook/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/gitbook/.eslintignore b/gitbook/.eslintignore new file mode 100644 index 00000000..c6e8e215 --- /dev/null +++ b/gitbook/.eslintignore @@ -0,0 +1,2 @@ +docs/**/* +test/node_modules/**/* diff --git a/gitbook/.eslintrc b/gitbook/.eslintrc new file mode 100644 index 00000000..35b58c76 --- /dev/null +++ b/gitbook/.eslintrc @@ -0,0 +1,19 @@ +{ + "rules": { + "indent": [ 2, 4 ], + "quotes": [ 2, "single" ], + "linebreak-style": [ 2, "unix" ], + "semi": [ 2, "always" ], + "no-unused-vars": [ 2, { + "vars": "all", + "args": "none" + } ], + "spaced-comment": [ 2, "always" ] + }, + "env": { + "node": true, + "mocha": true, + "browser": true + }, + "extends": "eslint:recommended" +} \ No newline at end of file diff --git a/gitbook/.gitbook b/gitbook/.gitbook new file mode 100644 index 00000000..ffcee857 --- /dev/null +++ b/gitbook/.gitbook @@ -0,0 +1 @@ +./docs \ No newline at end of file diff --git a/gitbook/.travis.yml b/gitbook/.travis.yml new file mode 100644 index 00000000..8de84e72 --- /dev/null +++ b/gitbook/.travis.yml @@ -0,0 +1,10 @@ +sudo: false +language: node_js +node_js: + - "stable" + - "4.1" + - "0.12" +before_install: + - npm install svgexport -g +after_success: + - npm run lint diff --git a/gitbook/AUTHORS.md b/gitbook/AUTHORS.md new file mode 100644 index 00000000..63a8f58e --- /dev/null +++ b/gitbook/AUTHORS.md @@ -0,0 +1,67 @@ +Authors +======= + +Also see https://github.com/GitbookIO/gitbook/graphs/contributors. +Names below are ordered by first contribution. + +Author +------ + +- Samy Pessé (@SamyPesse) +- Aaron O'Mullan (@AaronO) + + +Contributors +------------ + +- Nijiko Yonskai (@Nijikokun) +- Herman Starikov (@Hermanya) + +Translators +------------ + +- German + - Winnie (@winniehell) +- Italian + - Giulio Bonanome (@gbonanome) +- Russian + - Andrey Akinshin (@AndreyAkinshin) +- Norwegian + - Knut Melvær (@kmelve) +- Persian (Farsi) + - Mohammad Hossein Mojtahedi (@mhm5000) +- Polish + - Łukasz Szeremeta (@lszeremeta) +- Portuguese + - Ryan O'Mullan (@RyanOM) +- Spanish + - Ryan O'Mullan (@RyanOM) +- Simplifiled Chinese + - Hu Hao (@howiehu) +- Traditional Chinese + - Hu Hao (@howiehu) +- French + - Samy Pessé (@SamyPesse) +- Romanian + - Iancu Aurel (@awrelll) +- Finnish + - Tommi Savikko (@savikko) +- Japanese + - Iancu Aurel (@awrelll) +- Korean + - Iancu Aurel (@awrelll) + - SangYeob Yu (@deminoth) +- Vietnamese + - Hong Nguyen (@nghong) +- Hebrew + - @a-moses +- Ukrainian + - @Karnaukhov +- Czech + - @mjanda +- Swedish + - Jacob Burenstam (@buren) +- Turkish + - Turan Konan (@turankonan) +- Catalan + - Esaú García Sánchez-Torija (@egasato) diff --git a/gitbook/CHANGES.md b/gitbook/CHANGES.md new file mode 100644 index 00000000..169f2749 --- /dev/null +++ b/gitbook/CHANGES.md @@ -0,0 +1,336 @@ +# Release notes +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## 3.0.0 (pre) +- Summary can contain external links and anchors (Fix [#776](https://github.com/GitbookIO/gitbook/issues/776)) +- Summary can contain differents entitled sections +- Glossary is generated as a normal page +- Headings are no longer annotated with glossary terms +- Themes are now published as a plugin, with ability to extend it from the book source +- `links.sidebar` configuration is no longer supported, use summary sections instead +- `pdf.headerTemplate` and `pdf.footerTemplate` have been replaced by a template in theme/book: `_layout/ebook/pdf_header.html` and `_layout/ebook/pdf_footer.html` +- Markdown parser is now using CommonMark +- Root folder for the book can be specified in a `.gitbook` file +- Multi-lingual books share assets folder +- YAML front matter is parsed and page's description can be specified in it +- Fix `uk` translation + +## 2.6.7 +- Fix bug with filenames including spaces +- Add Turkish and Catalan translations + +## 2.6.6 +- Fix custom CSS that are generated by plugins for PDF output + +## 2.6.5 +- Fix support for plugins generating custom stylesheets (`styles-less` and `styles-sass`) +- Fix glossary terms being replaced in script (ex: math) + +## 2.6.4 +- Fix regression introduced by `2.6.3` of single HTML tags in markdown + +## 2.6.3 +- Fix parsing bug with inline HTML in Markdown + +## 2.6.2 +- Fix `gitbook.state.bookRoot`, `gitbook.state.root` now has a trailing slash +- Update nunjucks to 2.2.0 + +## 2.6.1 +- Use CamelCase for `gitbook.state.innerLanguage` + +## 2.6.0 +- Close sidebar after clicking a link on mobile +- Add root for multilingual books: `gitbook.state.bookRoot` +- Fix color of h6 headings +- Fix bottom margin of lists and blockquotes +- Add Swedish translation (`sv`) +- Add Czech translation (`cs`) +- Fix locale names for `zh-hans` and `jp` +- Update plugin `search` to fix crashes +- Aceept case-incensitive structure files (README, GLOSSARY, etc) + +## 2.5.2 +- Fix custom stylesheets for ebook generation +- Trigger event `start` before `page.change` + +## 2.5.1 +- Fix calcul of `gitbook.state.root` when serving HTML index as `/` + +## 2.5.0 +- Font settings, sharing and search are externalized as default plugins +- Plugins can define a configuration schema in the manifest, this schema will be used to validate configuration during build +- New Node.js API for plugin: `book.formatString(type, content)` +- New client side API for website plugins: `gitbook.toolbar.createButton(opts)` +- Better header/footer for PDF, CSS wil be inlined to easily style the header/footer +- Cleaner table of contents for ebooks +- Support for RTL in ebook's table of contents +- Better colors for mobi (links and code blocks) +- Fix installation of plugins when using a pre-release +- Fix support for pre-releases +- Update asciidoc parser to remove git dependency +- Fix templating in imported content +- Fix querystring in image urls +- Normalize heading IDs like GitHub +- Use Arial as default font for PDFs +- Add `root`, `chapterTitle` and `filepath` to `gitbook.state` JS API + +## 2.4.3 +- Add ukrainian translation (`uk`) +- Add `book.json` configuration for maximum size of search index +- Improve reliability of summary parser + +## 2.4.2 +- Default plugins should not be installed by `gitbook install` +- Limit search index size to avoid crash during generation +- Fix code highlighting for html without language specified +- Fix warning message for gitbook version when building a multilingual book + +## 2.4.1 +- Fix disabling of default plugins, ex: `-highlight` + +## 2.4.0 +- Fix page being updated when user wants to open a link in a new tab +- Plugins can now replaced default code highlighter +- Add semantic information for screen readers (web version) +- Content references accept absolute paths, resolved to book folder +- Improve overall reliability + +## 2.3.3 +- Fix bug in SUMMARY parsing preventing multiple entries without filenames + +## 2.3.2 +- Fix blocks (like maths) in Asciidoc +- Fix error when checking gitbook version + +## 2.3.1 +- Fix black font color for ebooks (mobi, pdf and epub) +- Fix ISO code for korean language +- Fix korean translation +- Fix syntax highlighting for asciidoc +- Fix inline html escaping in markdown +- Add warning for file outside SUMMARY +- Force SUMMARY entries to be unique by filename + +## 2.3.0 +- Fix nunjucks issue with multiple `{% raw %}` blocks +- Fix crash when git conref failed +- Fix crash when failed to download remote image (better error message) +- Fix flicking effect when changing page (big UX improvement) +- Add Hebrew translation (`he`) +- Add utility method `book.config.get` for plugins +- Hooks `page:before` and `page` are no longer deprecated +- Remove webfonts to make website lighter +- Make glossary's order case insensitive + +## 2.2.0 +- Fix direction in code blocks (always LTR) +- Add options `chapterMark` and `pageBreaksBefore` for PDF +- Update code highlighting library +- `book.json` accessible as `config` in templating syntax +- Add Vietnamese translation (`vi`) + +## 2.1.0 +- Fix error in calcul of `levels` in table of contents, error introduced a few versions ago +- Add optional `styles/print.css` to replace `print.css` used in ebook + +## 2.0.4 +- Fix `{% raw %}`, got confused with "fake" variable declarations +- Fix title of language chooser +- Fix the X-UA-Compatible meta tag +- Move style sheets to the section + +## 2.0.3 +- Fix `gitbook init` for SUMMARY with empty entries +- Fix escaping of code blocks in markdown + +## 2.0.2 +- Fix relative links in windows +- Improve watcher in serve command (switch to chokidar) +- Add Romanian translation (`ro`) +- Add Finish translation (`fi`) +- Add Japanese translation (`jp`) +- Add Korean translation (`kr`) + +## 2.0.1 +- Improve error logging (display file, line and column) +- Add back support for `options.originalInput` +- Don't process math in markdown parser (delegated to `mathjax` plugin) +- Fix some cases of code blocks escaping +- Fix i18n for introduction title in json format +- Fix reload when book configuration is updated +- Fix backslashes in url when building on windows + +## 2.0.0 +- Fix page title of introduction +- Ignore codeblocks when replacing glossary terms +- Improve Unit Tests +- Fix scrolling position in website when preparing page + +## 2.0.0-beta.5 +- Fix progress order in json format + +## 2.0.0-beta.4 +- Fix default generator for use programmatically +- Add option "author" for html meta tags +- Fix links normalization (content and hash) + +## 2.0.0-beta.3 +- Fix odd cases with code blocks escaping + +## 2.0.0-beta.2 +- Fix definition of entry point title using SUMMARY.md + +## 2.0.0-beta.1 +- Fix windows incompatibility +- Add support for rtl (enabled by default for `ar` and `fa`) +- Escape code blocks in markdown parser +- Add Persian/Farsi translation (`fa`) +- Add Arabic translation (`ar`) +- Add Bengali translation (`bn`) +- Provide generator name in template context + +## 2.0.0-alpha.9 +- Fix links in sidebar +- Fix normalization of html link (README to index) +- Fix html snippets escaping + +## 2.0.0-alpha.8 +- Improve locale detection for i18n +- Fix chapter name for Glossary in pdf +- Don't escape html in glossary items +- Fix generation of multilingual book as ebook +- Add "post" block attribute to post-process + +## 2.0.0-alpha.7 +- Fix display of glossary in ebook formats +- Add default footer and header to pdf +- Fix generation of json format compatible with 1.x.x +- Add Simplifiled Chinese and Traditional Chinese translations + +## 2.0.0-alpha.6 +- Add es and pt translations +- Fix replacement of glossary terms + +## 2.0.0-alpha.5 +- Fix copy of files/covers +- Add back `finish:before` hook + +## 2.0.0-alpha.4 +- Fix copy of cover for multilingal books + +## 2.0.0-alpha.3 +- Norwegian translation +- Load plugins from book in priority + +## 2.0.0-alpha.3 +- Fix init command +- Update parsers to fix spaces in summary (`gitbook-parsers@0.3.1`) + +## 2.0.0-alpha.1 +- Externalize parsing into `gitbook-parsers` module +- Supports AsciiDoc and reStructuredText +- Hooks for page (`page:*`) are now deprecated, plugins should extend filters and blocks instead +- Hooks `summary` and `glossary` (after and before) have been removed +- Exercises and Quizzes are no longer parsed in the markdown parser +- Support for more markdown extensions: `.markdown`, `.mdown` +- Templates are rendered with nunjucks instead of swig, syntax is almost compatible, there is some changes with contexts and filters. `{{ super() }}` should be use instead of `{% parent %}` +- Clean output folder on build without removing `.git` and `.svn` +- MathJAX is no longer a default plugin +- SVG images are converted to PNG during generation of ebooks +- i18n in website and ebook (ru, it, de, fr) +- New templating syntax +- Content references (both internal and external) +- Glossary terms are handled during generation (also in ebook format) + +## 1.5.0 +- Fix `serve` command, broken by `1.4.2` +- Add nicer `dark` theme :) + +## 1.4.2 +- Force `process.exit` after builds, to prevent (possibly) lingering plugins + +## 1.4.1 +- Fix command 'install' without arguments + +## 1.4.0 +- Add command `gitbook install` to install plugins from book.json +- `package.json` is no longer necessary + +## 1.3.4 +- Add glossary to ebooks +- Fix autocover with new hook "finish:before" +- Add X-UA-Compatible meta tag for IE + +## 1.3.3 +- Fix parsing of lexed content using the client library + +## 1.3.2 +- ePub files are now passing validation from epubcheck +- Fix replacement of multiple glossary terms in a single sentence +- Fix on windows deep relative links +- Fix search indexer + +## 1.3.1 +- Fix error with links in markdown + +## 1.3.0 +- Bundle gitbook parsing library as a client side library in `gitbook.js` and `gitbook.min.js` + +## 1.2.0 +- Improvements on ebook generation +- Fix incorrect follow of links in ebook generation +- Move Table of Contents at the beginning of the ebook +- Update to last highlight.js (includes Swift) +- Includes of templates and variables (from book.json) + +## 1.1.1 +- Rewrite quiz logic to be more robust +- Improve integration of glossary +- Improve generation of ebook by using a multiple HTML pages input source +- Fix incorrect page breaks after h1 and h2 divs +- New options to set header and footer in PDF generation + +## 1.1.0 +- Plugins can now extend the ebook generation (pdf, epub, mobi) +- Update `kramed` to version 0.4.3 + +## 1.0.3 +- Update `mathjax` plugin and MathJAx to version 2.4 +- Update `highlight.js` to 8.2.0 + +## 1.0.2 +- Update `mathjax` plugin, fixes issues with inline math rendering (no longer wanted) + +## 1.0.1 +- New inline math convention (kramdown's), using `$$` rather than `$` as delimiters +- Fix instapaper sharing +- The `exercises` & `quizzes` plugins are now by default + +## 1.0.0 +- New design +- Support for glossary +- Support for sharing to instapaper +- Support for footnotes + +## 0.7.1 +- Update `fs-extra` to `0.10.0` (fixes potential race conditions) + +## 0.7.0 +- Add page break in ebook (pdf, epub, mobi) between chapters/articles +- Start using kramed instead of marked +- Fix display of inline math +- Switch to graceful-fs to fix EMFILE errors +- Add sharing to weibo.com + +## 0.6.2 +- Support generating a plugin's book info dynamically +- Improve navigation on dark theme +- Improve path normalization when parsing SUMMARY.md + +## 0.6.0 +- Generate header id the same as github +- Custom links can be added at top of sidebar +- Summary can now be transformed by plugins +- Support importing code snippets diff --git a/gitbook/LICENSE b/gitbook/LICENSE new file mode 100644 index 00000000..3e53c4e1 --- /dev/null +++ b/gitbook/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 FriendCode Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/gitbook/README.md b/gitbook/README.md new file mode 100644 index 00000000..fdde2067 --- /dev/null +++ b/gitbook/README.md @@ -0,0 +1,51 @@ +GitBook +======= + +[![NPM version](https://badge.fury.io/js/gitbook.svg)](http://badge.fury.io/js/gitbook) +[![Linux Build Status](https://travis-ci.org/GitbookIO/gitbook.png?branch=master)](https://travis-ci.org/GitbookIO/gitbook) +[![Windows Build status](https://ci.appveyor.com/api/projects/status/63nlflxcwmb2pue6?svg=true)](https://ci.appveyor.com/project/GitBook/gitbook) +[![Slack Status](https://slack.gitbook.com/badge.svg)](https://slack.gitbook.com) + +GitBook is a command line tool (and Node.js library) for building beautiful books using GitHub/Git and Markdown (or AsciiDoc). Here is an example: [Learn Javascript](https://www.gitbook.com/book/GitBookIO/javascript). + +You can publish and host books easily online using [gitbook.com](https://www.gitbook.com). A desktop editor is [also available](https://www.gitbook.com/editor). + +Check out the [GitBook Community Slack Channel](https://slack.gitbook.com), Stay updated by following [@GitBookIO](https://twitter.com/GitBookIO) on Twitter or [GitBook](https://www.facebook.com/gitbookcom) on Facebook. + +Complete documentation is available at [help.gitbook.com](http://help.gitbook.com/). + +![Image](https://raw.github.com/GitbookIO/gitbook/master/preview.png) + +## Getting started + +GitBook can be used either on your computer for building local books or on GitBook.com for hosting them. To get started, check out [the installation instructions in the documentation](docs/setup.md). + +## Usage examples + +GitBook can be used to create book, public documentation, enterprise manual, thesis, research papers, etc. + +You can find a [list of real-world examples](docs/examples.md) in the documentation. + +## Help and Support + +We're always happy to help out with your books or any other questions you might have. You can ask a question on the following contact form at [gitbook.com/contact](https://www.gitbook.com/contact) or signal an issue on [GitHub](https://github.com/GitbookIO/gitbook). + +## Features + +* [Output as a website or ebook (pdf, epub, mobi)](http://help.gitbook.com/format/output.html) +* [Multi-Languages](http://help.gitbook.com/format/languages.html) +* [Glossary](http://help.gitbook.com/format/glossary.html) +* [Cover](http://help.gitbook.com/format/cover.html) +* [AsciiDoc Support](http://help.gitbook.com/format/asciidoc.html) +* [Variables and Templating](http://help.gitbook.com/format/templating.html) +* [Content References](http://help.gitbook.com/format/conrefs.html) +* [Plugins](http://help.gitbook.com/format/plugins.html) +* [Beautiful default theme](https://github.com/GitbookIO/theme-default) + +## Publish your book + +The platform [GitBook.com](https://www.gitbook.com/) is like an "Heroku for books": you can create a book on it (public, or private) and update it using **git push**. + +## Licensing + +GitBook is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. diff --git a/gitbook/app.js b/gitbook/app.js new file mode 100644 index 00000000..906e7030 --- /dev/null +++ b/gitbook/app.js @@ -0,0 +1,6 @@ +!function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a0&&e-1 in t}function r(t,e,n){if(Z.isFunction(e))return Z.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return Z.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(ut.test(e))return Z.filter(e,t,n);e=Z.filter(e,t)}return Z.grep(t,function(t){return X.call(e,t)>=0!==n})}function o(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function i(t){var e=dt[t]={};return Z.each(t.match(ht)||[],function(t,n){e[n]=!0}),e}function a(){J.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1),Z.ready()}function u(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Z.expando+u.uid++}function s(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(xt,"-$1").toLowerCase(),n=t.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:bt.test(n)?Z.parseJSON(n):n}catch(o){}yt.set(t,e,n)}else n=void 0;return n}function c(){return!0}function l(){return!1}function f(){try{return J.activeElement}catch(t){}}function p(t,e){return Z.nodeName(t,"table")&&Z.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function h(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function d(t){var e=It.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function v(t,e){for(var n=0,r=t.length;r>n;n++)mt.set(t[n],"globalEval",!e||mt.get(e[n],"globalEval"))}function g(t,e){var n,r,o,i,a,u,s,c;if(1===e.nodeType){if(mt.hasData(t)&&(i=mt.access(t),a=mt.set(e,i),c=i.events)){delete a.handle,a.events={};for(o in c)for(n=0,r=c[o].length;r>n;n++)Z.event.add(e,o,c[o][n])}yt.hasData(t)&&(u=yt.access(t),s=Z.extend({},u),yt.set(e,s))}}function m(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&Z.nodeName(t,e)?Z.merge([t],n):n}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Ct.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function b(e,n){var r,o=Z(n.createElement(e)).appendTo(n.body),i=t.getDefaultComputedStyle&&(r=t.getDefaultComputedStyle(o[0]))?r.display:Z.css(o[0],"display");return o.detach(),i}function x(t){var e=J,n=$t[t];return n||(n=b(t,e),"none"!==n&&n||(Pt=(Pt||Z("