YFM project settings

Article last updated at November 18, 2026

Project settings are specified in the yaml file .yfm in the document root. During build, you can specify a path to another file using the launch key --config.

Some parameters can also be set or overridden via the launch keys of the yfm build command.

Example of the .yfm file
# Корневая секция параметров
allowHtml: false

# Настройки интерфейса документации
interface:
  favicon-src: https://raw.githubusercontent.com/yandex-cloud/yfm-documentation/master/_images/logo_blue_32x32.png

# Секция параметров вьюера (docs-viewer)
docs-viewer:
  # Настройки логотипа
  logo-options:
    url: https://diplodoc.com/docs/{lang}/
    src: https://storage.yandexcloud.net/docs-external/yfm-documentation/_images/logo.svg
    src-dark: https://storage.yandexcloud.net/docs-external/yfm-documentation/_images/logo.svg
    src-mobile: https://storage.yandexcloud.net/docs-external/yfm-documentation/_images/logo.svg
    src-mobile-dark: https://storage.yandexcloud.net/docs-external/yfm-documentation/_images/logo.svg
    src-preview: https://storage.yandexcloud.net/docs-external/yfm-documentation/_images/share-logo-dark.svg
    # Если логотипа нет, то вместо него можно задать текст
    title: Yandex Flavored Markdown

Root section of .yfm

Parameter

Description

Type and default value

allowCustomResources

Allow loading custom resources into statically generated pages.

boolean

false

allowHtml

Allow using HTML elements in markup.

boolean

false

applyPresets

Whether to apply variable presets.
For more details about presets, see.

boolean

false

authors

Enable displaying the article author.

Example:

authors:
  enabled: true
  ignore:
    - robot-*
    - noreply@company.com

Parameters:

  • enabled — boolean — enable displaying the article author,
  • ignore — string[] — ignore authors by patterns listed in the array.

The value authors: true is equivalent to authors: enabled: true.

Works when the vcs parameter is enabled.

boolean | object

false

baseHref

Set the root URL at which the documentation will be available on the website.

Example:

baseHref: 'https://diplodoc.com/docs/'

The value of this parameter:

  • is added to the <base href="..."> tag;
  • is used to construct absolute URLs in hreflang metadata tags;
  • is used to construct absolute page URLs when generating sitemap.xml and llms.txt;
  • is used to construct absolute URLs in page Markdown companions.

Important: a / character is always appended to the baseHref value when constructing an absolute URL.

string

—

breaks

Wrap lines at the carriage return character.

boolean

true

contributors

Enable displaying contributors in the article.

Example:

contributors:
  enabled: true
  ignore:
    - robot-*
    - noreply@company.com

Parameters:

  • enabled — boolean — enable displaying contributors in the article,
  • ignore — string[] — ignore contributors by patterns listed in the array.

The value contributors: true is equivalent to contributors: enabled: true.

Works when the vcs parameter is enabled.

boolean | object

false

disableCsp

Disable adding the Content-Security-Policy meta tag to generated HTML pages.

Use this when CSP is managed externally (for example, via server HTTP headers).

boolean

false

extensions

List of Diplodoc extensions used for building the project.

Objects in the list must contain the name parameter with the extension name, as well as operation parameters unique to each extension.

extensions:
  - name: my-extension
    option1: true
    option2: true
    ...

Strings in the list can specify extension names in a simplified format:

extensions:
  - algolia
  - some-author/my-extension
  - /my-local-extension

(string\|object)[]

—

feedback

Settings for submitting feedback in statically generated documentation.

object

Not set

langs

An array of languages involved in the build.

—

—

linkify

Convert link-like strings into links.

Examples of strings:

  • https://diplodoc.com/ru
  • diplodoc.com/ru

boolean

false

lint

Enable the linter file.

boolean

false

llms

Settings for generating llms.txt and llms-full.txt files for the project:

llms:
  enabled: true
  description: Product documentation.
  details: Additional Markdown information.
  llmsFullMaxSize: 8M
  url: https://example.com/llms.txt

