Repository navigation
Online Books
The documentation website has online books which contain autogenerated exports of in game books. This page covers information on how to update them on the website.
Mantle has two commands to export books to automatically create the book pages:
- Export Images (since 1.18.2): used to create the non-interactive book gallery views. Has limited support on 1.16.5 through a specialized Mantle build.
- Export HTML (since 1.20.1): used to create the interactive book HTML views.
The export images command has the benefit of working automatically on any Mantle book. The export HTML command may require some additional support if mod uses custom book pages.
The following sections describe where to place data on the website for books.
Both the export images command and the export HTML command will create a number of images in the screenshots folder. These images are placed anywhere under assets/images/book/.
We typically organize images a structure of <mod>/<version>/<book>, or <mod>/<version> if the mod has only a single book:
-
<mod>does not need to match the mod ID in game, just needs to be unique from other mods on the site. -
<version>is typically the mod version rather than the Minecraft version as we use this as a form of "cache buster" on update. -
<book>does not need to match the book ID in game, but it simplifies copying over the data if it does.
If you wish to update a book, its important that the <version> changes as otherwise there may be issues with web browsers caching the old pages. This is notably an issue if the number of pages in a book changed during the update. There is no need for all books under a mod to be in the same version folder on the chance a book didn't change during an update.
If its necessary to update a book without releasing an update, simply append a letter to the version number, e.g. 1.0.3b, then 1.0.3c, and so on. This can be useful if we improve book export functionality without any new contents being added to the book, as that does not necessitate a mod release to update the website.
While the HTML can be placed anywhere on the website and it should function, all our books are located under docs/books/<verison>/<book-name> where <version> is the Minecraft version and <book-name> is the name of the book for the website URL. We do not currently sort books into separate URLs by mod name as we have no conflicts so far.
For books exported using the export HTML command, simply copy over the HTML folder into docs/books/<verison>/. It should automatically have the standard book key set in the exported HTML, which you will use for the book yml data. This export also includes an automatically generated gallery view for the export images.
For books exported using the export images command alone, its easiest to copy over an existing book markdown file from 1.19 or before. Simply update any relevant fields in the header, including picking a book key unique to that book and Minecraft version.
Under _data/books.yml is a data file describing information for each book. The root key for the data is the book key mentioned above. It needs the following information:
Common:
-
path: Path to the images for the book starting fromassets/images/book/. -
next/previous: Information for generating a link to the next/previous book for mods with multiple books. Has the following fields:-
title: Display title for the link. -
link: URL for the link. If unset, will be generated by lowercasingtitleand replacing spaces with-.
-
-
max_page: Largest number on any exported page. Used to determine how many pages to show in the gallery view and whether to show next page links for the HTML books. Note this matches the image numbers, not the displayed page numbers.
Gallery:
-
titles: List of section titles for the book. Roughly map to actual book sections.- Each title has the following fields:
-
index: Page index that starts this section. We typically set this as the first page with contents from the section, even if the left side page is from the previous section. -
title: Section title to display in the HTML header.
-
- Each title has the following fields:
HTML:
-
arrows: Path to the images for book arrow buttons starting fromassets/images/book/arrows/.
When releasing a new Minecraft version, create a new book for its data. When releasing a new version for an existing Minecraft version, simply update the image path and the data under Gallery to match the new images.