Cvolo documentation is built from files and directories. This is intentional: authors do not need to describe the navigation tree manually in Svelte components or maintain a separate list of pages.
If a file is placed in the correct directory and registered in chapter.toml, the documentation builder automatically creates its route, breadcrumbs, Previous/Next links, and an entry in the sidebar navigation.
A full article path is easiest to read from left to right:
src/content/<version>/<language>/<section>/<chapter>/<page>.mdFor example:
src/content/main/en/book/01-introduction/1-1-hello-world.mdThis path means:
main- documentation version (GitHub branch);en- language;book- top-level section;01-introduction- chapter;1-1-hello-world- individual page.
Top-level sections such as book and authoring are defined in config/book.toml. Inside each section, the documentation structure is determined by directories, chapter.toml, and Markdown files.
#Folder = chapter
Each chapter directory usually contains three kinds of files:
chapter.toml- the order of the chapter and its pages;index.md- the chapter introduction page;- other
.mdfiles - individual pages in the chapter.
For example:
src/content/main/en/book
01-introduction
01-introduction/ is the chapter itself.
It is best to treat the directory name as a stable technical identifier. It is part of the URL and should match across localizations.
The visible chapter title does not come from the folder name. Instead, it is taken from the first # H1 in index.md. This means the technical directory can remain 01-introduction, while the user sees:
Chapter 1. Getting startedГлава 1. Начало работы#Why chapter.toml is needed
The file system tells the builder which pages exist, but the order of files on disk should not determine the order of chapters or their contents.
That is why each chapter has a chapter.toml file. A minimal version looks like this:
order = 1
pages = ["1-1-hello-world"]order- sets the chapter position relative to other chapters in the current section.pages- sets the order of Markdown files inside the chapter. File names are specified without the.mdextension.
If a second page is added later, the list can be extended:
order = 1
pages = [
"1-1-hello-world",
"1-2-building-and-running"
]This keeps the documentation order explicit and predictable instead of depending on how an editor or file system sorts files.
If a page is listed in pages but the corresponding file or directory does not exist, docs:verify should treat the structure as invalid.
#Why index.md is needed
index.md is the introduction page of a chapter.
It should explain:
- what the chapter is about;
- what problem it solves;
- what the reader will learn next.
The first # H1 in index.md becomes the visible chapter title.
For example, the directory stays the same:
01-introduction/But localized index.md files can start differently.
Chapter 1. Getting startedГлава 1. Начало работыA good index.md usually contains a few paragraphs of context, but does not try to repeat the chapter navigation manually. The list of child pages is generated automatically from the file structure and chapter.toml.
#Regular page
Every other .md file inside a chapter represents an independent documentation page.
For example:
1-1-hello-world.mdThe first # H1 becomes the page title and is used in navigation.
The content can look like this:
# 1.1 Hello World
A short introduction to the page.
## First program
Section text.
## What happens
Section text.In the left navigation, this remains a single page:
1.1 Hello WorldSecond-level and deeper headings belong to the structure of the current article and appear in the right-side On this page block:
First program
What happensIn other words, ## and ### do not create new documentation pages.
Do not split a short article into several files just to create subheadings. At the same time, a single page should not become an enormous chapter if the topics are genuinely independent.
#File names and stable URLs
Directory names and Markdown file names are part of the URL, so it is best to treat them as stable identifiers.
An article title can be corrected or translated without changing its slug.
For example, the same logical page in EN and RU should have the same relative path:
src/content/main/en/book/01-introduction/1-1-hello-world.md
src/content/main/ru/book/01-introduction/1-1-hello-world.mdOnly the language segment changes:
src/content/main/en/book/01-introduction/1-1-hello-world.md
src/content/main/ru/book/01-introduction/1-1-hello-world.mdEverything after it stays the same:
book/01-introduction/1-1-hello-world.mdThis allows the language switcher to open the equivalent page in another localization without trying to guess a translated file name.
Practical rule: if a new page exists in both EN and RU, use the same relative path and the same slug in both chapter.toml files.
Page content can be translated independently, but the localization structure should not drift apart accidentally.