Parameters:

  • description – string — a short project summary at the beginning of llms.txt;
  • details — string — additional Markdown paragraphs and lists after the summary and before the link sections in llms.txt. Not added to llms-full.txt;
  • enabled — boolean — enable file generation;
  • llmsFullMaxSize — number|string — the maximum size of the llms-full.txt file, accepts numbers and strings like 1024, 512K, 8M;
  • url – string — a link to the external llms.txt file, which will be written into documentation articles.

The description, details, and url fields can be overridden independently at the root of toc.yaml. An omitted field uses the .yfm value; an empty string clears it. The enabled and llmsFullMaxSize fields remain project settings.

object

—

mtimes

Enable displaying the article modification date, which is taken from VCS data.

Works when the vcs parameter is enabled.

Also, the modification date is automatically added to the page metadata last-modified and article:modified_time.

boolean

false

outputFormat

The format of the final build files: html or md.

string

html

removeHiddenTocItems

Remove from the build all files marked in toc.yaml with the attribute hidden: true.

boolean

false

sanitizeHtml

Enables cleaning HTML markup from potentially dangerous elements in .md files using an HTML sanitizer. Defines allowed and forbidden tags, attributes, styles, and other elements when cleaning HTML content.

boolean

true

singlePage

Build a single-page build. A file single-page.html will be created, which will combine the contents of all project files.

The page will be available at

<documentation_root>/
single-page

boolean

false

sitemap

Generate a sitemap.xml file in the build output. The file lists the documentation pages as absolute URLs resolved against the baseHref parameter, which must be set in the configuration file or passed as a launch parameter. Pages marked noIndex are not included.

boolean

false

staticContent

Build the article's HTML content as part of the layout. By default, it is in a JS object and is inserted into the page during rendering in the browser.

boolean

false

strict

Strict build mode, all YFM warnings are displayed as errors.

You can find the full list of YFM rules here.

boolean

false

supportGithubAnchors

Generate additional anchors compatible with GitHub.

boolean

false

theme

Setting for the base color in the themizer. Overrides base-brand in the main section of the theme.yaml configuration file. Learn more about the themizer.

By default, the base color does not change.

varsPreset

The name of the variables preset to use during the build.

string

—

vcs

Setting for connecting to a VCS system. Enabling it allows using the mtimes, authors, and contributors features.

Requires connecting the built-in extension github-vcs.

boolean | object

false

Section ai

Name

Description

Type and default value

mdCompanions

Include Markdown versions of pages (Markdown companions) in the final documentation build:

  • internal links in Markdown companions are converted to absolute URLs using the baseHref parameter;
  • links in llms.txt files point to Markdown versions of articles instead of HTML versions;
  • the Copy as Markdown and View as Markdown actions are added to the interface.

boolean

false

openapiCompanions

Include JSON schemas of OpenAPI specifications as *.openapi.json files in the final documentation build, with links in llms.txt.

boolean

false

Section analytics

Name

Description

Type and default value

gtm

Google Tag Manager analytics settings.

Parameters:

  • id — string — Google Tag Manager identifier in GTM format,
  • mode — string — notification type before sending events base (default) or notification.

object

—

metrika

Connecting Yandex Metrica counters.

Each list item is an object with a required field id (counter number) and an optional field params for passing counter initialization parameters.

Minimal configuration:

analytics:
  metrika:
    - id: 123456
Example with multiple counters
analytics:
  metrika:
    - id: 123456
      params:
        clickmap: true
    - id: 456789
      params:
        clickmap: true
        webvisor: true

Goals are sent to the connected counters from the documentation interface.

object[]

—

Section content

Managing article content processing and checks.

Name

Description

Type and default value

maxAssetSize

Maximum allowed asset size in the project. If exceeded, the build will fail with an error.

Accepts numbers and strings: 1024, 512K, 8M.

If you specify 0, asset size checking will not be performed.

number | string

64M

maxHtmlSize

Maximum allowed size of the article's HTML content after the build. If exceeded, the build will fail with an error.

Accepts numbers and strings: 1024, 512K, 8M.

Maximum value — 96M.

number | string

42M

maxInlineSvgSize

Maximum allowed size of an SVG image at which it is inlined into the article content automatically. If the size is exceeded, the SVG image is inserted via the <img> tag.

Accepts numbers and strings: 1024, 512K, 2M.

If you specify 0, SVG images will not be inlined during the build.

