-
Notifications
You must be signed in to change notification settings - Fork 1
Reading order
The reading order is the sequence in which files are arranged when viewing a project. File names are included in the toc.yml
file in the desired reading order, and chapters can also be nested. The reading order can be set for all builds by updating the entries in the toc.yml
.
The only exception to this is the figures section. Since b-ber creates figures pages dynamically during the build, you only need to include a figures-titlepage
entry in the toc.yml
to indicate where you'd like the figures section to be placed. Find more detailed information below.
The reading order can also be configured per-build basis by adding <type>.yml
files to the _project
directory, where <type>
is the name of the build type (epub
, mobi
, reader
, web
, pdf
, sample
or xml
). This allows content to be structured differently for different output formats.
When you add or remove Markdown files to your project, b-ber will automatically update the toc.yml
to keep everything in sync. If using multiple YAML files, b-ber will ensure that the updates only occur in the file that relates to the current build.
The reading order of the project will follow the order of the files listed in the toc.yml
file.
Note: Do not include the file extension when changing items in the toc.yml
.
- Cover
- Chapter-One
- Chapter-Two
b-ber creates figures pages during the build process. Each figure
directive it encounters will be added to a list of illustrations. You can set the order of the list of illustrations by adding the figures-titlepage
property to the toc.yml
.
- Cover
- Chapter-One
- Chapter-Two
- figures-titlepage
- Colophon
It is not possible to change the order of the figures as they appear in the figures section. b-ber guarantees that they will be included in the same order as they are sequenced in the project's Markdown files.
b-ber creates an HTML table of contents toc.xhtml
for each project during the build. To hide entries from the table of contents, add in_toc: false
to that entry.
Note: This does not remove the file from the project. It only prevents it from being listed in the table of contents.
- Cover:
in_toc: false # Will not appear in the table of contents
- Chapter-One
- Chapter-Two
Add a name to a chapter in the toc.xhtml
by editing the front matter in the Markdown. No changes need to be made to the toc.yml
.
<!-- Chapter-one.md -->
---
title: Chapter One
---
<!-- toc.xhtml -->
<nav id="toc" epub:type="toc">
<h2>Table of Contents</h2>
<ol>
<li>
<a href="text/Chapter-one.xhtml">Chapter One</a>
</li>
Nest chapters by wrapping them in a section
in the toc.yml
:
- part-1
- section:
- chapter-1-1
- chapter-1-2
- part-2
- section:
- chapter-2-1
- chapter-2-2
Chapters can be deeply nested:
- part-1
- section:
- chapter-1-1
- section:
- chapter-1-1-1
EPUB 3.0 allows for the inclusion of non-linear pages, which means they are hidden from the EPUB's table of contents. To accomplish this, assign linear: false
to entries in the toc.yml
. This does not remove the files from the project, it only hides them in the final output.
- chapter-1
- chapter-2:
linear: false
- chapter-3
The in_toc
and linear
properties can also be combined.
- chapter-1
- chapter-2:
linear: false
in_toc: false
- chapter-3
The b-ber Reader allows a user to navigate through the project by using keyboard forward and back arrows; by the previous and next spread (left and right-pointing arrows); and previous and next chapter (left and right-pointing chevrons).
The location in the project is cached as a user navigates and will be retained if the browser is closed. If a URL containing a slug
parameter in the query string is included, the b-ber Reader will navigate to that chapter automatically, overriding any saved position. A chapter's slug
parameter will be the title of the chapter as declared in that chapter's YAML frontmatter, which is located in the chapter's markdown file.
<!-- chapter-one.md -->
---
title: Chapter One
---
# Chapter One Title
In the previous example, the URL to take a user directly to "Chapter One" would appear as follows:
http://mysite.com?slug=chapter-one
- Adding metadata
- Creating content
- Generating new content
- Authoring and editing content
- Reading order (Table of Contents)
- Configuring the build
- Adding a cover image
- All directives
- Text
- Media
- Misc