mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-26 12:18:01 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 04d8ada281 | |||
| 59a5e87a6e | |||
| d8f5aa680d | |||
| f2b585e446 | |||
| 78f91e0037 | |||
| 3f3c156697 | |||
| 4627bf5d1f | |||
| 93a144984a | |||
| 2d0784440c | |||
| 05a083437f | |||
| d4b5f59f92 | |||
| ff53fb6db0 | |||
| 534b3908cc | |||
| 7ea2369810 | |||
| 4d96ec10c1 | |||
| a37ee3457a | |||
| 6969bb9a5c |
@@ -61,3 +61,7 @@ Translators
|
||||
- @mjanda
|
||||
- Swedish
|
||||
- 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.
|
||||
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
|
||||
- Fix support for plugins generating custom stylesheets (`styles-less` and `styles-sass`)
|
||||
- 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).
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ Generator.prototype.getPDFTemplate = function(id) {
|
||||
|
||||
// Custom PDF style
|
||||
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, {
|
||||
|
||||
+26
-27
@@ -1,51 +1,50 @@
|
||||
var url = require("url");
|
||||
var path = require("path");
|
||||
var url = require('url');
|
||||
var path = require('path');
|
||||
|
||||
// Is the link an external link
|
||||
var isExternal = function(href) {
|
||||
function isExternal(href) {
|
||||
try {
|
||||
return Boolean(url.parse(href).protocol);
|
||||
} catch(err) { }
|
||||
|
||||
return false;
|
||||
};
|
||||
} catch(err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Return true if the link is relative
|
||||
var isRelative = function(href) {
|
||||
function isRelative(href) {
|
||||
try {
|
||||
var parsed = url.parse(href);
|
||||
|
||||
return !!(!parsed.protocol && parsed.path);
|
||||
} catch(err) {}
|
||||
|
||||
return true;
|
||||
};
|
||||
} catch(err) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Return true if the link is an achor
|
||||
var isAnchor = function(href) {
|
||||
function isAnchor(href) {
|
||||
try {
|
||||
var parsed = url.parse(href);
|
||||
return !!(!parsed.protocol && !parsed.path && parsed.hash);
|
||||
} catch(err) {}
|
||||
|
||||
return false;
|
||||
};
|
||||
} catch(err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize a path to be a link
|
||||
var normalizeLink = function(s) {
|
||||
return s.replace(/\\/g, "/");
|
||||
};
|
||||
function normalizeLink(s) {
|
||||
return s.replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
// Relative to absolute path
|
||||
// dir: directory parent of the file currently in rendering process
|
||||
// outdir: directory parent from the html output
|
||||
|
||||
var toAbsolute = function(_href, dir, outdir) {
|
||||
function toAbsolute(_href, dir, outdir) {
|
||||
if (isExternal(_href)) return _href;
|
||||
|
||||
// Path "_href" inside the base folder
|
||||
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
|
||||
_href = path.relative(outdir, hrefInRoot);
|
||||
@@ -54,22 +53,22 @@ var toAbsolute = function(_href, dir, outdir) {
|
||||
_href = normalizeLink(_href);
|
||||
|
||||
return _href;
|
||||
};
|
||||
}
|
||||
|
||||
// Join links
|
||||
var join = function() {
|
||||
function join() {
|
||||
var _href = path.join.apply(path, arguments);
|
||||
|
||||
return normalizeLink(_href);
|
||||
};
|
||||
|
||||
// Change extension
|
||||
var changeExtension = function(filename, newext) {
|
||||
function changeExtension(filename, newext) {
|
||||
return path.join(
|
||||
path.dirname(filename),
|
||||
path.basename(filename, path.extname(filename))+newext
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isAnchor: isAnchor,
|
||||
|
||||
+4
-1
@@ -205,9 +205,12 @@ function normalizeHtml(src, options) {
|
||||
// Keep it as it is
|
||||
} else if (links.isRelative(href)) {
|
||||
var parts = url.parse(href);
|
||||
var absolutePath = links.join(options.base, parts.pathname);
|
||||
|
||||
var pathName = decodeURIComponent(parts.pathname);
|
||||
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 (options.navigation[absolutePath]) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitbook",
|
||||
"version": "2.6.5",
|
||||
"version": "2.6.8",
|
||||
"homepage": "https://www.gitbook.com",
|
||||
"description": "Library and cmd utility to generate GitBooks",
|
||||
"main": "lib/index.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"nunjucks": "2.2.0",
|
||||
"nunjucks-autoescape": "1.0.0",
|
||||
"nunjucks-filter": "1.0.0",
|
||||
"i18n": "0.5.0",
|
||||
"i18n": "GitbookIO/i18n-node#f26fbfa6b1d7a3bb086ff7849ca262f58a30255b",
|
||||
"semver": "5.0.1",
|
||||
"npmi": "0.1.1",
|
||||
"cheerio": "0.19.0",
|
||||
|
||||
@@ -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": "言語を選択",
|
||||
"GLOSSARY": "用語集",
|
||||
"GLOSSARY_INDEX": "インデックス",
|
||||
"GLOSSARY_INDEX": "索引",
|
||||
"GLOSSARY_OPEN": "用語集",
|
||||
"GITBOOK_LINK": "で公開 GitBook",
|
||||
"GITBOOK_LINK": "GitBookで公開 ",
|
||||
"SUMMARY": "目次",
|
||||
"SUMMARY_INTRODUCTION": "はじめに",
|
||||
"SUMMARY_TOGGLE": "目次",
|
||||
@@ -11,10 +11,10 @@
|
||||
"SEARCH_PLACEHOLDER": "検索すると入力",
|
||||
"FONTSETTINGS_TOGGLE": "フォント設定",
|
||||
"SHARE_TOGGLE": "シェア",
|
||||
"SHARE_ON": "でシェア {{platform}}",
|
||||
"SHARE_ON": "{{platform}}でシェア",
|
||||
"FONTSETTINGS_WHITE": "白",
|
||||
"FONTSETTINGS_SEPIA": "Sepia",
|
||||
"FONTSETTINGS_SEPIA": "セピア",
|
||||
"FONTSETTINGS_NIGHT": "夜",
|
||||
"FONTSETTINGS_SANS": "Sans",
|
||||
"FONTSETTINGS_SERIF": "Serif"
|
||||
"FONTSETTINGS_SANS": "ゴシック体",
|
||||
"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