mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-10-02 15:08:11 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8f5aa680d | |||
| f2b585e446 | |||
| 78f91e0037 | |||
| 3f3c156697 | |||
| 4627bf5d1f | |||
| 93a144984a | |||
| 2d0784440c | |||
| 05a083437f | |||
| d4b5f59f92 | |||
| ff53fb6db0 | |||
| 534b3908cc | |||
| 7ea2369810 | |||
| 4d96ec10c1 | |||
| a37ee3457a | |||
| 6969bb9a5c |
@@ -61,3 +61,7 @@ Translators
|
|||||||
- @mjanda
|
- @mjanda
|
||||||
- Swedish
|
- Swedish
|
||||||
- Jacob Burenstam (@buren)
|
- Jacob Burenstam (@buren)
|
||||||
|
- Turkish
|
||||||
|
- Turan Konan (@turankonan)
|
||||||
|
- Catalan
|
||||||
|
- Esaú García Sánchez-Torija (@egasato)
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
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.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
|
## 2.6.5
|
||||||
- Fix support for plugins generating custom stylesheets (`styles-less` and `styles-sass`)
|
- Fix support for plugins generating custom stylesheets (`styles-less` and `styles-sass`)
|
||||||
- Fix glossary terms being replaced in script (ex: math)
|
- Fix glossary terms being replaced in script (ex: math)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ 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).
|
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 book easily online using [gitbook.com](https://www.gitbook.com), a desktop editor is [also available](https://www.gitbook.com/editor).
|
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.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Generator.prototype.getPDFTemplate = function(id) {
|
|||||||
|
|
||||||
// Custom PDF style
|
// Custom PDF style
|
||||||
if (this.styles.pdf) {
|
if (this.styles.pdf) {
|
||||||
stylesheets.push(fs.readFileSync(this.book.resolve(this.styles.pdf), { encoding: 'utf-8' }));
|
stylesheets.push(fs.readFileSync(this.book.resolveOutput(this.styles.pdf), { encoding: 'utf-8' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
tpl = juice(tpl, {
|
tpl = juice(tpl, {
|
||||||
|
|||||||
+26
-27
@@ -1,51 +1,50 @@
|
|||||||
var url = require("url");
|
var url = require('url');
|
||||||
var path = require("path");
|
var path = require('path');
|
||||||
|
|
||||||
// Is the link an external link
|
// Is the link an external link
|
||||||
var isExternal = function(href) {
|
function isExternal(href) {
|
||||||
try {
|
try {
|
||||||
return Boolean(url.parse(href).protocol);
|
return Boolean(url.parse(href).protocol);
|
||||||
} catch(err) { }
|
} catch(err) {
|
||||||
|
return false;
|
||||||
return false;
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// Return true if the link is relative
|
// Return true if the link is relative
|
||||||
var isRelative = function(href) {
|
function isRelative(href) {
|
||||||
try {
|
try {
|
||||||
var parsed = url.parse(href);
|
var parsed = url.parse(href);
|
||||||
|
|
||||||
return !!(!parsed.protocol && parsed.path);
|
return !!(!parsed.protocol && parsed.path);
|
||||||
} catch(err) {}
|
} catch(err) {
|
||||||
|
return true;
|
||||||
return true;
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// Return true if the link is an achor
|
// Return true if the link is an achor
|
||||||
var isAnchor = function(href) {
|
function isAnchor(href) {
|
||||||
try {
|
try {
|
||||||
var parsed = url.parse(href);
|
var parsed = url.parse(href);
|
||||||
return !!(!parsed.protocol && !parsed.path && parsed.hash);
|
return !!(!parsed.protocol && !parsed.path && parsed.hash);
|
||||||
} catch(err) {}
|
} catch(err) {
|
||||||
|
return false;
|
||||||
return false;
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// Normalize a path to be a link
|
// Normalize a path to be a link
|
||||||
var normalizeLink = function(s) {
|
function normalizeLink(s) {
|
||||||
return s.replace(/\\/g, "/");
|
return s.replace(/\\/g, '/');
|
||||||
};
|
}
|
||||||
|
|
||||||
// Relative to absolute path
|
// Relative to absolute path
|
||||||
// dir: directory parent of the file currently in rendering process
|
// dir: directory parent of the file currently in rendering process
|
||||||
// outdir: directory parent from the html output
|
// outdir: directory parent from the html output
|
||||||
|
function toAbsolute(_href, dir, outdir) {
|
||||||
var toAbsolute = function(_href, dir, outdir) {
|
|
||||||
if (isExternal(_href)) return _href;
|
if (isExternal(_href)) return _href;
|
||||||
|
|
||||||
// Path "_href" inside the base folder
|
// Path "_href" inside the base folder
|
||||||
var hrefInRoot = path.normalize(path.join(dir, _href));
|
var hrefInRoot = path.normalize(path.join(dir, _href));
|
||||||
if (_href[0] == "/") hrefInRoot = path.normalize(_href.slice(1));
|
if (_href[0] == '/') hrefInRoot = path.normalize(_href.slice(1));
|
||||||
|
|
||||||
// Make it relative to output
|
// Make it relative to output
|
||||||
_href = path.relative(outdir, hrefInRoot);
|
_href = path.relative(outdir, hrefInRoot);
|
||||||
@@ -54,22 +53,22 @@ var toAbsolute = function(_href, dir, outdir) {
|
|||||||
_href = normalizeLink(_href);
|
_href = normalizeLink(_href);
|
||||||
|
|
||||||
return _href;
|
return _href;
|
||||||
};
|
}
|
||||||
|
|
||||||
// Join links
|
// Join links
|
||||||
var join = function() {
|
function join() {
|
||||||
var _href = path.join.apply(path, arguments);
|
var _href = path.join.apply(path, arguments);
|
||||||
|
|
||||||
return normalizeLink(_href);
|
return normalizeLink(_href);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Change extension
|
// Change extension
|
||||||
var changeExtension = function(filename, newext) {
|
function changeExtension(filename, newext) {
|
||||||
return path.join(
|
return path.join(
|
||||||
path.dirname(filename),
|
path.dirname(filename),
|
||||||
path.basename(filename, path.extname(filename))+newext
|
path.basename(filename, path.extname(filename))+newext
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
isAnchor: isAnchor,
|
isAnchor: isAnchor,
|
||||||
|
|||||||
+4
-1
@@ -205,9 +205,12 @@ function normalizeHtml(src, options) {
|
|||||||
// Keep it as it is
|
// Keep it as it is
|
||||||
} else if (links.isRelative(href)) {
|
} else if (links.isRelative(href)) {
|
||||||
var parts = url.parse(href);
|
var parts = url.parse(href);
|
||||||
var absolutePath = links.join(options.base, parts.pathname);
|
|
||||||
|
var pathName = decodeURIComponent(parts.pathname);
|
||||||
var anchor = parts.hash || '';
|
var anchor = parts.hash || '';
|
||||||
|
|
||||||
|
// Calcul absolute path for this file (without the anchor)
|
||||||
|
var absolutePath = links.join(options.base, pathName);
|
||||||
|
|
||||||
// If is in navigation relative: transform as content
|
// If is in navigation relative: transform as content
|
||||||
if (options.navigation[absolutePath]) {
|
if (options.navigation[absolutePath]) {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gitbook",
|
"name": "gitbook",
|
||||||
"version": "2.6.5",
|
"version": "2.6.7",
|
||||||
"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",
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"LANGS_CHOOSE": "Seleccioni un idioma",
|
||||||
|
"GLOSSARY": "Glossari",
|
||||||
|
"GLOSSARY_INDEX": "Índex",
|
||||||
|
"GLOSSARY_OPEN": "Glossari",
|
||||||
|
"GITBOOK_LINK": "Publicat amb GitBook",
|
||||||
|
"SUMMARY": "Taula de contingut",
|
||||||
|
"SUMMARY_INTRODUCTION": "Introducció",
|
||||||
|
"SUMMARY_TOGGLE": "Taula de contingut",
|
||||||
|
"SEARCH_TOGGLE": "Cerca",
|
||||||
|
"SEARCH_PLACEHOLDER": "Escriu per cercar",
|
||||||
|
"FONTSETTINGS_TOGGLE": "Configuració de font",
|
||||||
|
"SHARE_TOGGLE": "Comparteix",
|
||||||
|
"SHARE_ON": "Comparteix en {{platform}}",
|
||||||
|
"FONTSETTINGS_WHITE": "Claro",
|
||||||
|
"FONTSETTINGS_SEPIA": "Sépia",
|
||||||
|
"FONTSETTINGS_NIGHT": "Noche",
|
||||||
|
"FONTSETTINGS_SANS": "Sans",
|
||||||
|
"FONTSETTINGS_SERIF": "Serif"
|
||||||
|
}
|
||||||
+6
-6
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"LANGS_CHOOSE": "言語を選択",
|
"LANGS_CHOOSE": "言語を選択",
|
||||||
"GLOSSARY": "用語集",
|
"GLOSSARY": "用語集",
|
||||||
"GLOSSARY_INDEX": "インデックス",
|
"GLOSSARY_INDEX": "索引",
|
||||||
"GLOSSARY_OPEN": "用語集",
|
"GLOSSARY_OPEN": "用語集",
|
||||||
"GITBOOK_LINK": "で公開 GitBook",
|
"GITBOOK_LINK": "GitBookで公開 ",
|
||||||
"SUMMARY": "目次",
|
"SUMMARY": "目次",
|
||||||
"SUMMARY_INTRODUCTION": "はじめに",
|
"SUMMARY_INTRODUCTION": "はじめに",
|
||||||
"SUMMARY_TOGGLE": "目次",
|
"SUMMARY_TOGGLE": "目次",
|
||||||
@@ -11,10 +11,10 @@
|
|||||||
"SEARCH_PLACEHOLDER": "検索すると入力",
|
"SEARCH_PLACEHOLDER": "検索すると入力",
|
||||||
"FONTSETTINGS_TOGGLE": "フォント設定",
|
"FONTSETTINGS_TOGGLE": "フォント設定",
|
||||||
"SHARE_TOGGLE": "シェア",
|
"SHARE_TOGGLE": "シェア",
|
||||||
"SHARE_ON": "でシェア {{platform}}",
|
"SHARE_ON": "{{platform}}でシェア",
|
||||||
"FONTSETTINGS_WHITE": "白",
|
"FONTSETTINGS_WHITE": "白",
|
||||||
"FONTSETTINGS_SEPIA": "Sepia",
|
"FONTSETTINGS_SEPIA": "セピア",
|
||||||
"FONTSETTINGS_NIGHT": "夜",
|
"FONTSETTINGS_NIGHT": "夜",
|
||||||
"FONTSETTINGS_SANS": "Sans",
|
"FONTSETTINGS_SANS": "ゴシック体",
|
||||||
"FONTSETTINGS_SERIF": "Serif"
|
"FONTSETTINGS_SERIF": "明朝体"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"LANGS_CHOOSE": "Dil seçimi",
|
||||||
|
"GLOSSARY": "Sözlük",
|
||||||
|
"GLOSSARY_INDEX": "Dizin",
|
||||||
|
"GLOSSARY_OPEN": "Sözlük",
|
||||||
|
"GITBOOK_LINK": "GitBook ile yayınla",
|
||||||
|
"SUMMARY": "İçindekiler",
|
||||||
|
"SUMMARY_INTRODUCTION": "Giriş",
|
||||||
|
"SUMMARY_TOGGLE": "İçindekiler",
|
||||||
|
"SEARCH_TOGGLE": "Arama",
|
||||||
|
"SEARCH_PLACEHOLDER": "Aramak istediğiniz",
|
||||||
|
"FONTSETTINGS_TOGGLE": "Font Ayarları",
|
||||||
|
"SHARE_TOGGLE": "Paylaş",
|
||||||
|
"SHARE_ON": "{{platform}} ile paylaş",
|
||||||
|
"FONTSETTINGS_WHITE": "Beyaz",
|
||||||
|
"FONTSETTINGS_SEPIA": "Sepya",
|
||||||
|
"FONTSETTINGS_NIGHT": "Karanlık",
|
||||||
|
"FONTSETTINGS_SANS": "Sans",
|
||||||
|
"FONTSETTINGS_SERIF": "Serif"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user