⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Closed
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
2 changes: 2 additions & 0 deletions create/reusable-snippets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
keywords: ["content snippets", "reusable content", "variables"]
---

One of the core principles of software development is DRY (Don't Repeat Yourself), which applies to documentation too. If you find yourself repeating the same content in multiple places, create a custom snippet for that content. Snippets contain content that you can import into other files to reuse. You control where the snippet appears on a page. If you ever need to update the content, you only need to edit the snippet rather than every file where the snippet is used.

Check warning on line 7 in create/reusable-snippets.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

create/reusable-snippets.mdx#L7

Spell out 'DRY', if it's unfamiliar to the audience.

Check warning on line 7 in create/reusable-snippets.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

create/reusable-snippets.mdx#L7

Use parentheses judiciously.

## How snippets work

Expand All @@ -12,6 +12,8 @@

When you import a snippet into another file, the snippet only appears where you import it and does not render as a standalone page. Any file in the `/snippets/` folder is always a snippet even if it is not imported into another file.

Snippets and React components render with live previews in the visual editor, showing exactly how they will appear when published.

Check warning on line 15 in create/reusable-snippets.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

create/reusable-snippets.mdx#L15

Avoid using 'will'.

## Create snippets

Create a file with the content you want to reuse. Snippets can contain all content types supported by Mintlify and they can import other snippets.
Expand Down Expand Up @@ -132,7 +134,7 @@
```

<Note>
When creating JSX snippets, use arrow function syntax (`=>`) rather than function declarations. The `function` keyword is not supported in snippets.

Check warning on line 137 in create/reusable-snippets.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

create/reusable-snippets.mdx#L137

Use 'isn't' instead of 'is not'.
</Note>

2. Import the snippet.
Expand Down
2 changes: 2 additions & 0 deletions editor/pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

1. Click the **+** button in the navigation element where you want to add a page.
1. Click **Add a page**.
1. Enter a file name. The editor adds the `.mdx` extension automatically.

Check warning on line 19 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L19

Use 'filename' instead of 'file name'.

## Edit content

Expand All @@ -29,14 +29,16 @@

### Visual mode

Edit content with real-time previews that show how the content looks when it is published.

Check warning on line 32 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L32

Use 'it's' instead of 'it is'.

Check warning on line 32 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L32

In general, use active voice instead of passive voice ('is published').

- **Add text**: Type in the editor to see how the text appears when published.
- **Format text**: Use the toolbar to bold, italicize, or apply other formatting to text.
- **Add components**: Press <kbd>/</kbd> to open the component menu and select components.
- **Add images**: Use the image component from the <kbd>/</kbd> menu.
- **Insert links**: Select text and press <kbd>Cmd</kbd> + <kbd>K</kbd>.

Check warning on line 38 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L38

Did you really mean 'Cmd'?

The visual editor renders snippets and React components with live previews, showing exactly how they will appear when published.

Check warning on line 40 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L40

Avoid using 'will'.

See [Components](/components) documentation for the complete list of available components.

### Markdown mode
Expand All @@ -44,7 +46,7 @@
Edit the MDX source code.

- **Direct MDX editing**: Write MDX and Markdown syntax for precise control over content.
- **Syntax highlighting**: Code is highlighted for readability.

Check warning on line 49 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L49

In general, use active voice instead of passive voice ('is highlighted').
- **Component properties**: Set component properties and configurations.
- **Frontmatter**: Edit page metadata at the top of the file.

Expand All @@ -67,7 +69,7 @@

Help users find your page and improve how it appears when shared.

- **Description**: Write a brief summary. Appears in search results and SEO meta tags.

Check warning on line 72 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L72

Spell out 'SEO', if it's unfamiliar to the audience.
- **Keywords**: Add relevant search terms to help users discover this page.
- **OG Image URL**: Set a custom preview image for social media shares and link previews.

Expand All @@ -75,13 +77,13 @@

Choose how the page displays to match your content needs.

- **Standard layout** (`default`): Default page with sidebar navigation and table of contents.

Check warning on line 80 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L80

Use parentheses judiciously.
- **Full-width layout** (`wide`): Hides table of contents to allow wider layouts for tables, diagrams, or other content.

Check warning on line 81 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L81

Use parentheses judiciously.
- **Centered layout** (`center`): Hides sidebar and table of contents for better readability of text-heavy pages like changelogs.

Check warning on line 82 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L82

Use parentheses judiciously.
- **Custom width** (`custom`): Minimal layout with only the top navbar for landing pages or other unique layouts.

Check warning on line 83 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L83

Use parentheses judiciously.

## Manage files

To move files in your navigation, drag and drop them to your desired location.

Check warning on line 87 in editor/pages.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/pages.mdx#L87

Use the Oxford comma in 'To move files in your navigation, drag and'.

To duplicate or delete files, right-click the file and select the desired action.