Compare commits

..

90 Commits

Author SHA1 Message Date
Samy Pessé 3bf592f870 Bump version to 2.3.3 2015-09-10 11:26:15 +02:00
Samy Pessé 241e205717 Merge pull request #912 from GitbookIO/fix/538
Fix 538: duplicate entries without paths are ignored
2015-09-10 09:59:45 +02:00
Samy Pessé fb2720ea8d Update gitbook-parsers@0.8.2 2015-09-10 09:57:04 +02:00
Samy Pessé 14853befda Add test for init with deep summary 2015-09-10 09:56:18 +02:00
Samy Pessé e7f2803d11 Bump version to 2.3.2 2015-09-09 09:30:53 +02:00
Samy Pessé 320015dd8f Fix #910: fix stupid error with semver api 2015-09-09 09:27:08 +02:00
Samy Pessé 471c124a98 Merge pull request #908 from GitbookIO/fix/asciidoc_blocks
Fix blocks in asciidoc
2015-09-09 00:01:43 +02:00
Samy Pesse aa44a109c6 Use position indicator that doesn't conflict with asciidoc 2015-09-08 23:57:40 +02:00
Samy Pesse 41e5ca8422 Add test for blocks without parsing 2015-09-08 23:55:30 +02:00
Samy Pessé 53af8b2bb6 Bump version to 2.3.1 2015-09-08 16:33:22 +02:00
Samy Pessé bd885b135f Merge pull request #904 from kuaipao/fix-mobi-font-color
use black font on mobi
2015-09-08 09:16:43 +02:00
kuaipao 62a6dde81a use black font on mobi 2015-09-08 04:02:48 +08:00
Samy Pesse 14b72b344f Log modified file in watcher 2015-09-06 21:13:18 +02:00
Samy Pesse ac03668063 Update chokidar@1.0.5 2015-09-06 21:11:49 +02:00
Samy Pesse 2512e176c9 Fix #893: korean iso code is "ko" not "kr" 2015-09-06 21:01:39 +02:00
Samy Pesse b613393866 Update highlight.js@8.8.0 2015-09-06 19:04:09 +02:00
Samy Pessé 607a6e95de Update gitbook-parsers@0.8.1 2015-09-05 19:00:42 +02:00
Samy Pessé 871f574ff7 Fix #761: fix syntax highlighting for asciidoc 2015-09-05 17:28:01 +02:00
Samy Pessé 377e470b15 Add warning for file outside spine 2015-09-04 19:12:27 +02:00
Samy Pessé e0a3f0cea5 Add warning for too strict gitbook version 2015-09-04 18:58:16 +02:00
Samy Pessé 66727b2736 Update gitbook-parsers@0.8.0 2015-09-04 18:33:45 +02:00
Samy Pessé 8215ad977f Merge pull request #898 from deminoth/master
Korean translation fixed
2015-09-04 08:36:19 +02:00
SangYeob Bono Yu a611dffbdf Add my name 2015-09-04 10:29:59 +09:00
SangYeob Bono Yu 39f378d8cf Korean translation fixed 2015-09-04 10:22:24 +09:00
Samy Pessé f00da58153 Update appveyor button 2015-09-01 17:52:27 +02:00
Samy Pessé 09b038b16d Bump version to 2.3.0 2015-09-01 17:44:53 +02:00
Samy Pessé cf601d97ad Improve error handling for failed image download 2015-09-01 17:38:33 +02:00
Samy Pessé 80edad53d4 Update nunjucks to fix raw and loader 2015-09-01 17:25:43 +02:00
Samy Pessé a972b32769 Update nunjucks@2.0.0 2015-08-28 08:45:28 +02:00
Samy Pessé efcaae3e60 Add author for hebrew 2015-08-27 19:07:31 +02:00
Samy Pessé e0ee591638 Merge pull request #877 from a-moses/hebrew
hebrew support theme
2015-08-27 19:06:26 +02:00
Samy Pessé 310a6d909f Add method 'get' to config object (helper for plugins) 2015-08-27 15:26:12 +02:00
Samy Pessé cefd8fc50f Don't fail if hook returns nothing for "page" and "page:before" 2015-08-27 15:04:28 +02:00
Samy Pessé a4422593f2 Add back page:before and page as non-deprecated 2015-08-26 11:16:02 +02:00
Samy Pessé e2c5d22756 Merge pull request #844 from xcv58/master
Fix #843 ignore _book in watch.js
2015-08-26 11:05:43 +02:00
Samy Pessé 84385d9dc3 Merge pull request #881 from mortonfox/patch-1
Fix Plugins link.
2015-08-26 11:01:28 +02:00
Morton Fox 6cfa4c8ab7 Fix Plugins link. 2015-08-25 23:35:15 -04:00
a-moses c76ccc53e1 Update he.json 2015-08-23 09:59:14 +03:00
a-moses d48eafb1a2 hebrew support theme
full Hebrew support for GITBOOK (with rtl )

* Sans and Serif may still in original name fonts
2015-08-23 09:53:25 +03:00
Aaron O'Mullan 302d9b4b91 Merge pull request #849 from GitbookIO/improve/remove-webfonts
Use system fonts instead of webfonts
2015-08-13 19:19:35 +02:00
Samy Pessé a091a7f68b Update gitbook-parsers@0.7.7 2015-08-09 15:45:04 +02:00
Aaron O'Mullan 53621f6de3 Use system fonts instead of webfonts 2015-08-08 17:35:05 +02:00
Samy Pessé 288b965db3 Merge pull request #847 from GitbookIO/fix/flicker
Improve header merge on page change
2015-08-07 16:55:42 +02:00
Aaron O'Mullan 578c9dcfc6 Improve header merge on page change
Prevents flickering (style reset)

