Compare commits

...

32 Commits

Author SHA1 Message Date
Aaron O'Mullan 799815d85a Bump version to 0.4.2 2014-05-01 16:17:05 -07:00
Samy Pessé 2946246834 Fix #191: remove log for changes in files 2014-05-01 18:55:45 +02:00
Samy Pessé 6d276d1e79 Add option to remove home link 2014-05-01 18:53:49 +02:00
Samy Pessé 6a3a369b3e Add options to remove sharing links 2014-05-01 18:37:30 +02:00
Samy Pessé 5d8afa2135 Merge pull request #196 from mrpotes/new-plugins
New plugins
2014-05-01 18:33:30 +02:00
Samy Pessé ab3e6aa8ce Fix font-size for titles in markdown content 2014-05-01 18:29:42 +02:00
James Phillpotts 822092736e New plugins 2014-05-01 17:00:38 +01:00
Samy Pessé 7497acd2e3 Center navigation button on mobile on start page 2014-05-01 17:37:38 +02:00
Samy Pessé ae137885b8 Fix book content padding on mobile 2014-05-01 17:27:03 +02:00
Samy Pessé b964cc7009 Fix #162: hide watch/star buttons on mobile 2014-05-01 17:16:09 +02:00
Samy Pessé c2ea126c5f Fix #182: Replace all book body when page changes 2014-05-01 14:05:14 +02:00
Samy Pessé b668dba479 Update gaze version to 0.5.1 2014-05-01 13:26:50 +02:00
Samy Pessé 2cae5a0310 Secure .book position 2014-05-01 13:26:19 +02:00
Samy Pessé b6a0f3ff67 Fix #164: use position absolute instead of fixed 2014-04-30 17:01:25 +02:00
Samy Pessé fa00b52fb5 Fix #127: add configuration for changing links in sidebar 2014-04-30 16:46:24 +02:00
Samy Pessé 2999d90907 Merge pull request #188 from snipe/feature/json-doc
Added quotes for JSON example, per #127
2014-04-30 12:48:28 +02:00
snipe b6696bcad2 Added quotes for JSON example, per #127 2014-04-30 06:46:28 -04:00
Samy Pessé 728c87c525 Merge pull request #187 from snipe/feature/typo-fixes
Fixed typos
2014-04-30 12:05:12 +02:00
snipe ace394ee2d Fixed typos 2014-04-30 05:28:18 -04:00
Samy Pessé 076ee98f64 Fix #186: Plugins that don't have assets should be skipped 2014-04-30 11:15:01 +02:00
Samy Pessé 2e472654ca Fix error when calling hooks in site generation 2014-04-30 10:54:45 +02:00
Aaron O'Mullan d46bd14678 0.4.1 2014-04-29 10:23:54 -07:00
Samy Pessé b3e5b3d106 Fix #183: normalize hooks and transformation of page (content, progress, ..° 2014-04-29 17:45:54 +02:00
Samy Pessé b830ef5dca Merge pull request #179 from erixtekila/master
Update README.md
2014-04-29 08:23:33 +02:00
Eric Priou 45326c4ad2 Update README.md 2014-04-29 03:45:03 +02:00
Aaron O'Mullan 603b61e8c8 Bump version to 0.4.0 2014-04-28 13:26:40 -07:00
Samy Pessé efb066c8e3 Update doc about how to configure gitbook 2014-04-28 20:45:10 +02:00
Samy Pessé c30db427b1 Remove some options from command line (moved to book.json) 2014-04-28 20:33:25 +02:00
Samy Pessé 23056fc85d Use a global configuration file for a book (default to book.json) 2014-04-28 20:29:36 +02:00
Samy Pessé 5f1bfc0280 Fix #163: Move logic of git infos extraction to lib 2014-04-28 20:16:30 +02:00
Samy Pessé b715901f92 Add hooks "page:before" and "page:after" 2014-04-28 19:56:40 +02:00
Samy Pessé 38fea06cf9 Use hook to allow plugins to edit page content during generation (Fixes #176) 2014-04-28 17:21:06 +02:00
23 changed files with 290 additions and 163 deletions
+52 -8
View File
@@ -30,14 +30,55 @@ $ gitbook build ./repository --output=./outputFolder
Options for commands `build` and `serve` are:
```
-t, --title <name> Name of the book to generate, defaults to repo name
-i, --intro <intro> Description of the book to generate
-g, --github <repo_path> ID of github repo like : username/repo
-o, --output <directory> Path to output directory, defaults to ./_book
-f, --format <name> Change generation format, defaults to site, availables are: site, page, pdf, json
--githubHost <url> The url of the github host (defaults to https://github.com/)
--plugins <plugins> List of plugins to use separated by ","
--pluginsConfig <json file> JSON File containing plugins configuration
--config <config file> Configuration file to use, defaults to book.json
```
GitBook load the default configuration from a `book.json` file in the repository if it exists.
Here are the options that can be stored in this file:
```
{
// Folders to use for output (caution: it override the value from the command line)
"output": null,
// Generator to use for building (caution: it override the value from the command line)
"generator": "site",
// Book title and description (defaults are extracted from the README)
"title": null,
"description": null,
// GitHub informations (defaults are extracted using git)
"github": null,
"githubHost": "https://github.com/",
// Plugins list, can contain "-name" for removing default plugins
"plugins": [],
// Global configuration for plugins
"pluginsConfig": {},
// Links in template (null: default, false: remove, string: new value)
"links": {
// Link to home in the top-left corner
"home": null,
// Links in top of sidebar
"about": null,
"issues": null,
"edit": null,
// Sharing links
"sharing": {
"google": null,
"facebook": null,
"twitter": null
}
}
}
```
You can publish your books to our index by visiting [GitBook.io](http://www.gitbook.io)
@@ -137,7 +178,7 @@ GitBook will read the `.gitignore`, `.bookignore` and `.ignore` files to get a l
#### Plugins
Plugins can used to extend your book functionnalities. Read [GitbookIO/plugin](https://github.com/GitbookIO/plugin) for more informations about how to build a plugin for gitbook.
Plugins can used to extend your book's functionality. Read [GitbookIO/plugin](https://github.com/GitbookIO/plugin) for more information about how to build a plugin for gitbook.
##### Default plugins:
@@ -148,5 +189,8 @@ Plugins can used to extend your book functionnalities. Read [GitbookIO/plugin](h
* [Google Analytics](https://github.com/GitbookIO/plugin-ga): Google Analytics tracking for your book
* [Disqus](https://github.com/GitbookIO/plugin-disqus): Disqus comments integration in your book
* [Transform comments to notes](https://github.com/erixtekila/gitbook-plugin-comments): Allow markdown comments to be inserted in HTML output
* [Transform annoted quotes to notes](https://github.com/erixtekila/gitbook-plugin-richquotes): Allow extra markdown markup to render blockquotes as nice notes
* [Send code to console](https://github.com/erixtekila/gitbook-plugin-toconsole): Evaluate javascript blockin the browser inspector's console
* [Revealable sections](https://github.com/mrpotes/gitbook-plugin-reveal): Reveal sections of the page using buttons made from the first title in each section
* [Markdown within HTML](https://github.com/mrpotes/gitbook-plugin-nestedmd): Process markdown within HTML blocks - allows custom layout options for individual pages
* [Bootstrap JavaScript plugins](https://github.com/mrpotes/gitbook-plugin-bootstrapjs): Use the [Bootstrap JavaScript plugins](http://getbootstrap.com/javascript) in your online GitBook
+9 -36
View File
@@ -12,12 +12,7 @@ var buildCommand = function(command) {
return command
.option('-o, --output <directory>', 'Path to output directory, defaults to ./_book')
.option('-f, --format <name>', 'Change generation format, defaults to site, availables are: '+_.keys(generators).join(", "))
.option('-t, --title <name>', 'Name of the book to generate, default is extracted from readme')
.option('-i, --intro <intro>', 'Description of the book to generate, default is extracted from readme')
.option('--plugins <plugins>', 'List of plugins to use separated by ","')
.option('--pluginsConfig <json file>', 'JSON File containing plugins configuration')
.option('-g, --github <repo_path>', 'ID of github repo like : username/repo')
.option('--githubHost <url>', 'The url of the github host (defaults to https://github.com/');
.option('--config <config file>', 'Configuration file to use, defualt to book.json')
};
@@ -26,37 +21,15 @@ var makeBuildFunc = function(converter) {
dir = dir || process.cwd();
outputDir = options.output;
// Read plugins config
var pluginsConfig = {};
if (options.pluginsConfig) {
pluginsConfig = JSON.parse(fs.readFileSync(options.pluginsConfig))
}
console.log('Starting build ...');
// Get repo's URL
return utils.gitURL(dir)
.then(function(url) {
// Get ID of repo
return utils.githubID(url);
}, function(err) {
return null;
})
.then(function(repoID) {
return converter(
_.extend({}, options || {}, {
input: dir,
output: outputDir,
title: options.title,
description: options.intro,
github: options.github || repoID,
githubHost: options.githubHost,
generator: options.format,
plugins: options.plugins,
pluginsConfig: pluginsConfig
})
);
})
return converter(
_.extend({}, options || {}, {
input: dir,
output: outputDir,
generator: options.format,
configFile: options.config
})
)
.then(function(output) {
console.log("Successfuly built !");
return output;
+1 -1
View File
@@ -46,7 +46,7 @@ build.command(prog.command('serve [source_dir]'))
if (!options.watch) return;
return utils.watch(_options.input)
.then(function(filepath) {
console.log("Restart after change in "+path.relative(dir, filepath));
console.log("Restart after change in files");
console.log('');
return generate();
})
-54
View File
@@ -4,60 +4,9 @@ var _ = require('lodash');
var http = require('http');
var send = require('send');
var cp = require('child_process');
var path = require('path');
var url = require('url');
var Gaze = require('gaze').Gaze;
// Get the remote of a given repo
function gitURL(path) {
var d = Q.defer();
cp.exec("git config --get remote.origin.url", {
cwd: path,
env: process.env,
}, function(err, stdout, stderr) {
if(err) {
return d.reject(err);
}
return d.resolve(stdout);
});
return d.promise
.then(function(output) {
return output.replace(/(\r\n|\n|\r)/gm, "");
});
}
// Poorman's parsing
// Parse a git URL to a github ID : username/reponame
function githubID(_url) {
// Remove .git if it's in _url
var sliceEnd = _url.slice(-4) === '.git' ? -4 : _url.length;
// Detect HTTPS repos
var parsed = url.parse(_url);
if(parsed.protocol === 'https:' && parsed.host === 'github.com') {
return parsed.path.slice(1, sliceEnd);
}
// Detect SSH repos
if(_url.indexOf('git@') === 0) {
return _url.split(':', 2)[1].slice(0, sliceEnd);
}
// None found
return null;
}
function titleCase(str)
{
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
function watch(dir) {
var d = Q.defer();
dir = path.resolve(dir);
@@ -88,9 +37,6 @@ function logError(err) {
// Exports
module.exports = {
gitURL: gitURL,
githubID: githubID,
titleCase: titleCase,
watch: watch,
logError: logError
};
+2 -2
View File
@@ -12,8 +12,8 @@ var BaseGenerator = function(options) {
this.plugins = [];
};
BaseGenerator.prototype.callHook = function(name) {
return this.plugins.hook(name, this);
BaseGenerator.prototype.callHook = function(name, data) {
return this.plugins.hook(name, this, data);
};
BaseGenerator.prototype.loadPlugins = function() {
+47 -10
View File
@@ -28,26 +28,34 @@ var generate = function(options) {
options = _.defaults(options || {}, {
// Folders to use
input: null,
output: null,
"input": null,
"output": null,
// Config file (relative to input)
"configFile": "book.json",
// Output generator
generator: "site",
"generator": "site",
// Book title, keyword, description
title: null,
description: null,
"title": null,
"description": null,
// Origin github repository id
github: null,
githubHost: 'https://github.com/',
"github": null,
"githubHost": 'https://github.com/',
// Theming
theme: path.resolve(__dirname, '../../theme'),
"theme": path.resolve(__dirname, '../../theme'),
// Plugins
plugins: [],
pluginsConfig: {}
"plugins": [],
"pluginsConfig": {},
// Links
"links": {
"about": null
}
});
if (!options.input) {
@@ -63,6 +71,35 @@ var generate = function(options) {
// Clean output folder
return fs.remove(options.output)
// Read config file
.then(function() {
return fs.readFile(path.resolve(options.input, options.configFile))
.then(function(_config) {
// Extend current config
_config = JSON.parse(_config);
_config = _.omit(_config, 'input', 'configFile');
_.extend(options, _config);
}, function() {
// No config file: not a big deal
return Q();
})
})
// Get repo's URL
.then(function() {
return parse.git.url(options.input)
.then(function(_url) {
// Get ID of repo
return parse.git.githubID(_url);
}, function(err) {
return null;
})
.then(function(repoId) {
options.github = options.github || repoId;
});
})
.then(function() {
return fs.mkdirp(options.output);
})
+14 -9
View File
@@ -74,21 +74,26 @@ Plugin.prototype.resolveFile = function(filename) {
};
// Resolve file path
Plugin.prototype.callHook = function(name, args) {
Plugin.prototype.callHook = function(name, context, data) {
var hookFunc = this.infos.hooks? this.infos.hooks[name] : null;
args = _.isArray(args) ? args : [args];
data = data || {};
if (!hookFunc) return Q();
if (!hookFunc) return Q(data);
return Q()
.then(function() {
return hookFunc.apply(null, args);
return hookFunc.apply(context, [data]);
});
};
// Has assets
Plugin.prototype.hasAssets = function(out) {
return (this.infos.book && this.infos.book.assets);
};
// Copy plugin assets fodler
Plugin.prototype.copyAssets = function(out) {
if (!this.infos.book || !this.infos.book.assets) return Q();
if (!this.hasAssets()) return Q();
return fs.copy(
this.resolveFile(this.infos.book.assets),
out
@@ -159,12 +164,12 @@ Plugin.fromList = function(names, root) {
return Q({
'list': plugins,
'resources': resources,
'hook': function(name, args) {
'hook': function(name, context, data) {
return _.reduce(plugins, function(prev, plugin) {
return prev.then(function() {
return plugin.callHook(name, args);
return prev.then(function(ret) {
return plugin.callHook(name, context, ret);
})
}, Q());
}, Q(data));
},
'template': function(name) {
var withTpl = _.find(plugins, function(plugin) {
+42 -8
View File
@@ -59,8 +59,11 @@ Generator.prototype.loadPlugins = function() {
};
// Generate a template
Generator.prototype._writeTemplate = function(tpl, options, output) {
Generator.prototype._writeTemplate = function(tpl, options, output, interpolate) {
var that = this;
interpolate = interpolate || _.identity;
return Q()
.then(function(sections) {
return tpl(_.extend({
@@ -77,9 +80,12 @@ Generator.prototype._writeTemplate = function(tpl, options, output) {
allNavigation: that.options.navigation,
plugins: that.plugins,
pluginsConfig: JSON.stringify(that.options.pluginsConfig)
pluginsConfig: JSON.stringify(that.options.pluginsConfig),
options: that.options
}, options));
})
.then(interpolate)
.then(function(html) {
return fs.writeFile(
output,
@@ -96,7 +102,6 @@ Generator.prototype.indexPage = function(lexed, pagePath) {
// Convert a markdown file to html
Generator.prototype.convertFile = function(content, _input) {
var that = this;
var progress = parse.progress(this.options.navigation, _input);
_output = _input.replace(".md", ".html");
if (_output == "README.html") _output = "index.html";
@@ -105,10 +110,28 @@ Generator.prototype.convertFile = function(content, _input) {
var output = path.join(this.options.output, _output);
var basePath = path.relative(path.dirname(output), this.options.output) || ".";
var page = {
path: _input,
content: content,
progress: parse.progress(this.options.navigation, _input)
};
var _callHook = function(name) {
return that.callHook(name, page)
.then(function(_page) {
page = _page;
return page;
});
};
return Q()
.then(function() {
// Send content to plugins
return _callHook("page:before");
})
.then(function() {
// Lex page
return parse.lex(content);
return parse.lex(page.content);
})
.then(function(lexed) {
// Index page in search
@@ -124,17 +147,27 @@ Generator.prototype.convertFile = function(content, _input) {
});
})
.then(function(sections) {
page.sections = sections;
// Use plugin hook
return _callHook("page");
})
.then(function() {
that.manifest.add("CACHE", _output);
return that._writeTemplate(that.template, {
progress: progress,
progress: page.progress,
_input: _input,
content: sections,
content: page.sections,
basePath: basePath,
staticBase: path.join(basePath, "gitbook"),
}, output);
}, output, function(html) {
page.content = html;
return _callHook("page:after").get("content")
});
});
};
@@ -174,8 +207,9 @@ Generator.prototype.copyAssets = function() {
.then(function() {
return Q.all(
_.map(that.plugins.list, function(plugin) {
var pluginAssets = path.join(that.options.output, "gitbook/plugins/", plugin.name);
if (!plugin.hasAssets()) return Q();
var pluginAssets = path.join(that.options.output, "gitbook/plugins/", plugin.name);
return plugin.copyAssets(pluginAssets)
.then(function() {
return that.manifest.addFolder(pluginAssets, "gitbook/plugins/"+plugin.name);
+56
View File
@@ -0,0 +1,56 @@
var Q = require('q');
var _ = require('lodash');
var cp = require('child_process');
var url = require('url');
// Get the remote of a given repo
function gitURL(path) {
var d = Q.defer();
cp.exec("git config --get remote.origin.url", {
cwd: path,
env: process.env,
}, function(err, stdout, stderr) {
if(err) {
return d.reject(err);
}
return d.resolve(stdout);
});
return d.promise
.then(function(output) {
return output.replace(/(\r\n|\n|\r)/gm, "");
});
}
// Poorman's parsing
// Parse a git URL to a github ID : username/reponame
function githubID(_url) {
// Remove .git if it's in _url
var sliceEnd = _url.slice(-4) === '.git' ? -4 : _url.length;
// Detect HTTPS repos
var parsed = url.parse(_url);
if(parsed.protocol === 'https:' && parsed.host === 'github.com') {
return parsed.path.slice(1, sliceEnd);
}
// Detect SSH repos
if(_url.indexOf('git@') === 0) {
return _url.split(':', 2)[1].slice(0, sliceEnd);
}
// None found
return null;
}
function titleCase(str) {
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
module.exports = {
url: gitURL,
githubID: githubID,
titleCase: titleCase
};
+2 -1
View File
@@ -5,5 +5,6 @@ module.exports = {
lex: require('./lex'),
progress: require('./progress'),
navigation: require('./navigation'),
readme: require('./readme')
readme: require('./readme'),
git: require('./git')
};
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "gitbook",
"version": "0.3.2",
"version": "0.4.2",
"homepage": "http://www.gitbook.io/",
"description": "Library and cmd utility to generate GitBooks",
"main": "lib/index.js",
@@ -18,7 +18,7 @@
"highlight.js": "8.0.0",
"tmp": "0.0.23",
"semver": "2.2.1",
"gaze": "0.6.4",
"gaze": "~0.5.1",
"resolve": "0.6.3",
"gitbook-plugin": "0.0.2",
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8 -9
View File
@@ -28,7 +28,7 @@ define([
.done(function (html) {
// Push url to history
if (push) history.pushState({ path: url }, null, url);
// Replace html content
html = html.replace( /<(\/?)(html|head|body)([^>]*)>/ig, function(a,b,c,d){
return '<' + b + 'div' + ( b ? '' : ' data-element="' + c + '"' ) + d + '>';
@@ -36,6 +36,7 @@ define([
var $page = $(html);
var $pageHead = $page.find("[data-element=head]");
var $pageBody = $page.find('.book');
// Merge heads
var headContent = $pageHead.html()
@@ -45,13 +46,11 @@ define([
});
$("head").html(headContent);
// Update header, body
$('.book-header').html($page.find('.book-header').html());
$('.book-body').html($page.find('.book-body').html());
// Update summary
// Merge body
var scrollPosition = $('.book-summary .summary').scrollTop();
$('.book-summary').html($page.find('.book-summary').html());
$pageBody.toggleClass("with-summary", $(".book").hasClass("with-summary"))
$(".book").replaceWith($pageBody);
$('.book-summary .summary').scrollTop(scrollPosition);
// Update state
@@ -134,7 +133,7 @@ define([
if (url) handleNavigation(url, true);
};
var init = function() {
// Prevent cache so that using the back button works
@@ -157,7 +156,7 @@ define([
$(document).on('click', ".navigation-prev", handlePagination);
$(document).on('click', ".navigation-next", handlePagination);
$(document).on('click', ".summary [data-path] a", handlePagination);
$(window).resize(updateNavigationPosition);
// Prepare current page
+5 -1
View File
@@ -1,6 +1,10 @@
.book {
position: relative;
width: 100%;
height: 100%;
.book-body {
position: fixed;
position: absolute;
top: @header-height;
right: 0px;
left: 0px;
+1 -1
View File
@@ -2,7 +2,7 @@
.book-header {
font-family: @font-family-sans;
position: fixed;
position: absolute;
overflow: visible;
top: 0px;
right: 0px;
+7 -7
View File
@@ -21,7 +21,7 @@
}
}
.book .book-body .page-wrapper .page-inner section.normal {
padding: 25px 0px;
padding-bottom: 25px;
padding-top: 15px;
color:@page-color;
@@ -72,25 +72,25 @@
font-size: inherit; }
h1 {
font-size: 28px;
font-size: 2.5em;
}
h2 {
font-size: 24px;
font-size: 2em;
border-bottom: 1px solid #eee;
}
h3 {
font-size: 18px; }
font-size: 1.5em; }
h4 {
font-size: 16px; }
font-size: 1.2em; }
h5 {
font-size: 14px; }
font-size: 1em; }
h6 {
font-size: 14px; }
font-size: 1em; }
p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0; }
+5
View File
@@ -40,6 +40,11 @@
width: 50%;
display: inline-block;
float: left;
&.navigation-unique {
max-width: 100%;
width: 100%;
}
}
}
}
+1 -1
View File
@@ -16,7 +16,7 @@
width: 100%;
position: relative;
background: #fff;
margin-bottom: 20px;
margin-bottom: 10px;
.bar {
height: @bar-height;
+1 -1
View File
@@ -2,7 +2,7 @@
.book-summary {
font-family: @font-family-sans;
position: fixed;
position: absolute;
top: @header-height;
left: -@sidebar-width;
bottom: 0px;
+10 -4
View File
@@ -1,7 +1,7 @@
<div class="book-header">
<!-- Actions Left -->
{% if githubId %}
<a href="{{ githubHost }}{{ githubId }}" target="_blank" class="btn pull-left"><i class="fa fa-github-alt"></i></a>
{% if options.links.home !== false and (options.links.home != null or githubId) %}
<a href="{{ options.links.home|default(githubHost+githubId) }}" target="_blank" class="btn pull-left"><i class="fa fa-bookmark-o"></i></a>
{% endif %}
<a href="#" class="btn pull-left toggle-summary"><i class="fa fa-align-justify"></i></a>
<a href="#" class="btn pull-left toggle-search"><i class="fa fa-search"></i></a>
@@ -12,13 +12,19 @@
</span>
<!-- Actions Right -->
{% if options.links.sharing.google !== false %}
<a href="#" target="_blank" class="btn pull-right" data-sharing="google-plus"><i class="fa fa-google-plus"></i></a>
{% endif %}
{% if options.links.sharing.facebook !== false %}
<a href="#" target="_blank" class="btn pull-right" data-sharing="facebook"><i class="fa fa-facebook"></i></a>
{% endif %}
{% if options.links.sharing.twitter !== false %}
<a href="#" target="_blank" class="btn pull-right" data-sharing="twitter"><i class="fa fa-twitter"></i></a>
{% endif %}
{% if githubId %}
<a href="{{ githubHost }}{{ githubId }}/stargazers" target="_blank" class="btn pull-right count-star"><i class="fa fa-star-o"></i> Star (<span>-</span>)</a>
<a href="{{ githubHost }}{{ githubId }}/watchers" target="_blank" class="btn pull-right count-watch"><i class="fa fa-eye"></i> Watch (<span>-</span>)</a>
<a href="{{ githubHost }}{{ githubId }}/stargazers" target="_blank" class="btn pull-right count-star hidden-xs"><i class="fa fa-star-o"></i> Star (<span>-</span>)</a>
<a href="{{ githubHost }}{{ githubId }}/watchers" target="_blank" class="btn pull-right count-watch hidden-xs"><i class="fa fa-eye"></i> Watch (<span>-</span>)</a>
{% endif %}
<!-- Title -->
+21 -4
View File
@@ -3,18 +3,28 @@
<input type="text" placeholder="Search" class="form-control" />
</div>
<ul class="summary">
{% if githubId %}
{% if options.links.about !== false && (options.links.about != null || githubId) %}
<li>
<a href="{{ githubHost }}{{ githubAuthor }}" target="blank">About the author</a>
<a href="{{ options.links.about|default(githubHost+githubAuthor) }}" target="blank">About the author</a>
</li>
{% endif %}
{% if options.links.issues !== false && (options.links.issues != null || githubId) %}
<li>
<a href="{{ githubHost }}{{ githubId }}/issues" target="blank">Questions and Issues</a>
<a href="{{ options.links.issues|default(githubHost+githubId+"/issues") }}" target="blank">Questions and Issues</a>
</li>
{% endif %}
{% if options.links.contribute !== false && (options.links.contribute != null || githubId) %}
<li>
<a href="{{ githubHost }}{{ githubId }}/edit/master/{{ _input }}" target="blank">Edit and Contribute</a>
<a href="{{ options.links.contribute|default(githubHost+githubId+"/edit/master/"+_input) }}" target="blank">Edit and Contribute</a>
</li>
{% endif %}
{% if options.links.contribute || options.links.issues || options.links.about || githubId %}
<li class="divider"></li>
{% endif %}
<li data-level="0" data-path="index.html">
<a href="{{ basePath }}/"><i class="fa fa-check"></i> Introduction</a>
</li>
@@ -44,5 +54,12 @@
{% endif %}
</li>
{% endfor %}
{% if options.links.gitbook !== false %}
<li class="divider"></li>
<li>
<a href="http://www.gitbook.io/" target="blank">Generated using GitBook</a>
</li>
{% endif %}
</ul>
</div>
+2 -2
View File
@@ -28,10 +28,10 @@
</div>
{% if progress.current.prev and progress.current.prev.path %}
<a href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" class="navigation navigation-prev"><i class="fa fa-angle-left"></i></a>
<a href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" class="navigation navigation-prev {% if !progress.current.next or !progress.current.next.path %}navigation-unique{% endif %}"><i class="fa fa-angle-left"></i></a>
{% endif %}
{% if progress.current.next and progress.current.next.path %}
<a href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" class="navigation navigation-next"><i class="fa fa-angle-right"></i></a>
<a href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" class="navigation navigation-next {% if !progress.current.prev or !progress.current.prev.path %}navigation-unique{% endif %}"><i class="fa fa-angle-right"></i></a>
{% endif %}
</div>
</div>