mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-27 04:29:05 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a9adb9440 | |||
| d8898b7a1f | |||
| bb7e081a37 | |||
| c3ffa5e0ef | |||
| 724bc2b59c | |||
| 178d2e2a48 | |||
| 4d710c129c | |||
| e4dbf62c0f | |||
| b0cd23fd34 | |||
| af5764bc3b | |||
| 6309da1214 | |||
| 38c9bfa357 | |||
| f194cb513c | |||
| 03ff892727 | |||
| 8cc0f64f54 | |||
| 532e8b0388 | |||
| 35b3d50012 | |||
| 72ff9996ce | |||
| 0759c4dd78 | |||
| 82a1a151e4 |
+5
-1
@@ -28,5 +28,9 @@ Translators
|
||||
- Andrey Akinshin (@AndreyAkinshin)
|
||||
- Norwegian
|
||||
- Knut Melvær (@kmelve)
|
||||
- Portuguese
|
||||
- Ryan O'Mullan (@RyanOM)
|
||||
- Spanish
|
||||
- Ryan O'Mullan (@RyanOM)
|
||||
- French
|
||||
- Samy Pessé (@SamyPesse)
|
||||
- Samy Pessé (@SamyPesse)
|
||||
|
||||
+35
@@ -1,5 +1,40 @@
|
||||
# Release notes
|
||||
|
||||
## 2.0.0-alpha.6
|
||||
- Add es and pt translations
|
||||
- Fix replacement of glossary terms
|
||||
|
||||
## 2.0.0-alpha.5
|
||||
- Fix copy of files/covers
|
||||
- Add back `finish:before` hook
|
||||
|
||||
## 2.0.0-alpha.4
|
||||
- Fix copy of cover for multilingal books
|
||||
|
||||
## 2.0.0-alpha.3
|
||||
- Norwegian translation
|
||||
- Load plugins from book in priority
|
||||
|
||||
## 2.0.0-alpha.3
|
||||
- Fix init command
|
||||
- Update parsers to fix spaces in summary (`gitbook-parsers@0.3.1`)
|
||||
|
||||
## 2.0.0-alpha.1
|
||||
- Externalize parsing into `gitbook-parsers` module
|
||||
- Supports AsciiDoc and reStructuredText
|
||||
- Hooks for page (`page:*`) are now deprecated, plugins should extend filters and blocks instead
|
||||
- Hooks `summary` and `glossary` (after and before) have been removed
|
||||
- Exercises and Quizzes are no longer parsed in the markdown parser
|
||||
- Support for more markdown extensions: `.markdown`, `.mdown`
|
||||
- Templates are rendered with nunjucks instead of swig, syntax is almost compatible, there is some changes with contexts and filters. `{{ super() }}` should be use instead of `{% parent %}`
|
||||
- Clean output folder on build without removing `.git` and `.svn`
|
||||
- MathJAX is no longer a default plugin
|
||||
- SVG images are converted to PNG during generation of ebooks
|
||||
- i18n in website and ebook (ru, it, de, fr)
|
||||
- New templating syntax
|
||||
- Content references (both internal and external)
|
||||
- Glossary terms are handled during generation (also in ebook format)
|
||||
|
||||
## 1.5.0
|
||||
- Fix `serve` command, broken by `1.4.2`
|
||||
- Add nicer `dark` theme :)
|
||||
|
||||
@@ -646,6 +646,11 @@ Book.prototype.parentRoot = function() {
|
||||
return this.root;
|
||||
};
|
||||
|
||||
// Return true if it's a sub-book
|
||||
Book.prototype.isSubBook = function() {
|
||||
return !!this.parent;
|
||||
};
|
||||
|
||||
// Resolve a path in book
|
||||
Book.prototype.resolve = function(p) {
|
||||
return path.resolve(this.root, p);
|
||||
|
||||
@@ -107,6 +107,8 @@ Configuration.prototype.load = function() {
|
||||
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"));
|
||||
}
|
||||
|
||||
that.options.gitbook = pkg.version;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ BaseGenerator.prototype.copyCover = function() {
|
||||
])
|
||||
.fail(function() {
|
||||
// If orignaly from multi-lang, try copy from parent
|
||||
if (!that.isMultilingual()) return;
|
||||
if (!that.book.isSubBook()) return;
|
||||
|
||||
return Q.all([
|
||||
fs.copy(path.join(that.book.parentRoot(), "cover.jpg"), path.join(that.options.output, "cover.jpg")),
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
var Q = require("q");
|
||||
var _ = require("lodash");
|
||||
var path = require("path");
|
||||
var tinylr = require('tiny-lr-fork');
|
||||
var tinylr = require('tiny-lr');
|
||||
var color = require('bash-color');
|
||||
|
||||
var Book = require("./book");
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ var Plugin = function(book, name) {
|
||||
// Type of plugins resources
|
||||
Plugin.RESOURCES = ["js", "css"];
|
||||
Plugin.HOOKS = [
|
||||
"init", "finish"
|
||||
"init", "finish", "finish:before"
|
||||
]
|
||||
|
||||
// Load from a name
|
||||
|
||||
+10
-2
@@ -78,7 +78,14 @@ function pregQuote( str ) {
|
||||
|
||||
// Adapt an html snippet to be relative to a base folder
|
||||
function normalizeHtml(src, options) {
|
||||
var $ = cheerio.load(src, { xmlMode: false});
|
||||
var $ = cheerio.load(src, {
|
||||
// We should parse html without trying to normalize too much
|
||||
xmlMode: false,
|
||||
|
||||
// SVG need some attributes to use uppercases
|
||||
lowerCaseAttributeNames: false,
|
||||
lowerCaseTags: false
|
||||
});
|
||||
var toConvert = [];
|
||||
var svgContent = {};
|
||||
var outputRoot = options.book.options.output;
|
||||
@@ -198,12 +205,13 @@ function normalizeHtml(src, options) {
|
||||
|
||||
$("*").each(function() {
|
||||
replaceText($, this, r, function(match) {
|
||||
// Add to files index in glossary
|
||||
if (!includedInFiles) {
|
||||
includedInFiles = true;
|
||||
term.files = term.files || [];
|
||||
term.files.push(options.navigation[options.input]);
|
||||
}
|
||||
return "<a href='"+links.toAbsolute("GLOSSARY.html", options.base, options.output)+"#"+term.id+"' class='glossary-term' title='"+term.description+"'>"+match+"</span>";
|
||||
return "<a href='"+links.toAbsolute("GLOSSARY.html", options.base, options.output)+"#"+term.id+"' class='glossary-term' title='"+term.description+"'>"+match+"</a>";
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitbook",
|
||||
"version": "2.0.0-alpha.3",
|
||||
"version": "2.0.0-alpha.6",
|
||||
"homepage": "https://www.gitbook.com",
|
||||
"description": "Library and cmd utility to generate GitBooks",
|
||||
"main": "lib/index.js",
|
||||
@@ -10,7 +10,7 @@
|
||||
"lodash": "2.4.1",
|
||||
"graceful-fs": "3.0.5",
|
||||
"resolve": "0.6.3",
|
||||
"fs-extra": "0.14.0",
|
||||
"fs-extra": "0.16.3",
|
||||
"fstream-ignore": "1.0.2",
|
||||
"gitbook-parsers": "0.3.1",
|
||||
"nunjucks": "git+https://github.com/SamyPesse/nunjucks.git#4019d1b7379372336b86ce1b0bf84352a2029747",
|
||||
@@ -23,14 +23,14 @@
|
||||
"gitbook-plugin-livereload": "0.0.1",
|
||||
"gaze": "~0.5.1",
|
||||
"send": "0.2.0",
|
||||
"tiny-lr-fork": "0.0.5",
|
||||
"tiny-lr": "0.1.5",
|
||||
"tmp": "0.0.24",
|
||||
"crc": "3.2.1",
|
||||
"bash-color": "0.0.3",
|
||||
"URIjs": "1.14.1",
|
||||
"request": "2.51.0",
|
||||
"npm": "2.4.1",
|
||||
"dom-serializer": "git+https://github.com/SamyPesse/dom-serializer.git#58d8ea24b9b7b4137ee5f30a41abce4d7c4a922a"
|
||||
"dom-serializer": "git+https://github.com/SamyPesse/dom-serializer.git#57ed9a2c3dfa964022ce7d71859c558ba7721785"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "1.18.2",
|
||||
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
# Other Title
|
||||
|
||||
A description
|
||||
This is a description, it's simple, no ?
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
var path = require('path');
|
||||
var _ = require('lodash');
|
||||
var assert = require('assert');
|
||||
var cheerio = require('cheerio');
|
||||
|
||||
var fs = require("fs");
|
||||
var fsUtil = require("../lib/utils/fs");
|
||||
|
||||
|
||||
describe('Glossary Generation', function () {
|
||||
it('should correctly replace glossary terms', function(done) {
|
||||
testGeneration(books[0], "website", function(output) {
|
||||
var content = fs.readFileSync(path.join(output, "index.html"), { encoding: "utf8" });
|
||||
var $ = cheerio.load(content);
|
||||
|
||||
var $body = $(".page-inner");
|
||||
var $a = $("a[href='GLOSSARY.html#description']");
|
||||
assert($a.length == 1);
|
||||
assert($a.text() == "description");
|
||||
}, done);
|
||||
});
|
||||
});
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
"SEARCH_PLACEHOLDER": "Suchbegriff eingeben",
|
||||
"FONTSETTINGS_TOGGLE": "Schrifteinstellungen",
|
||||
"SHARE_TOGGLE": "Teilen",
|
||||
"SHARE_ON": "auf __platform__ teilen",
|
||||
"SHARE_ON": "Auf __platform__ teilen",
|
||||
"FONTSETTINGS_WHITE": "Hell",
|
||||
"FONTSETTINGS_SEPIA": "Sepia",
|
||||
"FONTSETTINGS_NIGHT": "Nacht"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"LANGS_CHOOSE": "Seleccione un idioma",
|
||||
"GLOSSARY": "Glosario",
|
||||
"GLOSSARY_INDEX": "Índice",
|
||||
"GLOSSARY_OPEN": "Glosario",
|
||||
"GITBOOK_LINK": "Publicado con GitBook",
|
||||
"SUMMARY": "Tabla de contenido",
|
||||
"SUMMARY_INTRODUCTION": "Introducción",
|
||||
"SUMMARY_TOGGLE": "Tabla de contenido",
|
||||
"SEARCH_TOGGLE": "Busca",
|
||||
"SEARCH_PLACEHOLDER": "Escribe para buscar",
|
||||
"FONTSETTINGS_TOGGLE": "Configuración de fuente",
|
||||
"SHARE_TOGGLE": "Comparte",
|
||||
"SHARE_ON": "Comparte en __platform__",
|
||||
"FONTSETTINGS_WHITE": "Claro",
|
||||
"FONTSETTINGS_SEPIA": "Sépia",
|
||||
"FONTSETTINGS_NIGHT": "Noche"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"LANGS_CHOOSE": "Escolher sua língua",
|
||||
"GLOSSARY": "Glossário",
|
||||
"GLOSSARY_INDEX": "Índice",
|
||||
"GLOSSARY_OPEN": "Glossário",
|
||||
"GITBOOK_LINK": "Publicado com GitBook",
|
||||
"SUMMARY": "Tabela de conteúdos",
|
||||
"SUMMARY_INTRODUCTION": "Introdução",
|
||||
"SUMMARY_TOGGLE": "Tabela de conteúdos",
|
||||
"SEARCH_TOGGLE": "Pesquise",
|
||||
"SEARCH_PLACEHOLDER": "Escreva para pesquisar",
|
||||
"FONTSETTINGS_TOGGLE": "Configurações de fonte",
|
||||
"SHARE_TOGGLE": "Compartilhar",
|
||||
"SHARE_ON": "Compartilhar no __platform__",
|
||||
"FONTSETTINGS_WHITE": "Claro",
|
||||
"FONTSETTINGS_SEPIA": "Sépia",
|
||||
"FONTSETTINGS_NIGHT": "Noite"
|
||||
}
|
||||
Reference in New Issue
Block a user