mirror of
https://github.com/rust-lang/mdBook
synced 2024-11-14 00:37:15 +00:00
book-example/book is not tracked anymore and the deploy script should build the output before pushing it to gh-pages
This commit is contained in:
parent
991ccb5495
commit
f222134ee6
19 changed files with 6 additions and 1536 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ target
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
|
||||||
book-test
|
book-test
|
||||||
|
book-example/book
|
||||||
|
|
|
@ -1,63 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="README.html"class="active"><strong>1.</strong> mdBook</a></li><li><a href="cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>mdBook</h1>
|
|
||||||
<p><strong>mdBook</strong> is a command line tool and Rust library to create books using Markdown.
|
|
||||||
It's very similar to Gitbook but written in <a href="http://www.rust-lang.org">Rust</a>.</p>
|
|
||||||
<p>This book serves as an example of the output of mdBook and as the docs at the same time.</p>
|
|
||||||
<p>mdBook is free and open source, you can find the source code on <a href="https://github.com/azerupi/mdBook">Github</a>.
|
|
||||||
Issues and feature requests can be posted on the <a href="https://github.com/azerupi/mdBook/issues">Github Issue tracker</a>.</p>
|
|
||||||
<h2>License</h2>
|
|
||||||
<p>mdBook, all the code and this book, are released under the <a href="https://www.mozilla.org/MPL/2.0/">Mozilla Public License v2.0</a></p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="cli/cli-tool.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="highlight.js"></script>
|
|
||||||
<script src="book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,212 +0,0 @@
|
||||||
html, body {
|
|
||||||
font-family: "Open Sans", sans-serif;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.sidebar {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 300px;
|
|
||||||
overflow-y: auto;
|
|
||||||
border-right: 1px solid rgba(0, 0, 0, 0.07);
|
|
||||||
padding: 10px 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
background-color: #fafafa;
|
|
||||||
color: #364149;
|
|
||||||
|
|
||||||
/* Animation: slide away */
|
|
||||||
-webkit-transition: left 0.5s; /* Safari */
|
|
||||||
-o-transition: left 0.5s; /* Opera */
|
|
||||||
-moz-transition: left 0.5s; /* Mozilla Firefox */
|
|
||||||
transition: left 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-wrapper {
|
|
||||||
position: absolute;
|
|
||||||
overflow-y: auto;
|
|
||||||
left: 315px;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background: none repeat scroll 0 0 #FFF;
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
|
|
||||||
/* Animation: slide away */
|
|
||||||
-webkit-transition: left 0.5s; /* Safari */
|
|
||||||
-o-transition: left 0.5s; /* Opera */
|
|
||||||
-moz-transition: left 0.5s; /* Mozilla Firefox */
|
|
||||||
transition: left 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 1060px) {
|
|
||||||
.sidebar {
|
|
||||||
left: -300px;
|
|
||||||
}
|
|
||||||
.page-wrapper {
|
|
||||||
left: 15px;
|
|
||||||
padding-right: 15px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.page {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right:auto;
|
|
||||||
max-width: 750px;
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter {
|
|
||||||
list-style: none outside none;
|
|
||||||
padding-left: 0;
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section {
|
|
||||||
list-style: none outside none;
|
|
||||||
padding-left: 20px;
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section li {
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter li {
|
|
||||||
color: #AAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter li a {
|
|
||||||
color: #333;
|
|
||||||
padding: 5px 0;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter li .active {
|
|
||||||
color: #008cff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter li a:hover {
|
|
||||||
/* Animate color change */
|
|
||||||
color: #008cff;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-bar {
|
|
||||||
position: relative;
|
|
||||||
height: 50px;
|
|
||||||
color: #CCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-bar i {
|
|
||||||
position: relative;
|
|
||||||
z-index: 10;
|
|
||||||
line-height: 50px;
|
|
||||||
-webkit-transition: color 0.5s; /* Safari */
|
|
||||||
-o-transition: color 0.5s; /* Opera */
|
|
||||||
-moz-transition: color 0.5s; /* Mozilla Firefox */
|
|
||||||
transition: color 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-bar :hover {
|
|
||||||
/* Animate color change */
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-title {
|
|
||||||
color: #7E7E7E;
|
|
||||||
display: inline-block;
|
|
||||||
font-weight: 200;
|
|
||||||
font-size: 20px;
|
|
||||||
line-height: 50px;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
text-align: center;
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
opacity: 0;
|
|
||||||
-webkit-transition: opacity 0.5s ease-in-out; /* Safari */
|
|
||||||
-o-transition: opacity 0.5s ease-in-out; /* Opera */
|
|
||||||
-moz-transition: opacity 0.5s ease-in-out; /* Mozilla Firefox */
|
|
||||||
transition: opacity 0.5s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-bar:hover .menu-title {
|
|
||||||
color: #7E7E7E;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Content */
|
|
||||||
|
|
||||||
.content a {
|
|
||||||
color: #4183c4;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Nav icons */
|
|
||||||
.nav-chapters {
|
|
||||||
color: #CCC;
|
|
||||||
font-size: 40px;
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
top: 50px; /* Height of menu-bar */
|
|
||||||
bottom: 0;
|
|
||||||
margin: 0;
|
|
||||||
max-width: 150px;
|
|
||||||
min-width: 90px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
-webkit-transition: color 0.5s; /* Safari */
|
|
||||||
-o-transition: color 0.5s; /* Opera */
|
|
||||||
-moz-transition: color 0.5s; /* Mozilla Firefox */
|
|
||||||
transition: color 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-chapters:hover {
|
|
||||||
color: #333;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.previous {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.next {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
$( document ).ready(function() {
|
|
||||||
|
|
||||||
// Syntax highlighting Configuration
|
|
||||||
hljs.configure({
|
|
||||||
tabReplace: ' ', // 4 spaces
|
|
||||||
languages: [], // Languages used for auto-detection
|
|
||||||
});
|
|
||||||
|
|
||||||
$('code').each(function(i, block) {
|
|
||||||
hljs.highlightBlock(block);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Interesting DOM Elements
|
|
||||||
var sidebar = $("#sidebar");
|
|
||||||
var page_wrapper = $("#page-wrapper");
|
|
||||||
|
|
||||||
$("#sidebar-toggle").click(function(event){
|
|
||||||
if(sidebar.position().left === 0){
|
|
||||||
sidebar.css({left: "-300px"});
|
|
||||||
page_wrapper.css({left: "15px"});
|
|
||||||
} else {
|
|
||||||
sidebar.css({left: "0"});
|
|
||||||
page_wrapper.css({left: "315px"});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
|
@ -1,74 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../cli/build.html"class="active"><strong>2.2.</strong> build</a></li></ul><li><a href="../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>The build command</h1>
|
|
||||||
<p>The build command is used to render your book:</p>
|
|
||||||
<pre><code>mdbook build
|
|
||||||
</code></pre>
|
|
||||||
<p>It will try to parse your <code>SUMMARY.md</code> file to understand the structure of your book
|
|
||||||
and fetch the corresponding files.</p>
|
|
||||||
<p>The rendered ouput will maintain the same directory structure as the source for
|
|
||||||
convenience. Large books will therefore remain structured when rendered.</p>
|
|
||||||
<h4>Specify a directory</h4>
|
|
||||||
<p>Like init, the build command can take a directory as argument to use instead of the
|
|
||||||
current working directory.</p>
|
|
||||||
<pre><code>mdbook build path/to/book
|
|
||||||
</code></pre>
|
|
||||||
<hr />
|
|
||||||
<p><strong>note:</strong> make sure to run the build command in the root directory and not in the source directory</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../cli/init.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../format/format.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../highlight.js"></script>
|
|
||||||
<script src="../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,62 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../cli/cli-tool.html"class="active"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>Command Line Tool</h1>
|
|
||||||
<p>mdBook can be used either as a command line tool or a Rust library.
|
|
||||||
Let's focus on the command line tool capabilities first.</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../README.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../cli/init.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../highlight.js"></script>
|
|
||||||
<script src="../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,91 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../cli/init.html"class="active"><strong>2.1.</strong> init</a></li><li><a href="../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>The init command</h1>
|
|
||||||
<p>The init command, used like this:</p>
|
|
||||||
<pre><code>mdbook init
|
|
||||||
</code></pre>
|
|
||||||
<p>Will create a couple of files and directories in the working directory so that you can
|
|
||||||
spend more time writing your book and less setting it up.</p>
|
|
||||||
<p>The files set up for you are the following:</p>
|
|
||||||
<pre><code>book-test/
|
|
||||||
├── book
|
|
||||||
└── src
|
|
||||||
├── chapter_1.md
|
|
||||||
└── SUMMARY.md
|
|
||||||
</code></pre>
|
|
||||||
<p>The <code>src</code> directory is were you write your book in markdown. It contains all the source files,
|
|
||||||
configuration files, etc.</p>
|
|
||||||
<p>The <code>book</code> directory is where your book is rendered. All the output is ready to be uploaded
|
|
||||||
to a serer to be seen by the internet.</p>
|
|
||||||
<p>The <code>SUMMARY.md</code> file is the most important file, it's the skeleton of your book.
|
|
||||||
It's so important that it has it's own <a href="../format/summary.html">chapter</a>.</p>
|
|
||||||
<h4>Specify a directory</h4>
|
|
||||||
<p>When using the init command, you can also specify a directory, instead of using the current directory,
|
|
||||||
by appending a path to the command:</p>
|
|
||||||
<pre><code>mdbook init path/to/book
|
|
||||||
</code></pre>
|
|
||||||
<h2>Not yet implemented</h2>
|
|
||||||
<p>In the future I would like <code>mdBook init</code> to be able to:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Copy the default theme to the <code>src</code> directory in a <code>theme</code> directory when using a flag like <code>--theme</code>.
|
|
||||||
The user could then tweak the theme to his needs.</li>
|
|
||||||
<li>Generate files that are in <code>SUMMARY.md</code>. If the user has already created a <code>SUMMARY.md</code> file and added some entries but did
|
|
||||||
not create the corresponding files, init command should create the files for him.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../cli/cli-tool.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../cli/build.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../highlight.js"></script>
|
|
||||||
<script src="../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,73 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../format/config.html"class="active"><strong>3.2.</strong> Configuration</a></li><li><a href="../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>Configuration</h1>
|
|
||||||
<p>You can configure the parameters for your book in the <em>book.json</em> file.</p>
|
|
||||||
<p>Here is an example of what a <em>book.json</em> file might look like:</p>
|
|
||||||
<pre><code class="language-json">{
|
|
||||||
"title": "Example book",
|
|
||||||
"author": "Name",
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
<h4>Supported variables</h4>
|
|
||||||
<ul>
|
|
||||||
<li><strong>title:</strong> title of the book</li>
|
|
||||||
<li><strong>author:</strong> author of the book</li>
|
|
||||||
<li><strong>dest:</strong> path to the directory where you want your book to be rendered. If a relative path is given it will be relative to the parent directory of the source directory</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../format/summary.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../format/theme/theme.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../highlight.js"></script>
|
|
||||||
<script src="../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,67 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../format/format.html"class="active"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>Format</h1>
|
|
||||||
<p>In this section you will learn how to:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Structure your book correctly</li>
|
|
||||||
<li>Format your <code>SUMMARY.md</code> file</li>
|
|
||||||
<li>Configure your book using <code>book.json</code></li>
|
|
||||||
<li>Customize your theme</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../cli/build.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../format/summary.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../highlight.js"></script>
|
|
||||||
<script src="../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,86 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../format/summary.html"class="active"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>SUMMARY.md</h1>
|
|
||||||
<p>The summary file is used by mdBook to know what chapters to include,
|
|
||||||
in what order they should appear, what their hierarchy is and where the source files are.
|
|
||||||
Without this file, there is no book.</p>
|
|
||||||
<p>Even though <code>SUMMARY.md</code> is a markdown file, the formatting is very strict to
|
|
||||||
allow for easy parsing. Let's see how you should format your <code>SUMMARY.md</code> file.</p>
|
|
||||||
<h4>Allowed elements</h4>
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>Title</em></strong> It's common practice to begin with a title, generally
|
|
||||||
<code class="language-markdown"># Summary</code>.
|
|
||||||
But it is not mandatory, the parser just ignores it. So you can too
|
|
||||||
if you feel like it.</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>list link</em></strong> the other elements have to be list elements in form of a link</p>
|
|
||||||
<pre><code class="language-markdown">- [Title of the Chapter](relative/path/to/markdown.md)
|
|
||||||
</code></pre>
|
|
||||||
<p>You can either use <code>-</code> or <code>*</code> to indicate a list. The lists can be nested,
|
|
||||||
resulting in a nice hierarchy (chapters, sub-chapters, etc.)</p>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
<p>All other elements are unsupported and will be ignored at best or result in an error.</p>
|
|
||||||
<h4>not yet implemented</h4>
|
|
||||||
<p>In the feature I would like to add support for links without the need to be list elements
|
|
||||||
at the root level to add chapters that don't need numbering, like an index, appendix,
|
|
||||||
contributor list, introduction, foreword, etc.</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../format/format.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../format/config.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../highlight.js"></script>
|
|
||||||
<script src="../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,138 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../../format/theme/index-hbs.html"class="active"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>index.hbs</h1>
|
|
||||||
<p><code>index.hbs</code> is the handlebars template that is used to render the book.
|
|
||||||
The markdown files are processed to html and then injected in that template.</p>
|
|
||||||
<p>If you want to change the layout or style of your book, chances are that you will
|
|
||||||
have to modify this template a little bit. Here is what you need to know.</p>
|
|
||||||
<h2>Data</h2>
|
|
||||||
<p>A lot of data is exposed to the handlebars template with the "context".
|
|
||||||
In the handlebars template you can access this information by using</p>
|
|
||||||
<pre><code class="language-handlebars">{{name_of_property}}
|
|
||||||
</code></pre>
|
|
||||||
<p>Here is a list of the properties that are exposed:</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>language</em></strong> Language of the book in the form <code>en</code>. To use in <code class="language-html"><html lang="{{ language }}"></code> for example.
|
|
||||||
At the moment it is hardcoded.</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>title</em></strong> Title of the book, as specified in <code>book.json</code></p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>path</em></strong> Relative path to the original markdown file from the source directory</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>content</em></strong> This is the rendered markdown.</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>path_to_root</em></strong> This is a path containing exclusively <code>../</code>'s that points to the root of the book from the current file.
|
|
||||||
Since the original directory structure is maintained, it is useful to prepend relative links with this <code>path_to_root</code>.</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p><strong><em>chapters</em></strong> Is an array of dictionaries of the form</p>
|
|
||||||
<pre><code class="language-json">{"section": "1.2.1", "name": "name of this chapter", "path": "dir/markdown.md"}
|
|
||||||
</code></pre>
|
|
||||||
<p>containing all the chapters of the book. It is used for example to construct the table of contents (sidebar).</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h2>Handlebars Helpers</h2>
|
|
||||||
<p>In addition to the properties you can access, there are some handlebars helpers at your disposal.</p>
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
<h3>toc</h3>
|
|
||||||
<p>The toc helper is used like this</p>
|
|
||||||
<pre><code class="language-handlebars">{{#toc}}{{/toc}}
|
|
||||||
</code></pre>
|
|
||||||
<p>and outputs something that looks like this, depending on the structure of your book</p>
|
|
||||||
<pre><code class="language-html"><ul class="chapter">
|
|
||||||
<li><a href="link/to/file.html">Some chapter</a></li>
|
|
||||||
<li>
|
|
||||||
<ul class="section">
|
|
||||||
<li><a href="link/to/other_file.html">Some other Chapter</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</code></pre>
|
|
||||||
<p>If you would like to make a toc with another structure, you have access to the chapters property containing all the data.
|
|
||||||
The only limitation at the moment is that you would have to do it with JavaScript instead of with a handlebars helper.</p>
|
|
||||||
<pre><code class="language-html"><script>
|
|
||||||
var chapters = {{chapters}};
|
|
||||||
// Processing here
|
|
||||||
</script>
|
|
||||||
</code></pre>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<h3>previous / next</h3>
|
|
||||||
<p>The previous and next helpers expose a <code>link</code> and <code>name</code> property to the previous and next chapters.</p>
|
|
||||||
<p>They are used like this</p>
|
|
||||||
<pre><code class="language-handlebars">{{#previous}}
|
|
||||||
<a href="{{link}}" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
{{/previous}}
|
|
||||||
</code></pre>
|
|
||||||
<p>The inner html will only be rendered if the previous / next chapter exists.
|
|
||||||
Of course the inner html can be changed to your liking.</p>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
<hr />
|
|
||||||
<p>If you would like me to expose other properties or helpers, please <a href="https://github.com/azerupi/mdBook/issues">create a new issue</a>
|
|
||||||
and I will consider it.</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../../format/theme/theme.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../../format/theme/syntax-highlighting.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../../highlight.js"></script>
|
|
||||||
<script src="../../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,78 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../../format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../../format/theme/syntax-highlighting.html"class="active"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>Syntax Highlighting</h1>
|
|
||||||
<p>For syntax highlighting I use <a href="https://highlightjs.org">Highlight.js</a> with a custom theme.</p>
|
|
||||||
<p>Automatic language detection has been turned off, so you will probably want to
|
|
||||||
specify the programming language you use like this</p>
|
|
||||||
<pre class="language-markdown"><code class="language-markdown">```rust
|
|
||||||
fn main() {
|
|
||||||
// Some code
|
|
||||||
}
|
|
||||||
```</code></pre>
|
|
||||||
<h2>Improve default theme</h2>
|
|
||||||
<p>If you think the default theme doesn't look quite right for a specific language, or could be improved.
|
|
||||||
Feel free to <a href="https://github.com/azerupi/mdBook/issues">submit a new issue</a> explaining what you have in mind and I will take a look at it.</p>
|
|
||||||
<p>You could also create a pull-request with the proposed improvements.</p>
|
|
||||||
<p>Overall the theme should be light and sober, without to many flashy colors.</p>
|
|
||||||
<h2>Custom theme</h2>
|
|
||||||
<p>Like the rest of the theme, the files used for syntax highlighting can be overwritten with your own.</p>
|
|
||||||
<ul>
|
|
||||||
<li><strong><em>highlight.js</em></strong> normally you shouldn't have to overwrite this file. But if you need to, you can.</li>
|
|
||||||
<li><strong><em>highlight.css</em></strong> theme used by highlight.js for syntax highlighting.</li>
|
|
||||||
</ul>
|
|
||||||
<p>If you want to use another theme for <code>highlight.js</code> download it from their website, or make it yourself,
|
|
||||||
rename it to <code>highlight.css</code> and put it in <code>src/theme</code> (or the equivalent if you changed your source folder)</p>
|
|
||||||
<p>Now your theme will be used instead of the default theme.</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../../format/theme/index-hbs.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../../highlight.js"></script>
|
|
||||||
<script src="../../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,73 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="../../highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="../../README.html"><strong>1.</strong> mdBook</a></li><li><a href="../../cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="../../cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="../../cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="../../format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="../../format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="../../format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="../../format/theme/theme.html"class="active"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="../../format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="../../format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>Theme</h1>
|
|
||||||
<p>The default renderer uses a <a href="http://handlebarsjs.com/">handlebars</a> template to render your markdown files in and comes with a default theme
|
|
||||||
included in the mdBook binary.</p>
|
|
||||||
<p>But the theme is totally customizable, you can replace every file from the theme by your own by adding a
|
|
||||||
<code>theme</code> directory in your source folder. Create a new file with the name of the file you want to overwrite
|
|
||||||
and now that file will be used instead of the default file.</p>
|
|
||||||
<p>Here are the files you can overwrite:</p>
|
|
||||||
<ul>
|
|
||||||
<li><strong><em>index.hbs</em></strong> is the handlebars template.</li>
|
|
||||||
<li><strong><em>book.css</em></strong> is the style used in the output. If you want to change the design of your book, this is probably the file you want to modify. Sometimes in conjunction with <code>index.hbs</code> when you want to radically change the layout.</li>
|
|
||||||
<li><strong><em>book.js</em></strong> is mostly used to add client side functionality.</li>
|
|
||||||
</ul>
|
|
||||||
<p><strong>Note:</strong></p>
|
|
||||||
<p>When you overwrite a file, it is possible that you break some functionality. Therefore I recommend to use the file from the default theme as template and only add / modify what you need. In the future you will be able to copy the default theme into your source directory automatically by using <code>mdbook init --theme</code>.</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<a href="../../format/config.html" class="nav-chapters previous">
|
|
||||||
<i class="fa fa-angle-left"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="../../format/theme/index-hbs.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="../../highlight.js"></script>
|
|
||||||
<script src="../../book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,115 +0,0 @@
|
||||||
/* Modified Base16 Atelier Dune Light - Theme
|
|
||||||
/* Original by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
|
|
||||||
|
|
||||||
.hljs {
|
|
||||||
display: block;
|
|
||||||
overflow-x: auto;
|
|
||||||
background: #f1f1f1;
|
|
||||||
color: #6e6b5e;
|
|
||||||
padding: 0.5em;
|
|
||||||
-webkit-text-size-adjust: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Inline code */
|
|
||||||
:not(pre) > .hljs {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
padding: 0.1em 0.3em;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Atelier-Dune Comment */
|
|
||||||
.hljs-comment {
|
|
||||||
color: #AAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Atelier-Dune Red */
|
|
||||||
.hljs-variable,
|
|
||||||
|
|
||||||
.hljs-tag,
|
|
||||||
.hljs-regexp,
|
|
||||||
.hljs-name,
|
|
||||||
.ruby .hljs-constant,
|
|
||||||
.xml .hljs-tag .hljs-title,
|
|
||||||
.xml .hljs-pi,
|
|
||||||
.xml .hljs-doctype,
|
|
||||||
.html .hljs-doctype,
|
|
||||||
.css .hljs-id,
|
|
||||||
.css .hljs-class,
|
|
||||||
.css .hljs-pseudo {
|
|
||||||
color: #d73737;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Atelier-Dune Orange */
|
|
||||||
.hljs-number,
|
|
||||||
.hljs-preprocessor,
|
|
||||||
.hljs-built_in,
|
|
||||||
.hljs-literal,
|
|
||||||
.hljs-params,
|
|
||||||
.hljs-attribute,
|
|
||||||
.hljs-constant {
|
|
||||||
color: #b65611;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Atelier-Dune Yellow */
|
|
||||||
.ruby .hljs-class .hljs-title,
|
|
||||||
.css .hljs-rule .hljs-attribute {
|
|
||||||
color: #ae9513;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Atelier-Dune Green */
|
|
||||||
.hljs-string,
|
|
||||||
.hljs-value,
|
|
||||||
.hljs-inheritance,
|
|
||||||
.ruby .hljs-symbol,
|
|
||||||
.xml .hljs-cdata {
|
|
||||||
color: #2a9292;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Atelier-Dune Aqua */
|
|
||||||
.hljs-title,
|
|
||||||
.css .hljs-hexcolor {
|
|
||||||
color: #1fad83;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Atelier-Dune Blue */
|
|
||||||
.hljs-function,
|
|
||||||
.python .hljs-decorator,
|
|
||||||
.python .hljs-title,
|
|
||||||
.ruby .hljs-function .hljs-title,
|
|
||||||
.ruby .hljs-title .hljs-keyword,
|
|
||||||
.perl .hljs-sub,
|
|
||||||
.javascript .hljs-title,
|
|
||||||
.coffeescript .hljs-title {
|
|
||||||
color: #6684e1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Atelier-Dune Purple */
|
|
||||||
.hljs-keyword,
|
|
||||||
.javascript .hljs-function {
|
|
||||||
color: #b854d4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.coffeescript .javascript,
|
|
||||||
.javascript .xml,
|
|
||||||
.tex .hljs-formula,
|
|
||||||
.xml .javascript,
|
|
||||||
.xml .vbscript,
|
|
||||||
.xml .css,
|
|
||||||
.xml .hljs-cdata {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* markdown */
|
|
||||||
.hljs-header {
|
|
||||||
color: #A30000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hljs-link_label {
|
|
||||||
color: #33CCCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hljs-link_url {
|
|
||||||
color: #CC66FF;
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
|
@ -1,63 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>mdBook Documentation</title>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
||||||
<meta name="description" content="{% block description %}{% endblock %}">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="book.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
||||||
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
|
||||||
<link rel="stylesheet" href="highlight.css" media="screen" title="no title" charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="sidebar" class="sidebar">
|
|
||||||
<ul class="chapter"><li><a href="README.html"class="active"><strong>1.</strong> mdBook</a></li><li><a href="cli/cli-tool.html"><strong>2.</strong> Command Line Tool</a></li><li><ul class="section"><li><a href="cli/init.html"><strong>2.1.</strong> init</a></li><li><a href="cli/build.html"><strong>2.2.</strong> build</a></li></ul><li><a href="format/format.html"><strong>3.</strong> Format</a></li><li><ul class="section"><li><a href="format/summary.html"><strong>3.1.</strong> SUMMARY.md</a></li><li><a href="format/config.html"><strong>3.2.</strong> Configuration</a></li><li><a href="format/theme/theme.html"><strong>3.3.</strong> Theme</a></li><li><ul class="section"><li><a href="format/theme/index-hbs.html"><strong>3.3.1.</strong> index.hbs</a></li><li><a href="format/theme/syntax-highlighting.html"><strong>3.3.2.</strong> Syntax highlighting</a></li></ul><li><strong>4.</strong> Rust Library</li></ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="page-wrapper" class="page-wrapper">
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<div id="menu-bar" class="menu-bar">
|
|
||||||
<i id="sidebar-toggle" class="fa fa-bars left"></i>
|
|
||||||
<h1 class="menu-title">mdBook Documentation</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="content" class="content">
|
|
||||||
<h1>mdBook</h1>
|
|
||||||
<p><strong>mdBook</strong> is a command line tool and Rust library to create books using Markdown.
|
|
||||||
It's very similar to Gitbook but written in <a href="http://www.rust-lang.org">Rust</a>.</p>
|
|
||||||
<p>This book serves as an example of the output of mdBook and as the docs at the same time.</p>
|
|
||||||
<p>mdBook is free and open source, you can find the source code on <a href="https://github.com/azerupi/mdBook">Github</a>.
|
|
||||||
Issues and feature requests can be posted on the <a href="https://github.com/azerupi/mdBook/issues">Github Issue tracker</a>.</p>
|
|
||||||
<h2>License</h2>
|
|
||||||
<p>mdBook, all the code and this book, are released under the <a href="https://www.mozilla.org/MPL/2.0/">Mozilla Public License v2.0</a></p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Doesn't seem to work: using JavaScript
|
|
||||||
alternative until I find a way to do it in the template
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<a href="cli/cli-tool.html" class="nav-chapters next">
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
||||||
<script src="highlight.js"></script>
|
|
||||||
<script src="book.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,238 +0,0 @@
|
||||||
/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript */
|
|
||||||
/**
|
|
||||||
* okaidia theme for JavaScript, CSS and HTML
|
|
||||||
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
|
|
||||||
* @author ocodia
|
|
||||||
*/
|
|
||||||
|
|
||||||
code,
|
|
||||||
pre {
|
|
||||||
color: #333;
|
|
||||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
||||||
direction: ltr;
|
|
||||||
text-align: left;
|
|
||||||
white-space: pre;
|
|
||||||
word-spacing: normal;
|
|
||||||
word-break: normal;
|
|
||||||
line-height: 1.5;
|
|
||||||
|
|
||||||
-moz-tab-size: 4;
|
|
||||||
-o-tab-size: 4;
|
|
||||||
tab-size: 4;
|
|
||||||
|
|
||||||
-webkit-hyphens: none;
|
|
||||||
-moz-hyphens: none;
|
|
||||||
-ms-hyphens: none;
|
|
||||||
hyphens: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Code blocks */
|
|
||||||
pre {
|
|
||||||
padding: 1em;
|
|
||||||
margin: .5em 0;
|
|
||||||
overflow: auto;
|
|
||||||
border-radius: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
:not(pre) > code,
|
|
||||||
pre {
|
|
||||||
background: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Inline code */
|
|
||||||
:not(pre) > code {
|
|
||||||
padding: .2em;
|
|
||||||
border-radius: .2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.comment,
|
|
||||||
.token.prolog,
|
|
||||||
.token.doctype,
|
|
||||||
.token.cdata {
|
|
||||||
color: slategray;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.punctuation {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.namespace {
|
|
||||||
opacity: .7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.property,
|
|
||||||
.token.tag,
|
|
||||||
.token.constant,
|
|
||||||
.token.symbol,
|
|
||||||
.token.deleted {
|
|
||||||
color: #f92672;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.boolean,
|
|
||||||
.token.number {
|
|
||||||
color: #ae81ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.selector,
|
|
||||||
.token.attr-name,
|
|
||||||
.token.string,
|
|
||||||
.token.char,
|
|
||||||
.token.builtin,
|
|
||||||
.token.inserted {
|
|
||||||
color: #a6e22e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.operator,
|
|
||||||
.token.entity,
|
|
||||||
.token.url,
|
|
||||||
.language-css .token.string,
|
|
||||||
.style .token.string,
|
|
||||||
.token.variable {
|
|
||||||
color: #CCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.atrule,
|
|
||||||
.token.attr-value,
|
|
||||||
.token.function {
|
|
||||||
color: #e6db74;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.keyword {
|
|
||||||
color: #66d9ef;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.regex,
|
|
||||||
.token.important {
|
|
||||||
color: #fd971f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.important,
|
|
||||||
.token.bold {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.token.italic {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.entity {
|
|
||||||
cursor: help;
|
|
||||||
}
|
|
||||||
/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript */
|
|
||||||
/**
|
|
||||||
* okaidia theme for JavaScript, CSS and HTML
|
|
||||||
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
|
|
||||||
* @author ocodia
|
|
||||||
*/
|
|
||||||
|
|
||||||
code,
|
|
||||||
pre {
|
|
||||||
color: #333;
|
|
||||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
||||||
direction: ltr;
|
|
||||||
text-align: left;
|
|
||||||
white-space: pre;
|
|
||||||
word-spacing: normal;
|
|
||||||
word-break: normal;
|
|
||||||
line-height: 1.5;
|
|
||||||
|
|
||||||
-moz-tab-size: 4;
|
|
||||||
-o-tab-size: 4;
|
|
||||||
tab-size: 4;
|
|
||||||
|
|
||||||
-webkit-hyphens: none;
|
|
||||||
-moz-hyphens: none;
|
|
||||||
-ms-hyphens: none;
|
|
||||||
hyphens: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Code blocks */
|
|
||||||
pre {
|
|
||||||
padding: 1em;
|
|
||||||
margin: .5em 0;
|
|
||||||
overflow: auto;
|
|
||||||
border-radius: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
:not(pre) > code,
|
|
||||||
pre {
|
|
||||||
background: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Inline code */
|
|
||||||
:not(pre) > code {
|
|
||||||
padding: .2em;
|
|
||||||
border-radius: .2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.comment,
|
|
||||||
.token.prolog,
|
|
||||||
.token.doctype,
|
|
||||||
.token.cdata {
|
|
||||||
color: slategray;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.punctuation {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.namespace {
|
|
||||||
opacity: .7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.property,
|
|
||||||
.token.tag,
|
|
||||||
.token.constant,
|
|
||||||
.token.symbol,
|
|
||||||
.token.deleted {
|
|
||||||
color: #f92672;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.boolean,
|
|
||||||
.token.number {
|
|
||||||
color: #ae81ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.selector,
|
|
||||||
.token.attr-name,
|
|
||||||
.token.string,
|
|
||||||
.token.char,
|
|
||||||
.token.builtin,
|
|
||||||
.token.inserted {
|
|
||||||
color: #a6e22e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.operator,
|
|
||||||
.token.entity,
|
|
||||||
.token.url,
|
|
||||||
.language-css .token.string,
|
|
||||||
.style .token.string,
|
|
||||||
.token.variable {
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.atrule,
|
|
||||||
.token.attr-value,
|
|
||||||
.token.function {
|
|
||||||
color: #e6db74;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.keyword {
|
|
||||||
color: #66d9ef;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.regex,
|
|
||||||
.token.important {
|
|
||||||
color: #fd971f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.important,
|
|
||||||
.token.bold {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.token.italic {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.entity {
|
|
||||||
cursor: help;
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
|
@ -1,11 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on error or variable unset
|
||||||
set -o errexit -o nounset
|
set -o errexit -o nounset
|
||||||
|
|
||||||
rev=$(git rev-parse --short HEAD)
|
rev=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
# Run mdbook to generate the book
|
||||||
|
target/debug/mdbook build book-example/
|
||||||
|
|
||||||
cd book-example/book
|
cd book-example/book
|
||||||
|
|
||||||
|
|
||||||
git init
|
git init
|
||||||
git config user.name "Mathieu David"
|
git config user.name "Mathieu David"
|
||||||
git config user.email "mathieudavid@mathieudavid.org"
|
git config user.email "mathieudavid@mathieudavid.org"
|
||||||
|
|
Loading…
Reference in a new issue