<p><em>mkbook</em> follows a fairly simple directory structure for now, with a <code>README.md</code> file declaring the book’s metadata, and <code>.md</code> files defining each chapter of the book.</p>
<p><em>mkbook</em> generally requires a <code>README.md</code> file to reside in your source directory. This file is responsible for defining the metadata associated with your book:</p>
<p>If the <code>README.md</code> file or any of the entries are missing, default values will be used. The <code>README.md</code> file should be formatted as any other page, with the <code>title</code>, <code>author</code>, <code>pubdate</code>, and <code>url</code> specified in the frontmatter, and the book description the <em>Markdown</em> contents of the <code>README.md</code> file.</p>
</span><spanstyle="font-style:italic;color:#cc99cc;">_mkbook_</span><spanstyle="color:#d3d0c8;"> is my simpler alternative to </span><spanstyle="color:#f99157;">[mdbook](https://crates.io/crates/mdbook)
</span><spanstyle="color:#d3d0c8;">which is a great tool, but for which I really dislike some of the decisions they
</span><spanstyle="color:#d3d0c8;">took, such as relying on javascript for highlighting and navigation, and
</span><spanstyle="color:#d3d0c8;">including a lot of bells and whistles such as javascript-based search.
</span><spanstyle="color:#d3d0c8;">
</span><spanstyle="color:#d3d0c8;">This tool aims to work somewhat similarly to </span><spanstyle="font-style:italic;color:#cc99cc;">_mdbook_</span><spanstyle="color:#d3d0c8;">, but is generally intended
</span><spanstyle="color:#d3d0c8;">to be a more minimal alternative that is customized more towards my needs and
</span><spanstyle="color:#d3d0c8;">desires than anything else.
<p>Any files in the <code>src</code> directory which are not included in <code>.gitignore</code> and do not end in the extension <code>.md</code> will be copied to the output folder. You can use this to include images, files, etc, for example the following image is an asset bundled with the book:</p>
<prestyle="background-color:#2d2d2d;">
<spanstyle="color:#f99157;">![chapter-six](book-chapter-six-5834.jpg </span><spanstyle="color:#d3d0c8;">"</span><spanstyle="color:#f2777a;">Photo by Kaboompics.com from Pexels</span><spanstyle="color:#d3d0c8;">"</span><spanstyle="color:#f99157;">)
<figure><imgsrc="book-chapter-six-5834.jpg"alt="chapter-six"title="Photo by Kaboompics.com from Pexels"><figcaption>Photo by Kaboompics.com from Pexels</figcaption></figure>
<p><em>mkbook</em> works on mostly a flat directory structure, however one level of sub-directories are supported in order to create sections within chapters. Files that don’t end in a <code>.md</code> extension are completely ignored. Each <code>.md</code> file in the root source directly is it’s own chapter. To create chapters with sub-sections, create a sub-directory in the root directory and then create a <code>README.md</code> file, which will become the root of the chapter, with all <code>.md</code> files in the sub-directory becoming sections in the chapter. The <code>title</code> in the <code>README.md</code> file’s frontmatter will be used as the name of the chapter.</p>
<p>The order of the book is based on the alphabetical order of the file names (actually it’s based on Rust’s <ahref="https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html#impl-PartialOrd%3Cstr%3E">implementation of <code>PartialOrd</code> for str</a>). Thus, it is recommended to lay out your book chapters with manual numbering of the file names, as such:</p>