YFM project settings
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 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 |
|
|
Allow loading custom resources into statically generated pages. |
|
|
|
Allow using HTML elements in markup. |
|
|
|
Whether to apply variable presets. |
|
|
Enable displaying the article author. Example:
Parameters:
The value Works when the vcs parameter is enabled. |
|
|
|
|
Wrap lines at the carriage return character. |
|
|
|
Enable displaying contributors in the article. Example:
Parameters:
The value Works when the vcs parameter is enabled. |
|
|
|
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). |
|
|
|
List of Diplodoc extensions used for building the project. Objects in the list must contain the
Strings in the list can specify extension names in a simplified format:
|
— |
|
|
An array of languages involved in the build. |
— — |
|
|
Convert link-like strings into links. Examples of strings:
|
|
|
|
Enable the linter file. |
|
|
|
Settings for generating llms.txt and llms-full.txt files for the project:
Parameters:
|
— |
|
|
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. |
|
|
|
The format of the final build files: |
|
|
|
Remove from the build all files marked in |
|
|
|
Enables cleaning HTML markup from potentially dangerous elements in |
|
|
|
Build a single-page build. A file The page will be available at
|
|
|
|
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. |
|
|
|
Strict build mode, all YFM warnings are displayed as errors. You can find the full list of YFM rules here. |
|
|
|
Generate additional anchors compatible with GitHub. |
|
|
|
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. |
|
|
The name of the variables preset to use during the build. |
— |
|
|
Setting for connecting to a VCS system. Enabling it allows using the mtimes, authors, and contributors features. Requires connecting the built-in extension |
|
Section analytics
|
Name |
Description |
Type and default value |
|
|
Google Tag Manager analytics settings. Parameters:
|
— |
|
|
Connecting Yandex Metrica counters. Each list item is an object with a required field Minimal configuration:
Example with multiple counters
Goals are sent to the connected counters from the documentation interface. |
— |
Section content
Managing article content processing and checks.
|
Name |
Description |
Type and default value |
|
|
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. |
|
|
|
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. |
|
|
|
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. |
|
|
|
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 ( Accepts numbers and strings like: 1024, 512K, 2M. If you specify 0, the |
|
|
|
Whether tooltips can contain content with multiple line breaks:
|
|
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 |
|
|
Icon in the browser tab. |
— |
|
|
Hides the table of contents (ToC). If not specified, the ToC is considered enabled. |
|
|
|
Hides the header in the ToC. If not specified, the header is considered enabled. |
|
|
|
Hides the feedback at the end of the page. If not specified, feedback is enabled. |
|
|
|
Hides search. If not specified, search is considered enabled. |
|
Section pdf
Contains data preprocessing parameters for generating a PDF version of the documentation.
|
Name |
Description |
Type and default value |
|
|
Enable data preprocessing for the |
|
|
|
If set to true, pages hidden by the If set to false, hidden pages will be displayed in the PDF version of the documentation. |
|
Section resources
Managing resources attached to the project.
|
Name |
Description |
Type and default value |
|
|
Managing Content Security Policy (CSP). Example structure
This configuration is converted into an HTML tag like:
Object keys correspond to supported CSP directives. The system does not validate the correctness of the specified values — they are taken from the |
— |
|
|
List of JavaScript files attached to all project pages.
To connect scripts, the parameter allowCustomResources: true must be set. |
— |
|
|
A list of css files to be connected to all pages of the project.
To connect styles, the parameter allowCustomResources: true must be set. |
— |
Section template
Managing supported constructs of template syntax.
|
Parameter |
Description |
Type and default value |
|
|
Enables processing of template syntax in the documentation. If not specified, templating is considered enabled. |
|
|
|
||
|
|
Enables processing of conditional operators syntax in code blocks. |
|
|
|
Enables processing of conditional operators syntax in document text. |
|
|
|
||
|
|
Enables processing of loops syntax. |
|
|
|
Enables processing of conditional operators syntax. |
|
|
|
Enables processing of variables syntax. |
|
Section search
To add search to the documentation, explicitly specify the search section in the .yfm file.
Diplodoc supports two 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 |
|
|
Selection of the search engine.
|
— (search not connected) |
Parameters for local search (provider: local)
|
Name |
Description |
Type and default value |
|
|
Depth of match expansion:
|
|
|
|
Result ranking mode:
|
|
Example of local search configuration
search:
provider: local
tolerance: 2
confidense: phrased
Parameters for search via Algolia (provider: algolia)
|
Name |
Description |
Type and default value |
|
|
Algolia App ID. |
— |
|
|
Secret Admin API Key for indexing. |
— |
|
|
The name of the index in Algolia. |
|
|
|
If |
|
|
|
Search API Key. |
|
|
|
Path to the client-side search JS API. |
|
|
|
— |
|
|
|
— |
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
searchsection and specifyprovider. - For large projects, Algolia cloud search is recommended.
- Do not publish the
apiKeyfrom Algolia in public repositories or production configurations — use environment variables or CLI parameters.
The docs-viewer
|
Name |
Description |
Type and default value |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Default language for localization. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
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
Full list of supported languages
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. |
— |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Logo settings:
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. ExamplesOne logo for all languages:
Different logos for different languages:
In this example, when navigating via links with a language directory specified, Examples of links and displayed logos:
|
— — |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Prohibition on indexing by external robots. It is recommended to use it before public launches so that the document is not displayed in search engines. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Forms the project URL. Requirements:
Warning There are three reserved names that cannot be used as the value of
|
— |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
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:
Warning The parameter is supported only in the server version. |
|