Maximum value — 16M.

number | string

2M

maxOpenapiIncludeSize

Maximum allowed size of the JSON schema in the table of contents text of the built OpenAPI specification. If the size is exceeded, the JSON schema is not added to the page directly, but is inserted as a download link (link mode).

Accepts numbers and strings like: 1024, 512K, 2M.

If you specify 0, the inline JSON schema insertion mode is always replaced with link.

number | string

100K

multilineTermDefinitions

Whether tooltips can contain content with multiple line breaks:

  • true — tooltips can contain content with multiple line breaks.

  • false — tooltips can contain only single line breaks, and all term definitions must be placed at the end of the file (if this condition is violated, the build will fail with an YFM009 error).

boolean

true

Section feedback

Sets the URL for submitting feedback in statically generated HTML documentation. Add the section to the root of the .yfm file:

feedback:
  url: https://api.example.com/feedback

Name

Description

Type and default value

url

URL of the feedback handler.

string

Not set

The handler must accept POST requests with Content-Type: application/json. The request includes the feedback data, the page path (page), and the submission time in ISO 8601 format (timestamp). For a URL on another domain, configure CORS on the handler.

Without feedback.url, the feedback form is hidden in static documentation. To hide it when a URL is configured, set interface.feedback: false in .yfm or in the metadata of an individual page.

Section interface

Interface display settings. All settings in the section can be overridden for individual articles by specifying their values in the page metadata.

Name

Description

Type and default value

favicon-src

Icon in the browser tab.
You can use any image link that meets standard favicon requirements.

string

—

toc

Hides the table of contents (ToC). If not specified, the ToC is considered enabled.

boolean

true

toc-header

Hides the header in the ToC. If not specified, the header is considered enabled.

boolean

true

feedback

Controls feedback form visibility. Setting it to false hides the form in the side menu and at the end of the page. Static documentation also requires feedback.url to display the form.

boolean

true

Open images and videos in a gallery. Enabled by default.

boolean

true

markdownActions

Controls how the Copy as Markdown and View as Markdown actions are displayed: as separate buttons (visible), in a dropdown (dropdown), or hidden (none).

string

dropdown

search

Hides search. If not specified, search is considered enabled.

boolean

true

Section pdf

Settings for PDF generation and the download button.

The enabled, hiddenPolicy, and showAbsoluteUrls fields control generation. The icon, position, size, and pdfFileUrl fields configure the download button. In a static HTML build, the link appears when pdfFileUrl is set. Setting enabled alone does not display it.

Name

Description

Type and default value

enabled

Enables data preparation for @diplodoc/pdf-generator. Displaying a download link requires the button configuration described below.

boolean

false

hiddenPolicy

When true, excludes pages hidden by the hidden parameter in toc.yaml and their descendants from the PDF. When false, includes them in the PDF.

boolean

true

showAbsoluteUrls

Appends absolute HTTP(S) URLs in parentheses after link text in the PDF. If the link text already matches the URL, the URL is not repeated. See Link URLs in PDF.

boolean

false

icon

Download button icon: SVG markup, an absolute image URL, or a path relative to the project root starting with _assets/, such as _assets/pdf-icon.svg.

string

Standard PDF icon

position

Download button location: toc — below the table of contents, header — in the documentation header.

string

toc

size

Download button size. When omitted, inherits the size of the surrounding controls. See the limitation below before using this option.

string

Not set

pdfFileUrl

URL or path to an existing PDF file for the download button in a static HTML build. Generate and publish the file separately. In the web viewer, the PDF URL is computed automatically.

string

Not set

Note

The size option currently has a limitation: the .yfm schema accepts S, M, and L, while the UI uses m, l, and xl. Until these values are aligned, omit the option so the button inherits the size of the surrounding controls.

Example .yfm configuration for a static HTML build with a button in the header:

pdf:
  enabled: true
  hiddenPolicy: true
  showAbsoluteUrls: true
  icon: _assets/pdf-icon.svg
  position: header
  pdfFileUrl: ./single-page.pdf

Place the icon image at _assets/pdf-icon.svg and publish the PDF at the URL specified by pdfFileUrl.

Title and closing pages are configured separately in toc.yaml using pdf.startPages and pdf.endPages.

