The configuration file for the entire document is vivliostyle.config.js
. The path is the root of the repository.
vivliostyle.config.js
can be edited using Vivliostyle Pub itself, and once saved, the changes will be reflected in the entire document. The syntax involves filling in values inside the { }
as shown below.
module.exports = {
}
You can specify the title with title
(enclose the value in single quotes. The same applies below).
title: 'My Book',
You can specify the author's name with author
.
author: 'Jiro Ogwata <[email protected]>',
You can specify the language used in the document with language
. English is en
, Japanese is ja
, and other languages can be specified with the two-letter codes defined in ISO 639-1.
language: 'ja',
The format should be specified in the theme, not in vivliostyle.config.js
. For details, please refer to the following.
You can specify the target document for processing with the syntax entry: [ ]
. Multiple documents can be specified, and by specifying them as shown below, you can output multiple markdown files as a single book.
entry: [
"Chapter-1.md",
"Chapter-2.md",
"Chapter-3.md",
],
If there are files you do not want to output, you can comment them out by adding //
at the beginning of the line.
You can add a table of contents by following these steps:
- Prepare a markdown file for the table of contents as shown below, and upload it with the filename
index.md
(→Uploading Files). Note that the following is HTML syntax, so the file to be specified should also be an HTML file.
# Book Title
<nav id="toc" role="doc-toc">
## Table of Contents
- [Article Title 1](Chapter-1.html)
- [Article Title 2](Chapter-2.html)
- [Article Title 3](Chapter-3.html)
</nav>
Note that there must be a blank line between lines with HTML tags and markdown lines. Otherwise, it will result in an error.
- Specify the prepared
index.md
at the top line ofentry
invivliostyle.config.js
.
entry: [
"index.md",
"Chapter-1.md",
"Chapter-2.md",
"Chapter-3.md",
],
You can add a colophon by following these steps:
- Prepare a markdown file for the colophon as shown below, and upload it with the filename
colophon.md
(→Uploading Files).
<section id="colophon" role="doc-colophon">
## The Book I Wrote
First Edition Published on xx xx, 20xx
- Publisher: The Book I Wrote Publishing Association
- Author: Jiro Ogwata
- Printing: Sample Printing
© My Book Publishing, 20xx
</section>
- Specify the prepared
colophon.md
at the last line ofentry
invivliostyle.config.js
.
entry: [
"index.md",
"Chapter-1.md",
"Chapter-2.md",
"Chapter-3.md",
"colophon.md",
],
To summarize the explanation so far, the description of vivliostyle.config.js
will be as follows:
module.exports = {
title: 'My Book',
author: 'Jiro Ogwata <[email protected]>',
language: 'ja',
theme: 'css/style.css',
entry: [
"index.md",
"Chapter-1.md",
"Chapter-2.md",
"Chapter-3.md",
"colophon.md",
],
}