mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-28 21:18:57 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d9e4c80a2 | |||
| a7f49015c1 | |||
| 68ed2631dc | |||
| 2814fea67e | |||
| 3388be9db6 | |||
| 9b89319820 | |||
| ad34089df5 | |||
| 7a4c6bc326 |
+15
-29
@@ -2,36 +2,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## 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
|
## 2.5.0
|
||||||
- Add `chapterTitle` and `filepath` to `gitbook.state` JS API
|
|
||||||
- Fix compatibility with plugins `<2.5.0`
|
|
||||||
|
|
||||||
## 2.5.0-beta.7
|
|
||||||
- Use Arial as default font for PDFs
|
|
||||||
- Client side API provides `gitbook.state.root`
|
|
||||||
- Normalize heading IDs like GitHub
|
|
||||||
|
|
||||||
## 2.5.0-beta.6
|
|
||||||
- Fix default style for pdf footer and header
|
|
||||||
- Correctly handle query in image urls
|
|
||||||
- Fix templating in imported content
|
|
||||||
- Use helvetica as default font for PDFs
|
|
||||||
|
|
||||||
## 2.5.0-beta.5
|
|
||||||
- Fix position of sidebar toggle button
|
|
||||||
- Update asciidoc parser to remove git dependency
|
|
||||||
|
|
||||||
## 2.5.0-beta.4
|
|
||||||
- Fix compatibility for some plugins (like `autocover`)
|
|
||||||
- Fix position of sidebar toggle button when glossary button is present
|
|
||||||
|
|
||||||
## 2.5.0-beta.3
|
|
||||||
- Fix installation of plugins when using a pre-release
|
|
||||||
|
|
||||||
## 2.5.0-beta.2
|
|
||||||
- Fix support for pre-releases
|
|
||||||
|
|
||||||
## 2.5.0-beta.1
|
|
||||||
- Font settings, sharing and search are externalized as default plugins
|
- 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
|
- 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 Node.js API for plugin: `book.formatString(type, content)`
|
||||||
@@ -40,6 +18,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Cleaner table of contents for ebooks
|
- Cleaner table of contents for ebooks
|
||||||
- Support for RTL in ebook's table of contents
|
- Support for RTL in ebook's table of contents
|
||||||
- Better colors for mobi (links and code blocks)
|
- 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
|
## 2.4.3
|
||||||
- Add ukrainian translation (`uk`)
|
- Add ukrainian translation (`uk`)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ Generator.prototype.getPDFTemplate = function(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tpl = juice(tpl, {
|
tpl = juice(tpl, {
|
||||||
extraCss: stylesheets.concat('/n')
|
extraCss: stylesheets.join('\n\n')
|
||||||
});
|
});
|
||||||
|
|
||||||
return tpl;
|
return tpl;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gitbook",
|
"name": "gitbook",
|
||||||
"version": "2.5.0",
|
"version": "2.5.2",
|
||||||
"homepage": "https://www.gitbook.com",
|
"homepage": "https://www.gitbook.com",
|
||||||
"description": "Library and cmd utility to generate GitBooks",
|
"description": "Library and cmd utility to generate GitBooks",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
|
|||||||
@@ -24403,6 +24403,7 @@ function start(config) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
events.trigger('start', config);
|
events.trigger('start', config);
|
||||||
|
navigation.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export APIs for plugins
|
// Export APIs for plugins
|
||||||
@@ -24581,7 +24582,11 @@ function updateNavigationPosition() {
|
|||||||
$('.navigation-next').css('margin-right', (bodyInnerWidth - pageWrapperWidth) + 'px');
|
$('.navigation-next').css('margin-right', (bodyInnerWidth - pageWrapperWidth) + 'px');
|
||||||
}
|
}
|
||||||
|
|
||||||
function preparePage() {
|
function notifyPageChange() {
|
||||||
|
events.trigger('page.change');
|
||||||
|
}
|
||||||
|
|
||||||
|
function preparePage(notify) {
|
||||||
var $bookBody = $('.book-body');
|
var $bookBody = $('.book-body');
|
||||||
var $bookInner = $bookBody.find('.body-inner');
|
var $bookInner = $bookBody.find('.body-inner');
|
||||||
var $pageWrapper = $bookInner.find('.page-wrapper');
|
var $pageWrapper = $bookInner.find('.page-wrapper');
|
||||||
@@ -24597,7 +24602,7 @@ function preparePage() {
|
|||||||
$bookBody.scrollTop(0);
|
$bookBody.scrollTop(0);
|
||||||
|
|
||||||
// Notify
|
// Notify
|
||||||
events.trigger('page.change');
|
if (notify !== false) notifyPageChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLeftClickEvent(e) {
|
function isLeftClickEvent(e) {
|
||||||
@@ -24656,13 +24661,14 @@ function init() {
|
|||||||
$(window).resize(updateNavigationPosition);
|
$(window).resize(updateNavigationPosition);
|
||||||
|
|
||||||
// Prepare current page
|
// Prepare current page
|
||||||
preparePage();
|
preparePage(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init: init,
|
init: init,
|
||||||
goNext: goNext,
|
goNext: goNext,
|
||||||
goPrev: goPrev
|
goPrev: goPrev,
|
||||||
|
notify: notifyPageChange
|
||||||
};
|
};
|
||||||
|
|
||||||
},{"./events":12,"./loading":15,"./state":19,"jquery":8,"url":7}],17:[function(require,module,exports){
|
},{"./events":12,"./loading":15,"./state":19,"jquery":8,"url":7}],17:[function(require,module,exports){
|
||||||
@@ -24749,7 +24755,7 @@ state.update = function(dom) {
|
|||||||
// Absolute url to the root of the book
|
// Absolute url to the root of the book
|
||||||
state.root = url.resolve(
|
state.root = url.resolve(
|
||||||
location.protocol+'//'+location.host,
|
location.protocol+'//'+location.host,
|
||||||
path.dirname(path.resolve(location.pathname, state.basePath))
|
path.dirname(path.resolve(location.pathname.replace(/\/$/, '/index.html'), state.basePath))
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -24916,7 +24922,7 @@ function updateButton(opts) {
|
|||||||
// Create button
|
// Create button
|
||||||
var $btn = $('<a>', {
|
var $btn = $('<a>', {
|
||||||
'class': 'btn',
|
'class': 'btn',
|
||||||
'text': opts.text,
|
'text': opts.text? ' ' + opts.text : '',
|
||||||
'aria-label': opts.label,
|
'aria-label': opts.label,
|
||||||
'href': '#'
|
'href': '#'
|
||||||
});
|
});
|
||||||
@@ -24955,6 +24961,8 @@ function updateButton(opts) {
|
|||||||
$result = $btn;
|
$result = $btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result.addClass('js-toolbar-action');
|
||||||
|
|
||||||
if (_.isNumber(opts.index) && opts.index >= 0) {
|
if (_.isNumber(opts.index) && opts.index >= 0) {
|
||||||
insertAt($toolbar, '.btn, .dropdown, h1', opts.index, $result);
|
insertAt($toolbar, '.btn, .dropdown, h1', opts.index, $result);
|
||||||
} else {
|
} else {
|
||||||
@@ -24964,6 +24972,7 @@ function updateButton(opts) {
|
|||||||
|
|
||||||
// Update all buttons
|
// Update all buttons
|
||||||
function updateAllButtons() {
|
function updateAllButtons() {
|
||||||
|
$('.js-toolbar-action').remove();
|
||||||
_.each(buttons, updateButton);
|
_.each(buttons, updateButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ function start(config) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
events.trigger('start', config);
|
events.trigger('start', config);
|
||||||
|
navigation.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export APIs for plugins
|
// Export APIs for plugins
|
||||||
|
|||||||
@@ -75,7 +75,11 @@ function updateNavigationPosition() {
|
|||||||
$('.navigation-next').css('margin-right', (bodyInnerWidth - pageWrapperWidth) + 'px');
|
$('.navigation-next').css('margin-right', (bodyInnerWidth - pageWrapperWidth) + 'px');
|
||||||
}
|
}
|
||||||
|
|
||||||
function preparePage() {
|
function notifyPageChange() {
|
||||||
|
events.trigger('page.change');
|
||||||
|
}
|
||||||
|
|
||||||
|
function preparePage(notify) {
|
||||||
var $bookBody = $('.book-body');
|
var $bookBody = $('.book-body');
|
||||||
var $bookInner = $bookBody.find('.body-inner');
|
var $bookInner = $bookBody.find('.body-inner');
|
||||||
var $pageWrapper = $bookInner.find('.page-wrapper');
|
var $pageWrapper = $bookInner.find('.page-wrapper');
|
||||||
@@ -91,7 +95,7 @@ function preparePage() {
|
|||||||
$bookBody.scrollTop(0);
|
$bookBody.scrollTop(0);
|
||||||
|
|
||||||
// Notify
|
// Notify
|
||||||
events.trigger('page.change');
|
if (notify !== false) notifyPageChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLeftClickEvent(e) {
|
function isLeftClickEvent(e) {
|
||||||
@@ -150,11 +154,12 @@ function init() {
|
|||||||
$(window).resize(updateNavigationPosition);
|
$(window).resize(updateNavigationPosition);
|
||||||
|
|
||||||
// Prepare current page
|
// Prepare current page
|
||||||
preparePage();
|
preparePage(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init: init,
|
init: init,
|
||||||
goNext: goNext,
|
goNext: goNext,
|
||||||
goPrev: goPrev
|
goPrev: goPrev,
|
||||||
|
notify: notifyPageChange
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ state.update = function(dom) {
|
|||||||
// Absolute url to the root of the book
|
// Absolute url to the root of the book
|
||||||
state.root = url.resolve(
|
state.root = url.resolve(
|
||||||
location.protocol+'//'+location.host,
|
location.protocol+'//'+location.host,
|
||||||
path.dirname(path.resolve(location.pathname, state.basePath))
|
path.dirname(path.resolve(location.pathname.replace(/\/$/, '/index.html'), state.basePath))
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ function updateButton(opts) {
|
|||||||
// Create button
|
// Create button
|
||||||
var $btn = $('<a>', {
|
var $btn = $('<a>', {
|
||||||
'class': 'btn',
|
'class': 'btn',
|
||||||
'text': opts.text,
|
'text': opts.text? ' ' + opts.text : '',
|
||||||
'aria-label': opts.label,
|
'aria-label': opts.label,
|
||||||
'href': '#'
|
'href': '#'
|
||||||
});
|
});
|
||||||
@@ -156,6 +156,8 @@ function updateButton(opts) {
|
|||||||
$result = $btn;
|
$result = $btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result.addClass('js-toolbar-action');
|
||||||
|
|
||||||
if (_.isNumber(opts.index) && opts.index >= 0) {
|
if (_.isNumber(opts.index) && opts.index >= 0) {
|
||||||
insertAt($toolbar, '.btn, .dropdown, h1', opts.index, $result);
|
insertAt($toolbar, '.btn, .dropdown, h1', opts.index, $result);
|
||||||
} else {
|
} else {
|
||||||
@@ -165,6 +167,7 @@ function updateButton(opts) {
|
|||||||
|
|
||||||
// Update all buttons
|
// Update all buttons
|
||||||
function updateAllButtons() {
|
function updateAllButtons() {
|
||||||
|
$('.js-toolbar-action').remove();
|
||||||
_.each(buttons, updateButton);
|
_.each(buttons, updateButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user