﻿---
title: File inclusion
description: File inclusion is useful for including entire pages in a content set (usually done in the docset.yml file), breaking files into smaller units and including...
url: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/3804/syntax/file_inclusion
products:
  - Elastic Docs Builder
---

# File inclusion
File inclusion is useful for
- including entire pages in a content set (usually done in the `docset.yml` file)
- breaking files into smaller units and including them where appropriate

If there are portions of content that are relevant to multiple pages, you can inject content from another file into any given MD file using the `include` directive.
<note>
  Files to be included must live in a `_snippets` folder to be considered a snippet file. This folder can live anywhere.
</note>


### Syntax

```markdown
:::{include} _snippets/reusable-snippet.md
:::
```

This is a snippet included on "File inclusion".
<tip>
  This is a snippet
</tip>


#### Linking to snippets with custom anchors

To link to a heading with a [custom anchor (ID)](/elastic/docs-builder/pull/3804/syntax/headings#custom-anchor-links) defined in a snippet, target the parent file + anchor.
For example:
```markdown
[my favorite esql function](parent-file.md#id-from-included-snippet)
```


### Asciidoc syntax

```asciidoc
include::shared-monitor-config.asciidoc[]
```