"license": "This guide is published under the Creative Commons Attribution-ShareAlike 4.0-International license.",
"about": "Crowbook allows to render a book written in Markdown in various formats. This is some kind of manual for it, and a way to demonstrate and test it.",
<pid ="para-2">Crowbook’s aim is to allow you to write a book in Markdown without worrying about formatting or typography, and let the program generate HTML, PDF and EPUB output for you. Its focus is novels and fiction, and the default settings should (hopefully) generate readable books with correct typography without requiring you to worry about it.</p>
<pid ="para-3">To see what Crowbook’s output looks like, you can read the Crowbook guide rendered in <ahref ="http://lise-henry.github.io/crowbook/book/book.html">HTML</a>, <ahref ="http://lise-henry.github.io/crowbook/book/book.pdf">PDF</a> or <ahref ="http://lise-henry.github.io/crowbook/book/book.epub">EPUB</a>.</p>
<pid ="para-4">You can also play with the <ahref ="http://vps.crowdagger.fr/crowbook/">online demo version</a>.</p>
<pid ="para-6">See <ahref ="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>
<pid ="para-7">If you are on Debian GNU/Linux or Ubuntu (on a PC architecture), you can also download <code>.deb</code> packages on <ahref ="https://github.com/lise-henry/crowbook/releases">the releases page</a>.</p>
<pid ="para-8"><ahref ="https://crates.io/">Cargo</a> is the <ahref ="https://www.rust-lang.org/">Rust</a>’s package manager. You can <ahref ="https://www.rust-lang.org/downloads.html">install it here</a>. Once it is done:</p>
</span></pre><pid ="para-9">will automatically download the latest <code>crowbook</code> release on <ahref ="https://crates.io/crates/crowbook">crates.io</a>, compile it, and install it on your system.</p>
<blockquote><pid ="para-10">Some dependencies also require building C libraries; you might thus also need to install a C compiler and <code>make</code>/<code>cmake</code> build tools. You can also try to build a version of Crowbook without optional features: <code>cargo install crowbook --no-default-features --features “clap”</code> will disable syntactic highlighting and proofreading, requiring less dependencies.</p>
<pid ="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>
</span></pre><pid ="para-13">where <code>BOOK</code> is a configuration file. Crowbook will parse this file and generate HTML, EPUB, and/or PDF output formats, according to the settings in the configuration file.</p>
<pid ="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>
</span></pre><pid ="para-15">This will generate a default <code>my.book</code> file, which you’ll need to complete. This configuration file contains some metadata, options, and lists the Markdown files.</p>
<pid ="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>
</span></pre><pid ="para-17">For more information, see the chapters on <ahref ="#chapter-1">the arguments supported by <code>crowbook</code></a> and on <ahref ="#chapter-2">the configuration file</a>.</p>
<pid ="para-18">Crowbook supports HTML, PDF and EPUB (either version 2 or 3) as output formats. See the Crowbook User Guide rendered in <ahref ="http://lise-henry.github.io/crowbook/book/book.html">HTML</a>, <ahref ="http://lise-henry.github.io/crowbook/book/book.epub">EPUB</a> and <ahref ="http://lise-henry.github.io/crowbook/book.pdf">PDF</a>.</p>
<pid ="para-19">Crowbook uses <ahref ="https://crates.io/crates/pulldown-cmark">pulldown-cmark</a> and thus should support most of <ahref ="http://commonmark.org/">CommonMark Markdown</a>. Inline HTML, however, is not implemented, and probably won’t be, as the goal is to have books that can also be generated in PDF (and maybe ODT).</p>
<pid ="para-20">Maybe the most specific “feature” of Crowbook is that it does its best to “clean” the input text before rendering it. By default, it removes superfluous spaces and tries to use curly quotes. If the book’s language is set to french, it also tries to respect french typography by replacing spaces with non-breaking ones when it is appropriate (e.g. before ‘?’, ‘!’, ‘;’ or ‘:’).</p>
<blockquote><pid ="para-21">Please <ahref ="https://github.com/lise-henry/crowbook/issues/new">open an issue</a> describing typographic rules if you want them to be implemented for other languages.</p>
<pid ="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>
</span></pre><pid ="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>
<pid ="para-25">Crowbook can also generate “proofreading” copies in HTML or PDF, highlighting grammar errors and repetitions. For more information, see <ahref ="#chapter-5">the proofreading chapter of the guide</a>.</p>
<h3id ="link-15">Interactive fiction</h3>
<pid ="para-26">Crowbook has experimental support for writing interactive fiction (only for HTML). For more information, read the <ahref ="#chapter-6">interactive fiction chapter</a>.</p>
<pid ="para-27">While the default settings will hopefully generate something that should look “good enough”, it is possible to customize the output, essentially by providing different <ahref ="#chapter-4">templates</a>.</p>
<h3id ="link-17">Bugs</h3>
<pid ="para-28">See the <ahref ="https://github.com/lise-henry/crowbook/issues">github’s issue tracker</a>.</p>
<pid ="para-29">Besides the <ahref ="https://www.rust-lang.org/">Rust</a> compiler and standard library, Crowbook uses the following libraries: <ahref ="https://crates.io/crates/pulldown-cmark">pulldown-cmark</a>, <ahref ="https://crates.io/crates/yaml-rust">yaml-rust</a>, <ahref ="https://crates.io/crates/mustache">mustache</a>, <ahref ="https://github.com/kbknapp/clap-rs">clap</a>, <ahref ="https://crates.io/crates/chrono">chrono</a>, <ahref ="https://crates.io/crates/uuid">uuid</a>, <ahref ="https://crates.io/crates/mime_guess">mime_guess</a>, <ahref ="https://crates.io/crates/crossbeam">crossbeam</a>, <ahref ="https://crates.io/crates/walkdir">walkdir</a>, <ahref ="https://crates.io/crates/rustc-serialize">rustc-serialize</a>, <ahref ="https://crates.io/crates/caribon">caribon</a>, <ahref ="https://crates.io/crates/hyper">hyper</a>, <ahref ="https://crates.io/crates/url">url</a>, <ahref ="https://crates.io/crates/lazy_static">lazy_static</a>, <ahref ="https://crates.io/crates/regex">regex</a>, <ahref ="https://crates.io/crates/term">term</a>, <ahref ="https://crates.io/crates/numerals">numerals</a>, <ahref ="https://crates.io/crates/syntect">syntect</a>.</p>
<pid ="para-30">It can also embed <ahref ="https://highlightjs.org/">Highlight.js</a> in HTML output to enable syntax highlighting for code blocks.</p>
<pid ="para-31">It also uses configuration files from <ahref ="https://github.com/japaric/rust-everywhere">rust-everywhere</a> to use <ahref ="https://travis-ci.org/">Travis</a> and <ahref ="http://www.appveyor.com/">Appveyor</a> to generate binaries for various platforms on each release.</p>
<pid ="para-32">While Crowbook directly doesn’t use them, there was also inspiration from <ahref ="http://pandoc.org/">Pandoc</a> and <ahref ="https://github.com/azerupi/mdBook">mdBook</a>.</p>
<pid ="para-33">Also, the <ahref ="https://validator.w3.org/">W3C HTML validator</a> and the <ahref ="http://validator.idpf.org/">IDPF EPUB validator</a> prove very useful during development and testing.</p>
<pid ="para-35">See <ahref ="#chapter-8">how you can contribute to Crowbook</a>.</p>
<pid ="para-36">If you find this project useful, you can also support its author by <ahref ="https://www.paypal.me/crowdagger">making a Paypal donation</a>.</p>
<h2id ="link-22">1.10. Library</h2>
<pid ="para-37">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 <ahref ="https://docs.rs/releases/search?query=crowbook">docs.rs</a>.</p>
<pid ="para-38">Note that, in order to facilitate code reuse, some features have been split to separate libraries:</p>
<li><ahref ="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><ahref ="https://github.com/lise-henry/crowbook-intl/">crowbook-intl</a> is used for the internationalization (translation) process.</li>
<pid ="para-39">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 <ahref ="#chapter-10">LICENSE</a> for more information.</p>
<pid ="para-40">Crowbook’s logo is licensed under the <ahref ="https://creativecommons.org/licenses/by/4.0/deed.en">Creative Commons Attribution 4.0 International license</a>, based on the <ahref ="https://commons.wikimedia.org/wiki/File:Rust_programming_language_black_logo.svg">Rust logo</a> by Mozilla Corporation.</p>
<pid ="para-41">Crowbook includes binary (minified) CSS and Javascript files from <ahref ="https://highlightjs.org/">Highlight.js</a>, written by Ivan Sagalaev, licensed under the following terms:</p>
<blockquote><pid ="para-42">Copyright (c) 2006, Ivan Sagalaev</p>
<pid ="para-43">All rights reserved.</p>
<pid ="para-44">Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<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>
<pid ="para-45">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>
<h1id ='link-24'><spanclass ='chapter-header'>Chapter 2</span><br/>Arguments</h1><pid ="para-46">Crowbook can take a number of arguments, generally in the form:</p>
</span></pre><pid ="para-47">The most important argument is obviously the book configuration file. It is mandatory in most cases: if you don’t pass it, Crowbook will simply display an error. In a normal use case this is the only argument you’ll need to pass, as most options will be set in this configuration file.</p>
<pid ="para-48">It is, however, possible to pass more arguments to <code>crowbook</code>:</p>
<pid ="para-51">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>
<pid ="para-57">This argument allows you 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 containing only <code>---</code> (three dashes). E.g:</p>
</span></pre><pid ="para-58">If this YAML block is not at the beginning of a file, it must also be preceded by a blank line.</p>
<pid ="para-59">This allows to not have to write a <code>.book</code> configuration file for a short story or an article. <code>crowbook -s foo.md</code> is rougly equivalent to having a book configuration file containing:</p>
</span></pre><pid ="para-60">That is, the chapter heading (if any) won’t be displayed in the output documents (though they still appear in the TOC).</p>
<blockquote><pid ="para-61">Note that by default, using <code>--single</code> or <code>-s</code> sets the default LaTeX class of the book to <code>article</code> instead of <code>book</code>.</p>
<pid ="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 <ahref ="#chapter-2">the configuration file</a>.</p>
<pid ="para-67">Displays all the valid options that can be used, whether in a book configuration file, with <code>--set</code>, or in an inline YAML block.</p>
<pid ="para-69">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>
<pid ="para-72">Display some statistics (word and character counts) about the book. If you use the <code>--verbose</code> or <code>-v</code> option (and your version of Crowbook has been compiled with support for this feature) you will get advanced statistics such as Felsch readability index.</p>
<pid ="para-84">Generate only the specified format. <code>FORMAT</code> must be either <code>epub</code>, <code>pdf</code>, <code>html</code>, <code>html.dir</code>, <code>odt</code> or <code>tex</code>.</p>
<pid ="para-85">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>
</span></pre><pid ="para-86">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>
<pid ="para-93">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 don’t use such an option, such as Windows).</p>
<pid ="para-95">will display Crowbook’s help message in french.</p>
<blockquote><pid ="para-96">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, but has no effect on the generated documents.</p>
<h1id ='link-40'><spanclass ='chapter-header'>Chapter 3</span><br/>The configuration file</h1><pid ="para-97">If you want to use Crowbook for your book, this configuration file is all you’ll have to add, beside the Markdown files containing the text of your book.</p>
<pid ="para-98">The format is not very complicated. This is an example of it:</p>
<pid ="para-100">Lines starting with the <code>#</code> characters are comments and are discarded.</p>
<h2id ="link-41">3.1. Configuration in an inline YAML block</h2>
<pid ="para-101">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>
</span></pre><pid ="para-102">This method only allows to set up options: you can’t include a list of chapters in this way, since the only “chapter” that will be included is this Markdown file itself.</p>
</span></pre><pid ="para-104">to generate output formats from this Markdown file.</p>
<blockquote><pid ="para-105">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>
<li><code>! file_name.md</code> includes a chapter whose title won’t 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>the paths 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 book’s directory.</li>
<pid ="para-109">Also note that you don’t 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>
</span></pre><pid ="para-111">Ideally, you should have one and only one level-one header (i.e. chapter title) in each Markdown file. If you have more than one, it might mess with the table of contents in some cases (e.g. for EPUB).</p>
<h3id ="link-43">Parts</h3>
<pid ="para-112">Parts are included using the <code>@</code> character, followed by the same characters than for chapters:</p>
</span></pre><pid ="para-113">However, you usually don’t really want to have a content directly below the part, only chapters (though it can be useful to add an introduction before the first chapter of this part), so there is also a more straighforward way to use parts, using only the <code>@</code> character followed by the (markdown-formatted) title of this part:</p>
</span></pre><pid ="para-114">With this shortcut, parts are always numbered.</p>
<h3id ="link-44">Subchapters</h3>
<pid ="para-115">If you write your book to be rendered by Crowbook, it is better to have one Markdown file per chapter. It is, however, possible to work with divisions at lower levels. In order to properly include these files, you can use the following syntax:</p>
</span></pre><blockquote><pid ="para-116">Note that there isn’t different syntax for numbered or unnumbered sections/subsections: you can only change the numbering scheme at the chapter level.</p>
<pid ="para-117">When including those files, Crowbook will include them in the table of content as part of the previous chapter (or section for subsections, and so on). It will also adjust the header levels of the Markdown files, so, in the previous example, a level-1 header in <code>section.md</code> will be displayed as a level-2 header in the book, and a level-1 header in <code>subsection.md</code> as a level-3 header.</p>
<blockquote><pid ="para-118">This can cause issues as only six levels of headers are supported; hence, if you include a level-5 header in <code>subsubsection.md</code>, it will cause an error.</p>
<pid ="para-119">The first part of the configuration file is dedicated to pass options to Crowbook. This is <ahref ="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 don’t have to put string in quotes, e.g.:</p>
</span></pre><pid ="para-121">It is possible to use multiline strings with <code>>-</code> and then indenting the lines that are part of the string:</p>
</span></pre><pid ="para-122">will set <code>title</code> to <code>“A long title”</code>. See <ahref ="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 won’t be inserted).</p>
<pid ="para-123">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>
<h3id ="link-46">Metadata</h3>
<pid ="para-124">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>
<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>, or <code>fr</code>...</li>
<li><code>cover</code>, a path to an image file for the cover of the book (not displayed in all output formats).</li>
<pid ="para-126">You can define your own metadata by starting an option name with <code>metadata.foo</code>.</p>
<pid ="para-127">All metadata are accessible from templates, see <ahref ="#chapter-4">Templates</a>.</p>
<h3id ="link-47">The <code>import</code> special option</h3>
<pid ="para-128">The special <code>import</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>
license</span><spanstyle="color:#839496;">: "</span><spanstyle="color:#2aa198;">Copyright (C) Joan Doe. All rights reserved.</span><spanstyle="color:#839496;">"
license</span><spanstyle="color:#839496;">: </span><spanstyle="color:#2aa198;">CC-BY-SA </span><spanstyle="color:#586e75;"># Override the license from common.book
<pid ="para-131">These options specify which files to generate.</p>
<pid ="para-132">Note that all file paths are relative to the directory where the configuration file is, not to the one where you run <code>crowbook</code>. So if you set</p>
</span></pre><pid ="para-134"><code>foo.epub</code> will be generated in <code>some/dir</code>, not in your current directory.</p>
<pid ="para-135">Crowbook will try to generate each of the <code>output.xxx</code> files that are specified. That means that you’ll have to set at least one of those if you want a call to</p>
</span></pre><pid ="para-136">to generate anything. (It’s still possible to generate a specific format, and only this one, by using the <code>--to</code> and <code>--output</code> argument on the command line).</p>
<pid ="para-137">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 another command to use with <code>tex.command</code>) to generate a PDF file, so PDF rendering won’t 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>
<pid ="para-139">(There are other output options for generating proofreading files, see <ahref ="#chapter-5">Proofreading</a>, and interactive fiction, see <ahref ="#chapter-6">Interactive fiction</a>.)</p>
<pid ="para-140">Setting output file names manually can be a bit tedious, and is not always necessary. You can also specify a list of output formats with the <code>output</code> option:</p>
</span></pre><pid ="para-142">This option will set default output path for PDF, EPUB and HTML according to the book configuration file name. So, if your book is <code>my_book.book</code> (or <code>my_book.md</code>), it will generate <code>my_book.pdf</code>, <code>my_book.html</code> and <code>my_book.epub</code>.</p>
<blockquote><pid ="para-143">You can also infer the output file name by specifying “auto” to e.g. <code>output.html</code>. The previous example is thus equivalent to</p>
<pid ="para-144">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>
</span></pre><pid ="para-145">will render the EPUB file in <code>docs/book/book.epub</code>.</p>
<h3id ="link-51">Input options</h3>
<pid ="para-146">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>
<li><code>input.clean</code> (default: <code>true</code>): if set to <code>false</code>, will disable all typographic “cleaning”. The 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> (default: <code>true</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 can’t be perfect, you might want to disable it in some circumstances.</li>
<li><code>input.clean.ligature_dashes</code> (default: <code>false</code>): if set to <code>true</code>, will convert <code>--</code> to en dash (<code>–</code>) and <code>---</code> to em dash (<code>—</code>). This can be useful if you want to use these characters but can’t access them easily on your keymap; however, as it can also cause problems if you <em>do</em> want to have two successive dashes, it is disabled by default.</li>
<li><code>input.clean.ligature_guillemets</code> (default: <code>false</code>) is a similar feature for french ‘guillemets’, replacing <code><<</code> and <code>>></code> to <code>«</code> and <code>»</code>.</li>
<li><code>rendering.highlight</code> (default: <code>syntect</code>): specify if and how to perform syntax highlighting for code blocks. Valid values are:<ul>
<li><code>syntect</code>: uses the <ahref ="https://crates.io/crates/syntect">syntect</a> library to perform syntax highlighting. This has the advantage of also enabling syntax highlighting for LaTeX/PDF and EPUB formats; however syntect support doesn’t seem to work on Windows.</li>
<li><code>highlight.js</code>: this will use (and embed) <ahref ="https://highlightjs.org/"><code>highlight.js</code></a> for HTML rendering, and will not perform any syntax highlighting for other output formats.</li>
<li><code>none</code>: disable syntax highlighting. If your version of Crowbook (as is the case for Windows builds) isn’t built with <code>syntect</code> support, it will default to <code>none</code> if you try to use it.</li>
<li><code>rendering.highlight.theme</code>: only used if <code>rendering.highlight</code> is set to <code>syntect</code>, selects the theme to use for syntax highlighting. Default is “InspiredGitHub”. Valid theme names are “InspiredGitHub”, “Solarized (dark)”, “Solarized (light)”, “base16-eighties.dark”, “base16-mocha.dark”, “base16-ocean.dark” and “base16-ocean.light”.</li>
<li><code>rendering.num_depth</code>: 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. (Default is <code>1</code>.) This also affects what levels will be displayed in the table of contents.</li>
<li><code>rendering.chapter</code> and <code>rendering.part</code>: the strings that will be used to design chapter and part. E.g., if you want your parts to show as “Book III” instead of “Part III”, you can set <code>rendering.part: Book</code>.</li>
<li><code>rendering.part.roman_numerals</code> and <code>rendering.chapter.roman_numerals</code>: these two booleans allow you to specify if you want roman numerals for part or chapter numbers (default is <code>true</code> for part numbers, and <code>false</code> for chapter numbers).</li>
<li><code>rendering.inline_toc</code>: if set to true, Crowbook will include a table of contents at the beginning of the document.</li>
<li><code>rendering.inline_toc.name</code>: the name of this table of contents as it should be displayed in the document.</li>
<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>
<li><code>rendering.part.reset_counter</code>: set it to <code>false</code> if you don’t want your chapter numbers to start again at 1 at each part.</li>
<pid ="para-148">These options allow you to customize the HTML rendering (used both by the default HTML standalone renderer and the HTML multifile renderer):</p>
<li><code>html.header</code> and <code>html.footer</code> allow to set a custom (Markdown) string at the top and at the bottom of the HTML page. This is actually a template, so you can access metadata, such as <code>{{{author}}}</code>, <code>{{{title}}}</code>, or <code>{{{version}}}</code> in it. See the <ahref ="#chapter-4">template</a> chapter for more information on the fields you can use.</li>
<li><code>html.css</code> allows to set up a custom CSS file. You can also redefine the colours in a file and set it using <code>html.css.colours</code>.</li>
<li><code>html.css.add</code> allows you to add some specific lines of CSS in your book configuration file, that will be appended after the default CSS template.</li>
<li><code>html.highlight.theme</code> is similar to <code>rendering.highlight.theme</code> but only sets the theme for HTML output.</li>
<li><code>html.standalone.one_chapter</code>, if set to true, will only display one chapter at a time (using Javascript), making it look similarly to the multifile HTML.</li>
<li><code>html.standalone.template</code> allows you to change or modify the HTML template for standalone HTML.</li>
<li><code>tex.paper.size</code> and <code>tex.font.size</code> (default <code>a5paper</code> and <code>10pt</code>) allows to modify the page and font size .</li>
<li><code>tex.margin.left</code>, <code>tex.margin.right</code>, <code>tex.margin.top</code> and <code>tex.margin.bottom</code> specify the margin of the page.</li>
<li><code>tex.links_as_footnotes</code> can be set to <code>false</code> if you don’t want links to also appear as footnotes (which means losing them if it is actually printed).</li>
</span></pre><pid ="para-154">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>
</span></pre><pid ="para-156"><b>default</b>: not set</p>
<h4id ="link-59">resources.out_path</h4>
<pid ="para-157">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>
<pid ="para-158">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>
</span></pre><pid ="para-159">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>
<pid ="para-160">Similarly, the whole path of <code>resources.files</code> is copied, so</p>
<pid ="para-163">Here is the complete list of options. You can always look at it by running <code>crowbook --list-options</code> or <code>crowbook -l</code>.</p>
<li><b>default value</b>: <code>“<h1 id = ‘link-{{{link}}}’>{{#has_number}}<span class = ‘chapter-header’>{{{header}}} {{{number}}}</span>{{#has_title}}<br />{{/has_title}}{{/has_number}}{{{title}}}</h1>”</code></li>
<li>Inline template for HTML chapter formatting</li>
</ul>
</li>
<li><b><code>html.part.template</code></b><ul>
<li><b>type</b>: string</li>
<li><b>default value</b>: <code>“<h2 class = ‘part’>{{{header}}} {{{number}}}</h2><h1 id = ‘link-{{{link}}}’ class = ‘part’>{{{title}}}</h1>”</code></li>
<li>Specifies left margin (note that with book class left and right margins are reversed for odd pages, thus the default value is 1.5cm for book class and 2cm else)</li>
<li>Specifies right margin(note that with book class left and right margins are reversed for odd pages, thus the default value is 2.5cm for book class and 2cm else)</li>
<li>Path where to find resources (in the source tree). By default, links and images are relative to the Markdown file. If this is set, it will be to this path.</li>
<pid ="para-164">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 (note that you might need to use quotes if it includes some characters that may lead the YAML parser to read it as an array, an integer or a list), and a list of strings is a list containing only strings, see <ahref ="https://en.wikipedia.org/wiki/YAML#Basic_components">YAML syntax</a>). The <code>path</code> type might puzzle you a bit, but it’s 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>
<h1id ='link-77'><spanclass ='chapter-header'>Chapter 4</span><br/>Markdown format</h1><pid ="para-165">Crowbook uses <ahref ="https://github.com/google/pulldown-cmark">pulldown-cmark</a>, which is an implementation of <ahref ="http://commonmark.org/">CommonMark</a>, so for more information on Markdown syntax, you can refer to this website.</p>
<pid ="para-166">However, pulldown-cmark also implements a handful of unofficial extensions, and Crowbook also adds its own variants, so there are a few syntax elements that are not covered by the CommonMark reference.</p>
<h2id ="link-78">4.1. Tables</h2>
<pid ="para-167">Tables can be included in your Markdown file. E.g.:</p>
[</span><spanstyle="color:#b58900;">^1</span><spanstyle="color:#839496;">]: </span><spanstyle="color:#2aa198;">But </span><spanstyle="color:#839496;">you shouldn't use them too much.</span><spanstyle="color:#839496;">
<pid ="para-174">You can use multiple paragraphs in a footnote definition. This can sometimes be useful, but it can also be tricky, as if you only let an empty line before the next paragraph, it will also be included in the footnote. And probably the next one and the following one too:</p>
[</span><spanstyle="color:#b58900;">^1</span><spanstyle="color:#839496;">]: </span><spanstyle="color:#2aa198;">This </span><spanstyle="color:#839496;">is obviously part of the footnote definition.</span><spanstyle="color:#839496;">
This is less obviously ALSO part of the footnote definition.
<h2id ="link-80">4.3. Superscript and subscript</h2>
<pid ="para-179">Crowbook 0.12.0 added experimental support for superscript and subscript, using respectively <code>foo^up^</code> and <code>bar~down~</code> syntax, which will render as “foo<sup>up</sup>" and “bar<sub>down</sub>" ; this feature is quite a hack above the Markdown parsing library, and as such might cause issue if you mix it with other Markdown syntax elements (or, in the previous example, for smart quote detection). This is why you’ll need to enable it with <code>crowbook.mardown.superscript</code>.</p>
<h2id ="link-81">4.4. “Standalone” images</h2>
<pid ="para-180">This is not <em>per se</em> a new syntactic element, but Crowbook distinguish two kind of images, according to their position in the document:</p>
</div><pid ="para-183">While this one <imgsrc ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAADAPAAAwDwEQo/h8AAAAB3RJTUUH4QcOERMAPzhBcQAACalJREFUeNrtnHtwVsUVwH9JDI8IUgoaFQHBiJiA4ZkWBRQcKY5YtDZDoUxFaam2CHQ6Mlo7KmmnVXHoY7StnbZW2/HRTqvTB+1UHXG0Kmh5k9pOQ4OmFAQKkgARCekf93yTzc3eu7v37pf7RT0zO/N9d++ePXvu7tnz2oXChunADD6ESBgHNAE1mrppQLuUmZr6qcDeiLYfCCgCNihMmhaq26bU1cuzHMxQ6l4Hit/PjDofWA2UhJ5/FHhHYUQrUC51i5XnufIlqRsCHFeeHwYGhXCXAj8ExvR05hUD/5aBvg1crdQt1DDpCLBG8zxXHgSOaZ4vUvBeBxyU542aD9ej4CPAntBgvyuD2hPDKNeyD+gLPBR6vkdo6LFwDtDikVGu5YjQkNcl5gNGCMEbgUuAMnneDzg1Ic5jwHPAn4GjCXGUAf0VWmYAbwitFYU0074c+vKNwG3AphSz5xMK/stT4NkB1AFvhZ4v9THwUzwxsCX0fzjwbYf2e4CdMtj1osJsUOqfAy6S8jGgGhhpuTwrpYThcCHNwE8lnB2PABcAfRx3y2JpM1R25iR9X5sVs6qB8RqTy5bw9cBNwgCfsnwR8KIDHdNDemMNMDnfzBsbIuIFUXrrLQg+DFzaDR+4BvifBT3/ApYBr4WeV+eTuDEJlspJsSKKunmlLA5ZLLalMt+EuRBTr6gRWUAZsMWR5rzDnywJudvjLp8GSoDlQJsFzb/vDoIWGIg4AawoIA2hHHjM8qPP960HngdcAzRL2Qd8zdBmjlgPhQBXAk8Ap1m+f7dYPYNF9PQHfiOiKO/y7kTI25Il9IrRD48nsM8Tw0sOnSwtEOaNEJVJR+Mx4MwIf2NUWZeGmMmihpg6ubcAGFcE3AG8G0HjVuBc5f06SxVsYhqi+oiNGtfJFtHks2JaGXCDyK4oGl+PkP8bDWNrAHqnJXKFoZMhGTFvJvBHC6vj1RgmlBvaLk+qNw0UQ/1Cw1f6YkbMu9NSfu2XHTjOCroxpv028QANJ4i7GFdahfjy9oo3N464A54dAi7LdqclA+da4OstjI7D0yoqXBMwOg7ZKofdaV5Gs2+iJX0r8+SOu8vkFmqyQLI9w912qwV9jyfAa2Mz78IiDHKFBaIbMmLeKMtZcl4C3Ndb4LVOM6mLsTbeBc6KaHdNnhn4dUsGJlGrykXWnYjAeUdaM+4+YECM/Twy4dJxgUYL5rV6cIF9Q4PX6M8slq36c7LjqI3fDH3VIg0ja4H3lP9n5kHvs5l9mz30VSryTsXbTBB9HIwmfjNOtPUoG3KHZlm8QpDfkoPH5d1LhLnNQJVHBv7TkoG/8MTAqDDFEdlwOsVPGgxEtQETQp1sonNwKZdKAfCy/B+g0bn6JhjQGOzd81/xwMAaCx9Ag9pgrKVsUYn7q/j+AG5VdMPVGlVnuKgfzaLZu8K3HPS0tAmZK2McEmq5INxwkoWfbJny/vOysQDsFvlXpzHzvhqh/pwuDs8zLGTzSQcGpjX+b8EcXRwf1XggcCim8ZXKu3+RXXE0XeMNraKLqQmUz8vsu4sg5e2k4DDB9x2Yt8aTFzvOfDV6t1fHIBirvLdWQaqTmUctB/2kKLG1snyWALPkKy9wwPOip80qTpzdbzLSbzQQqSrQvyO7tLV8mpZnGfpaoTPnpgsRJkLV6ft0ATGw3CMDT7Po7x/A7FyDKQ6EqirIkwXAuPV0zY9OC30d+p9ajFtWlLrDNWccA2knCFke8ICrStFZXXbxttyPWXRkbsaVoUrjq0QXbMt4FtbLztkrIfNGigMhB8OwS9q8VLeJLDM0nKBx/w8VdeRe4JOCvLuZeFLs91ssGXkqQTrcszIBHnZw2C4xORbi1Bhbd9XFwC8dFWAfpS1kn6t+xOsJEjp3adSovpbe6ftMA+9viA+sdFwefQhSI7qTiUvFGTCbICcmzobWpSHfFvP+ITE2tFBN55NDuvLzFHLmngJSe3JllIbWRw1tWtBkstq6ytP62voRxHKPZ8y4A6oelyDm0k7oGFmDQ+c+Mk1vz3jXjlJVShzwNIT9X1swx4Lbgc+nZF5v7HKq81VujqHtZov2zeJ8rta5jQYLkji31u6UDHwloyV7q/gl48KScef39ouvYJBNaLPIoHMlPUa6JAPmtVnSdpFB7Yp0VhKxlccxtzYhA32YXbZm3s9Ex7PVXecZ5HtdFDPCcJk4P+OgNWFsA/H6RAWbNouMmWSBv00CWc+K9VAh4mEjwbm4rQ40FcmYTFbMLOAZk/u80XJpPJCQgRM03utvaj5mrcjbtpD4qCQ4d/K2xxn7kOWY3zLJvzsdZMsx4OwExBYL03IMOdfw/hQ6jlY0iRydS5AX6AOGKPTYlFVxyEYLkfvQH633EYMtUczFLzi0G0dwtOw9xWI6Avw0wqKwhV9ZjPOozPhGLPJuSmWrHi470zb8JhrlGHiIjoPZLjBP6XuOWDdJ8xRvMoxtE0GS6TCxgRMdHDK5uA46utRz2v5nEg56oLR/WWzzpMw728L2X55WPvQmONVoI1xt4RTg1yloGiVLeSBBwL1PQvNyt8W4dpIyzjzRwaf3tIPKMCAFTX8Avqf47pLAWgdHbaozxOsctf58p7fNVfq6J+HyfcpxTC+l1ehdy6N5ZOBa4Mei7M8Xr7eLWflEwjHFLqc4qAQ+Tcdhw/0S+zCpDReLVeAbniFIQVbhQuDvFm1rCMKgcbCDIIHqdDoOGz4Vdl2lhfmGr/WdPM7ATcDHSX4Xzf0G2j+bxCpwhQWG+jc1z3p5YmAtQZxjpsW7Ovn4X0Obhd3l6Ygrr4Xev1yWgK/0i1LMma/DCKJvszXOikyP/FdaCt1XCeKut9M56/1HJEuwdFG7Hg75AleJ/bzZkvaqfDJwnGa2LbdUttVB/Q2/d7TkkqNcsiTqCc4Nv0B0Cl9eoEZKaWgASdSDRnEGLBTb2xYq6AiU/ydh39NDOMeT4M4YX3e5XAv81hOudSICtouJWCrMrRLX1hRP/Vzng2Zf15L4vBvmMin5hn4+kPi6PzCcN9xEcNqnnuxhi2xmu/L40VNDhciVN0RHy33d0WSfvpE731tGcAgod6fhCHoAnINdsD5fpYUecgVoFLTQNZP1JzIb9nnsZ6/I8zWa/lvowVBCR5TvoDgmcrAIfaDqQYOdrZvRqgk2hyB+0U5wHqXHX9JdBfyArocVB9H5cONxOm4A0eWoLJa6M+gcRXuHrkmVxQSJoufzPoZiOl9+ODOkn6oJSNtDOutUpW4D3X83YcHAJJFfUzV16vngaZr6yaJoV/MhRMIMjclVUPB/QxRWXpMKRCkAAAAASUVORK5CYII="title =""alt ="Logo"/> is embedded in a paragraph and its size is unchanged.</p>
<h2id ="link-82">4.5. Interactive fiction</h2>
<pid ="para-184">Crowbook also adds some syntax for interactive fiction, to make embedding Javascript code easier. It is only enabled for the interactive fiction renderer. For more information, see the <ahref ="#chapter-6">chapter on this matter</a>.</p>
<h1id ='link-83'><spanclass ='chapter-header'>Chapter 5</span><br/>Templates</h1><pid ="para-186">Crowbook allows the user to specify a number of templates.<ahref ="#note-dest-4"><supid ="note-source-4">[4]</sup></a></p>
<pid ="para-187">Each of this template can be overriden by a custom one, by setting e.g.:</p>
<pid ="para-191">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>
</span></pre><pid ="para-192">In order to get the <code>chapter.xhtml</code> template for EPUB3, you’ll also have to use <code>--set epub.version 3</code>:</p>
<pid ="para-193">Crowbook uses <ahref ="https://crates.io/crates/mustache">rust-mustache</a> as its templating engine, which allows to use <ahref ="http://mustache.github.io/">Mustache</a> syntax in the templates.</p>
<pid ="para-195">It mainly boils down to using <code>{{{foo}}}</code><ahref ="#note-dest-5"><supid ="note-source-5">[5]</sup></a> to insert the value of variable <code>foo</code> in the document:</p>
</span></pre><pid ="para-197">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>
</span></pre><pid ="para-198">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>
<pid ="para-199">For more information about Mustache syntax, see the <ahref ="http://mustache.github.io/mustache.5.html">Mustache manual</a>.</p>
<h4id ="link-87">Syntax in LaTeX</h4>
<pid ="para-201">Since LaTeX already uses a lot of curly brackets, the default template sets an altenative syntax to access variables, with <code><<&foo>></code><ahref ="#note-dest-6"><supid ="note-source-6">[6]</sup></a>:</p>
<pid ="para-202">The javascript file used by both the standalone HTML renderer and the multiple files HTML renderer.</p>
<pid ="para-203">This is not currently an actual template, just a plain javascript file which cannot contain <code>mustache</code> tags.</p>
<h3id ="link-90">html.css</h3>
<pid ="para-204">The main CSS file used by both the standalone HTML renderer and the multiple files HTML renderer.</p>
<h3id ="link-91">html.css.colours</h3>
<pid ="para-205">A CSS file containing only colour settings. Used by <code>html.css</code>.</p>
<pid ="para-206">This is not currently an actual template, just a plain CSS file which cannot contain <code>mustache</code> tags.</p>
<h3id ="link-92">html.css.print</h3>
<pid ="para-207">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>
<pid ="para-208">This is not currently an actual template, just a plain CSS file which cannot contain <code>mustache</code> tags.</p>
<h3id ="link-93">html.highlight.js</h3>
<pid ="para-209">A javascript file used by both HTML renderers to highlight codes in code blocks. It should be a variant of <ahref ="https://highlightjs.org/">highlight.js</a>.</p>
<pid ="para-210">This is not an actual template, just a plain javascript file.</p>
<h3id ="link-94">html.highlight.css</h3>
<pid ="para-211">A CSS file used by both HTML renderers to set the theme of <ahref ="https://highlightjs.org/">highlight.js</a>. It should, though, be an highlight.js theme.</p>
<pid ="para-212">This is not an actual template, just a plain CSS file.</p>
<h3id ="link-95">html.standalone.js</h3>
<pid ="para-213">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>
<h3id ="link-96">html.standalone.template</h3>
<pid ="para-214">The main HTML template for standalone HTML renderer.</p>
<h3id ="link-97">html.dir.template</h3>
<pid ="para-215">The main HTML template for multiple files HTML renderer.</p>
<h3id ="link-98">tex.template</h3>
<pid ="para-216">The main (and currently only) template used by the LaTeX renderer.</p>
<h3id ="link-99">epub.chapter.xhtml</h3>
<pid ="para-217">This template is the main template used by the Epub renderer. It contains the XHTML template that will be used for each chapter.</p>
<h3id ="link-100">epub.css</h3>
<pid ="para-218">This template is used by the Epub renderer and contains the style sheet.</p>
<h3id ="link-101">Inline templates</h3>
<pid ="para-219">Crowbook also has some inline templates, that are set in the book configuration file:</p>
<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 templates, 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, allowing to redefine commands.</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, while <code>rendering.part.template</code> does the same for part. These are used only for text-only output, such as in the TOC. <code>html.chapter.template</code> and <code>html.part.template</code> allow to change the HTML formatting for parts and chapters. <em>These options should probably only be used if you know what you’re doing, as they can break the document.</em> If you only need to change the name of chapters or parts, use <code>rendering.part</code> and <code>rendering.chapter</code> instead.</li>
<pid ="para-221">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><b></code> tag for HTML or <code>\textbf</code> for LaTeX. If you need to use these data in places that don’t support formatted text (e.g. in meta tags), you can use the raw content by accessing <code>xxx_raw</code> instead (e.g., <code>author_raw</code>, <code>title_raw</code>, ...). (Note that the content of the raw metadata is <em>not</em> HTML-escaped, so in this case you might want to use <code>{{xxx_raw}}</code> instead of <code>{{{xxx_raw}}}</code>.)</p>
<pid ="para-222">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 Mustache’s section for some logic, e.g.:</p>
<td><code>content</code></td><td> A rendered version of the book or chapter’s content </td><td><code>html.standalone.template</code>, <code>html.dir.template</code>, <code>tex.template</code>, <code>epub.chapter.xhtml</code></td></tr>
<td><code>toc</code></td><td> A rendered version of the table of contents </td><td><code>html.standalone.template</code>, <code>html.dir.template</code></td></tr>
<td><code>has_toc</code></td><td> Set to <code>true</code> if the table of contents is not empty </td><td><code>html.standalone.template</code></td></tr>
<td><code>footer</code></td><td> The content of <code>html.footer</code></td><td><code>html.standalone.template</code>, <code>html.dir.template</code></td></tr>
<td><code>header</code></td><td> The content of <code>html.header</code></td><td><code>html.standalone.template</code>, <code>html.dirtemplate</code></td></tr>
<td><code>script</code></td><td> The javascript file for this HTML document </td><td><code>html.standalone.template</code>, <code>html.dir.template</code></td></tr>
<td><code>style</code></td><td> The CSS file for this HTMLdocument, that is, a rendered version of <code>html.css</code></td><td><code>html.standalone.template</code></td></tr>
<td> A variable whose name corresponds to <code>lang</code> in book options (e.g. <code>lang_en</code> if lang is set to “en”, <code>lang_fr</code> if it is set to “fr”, ...) </td><td><code>true</code></td><td><code>html.css</code>, <code>epub.css</code></td></tr>
<td><code>chapter_title</code></td><td> The title of current chapter </td><td><code>html.dir.template</code>, <code>epub.chapter.xhtml</code>, <code>rendering.chapter.template</code></td></tr>
<td><code>chapter_title_raw</code></td><td> The title of current chapter (raw text without HTML formatting) </td><td><code>html.dir.template</code>, <code>epub.chapter.xhtml</code>, <code>rendering.chapter.template</code></td></tr>
<td><code>json_data</code></td><td> Contains structured data with book’s metadata in JSON-LD format </td><td><code>html.standalone.template</code>, <code>html.dir.template</code></td></tr>
<td><code>highlight_code</code></td><td> True if <code>html.highlight_code</code> is true </td><td><code>html.standalone.template</code>, <code>html.dir.template</code></td></tr>
<td><code>highlight_js</code></td><td> The base64-encoded content of <code>html.highlight.js</code></td><td><code>html.standalone.tempate</code></td></tr>
<td><code>one_chapter</code></td><td> True if <code>html.standalone.one_chapter</code> is true, else not present </td><td><code>html.standalone.template</code>, <code>html.standalone.js</code></td></tr>
<td><code>book.svg</code></td><td> The base64-encoded image of the button to display all chapters </td><td><code>html.standalone.js</code>, <code>html.standalone.template</code></td></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.standalone.js</code>, <code>html.standalone.template</code></td></tr>
<td><code>favicon</code></td><td> The <code><link rel = “icon” ...></code> tag if <code>html.icon</code> is set </td><td><code>html.standalone.template</code>, <code>html.dir.template</code></td></tr>
<td><code>margin_left</code>, <code>margin_right</code>, <code>margin_top</code>, <code>margin_bottom</code></td><td> The margins of the document </td><td><code>tex.template</code></td></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>
<h1id ='link-106'><spanclass ='chapter-header'>Chapter 6</span><br/>Proofreading with Crowbook</h1><pid ="para-226">Crowbook includes some proofreading features, that can be enabled if you set one of the</p>
<pid ="para-227">output files (or include <code>proofread.pdf</code> in the list of formats to render to <code>output</code>). This allows you to generate different files for publishing and proofreading (you probably don’t want to publish a version that highlights your grammar errors or your repetitions).</p>
<pid ="para-228">Current proofreading features are:</p>
</span></pre><pid ="para-231">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>
</span></pre><pid ="para-234">It uses <ahref ="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>
<pid ="para-237">Crowbook can use <ahref ="https://languagetool.org/">LanguageTool</a> to detect grammar errors in your text. It is, however, a bit more complex to activate.</p>
<pid ="para-238">First, you’ll have to activate this feature in your book configuration file:</p>
</span></pre><pid ="para-239">You’ll then have to download the stand-alone version of <ahref ="https://languagetool.org/">LanguageTool</a>. It includes a server mode, which you’ll have to launch:</p>
</span></pre><pid ="para-240">You can also use the LanguageTool GUI (<code>languagetool.jar</code>) and start the server from the menu “Text Checking -> Options”. This also allows you to configure LanguageTool more precisely by activating or deactivating rules.</p>
<pid ="para-241">You can then run Crowbook, and it will highlight grammar errors in HTML or PDF proofreading output files.</p>
<blockquote><pid ="para-242">Note: running a grammar check on a long book (like a novel) can take up to a few minutes.</p>
<pid ="para-243"><ahref ="http://grammalecte.net/">Grammalecte</a> is a grammar checker specialized for the french language. If the language of your book is french, you can use it in a similar fashion to languagetool:</p>
</span></pre><pid ="para-244">You’ll also need to run the Grammalecte server. First <ahref ="https://www.dicollecte.org/#download_div">download the CLI and server version</a>, then:</p>
</span></pre><pid ="para-245">You can then run Crowbook with <code>--proofread</code> to check the grammar of your book. It is possible to run both LanguageTool and Grammalecte on the same book (though might take a while for a long book...).</p>
<h1id ='link-112'><spanclass ='chapter-header'>Chapter 7</span><br/>Interactive fiction</h1><pid ="para-246">Version <code>0.12.0</code> added experimental support for writing interactive fiction.</p>
<blockquote><pid ="para-247">Since this support is experimental, it means it can change at anytime, and there is no guarentee that the interactive fiction you write for the current version of Crowbook will work with the next release, even if it isn’t a major release.</p>
</span></pre><pid ="para-249">All Crowbook renderers should render this correctly, allowing the reader to “choose her adventure”. Note, however, that you still need to include all these Markdown files in you book configuration files.</p>
<h2id ="link-114">7.2. The interactive fiction renderer</h2>
<pid ="para-250">While the above allows you to generate correct EPUB and PDF files, it will still display all the content if the reader chooses to read your book linearly. While this may not be a problem, you might want to only display the part of the book that the reader is actually exploring.</p>
<pid ="para-251">In order to do so, you can use the interactive fiction html renderer:</p>
</span></pre><pid ="para-252">This output is similar to the standalone HTML output, except the option to display only a chapter at a time is always true, and there is no way to display the table of contents.</p>
<h2id ="link-115">7.3. Using Javascript in your interactive fiction</h2>
<pid ="para-253">While the above allows the reader to choose his own path, its interactivity is quite limited. With the interactive fiction renderer, it is possible to include Javascript code in your Markdown files, using a code block element:</p>
</span></pre><pid ="para-254">This Javascript code can return a string value, which will be displayed inside the document according to the reader’s previous choices:</p>
</span></pre><blockquote><pid ="para-255">Note that <em>only</em> the interactive fiction renderer supports this way of embedding Javascript code. If you try to render a document containing such code blocks to EPUB, PDF, or the “normal” HTML renderer, they will be displayed as regular code blocks.</p>
<h2id ="link-116">7.4. Embedding Makdown in your Javascript code embedded in your Markdown</h2>
<pid ="para-256">If you want to include Markdown formatting in the Javascript code (to display a passage or another without having to write HTML code), you can use the <code>@"..."@</code> syntax:</p>
</span></pre><pid ="para-257">Note that in this case you don’t need to return a value, this is done behind your back. Similarly, <code>@"..."@</code> blocks don’t require semicolons.</p>
<pid ="para-258">If you need to access the value of a Javascript variable inside this Markdown code, you can use the <code>{{...}}</code> syntax:</p>
<pid ="para-259">Sometimes, you want some text (or Javascript code) to only be displayed (or run) when the reader reads this passage the first time, or alternatively when she goes back to it. While it is trivial to add some code to check that, it is a common enough pattern to justify its own variant : you’ll juste have to insert a named code block with the number:</p>
<pid ="para-260">As other renderers, there are options specific to the interactive fiction.</p>
<pid ="para-261"><b>html.if.new_game</b> allows you to specify the path to a Javascript that will be run at the beginning of the game. Since this code is not embedded in a function and is at the root (and the beginning) of the document, it is a good place to declare all the functions and the global variables you might need for your interactive fiction mechanics. e.g.:</p>
</span></pre><pid ="para-262"><b>html.if.new_turn</b> and <b>html.if.end_turn</b> allow you to specify some Javascript code that will be executed at the beginning and the end of each segment. Unlike <code>html.if.new_game</code>, the (usually shorter) code is specified inline, and can return a string value that will be displayed at the beginning and the end of each segment. This is exactly like including code blocks at the beginning or the end of each of your Markdown file. E.g.:</p>
<h1id ='link-119'><spanclass ='chapter-header'>Chapter 8</span><br/>Tips and tricks</h1><h2id ="link-120">8.1. Using Crowbook with Emacs’ markdown mode</h2>
<pid ="para-264">If you use <ahref ="https://www.gnu.org/software/emacs/">Emacs</a> as a text editor, there is a nice <ahref ="http://jblevins.org/projects/markdown-mode/">Markdown mode</a> to edit Markdown files.</p>
<pid ="para-265">It is possible to use Crowbook for HTML previewing in this mode, which <ahref ="http://xkcd.com/1742/">requires only minimal configuration and tweaking</a>:</p>
</span></pre><pid ="para-266">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 your file) in Emacs’ integrated browser.</p>
<h3id ="link-121">Some explanations if it looks a bit cryptic to you</h3>
<pid ="para-267">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>
<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>--output -</code> tells Crowbook to display the result on the stdout, even if you set <code>output.html</code> to <code>some_file.html</code>.</li>
</span></pre><pid ="para-269">You’ll need to use the <ahref ="https://developer.mozilla.org/fr/docs/Web/CSS/@font-face"><code>@font-face</code> attribute</a>:</p>
</span></pre><pid ="para-271">(Note that you’ll have to repeat the process for 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>
<h1id ='link-123'><spanclass ='chapter-header'>Chapter 9</span><br/>Contributing</h1><pid ="para-272">Crowbook is a free software, and you can contribute to it. There are some things that can be accessible even if you don’t know anything about programming.</p>
<h2id ="link-124">9.1. Internationalization</h2>
<pid ="para-273">Crowbook aims to support multiple languages. However, unfortunately, currently only english, french, and (in a more limited way) spanish are currently supported. If you want to have better support for the language you write in, there are easy things you can do:</p>
<li>Provide a translation for the few strings that Crowbook insert into the rendered documents. This is really easy, as there are currently less than a dozen of them, and you just need to create a new variant of the <ahref ="https://github.com/lise-henry/crowbook/blob/master/lang/en.yaml"><code>lang/en.yaml</code></a> file.</li>
<li>Open an <ahref ="https://github.com/lise-henry/crowbook/issues">issue</a> about the typographic rules in your language, if Crowbook doesn’t cover them.</li>
<li>Provide a translation for the Crowbook program. It requires creating a variant of the <ahref ="https://github.com/lise-henry/crowbook/blob/master/lang/fr.po"><code>.po</code> file</a>, which is a bit more work because (at this time) it’s around 1,500 lines (and less a priority than the first item of this list, as this translation only affects the the command-line interface and not the rendered documents).</li>
<li><code>--stats</code> can now display more statistics when used with the <code>--verbose</code> option (if support for advanced statistics is compiled)</li>
<li>LaTeX outputs now make uses of user-defined <code>rendering.chapter</code> and <code>rendering.part</code></li>
<li>The <code>template.tex</code> template was quite modified. Crowbook now uses custom command for most markdown elements, defined in the template. This allow an user to redefine the way the book is rendered without having to modify Crowbook itself. Unfortunately, as tex templates for previous Crowbook versions won’t work anymore.</li>
<li>the <code>resources.files</code> option is now a YAML list of strings, instead of a comma-seprated string.</li>
</ul>
</li>
<li>Add support for grammalecte grammar checker.</li>
<li><code>crowbook</code> command takes a new argument, <code>-S</code> or <code>--stats</code> which displays stats on the book (currently, words and characters count).</li>
<li>Interactive fiction:<ul>
<li>Added conditional blocks.</li>
</ul>
</li>
<li>Options:<ul>
<li><code>output.xxx</code> options can now take the “auto” value, which will infer the output file name based on the book file name.</li>
<li><code>output</code> is a new option that can specify a series of format to render, with default output file name.</li>
<li><code>proofread.grammalecte</code> and <code>proofread.grammalecte.port</code> allow respectively to enable grammar checking with Grammalecte and (optionnally) to specify the port to connect.</li>
<li><code>tex.margin.left</code>, <code>tex.margin.right</code>, <code>tex.margin.bottom</code> and <code>tex.margin.top</code> are new options that allow to specify margins for LaTeX/PDF outputs.</li>
<li><code>tex.paper_size</code> was renamed <code>tex.paper_size</code>.</li>
</ul>
</li>
<li>HTML:<ul>
<li>Add JSON-LD structured data to the book’s HTML files.</li>
</ul>
</li>
<li>Bugfixes:<ul>
<li>LaTeX: fix rendering of part/chapter (part previously displayed as chapter and its first chapter as part)</li>
<li>EPUB:<ul>
<li>Fix <code>.rule</code> so it is centered despite KOBO CSS injection.</li>
</ul>
</li>
<li>Fix resources/images inclusion when they are symlinks to the actual file.</li>
<pid ="para-274">This release includes a few new features, such as the possiblity to include Markdown files as section/subsections and not only as chapter, experimental support for superscript and subscript, and yet more experimental support for writing interactive fiction.</p>
<li>It is now possible to include subchapters using the <code>--</code> command (with one dash per sublevel: <code>--- foo.md</code> will include <code>foo.md</code> as a subsection).</li>
<li>Added support for superscript and subscript features, using respectively <code>foo^up^</code> or <code>bar~down~</code> syntax.</li>
</ul>
</li>
<li>New options:<ul>
<li><code>rendering.chapter</code>: change what is displayed in place of “chapter”.</li>
<li><code>rendering.part</code>: change what is displayed in place of “part”.</li>
<li><code>html.chapter.template</code> and <code>html.part.template</code> allow to tune a little how the chapters and parts are displayed in HTML.</li>
<li><code>tex.hyperref</code>, if set to <code>false</code>, will disable hyperrefs for local links. Can be useful for some files.</li>
<li><code>crowbook.html_as_text</code>, if set to false, will not treat HTML as text but ignore it.</li>
<li><code>subtitle</code>, as its name suggest, set the subtitle of a book.</li>
<li><code>crowbook.markdown.superscript</code> can enable or disable superscript/subscript “extension”.</li>
</ul>
</li>
<li>Rendering:<ul>
<li>Change the way chapters are displayed by default.</li>
<li>PDF output now has a better-looking (hopefully) title page.</li>
<li>Internal links are a bit more flexible, e.g. if you link to <code>Readme.html</code> it will now try to link to the chapter corresponding to <code>Readme.md</code>.</li>
</ul>
</li>
<li>Bugfixes:<ul>
<li>LaTeX:<ul>
<li>Fix bug in syntax highlighting.</li>
<li>Fix label placements (and thus navigation inside PDF document).</li>
</ul>
</li>
<li>EPUB:<ul>
<li>Add unnamed but numbered chapters to the TOC.</li>
<li>Fix HTML escaping issue for chapter titles.</li>
<li>Fix the way parts were handled in the TOC.</li>
</ul>
</li>
<li>Book configuration file:<ul>
<li>Fix issue when setting custom number for parts.</li>
<li>An image can now be considered standalone even if it is inside a link.</li>
<li>Bugfixes:<ul>
<li>HTML/EPUB: use raw (not HTML rendered) metadata in the places where HTML code is not appropriate. Templates can use this metadata with the <code>foo_raw</code> value.</li>
<li>HTML/EPUB: fix double-escaping/rendering issues in titles.</li>
<li>EPUB:<ul>
<li>Escape title and author before feeding them to epub-builder.</li>
<li>Fix content.opf issue by not rendering first chapter’s title (marked as beginning of document) in <code><guide></code>.</li>
</ul>
</li>
</ul>
</li>
<li>Rendering:<ul>
<li>HTML/EPUB: standalone images are now displayed centered.</li>
<li>When crowbook parses the book’s contents, it now detects which features are used. This is useful in various ways:<ul>
<li>The ODT renderer only displays a global warning showing the lists of used features that are not implemented, instead of a warning each time such a feature is encountered.</li>
<li>The LaTeX and HTML/EPUB renderers only initialize <code>syntect</code> (which can take some time) if code blocks are used in the document.</li>
<li>When there is an error setting an option from the book configuration file (e.g. because it is an invalid key), print an error but do not abort, only ignore this specific option.</li>
</ul>
</li>
<li>New options:<ul>
<li><code>tex.stdpage</code>: if set to <code>true</code>, will use the <code>stdpage</code> package to render the book according to standards for submitting manuscripts.</li>
<li><code>rendering.highlight.theme</code> allows to specifies a theme for syntax highlighting (only used if <code>rendering.highlight</code> is set to “syntect”).</li>
<li><code>html.highlight.theme</code>, <code>epub.highlight.theme</code> and <code>tex.highlight.theme</code> allow to specify a theme for HTML/EPUB/LaTeX renderers (only used with syntect).</li>
<li><code>[syntect](https://crates.io/crates/syntect)</code> is now the default for <code>rendering.highlight</code>. Concretely, this means that by default syntax highlighting is now done when <code>crowbook</code> is run instead of using <code>[highlight.js](https://highlightjs.org/)</code>.</li>
<li>Now sets the “cover-image” property and meta so readers should display cover correctly.</li>
<li>Narrow non-breaking spaces should display more correctly on KOBO ereaders (hoping this won’t break the way they are displayed everywhere else).</li>
<li>Repetition detection is now a bit less of an hack, and should cause less problems when used in conjunction with grammar checking. It now also works on PDF output (so the way it is highlighted could be improved).</li>
<li>Avoid page break before or after a separating rule.</li>
<li>Add support for <ahref ="https://crates.io/crates/syntect">syntect</a> for syntax highlighting. This is activated by setting <code>rendering.highlight</code> to <code>syntect</code> (see below).</li>
<li>EPUB:<ul>
<li>Set back HTML escape of narrow non-breaking spaces to <code>true</code> by default (it caused problems on some readers, but cause much more serious one if <code>false</code>).</li>
<li>Add more information to guide/nav landmarks.</li>
</ul>
</li>
<li>LaTeX/PDF:<ul>
<li>Improve the way code blocks are displayed, using the <code>mdframed</code> package.</li>
<li>Try to reduce the issues of too long lines when using code and code blocks, by inserting <code>\allowbreak{}</code> directive after some characters (<code>.</code>, <code>/</code>, <code>_</code>, ...).</li>
<li>Block quotes are now displayed in italics.</li>
<li>Tables now use <code>tabularx</code>, which allows to break too long lines (it still doesn’t break pages, though).</li>
</ul>
</li>
</ul>
</li>
<li>New options:<ul>
<li><code>rendering.highlight</code> can be set to <code>none</code>, <code>highlight.js</code> (by default, enables syntax highlighting via Javascript, but only on HTML document) or <code>syntect</code> (doesn’t necessitate javascript, and can work in EPUB or LaTeX, but more experimental at this point).</li>
<li><b>Breaking changes</b>: the API has undergone some breaking changes, hoping they will be the last ones for a while. API should now be more simple and consistent (?). This version contains also substantial options renaming (see below).</li>
<li>Crowbook now supports parts (above the “chapter” level), using the ‘@’ character in the book configuration file.</li>
<li>Command-line interface:<ul>
<li>Behaviour of <code>--to</code> should now be consistent for all output formats.</li>
<li>If <code>--output</code> is set to <code>-</code>, prints to stdout.</li>
<li>Conversely, if <code><BOOK></code> is set to <code>-</code>, reads from stdin.</li>
<li>Path specified by <code>--output</code> is now interpreted relatively to current directory (and not depending on where <code><BOOK></code> is or its options).</li>
<li>Chapters with no titles now have an empty title added (so it can at least display e.g. “Chapter X”).</li>
<li>EPUB:<ul>
<li>The <code>toc.ncx</code> file now displays links to “title” and (if set) “cover” (can be deactivated, see below).</li>
<li>The <code>toc.ncx</code> file now displays toc levels below chapter.</li>
<li>The table of contents is now displayed inline if <code>rendering.inline_toc</code> is set to <code>true</code>.</li>
</ul>
</li>
</ul>
</li>
<li>New options:<ul>
<li><code>epub.toc.extras</code>, set to <code>true</code> by default, will add links to the title and the cover (if it is set) in the table of contents.</li>
<li><code>epub.escape_nb_spaces</code>, similar to <code>html.escape_nb_spaces</code> and set to false by default since at least Kobo reader don’t seem to be able to understand the CSS to escape those nb spaces...</li>
<li><code>rendering.chapter.roman_numerals</code>, if set to <code>true</code>, will display chapter numbers using roman numerals.</li>
<li><code>rendering.part.roman_numerals</code>, if set to <code>true</code> (it is by default) will display part numbers using roman numerals.</li>
<li><code>rendering.part.template</code> specifies the numbering scheme of parts.</li>
<li><code>rendering.part.reset_counter</code>, if set to <code>true</code> (it is by default), resets chapter number to zero after a part.</li>
</ul>
</li>
<li>Renamed options:<ul>
<li><code>import_config</code> renamed to <code>import</code>.</li>
<li><code>rendering.chapter_template</code> renamed to <code>rendering.chapter.template</code>.</li>
<li><code>html_single.html</code> renamed to <code>html.standalone.template</code>.</li>
<li><code>html_single.js</code> renamed to <code>html.standalone.js</code>.</li>
<li><code>html_single.one_chapter</code> renamed to <code>html.standalone.one_chapter</code>.</li>
<li><code>output.html_dir</code> renamed to <code>output.html.dir</code>.</li>
<li><code>output.proofread.html_dir</code> renamed to <code>output.proofread.html.dir</code>.</li>
<li><code>html_dir.index.html</code> and <code>html.dir.chapter.html</code> have been merged and both renamed to <code>html.dir.template</code>.</li>
<li><code>tex.font_size</code> renamed to <code>tex.font.size</code>.</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>
<li>Crowbook now requires rustc >= 1.13.0 to build.</li>
<li>Pre-built binaries now all include the proofreading feature.</li>
<li>Linux binaries are now linked against <code>musl</code> library so they should really work on any Linux platform.</li>
</ul>
</li>
<li>Bugfixes:<ul>
<li>Fixed escaping of <code>author</code> and <code>title</code> fields.</li>
<li>Fixed text cleaning in ODT rendering that causes corrupt files to be generated.</li>
</ul>
</li>
<li>CommandLine Interface:<ul>
<li>Crowbook displays clearer error messages when unable to launch <code>latex</code> or <code>zip</code> commands.</li>
<li>Crowbook uses <code>term</code> library in order to display colours correctly on e.g. Windows.</li>
<li>The new argument <code>--lang</code> (or <code>-L</code>) allows to set the runtime language used by Crowbook, overriding <code>LANG</code> environment variable.</li>
<li><code>--list-options</code> no longer uses colours as it caused problems depending on the terminal or when piping to <code>less</code>.</li>
<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>
<li><code>input.autoclean</code> has been renamed <code>input.clean</code>.</li>
<li><code>input.smart_quotes</code> has been renamed <code>input.clean.smart_quotes</code>.</li>
<li>new option: <code>input.clean.ligature.dashes</code> will (if set to true) replace <code>--</code> to en dash (<code>–</code>) and <code>---</code> to em dash (<code>—</code>).</li>
<li>new option: <code>input.clean.ligature.guillemets</code> will (if set to true) replace <code><<</code> and <code>>></code> to french guillemets (<code>«</code> and <code>»</code>).</li>
<li>HTML: if <code>html_single.one_chapter</code> and <code>rendering.inline_toc</code> are both set to true, only render the TOC if currently displayed chapter is the first.</li>
<pid ="para-278">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>
<li>Conditional inclusion depending on <code>lang</code> must now be done using <code>lang_LANG</code> (e.g. <code>lang_fr</code>, <code>lang_en</code>, and so on). This might impact custom <code>epub.css</code> and <code>html.css</code> templates.</li>
</ul>
</li>
<li>API:<ul>
<li>The <code>escape</code> module has been moved to a separate crate, <code>crowbook_text_processing</code>. The <code>cleaner</code> module is no longer public, but the features it provided are also available in <code>crowbook_text_processing</code>.</li>
</ul>
</li>
</ul>
</li>
<li>New options:<ul>
<li><code>html.css.colours</code> allows to provide a CSS file that only redefine the colour scheme. Such a file can be built from <code>crowbook --print-template html.css.colours</code>.</li>
<li>Added the <code>--quiet</code> (or <code>-q</code>) argument, that makes crowbook run without displaying any messages (except some error messages at this point).</li>
<pid ="para-279">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>
<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 reader’s don’t have a browser/font supporting these unicode symbols.</li>
<li>Output files for proofread documents: <code>output.proofread.html</code>, <code>output.proofread.html_dir</code> and <code>output.proofread.pdf</code>.</li>
<li>Proofread options <code>proofread.repetitions</code> and <code>proofread.nb_spaces</code> have been added.<ul>
<li><code>proofread.nb_spaces</code>, if set to true, highlights non-breaking spaces so it is easier to check the correct typography of a book. Note that it requires that <code>html.escape_nb_spaces</code> be set to true (default) to work.</li>
<li><code>proofread.reppetitions</code>, if set to true, uses <ahref ="https://github.com/lise-henry/caribon">Caribon</a> to highlight repetitions in a document. It also uses the settings <code>proofread.repetitions.fuzzy</code>, <code>proofread.repetitions.max_distance</code>, <code>proofread.repetitions.threshold</code>, <code>proofread.repetitions.fuzzy.threshold</code>, <code>proofread.repetitions.ignore_proper</code>. Note that this feature is not built by default, you’ll have to build crowbook with <code>cargo build --release --features “repetitions”</code>.</li>
<li><code>tex.command</code> is now <code>xelatex</code> by default.</li>
</ul>
</li>
<li>Rendering:<ul>
<li>LaTeX:<ul>
<li>Add support for xelatex in the default template.</li>
</ul>
</li>
<li>Improved french cleaner (see <ahref ="https://crowdagger.github.io/textes/articles/heuristique.html">an article (in french)</a> that talks about what it does).</li>
</ul>
</li>
<li>Crowbook user guide: documentation has been updated to correctly reflect 0.9.x options.</li>
<li><code>clap</code> dependency is now optional, people who want to use Crowbook as a library should include it with <code>crowbook = { version = “0.9”, default-features = false }</code>. (<code>clap</code> is still required to build a working binary).</li>
<pid ="para-280">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>
<li>cleaning the names exported in templates and document them, in order not to break user-defined templates in future (non-breaking) releases. More detailed changes for this release:</li>
<li><b>Breaking change for users</b>: removed <code>tex.short</code> option, replaced by a more generic <code>tex.class</code> (default being <code>book</code>). <code>html.crowbook_link</code> has also been removed.</li>
<li>Renamed options. Using the old name will print a deprecation warning but will still work for a while.<ul>
<li><code>html_dir.css</code> -><code>html.css</code> (not really renamed, <code>html_dir.css</code> isactually removed as there is no point in having different CSS for standalone and multifile HTML rendering, is it?)</li>
</ul>
</li>
<li>New options:<ul>
<li>More metadata: <code>license</code>, <code>version</code> and <code>date</code>. These metadata are not treated by the renderers, but they are exported to the templates: <code>{{{metadata}}}</code> allows to access the content. If they are present, a <code>has_metadata</code> is also set to true, allowing to do something like <code>{{{title}}} {{#has_version}}version {{{version}}} {{/has_version}}</code>.</li>
<li>Yet more metadata: it is possible to add custom metadata by prefixing it with <code>metadata.</code>. They will then be accessible in the templates, with dots ('.') replaced by underscores ('_'). E.g., with <code>metadata.foo: bar</code> you can access it in your templates with <code>{{{metadata_foo}}}</code>.</li>
<li>Metadata can now contain Markdown and will be rendered by the renderers. This might not be a good idea for common fields (e.g. “title”), though. Use with caution.</li>
<li><code>rendering.inline_toc.name</code> can use <code>{{{loc_toc}}}</code> to specify a localized name.</li>
<li>HTML:<ul>
<li><code>html.top</code> and <code>hstml.footer</code> are now considered as templates, so you can use some <code>{{{metadata}}}</code> in it.</li>
<li>Improved the way footnotes are displayed.</li>
<li>In standalone HTML, footnotes are rendered at the end of the document instead of at the end of the chapter, unless <code>html_single.one_chapter</code> is true.</li>
<li>If <code>tex.class</code> is set to <code>article</code>, chapters will be displayed as <code>\sections</code> since <code>article</code> class doesn’t handle chapters.</li>
<li><code>import_config</code> only import options from another book file that are not equal to the default ones and that haven’t already been set by the caller. E.g., <code>author: foo</code> then <code>import_config: bar.book</code> won’t erase the author previously set.</li>
<li><code>import_config</code> now correctly translates the imported book’s paths.</li>
<pid ="para-281">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>
<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>
<li><code>use_initials</code> (set to false by default) makes Crowbook use initials (“lettrines”) at start of each chapter. Support is still experimental.</li>
<li><code>html.highlight_code</code> (set to true by default) allows syntax highlighting for code blocks, using highlight.js.</li>
<li><code>html.higlight.css</code> and <code>html.highlight.js</code> can be used to provide other themes (default is default.css) and an highlight.js build that support other languages.</li>
<li><code>html.footer</code> allows to specify custom footer. If not set, <code>html.crowbook_link</code> allows to disable “Generated by Crowbook” message.</li>
<li><code>html.top</code> allows to specify a custom header that will be displayed at the top of HTML file(s).</li>
</ul>
</li>
<li>Deprecated options:<ul>
<li><code>side_notes</code> has been renamed <code>html.side_notes</code>.</li>
</ul>
</li>
<li>Crowbook program:<ul>
<li>All output formats are now rendered concurrently.</li>
<li>Better error messages. Crowbook now tries to give more information when displaying an error, with the file name where a problem was found, and, in some cases, the line. It also tries to detect errors (such as files not found) sooner.</li>
<li>Some “warning” messages have also been “moved” to error messages, to make sure they are displayed even when crowbook isn’t runned with <code>--verbose</code>.</li>
<li>Hidden chapter now produce empty <code>\chapter*{}</code> and <code><h1></code> in LaTeX and HTML. This allow to delimit a chapter break even if nothing is displayed.</li>
<li>Navigation menu of standalone HTML didn’t include a call to javascript when <code>html.display_chapter</code> was set to true, meaning it didn’t display the chapter correctly.</li>
<li>Image paths are now found correctly in HtmlDir rendering even if <code>crowbook</code> is called from another directory (same fix as 0.6’s for Epub and LaTeX, which was forgotten for HtmlDir).</li>
<li>In order to have better error messages, there was a need to refactor the <code>Error</code> type, and make more methods return <code>Result<X></code> instead of <code>X</code>. The API is, therefore, quite modified.</li>
<li>Added a <code>Renderer</code> trait used by the various renderers.</li>
<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>
<li><code>Parser.parse</code> method now distingues between <code>Image</code> and <code>StandaloneImage</code>. Currently, an image is considered “standalone” if it is the sole element of a paragraph, even if it is among a link.</li>
<li><code>nb_char</code>: since it was only used for french cleaner and for typography reasons it’s better to use different non breaking spaces according to context, this option was not really useful anymore.</li>
<li>“Autocleaning” is now also activated (for french at least) for LaTeX rendering, since it doesn’t correctly insert non-breaking spaces for e.g. ‘«’ or ‘»’.</li>
<li>Use non-narrow non-breaking spapce instead of narrow one for ‘:’, ‘«’ and ‘»’ (following https://fr.wikipedia.org/wiki/Espace_ins%C3%A9cable#En_France).</li>
<li>Don’t display the button to display chapter and the previous/next chapter link if <code>html.display_chapter</code> is set to <code>false</code>.</li>
<li>It is now possible to render HTML in multiple files:<ul>
<li><code>output.html_dir</code> will activate this renderer, and specify in which directory to render these files;</li>
<li><code>html_dir.css</code> allows to override the CSS for this rendering;</li>
<li><code>html_dir.index.html</code> allows to specify a template for the <code>index.html</code> page;</li>
<li><code>html_dir.chapter.html</code> allows to specify a template for the chapters pages.</li>
</ul>
</li>
<li>New book options:<ul>
<li><code>tex.short</code>: if set to true, the LaTeX renderer will use <code>article</code> instead of <code>book</code> as document class, and will use the default <code>\maketitle</code> command for article. This option is by default set to false, except when Crowbook is called with <code>--single</code>.</li>
<li><code>enable_yaml_blocks</code>: parsing YAML blocks is no longer activated by default, except when using <code>--single</code>. This is because you might want to have e.g. multiple short stories using YAML blocks to set their titles and so on, <em>and</em> a separate <code>.book</code> file to render a book as a collection of short stories. In this case, you wouldn’t want the displayed title or the output.pdf/html/epub files be redefined by the short stories .md files.</li>
<li><code>html.print_css</code>: allows to specify a stylesheet for media print</li>
<li><code>html.display_chapter</code>: displays one chapter at a time in standalone HTML</li>
<li><code>html.script</code>: allows to specify a custom javascript file for standalone HTML</li>
<li><code>html_dir.script</code>: same thing for multipage HTML</li>
<li><code>resources.base_path</code>: by default, Crowbook resolves local links in markdown files relatively to the markdown file. This option allows to resolve them relatively to a base path. This option comes with two variants, <code>resources.base_path.images</code> and <code>resources.base_path.links</code>, which only activate it for respectively images tags and links tags. These two options are ignored when <code>base_path</code> is set. There is also <code>resources.base_path.files</code> which specify where additional files (see below) should be read, but this is one is set to <code>.</code> (i.e., the directory where the <code>.book</code> file is) by default.</li>
<li><code>resources.files</code>: indicate a (whitespace-separated) list of files that should be embedded. Currently only used with the EPUB renderer.</li>
<li><code>resources.out_path</code>: indicate where <code>resources.files</code> should be copied in the final document. Default to <code>data</code>, meaning that files will be placed in a <code>data</code> directory in the EPUB.</li>
</ul>
</li>
<li>Rendering:<ul>
<li>Templates can now use localized strings according to the <code>lang</code> option</li>
<li>Standalone HTML now includes locale files using base64.</li>
<li>Standalone HTML displays one chapter at a time, thouht it can be changed via a button in the menu.</li>
<li>HTML/EPUB: default CSS now uses the <code>lang</code> value do determine how to display lists (currently the only difference is it uses “–” when <code>lang</code> is set to “fr” and standard bullets for other languages).</li>
<li>Fixed a bug of filename “resolution” when Crowbook was called with <code>--single</code> (e.g., <code>crowbook -s tests/test.md</code> would previously try to load `tests/tests/test.md).</li>
<li>Epub renderer now uses the <code>mime_guess</code> library to guess the mime type based on extension, which should fix the mime type guessed for a wide range of extensions (e.g., svg).</li>
</ul>
</li>
<li>Internal/API:<ul>
<li>The <code>Book::new</code>, <code>new_from_file</code>, and <code>new_from_markdown_file</code> take an additional <code>options</code> parameter. To create a book with default options, set it to <code>&[]</code>.</li>
<li>Crowbook now internally uses a true YAML parser, <code>yaml_rust</code>, for its options. Since the “old” Crowbooks’s config format was similar, but had some subtle differences, this is somewhat of a breaking change:<ul>
<li>strings should now be escaped with “” in some cases (e.g. if it contains special characters). On the other hand, it <em>allows</em> to optionally escape a string with these quotes, which wasn’t possible until then and might be useful in some cases.</li>
<li>multiline strings now follow the YAML format, instead of the previous “YAML-ish” format. This can impact the way newlines are added at the end of a multiline string. See e.g. <ahref ="http://stackoverflow.com/questions/3790454/in-yaml-how-do-i-break-a-string-over-multiple-lines">this link</a> for the various ways to include mulitiline strings in Yaml.</li>
<li>Crowbook now parses YAML blocks (delimited by two lines with “---”) in Markdown files, ignoring keys that it doesn’t recognize. This allows crowbook to be compatible(-ish) with Markdown that contains YAML blocks for Jekyll or Pandoc.</li>
<li>New option <code>--single</code> allows to give Crowbook a single Markdown file (which can contain options within an inline YAML block) instead of a book configuration file. This is useful for e.g. short stories.</li>
<li>Enhanced the way debugging/warning/info messages are handled and displayed:<ul>
<li>Added a <code>--debug</code> option to the binary.</li>
<li>Internal: added a <code>Logger</code> struct.</li>
<li>Different levels of information (debug/warning/info/error) get different colours.</li>
<li>Crowbook now tries to convert local links. That is, if you link to a Markdown file that is used in the book. (e.g. <ahref ="#chapter-0">README.md</a>), it <em>should</em> link to an appropriate inner reference inside the book.</li>
<li>Latex renderer now supports (local) images.</li>
<li>Epub renderer now embed (local) images in the EPUB file.</li>
<li>Some changes to the HTML/Epub stylesheets.</li>
<li>Internal (or usage as a library):<ul>
<li>Crowbook no longer changes current directory, which worked in the binary but could cause problem if library was used in multithreaded environment (e.g. in <code>cargo test</code>).</li>
<li>More modules and methods are now private.</li>
<li>Improved documentation.</li>
<li>Added more unit tests.</li>
</ul>
</li>
<li>Bugfixes:<ul>
<li>Epub renderer now correctly renders unnumbered chapter without a number in its toc.ncx file</li>
<li>New argument <code>--print-template</code> now allows to print a built-in template to stdout.</li>
<li>New argument <code>--list-options</code> prints out all valid options in a config file (or in <code>set</code>), their type and default value.</li>
<li>New argument <code>--set</code> allows to define or override whatever option set in a book configuration.</li>
<li><code>--create</code> can now be used without specifying a <code>BOOK</code>, printing its result on <code>stdout</code>.</li>
<li>Added support for multiline strings in <code>.book</code> files, with either ‘|’ (preserving line returns) or ‘>’ (transforming line returns in spaces)</li>
<li>New option <code>display_toc</code> allows to display the table of contents (whose name, at least for HTML, is specified by <code>toc_name</code>) in HTML and PDF documents.</li>
<li>Option <code>numbering</code> now takes an int instead of a boolean, allowing to specify the maximum level to number (e.g. <code>1</code>: chapters only, <code>2</code>: chapters and sectino, ..., <code>6</code>: everything).</li>
</ul>
</li>
<li>Rendering:<ul>
<li>Added support for numbering all headers, not just level-1 (e.g., having a subsection numbered <code>2.3.1</code>).</li>
<li>Tables and Footnotes are now implemented for HTML/Epub and LaTeX output.</li>
</ul>
</li>
<li>Internal:<ul>
<li>Refactored <code>Book</code> to use an HashMap of <code>BookOption</code>s instead of having like 42 fields.</li>
</span></pre><pid ="para-284">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>
<pid ="para-285">[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>
</span></pre><pid ="para-286">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>
<pid ="para-287">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>
<pid ="para-288">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>
<pid ="para-289">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>
<pid ="para-290">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>
<pid ="para-291">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>
<pid ="para-292">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 author’s reputation will not be affected by problems that might be introduced by others.</p>
<pid ="para-293"> 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>
<pid ="para-294">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>
<pid ="para-295">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>
<pid ="para-296">We call this license the “Lesser” General Public License because it does Less to protect the user’s 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>
<pid ="para-297">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>
<pid ="para-298">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>
<pid ="para-299">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>
<pid ="para-300">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>
<pid ="para-301"> GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</p>
<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>
<pid ="para-302">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>
<pid ="para-303">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>
<pid ="para-304">“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>
<pid ="para-305">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>
<li>You may copy and distribute verbatim copies of the Library’s 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>
<pid ="para-306">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>
<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>
</span></pre><pid ="para-308">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>
<pid ="para-309">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>
<pid ="para-310">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>
<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>
<pid ="para-311"> 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>
<pid ="para-312">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>
<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>
<pid ="para-313">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>
<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>
<pid ="para-314">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>
<pid ="para-315">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>
<pid ="para-316">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>
<pid ="para-317">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>
<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 customer’s own use and reverse engineering for debugging such modifications.</li>
<pid ="para-319">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>
</span></pre><pid ="para-320">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>
<pid ="para-321">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>
<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>
<li><pid ="para-323">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><pid ="para-324">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><pid ="para-325">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>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>
<pid ="para-327">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>
<pid ="para-328">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>
<pid ="para-329">This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.</p>
<li><pid ="para-330">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><pid ="para-331">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>
<pid ="para-332">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>
<li><pid ="para-334">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><pid ="para-335">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><pid ="para-336">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>
<pid ="para-337"> How to Apply These Terms to Your New Libraries</p>
<pid ="para-338">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>
<pid ="para-339">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>
</span></pre><pid ="para-340">Also add information on how to contact you by electronic and paper mail.</p>
<pid ="para-341">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>
<pid ="para-342">Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob’ (a library for tweaking knobs) written by James Random Hacker.</p>
<pid ="para-343"><signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice</p>
<asideid ="note-dest-4"><pid ="para-185">Some of them, though, are not “real” templates, they are just files that are inserted, but can’t contain mustache tags. This will probably evolve in future versions.</p>
<asideid ="note-dest-5"><pid ="para-194">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>
<asideid ="note-dest-6"><pid ="para-200"><code><<foo>></code> might also work, but the ampersand is required to prevent mustache HTML-escaping the value. This is not good because:</p>