Section resources

Managing resources attached to the project.

Name

Description

Type and default value

csp

Managing Content Security Policy (CSP).

Example structure
resources:
  csp:
    - "script-src":
        - "self"
        - "domain1.com"
        - "domain2.com"
        "*.domain3.com"
    - "style-src":
    	- "self"

This configuration is converted into an HTML tag like:

<meta http-equiv="content-security-policy" content="script-src 'self' domain1.com domain2.com *.domain3.com; style-src 'self'">

Object keys correspond to supported CSP directives. The system does not validate the correctness of the specified values — they are taken from the .yfm file and automatically included in the meta tag.

object

—

script

List of JavaScript files attached to all project pages.

resources:
  script:
    - _assets/scripts/custom.js
    - _assets/scripts/some.js

To connect scripts, the parameter allowCustomResources: true must be set.

string[]

—

style

A list of css files to be connected to all pages of the project.

resources:
  style:
    - _assets/style/custom.css
    - _assets/style/my.css

To connect styles, the parameter allowCustomResources: true must be set.

string[]

—

Section template

Managing supported constructs of template syntax.

Parameter

Description

Type and default value

enabled

Enables processing of template syntax in the documentation. If not specified, templating is considered enabled.

boolean

true

scopes

scopes.code

Enables processing of conditional operators syntax in code blocks.

boolean

false

scopes.text

Enables processing of conditional operators syntax in document text.

boolean

true

features

features.cicles

Enables processing of loops syntax.

boolean

true

features.conditions

Enables processing of conditional operators syntax.

boolean

true

features.substitutions

Enables processing of variables syntax.

boolean

true

To add search to the documentation, explicitly specify the search section in the .yfm file.
Diplodoc supports three types of search integration in the static documentation build mode:

By default, search is disabled; to enable it, configure the search section.

Common parameters

Name

Description

Type and default value

provider

Selection of the search engine.
Options:

  • local — local search (Lunr.js);
  • algolia - cloud search based on Algolia;
  • external - a custom HTTP endpoint.

string

— (search not connected)

hiddenPolicy

If set to true, pages hidden with the hidden parameter in toc.yaml get noIndex: true and are excluded from search indexes: local, Algolia, and external search engines. All pages nested in a hidden section are excluded as well.

An explicit noIndex value on a page or section takes precedence over the policy: noIndex: false keeps a hidden page searchable, noIndex: true excludes it regardless of the setting.

The parameter also applies when search is disabled and in md builds: the restriction is written to page metadata.

boolean

false

External HTTP search (provider: external)

search:
  provider: external
  endpoint: /api/docs/search
  options:
    version: v1

endpoint is required when external search is enabled. It accepts an HTTP(S) URL, an origin-relative path, or a path relative to the documentation root. options contains public extra query parameters with string, number, or boolean values. These settings are included in the generated pages; keep backend credentials on your server.

CLI equivalents: --search-provider external --search-endpoint /api/docs/search --search-options '{"version":"v1"}'. CLI values override their .yfm counterparts. Use --no-search to disable search for a build.

See the HTTP contract for request and response fields. The build does not create or upload an external index.

Parameters for local search (provider: local)

Name

Description

Type and default value

tolerance

Depth of match expansion:

  • 0 — only exact word match;
  • 1 — prefix match (word*);
  • 2 — match by any substring of the word (*word*).

number

2

confidence

Result ranking mode:

  • phrased — results are ranked higher by the length of the found phrase;
  • sparsed — results are ranked higher by the number of found words.

string

phrased

Example of local search configuration
search:
  provider: local
  tolerance: 2
  confidence: phrased

Parameters for search via Algolia (provider: algolia)

Name

Description

Type and default value

appId

Algolia App ID.
Required parameter for cloud search.

string

—

apiKey

Secret Admin API Key for indexing.
It is recommended to pass them via environment variables or CLI.

string

—

indexName

The name of the index in Algolia.

string

docs

index

If true, the index will be automatically uploaded to Algolia after the build.
If false, only a local index is created.

boolean

false

searchApiKey

Search API Key.
Client-side key for search on the frontend. Without it, cloud search does not work on the client.

string

search-api-key

api

