1
0
Fork 0
mirror of https://github.com/lise-henry/crowbook synced 2024-05-26 20:26:19 +02:00

Update docs dir

This commit is contained in:
Elisabeth Henry 2016-12-16 02:44:19 +01:00
parent ff290b80ee
commit aee57bb99d
17 changed files with 772 additions and 3443 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide 1. Crowbook</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-294">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-293">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -215,7 +216,7 @@ function toggle() {
<h1 id = "link-1">1. Crowbook</h1>
<p id = "para-1"><a href = "https://travis-ci.org/lise-henry/crowbook"><img src = "https://travis-ci.org/lise-henry/crowbook.svg?branch=master" title = "" alt = "Build Status" /></a></p>
<p id = "para-2">Render a book written in markdown to HTML, EPUB and/or PDF.</p>
<p id = "para-3">Crowbooks purpose is to allow you to automatically generate multiple outputs formats from a book written in Markdown. Its focus is novels, and the default settings should (hopefully) generate readable books with correct typography without requiring you to worry about it.</p>
<p id = "para-3">Crowbooks purpose is to allow you to automatically generate multiple output formats from a book written in Markdown. Its focus is novels, and the default settings should (hopefully) generate readable books with correct typography without requiring you to worry about it.</p>
<h2 id = "link-2">1.1. Example</h2>
<p id = "para-4">To see what Crowbooks output looks like, you can read the Crowbook guide rendered in <a href = "http://lise-henry.github.io/crowbook/book/book.html">HTML</a>, <a href = "http://lise-henry.github.io/crowbook/book/book.pdf">PDF</a> or <a href = "http://lise-henry.github.io/crowbook/book/book.epub">EPUB</a>.</p>
<p id = "para-5">You can also play with the <a href = "http://vps.crowdagger.fr/crowbook/">online demo version</a>.</p>
@ -224,63 +225,61 @@ function toggle() {
<h3 id = "link-4">Binaries</h3>
<p id = "para-7">See <a href = "https://github.com/lise-henry/crowbook/releases">the releases page</a> to download a precompiled binary for your architecture (currently: Linux, Windows and MacOSX). Just extract the archive and run <code>crowbook</code> (or <code>crowbook.exe</code> on Windows). You might also want to copy the binary somewhere in your <code>PATH</code> for later usage.</p>
<p id = "para-8">If you are on Debian GNU/Linux or Ubuntu (on a PC architecture), you can also download <code>.deb</code> packages on <a href = "https://github.com/lise-henry/crowbook/releases">the releases page</a>.</p>
<blockquote><p id = "para-9">Note: only the Linux binaries are really tested, please contact me if you have any trouble executing the Windows or Mac binaries.</p>
</blockquote>
<h3 id = "link-5">Using Cargo</h3>
<p id = "para-10"><a href = "https://crates.io/">Cargo</a> is the <a href = "https://www.rust-lang.org/">Rust</a>s package manager. You can <a href = "https://www.rust-lang.org/downloads.html">install it here</a>. Once it is done:</p>
<p id = "para-9"><a href = "https://crates.io/">Cargo</a> is the <a href = "https://www.rust-lang.org/">Rust</a>s package manager. You can <a href = "https://www.rust-lang.org/downloads.html">install it here</a>. Once it is done:</p>
<pre><code class = "language-bash">$ cargo install crowbook
</code></pre>
<p id = "para-11">will automatically download the latest <code>crowbook</code> release on <a href = "https://crates.io/crates/crowbook">crates.io</a>, compile it, and install it on your system.</p>
<p id = "para-10">will automatically download the latest <code>crowbook</code> release on <a href = "https://crates.io/crates/crowbook">crates.io</a>, compile it, and install it on your system.</p>
<h2 id = "link-6">1.3. Dependencies</h2>
<p id = "para-12">While there should be, strictly speaking, no real dependencies to be able to run Crowbook (it is published as a statically compiled binary), some features require additional commands to work correctly:</p>
<p id = "para-11">While there should be, strictly speaking, no real dependencies to be able to run Crowbook (it is published as a statically compiled binary), some features require additional commands to work correctly:</p>
<ul>
<li>EPUB rendering requires the <code>zip</code> command to be present on your system;</li>
<li>PDF rendering requires a working installation of LaTeX (preferably <code>xelatex</code>).</li>
</ul>
<h2 id = "link-7">1.4. Quick tour</h2>
<p id = "para-13">The simplest command is:</p>
<p id = "para-12">The simplest command is:</p>
<pre><code class = "language-bash">$ crowbook &lt;BOOK&gt;
</code></pre>
<p id = "para-14">where <code>BOOK</code> is a configuration file. Crowbook will parse this file and generate a book in HTML, EPUB, and/or PDF, according to the settings in the configuration file.</p>
<p id = "para-15">To create a new book, assuming you have a list of Markdown files, you can generate a template configuration file with the <code>--create</code> argument:</p>
<p id = "para-13">where <code>BOOK</code> is a configuration file. Crowbook will parse this file and generate a book in HTML, EPUB, and/or PDF, according to the settings in the configuration file.</p>
<p id = "para-14">To create a new book, assuming you have a list of Markdown files, you can generate a template configuration file with the <code>--create</code> argument:</p>
<pre><code class = "language-bash">$ crowbook my.book --create chapter_*.md
</code></pre>
<p id = "para-16">This will generate a default <code>my.book</code> file, which youll need to complete. This configuration file contains some metadata, options, and lists the Markdown files.</p>
<p id = "para-17">For short books containing only a single Markdown file, it is possible to embed some metadata at the beginning of the file and use the <code>--single</code> or <code>-s</code> option to run <code>crowbook</code> directly on this Markdown file and avoid creating a separate book configuration file:</p>
<p id = "para-15">This will generate a default <code>my.book</code> file, which youll need to complete. This configuration file contains some metadata, options, and lists the Markdown files.</p>
<p id = "para-16">For short books containing only a single Markdown file, it is possible to embed some metadata at the beginning of the file and use the <code>--single</code> or <code>-s</code> option to run <code>crowbook</code> directly on this Markdown file and avoid creating a separate book configuration file:</p>
<pre><code class = "language-bash">$ crowbook -s text.md
</code></pre>
<p id = "para-18">For more information see the chapters on <a href = "chapter_001.html">the arguments supported by <code>crowbook</code></a> and on <a href = "chapter_002.html">the configuration file</a>.</p>
<p id = "para-17">For more information see the chapters on <a href = "chapter_001.html">the arguments supported by <code>crowbook</code></a> and on <a href = "chapter_002.html">the configuration file</a>.</p>
<h2 id = "link-8">1.5. Current features</h2>
<h3 id = "link-9">Output formats</h3>
<p id = "para-19">Crowbook supports HTML, PDF and EPUB (either version 2 or 3) as output formats. See the Crowbook User Guide rendered in <a href = "http://lise-henry.github.io/crowbook/book/book.html">HTML</a>, <a href = "http://lise-henry.github.io/crowbook/book/book.epub">EPUB</a> and <a href = "http://lise-henry.github.io/crowbook/book.pdf">PDF</a>.</p>
<p id = "para-18">Crowbook supports HTML, PDF and EPUB (either version 2 or 3) as output formats. See the Crowbook User Guide rendered in <a href = "http://lise-henry.github.io/crowbook/book/book.html">HTML</a>, <a href = "http://lise-henry.github.io/crowbook/book/book.epub">EPUB</a> and <a href = "http://lise-henry.github.io/crowbook/book.pdf">PDF</a>.</p>
<h3 id = "link-10">Input format</h3>
<p id = "para-20">Crowbook uses <a href = "https://crates.io/crates/pulldown-cmark">pulldown-cmark</a> and thus should support most of <a href = "http://commonmark.org/">CommonMark Markdown</a>. Inline HTML, however, is not implemented, and probably wont be, as the goal is to have books that can also be generated in PDF (and maybe ODT).</p>
<p id = "para-19">Crowbook uses <a href = "https://crates.io/crates/pulldown-cmark">pulldown-cmark</a> and thus should support most of <a href = "http://commonmark.org/">CommonMark Markdown</a>. Inline HTML, however, is not implemented, and probably wont be, as the goal is to have books that can also be generated in PDF (and maybe ODT).</p>
<h3 id = "link-11">Typographic “cleaning”</h3>
<p id = "para-21">Maybe the most specific “feature” of Crowbook is that (by default, it can be deactivated) it tries to “clean” the input files. By default, it removes superfluous spaces and tries to use curly quotes. If the books language is set to french, it also tries its best to respect french typography by replacing spaces with non-breaking ones when it is appropriate (e.g. before ?, !, ; or :).</p>
<blockquote><p id = "para-22">This feature is currently limited to french language, but please <a href = "https://github.com/lise-henry/crowbook/issues/new">open an issue</a> describing typographic rules if you want it to be implemented for another language.</p>
<p id = "para-20">Maybe the most specific “feature” of Crowbook is that (by default, it can be deactivated) it tries to “clean” the input files. By default, it removes superfluous spaces and tries to use curly quotes. If the books language is set to french, it also tries its best to respect french typography by replacing spaces with non-breaking ones when it is appropriate (e.g. before ?, !, ; or :).</p>
<blockquote><p id = "para-21">Please <a href = "https://github.com/lise-henry/crowbook/issues/new">open an issue</a> describing typographic rules if you want it to be implemented for other languages.</p>
</blockquote>
<h3 id = "link-12">Links handling</h3>
<p id = "para-23">Crowbook tries to correctly translate local links in the input Markdown files: e.g. if you have a link to a markdown file that is part of your book, it will be transformed into a link inside the document.</p>
<p id = "para-22">Crowbook tries to correctly translate local links in the input Markdown files: e.g. if you have a link to a Markdown file that is part of your book, it will be transformed into a link inside the document.</p>
<h3 id = "link-13">Inline YAML blocks</h3>
<p id = "para-24">Crowbook supports inline YAML blocks:</p>
<p id = "para-23">Crowbook supports inline YAML blocks:</p>
<pre><code class = "language-yaml">---
author: Me
title: My title
---
</code></pre>
<p id = "para-25">This is mostly useful when Crowbook is run with the <code>--single</code> argument (receiving a single Markdown file instead of a book configuration file), for short texts that only contain one “chapter”.</p>
<p id = "para-24">This is mostly useful when Crowbook is run with the <code>--single</code> argument (receiving a single Markdown file instead of a book configuration file), for short texts that only contain one “chapter”.</p>
<h3 id = "link-14">Proofreading</h3>
<p id = "para-26">Crowbook can also generate “proofreading” copies in HTML or PDF, highlighting grammar errors and repetitions.</p>
<blockquote><p id = "para-27">This feature has been introduced in version <code>0.9.1</code> and is still experimental. For more information, see <a href = "chapter_004.html">the proofreading chapter of the guide</a>.</p>
<p id = "para-25">Crowbook can also generate “proofreading” copies in HTML or PDF, highlighting grammar errors and repetitions.</p>
<blockquote><p id = "para-26">This feature has been introduced in version <code>0.9.1</code> and is still experimental. For more information, see <a href = "chapter_004.html">the proofreading chapter of the guide</a>.</p>
</blockquote>
<h3 id = "link-15">Bugs</h3>
<p id = "para-28">See the <a href = "https://github.com/lise-henry/crowbook/issues">githubs issue tracker</a>.</p>
<p id = "para-27">See the <a href = "https://github.com/lise-henry/crowbook/issues">githubs issue tracker</a>.</p>
<h2 id = "link-16">1.6. Contributors</h2>
<ul>
<li><a href = "http://stephanemourey.fr/">Stéphane Mourey</a> <code>&lt;s+crowbook AT stephanemourey DOT fr&gt;</code></li>
</ul>
<h2 id = "link-17">1.7. Acknowledgements</h2>
<p id = "para-29">Besides the <a href = "https://www.rust-lang.org/">Rust</a> compiler and standard library, Crowbook uses the following libraries:</p>
<p id = "para-28">Besides the <a href = "https://www.rust-lang.org/">Rust</a> compiler and standard library, Crowbook uses the following libraries:</p>
<ul>
<li><a href = "https://crates.io/crates/pulldown-cmark">pulldown-cmark</a></li>
<li><a href = "https://crates.io/crates/yaml-rust">yaml-rust</a></li>
@ -299,28 +298,32 @@ title: My title
<li><a href = "https://crates.io/crates/regex">regex</a></li>
<li><a href = "https://crates.io/crates/term">term</a></li>
</ul>
<p id = "para-30">It also embeds <a href = "https://highlightjs.org/">Highlight.js</a> in HTML output to enable syntax highlighting for code blocks.</p>
<p id = "para-31">It also uses configuration files from <a href = "https://github.com/japaric/rust-everywhere">rust-everywhere</a> to use <a href = "https://travis-ci.org/">Travis</a> and <a href = "http://www.appveyor.com/">Appveyor</a> to generate binaries for various platforms on each release.</p>
<p id = "para-32">While Crowbook directly doesnt use them, there was also inspiration from <a href = "http://pandoc.org/">Pandoc</a> and <a href = "https://github.com/azerupi/mdBook">mdBook</a>.</p>
<p id = "para-33">Also, the <a href = "https://validator.w3.org/">W3C HTML validator</a> and the <a href = "http://validator.idpf.org/">IDPF EPUB validator</a> proved very useful during development.</p>
<p id = "para-29">It also embeds <a href = "https://highlightjs.org/">Highlight.js</a> in HTML output to enable syntax highlighting for code blocks.</p>
<p id = "para-30">It also uses configuration files from <a href = "https://github.com/japaric/rust-everywhere">rust-everywhere</a> to use <a href = "https://travis-ci.org/">Travis</a> and <a href = "http://www.appveyor.com/">Appveyor</a> to generate binaries for various platforms on each release.</p>
<p id = "para-31">While Crowbook directly doesnt use them, there was also inspiration from <a href = "http://pandoc.org/">Pandoc</a> and <a href = "https://github.com/azerupi/mdBook">mdBook</a>.</p>
<p id = "para-32">Also, the <a href = "https://validator.w3.org/">W3C HTML validator</a> and the <a href = "http://validator.idpf.org/">IDPF EPUB validator</a> proved very useful during development.</p>
<h2 id = "link-18">1.8. ChangeLog</h2>
<p id = "para-34">See <a href = "chapter_006.html">ChangeLog</a>.</p>
<p id = "para-33">See <a href = "chapter_006.html">ChangeLog</a>.</p>
<h2 id = "link-19">1.9. Library</h2>
<p id = "para-35">While the main purpose of Crowbook is to be run as a standalone program, the code is written as a library, so if you want to build on it you can use it as such. You can look at the generated documentation on <a href = "https://docs.rs/releases/search?query=crowbook">docs.rs</a>.</p>
<p id = "para-36">Additionally, <a href = "https://github.com/lise-henry/crowbook-text-processing/">crowbook-text-processing</a> is a separate library containing all the “typographic” functions (smart quotes, handling of non-breaking spaces in french, ...).</p>
<p id = "para-34">While the main purpose of Crowbook is to be run as a standalone program, the code is written as a library, so if you want to build on it you can use it as such. You can look at the generated documentation on <a href = "https://docs.rs/releases/search?query=crowbook">docs.rs</a>.</p>
<p id = "para-35">Note that, in order to facilitate code reuse, some features have been split to separate libraries:</p>
<ul>
<li><a href = "https://github.com/lise-henry/crowbook-text-processing/">crowbook-text-processing</a> contains all the “typographic” functions (smart quotes, handling of non-breaking spaces in french, ...).</li>
<li><a href = "https://github.com/lise-henry/crowbook-intl/">crowbook-intl</a> is used for the internationalization (translation) process.</li>
</ul>
<h2 id = "link-20">1.10. License</h2>
<p id = "para-37">Crowbook is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL), version 2.1 or (at your option) any ulterior version. See <a href = "chapter_007.html">LICENSE</a> for more information.</p>
<p id = "para-38">Crowbooks logo is licensed under the <a href = "https://creativecommons.org/licenses/by/4.0/deed.en">Creative Commons Attribution 4.0 International license</a>, based on the <a href = "https://commons.wikimedia.org/wiki/File:Rust_programming_language_black_logo.svg">Rust logo</a> by Mozilla Corporation.</p>
<p id = "para-39">Crowbook includes binary (minified) CSS and Javascript files from <a href = "https://highlightjs.org/">Highlight.js</a>, written by Ivan Sagalaev, licensed under the following terms:</p>
<blockquote><p id = "para-40">Copyright (c) 2006, Ivan Sagalaev</p>
<p id = "para-41">All rights reserved.</p>
<p id = "para-42">Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<p id = "para-36">Crowbook is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL), version 2.1 or (at your option) any ulterior version. See <a href = "chapter_007.html">LICENSE</a> for more information.</p>
<p id = "para-37">Crowbooks logo is licensed under the <a href = "https://creativecommons.org/licenses/by/4.0/deed.en">Creative Commons Attribution 4.0 International license</a>, based on the <a href = "https://commons.wikimedia.org/wiki/File:Rust_programming_language_black_logo.svg">Rust logo</a> by Mozilla Corporation.</p>
<p id = "para-38">Crowbook includes binary (minified) CSS and Javascript files from <a href = "https://highlightjs.org/">Highlight.js</a>, written by Ivan Sagalaev, licensed under the following terms:</p>
<blockquote><p id = "para-39">Copyright (c) 2006, Ivan Sagalaev</p>
<p id = "para-40">All rights reserved.</p>
<p id = "para-41">Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ul>
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of highlight.js nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ul>
<p id = "para-43">THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
<p id = "para-42">THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</blockquote>
<p class = "next_chapter">
@ -330,7 +333,7 @@ title: My title
</p>
</div>
</div>
<footer id = "footer"><p id = "para-293">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-292">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide 2. Arguments</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-296">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-295">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -217,7 +218,7 @@ function toggle() {
</a>
</p>
<h1 id = "link-21">2. Arguments</h1>
<p id = "para-44">Crowbook can take a number of arguments:</p>
<p id = "para-43">Crowbook can take a number of arguments:</p>
<pre><code class = "language-text">Render a Markdown book in EPUB, PDF or HTML.
USAGE:
@ -242,19 +243,19 @@ OPTIONS:
ARGS:
&lt;BOOK&gt; File containing the book configuration file, or a Markdown file when called with --single
</code></pre>
<p id = "para-45">Note that Crowbook generates output files relatively to the directory where &lt;BOOK&gt; is:</p>
<p id = "para-44">Note that Crowbook generates output files relatively to the directory where &lt;BOOK&gt; is:</p>
<pre><code class = "language-bash">$ crowbook foo/bar.book --to pdf --output baz.pdf
</code></pre>
<p id = "para-46">will thus generate “baz.pdf” in directory “foo” and not in the current directory.</p>
<p id = "para-47">The most important option is obviously &lt;BOOK&gt;, i.e. the book configuration file. It is mandatory in most cases: if you dont pass it, Crowbook will simply display this help message. In a normal use case this is the only argument youll need to pass, and Crowbook will generate the book in all formats specified in the configuration file.</p>
<p id = "para-48">It is, however, possible to pass more arguments to <code>crowbook</code>:</p>
<p id = "para-45">will thus generate “baz.pdf” in directory “foo” and not in the current directory.</p>
<p id = "para-46">The most important option is obviously &lt;BOOK&gt;, i.e. the book configuration file. It is mandatory in most cases: if you dont pass it, Crowbook will simply display this help message. In a normal use case this is the only argument youll need to pass, and Crowbook will generate the book in all formats specified in the configuration file.</p>
<p id = "para-47">It is, however, possible to pass more arguments to <code>crowbook</code>:</p>
<h2 id = "link-22">2.1. <code>--create</code></h2>
<p id = "para-49"><b>Usage</b>: <code>crowbook [BOOK] --create file_1.md file_2.md ...</code></p>
<p id = "para-50">Creates a new book from a list of Markdown files. It will generate a book configuration file with all file names specified as chapters. It either prints the result to stdout (if <code>BOOK</code> is not specified) or generate the file <code>BOOK</code> (or abort if it already exists).</p>
<p id = "para-48"><b>Usage</b>: <code>crowbook [BOOK] --create file_1.md file_2.md ...</code></p>
<p id = "para-49">Creates a new book from a list of Markdown files. It will generate a book configuration file with all file names specified as chapters. It either prints the result to stdout (if <code>BOOK</code> is not specified) or generate the file <code>BOOK</code> (or abort if it already exists).</p>
<h3 id = "link-23">Examples</h3>
<pre><code class = "language-bash">crowbook foo.book --create README.md ChangeLog.md LICENSE.md
</code></pre>
<p id = "para-51">will generate a file <code>foo.book</code> containing:</p>
<p id = "para-50">will generate a file <code>foo.book</code> containing:</p>
<pre><code class = "language-yaml">author: Your name
title: Your title
lang: en
@ -272,14 +273,14 @@ lang: en
+ ChangeLog.md
+ LICENSE.md
</code></pre>
<p id = "para-52">while</p>
<p id = "para-51">while</p>
<pre><code class = "language-bash">crowbook --create README.md ChangeLog.md LICENSE.md
</code></pre>
<p id = "para-53">will print the same result, but to stdout (without creating a file).</p>
<p id = "para-54">When <code>crowbook</code> is runned with <code>--create</code>, it can also use the keys/values set by <code>--set</code> (see below):</p>
<p id = "para-52">will print the same result, but to stdout (without creating a file).</p>
<p id = "para-53">When <code>crowbook</code> is runned with <code>--create</code>, it can also use the keys/values set by <code>--set</code> (see below):</p>
<pre><code class = "language-bash">$ crowbook foo.book --create file1.md file2.md --set author "Pierre Dupont" title "Mon œuvre" lang fr
</code></pre>
<p id = "para-55">will generate a <code>foo.book</code> file containing:</p>
<p id = "para-54">will generate a <code>foo.book</code> file containing:</p>
<pre><code class = "language-yaml">author: Pierre Dupont
title: Mon œuvre
lang: fr
@ -289,83 +290,83 @@ lang: fr
+ file2.md
</code></pre>
<h2 id = "link-24">2.2. <code>--single</code></h2>
<p id = "para-56"><b>usage</b>: <code>crowbook --single &lt;FILE&gt;</code></p>
<p id = "para-57">(or <code>crowbook -s &lt;FILE&gt;</code>)</p>
<p id = "para-58">This argument allows to give <code>crowbook</code> a single Markdown file. This file can contain an inline YAML block to set some book options. Inline YAML blocks must start and end with a line with <code>---</code> (three dashes). E.g:</p>
<p id = "para-55"><b>usage</b>: <code>crowbook --single &lt;FILE&gt;</code></p>
<p id = "para-56">(or <code>crowbook -s &lt;FILE&gt;</code>)</p>
<p id = "para-57">This argument allows to give <code>crowbook</code> a single Markdown file. This file can contain an inline YAML block to set some book options. Inline YAML blocks must start and end with a line with <code>---</code> (three dashes). E.g:</p>
<pre><code class = "language-yaml">---
author: Joan Doe
title: A short story
output.html: short.html
---
</code></pre>
<p id = "para-59">If this YAML block is not at the beginning of a file, it must also be preceded by a blank line.</p>
<p id = "para-60">This allows to not have to write a <code>.book</code> configuration file for a short story or an article. <code>crowbook --single foo.md</code> is rougly equivalent to having a book configuration file containing:</p>
<p id = "para-58">If this YAML block is not at the beginning of a file, it must also be preceded by a blank line.</p>
<p id = "para-59">This allows to not have to write a <code>.book</code> configuration file for a short story or an article. <code>crowbook --single foo.md</code> is rougly equivalent to having a book configuration file containing:</p>
<pre><code class = "language-yaml">! foo.md
</code></pre>
<p id = "para-61">That is, the chapter heading (if any) wont be displayed in the output documents (though they still appear in the TOC).</p>
<blockquote><p id = "para-62">Note that by default, using <code>--single</code> sets the default LaTeX class of the book to <code>article</code> instead of <code>book</code>.</p>
<p id = "para-60">That is, the chapter heading (if any) wont be displayed in the output documents (though they still appear in the TOC).</p>
<blockquote><p id = "para-61">Note that by default, using <code>--single</code> sets the default LaTeX class of the book to <code>article</code> instead of <code>book</code>.</p>
</blockquote>
<h2 id = "link-25">2.3. <code>--set</code></h2>
<p id = "para-63"><b>usage</b>: <code>crowbook &lt;BOOK&gt; --set [KEY] [VALUE]...</code></p>
<p id = "para-64">This argument takes a list of <code>KEY</code> <code>VALUE</code> pairs and allows setting or overriding a book configuration option. All valid options in the configuration files are valid as keys. For more information, see <a href = "chapter_002.html">the configuration file</a>.</p>
<p id = "para-62"><b>usage</b>: <code>crowbook &lt;BOOK&gt; --set [KEY] [VALUE]...</code></p>
<p id = "para-63">This argument takes a list of <code>KEY</code> <code>VALUE</code> pairs and allows setting or overriding a book configuration option. All valid options in the configuration files are valid as keys. For more information, see <a href = "chapter_002.html">the configuration file</a>.</p>
<h3 id = "link-26">Examples</h3>
<pre><code class = "language-bash">$ crowbook foo.book --set html.css style.css
</code></pre>
<p id = "para-65">will override the CSS for HTML generation (the <code>html.css</code> key) to the file <code>style.css</code>.</p>
<p id = "para-64">will override the CSS for HTML generation (the <code>html.css</code> key) to the file <code>style.css</code>.</p>
<pre><code class = "language-bash">$ crowbook foo.book --set author Foo title Bar
</code></pre>
<p id = "para-66">will override the book title to <code>Bar</code> and its author to <code>Foo</code>.</p>
<p id = "para-65">will override the book title to <code>Bar</code> and its author to <code>Foo</code>.</p>
<h2 id = "link-27">2.4. <code>--proofread</code></h2>
<p id = "para-67">Equivalent to <code>--set proofread true</code>. Enable proofreading. See <a href = "chapter_004.html">Proofreading</a>.</p>
<p id = "para-66">Equivalent to <code>--set proofread true</code>. Enable proofreading. See <a href = "chapter_004.html">Proofreading</a>.</p>
<h2 id = "link-28">2.5. <code>--list-options</code></h2>
<p id = "para-68"><b>usage</b>: <code>crowbook --list-options</code></p>
<p id = "para-69">(or <code>crowbook -l</code>)</p>
<p id = "para-70">Displays all the valid options to use, whether in a book configuration file, with <code>--set</code>, or in an inline YAML block.</p>
<p id = "para-67"><b>usage</b>: <code>crowbook --list-options</code></p>
<p id = "para-68">(or <code>crowbook -l</code>)</p>
<p id = "para-69">Displays all the valid options to use, whether in a book configuration file, with <code>--set</code>, or in an inline YAML block.</p>
<h2 id = "link-29">2.6. <code>--print-template</code></h2>
<p id = "para-71"><b>usage</b>: <code>crowbook --print-template template</code></p>
<p id = "para-72">Prints the built-in template to stdout. Useful if you want to customize the appearance of your document. E.g., if you want to modify the CSS used for HTML rendering:</p>
<p id = "para-70"><b>usage</b>: <code>crowbook --print-template template</code></p>
<p id = "para-71">Prints the built-in template to stdout. Useful if you want to customize the appearance of your document. E.g., if you want to modify the CSS used for HTML rendering:</p>
<pre><code class = "language-bash">$ crowbook --print-template html.css &gt; my_style.css
# edit my_style.css in your favourite editor
$ crowbook my.book --set html.css my_style.css
# or add "html.css: my_style.css" in my.book
</code></pre>
<p id = "para-73">Note that it is possible to use this option in conjonction with <code>--set</code>, though it is currently only useful for EPUB template:</p>
<p id = "para-72">Note that it is possible to use this option in conjonction with <code>--set</code>, though it is currently only useful for EPUB template:</p>
<pre><code class = "language-bash">$ crowbook --print-template epub.template --set epub.version 2
# Returns the template for Epub 2 (currently it is the default one)
$ crowbook --print-template epub.template --set epub.version 3
# Returns the template for Epub 3
</code></pre>
<h2 id = "link-30">2.7. <code>--verbose</code></h2>
<p id = "para-74"><b>usage</b>: <code>crowbook &lt;BOOK&gt; --verbose</code></p>
<p id = "para-75">If this flag is set, Crowbook will print the warnings it detects while parsing and rendering. These warnings are typically related to the inclusion of non-local images, linking to Markdown files that are not part of the book, and so on.</p>
<p id = "para-73"><b>usage</b>: <code>crowbook &lt;BOOK&gt; --verbose</code></p>
<p id = "para-74">If this flag is set, Crowbook will print the warnings it detects while parsing and rendering. These warnings are typically related to the inclusion of non-local images, linking to Markdown files that are not part of the book, and so on.</p>
<h2 id = "link-31">2.8. <code>--to</code></h2>
<p id = "para-76"><b>usage</b>: <code>crowbook &lt;BOOK&gt;--to [FORMAT]</code></p>
<p id = "para-77">(or <code>crowbook &lt;BOOK&gt; -t [FORMAT]</code>)</p>
<p id = "para-78">Generate only the specified format. <code>FORMAT</code> must be either <code>epub</code>, <code>pdf</code>, <code>html</code>, <code>odt</code> or <code>tex</code>.</p>
<p id = "para-79">If an output file for the format is not specified in the book configuration file, <code>crowbook</code> will fail to render PDF, ODT and EPUB, whereas it will print HTML and TeX files on stdout. It is, however, possible to specify a file with the <code>--output</code> option.</p>
<p id = "para-75"><b>usage</b>: <code>crowbook &lt;BOOK&gt;--to [FORMAT]</code></p>
<p id = "para-76">(or <code>crowbook &lt;BOOK&gt; -t [FORMAT]</code>)</p>
<p id = "para-77">Generate only the specified format. <code>FORMAT</code> must be either <code>epub</code>, <code>pdf</code>, <code>html</code>, <code>odt</code> or <code>tex</code>.</p>
<p id = "para-78">If an output file for the format is not specified in the book configuration file, <code>crowbook</code> will fail to render PDF, ODT and EPUB, whereas it will print HTML and TeX files on stdout. It is, however, possible to specify a file with the <code>--output</code> option.</p>
<h3 id = "link-32">Examples</h3>
<pre><code class = "language-bash">crowbook --to html foo.book
</code></pre>
<p id = "para-80">will generate some HTML, and prints it either to the file specified by <code>output.html</code> in <code>foo.book</code>, or to stdout if it is not specified.</p>
<p id = "para-79">will generate some HTML, and prints it either to the file specified by <code>output.html</code> in <code>foo.book</code>, or to stdout if it is not specified.</p>
<pre><code class = "language-bash">crowbook --to pdf --output foo.pdf foo.book
</code></pre>
<p id = "para-81">will generate a <code>foo.pdf</code> file.</p>
<p id = "para-80">will generate a <code>foo.pdf</code> file.</p>
<h2 id = "link-33">2.9. <code>--output</code></h2>
<p id = "para-82"><b>usage</b>: <code>crowbook &lt;BOOK&gt; --to &lt;FORMAT&gt; --output &lt;FILE&gt;</code></p>
<p id = "para-83">(or <code>crowbook -t &lt;FORMAT&gt; -o &lt;FILE&gt; &lt;BOOK&gt;</code>)</p>
<p id = "para-84">Specifies an output file. Only valid when <code>--to</code> is used.</p>
<p id = "para-85">Note that Crowbook generates output files relatively to the directory where <code>BOOK</code> is (unless the option <code>output.base_path</code> is set):</p>
<p id = "para-81"><b>usage</b>: <code>crowbook &lt;BOOK&gt; --to &lt;FORMAT&gt; --output &lt;FILE&gt;</code></p>
<p id = "para-82">(or <code>crowbook -t &lt;FORMAT&gt; -o &lt;FILE&gt; &lt;BOOK&gt;</code>)</p>
<p id = "para-83">Specifies an output file. Only valid when <code>--to</code> is used.</p>
<p id = "para-84">Note that Crowbook generates output files relatively to the directory where <code>BOOK</code> is (unless the option <code>output.base_path</code> is set):</p>
<pre><code class = "language-bash">$ crowbook foo/bar.book --to pdf --output baz.pdf
</code></pre>
<p id = "para-86">will thus generate <code>baz.pdf</code> in directory <code>foo</code> and not in current directory.</p>
<p id = "para-85">will thus generate <code>baz.pdf</code> in directory <code>foo</code> and not in current directory.</p>
<h2 id = "link-34">2.10. <code>--lang</code></h2>
<p id = "para-87"><b>usage</b>: <code>crowbook --lang &lt;LANG&gt;</code></p>
<p id = "para-88">(or <code>crowbook -L &lt;LANG&gt;</code>)</p>
<p id = "para-89">Set the runtime language used by Crowbook. Currently, only a french translation is available. By default, Crowbook uses the <code>LANG</code> environment variable to determine which language to use, but this option allows to override it (e.g. for operating systems that dont use such an option, such as Windows).</p>
<p id = "para-86"><b>usage</b>: <code>crowbook --lang &lt;LANG&gt;</code></p>
<p id = "para-87">(or <code>crowbook -L &lt;LANG&gt;</code>)</p>
<p id = "para-88">Set the runtime language used by Crowbook. Currently, only a french translation is available. By default, Crowbook uses the <code>LANG</code> environment variable to determine which language to use, but this option allows to override it (e.g. for operating systems that dont use such an option, such as Windows).</p>
<h3 id = "link-35">Example</h3>
<p id = "para-90"><code>$ crowbook --lang fr --help</code></p>
<p id = "para-91">will display Crowbooks help messages in french.</p>
<blockquote><p id = "para-92">Note that this argument has nothing to do with the <code>lang</code> option that you can set in the book configuration file, which specifies the language <em>of the book</em>. This argument specifies the language of the text messages that Crowbook will display while running.</p>
<p id = "para-89"><code>$ crowbook --lang fr --help</code></p>
<p id = "para-90">will display Crowbooks help messages in french.</p>
<blockquote><p id = "para-91">Note that this argument has nothing to do with the <code>lang</code> option that you can set in the book configuration file, which specifies the language <em>of the book</em>. This argument specifies the language of the text messages that Crowbook will display while running.</p>
</blockquote>
<p class = "next_chapter">
@ -375,7 +376,7 @@ $ crowbook --print-template epub.template --set epub.version 3
</p>
</div>
</div>
<footer id = "footer"><p id = "para-295">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-294">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide 3. The configuration file</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-298">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-297">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -217,8 +218,8 @@ function toggle() {
</a>
</p>
<h1 id = "link-36">3. The configuration file</h1>
<p id = "para-93">If you want to use Crowbook for your book, this configuration file is all youll have to add (assuming you already have the book in Markdown files; if you dont, youll also have to write a book first, but thats besides the scope of this document).</p>
<p id = "para-94">The format is not very complicated. This is an example of it:</p>
<p id = "para-92">If you want to use Crowbook for your book, this configuration file is all youll have to add (assuming you already have the book in Markdown files; if you dont, youll also have to write a book first, but thats besides the scope of this document).</p>
<p id = "para-93">The format is not very complicated. This is an example of it:</p>
<pre><code class = "language-yaml"># metadata
author: Joan Doe
title: Some book
@ -234,14 +235,14 @@ output.html: some_book.html
+ chapter_4.md
- epilogue.md
</code></pre>
<p id = "para-95">Basically, it is divided in two parts:</p>
<p id = "para-94">Basically, it is divided in two parts:</p>
<ul>
<li>a list of options, under the form <code>key: value</code>, following YAML syntax.</li>
<li>a list of Markdown files.</li>
</ul>
<p id = "para-96">Lines starting with the <code>#</code> characters are comments and are discarded.</p>
<p id = "para-95">Lines starting with the <code>#</code> characters are comments and are discarded.</p>
<h2 id = "link-37">3.1. Configuration in an inline YAML block (<code>crowbook --single</code>)</h2>
<p id = "para-97">Sometimes, you only have one Markdown file and might not want to have a separate configuration file. In this case, you can specify options at the beginning of your Markdown file, using an inline YAML block, separated by two lines containing only <code>---</code>:</p>
<p id = "para-96">Sometimes, you only have one Markdown file and might not want to have a separate configuration file. In this case, you can specify options at the beginning of your Markdown file, using an inline YAML block, separated by two lines containing only <code>---</code>:</p>
<pre><code class = "language-markdown">---
author: Joan Doe
title: Some (short) book
@ -254,22 +255,22 @@ output.html: some_book.html
The book content, formatted in Markdown.
</code></pre>
<p id = "para-98">This method only allows to set up options: you cant include a list of chapters in this way, since the only “chapter” that will be included is this Markdown file itself.</p>
<p id = "para-99">You can then use</p>
<p id = "para-97">This method only allows to set up options: you cant include a list of chapters in this way, since the only “chapter” that will be included is this Markdown file itself.</p>
<p id = "para-98">You can then use</p>
<pre><code class = "language-bash">crowbook --single some_book.md
</code></pre>
<p id = "para-100">to generate output formats from this Markdown file.</p>
<blockquote><p id = "para-101">By default (unless <code>input.yaml_blocks</code> is set to true), Crowboook will only read those inline blocks when it is runned with <code>crowbook --single</code> (or <code>crowbook -s</code>).</p>
<p id = "para-99">to generate output formats from this Markdown file.</p>
<blockquote><p id = "para-100">By default (unless <code>input.yaml_blocks</code> is set to true), Crowboook will only read those inline blocks when it is runned with <code>crowbook --single</code> (or <code>crowbook -s</code>).</p>
</blockquote>
<h2 id = "link-38">3.2. The list of files</h2>
<p id = "para-102">There are various options to include a Markdown file.</p>
<p id = "para-101">There are various options to include a Markdown file.</p>
<ul>
<li><code>+ file_name.md</code> includes a numbered chapter.</li>
<li><code>- file_name.md</code> includes an unnumbered chapter.</li>
<li><code>! file_name.md</code> includes a chapter whose title wont be displayed (except in the table of contents); this is useful for e.g. including a copyright at the beginning or the book, or for short stories where there is only one chapter.</li>
<li><code>42. file_name.md</code> specifies the number for a chapter.</li>
</ul>
<p id = "para-103">So a typical usage might look like this:</p>
<p id = "para-102">So a typical usage might look like this:</p>
<pre><code class = "language-yaml">! copyright.md
- preface.md
0. chapter_0.md # We want to start at chapter 0 instead of 1
@ -278,44 +279,44 @@ The book content, formatted in Markdown.
+ chapter_2.md
...
</code></pre>
<p id = "para-104">There are two important things to note:</p>
<p id = "para-103">There are two important things to note:</p>
<ol>
<li>you must <em>not</em> use quotes around the file names.</li>
<li>the path of these files are relative to the directory where your configuration file is. This means you can run <code>crowbook books/my_trilogy/first_book/config.book</code> without being in the books directory.</li>
</ol>
<p id = "para-105">Also note that you dont have to specify a title. This is because the title of the chapter is inferred from the Markdown document. To go back to our previous example:</p>
<p id = "para-104">Also note that you dont have to specify a title. This is because the title of the chapter is inferred from the Markdown document. To go back to our previous example:</p>
<pre><code>+ chapter_1.md
</code></pre>
<p id = "para-106">does not specify a chapter title, because it will read it directly in <code>chapter_1.md</code>, e.g.:</p>
<p id = "para-105">does not specify a chapter title, because it will read it directly in <code>chapter_1.md</code>, e.g.:</p>
<pre><code class = "language-markdown">The day I was born
==================
...
</code></pre>
<p id = "para-107">You should have one and only one level-one header (i.e. chapter title) in each markdown file.</p>
<p id = "para-108">If you have more than one, Crowbook will print a warning and treat it as another chapter (numbered according to the scheme specified for including the file). It might however mess the table of contents in some cases (e.g. for Epub).</p>
<p id = "para-109">If you do <em>not</em> have a level-1 header in a markdown file:</p>
<p id = "para-106">You should have one and only one level-one header (i.e. chapter title) in each markdown file.</p>
<p id = "para-107">If you have more than one, Crowbook will print a warning and treat it as another chapter (numbered according to the scheme specified for including the file). It might however mess the table of contents in some cases (e.g. for Epub).</p>
<p id = "para-108">If you do <em>not</em> have a level-1 header in a markdown file:</p>
<ul>
<li>if it is a numbered chapter, Crowbook will infer a chapter name from the numbering scheme;</li>
<li>if it is not numbered, chapters title will default to the empty string and wont be displayed in the TOC.</li>
</ul>
<h2 id = "link-39">3.3. Crowbook options</h2>
<p id = "para-110">The first part of the configuration file is dedicated to pass options to Crowbook. This is <a href = "https://en.wikipedia.org/wiki/YAML">YAML syntax</a>, so each line should be of the form <code>key: value</code>. Note that in most cases you dont have to put string in quotes, e.g.:</p>
<p id = "para-109">The first part of the configuration file is dedicated to pass options to Crowbook. This is <a href = "https://en.wikipedia.org/wiki/YAML">YAML syntax</a>, so each line should be of the form <code>key: value</code>. Note that in most cases you dont have to put string in quotes, e.g.:</p>
<pre><code class = "language-yaml">title: My title
</code></pre>
<p id = "para-111">It is however possible (and sometimes necessary) to escape some characters to use quotes around strings:</p>
<p id = "para-110">It is however possible (and sometimes necessary) to escape some characters to use quotes around strings:</p>
<pre><code class = "language-yaml">title: "My: title!"
</code></pre>
<p id = "para-112">It is possible to use multiline strings with <code>&gt;-</code> and then indenting the lines that are part of the string:</p>
<p id = "para-111">It is possible to use multiline strings with <code>&gt;-</code> and then indenting the lines that are part of the string:</p>
<pre><code class = "language-yaml">title: &gt;-
A
long
title
author: Joan Doe
</code></pre>
<p id = "para-113">will set <code>title</code> to <code>“A long title”</code>. See <a href = "https://en.wikipedia.org/wiki/YAML#Block_literals">block literals in YAML</a> for more information on the various way to insert multiline strings (which mostly change the way newlines will or wont be inserted).</p>
<p id = "para-114">A final note on the syntax: all options must be set <em>before</em> the first chapter inclusion (that is, a line beginning with +, -, x. (where <code>x</code> is a number) or !).</p>
<p id = "para-115">Here is the complete list of options, with a short description. The usage of some of them is detailed later on.</p>
<p id = "para-112">will set <code>title</code> to <code>“A long title”</code>. See <a href = "https://en.wikipedia.org/wiki/YAML#Block_literals">block literals in YAML</a> for more information on the various way to insert multiline strings (which mostly change the way newlines will or wont be inserted).</p>
<p id = "para-113">A final note on the syntax: all options must be set <em>before</em> the first chapter inclusion (that is, a line beginning with +, -, x. (where <code>x</code> is a number) or !).</p>
<p id = "para-114">Here is the complete list of options, with a short description. The usage of some of them is detailed later on.</p>
<h3 id = "link-40">Metadata</h3>
<ul>
<li><b><code>author</code></b><ul>
@ -339,13 +340,13 @@ author: Joan Doe
<li><b><code>subject</code></b><ul>
<li><b>type</b>: metadata</li>
<li><b>default value</b>: <code>not set</code></li>
<li>Subject of the book (used for EPUB metadata</li>
<li>Subject of the book (used for EPUB metadata)</li>
</ul>
</li>
<li><b><code>description</code></b><ul>
<li><b>type</b>: metadata</li>
<li><b>default value</b>: <code>not set</code></li>
<li>Description of the book (used for EPUB metadata</li>
<li>Description of the book (used for EPUB metadata)</li>
</ul>
</li>
<li><b><code>cover</code></b><ul>
@ -465,6 +466,12 @@ author: Joan Doe
</ul>
<h3 id = "link-45">HTML options</h3>
<ul>
<li><b><code>html.icon</code></b><ul>
<li><b>type</b>: path</li>
<li><b>default value</b>: <code>not set</code></li>
<li>Path to an icon to be used for the HTML files(s)</li>
</ul>
</li>
<li><b><code>html.header</code></b><ul>
<li><b>type</b>: string</li>
<li><b>default value</b>: <code>not set</code></li>
@ -483,6 +490,12 @@ author: Joan Doe
<li>Path of a stylesheet for HTML rendering</li>
</ul>
</li>
<li><b><code>html.css.add</code></b><ul>
<li><b>type</b>: string</li>
<li><b>default value</b>: <code>not set</code></li>
<li>Some inline CSS added to the stylesheet template</li>
</ul>
</li>
<li><b><code>html.css.colours</code></b><ul>
<li><b>type</b>: template path</li>
<li><b>default value</b>: <code>not set</code></li>
@ -582,6 +595,12 @@ author: Joan Doe
<li>Path of a stylesheet for EPUB</li>
</ul>
</li>
<li><b><code>epub.css.add</code></b><ul>
<li><b>type</b>: string</li>
<li><b>default value</b>: <code>not set</code></li>
<li>Inline CSS added to the EPUB stylesheet template</li>
</ul>
</li>
<li><b><code>epub.chapter.xhtml</code></b><ul>
<li><b>type</b>: template path</li>
<li><b>default value</b>: <code>not set</code></li>
@ -609,12 +628,36 @@ author: Joan Doe
<li>Path of a LaTeX template file</li>
</ul>
</li>
<li><b><code>tex.template.add</code></b><ul>
<li><b>type</b>: string</li>
<li><b>default value</b>: <code>not set</code></li>
<li>Inline code added in the LaTeX template</li>
</ul>
</li>
<li><b><code>tex.class</code></b><ul>
<li><b>type</b>: string</li>
<li><b>default value</b>: <code>book</code></li>
<li>LaTeX class to use</li>
</ul>
</li>
<li><b><code>tex.paper_size</code></b><ul>
<li><b>type</b>: string</li>
<li><b>default value</b>: <code>a5paper</code></li>
<li>Specifies the size of the page.</li>
</ul>
</li>
<li><b><code>tex.title</code></b><ul>
<li><b>type</b>: boolean</li>
<li><b>default value</b>: <code>true</code></li>
<li>If true, generate a title with maketitle</li>
</ul>
</li>
<li><b><code>tex.font_size</code></b><ul>
<li><b>type</b>: integer</li>
<li><b>default value</b>: <code>not set</code></li>
<li>Specify latex font size (in pt, 10 (default), 11, or 12 are accepted)</li>
</ul>
</li>
</ul>
<h3 id = "link-50">Resources option</h3>
<ul>
@ -799,16 +842,16 @@ author: Joan Doe
</ul>
</li>
</ul>
<p id = "para-116">Note that these options have a type, which in most case should be pretty straightforward (a boolean can be <code>true</code> or <code>false</code>, an integer must be composed by a number, a string is, well, any string). The <code>path</code> type might puzzle you a bit, but its equivalent to a string, except Crowbook will consider it relatively to the book file. The <code>template path</code> type is just the <code>path</code> of a template. Metadata are just strings.</p>
<p id = "para-115">Note that these options have a type, which in most case should be pretty straightforward (a boolean can be <code>true</code> or <code>false</code>, an integer must be composed by a number, a string is, well, any string). The <code>path</code> type might puzzle you a bit, but its equivalent to a string, except Crowbook will consider it relatively to the book file. The <code>template path</code> type is just the <code>path</code> of a template. Metadata are just strings.</p>
<h3 id = "link-55">Metadata</h3>
<p id = "para-117">Metadata are data about the book. Except for <code>cover</code>, which points to an image file, all its fields are strings. The main metadata are:</p>
<p id = "para-116">Metadata are data about the book. Except for <code>cover</code>, which points to an image file, all its fields are strings. The main metadata are:</p>
<ul>
<li><code>author</code>: the author(s) of the book.</li>
<li><code>title</code>: the title of the book.</li>
<li><code>lang</code>: the language of the book. The unicode language code should be used, e.g. <code>en_GB</code> or <code>en</code>, <code>fr_FR</code>, ...</li>
<li><code>cover</code>: path to an image file for the cover of the book (not displayed in all output formats).</li>
</ul>
<p id = "para-118">There are also additional metadata:</p>
<p id = "para-117">There are also additional metadata:</p>
<ul>
<li><code>subject</code></li>
<li><code>description</code></li>
@ -816,10 +859,10 @@ author: Joan Doe
<li><code>version</code></li>
<li><code>date</code></li>
</ul>
<p id = "para-119">You can define your own metadata by starting an option name with <code>metadata.foo</code>.</p>
<p id = "para-120">All metadata are accessible from templates, see <a href = "chapter_003.html">Templates</a>.</p>
<p id = "para-118">You can define your own metadata by starting an option name with <code>metadata.foo</code>.</p>
<p id = "para-119">All metadata are accessible from templates, see <a href = "chapter_003.html">Templates</a>.</p>
<h3 id = "link-56">The <code>import_config</code> special option</h3>
<p id = "para-121">The special <code>import_config</code> option allows you to include the options of another book configuration file. E.g., assuming that you want some common options to be applied to both <code>foo.book</code> and <code>bar.book</code>, you can create a <code>common.book</code> file:</p>
<p id = "para-120">The special <code>import_config</code> option allows you to include the options of another book configuration file. E.g., assuming that you want some common options to be applied to both <code>foo.book</code> and <code>bar.book</code>, you can create a <code>common.book</code> file:</p>
<pre><code class = "language-yaml">author: Joan Doe
lang: en
license: "Copyright (C) Joan Doe. All rights reserved."
@ -827,14 +870,14 @@ license: "Copyright (C) Joan Doe. All rights reserved."
html.header: "[Joan Doe's website](http://joan-doe.com)"
tex.template: my_template.tex
</code></pre>
<p id = "para-122">You can then include this file in <code>foo.book</code>:</p>
<p id = "para-121">You can then include this file in <code>foo.book</code>:</p>
<pre><code class = "language-yaml">import_config: common.book
title: Foo
+ foo_01.md
+ foo_02.md
</code></pre>
<p id = "para-123">Or include it in <code>bar.book</code>, but override some of its features:</p>
<p id = "para-122">Or include it in <code>bar.book</code>, but override some of its features:</p>
<pre><code class = "language-yaml">import_config: common.book
title: Bar
license: CC-BY-SA # Override the license from common.book
@ -842,20 +885,20 @@ license: CC-BY-SA # Override the license from common.book
+ bar_01.md
</code></pre>
<h3 id = "link-57">Output options</h3>
<p id = "para-124">These options specify which files to generate.</p>
<p id = "para-125">Recall that all file paths are relative to the directory where the config file is, not to the one where you run <code>crowbook</code>. So if you set</p>
<p id = "para-123">These options specify which files to generate.</p>
<p id = "para-124">Recall that all file paths are relative to the directory where the config file is, not to the one where you run <code>crowbook</code>. So if you set</p>
<pre><code class = "language-yaml">output.epub: foo.epub
</code></pre>
<p id = "para-126">and runs</p>
<p id = "para-125">and runs</p>
<pre><code class = "language-bash">$ crowbook some/dir/config.book
</code></pre>
<p id = "para-127"><code>foo.epub</code> will be generated in <code>some/dir</code>, not in your current directory.</p>
<p id = "para-128">Crowbook will try to generate each of the <code>output.xxx</code> files that are specified. That means that youll have to set at least one of those if you want a call to</p>
<p id = "para-126"><code>foo.epub</code> will be generated in <code>some/dir</code>, not in your current directory.</p>
<p id = "para-127">Crowbook will try to generate each of the <code>output.xxx</code> files that are specified. That means that youll have to set at least one of those if you want a call to</p>
<pre><code class = "language-bash">$ crowbook my.book
</code></pre>
<p id = "para-129">to generate anything. (Its still possible to generate a specific format, and only this one, by using the <code>--to</code> argument on the command line).</p>
<p id = "para-130">Note that some formats depend on some commands being installed on your system. Most notably, Crowbook depends on LaTeX (<code>xelatex</code> by default, though you can specify the command to use with <code>tex.command</code>) to generate a PDF file, so PDF rendering wont work if it is not installed on your system. Crowbook also uses the <code>zip</code> command to generate the EPUB and ODT files.</p>
<p id = "para-131">Current output options are:</p>
<p id = "para-128">to generate anything. (Its still possible to generate a specific format, and only this one, by using the <code>--to</code> argument on the command line).</p>
<p id = "para-129">Note that some formats depend on some commands being installed on your system. Most notably, Crowbook depends on LaTeX (<code>xelatex</code> by default, though you can specify the command to use with <code>tex.command</code>) to generate a PDF file, so PDF rendering wont work if it is not installed on your system. Crowbook also uses the <code>zip</code> command to generate the EPUB and ODT files.</p>
<p id = "para-130">Current output options are:</p>
<ul>
<li><code>output.html</code>: renders a standalone HTML file.</li>
<li><code>output.html_dir</code>: render a HTML directory with one page by chapter.</li>
@ -863,15 +906,15 @@ license: CC-BY-SA # Override the license from common.book
<li><code>output.tex</code>: renders a LaTeX file.</li>
<li><code>output.pdf</code>: renders a PDF file (using <code>tex.command</code>).</li>
</ul>
<p id = "para-132">(There are other output options for generating proofreading files, see <a href = "chapter_004.html">Proofreading</a>.)</p>
<p id = "para-131">(There are other output options for generating proofreading files, see <a href = "chapter_004.html">Proofreading</a>.)</p>
<h4 id = "link-58"><code>output.base_path</code></h4>
<p id = "para-133">Additionally, the <code>output.base_path</code> option allows you to set where the output files will be written (relatively to the book configuration file). E.g.,</p>
<p id = "para-132">Additionally, the <code>output.base_path</code> option allows you to set where the output files will be written (relatively to the book configuration file). E.g.,</p>
<pre><code class = "language-yaml">output.base_path: docs/book
output.epub: book.epub
</code></pre>
<p id = "para-134">will render the EPUB file in <code>docs/book/book.epub</code>.</p>
<p id = "para-133">will render the EPUB file in <code>docs/book/book.epub</code>.</p>
<h3 id = "link-59">Input options</h3>
<p id = "para-135">Crowbook does its best to improve the typography of your text. Default settings should be good enough for most usages, but you can enable/disable specific options:</p>
<p id = "para-134">Crowbook does its best to improve the typography of your text. Default settings should be good enough for most usages, but you can enable/disable specific options:</p>
<ul>
<li><code>input.clean</code>: if set to <code>false</code>, will disable all typographic “cleaning” (default: <code>true</code>). The <code>clean</code> algorithm is dependent on the language, though currently there is only a variant implemented for <code>fr</code> (french), dealing with the specific non-breaking spaces rules for this language.</li>
<li><code>input.clean.smart_quotes</code>: if set to <code>false</code>, disable the “smart quote” feature, that (tries to) replace straight quotes with curly ones. As it is an heuristics and cant be perfect, you might want to disable it in some circumstances (default: <code>true</code>).</li>
@ -879,21 +922,21 @@ output.epub: book.epub
<li><code>input.clean.ligature_guillemets</code> is a similar feature for french guilemets, replacing <code>&lt;&lt;</code> and <code>&gt;&gt;</code> to <code>«</code> and <code>»</code>. For the same reason, it is also disabled by default.</li>
</ul>
<h3 id = "link-60">Generic options for rendering</h3>
<p id = "para-136">These options allow to configure the rendering; they are used (or at least should be) for all formats.</p>
<p id = "para-135">These options allow to configure the rendering; they are used (or at least should be) for all formats.</p>
<h4 id = "link-61">rendering.num_depth</h4>
<p id = "para-137">An integer that represents the maximum level of numbering for your book. E.g., <code>1</code> will only number chapters, while <code>2</code> will number chapters, sections, but not anything below that. <code>6</code> is the maximum level and turns numbering on for all headers.</p>
<p id = "para-138"><b>default</b>: <code>1</code></p>
<p id = "para-136">An integer that represents the maximum level of numbering for your book. E.g., <code>1</code> will only number chapters, while <code>2</code> will number chapters, sections, but not anything below that. <code>6</code> is the maximum level and turns numbering on for all headers.</p>
<p id = "para-137"><b>default</b>: <code>1</code></p>
<h4 id = "link-62">rendering.chapter_template</h4>
<p id = "para-139">A string that will be used for chapter titles. You can use <code>{{{number}}}</code> and <code>{{{title}}}</code> in this string, e.g.:</p>
<p id = "para-138">A string that will be used for chapter titles. You can use <code>{{{number}}}</code> and <code>{{{title}}}</code> in this string, e.g.:</p>
<pre><code class = "language-yaml">numbering_template: "Chapter {{{number}} {{title}}}"
</code></pre>
<p id = "para-140">Note that:</p>
<p id = "para-139">Note that:</p>
<ul>
<li>in this case, quoting is necessary because <code>{</code> and <code>}</code> have special meaning in YAML;</li>
<li>this string wont be used for unnumbered chapters;</li>
<li>this string isnt currently used by LaTeX, either.</li>
</ul>
<p id = "para-141">It is possible to include Markdown formatting in this template, but it isnt advised, because it might cause problems for some formats (e.g. your EPUB file might not be correct anymore).</p>
<p id = "para-140">It is possible to include Markdown formatting in this template, but it isnt advised, because it might cause problems for some formats (e.g. your EPUB file might not be correct anymore).</p>
<h4 id = "link-63">Other rendering options</h4>
<ul>
<li><code>rendering.inline_toc</code>: if set to true, Crowbook will include a table of contents at the beginning of the document.</li>
@ -901,30 +944,30 @@ output.epub: book.epub
<li><code>rendering.initials</code>: if set to true, Crowbook will use initials, or “lettrines”, displaying the first letter of each chapter bigger than the others.</li>
</ul>
<h3 id = "link-64">Resources options</h3>
<p id = "para-142">These options allow to embed additional files for some formats (currently, only EPUB). This can be useful for embedding fonts.</p>
<p id = "para-141">These options allow to embed additional files for some formats (currently, only EPUB). This can be useful for embedding fonts.</p>
<h4 id = "link-65">resources.files</h4>
<p id = "para-143">A list of files or directories that should be added. Its a whitespace-separated list, so it can be, e.g.:</p>
<p id = "para-142">A list of files or directories that should be added. Its a whitespace-separated list, so it can be, e.g.:</p>
<pre><code class = "language-yaml">resources.files: font1.otf font2.otf
</code></pre>
<p id = "para-144">It is also possible to specify a directory (or multiple directories). So if you have a <code>fonts</code> directories containing <code>font1.otf</code> and <code>font2.otf</code>,</p>
<p id = "para-143">It is also possible to specify a directory (or multiple directories). So if you have a <code>fonts</code> directories containing <code>font1.otf</code> and <code>font2.otf</code>,</p>
<pre><code class = "language-yaml">resources.files: fonts
</code></pre>
<p id = "para-145">will be equivalent to:</p>
<p id = "para-144">will be equivalent to:</p>
<pre><code class = "language-yaml">resources.files: fonts/font1.otf fonts/font2.otf
</code></pre>
<p id = "para-146"><b>default</b>: not set</p>
<p id = "para-145"><b>default</b>: not set</p>
<h4 id = "link-66">resources.out_path</h4>
<p id = "para-147">This option determine where (in which directory), <em>in the resulting document</em>, those files will be copied. The default is <code>data</code>, so by default the <code>resources.files</code> in the first example above will search <code>font1.otf</code> and <code>font2.otf</code> <em>in the same directory than the <code>.book</code> file</em>, and will copy them to <code>data/font1.otf</code> and <code>data/font2.otf</code> <em>in the EPUB file</em>. This is therefore this last path that you should use if you want to access those files e.g. in a custom CSS stylesheet.</p>
<p id = "para-148">Note that if you pass directories to <code>resources.files</code>, the whole directory would be copied. So assuming <code>fonts/</code> contains <code>font1.otf</code> and <code>font2.otf</code></p>
<p id = "para-146">This option determine where (in which directory), <em>in the resulting document</em>, those files will be copied. The default is <code>data</code>, so by default the <code>resources.files</code> in the first example above will search <code>font1.otf</code> and <code>font2.otf</code> <em>in the same directory than the <code>.book</code> file</em>, and will copy them to <code>data/font1.otf</code> and <code>data/font2.otf</code> <em>in the EPUB file</em>. This is therefore this last path that you should use if you want to access those files e.g. in a custom CSS stylesheet.</p>
<p id = "para-147">Note that if you pass directories to <code>resources.files</code>, the whole directory would be copied. So assuming <code>fonts/</code> contains <code>font1.otf</code> and <code>font2.otf</code></p>
<pre><code class = "language-yaml">resources.files: fonts
resources.path: data
</code></pre>
<p id = "para-149">will copy these two files to <code>data/fonts/font1.otf</code> and <code>data/fonts/font2.otf</code> (and not <code>data/font1.otf</code> and <code>data/font2.otf</code>).</p>
<p id = "para-150">Similarly, the whole path of <code>resources.files</code> is copied, so</p>
<p id = "para-148">will copy these two files to <code>data/fonts/font1.otf</code> and <code>data/fonts/font2.otf</code> (and not <code>data/font1.otf</code> and <code>data/font2.otf</code>).</p>
<p id = "para-149">Similarly, the whole path of <code>resources.files</code> is copied, so</p>
<pre><code class = "language-yaml">resources.files: fonts/font1.otf fonts/font2.otf
</code></pre>
<p id = "para-151">will yield the same result.</p>
<p id = "para-152"><b>default</b>: <code>data</code></p>
<p id = "para-150">will yield the same result.</p>
<p id = "para-151"><b>default</b>: <code>data</code></p>
<p class = "next_chapter">
<a href = "chapter_003.html">
@ -933,7 +976,7 @@ resources.path: data
</p>
</div>
</div>
<footer id = "footer"><p id = "para-297">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-296">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide 4. Templates</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-300">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-299">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -217,37 +218,37 @@ function toggle() {
</a>
</p>
<h1 id = "link-67">4. Templates</h1>
<p id = "para-154">Crowbook allows the user to specify a number of templates.<a href = "#note-dest-1"><sup id = "note-source-1">[1]</sup></a></p>
<p id = "para-155">Each of this template can be overriden by a custom one, by setting e.g.:</p>
<p id = "para-153">Crowbook allows the user to specify a number of templates.<a href = "#note-dest-1"><sup id = "note-source-1">[1]</sup></a></p>
<p id = "para-154">Each of this template can be overriden by a custom one, by setting e.g.:</p>
<pre><code class = "language-yaml">html.css: my_template.css
</code></pre>
<p id = "para-156">in the book configuration file. The templates that you are most susceptible to modify are the following:</p>
<p id = "para-155">in the book configuration file. The templates that you are most susceptible to modify are the following:</p>
<ul>
<li><code>html.css</code>: stylesheet for HTML output;</li>
<li><code>epub.css</code>: stylesheet for EPUB output;</li>
<li><code>tex.template</code>: template of a LaTeX file.</li>
</ul>
<h2 id = "link-68">4.1. Create and edit template</h2>
<p id = "para-157">Except for inline templates, which are set directly in the book configuration file:</p>
<p id = "para-156">Except for inline templates, which are set directly in the book configuration file:</p>
<pre><code class = "language-yaml">rendering.chapter_template: "{{{loc_chapter}}} {{{number}}}: {{{chapter_title}}}"
</code></pre>
<p id = "para-158">most templates must be in a separate file:</p>
<p id = "para-157">most templates must be in a separate file:</p>
<pre><code class = "language-yaml">tex.template: my_template.tex
</code></pre>
<h3 id = "link-69"><code>--print-template</code></h3>
<p id = "para-159">The easiest way to create a new template is to start with the default one. In order to do so, you can use the <code>--print-template</code> argument:</p>
<p id = "para-158">The easiest way to create a new template is to start with the default one. In order to do so, you can use the <code>--print-template</code> argument:</p>
<pre><code class = "language-bash">$ crowbook --print-template tex.template &gt; my_template.tex
</code></pre>
<p id = "para-160">In order to get the <code>chapter.xhtml</code> template for EPUB3, youll also have to use <code>--set epub.version 3</code>:</p>
<p id = "para-159">In order to get the <code>chapter.xhtml</code> template for EPUB3, youll also have to use <code>--set epub.version 3</code>:</p>
<pre><code class = "language-bash">$ crowbook --print-template epub.chapter.xhtml --set epub.version 3 &gt; my_epub3_template.xhtml
</code></pre>
<h3 id = "link-70">Mustache syntax</h3>
<p id = "para-161">Crowbook uses <a href = "https://crates.io/crates/mustache">rust-mustache</a> as its templating engine, which allows to use <a href = "http://mustache.github.io/">Mustache</a> syntax in the templates.</p>
<p id = "para-163">It mainly boils down to using <code>{{{foo}}}</code><a href = "#note-dest-2"><sup id = "note-source-2">[2]</sup></a> to insert the value of variable <code>foo</code> in the document:</p>
<p id = "para-160">Crowbook uses <a href = "https://crates.io/crates/mustache">rust-mustache</a> as its templating engine, which allows to use <a href = "http://mustache.github.io/">Mustache</a> syntax in the templates.</p>
<p id = "para-162">It mainly boils down to using <code>{{{foo}}}</code><a href = "#note-dest-2"><sup id = "note-source-2">[2]</sup></a> to insert the value of variable <code>foo</code> in the document:</p>
<pre><code class = "language-html">&lt;h1 class = "title" &gt;{{{title}}}&lt;h1&gt;
&lt;h2 class = "author"&gt;{{{author}}}&lt;/h2&gt;
</code></pre>
<p id = "para-164">Mustache also provides the possibility of checking whether a variable is set:</p>
<p id = "para-163">Mustache also provides the possibility of checking whether a variable is set:</p>
<pre><code>{{#foo}}
Foo exists
{{/foo}}
@ -255,7 +256,7 @@ Foo exists
Foo does not exist
{{^foo}}
</code></pre>
<p id = "para-165">Crowbook uses this and sets some variables to <code>true</code> to allow templates to conditionally include some portions. E.g., in <code>html.css</code>:</p>
<p id = "para-164">Crowbook uses this and sets some variables to <code>true</code> to allow templates to conditionally include some portions. E.g., in <code>html.css</code>:</p>
<pre><code class = "language-css">{{#lang_fr}}
/* Make list displays '' instead of bullets */
ul li {
@ -264,55 +265,56 @@ ul li {
}
{{/lang_fr}}
</code></pre>
<p id = "para-166">In this case, Crowbook sets a variable whose name is equal to <code>lang_foo</code> to <code>true</code>, allowing to have different styles for some elements according to the language.</p>
<p id = "para-167">For more information about Mustache syntax, see <a href = "http://mustache.github.io/mustache.5.html">Mustache manual</a>.</p>
<p id = "para-165">In this case, Crowbook sets a variable whose name is equal to <code>lang_foo</code> to <code>true</code>, allowing to have different styles for some elements according to the language.</p>
<p id = "para-166">For more information about Mustache syntax, see <a href = "http://mustache.github.io/mustache.5.html">Mustache manual</a>.</p>
<h4 id = "link-71">Syntax in LaTeX</h4>
<p id = "para-169">Since LaTeX already uses a lot of curly brackets, the default template sets an altenative syntax to access variables, with <code>&lt;&lt;&amp;foo&gt;&gt;</code><a href = "#note-dest-3"><sup id = "note-source-3">[3]</sup></a>:</p>
<p id = "para-168">Since LaTeX already uses a lot of curly brackets, the default template sets an altenative syntax to access variables, with <code>&lt;&lt;&amp;foo&gt;&gt;</code><a href = "#note-dest-3"><sup id = "note-source-3">[3]</sup></a>:</p>
<pre><code class = "language-latex">\title{&lt;&lt;&amp;title&gt;&gt;}
\author{&lt;&lt;&amp;author&gt;&gt;}
&lt;&lt;#has_date&gt;&gt;\date{&lt;&lt;&amp;date&gt;&gt;}&lt;&lt;/has_date&gt;
</code></pre>
<h2 id = "link-72">4.2. List of templates</h2>
<h3 id = "link-73">html.js</h3>
<p id = "para-170">The javascript file used by both the standalone HTML renderer and the multiple files HTML renderer.</p>
<p id = "para-171">This is not currently an actual template, just a plain javascript file which cannot contain <code>mustache</code> tags.</p>
<p id = "para-169">The javascript file used by both the standalone HTML renderer and the multiple files HTML renderer.</p>
<p id = "para-170">This is not currently an actual template, just a plain javascript file which cannot contain <code>mustache</code> tags.</p>
<h3 id = "link-74">html.css</h3>
<p id = "para-172">The main CSS file used by both the standalone HTML renderer and the multiple files HTML renderer.</p>
<p id = "para-171">The main CSS file used by both the standalone HTML renderer and the multiple files HTML renderer.</p>
<h3 id = "link-75">html.css.colours</h3>
<p id = "para-173">A CSS file containing only colour settings. Used by <code>html.css</code>.</p>
<p id = "para-174">This is not currently an actual template, just a plain CSS file which cannot contain <code>mustache</code> tags.</p>
<p id = "para-172">A CSS file containing only colour settings. Used by <code>html.css</code>.</p>
<p id = "para-173">This is not currently an actual template, just a plain CSS file which cannot contain <code>mustache</code> tags.</p>
<h3 id = "link-76">html.css.print</h3>
<p id = "para-175">An additional CSS file used by both the standalone HTML renderer and the multiple files HTML renderer. Its purpose is to provide CSS instructions for printing (i.e., when the user clicks the <code>print</code> button in her browser).</p>
<p id = "para-176">This is not currently an actual template, just a plain CSS file which cannot contain <code>mustache</code> tags.</p>
<p id = "para-174">An additional CSS file used by both the standalone HTML renderer and the multiple files HTML renderer. Its purpose is to provide CSS instructions for printing (i.e., when the user clicks the <code>print</code> button in her browser).</p>
<p id = "para-175">This is not currently an actual template, just a plain CSS file which cannot contain <code>mustache</code> tags.</p>
<h3 id = "link-77">html.highlight.js</h3>
<p id = "para-177">A javascript file used by both HTML renderers to highlight codes in code blocks. It should be a variant of <a href = "https://highlightjs.org/">highlight.js</a>.</p>
<p id = "para-178">This is not an actual template, just a plain javascript file.</p>
<p id = "para-176">A javascript file used by both HTML renderers to highlight codes in code blocks. It should be a variant of <a href = "https://highlightjs.org/">highlight.js</a>.</p>
<p id = "para-177">This is not an actual template, just a plain javascript file.</p>
<h3 id = "link-78">html.highlight.css</h3>
<p id = "para-179">A CSS file used by both HTML renderers to set the theme of <a href = "https://highlightjs.org/">highlight.js</a>. It should, though, be an highlight.js theme.</p>
<p id = "para-180">This is not an actual template, just a plain CSS file.</p>
<p id = "para-178">A CSS file used by both HTML renderers to set the theme of <a href = "https://highlightjs.org/">highlight.js</a>. It should, though, be an highlight.js theme.</p>
<p id = "para-179">This is not an actual template, just a plain CSS file.</p>
<h3 id = "link-79">html_single.js</h3>
<p id = "para-181">A javascript file used only by the standalone HTML renderer. Its main purpose is to handle the displaying of a single chapter at a time when <code>one_chapter</code> is set to true.</p>
<p id = "para-180">A javascript file used only by the standalone HTML renderer. Its main purpose is to handle the displaying of a single chapter at a time when <code>one_chapter</code> is set to true.</p>
<h3 id = "link-80">html_single.html</h3>
<p id = "para-182">The main template for standalone HTML renderer.</p>
<p id = "para-181">The main template for standalone HTML renderer.</p>
<h3 id = "link-81">html_dir.chapter.html</h3>
<p id = "para-183">The main template for multiple files HTML renderer. It is the template for rendering each chapter.</p>
<p id = "para-182">The main template for multiple files HTML renderer. It is the template for rendering each chapter.</p>
<h3 id = "link-82">html_dir.index.html</h3>
<p id = "para-184">The template used by multiple files HTML renderer to render the <code>index.html</code> file.</p>
<p id = "para-183">The template used by multiple files HTML renderer to render the <code>index.html</code> file.</p>
<h3 id = "link-83">tex.template</h3>
<p id = "para-185">The main (and currently only) template used by the LaTeX renderer.</p>
<p id = "para-184">The main (and currently only) template used by the LaTeX renderer.</p>
<h3 id = "link-84">epub.chapter.xhtml</h3>
<p id = "para-186">This template is the main template used by the Epub renderer. It contains the XHTML template that will be used for each chapter.</p>
<p id = "para-185">This template is the main template used by the Epub renderer. It contains the XHTML template that will be used for each chapter.</p>
<h3 id = "link-85">epub.css</h3>
<p id = "para-187">This template is used by the Epub renderer and contains the style sheet.</p>
<p id = "para-186">This template is used by the Epub renderer and contains the style sheet.</p>
<h3 id = "link-86">Inline templates</h3>
<p id = "para-188">Crowbook also has some inline templates, that are set in the book configuration file:</p>
<p id = "para-187">Crowbook also has some inline templates, that are set in the book configuration file:</p>
<ul>
<li><code>tex.template.add</code>, <code>html.css.add</code> and <code>epub.css.add</code> allow to specify some LaTeX or CSS code directly in the book configuration file. This code will be added respectively to <code>tex.template</code>, <code>html.css</code> or <code>epub.css</code> template. For CSS template, this code is inserted at the end of the template (allowing to redefine rules that are set by the template); for the LaTeX template, the code is inserted at the end of the preambule, just before the <code>\begin{document}</code> tag.</li>
<li><code>rendering.inline_toc.name</code> sets the name of the inline table of content, if it is displayed. By default, is is set to <code>{{{loc_toc}}}</code>, that is, a localised version of “Table of Contents”.</li>
<li><code>rendering.chapter_template</code> sets the naming scheme for chapters.</li>
</ul>
<h2 id = "link-87">4.3. List of accessible variables</h2>
<h3 id = "link-88">Metadata</h3>
<p id = "para-189">For every template, Crowbook exports all of the metadata:</p>
<p id = "para-188">For every template, Crowbook exports all of the metadata:</p>
<ul>
<li><code>author</code>;</li>
<li><code>title</code>;</li>
@ -324,14 +326,14 @@ ul li {
<li><code>date</code>;</li>
<li>any option <code>metadata.foo</code> defined in the book configuration file will also be exported as <code>metadata_foo</code>.</li>
</ul>
<p id = "para-190">These metadata can contain Markdown, which will be rendered. E.g., setting <code>date: “20th of **september**”</code> will render <code>september</code> in bold, using <code>&lt;b&gt;</code> tag for HTML or <code>\textbf</code> for LaTeX. (It might be a bad idea to insert Markdown into <code>author</code> or <code>title</code> fields, and it certainly is for <code>lang</code>, but it can be useful for custom metadata or for fields like <code>description</code>).</p>
<p id = "para-191">For each metadata <code>foo</code> that is set, Crowbook also inserts a <code>has_foo</code> bool set to true. This allows to use Mustaches section for some logic, e.g.:</p>
<p id = "para-189">These metadata can contain Markdown, which will be rendered. E.g., setting <code>date: “20th of **september**”</code> will render <code>september</code> in bold, using <code>&lt;b&gt;</code> tag for HTML or <code>\textbf</code> for LaTeX. (It might be a bad idea to insert Markdown into <code>author</code> or <code>title</code> fields, and it certainly is for <code>lang</code>, but it can be useful for custom metadata or for fields like <code>description</code>).</p>
<p id = "para-190">For each metadata <code>foo</code> that is set, Crowbook also inserts a <code>has_foo</code> bool set to true. This allows to use Mustaches section for some logic, e.g.:</p>
<pre><code>{{{title}}}
{{#has_version}}, version {{{version}}}{{/has_version}}
</code></pre>
<p id = "para-192">will avoid rendering “, version” when <code>version</code> is not set.</p>
<p id = "para-191">will avoid rendering “, version” when <code>version</code> is not set.</p>
<h3 id = "link-89">Localisation strings</h3>
<p id = "para-193">For all templates, Crowbook also exports some localisation strings <code>loc_foo</code>. They currently include:</p>
<p id = "para-192">For all templates, Crowbook also exports some localisation strings <code>loc_foo</code>. They currently include:</p>
<div class = "table">
<table>
<tr>
@ -348,13 +350,13 @@ ul li {
</table>
</div>
<h3 id = "link-90">Template-dependent values</h3>
<p id = "para-194">Crowbook also exports some additional fields for some templates, see below.</p>
<p id = "para-193">Crowbook also exports some additional fields for some templates, see below.</p>
<div class = "table">
<table>
<tr>
<th> Mustache tag </th><th> Value </th><th> Available in... </th></tr>
<tr>
<td> <code>content</code> </td><td> A rendered version of the book or chapters content </td><td> <code>html_single.html</code>, <code>html_dir.index.html</code>, <code>html_dir.chapter.html</code>, <code>tex.temlplate</code>, <code>epub.chapter.xhtml</code> </td></tr>
<td> <code>content</code> </td><td> A rendered version of the book or chapters content </td><td> <code>html_single.html</code>, <code>html_dir.index.html</code>, <code>html_dir.chapter.html</code>, <code>tex.template</code>, <code>epub.chapter.xhtml</code> </td></tr>
<tr>
<td> <code>toc</code> </td><td> A rendered version of the table of contents </td><td> <code>html_single.html</code>, <code>html_dir.chapter.html</code>, <code>html_dir.index.html</code> </td></tr>
<tr>
@ -388,7 +390,9 @@ ul li {
<tr>
<td> <code>pages.svg</code> </td><td> The base64-encoded image of the button to display one chapter at a time </td><td> <code>html_single.js</code>, <code>html_single.html</code> </td></tr>
<tr>
<td> <code>menu_svg</code> </td><td> The base64-encoded image of the hamburger menu image </td><td> <code>hml_single.html</code> </td></tr>
<td> <code>favicon</code> </td><td> The <code>&lt;link rel = “icon” ...&gt;</code> tag if <code>html.icon</code> is set </td><td> <code>html_single.html</code>, <code>html_dir.chapter.html</code>, <code>html_dir.index.html</code> </td></tr>
<tr>
<td> <code>menu_svg</code> </td><td> The base64-encoded image of the hamburger menu image </td><td> <code>html_single.html</code> </td></tr>
<tr>
<td> <code>prev_chapter</code> </td><td> Title and a link of previous chapter </td><td> <code>html_dir.chapter.html</code> </td></tr>
<tr>
@ -407,6 +411,8 @@ ul li {
<td> <code>has_tex_size</code> </td><td> Set to true if <code>tex_size</code> is set </td><td> <code>tex.template</code> </td></tr>
<tr>
<td> <code>initials</code> </td><td> True if <code>rendering.initials</code> is true, not set else </td><td> <code>tex.template</code> </td></tr>
<tr>
<td> <code>additional_code</code> </td><td> Set to the content of <code>tex.template.add</code>, <code>html.css.add</code> or <code>epub.css.add</code> </td><td> <code>tex.template</code>, <code>html.css</code>, <code>epub.css</code> </td></tr>
</table>
</div>
@ -421,7 +427,7 @@ ul li {
</td>
<td class = "note">
<aside id = "note-dest-1"><p id = "para-153">Some of them, though, are not “real” templates, they are just files that are inserted, but cant contain mustache tags. This will probably evolve in future versions.</p>
<aside id = "note-dest-1"><p id = "para-152">Some of them, though, are not “real” templates, they are just files that are inserted, but cant contain mustache tags. This will probably evolve in future versions.</p>
</aside>
</td>
</tr>
@ -433,7 +439,7 @@ ul li {
</td>
<td class = "note">
<aside id = "note-dest-2"><p id = "para-162">Mustache also provides the <code>{{foo}}</code> variant, which HTML-escapes the content of the variable. You should not use this, as Crowbook already renders and correctly escapes the variables it sets for use in templates.</p>
<aside id = "note-dest-2"><p id = "para-161">Mustache also provides the <code>{{foo}}</code> variant, which HTML-escapes the content of the variable. You should not use this, as Crowbook already renders and correctly escapes the variables it sets for use in templates.</p>
</aside>
</td>
</tr>
@ -445,7 +451,7 @@ ul li {
</td>
<td class = "note">
<aside id = "note-dest-3"><p id = "para-168"><code>&lt;&lt;foo&gt;&gt;</code> might also work, but the ampersand is required to prevent mustache HTML-escaping the value. This is not good because:</p>
<aside id = "note-dest-3"><p id = "para-167"><code>&lt;&lt;foo&gt;&gt;</code> might also work, but the ampersand is required to prevent mustache HTML-escaping the value. This is not good because:</p>
<ol>
<li>escaping is already done by Crowbook before setting variable content;</li>
<li>escaping HTML in a LaTeX document wont probably look good.</li>
@ -463,7 +469,7 @@ ul li {
</p>
</div>
</div>
<footer id = "footer"><p id = "para-299">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-298">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide 5. Proofreading with Crowbook</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-302">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-301">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -217,35 +218,35 @@ function toggle() {
</a>
</p>
<h1 id = "link-91">5. Proofreading with Crowbook</h1>
<p id = "para-195">Since version 0.9.1, Crowbook includes some proofreading features, that can be enabled if you set one of the</p>
<p id = "para-194">Since version 0.9.1, Crowbook includes some proofreading features, that can be enabled if you set one of the</p>
<ul>
<li><code>output.proofread.html</code></li>
<li><code>output.proofread.html_dir</code></li>
<li><code>output.proofread.pdf</code></li>
</ul>
<p id = "para-196">output files. This allows you to generate different files for publishing and proofreading (you probably dont want to publish a version that highlights your grammar errors or your repetitions).</p>
<p id = "para-197">Current proofreading features are:</p>
<p id = "para-195">output files. This allows you to generate different files for publishing and proofreading (you probably dont want to publish a version that highlights your grammar errors or your repetitions).</p>
<p id = "para-196">Current proofreading features are:</p>
<ul>
<li>repetition detection;</li>
<li>grammar check;</li>
<li>highlighting non-breaking spaces.</li>
</ul>
<h2 id = "link-92">5.1. Enabling proofreading</h2>
<p id = "para-198">Since proofreading can take quite a lot of time, particularly for a long book, it is disabled by default. Youll have to run</p>
<p id = "para-197">Since proofreading can take quite a lot of time, particularly for a long book, it is disabled by default. Youll have to run</p>
<pre><code class = "language-bash">$ crowbook --proofread my.book
</code></pre>
<p id = "para-199">or</p>
<p id = "para-198">or</p>
<pre><code class = "language-bash">$ crowbook -p my.book
</code></pre>
<p id = "para-200">to generate proofreading copies. Alternatively, if you want it to be activated each time you run <code>crowbook</code> on this book (which is <em>not</em> recommanded for long books, particularly if you want to perform a grammar check), you can set</p>
<p id = "para-199">to generate proofreading copies. Alternatively, if you want it to be activated each time you run <code>crowbook</code> on this book (which is <em>not</em> recommanded for long books, particularly if you want to perform a grammar check), you can set</p>
<pre><code class = "language-yaml">proofread: true
</code></pre>
<p id = "para-201">in the book configuration file.</p>
<p id = "para-200">in the book configuration file.</p>
<h2 id = "link-93">5.2. Repetition detection</h2>
<p id = "para-202">Repetition detection is enabled with:</p>
<p id = "para-201">Repetition detection is enabled with:</p>
<pre><code class = "language-yaml">proofread.repetitions: true
</code></pre>
<p id = "para-203">It uses <a href = "https://github.com/lise-henry/caribon">Caribon</a> library to detect the repetition in your text. Since the notion of a repetition is relatively arbitrary, it is possible to adapt the settings. Default are:</p>
<p id = "para-202">It uses <a href = "https://github.com/lise-henry/caribon">Caribon</a> library to detect the repetition in your text. Since the notion of a repetition is relatively arbitrary, it is possible to adapt the settings. Default are:</p>
<pre><code class = "language-yaml"># The maximum distance between two identical words to
# consider them a repetition
proofread.repetitions.max_distance: 25
@ -263,26 +264,26 @@ proofread.repetitions.fuzzy: true
# considered as the same word, but they will be with 0.5)
proofread.repetitions.fuzzy.threshold: 0.2
</code></pre>
<p id = "para-204">For more information, see <a href = "https://github.com/lise-henry/caribon">Caribon</a>s documentation.</p>
<blockquote><p id = "para-205">Currently, repetitions are not displayed in PDF proofreading output.</p>
<p id = "para-203">For more information, see <a href = "https://github.com/lise-henry/caribon">Caribon</a>s documentation.</p>
<blockquote><p id = "para-204">Currently, repetitions are not displayed in PDF proofreading output.</p>
</blockquote>
<h2 id = "link-94">5.3. Grammar checking</h2>
<p id = "para-206">Crowbook can also use <a href = "https://languagetool.org/">LanguageTool</a> to detect grammar errors in your text. It is, however, a bit more complex to activate.</p>
<p id = "para-207">First, youll have to activate this feature in your book configuration file:</p>
<p id = "para-205">Crowbook can also use <a href = "https://languagetool.org/">LanguageTool</a> to detect grammar errors in your text. It is, however, a bit more complex to activate.</p>
<p id = "para-206">First, youll have to activate this feature in your book configuration file:</p>
<pre><code class = "language-yaml"># Activate language tool support
proofread.languagetool: true
# (Optional) Sets the port number to connect to (default below)
proofread.languagetool.port: 8081
</code></pre>
<p id = "para-208">Youll then have to download the stand-alone version of <a href = "https://languagetool.org/">LanguageTool</a>. It includes a server mode, which youll have to launch:</p>
<p id = "para-207">Youll then have to download the stand-alone version of <a href = "https://languagetool.org/">LanguageTool</a>. It includes a server mode, which youll have to launch:</p>
<pre><code class = "language-bash">$ java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081
</code></pre>
<p id = "para-209">You can also use the LanguageTool GUI (<code>languagetool.jar</code>) and start the server from the menu “Text Checking -&gt; Options”. This also allows you to configure LanguageTool more precisely by activating or deactivating rules.</p>
<p id = "para-210">You can then run Crowbook, and it will highlight grammar errors in HTML or PDF proofreading output files.</p>
<blockquote><p id = "para-211">Note: running a grammar check on a long book (like a novel) can take up to a few minutes.</p>
<p id = "para-208">You can also use the LanguageTool GUI (<code>languagetool.jar</code>) and start the server from the menu “Text Checking -&gt; Options”. This also allows you to configure LanguageTool more precisely by activating or deactivating rules.</p>
<p id = "para-209">You can then run Crowbook, and it will highlight grammar errors in HTML or PDF proofreading output files.</p>
<blockquote><p id = "para-210">Note: running a grammar check on a long book (like a novel) can take up to a few minutes.</p>
</blockquote>
<h2 id = "link-95">5.4. Highlighting non-breaking spaces</h2>
<p id = "para-212">The last proofreading feature is a bit less important, but it can be useful in some cases. It is is dis/activated by setting <code>proofread.nb_spaces</code> to “true” or “false”, and it will highlight different sort of non-breaking spaces in HTML proofreading output files. This can be useful in some cases, but it is mostly a debugging feature to check that the french cleaner of Crowbook correctly replaces spaces with correct non-breaking spaces in the relevant places.</p>
<p id = "para-211">The last proofreading feature is a bit less important, but it can be useful in some cases. It is is dis/activated by setting <code>proofread.nb_spaces</code> to “true” or “false”, and it will highlight different sort of non-breaking spaces in HTML proofreading output files. This can be useful in some cases, but it is mostly a debugging feature to check that the french cleaner of Crowbook correctly replaces spaces with correct non-breaking spaces in the relevant places.</p>
<p class = "next_chapter">
<a href = "chapter_005.html">
@ -291,7 +292,7 @@ proofread.languagetool.port: 8081
</p>
</div>
</div>
<footer id = "footer"><p id = "para-301">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-300">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide 6. Tips and tricks</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-304">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-303">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -218,40 +219,40 @@ function toggle() {
</p>
<h1 id = "link-96">6. Tips and tricks</h1>
<h2 id = "link-97">6.1. Using Crowbook with Emacs markdown mode</h2>
<p id = "para-213">If you use <a href = "https://www.gnu.org/software/emacs/">Emacs</a> as a text editor, there is a nice <a href = "http://jblevins.org/projects/markdown-mode/">Markdown mode</a> to edit Markdown files.</p>
<p id = "para-214">It is possible to use Crowbook for HTML previewing in this mode, which <a href = "http://xkcd.com/1742/">requires only minimal configuration and tweaking</a>:</p>
<p id = "para-212">If you use <a href = "https://www.gnu.org/software/emacs/">Emacs</a> as a text editor, there is a nice <a href = "http://jblevins.org/projects/markdown-mode/">Markdown mode</a> to edit Markdown files.</p>
<p id = "para-213">It is possible to use Crowbook for HTML previewing in this mode, which <a href = "http://xkcd.com/1742/">requires only minimal configuration and tweaking</a>:</p>
<pre><code class = "language-lisp">(custom-set-variables
'(markdown-command "crowbook -qs --to html --output /dev/stdout")
'(markdown-command-needs-filename t))
</code></pre>
<p id = "para-215">You can then use <code>markdown-preview</code> (or <code>C-c C-c p</code>) to run Crowbook on this file and preview it in your browser, or run <code>markdown-live-preview-mode</code> to see a live preview (updated each time you save you file) in Emacs integrated browser.</p>
<p id = "para-214">You can then use <code>markdown-preview</code> (or <code>C-c C-c p</code>) to run Crowbook on this file and preview it in your browser, or run <code>markdown-live-preview-mode</code> to see a live preview (updated each time you save you file) in Emacs integrated browser.</p>
<h3 id = "link-98">Some explanations if it looks a bit cryptic to you</h3>
<p id = "para-216">We set <code>markdown-command</code> to <code>crowbook</code>, the reason for this is a bit obvious. The arguments we give to crowbook might be a bit less obvious:</p>
<p id = "para-215">We set <code>markdown-command</code> to <code>crowbook</code>, the reason for this is a bit obvious. The arguments we give to crowbook might be a bit less obvious:</p>
<ul>
<li><code>-qs</code> or <code>--quiet --single</code> tells Crowbook that is a a standalone markdown file, and not a book configuration file, and to be a bit quiet on error/info messages;</li>
<li><code>--to html</code> specifies that HTML must be generated;</li>
<li><code>--output /dev/stdout</code> forces Crowbook to display the result on the stdout, even if you set <code>output.html</code> to <code>some_file.html</code>.</li>
</ul>
<p id = "para-217">Also, <code>(markdown-command-needs-filename t)</code> is because at this point Crowbook cant read from the stdin and must be specified a file.</p>
<p id = "para-216">Also, <code>(markdown-command-needs-filename t)</code> is because at this point Crowbook cant read from the stdin and must be specified a file.</p>
<h3 id = "link-99">Limitations</h3>
<p id = "para-218">While it renders correctly, this only works really nicely on standalone Markdown files where you have specified, e.g.:</p>
<p id = "para-217">While it renders correctly, this only works really nicely on standalone Markdown files where you have specified, e.g.:</p>
<pre><code class = "language-markdown">---
author: Your name
title: Some title
---
</code></pre>
<p id = "para-219">Else, it will sets <code>author</code> and <code>title</code> to the default values.</p>
<p id = "para-218">Else, it will sets <code>author</code> and <code>title</code> to the default values.</p>
<h2 id = "link-100">6.2. Embedding fonts in an EPUB file</h2>
<p id = "para-220">In order to embed fonts in an EPUB file, youll first have to edit the stylesheet, which you can first obtain with:</p>
<p id = "para-219">In order to embed fonts in an EPUB file, youll first have to edit the stylesheet, which you can first obtain with:</p>
<pre><code class = "language-bash">$ crowbook --print-template epub.css &gt; my_epub_stylesheet.css
</code></pre>
<p id = "para-221">Youll need to use the <a href = "https://developer.mozilla.org/fr/docs/Web/CSS/@font-face"><code>@font-face</code> attribute</a>:</p>
<p id = "para-220">Youll need to use the <a href = "https://developer.mozilla.org/fr/docs/Web/CSS/@font-face"><code>@font-face</code> attribute</a>:</p>
<pre><code class = "language-css">@font-face {
font-family: MyFont;
src: url(data/my_font.ttf);
}
</code></pre>
<p id = "para-222">Then you can add <code>my_font.ttf</code> to the files that need to be added to the EPUB zip file:</p>
<p id = "para-221">Then you can add <code>my_font.ttf</code> to the files that need to be added to the EPUB zip file:</p>
<pre><code class = "language-yaml">title: My Book
author: Me
@ -260,7 +261,7 @@ output.epub: book.epub
resources.files: my_font.ttf
</code></pre>
<p id = "para-223">(Note that youll have to repeat the process the different <code>font-weight</code> and <code>font-style</code> variants of your font if you want it to display correctly when there is some text in <b>bold</b>, <em>italics</em>, or <b><em>both</em></b>.)</p>
<p id = "para-222">(Note that youll have to repeat the process the different <code>font-weight</code> and <code>font-style</code> variants of your font if you want it to display correctly when there is some text in <b>bold</b>, <em>italics</em>, or <b><em>both</em></b>.)</p>
<p class = "next_chapter">
<a href = "chapter_006.html">
@ -269,7 +270,7 @@ resources.files: my_font.ttf
</p>
</div>
</div>
<footer id = "footer"><p id = "para-303">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-302">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide ChangeLog</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-306">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-305">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -223,6 +224,12 @@ function toggle() {
<li><code>tex.font_size</code> specifies an optional font size (in pt) passed to the LaTeX class (must be 10, 11 or 12).</li>
<li><code>tex.title</code> can be set to <code>false</code> to avoid rendering the title with <code>\maketitle</code>.</li>
<li><code>tex.paper_size</code> specifies the paper size for PDF output.</li>
<li><code>tex.template.add</code>, <code>html.css.add</code> and <code>epub.css.add</code>allow to specify inline LaTex or CSS code in the book configuration file that will be added respectively to <code>tex.template.add</code>, <code>html.css.add</code> and <code>epub.css.add</code>.</li>
<li><code>html.icon</code> allows to specify the path of an icon for HTML documents.</li>
</ul>
</li>
<li>Command-line interface:<ul>
<li>Paths that are displayed should now be normalized, e.g. “foo/bar.pdf” instead of “baz/../foo/bar.pdf”.</li>
</ul>
</li>
<li>Rendering:<ul>
@ -255,7 +262,7 @@ function toggle() {
</li>
</ul>
<h2 id = "link-104">0.10.2 (2016-10-21)</h2>
<p id = "para-224">Only minor changes in this version:</p>
<p id = "para-223">Only minor changes in this version:</p>
<ul>
<li>Options:<ul>
<li><code>author</code> and <code>title</code>s default values are both set to the empty string, instead of <code>Anonymous</code> and <code>Untitled</code>.</li>
@ -271,9 +278,9 @@ function toggle() {
</li>
</ul>
<h2 id = "link-105">0.10.1 (2016-10-18)</h2>
<p id = "para-225">Fixed a bug in <code>fr.po</code> translation that prevented building from fresh install.</p>
<p id = "para-224">Fixed a bug in <code>fr.po</code> translation that prevented building from fresh install.</p>
<h2 id = "link-106">0.10.0 (2016-10-18)</h2>
<p id = "para-226">This release contains some breaking changes (mostly for the API, which has been split in separate libraries). It alse features some internationalization support, and the program should now be tranlated if your <code>LANG</code> environment variable is set to french.</p>
<p id = "para-225">This release contains some breaking changes (mostly for the API, which has been split in separate libraries). It alse features some internationalization support, and the program should now be tranlated if your <code>LANG</code> environment variable is set to french.</p>
<ul>
<li><b>Breaking changes</b>:<ul>
<li>Templates:<ul>
@ -310,7 +317,7 @@ function toggle() {
</li>
</ul>
<h2 id = "link-107">0.9.1 (2016-09-29)</h2>
<p id = "para-227">This release mainly introduces generation of proofreading copies, allowing, if they are set (and <code>crowbook</code> was compiled with the <code>proofread</code> feature) to generate proofreading copies, using tools to check grammar and detect repetitions. These features are currently experimental.</p>
<p id = "para-226">This release mainly introduces generation of proofreading copies, allowing, if they are set (and <code>crowbook</code> was compiled with the <code>proofread</code> feature) to generate proofreading copies, using tools to check grammar and detect repetitions. These features are currently experimental.</p>
<ul>
<li>New options:<ul>
<li><code>html.escape_nb_spaces</code>, if set to true (by default), will replace unicode non breaking spaces with HTML entites and CSS so it can display correctly even if readers dont have a browser/font supporting these unicode symbols.</li>
@ -341,7 +348,7 @@ function toggle() {
</li>
</ul>
<h2 id = "link-108">0.9.0 (2016-09-23)</h2>
<p id = "para-228">The main objective of this release is to clean public interfaces, in order to limit breaking changes in the future. <em>Ideally</em>, all pre-1.0 releases should thus be 0.9.x. Concretely, this meant three things:</p>
<p id = "para-227">The main objective of this release is to clean public interfaces, in order to limit breaking changes in the future. <em>Ideally</em>, all pre-1.0 releases should thus be 0.9.x. Concretely, this meant three things:</p>
<ul>
<li>reducing the surface of Crowbooks library API;</li>
<li>cleaning options names</li>
@ -406,7 +413,7 @@ function toggle() {
</li>
</ul>
<h2 id = "link-109">0.8.0 (2016-09-19)</h2>
<p id = "para-229">This release adds support for syntax higlighting in code blocks, customized top and footer blocks for HTML rendering, and the special <code>import_config</code> option that allows to import options from another book file. It also provides (hopefully) better error messages.</p>
<p id = "para-228">This release adds support for syntax higlighting in code blocks, customized top and footer blocks for HTML rendering, and the special <code>import_config</code> option that allows to import options from another book file. It also provides (hopefully) better error messages.</p>
<ul>
<li>New options:<ul>
<li><code>import_config</code>is not really an option, but allows to import another configuration file, useful if you share a same set of options between multiple books.</li>
@ -446,7 +453,7 @@ function toggle() {
</li>
</ul>
<h2 id = "link-110">0.7.0 (2016-09-11)</h2>
<p id = "para-230">This releases renders images differently when they are on a standalone paragraph or inside a paragraph.</p>
<p id = "para-229">This releases renders images differently when they are on a standalone paragraph or inside a paragraph.</p>
<ul>
<li>Internal/API:<ul>
<li><code>Token</code> has a new variant, <code>StandaloneImage</code>. This is used to distinguish an image that is alone in a paragraph of an image that is inlined alongside text.</li>
@ -487,7 +494,7 @@ function toggle() {
</li>
</ul>
<h2 id = "link-112">0.5.1 (2016-04-14)</h2>
<p id = "para-231">Mostly rendering fixes:</p>
<p id = "para-230">Mostly rendering fixes:</p>
<ul>
<li>Epub:<ul>
<li>Fix a validation problem when book contained hidden chapters.</li>
@ -645,7 +652,7 @@ function toggle() {
</p>
</div>
</div>
<footer id = "footer"><p id = "para-305">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-304">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide GNU LESSER GENERAL PUBLIC LICENSE</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-308">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-307">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -219,38 +220,38 @@ function toggle() {
<h1 id = "link-120">GNU LESSER GENERAL PUBLIC LICENSE</h1>
<pre><code> Version 2.1, February 1999
</code></pre>
<p id = "para-232">Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.</p>
<p id = "para-233">[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]</p>
<p id = "para-231">Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.</p>
<p id = "para-232">[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]</p>
<pre><code> Preamble
</code></pre>
<p id = "para-234">The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.</p>
<p id = "para-235">This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.</p>
<p id = "para-236">When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.</p>
<p id = "para-237">To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.</p>
<p id = "para-238">For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.</p>
<p id = "para-239">We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.</p>
<p id = "para-240">To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original authors reputation will not be affected by problems that might be introduced by others.</p>
<p id = "para-241"> Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.</p>
<p id = "para-242">Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.</p>
<p id = "para-243">When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.</p>
<p id = "para-244">We call this license the “Lesser” General Public License because it does Less to protect the users freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.</p>
<p id = "para-245">For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.</p>
<p id = "para-246">In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.</p>
<p id = "para-247">Although the Lesser General Public License is Less protective of the users freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.</p>
<p id = "para-248">The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a “work based on the library” and a “work that uses the library”. The former contains code derived from the library, whereas the latter must be combined with the library in order to run.</p>
<p id = "para-249"> GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</p>
<p id = "para-233">The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.</p>
<p id = "para-234">This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.</p>
<p id = "para-235">When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.</p>
<p id = "para-236">To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.</p>
<p id = "para-237">For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.</p>
<p id = "para-238">We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.</p>
<p id = "para-239">To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original authors reputation will not be affected by problems that might be introduced by others.</p>
<p id = "para-240"> Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.</p>
<p id = "para-241">Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.</p>
<p id = "para-242">When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.</p>
<p id = "para-243">We call this license the “Lesser” General Public License because it does Less to protect the users freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.</p>
<p id = "para-244">For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.</p>
<p id = "para-245">In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.</p>
<p id = "para-246">Although the Lesser General Public License is Less protective of the users freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.</p>
<p id = "para-247">The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a “work based on the library” and a “work that uses the library”. The former contains code derived from the library, whereas the latter must be combined with the library in order to run.</p>
<p id = "para-248"> GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</p>
<ol start = "0">
<li>This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called “this License”). Each licensee is addressed as “you”.</li>
</ol>
<p id = "para-250">A “library” means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.</p>
<p id = "para-251">The “Library”, below, refers to any such software library or work which has been distributed under these terms. A “work based on the Library” means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term “modification”.)</p>
<p id = "para-252">“Source code” for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.</p>
<p id = "para-253">Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.</p>
<p id = "para-249">A “library” means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.</p>
<p id = "para-250">The “Library”, below, refers to any such software library or work which has been distributed under these terms. A “work based on the Library” means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term “modification”.)</p>
<p id = "para-251">“Source code” for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.</p>
<p id = "para-252">Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.</p>
<ol>
<li>You may copy and distribute verbatim copies of the Librarys complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.</li>
</ol>
<p id = "para-254">You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.</p>
<p id = "para-255"></p>
<p id = "para-253">You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.</p>
<p id = "para-254"></p>
<ol start = "2">
<li>You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:</li>
</ol>
@ -277,30 +278,30 @@ application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
</code></pre>
<p id = "para-256">These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.</p>
<p id = "para-257">Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.</p>
<p id = "para-258">In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.</p>
<p id = "para-255">These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.</p>
<p id = "para-256">Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.</p>
<p id = "para-257">In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.</p>
<ol start = "3">
<li>You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.</li>
</ol>
<p id = "para-259"> Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.</p>
<p id = "para-260">This option is useful when you wish to copy part of the code of the Library into a program that is not a library.</p>
<p id = "para-258"> Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.</p>
<p id = "para-259">This option is useful when you wish to copy part of the code of the Library into a program that is not a library.</p>
<ol start = "4">
<li>You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.</li>
</ol>
<p id = "para-261">If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.</p>
<p id = "para-260">If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.</p>
<ol start = "5">
<li>A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a “work that uses the Library”. Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.</li>
</ol>
<p id = "para-262">However, linking a “work that uses the Library” with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a “work that uses the library”. The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.</p>
<p id = "para-263">When a “work that uses the Library” uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.</p>
<p id = "para-264">If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)</p>
<p id = "para-265">Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.</p>
<p id = "para-266"></p>
<p id = "para-261">However, linking a “work that uses the Library” with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a “work that uses the library”. The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.</p>
<p id = "para-262">When a “work that uses the Library” uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.</p>
<p id = "para-263">If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)</p>
<p id = "para-264">Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.</p>
<p id = "para-265"></p>
<ol start = "6">
<li>As an exception to the Sections above, you may also combine or link a “work that uses the Library” with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customers own use and reverse engineering for debugging such modifications.</li>
</ol>
<p id = "para-267">You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:</p>
<p id = "para-266">You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:</p>
<pre><code>a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
@ -333,9 +334,9 @@ specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
</code></pre>
<p id = "para-268">For an executable, the required form of the “work that uses the Library” must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.</p>
<p id = "para-269">It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.</p>
<p id = "para-270"></p>
<p id = "para-267">For an executable, the required form of the “work that uses the Library” must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.</p>
<p id = "para-268">It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.</p>
<p id = "para-269"></p>
<ol start = "7">
<li>You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:</li>
</ol>
@ -349,43 +350,43 @@ that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
</code></pre>
<ol start = "8">
<li><p id = "para-271">You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.</p>
<li><p id = "para-270">You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.</p>
</li>
<li><p id = "para-272">You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.</p>
<li><p id = "para-271">You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.</p>
</li>
<li><p id = "para-273">Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.</p>
<li><p id = "para-272">Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.</p>
</li>
</ol>
<p id = "para-274"></p>
<p id = "para-273"></p>
<ol start = "11">
<li>If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.</li>
</ol>
<p id = "para-275">If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.</p>
<p id = "para-276">It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.</p>
<p id = "para-277">This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.</p>
<p id = "para-274">If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.</p>
<p id = "para-275">It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.</p>
<p id = "para-276">This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.</p>
<ol start = "12">
<li><p id = "para-278">If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.</p>
<li><p id = "para-277">If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.</p>
</li>
<li><p id = "para-279">The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.</p>
<li><p id = "para-278">The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.</p>
</li>
</ol>
<p id = "para-280">Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and “any later version”, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.</p>
<p id = "para-281"></p>
<p id = "para-279">Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and “any later version”, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.</p>
<p id = "para-280"></p>
<ol start = "14">
<li><p id = "para-282">If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.</p>
<li><p id = "para-281">If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.</p>
<pre><code> NO WARRANTY
</code></pre>
</li>
<li><p id = "para-283">BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
<li><p id = "para-282">BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
</li>
<li><p id = "para-284">IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
<li><p id = "para-283">IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
<pre><code> END OF TERMS AND CONDITIONS
</code></pre>
</li>
</ol>
<p id = "para-285"> How to Apply These Terms to Your New Libraries</p>
<p id = "para-286">If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).</p>
<p id = "para-287">To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.</p>
<p id = "para-284"> How to Apply These Terms to Your New Libraries</p>
<p id = "para-285">If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).</p>
<p id = "para-286">To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.</p>
<pre><code>&lt;one line to give the library's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;
@ -403,16 +404,16 @@ You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
</code></pre>
<p id = "para-288">Also add information on how to contact you by electronic and paper mail.</p>
<p id = "para-289">You should also get your employer (if you work as a programmer) or your school, if any, to sign a “copyright disclaimer” for the library, if necessary. Here is a sample; alter the names:</p>
<p id = "para-290">Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob (a library for tweaking knobs) written by James Random Hacker.</p>
<p id = "para-291">&lt;signature of Ty Coon&gt;, 1 April 1990 Ty Coon, President of Vice</p>
<p id = "para-292">Thats all there is to it!</p>
<p id = "para-287">Also add information on how to contact you by electronic and paper mail.</p>
<p id = "para-288">You should also get your employer (if you work as a programmer) or your school, if any, to sign a “copyright disclaimer” for the library, if necessary. Here is a sample; alter the names:</p>
<p id = "para-289">Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob (a library for tweaking knobs) written by James Random Hacker.</p>
<p id = "para-290">&lt;signature of Ty Coon&gt;, 1 April 1990 Ty Coon, President of Vice</p>
<p id = "para-291">Thats all there is to it!</p>
</div>
</div>
<footer id = "footer"><p id = "para-307">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-306">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -5,6 +5,7 @@
<meta name="generator" content="crowbook">
<meta name="author" content="Élisabeth Henry">
<meta name="viewport" content="width=device-width">
<link rel = "icon" href = "images/image_0.svg">
<title>Crowbook User Guide</title>
<link rel = "stylesheet" href = "stylesheet.css" type = "text/css"
/>
@ -204,7 +205,7 @@ function toggle() {
<div id = "content">
<div id = "page">
<header>
<div id = "top"><p id = "para-309">Crowbook User Guide 0.10.3</p>
<div id = "top"><p id = "para-308">Crowbook User Guide 0.10.4</p>
</div>
<div id = "menu">
<img id = "menu-button" onclick="toggle();"
@ -215,7 +216,7 @@ function toggle() {
<h2 class = "author">Élisabeth Henry</h2>
</header>
<div id = "cover">
<img class = "cover" alt = "Crowbook User Guide" src = "images/image_0.png" />
<img class = "cover" alt = "Crowbook User Guide" src = "images/image_1.png" />
</div><p class = "next_chapter">
<a href = "chapter_000.html">
1. Crowbook »
@ -223,7 +224,7 @@ function toggle() {
</p>
</div>
</div>
<footer id = "footer"><p id = "para-310">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
<footer id = "footer"><p id = "para-309">Generated by <a href = "https://github.com/lise-henry/crowbook">Crowbook</a> 0.10.4-pre</p>
</footer>
</body>
</html>

View File

@ -172,6 +172,7 @@ p.first-para {
white-space: nowrap;
}
/* Default HTML CSS file includes default EPUB CSS file */
/* Colours for the navigation menu (toc) */