Document table of contents

Article last updated at November 20, 2026

The document structure is described in the file toc.yaml. Based on this file, the table of contents is generated and the document is assembled.

Warning

Files not listed in toc.yaml are not processed during assembly.

Structure

The standard structure of the toc.yaml file is as follows:

title: Имя документа
href: index.yaml
items:
  - name: Имя раздела
    href: path/to/file.md
  - name: Имя группы разделов
    items:
      - name: Имя раздела
        href: path/to/file.md
      - name: Имя раздела
        href: path/to/file.md
  - name: Имя раздела
    href: path/to/file.md

At the root:

  • title — the document title. It is displayed in the table of contents above the list of all sections. You can hide it using the interface: toc-header setting in the .yfm file.
  • href — the relative path to the file.
  • items — table of contents items.
  • navigation — a settings section for extended navigation.
  • llms — llms.txt settings for this TOC: the string fields description, details, and url, which override .yfm defaults.

Each table of contents item contains the following fields:

  • name — the name of a section or group of sections. For a section that links to an article, the field can be omitted, see name from the article heading.
  • href — the relative path to the file.
  • items — a list of nested items.

All relative paths are calculated from the location of the toc.yaml file in which they are specified.

Section name from the article heading

If a section with an href to an md file has no name field, or the field is set to {#T}, the build takes the name from the first-level heading of that article, including a heading that comes from an include. If the article has no first-level heading, the file name without the extension is used.

items:
  - href: overview.md
  - name: "{#T}"
    href: setup.md
  - name: API reference
    href: api.md

This way the item name in the table of contents always matches the article heading and is edited in one place. It also helps with translations: such an item does not need to be translated in toc.yaml, each language gets the article heading in that language. The rule works the same way as heading substitution in links.

You can group parts of the documentation into multiple separate tables of contents.

To simplify working with large tables of contents and reuse blocks, inserting tables of contents is supported.

See also: Ajv schema for toc.yaml table of contents files

Opening links in a new tab

By default, all relative links in the table of contents open in the current browser tab, and all absolute links open in a new tab. This behavior can be changed using the target parameter:

  • _self — a link from the table of contents will open in the current tab,
  • _blank — a link from the table of contents will open in a new tab.
- name: Абсолютная ссылка
  href: https://github.com
  target: _self

Agent-only pages

Use the singular lowercase visibility: agent to make a page or section available
only in the agent representation:

items:
  - name: Shared instructions
    href: index.md
  - name: Autonomous operations
    visibility: agent
    items:
      - href: agent.md

The field also works at the TOC root and on TOC includes. It is inherited by all
descendants and cannot be reset below an agent-only ancestor. Omit the field for
shared content. Other values, including agents and human, are invalid. If the
same document is referenced from both shared and agent-only sections, the build
reports a conflict. Different languages have independent document paths.

Agent-only pages do not appear in human navigation, search, sitemap, single-page,
or PDF output. A human request to such a page returns 404 in Viewer. Authors and
reviewers can preview it with ?audience=agent; ordinary access checks still apply.
Put links to agent-only pages inside an agent visibility block so that the human
representation does not contain broken links. Page visibility and
:::visibility human / :::visibility agent blocks apply together. The sources
retain both block variants for authors and translation.

With LLMS generation enabled, human llms.txt and llms-full.txt omit these pages.
Agent artifacts include them. In Viewer, request llms.txt?audience=agent or
llms-full.txt?audience=agent. Machine API, Markdown companions and Docs MCP
read_toc / read_doc also select the agent representation with audience=agent.
The default is human; reuse the selected audience when following links or
continuing a paginated read.

Static HTML hosting does not select content by query parameters: agent HTML pages
are omitted. Its generated llms-agent.txt links to filtered .agent.md and
.agent.yaml source artifacts, with llms-full-agent.txt as the full agent corpus.
Links inside these artifacts also select the agent representation, including links
from YAML pages. Linked pages excluded by hidden or noIndex receive individual
agent artifacts without being added to LLMS indexes or full corpora.
Rebuild the documentation with the updated CLI and use matching Viewer/MCP code
before relying on the new field. Audience selection does not replace authorization.

Section visibility conditions

Individual sections can be included or excluded from the document depending on the values of variables. The when parameter is used to describe visibility conditions.

Available comparison operators: ==, !=, <, >, <=, >=.

- name: Раздел с условным вхождением
  href: path/to/conditional/file.md
  when: version == 12

Substitutions and conditional operators

The document title supports substitutions and conditional operators.

title: "{{ title }}"

Warning

If a value starts with a substitution, always enclose it in quotes. Without them, the value is treated as JSON embedded in YAML, which can lead to build errors, for example TypeError: str.replace is not a function.

Configuring section expansion

By default, all sections of the table of contents are collapsed. To keep important sections and pages always visible in the table of contents, you can use the expanded parameter:

title: Yandex Cloud Marketplace
items:
  - name: Начало работы
    href: index.md
  - name: Основы
    expanded: true
    items:
      - name: Создание виртуальной машины
        href: create.md
  - name: Первичная настройка программного обеспечения
    href: setup.md
  - name: Работа с виртуальной машиной
    href: operate.md
  - name: Справочник API
    href: guide.md

Warning

The expanded parameter can only be used for first-level sections; specifying expanded in lower-level sections is ignored.

Labeled sections in navigation

Special headings that visually group individual items in the table of contents.

In the toc.yaml file, specify the labeled: true attribute for the corresponding menu item:

title: Имя документа
href: index.yaml
items:
  - name: Имя раздела
    labeled: true
    href: path/to/file.md
  - name: Имя группы разделов
    labeled: true
    items:
      - name: Имя раздела
        href: path/to/file.md
      - name: Имя раздела
        href: path/to/file.md
  - name: Имя раздела
    labeled: true
    href: path/to/file.md

Hidden sections

To make a section accessible only via a direct link and exclude it from the table of contents, specify the hidden parameter.

- title: Секретный документ
  href: secret.md
  hidden: true

To completely exclude hidden sections from the build, use the build key --remove-hidden-toc-items=true.

The hidden parameter controls navigation visibility and, together with --remove-hidden-toc-items, removal from the build. On its own it does not prohibit indexing. Hidden pages are omitted from llms.txt and llms-full.txt, but to exclude them from other indexes either add noIndex: true or enable the search.hiddenPolicy parameter in .yfm, which applies noIndex to all hidden pages and their nested items. An explicit noIndex value on a hidden page or section takes precedence over this setting.

Disabling indexing

To exclude pages from search indexes and from llms.txt and llms-full.txt, add noIndex: true. You can set it at the toc.yaml root, on an individual page, or on a section.

Disable indexing for all documentation in this TOC:

title: Internal documentation
href: index.md
noIndex: true
items:
  - name: Getting started
    href: start.md

Disable indexing for an individual page and a section:

items:
  - name: Draft
    href: draft.md
    noIndex: true
  - name: Internal section
    href: internal/index.md
    noIndex: true
    items:
      - name: Details
        href: internal/details.md

For a section, the restriction applies to its own href page and every descendant. A root noIndex from an included TOC also applies to the inserted pages.

The true value is cumulative: noIndex: false on a nested page does not cancel a restriction from its parent section, the TOC root, or page metadata. The global .yfm docs-viewer.no-index setting cannot be canceled locally either.

To both hide a page from navigation and disable its indexing, specify both independent parameters:

- name: Service page
  href: service.md
  hidden: true
  noIndex: true

Auto-generation of the table of contents

To automatically build a table of contents from a list of md files in a folder, you can use the generic includer.