Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摉 Document include for splitting a document across multiple parts #1232

Merged
merged 2 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/documents-exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,10 @@ The following table shows the available properties for each export. You must def
```{seealso} Exposing Exports as Downloads
You can also include exported documents as downloads in your site, see [](./website-downloads.md).
```

## Split your document across multiple content files

When writing longer documents like manuscripts, it's common to write your document in multiple parts and then stitch them together into a single narrative.
You can accomplish this in MyST with the {myst:directive}`include` directive.

See [](#docs:include) for more information.
7 changes: 5 additions & 2 deletions docs/embed.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,11 @@ The following content is embedded from `![](xref:spec#admonition)`:

## The {myst:directive}`include` directive

If a portion of your content is in a separate file that is **not already included in your project** you can use the {myst:directive}`include` directive to parse and include that content.
This directive is helpful for including content snippets, such as a table, equation, that you want to keep in a different file on disk, but present as if it were one document. In addition to Markdown, MyST will also parse `.ipynb`, `.tex`, and `.html`.
You can include multiple files into your MyST document as if they were all written in the same file.
This allows you to store content in separate files, and then weave them together at build time.
To do so, use the {myst:directive}`include` directive.

This is also helpful for including content snippets, such as a table or an equation, that you want to keep in a different file on disk, but present as if it were one document. In addition to Markdown, MyST will also parse `.ipynb`, `.tex`, and `.html`.

See {myst:directive}`the {include} directive documentation <include>` for details about all the arguments you can give to `{include}`.

Expand Down
Loading