Path to the client-side search JS API.

string

_search/api.js

indexSettings

Algolia index settings.

object

—

querySettings

Algolia search parameter settings.

object

—

Example of configuring search via Algolia
search:
  provider: algolia
  appId: <YOUR_APP_ID>
  indexName: docs
  index: true
  searchApiKey: <YOUR_SEARCH_API_KEY>
  indexSettings:
    searchableAttributes:
      - title
      - content
      - headings
  querySettings:
    hitsPerPage: 10
    attributesToRetrieve:
      - title
      - content
      - url

Note

  • To activate search, be sure to add the search section and specify provider.
  • For large projects, Algolia cloud search is recommended.
  • Do not publish the apiKey from Algolia in public repositories or production configurations — use environment variables or CLI parameters.

The docs-viewer

Name

Description

Type and default value

lang

Default language for localization.
For the following languages, content will be displayed in RTL (right-to-left) format.

string

ru

langs

Array of languages displayed in the documentation interface. The default language when opening a page is the first element in the array.

Example of a project structure with multiple languages
input-folder
|-- .yfm
|-- ru
    |-- toc.yaml
    |-- index.md
|-- en
    |-- toc.yaml
    |-- index.md
Full list of supported languages

Language code (ISO 639-1)

Language

am

Amharic

ar

Arabic

az

Azerbaijani

be

Belarusian

bg

Bulgarian

el

Greek

en

English

es

Spanish

et

Estonian

fi

Finnish

fr

French

he

Hebrew

hu

Hungarian

hy

Armenian

ka

Georgian

kk

Kazakh

km

Khmer

ky

Kyrgyz

lt

Lithuanian

lv

Latvian

ne

Nepali

no

Norwegian

pl

Polish

pt

Portuguese

ro

Romanian / Moldavian

ru

Russian

sr

Serbian

tg

Tajik

tr

Turkish

uk

Ukrainian

ur

Urdu

uz

Uzbek

vi

Vietnamese

zh

Chinese

Warning

Languages not included in the list will not be displayed.

If the project structure contains language folders, this parameter must be specified, even if the project uses only one language.

string[]

—

logo-options

Logo settings:

  • src — link to the image for the light theme;

  • src-dark — link to the image for the dark theme;

  • src-mobile — link to the image for the light theme on mobile;

  • src-mobile-dark — link to the image for the dark theme on mobile;

  • src-preview — logo for the link preview when sharing on external resources, uses the standard OpenGraph;

  • url — link to which the user is redirected when clicking the logo. You can set a link template with the {lang} parameter so that it is replaced with the current documentation language when navigating. For example, the link https://diplodoc.com/docs/{lang}/ when navigating from the Russian-language documentation will lead to https://diplodoc.com/docs/ru/;

  • title — text that is shown instead of the logo if it is not set.

If the logo for the dark theme is not specified, the image for the light theme is used.

For the parameters listed above, you can configure specific logos for different documentation languages.

Examples

One logo for all languages:

src: logo

Different logos for different languages:

src:
  ru: logo1
  en: logo2
  default: logo3

In this example, when navigating via links with a language directory specified, logo1 and logo2 will be displayed for the languages ru and en respectively. If the language directory is not specified, logo3 will be displayed.

Examples of links and displayed logos:

  • https://diplodoc.com/docs/ru — logo1
  • https://diplodoc.com/docs/en — logo2
  • https://diplodoc.com/docs — logo3

—

—

no-index

Globally prohibits external robots from indexing the entire documentation.

docs-viewer:
  no-index: true

It is recommended before public launches so that the document is not displayed in search engines. Per-page and per-section noIndex settings cannot cancel the global restriction with false.

boolean

false

project-name

Forms the project URL. Requirements:

  • lowercase only;
  • only Latin letters, digits, hyphen, and underscore;
  • maximum length — 63 characters.

Warning

There are three reserved names that cannot be used as the value of project-name:

  • build;
  • docs-assets;
  • api.

string

—

themes

Selecting the design theme: light or dark. Both are available by default. You can disable one of them by specifying the one used by default, for example:

themes: ['dark']

Warning

The parameter is supported only in the server version.

string[]
['light', 'dark']

Ajv schema of Diplodoc configuration files