mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-27 04:29:05 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 695bda312c | |||
| 144bd4c97a | |||
| e105983cf8 | |||
| ea3afbed75 | |||
| d563abe3df | |||
| 70fd4ded29 |
@@ -5,6 +5,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
## 3.2.0 (pre)
|
||||
- Switch markdown parser from `kramed` to `markup-it`
|
||||
- Fix support of `|` in tables
|
||||
- Fix access to `output.name` in templating
|
||||
- Improve options of default search indexer (keywords, disabling per pages)
|
||||
- Improve pertinence of search results
|
||||
|
||||
## 3.1.1
|
||||
- Fix order of plugins during loading
|
||||
|
||||
@@ -6,10 +6,10 @@ module.exports = {
|
||||
title: 'GitBook Toolchain Documentation',
|
||||
|
||||
// Enforce use of GitBook v3
|
||||
gitbook: '>=3.0.0-pre.0',
|
||||
gitbook: '3.1.1',
|
||||
|
||||
// Use the "official" theme
|
||||
plugins: ['theme-official', 'sitemap'],
|
||||
plugins: ['theme-official@2.1.1', '-sharing', '-fontsettings', 'sitemap'],
|
||||
|
||||
variables: {
|
||||
version: pkg.version
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/* Reduce size of logo to allow long versions like 3.0.0-pre.1 */
|
||||
.gb-page-header .container .logo h1 {
|
||||
font-size: 24px ;
|
||||
}
|
||||
@@ -3,12 +3,12 @@ var encodePage = require('./encodePage');
|
||||
var encodeFile = require('./encodeFile');
|
||||
|
||||
/**
|
||||
Return a JSON representation of a book with a specific file
|
||||
|
||||
@param {Book} output
|
||||
@param {Page} page
|
||||
@return {Object}
|
||||
*/
|
||||
* Return a JSON representation of a book with a specific file
|
||||
*
|
||||
* @param {Book} output
|
||||
* @param {Page} page
|
||||
* @return {Object}
|
||||
*/
|
||||
function encodeBookWithPage(book, page) {
|
||||
var file = page.getFile();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
var encodeBook = require('./encodeBook');
|
||||
|
||||
/**
|
||||
Encode an output to JSON
|
||||
|
||||
@param {Output}
|
||||
@return {Object}
|
||||
*/
|
||||
* Encode an output to JSON
|
||||
*
|
||||
* @param {Output}
|
||||
* @return {Object}
|
||||
*/
|
||||
function encodeOutputToJson(output) {
|
||||
var book = output.getBook();
|
||||
var generator = output.getGenerator();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
var encodeOutput = require('./encodeOutput');
|
||||
var encodePage = require('./encodePage');
|
||||
var encodeFile = require('./encodeFile');
|
||||
|
||||
/**
|
||||
* Return a JSON representation of a book with a specific file
|
||||
*
|
||||
* @param {Book} output
|
||||
* @param {Page} page
|
||||
* @return {Object}
|
||||
*/
|
||||
function encodeOutputWithPage(output, page) {
|
||||
var file = page.getFile();
|
||||
var book = output.getBook();
|
||||
|
||||
var result = encodeOutput(output);
|
||||
result.page = encodePage(page, book.getSummary());
|
||||
result.file = encodeFile(file);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = encodeOutputWithPage;
|
||||
@@ -2,6 +2,7 @@
|
||||
module.exports = {
|
||||
encodeOutput: require('./encodeOutput'),
|
||||
encodeBookWithPage: require('./encodeBookWithPage'),
|
||||
encodeOutputWithPage: require('./encodeOutputWithPage'),
|
||||
encodeBook: require('./encodeBook'),
|
||||
encodeFile: require('./encodeFile'),
|
||||
encodePage: require('./encodePage'),
|
||||
|
||||
@@ -10,12 +10,12 @@ var createTemplateEngine = require('./createTemplateEngine');
|
||||
var callPageHook = require('./callPageHook');
|
||||
|
||||
/**
|
||||
Prepare and generate HTML for a page
|
||||
|
||||
@param {Output} output
|
||||
@param {Page} page
|
||||
@return {Promise<Page>}
|
||||
*/
|
||||
* Prepare and generate HTML for a page
|
||||
*
|
||||
* @param {Output} output
|
||||
* @param {Page} page
|
||||
* @return {Promise<Page>}
|
||||
*/
|
||||
function generatePage(output, page) {
|
||||
var book = output.getBook();
|
||||
var engine = createTemplateEngine(output);
|
||||
@@ -27,7 +27,7 @@ function generatePage(output, page) {
|
||||
var file = resultPage.getFile();
|
||||
var filePath = file.getPath();
|
||||
var parser = file.getParser();
|
||||
var context = JSONUtils.encodeBookWithPage(book, resultPage);
|
||||
var context = JSONUtils.encodeOutputWithPage(output, resultPage);
|
||||
|
||||
if (!parser) {
|
||||
return Promise.reject(error.FileNotParsableError({
|
||||
|
||||
@@ -7,11 +7,11 @@ var getModifiers = require('../getModifiers');
|
||||
var JSON_VERSION = '3';
|
||||
|
||||
/**
|
||||
Write a page as a json file
|
||||
|
||||
@param {Output} output
|
||||
@param {Page} page
|
||||
*/
|
||||
* Write a page as a json file
|
||||
*
|
||||
* @param {Output} output
|
||||
* @param {Page} page
|
||||
*/
|
||||
function onPage(output, page) {
|
||||
var file = page.getFile();
|
||||
var readme = output.getBook().getReadme().getFile();
|
||||
|
||||
@@ -12,11 +12,11 @@ var createTemplateEngine = require('./createTemplateEngine');
|
||||
var fileToOutput = require('../helper/fileToOutput');
|
||||
|
||||
/**
|
||||
Write a page as a json file
|
||||
|
||||
@param {Output} output
|
||||
@param {Page} page
|
||||
*/
|
||||
* Write a page as a json file
|
||||
*
|
||||
* @param {Output} output
|
||||
* @param {Page} page
|
||||
*/
|
||||
function onPage(output, page) {
|
||||
var options = output.getOptions();
|
||||
var prefix = options.get('prefix');
|
||||
@@ -40,7 +40,7 @@ function onPage(output, page) {
|
||||
return Modifiers.modifyHTML(page, getModifiers(output, page))
|
||||
.then(function(resultPage) {
|
||||
// Generate the context
|
||||
var context = JSONUtils.encodeBookWithPage(output.getBook(), resultPage);
|
||||
var context = JSONUtils.encodeOutputWithPage(output, resultPage);
|
||||
context.plugins = {
|
||||
resources: Plugins.listResources(plugins, resources).toJS()
|
||||
};
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitbook",
|
||||
"version": "3.2.0-pre.0",
|
||||
"version": "3.2.0-pre.1",
|
||||
"homepage": "https://www.gitbook.com",
|
||||
"description": "Library and cmd utility to generate GitBooks",
|
||||
"main": "lib/index.js",
|
||||
@@ -22,11 +22,11 @@
|
||||
"fresh-require": "1.0.3",
|
||||
"front-matter": "^2.1.0",
|
||||
"gitbook-asciidoc": "1.2.2",
|
||||
"gitbook-markdown": "2.0.0",
|
||||
"gitbook-markdown": "2.0.1",
|
||||
"gitbook-plugin-fontsettings": "2.0.0",
|
||||
"gitbook-plugin-highlight": "2.0.2",
|
||||
"gitbook-plugin-livereload": "0.0.1",
|
||||
"gitbook-plugin-lunr": "1.1.0",
|
||||
"gitbook-plugin-lunr": "1.2.0",
|
||||
"gitbook-plugin-search": "2.2.1",
|
||||
"gitbook-plugin-sharing": "1.0.2",
|
||||
"gitbook-plugin-theme-default": "1.0.4",
|
||||
|
||||
Reference in New Issue
Block a user