Fixes #782, #838, #840
2015-08-07 16:46:23 +02:00
xcv58 64de17b248 ignore _book in watch.js 2015-08-04 00:50:31 -04:00
Samy Pesse 501843d624 Bump version to 2.2.0 2015-07-28 15:28:38 -07:00
Samy Pesse 508ce4283e Fix #819: codes must always be ltr 2015-07-28 15:25:12 -07:00
Samy Pessé 4aa8e66549 Merge pull request #813 from MrMaksimize/pdf-options
Allowing for custom chapter-mark and page-break in PDF.
2015-07-01 18:00:31 -04:00
Maksim Pecherskiy 917a6f70d8 Allowing for custom chapter-mark and page-break in PDF. 2015-06-30 19:48:51 -07:00
Samy Pesse 2f5e53da55 Update highlight.js@8.6.0 2015-06-29 10:02:35 -04:00
Samy Pesse c3cdefc90a Simpler template for summary 2015-06-29 09:58:23 -04:00
Samy Pesse 9c580e4989 Fix #802: make book.json accessible as "config." in templating 2015-06-19 16:28:46 +02:00
Samy Pessé 50c902c4e4 Merge pull request #805 from GitbookIO/fix/804
Fix #804
2015-06-18 11:16:32 +02:00
Samy Pesse 84b6e0bde6 Add test for kwargs 2015-06-18 11:15:44 +02:00
Samy Pesse abc29c3fba Fix #804: correctly extract kwargs from blocks 2015-06-18 11:11:47 +02:00
Samy Pesse 8356c534f5 Add failing tests for block's arguments 2015-06-18 11:09:02 +02:00
Samy Pessé 78ff2687b4 Merge pull request #797 from nghong/vi-locale
Adding Vietnamese locale support
2015-06-13 11:15:00 +02:00
Hong Nguyen 9b6586fb36 Add translator name to AUTHORS.md 2015-06-13 16:13:34 +07:00
Hong Nguyen ea133219d0 Minor fix 2015-06-13 16:08:21 +07:00
Hong Nguyen c9b5d81a3c Add Vietnamese locale support 2015-06-13 15:42:49 +07:00
Samy Pessé d895c63211 Bump version to 2.1.0 2015-06-02 14:52:11 +02:00
Samy Pessé 8c86da67ca Update gitbook-parsers@0.7.6 2015-06-02 14:47:21 +02:00
Samy Pessé a9a230dfc3 Merge pull request #781 from GitbookIO/fix/775
Fix #775: add optional print.css style
2015-06-02 11:00:22 +02:00
Samy Pessé 6d53e52771 Handle empty string for styles configuration 2015-06-02 11:00:15 +02:00
Samy Pessé 52e10b7cfe Remove default print.css when styles/print.css is present 2015-06-02 10:23:31 +02:00
Samy Pessé addac85696 Add test for custom print style 2015-06-02 10:18:44 +02:00
Samy Pessé 13fb949d68 Merge pull request #774 from wilhelmmatilainen/patch-1
Styling should go to <head>, not to <body>
2015-05-30 18:11:15 +02:00
Wilhelm f1b593cfbd Styling should go to <head>, not to <body>
https://developers.google.com/speed/pagespeed/module/filter-css-to-head
2015-05-29 15:42:40 +03:00
Samy Pesse f998e2dec9 Bump version to 2.0.4 2015-05-28 18:07:20 +02:00
Samy Pesse 2c0bd53a91 Fix i18n used in multilingual book 2015-05-28 17:06:09 +02:00
Samy Pesse 6dd7f6162f Add title to languages chooser
Related to #757
2015-05-28 16:14:03 +02:00
Samy Pesse 475b0bb2b3 Adapt to nunjucks 1.3.x 2015-05-28 15:59:14 +02:00
Samy Pesse e6343935e3 Update nunjucks to fix raw tags 2015-05-28 15:50:46 +02:00
Samy Pessé 946883fd4c Merge pull request #772 from GitbookIO/feature/glossary_order
Fix #768: sort glossary, start with longest matchs
2015-05-28 15:21:03 +02:00
Samy Pessé b1b7e3148b Merge pull request #743 from chudaol/master
Added vk sharing button.
2015-05-28 14:54:03 +02:00
Samy Pesse 32203f6438 Sort glossary before applying it on pages 2015-05-28 14:49:53 +02:00
Samy Pesse f2d3c5d2ed Add test for #768 2015-05-28 14:38:21 +02:00
Samy Pessé 7e2f0ed4bc Merge pull request #758 from aschempp/hotfix/x-ua-compatible
Fix the X-UA-Compatible meta tag
2015-05-28 14:18:19 +02:00
Samy Pessé a877acf905 Merge pull request #759 from aschempp/hotfix/stylesheets
Move style sheets to the <head> section
2015-05-28 14:17:39 +02:00
Samy Pesse ac756ddf7e Bump version to 2.0.3 2015-05-27 21:11:58 +02:00
Samy Pesse 36e2236e6b Fix #765: in init handle correctly empty entries
Add tests for it, fix #769
2015-05-27 21:05:36 +02:00
Samy Pesse 72df665520 Update gitbook-parsers@0.7.5 2015-05-27 19:11:50 +02:00
Samy Pessé 07785528a5 Merge pull request #767 from wilhelmmatilainen/patch-1
Don't create panic by telling about false overwrite
2015-05-27 13:17:05 +02:00
Wilhelm bb579dd581 Don't create panic by telling about false overwrite 2015-05-27 14:13:02 +03:00
Samy Pessé a7d3064340 Change license to valid SPDX code 2015-05-26 16:10:11 +02:00
Andreas Schempp 1a60778248 Move style sheets to the <head> section
see https://github.com/GitbookIO/gitbook/issues/756
2015-05-23 09:14:26 +02:00
Andreas Schempp cda4bb5bda Fix the X-UA-Compatible meta tag
see https://github.com/GitbookIO/gitbook/issues/755
2015-05-23 09:06:58 +02:00
Olga Filipova 7543781046 Added vk sharing button. 2015-05-12 22:30:09 +02:00
Samy Pessé 82f3ffad06 Merge pull request #730 from creynders/patch-1
Fix typo in warning in `lib/plugin`
2015-05-04 14:47:56 +02:00
creynders dc4d2a1731 Fix typo in warning in lib/plugin 2015-05-04 13:16:47 +02:00
64 changed files with 422 additions and 205 deletions
+19 -14
View File
@@ -21,32 +21,37 @@ Translators
------------
- German
- Winnie (@winniehell)
- Winnie (@winniehell)
- Italian
- Giulio Bonanome (@gbonanome)
- Giulio Bonanome (@gbonanome)
- Russian
- Andrey Akinshin (@AndreyAkinshin)
- Andrey Akinshin (@AndreyAkinshin)
- Norwegian
- Knut Melvær (@kmelve)
- Knut Melvær (@kmelve)
- Persian (Farsi)
- Mohammad Hossein Mojtahedi (@mhm5000)
- Mohammad Hossein Mojtahedi (@mhm5000)
- Polish
- Łukasz Szeremeta (@lszeremeta)
- Łukasz Szeremeta (@lszeremeta)
- Portuguese
- Ryan O'Mullan (@RyanOM)
- Ryan O'Mullan (@RyanOM)
- Spanish
- Ryan O'Mullan (@RyanOM)
- Ryan O'Mullan (@RyanOM)
- Simplifiled Chinese
- Hu Hao (@howiehu)
- Hu Hao (@howiehu)
- Traditional Chinese
- Hu Hao (@howiehu)
- Hu Hao (@howiehu)
- French
- Samy Pessé (@SamyPesse)
- Samy Pessé (@SamyPesse)
- Romanian
- Iancu Aurel (@awrelll)
- Finnish
- Tommi Savikko (@savikko)
- Tommi Savikko (@savikko)
- Japanese
- Iancu Aurel (@awrelll)
- Iancu Aurel (@awrelll)
- Korean
- Iancu Aurel (@awrelll)
- Iancu Aurel (@awrelll)
- SangYeob Yu (@deminoth)
- Vietnamese
- Hong Nguyen (@nghong)
- Hebrew
- @a-moses
+48
View File
@@ -2,6 +2,54 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 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 <head> 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)
+3 -3
View File
@@ -2,8 +2,8 @@ GitBook
=======
[![NPM version](https://badge.fury.io/js/gitbook.svg)](http://badge.fury.io/js/gitbook)
[![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/github/GitbookIO/gitbook?branch=master&svg=true)](https://ci.appveyor.com/project/SamyPesse/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)
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).
@@ -50,7 +50,7 @@ $ gitbook build
* [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/plugins/index.html)
* [Plugins](http://help.gitbook.com/format/plugins.html)
* Interractive reader website:
* Search
* Font Settings (Serif, Sans Serif)
+16 -12
View File
@@ -512,7 +512,7 @@ Book.prototype.parsePage = function(filename, options) {
var interpolate = function(fn) {
return Q(fn(page))
.then(function(_page) {
page = _page;
page = _page || page;
});
};
@@ -789,20 +789,19 @@ Book.prototype.normError = function(err, opts, defs) {
};
// Init and return a book
Book.init = function(root) {
var book = new Book(root);
Book.init = function(root, opts) {
var book = new Book(root, opts);
var extensionToUse = ".md";
var chaptersPaths = function(chapters) {
return _.reduce(chapters || [], function(accu, chapter) {
if (!chapter.path) return accu;
var o = {
title: chapter.title
};
if (chapter.path) o.path = chapter.path;
return accu.concat(
_.filter([
{
title: chapter.title,
path: chapter.path
}
].concat(chaptersPaths(chapter.articles)))
[o].concat(chaptersPaths(chapter.articles))
);
}, []);
};
@@ -839,12 +838,17 @@ Book.init = function(root) {
.then(function(chapters) {
// Create files that don't exist
return Q.all(_.map(chapters, function(chapter) {
if (!chapter.path) return Q();
var absolutePath = path.resolve(book.root, chapter.path);
return fs.exists(absolutePath)
.then(function(exists) {
book.log.info.ln("create", chapter.path);
if(exists) return;
if(exists) {
book.log.info.ln("found", chapter.path);
return;
} else {
book.log.info.ln("create", chapter.path);
}
return fs.mkdirp(path.dirname(absolutePath))
.then(function() {
+15 -2
View File
@@ -121,8 +121,8 @@ Configuration.prototype.load = function() {
if (!semver.satisfies(pkg.version, that.options.gitbook)) {
throw "GitBook version doesn't satisfy version required by the book: "+that.options.gitbook;
}
if (that.options.gitbook == "*") {
that.book.log.warn.ln("you should specify a gitbook version to use in your book.json, for example: "+(_.first(pkg.version.split("."))+".x.x"));
if (that.options.gitbook != '*' && !semver.satisfies(semver.inc(pkg.version, 'patch'), that.options.gitbook)) {
that.book.log.warn.ln("gitbook version specified in your book.json might be too strict for future patches, \""+(_.first(pkg.version.split("."))+".x.x")+"\" is more adequate");
}
that.options.output = path.resolve(that.options.output || path.join(that.book.root, "_book"));
@@ -156,6 +156,10 @@ Configuration.prototype.normalizeLanguage = function() {
return i18n.normalizeLanguage(this.options.language);
};
// Return a configuration
Configuration.prototype.get = function(key, def) {
return _.get(this.options, key, def);
};
// Default configuration
Configuration.DEFAULT = {
@@ -186,6 +190,7 @@ Configuration.DEFAULT = {
// CSS Styles
"styles": {
"website": "styles/website.css",
"print": "styles/print.css",
"ebook": "styles/ebook.css",
"pdf": "styles/pdf.css",
"mobi": "styles/mobi.css",
@@ -245,6 +250,14 @@ Configuration.DEFAULT = {
// Choices are [ua0, ua1, ua2, ua3, ua4, ua5, ua6, ub0, ub1, ub2, ub3, ub4, ub5, ub6, ulegal, uletter]
"paperSize": "a4",
// How to mark detected chapters.
// Choices are “pagebreak”, “rule”, "both" or “none”.
"chapterMark" : "pagebreak",
// An XPath expression. Page breaks are inserted before the specified elements.
// To disable use the expression: "/"
"pageBreaksBefore": "/",
// Margin (in pts)
// Note: 72 pts equals 1 inch
"margin": {
+3 -3
View File
@@ -18,7 +18,7 @@ var Generator = function(book, format) {
this.namespace = "ebook";
// Styles to use
this.styles = _.compact(["ebook", this.ebookFormat]);
this.styles = _.compact(["print", "ebook", this.ebookFormat]);
// Convert images (svg -> png)
this.convertImages = true;
@@ -68,8 +68,6 @@ Generator.prototype.finish = function() {
"--book-producer": "GitBook",
"--publisher": "GitBook",
"--chapter": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]",
"--chapter-mark": "pagebreak",
"--page-breaks-before": "/",
"--level1-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]",
"--level2-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]",
"--level3-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]",
@@ -82,6 +80,8 @@ Generator.prototype.finish = function() {
var pdfOptions = that.options.pdf;
_.extend(_options, {
"--chapter-mark": String(pdfOptions.chapterMark),
"--page-breaks-before": String(pdfOptions.pageBreaksBefore),
"--margin-left": String(pdfOptions.margin.left),
"--margin-right": String(pdfOptions.margin.right),
"--margin-top": String(pdfOptions.margin.top),
+7 -5
View File
@@ -4,8 +4,8 @@ var Q = require("q");
var _ = require("lodash");
var nunjucks = require("nunjucks");
var AutoEscapeExtension = require("nunjucks-autoescape");
var FilterExtension = require("nunjucks-filter");
var AutoEscapeExtension = require("nunjucks-autoescape")(nunjucks);
var FilterExtension = require("nunjucks-filter")(nunjucks);
var fs = require("../utils/fs");
var BaseGenerator = require("../generator");
@@ -50,12 +50,13 @@ Generator.prototype.prepareStyles = function() {
this.styles = _.chain(this.styles)
.map(function(style) {
var stylePath = that.options.styles[style];
if (fs.existsSync(path.resolve(that.book.root, stylePath))) {
return stylePath;
if (stylePath && fs.existsSync(path.resolve(that.book.root, stylePath))) {
return [style, stylePath];
}
return null;
})
.compact()
.object()
.value();
return Q();
@@ -100,7 +101,6 @@ Generator.prototype.prepareTemplateEngine = function() {
that.env.addFilter('lvl', function(lvl) {
return lvl.split(".").length;
});
that.env.addGlobal('__', that.book.i18n.bind(that.book));
// Add extension
that.env.addExtension('AutoEscapeExtension', new AutoEscapeExtension(that.env));
@@ -238,6 +238,8 @@ Generator.prototype._writeTemplate = function(tpl, options, output, interpolate)
basePath: ".",
staticBase: path.join(".", "gitbook"),
'__': that.book.i18n.bind(that.book)
}, options)
);
})
+1 -1
View File
@@ -158,7 +158,7 @@ module.exports = {
.then(function(filepath) {
// set livereload path
lrPath = filepath;
console.log("Restart after change in files");
console.log("Restart after change in file", filepath);
console.log('');
return generate();
})
+2 -2
View File
@@ -33,7 +33,7 @@ var Plugin = function(book, name) {
// Type of plugins resources
Plugin.RESOURCES = ["js", "css"];
Plugin.HOOKS = [
"init", "finish", "finish:before"
"init", "finish", "finish:before", "page", "page:before"
]
// Load from a name
@@ -155,7 +155,7 @@ Plugin.prototype.callHook = function(name, data) {
if (!hookFunc) return Q(data);
this.book.log.debug.ln("call hook", name);
if (!_.contains(Plugin.HOOKS, name)) this.book.log.warn.ln("hook '"+name+"' used by plugin '"+this.name+"' is deprecated, and will be remove in the coming versions");
if (!_.contains(Plugin.HOOKS, name)) this.book.log.warn.ln("hook '"+name+"' used by plugin '"+this.name+"' is deprecated, and will be removed in the coming versions");
return Q()
.then(function() {
+9 -6
View File
@@ -103,16 +103,16 @@ TemplateEngine.prototype.processBlock = function(blk) {
return blk.body;
}
// Return it as a macro
return "%+%"+blk.id+"%+%";
// Return it as a position marker
return "@%@"+blk.id+"@%@";
};
// Replace blocks by body after processing
// This is done to avoid that markdown processer parse the block content
// Replace position markers of blocks by body after processing
// This is done to avoid that markdown/asciidoc processer parse the block content
TemplateEngine.prototype.replaceBlocks = function(content) {
var that = this;
return content.replace(/\%\+\%([\s\S]+?)\%\+\%/g, function(match, key) {
return content.replace(/\@\%\@([\s\S]+?)\@\%\@/g, function(match, key) {
var blk = that.blocks[key];
if (!blk) return match;
@@ -250,7 +250,7 @@ TemplateEngine.prototype.addBlock = function(name, block) {
// Extract main body and kwargs
var body = args.pop();
var kwargs = args.pop() || {};
var kwargs = _.isObject(_.last(args))? args.pop() : {};
// Extract blocks body
var _blocks = _.map(block.blocks, function(blockName, i){
@@ -316,6 +316,9 @@ TemplateEngine.prototype.renderString = function(content, context, options) {
// Variables from book.json
book: this.book.options.variables,
// Complete book.json
config: this.book.options,
// infos about gitbook
gitbook: {
version: pkg.version,
+4
View File
@@ -64,6 +64,10 @@ function writeStream(filename, st) {
d.reject(err);
});
st.on('error', function(err) {
d.reject(err);
});
st.pipe(wstream);
return d.promise;
+1 -1
View File
@@ -83,7 +83,7 @@ function cloneGitRepo(host, ref) {
return exec("git clone "+host+" "+repoPath)
.then(function() {
return exec("git checkout "+ref, { cwd: repoPath });
})
});
})
.thenResolve(repoPath);
});
+27 -3
View File
@@ -13,6 +13,8 @@ var fs = require('./fs');
var batch = require('./batch');
var code = require('./code');
var parsableExtensions = require('gitbook-parsers').extensions;
// Render a cheerio dom as html
var renderDom = function($, dom, options) {
if (!dom && $._root && $._root.children) {
@@ -196,11 +198,19 @@ function normalizeHtml(src, options) {
var absolutePath = links.join(options.base, parts.pathname);
var anchor = parts.hash || "";
// If is in navigation relative: transform as content
if (options.navigation[absolutePath]) {
absolutePath = options.book.contentLink(absolutePath);
}
// If md/adoc/rst files is not in summary
// or for ebook, signal all files that are outside the summary
else if (_.contains(parsableExtensions, path.extname(absolutePath))
|| _.contains(['epub', 'pdf', 'mobi'], options.book.options.generator)) {
options.book.log.warn.ln("page", options.input, "contains an hyperlink to resource outside spine '"+href+"'");
}
// Transform as absolute
href = links.toAbsolute("/"+absolutePath, options.base, options.output)+anchor;
} else {
@@ -219,7 +229,12 @@ function normalizeHtml(src, options) {
($(this).attr("class") || "").split(" ")
)
.map(function(cl) {
// Markdown
if (cl.search("lang-") === 0) return cl.slice("lang-".length);
// Asciidoc
if (cl.search("language-") === 0) return cl.slice("language-".length);
return null;
})
.compact()
@@ -237,13 +252,16 @@ function normalizeHtml(src, options) {
});
// Replace glossary terms
_.each(options.glossary, function(term) {
var glossary = _.sortBy(options.glossary, function(term) {
return -term.name.length;
});
_.each(glossary, function(term) {
var r = new RegExp( "\\b(" + pregQuote(term.name.toLowerCase()) + ")\\b" , 'gi' );
var includedInFiles = false;
$("*").each(function() {
// Ignore codeblocks
if (_.contains(["code", "pre"], this.name.toLowerCase())) return;
if (_.contains(["code", "pre", "a"], this.name.toLowerCase())) return;
replaceText($, this, r, function(match) {
// Add to files index in glossary
@@ -282,7 +300,13 @@ function convertImages(images, options) {
if (!image.origin && !_.contains(downloaded, image.origin)) return;
options.book.log.debug("download image", image.origin, "...");
downloaded.push(image.origin);
return options.book.log.debug.promise(fs.writeStream(imgin, request(image.origin)));
return options.book.log.debug.promise(fs.writeStream(imgin, request(image.origin)))
.fail(function(err) {
if (!_.isError(err)) err = new Error(err);
err.message = 'Fail downloading '+image.origin+': '+err.message;
throw err;
});
})
// Write svg if content
+1
View File
@@ -19,6 +19,7 @@ function watch(dir) {
var watcher = chokidar.watch(toWatch, {
cwd: dir,
ignored: '_book/**',
ignoreInitial: true
});
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "gitbook",
"version": "2.0.2",
"version": "2.3.3",
"homepage": "https://www.gitbook.com",
"description": "Library and cmd utility to generate GitBooks",
"main": "lib/index.js",
@@ -12,16 +12,16 @@
"resolve": "0.6.3",
"fs-extra": "0.16.5",
"fstream-ignore": "1.0.2",
"gitbook-parsers": "0.7.4",
"nunjucks": "1.3.0",
"nunjucks-autoescape": "0.1.1",
"nunjucks-filter": "0.1.0",
"gitbook-parsers": "0.8.2",
"nunjucks": "mozilla/nunjucks#b4351ec0752b102ebd02c5e2cbc2898a6e0e4839",
"nunjucks-autoescape": "1.0.0",
"nunjucks-filter": "1.0.0",
"i18n": "0.5.0",
"semver": "2.2.1",
"semver": "5.0.1",
"npmi": "0.1.1",
"cheerio": "0.19.0",
"gitbook-plugin-livereload": "0.0.1",
"chokidar": "~1.0.1",
"chokidar": "~1.0.5",
"send": "0.2.0",
"tiny-lr": "0.1.5",
"tmp": "0.0.24",
@@ -32,7 +32,7 @@
"npm": "2.4.1",
"dom-serializer": "0.1.0",
"spawn-cmd": "0.0.2",
"highlight.js": "8.4.0",
"highlight.js": "8.8.0",
"escape-string-regexp": "1.0.3"
},
"devDependencies": {
@@ -61,7 +61,7 @@
"gitbook"
],
"author": "FriendCode Inc. <contact@gitbook.com>",
"license": "Apache 2",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/GitbookIO/gitbook/issues"
},
+1 -1
View File
@@ -35,7 +35,7 @@ should.Assertion.add('html', function(rules, description) {
var $el = $(query);
// Test number of elements
$el.should.have.lengthOf(validations.count);
$el.length.should.be.equal(validations.count);
// Test text
if (validations.text !== undefined) {
+4
View File
@@ -7,3 +7,7 @@ Just a simple and easy to understand test.
## hakunamatata
This word is not present in the content.
## test long
This is a test with a longer text that the first entry to test order.
+2
View File
@@ -6,3 +6,5 @@ The word test should be replaced by a glossary link.
But the word test should not be replaced in code blocks
```
The two words test long should be replaced by the correct glossary links.
+3
View File
@@ -0,0 +1,3 @@
*
!SUMMARY.md
!.gitignore
+9
View File
@@ -0,0 +1,9 @@
# Summary
* [Hello](hello.md)
* [Hello 2](hello2.md)
* Hello 3
* [Hello 4](hello3/hello4.md)
* Hello 5
* [Hello 6](hello3/hello5/hello6.md)
+3
View File
@@ -0,0 +1,3 @@
# Readme
Default description for the book.
+1
View File
@@ -0,0 +1 @@
# Summary
+3
View File
@@ -0,0 +1,3 @@
body {
color: red;
}
+31
View File
@@ -21,4 +21,35 @@ describe('eBook generator', function () {
book.should.have.file("gitbook/style.css");
});
});
describe('Custom styles', function() {
var book;
before(function() {
return books.generate("style-print", "ebook")
.then(function(_book) {
book = _book;
});
});
it('should remove default print.css', function() {
var PAGE = fs.readFileSync(
path.join(book.options.output, "index.html"),
{ encoding: "utf-8" }
);
PAGE.should.be.html({
"link": {
count: 1,
attributes: {
href: "./styles/print.css"
}
}
});
});
it('should correctly print.css', function() {
book.should.have.file("styles");
book.should.have.file("styles/print.css");
});
})
});
+10 -1
View File
@@ -14,7 +14,7 @@ describe('Glossary', function () {
it('should correctly list items', function() {
book.should.have.property("glossary");
book.glossary.should.have.lengthOf(2);
book.glossary.should.have.lengthOf(3);
});
});
@@ -73,6 +73,15 @@ describe('Glossary', function () {
}
});
});
it('should correctly select the longest term', function() {
readme.should.be.html({
".page-inner a[href='GLOSSARY.html#test_long']": {
count: 1,
text: "test long"
}
});
});
});
});
});
+24
View File
@@ -0,0 +1,24 @@
var fs = require('fs');
var path = require('path');
var should = require('should');
var Book = require('../').Book;
var LOG_LEVELS = require('../').LOG_LEVELS;
describe('Init Books', function () {
var initRoot;
before(function() {
initRoot = path.resolve(__dirname, "books/init");
return Book.init(initRoot, {
logLevel: LOG_LEVELS.DISABLED,
});
});
it('should create all chapters', function() {
should(fs.existsSync(path.resolve(initRoot, "hello.md"))).be.ok;
should(fs.existsSync(path.resolve(initRoot, "hello2.md"))).be.ok;
should(fs.existsSync(path.resolve(initRoot, "hello3/hello4.md"))).be.ok;
should(fs.existsSync(path.resolve(initRoot, "hello3/hello5/hello6.md"))).be.ok;
});
});
+48
View File
@@ -3,6 +3,7 @@ var should = require('should');
var path = require('path');
var Plugin = require('../lib/plugin');
var parsers = require("gitbook-parsers");
var PLUGINS_ROOT = path.resolve(__dirname, 'plugins');
describe('Plugins', function () {
@@ -185,6 +186,53 @@ describe('Plugins', function () {
content.should.equal("hello;the;world");
});
});
it('should correctly extend template blocks with arguments', function() {
return testTpl('{% test5args "a", "b", "c" %}{% endtest5args %}')
.then(function(content) {
content.should.equal("test5a,b,ctest5");
});
});
it('should correctly extend template blocks with args and kwargs', function() {
return testTpl('{% test5kwargs "a", "b", "c", d="test", e="test2" %}{% endtest5kwargs %}')
.then(function(content) {
content.should.equal("test5a,b,c,d:test,e:test2,__keywords:truetest5");
});
});
});
describe('Blocks without parsing', function() {
var plugin;
before(function() {
plugin = new Plugin(book, "blocks");
plugin.load("./blocks", PLUGINS_ROOT);
return book.plugins.load(plugin);
});
var testTpl = function(markup, str, args, options) {
var filetype = parsers.get(markup);
return book.template.renderString(str, args, options)
.then(filetype.page).get('sections').get(0).get('content')
.then(book.template.postProcess)
};
it('should correctly process unparsable for markdown', function() {
return testTpl('.md', '{% test %}**hello**{% endtest %}')
.then(function(content) {
content.should.equal("<p>test**hello**test</p>\n");
});
});
it('should correctly process unparsable for asciidoc', function() {
return testTpl('.adoc', '{% test %}**hello**{% endtest %}')
.then(function(content) {
content.should.equal('<div class="paragraph">\n<p>test**hello**test</p>\n</div>');
});
});
});
});
+16 -1
View File
@@ -36,6 +36,21 @@ module.exports = {
assert(blk.blocks[1].name, "finally");
return [blk.body, blk.blocks[0].body, blk.blocks[1].body].join(blk.kwargs.separator);
}
}
},
"test5args": {
process: function(blk) {
return "test5"+blk.args.join(',')+"test5";
}
},
"test5kwargs": {
process: function(blk) {
var s = blk.args.join(',');
for (var key in blk.kwargs) {
s = s + ','+key+':'+blk.kwargs[key];
}
return "test5"+s+"test5";
}
},
}
};
+1 -1
View File
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+21
View File
@@ -0,0 +1,21 @@
{
"direction": "rtl",
"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"
}
+8 -8
View File
@@ -3,18 +3,18 @@
"GLOSSARY": "어휘",
"GLOSSARY_INDEX": "색인",
"GLOSSARY_OPEN": "어휘",
"GITBOOK_LINK": "에 게시 GitBook",
"GITBOOK_LINK": "GitBook에 게시",
"SUMMARY": "차례",
"SUMMARY_INTRODUCTION": "소개",
"SUMMARY_TOGGLE": "차례",
"SEARCH_TOGGLE": "색",
"SEARCH_TOGGLE": "색",
"SEARCH_PLACEHOLDER": "검색어 입력",
"FONTSETTINGS_TOGGLE": "글꼴 설정",
"SHARE_TOGGLE": "",
"SHARE_ON": "공유 {{platform}}",
"SHARE_TOGGLE": "공유",
"SHARE_ON": "{{platform}}에 공유",
"FONTSETTINGS_WHITE": "화이트",
"FONTSETTINGS_SEPIA": "Sepia",
"FONTSETTINGS_NIGHT": "",
"FONTSETTINGS_SANS": "Sans",
"FONTSETTINGS_SERIF": "Serif"
"FONTSETTINGS_SEPIA": "세피아",
"FONTSETTINGS_NIGHT": "나이트",
"FONTSETTINGS_SANS": "고딕",
"FONTSETTINGS_SERIF": "명조"
}
+20
View File
@@ -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"
}
+17 -5
View File
@@ -35,13 +35,25 @@ define([
var $pageHead = $page.find("[data-element=head]");
var $pageBody = $page.find('.book');
////
// Merge heads
var headContent = $pageHead.html()
// !! Warning !!: we only update necessary portions to avoid strange behavior (page flickering etc ...)
////
$("head style").each(function() {
headContent = headContent + this.outerHTML
});
$("head").html(headContent);
// Update title
document.title = $pageHead.find("title").text();
// Reference to $("head");
var $head = $("head");
// Update next & prev <link> tags
// Remove old
$head.find("link[rel=prev]").remove();
$head.find("link[rel=next]").remove();
// Add new next * prev <link> tags
$head.append($pageHead.find("link[rel=prev]"));
$head.append($pageHead.find("link[rel=next]"));
// Merge body
var bodyClass = $(".book").attr("class");
+3
View File
@@ -16,6 +16,9 @@ define([
},
"instapaper": function($el) {
window.open("http://www.instapaper.com/text?u="+encodeURIComponent(location.href));
},
"vk": function($el) {
window.open("http://vkontakte.ru/share.php?url="+encodeURIComponent(location.href));
}
};
+1
View File
@@ -51,6 +51,7 @@
pre {
font-family: monospace, monospace;
font-size: 1em;
direction: ltr;
}
table {
+1 -1
View File
@@ -39,6 +39,6 @@
body {
.page {
font-family: sans-serif;
.markdown-content(#333, 1.6);
.markdown-content(#000, 1.6);
}
}
+1 -1
View File
@@ -4,7 +4,6 @@
@import "mixins.less";
@import "website/fonts.less";
@import "website/variables.less";
@import "website/languages.less";
@import "website/header.less";
@@ -44,4 +43,5 @@ body {
font-smoothing: antialiased;
font-family: @font-family-base;
font-size: @font-size-base;
letter-spacing: .2px;
}
-96
View File
@@ -1,96 +0,0 @@
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 250;
src: local('Merriweather Light'),url('@{FontPath}/merriweather/250.woff') format('woff');
}
@font-face {
font-family: 'Merriweather';
font-style: italic;
font-weight: 250;
src: local('Merriweather Light Italic'),url('@{FontPath}/merriweather/250i.woff') format('woff');
}
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 400;
src: local('Merriweather'),url('@{FontPath}/merriweather/400.woff') format('woff');
}
@font-face {
font-family: 'Merriweather';
font-style: italic;
font-weight: 400;
src: local('Merriweather Italic'),url('@{FontPath}/merriweather/400i.woff') format('woff');
}
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 700;
src: local('Merriweather Bold'),url('@{FontPath}/merriweather/700.woff') format('woff');
}
@font-face {
font-family: 'Merriweather';
font-style: italic;
font-weight: 700;
src: local('Merriweather Bold Italic'),url('@{FontPath}/merriweather/700i.woff') format('woff');
}
@font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 900;
src: local('Merriweather Heavy'),url('@{FontPath}/merriweather/900.woff') format('woff');
}
@font-face {
font-family: 'Merriweather';
font-style: italic;
font-weight: 900;
src: local('Merriweather Heavy Italic'),url('@{FontPath}/merriweather/900i.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'),url('@{FontPath}/opensans/300.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 300;
src: local('Open Sans Light Italic'),url('@{FontPath}/opensans/300i.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans Regular'),url('@{FontPath}/opensans/400.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 400;
src: local('Open Sans Italic'),url('@{FontPath}/opensans/400i.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'),url('@{FontPath}/opensans/600.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 600;
src: local('Open Sans Semibold Italic'),url('@{FontPath}/opensans/600i.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'),url('@{FontPath}/opensans/700.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 700;
src: local('Open Sans Bold Italic'),url('@{FontPath}/opensans/700i.woff') format('woff');
}
+2 -2
View File
@@ -95,8 +95,8 @@
@border-radius-small: 1px;
// Fonts
@font-family-serif: "Merriweather", Georgia, serif;
@font-family-sans: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-family-serif: Georgia, serif;
@font-family-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-family-base: @font-family-sans;
@headings-font-family: inherit;
+7 -7
View File
@@ -1,8 +1,8 @@
<!DOCTYPE HTML>
<html lang="{{ language }}" {% block htmlTag %}{% endblock %} {% if options.direction == "rtl" %}dir="rtl"{% endif %}>
{{ htmlSnippet("html:start")|default("")|safe }}
{{ htmlSnippet("html:start")|default("", true)|safe }}
<head>
{{ htmlSnippet("head:start")|default("")|safe }}
{{ htmlSnippet("head:start")|default("", true)|safe }}
<meta charset="UTF-8">
<title>{% block title %}{% endblock %}</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
@@ -11,14 +11,14 @@
{% if options.author %}<meta name="author" content="{{ options.author }}">{% endif %}
{% if options.isbn %}<meta name="identifier" content="{{ options.isbn }}" scheme="ISBN">{% endif %}
{% block head %}{% endblock %}
{{ htmlSnippet("head:end")|default("")|safe }}
{% block style %}{% endblock %}
{{ htmlSnippet("head:end")|default("", true)|safe }}
</head>
<body>
{{ htmlSnippet("body:start")|default("")|safe }}
{% block style %}{% endblock %}
{{ htmlSnippet("body:start")|default("", true)|safe }}
{% block content %}{% endblock %}
{% block javascript %}{% endblock %}
{{ htmlSnippet("body:end")|default("")|safe }}
{{ htmlSnippet("body:end")|default("", true)|safe }}
</body>
{{ htmlSnippet("html:end")|default("")|safe }}
{{ htmlSnippet("html:end")|default("", true)|safe }}
</html>
+3 -1
View File
@@ -3,7 +3,9 @@
{% block title %}{{ progress.current.title }} | {{ title }}{% endblock %}
{% block style %}
{% if not styles.print %}
<link rel="stylesheet" href="{{ staticBase }}/print.css">
{% endif %}
{% for resource in plugins.resources.css %}
{% if resource.url %}
<link rel="stylesheet" href="{{ resource.url }}">
@@ -11,7 +13,7 @@
<link rel="stylesheet" href="{{ staticBase }}/plugins/{{ resource.path }}">
{% endif %}
{% endfor %}
{% for style in styles %}
{% for type, style in styles %}
<link rel="stylesheet" href="{{ basePath }}/{{ style }}">
{% endfor %}
{% endblock %}
@@ -54,6 +54,10 @@
{% if options.links.sharing.weibo == true %}
<a href="#" target="_blank" class="btn pull-right weibo-sharing-link sharing-link" data-sharing="weibo" aria-label="Weibo"><i class="fa fa-weibo"></i></a>
{% endif %}
{% if options.links.sharing.vk == true %}
<a href="#" target="_blank" class="btn pull-right vk-sharing-link sharing-link" data-sharing="vk" aria-label="VK"><i class="fa fa-vk"></i></a>
{% endif %}
<!-- Title -->
<h1>
@@ -4,21 +4,15 @@
{% if item.path and item.exists %}
{% if not item.external %}
<a href="{{ basePath }}/{{ item.path|contentLink }}">
<i class="fa fa-check"></i>
{% if item.level != "0" %}
<b>{{ item.level }}.</b>
{% endif %}
{{ item.title }}
</a>
{% else %}
<a target="_blank" href="{{ item.path }}">
{% endif %}
<i class="fa fa-check"></i>
{% if item.level != "0" %}
<b>{{ item.level }}.</b>
{% endif %}
{{ item.title }}
</a>
{% endif %}
{% else %}
<span><b>{{ item.level }}.</b> {{ item.title }}</span>
{% endif %}
+1 -1
View File
@@ -1,6 +1,6 @@
{% extends "./layout.html" %}
{% block title %}{{ title }}{% endblock %}
{% block title %}{{ __("LANGS_CHOOSE") }} | {{ title }}{% endblock %}
{% block style %}
<link rel="stylesheet" href="{{ staticBase }}/style.css">
+8 -8
View File
@@ -1,10 +1,10 @@
<!DOCTYPE HTML>
<html lang="{{ language }}" {% if options.direction == "rtl" %}dir="rtl"{% endif %}>
{{ htmlSnippet("html:start")|default("")|safe }}
{{ htmlSnippet("html:start")|default("", true)|safe }}
<head>
{{ htmlSnippet("head:start")|default("")|safe }}
{{ htmlSnippet("head:start")|default("", true)|safe }}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>{% block title %}{% endblock %}</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="{% block description %}{% endblock %}">
@@ -17,15 +17,15 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ staticBase }}/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="{{ staticBase }}/images/favicon.ico" type="image/x-icon">
{% block style %}{% endblock %}
{% block head %}{% endblock %}
{{ htmlSnippet("head:end")|default("")|safe }}
{{ htmlSnippet("head:end")|default("", true)|safe }}
</head>
<body>
{{ htmlSnippet("body:start")|default("")|safe }}
{% block style %}{% endblock %}
{{ htmlSnippet("body:start")|default("", true)|safe }}
{% block content %}{% endblock %}
{% block javascript %}{% endblock %}
{{ htmlSnippet("body:end")|default("")|safe }}
{{ htmlSnippet("body:end")|default("", true)|safe }}
</body>
{{ htmlSnippet("html:end")|default("")|safe }}
{{ htmlSnippet("html:end")|default("", true)|safe }}
</html>
+1 -1
View File
@@ -70,7 +70,7 @@ require(["gitbook"], function(gitbook) {
<link rel="stylesheet" href="{{ staticBase }}/plugins/{{ resource.path }}">
{% endif %}
{% endfor %}
{% for style in styles %}
{% for type, style in styles %}
<link rel="stylesheet" href="{{ basePath }}/{{ style }}">
{% endfor %}
{% endblock %}