mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-26 12:18:01 +00:00
Compare commits
6 Commits
2.5.0-beta.7
...
2.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ab386ae35 | |||
| 0abbfde912 | |||
| 0521defb63 | |||
| ea4d96610f | |||
| 4bc56564b4 | |||
| 013f7f09da |
@@ -2,6 +2,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## 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`
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitbook",
|
||||
"version": "2.5.0-beta.7",
|
||||
"version": "2.5.0",
|
||||
"homepage": "https://www.gitbook.com",
|
||||
"description": "Library and cmd utility to generate GitBooks",
|
||||
"main": "lib/index.js",
|
||||
|
||||
@@ -24426,7 +24426,7 @@ var gitbook = {
|
||||
// Modules mapping for plugins
|
||||
var MODULES = {
|
||||
'gitbook': gitbook,
|
||||
'jQuery': $,
|
||||
'jquery': $,
|
||||
'lodash': _
|
||||
};
|
||||
|
||||
@@ -24435,6 +24435,7 @@ window.$ = $;
|
||||
window.jQuery = $;
|
||||
window.require = function(mods, fn) {
|
||||
mods = _.map(mods, function(mod) {
|
||||
mod = mod.toLowerCase();
|
||||
if (!MODULES[mod]) {
|
||||
throw new Error('GitBook module '+mod+' doesn\'t exist');
|
||||
}
|
||||
@@ -24735,10 +24736,21 @@ state.update = function(dom) {
|
||||
state.$book = $book;
|
||||
state.level = $book.data('level');
|
||||
state.basePath = $book.data('basepath');
|
||||
|
||||
// Date of build
|
||||
state.revision = $book.data('revision');
|
||||
|
||||
// Original path of the file
|
||||
state.filepath = $book.data('filepath');
|
||||
|
||||
// Title of the chapter
|
||||
state.chapterTitle = $book.data('chapter-title');
|
||||
|
||||
// Absolute url to the root of the book
|
||||
state.root = url.resolve(location.origin, path.dirname(path.resolve(location.pathname, state.basePath)));
|
||||
state.root = url.resolve(
|
||||
location.protocol+'//'+location.host,
|
||||
path.dirname(path.resolve(location.pathname, state.basePath))
|
||||
);
|
||||
};
|
||||
|
||||
state.update($);
|
||||
|
||||
@@ -59,7 +59,7 @@ var gitbook = {
|
||||
// Modules mapping for plugins
|
||||
var MODULES = {
|
||||
'gitbook': gitbook,
|
||||
'jQuery': $,
|
||||
'jquery': $,
|
||||
'lodash': _
|
||||
};
|
||||
|
||||
@@ -68,6 +68,7 @@ window.$ = $;
|
||||
window.jQuery = $;
|
||||
window.require = function(mods, fn) {
|
||||
mods = _.map(mods, function(mod) {
|
||||
mod = mod.toLowerCase();
|
||||
if (!MODULES[mod]) {
|
||||
throw new Error('GitBook module '+mod+' doesn\'t exist');
|
||||
}
|
||||
|
||||
@@ -10,10 +10,21 @@ state.update = function(dom) {
|
||||
state.$book = $book;
|
||||
state.level = $book.data('level');
|
||||
state.basePath = $book.data('basepath');
|
||||
|
||||
// Date of build
|
||||
state.revision = $book.data('revision');
|
||||
|
||||
// Original path of the file
|
||||
state.filepath = $book.data('filepath');
|
||||
|
||||
// Title of the chapter
|
||||
state.chapterTitle = $book.data('chapter-title');
|
||||
|
||||
// Absolute url to the root of the book
|
||||
state.root = url.resolve(location.origin, path.dirname(path.resolve(location.pathname, state.basePath)));
|
||||
state.root = url.resolve(
|
||||
location.protocol+'//'+location.host,
|
||||
path.dirname(path.resolve(location.pathname, state.basePath))
|
||||
);
|
||||
};
|
||||
|
||||
state.update($);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{% block description %}{% if progress.current.level == "0" %}{{ description }}{% endif %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="book" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
|
||||
<div class="book" data-level="{{ progress.current.level }}" data-chapter-title="{{ progress.current.title }}" data-filepath="{{ progress.current.path }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
|
||||
{% include "includes/summary.html" %}
|
||||
<div class="book-body">
|
||||
<div class="body-inner">
|
||||
|
||||
Reference in New Issue
Block a user