Skip to content
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
2 changes: 2 additions & 0 deletions code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
To denote a `word` or `phrase` as code, enclose it in backticks (\`).

```mdx
To denote a `word` or `phrase` as code, enclose it in backticks (`).

Check warning on line 16 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L16

Use parentheses judiciously.
```

### Code blocks
Expand Down Expand Up @@ -57,8 +57,10 @@

Enable syntax highlighting by specifying the programming language after the opening backticks of a code block.

We use [Shiki](https://shiki.style/) for syntax highlighting and support all available languages. See the full list of [languages](https://shiki.style/languages) in Shiki's documentation.

Check warning on line 60 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L60

Try to avoid using first-person plural like 'We'.

Check warning on line 60 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L60

Did you really mean 'Shiki's'?

Customize code block themes globally using `styling.codeblocks` in your `docs.json` file. Set simple themes like `system` or `dark`, or configure custom [Shiki themes](https://shiki.style/themes) for light and dark modes. See [Settings](/settings#styling) for detailed configuration options.

```java
class HelloWorld {
public static void main(String[] args) {
Expand Down Expand Up @@ -105,7 +107,7 @@
```
````

### Line Highlighting

Check warning on line 110 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L110

'Line Highlighting' should use sentence-style capitalization.

Highlight specific lines in your code blocks using `highlight` with the line numbers or ranges you want to highlight.

Expand Down Expand Up @@ -302,12 +304,12 @@

### Diff

Show a visual diff of added or removed lines in your code blocks. Added lines are highlighted in green and removed lines are highlighted in red.

Check warning on line 307 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L307

In general, use active voice instead of passive voice ('are highlighted').

Check warning on line 307 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L307

In general, use active voice instead of passive voice ('are highlighted').

To create diffs, add these special comments at the end of lines in your code block:

- `// [!code ++]`: Mark a line as added (green highlight).

Check warning on line 311 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L311

Use parentheses judiciously.
- `// [!code --]`: Mark a line as removed (red highlight).

Check warning on line 312 in code.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

code.mdx#L312

Use parentheses judiciously.

For multiple consecutive lines, specify the number of lines after a colon:

Expand Down
2 changes: 2 additions & 0 deletions components/code-groups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class HelloWorld {

</CodeGroup>

Code groups inherit global styling from your `docs.json` file. Customize your theme using `styling.codeblocks`. See [Settings](/settings#styling) for configuration options.

## Creating code groups

To create a code group, wrap multiple code blocks with `<CodeGroup>` tags. Each code block must include a title, which becomes the tab label.
Expand Down
48 changes: 46 additions & 2 deletions settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
```json
{
"$schema": "https://mintlify.com/docs.json",
"theme": "mint",

Check warning on line 23 in settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

settings.mdx#L23

Commas and periods go inside quotation marks.
"name": "Your Docs",

Check warning on line 24 in settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

settings.mdx#L24

Commas and periods go inside quotation marks.
"colors": {
"primary": "#ff0000"
},
Expand Down Expand Up @@ -127,8 +127,52 @@
<ResponseField name="eyebrows" type="&quot;section&quot; | &quot;breadcrumbs&quot;">
The style of the page eyebrow. Choose `section` to show the section name or `breadcrumbs` to show the full navigation path. Defaults to `section`.
</ResponseField>
<ResponseField name="codeblocks" type="&quot;system&quot; | &quot;dark&quot;">
The theme of the code blocks. Choose `system` to match the site theme or `dark` for always dark code blocks. Defaults to `system`.
<ResponseField name="codeblocks" type="&quot;system&quot; | &quot;dark&quot; | object">
Code block theme configuration. Defaults to `"system"`.

**Simple options:**
- `"system"`: Match current site mode (light or dark)
- `"dark"`: Always use dark mode

**Custom theme configuration:**
Use an object to specify [Shiki themes](https://shiki.style/themes). Choose a single theme for both modes or separate themes for light and dark.

<Expandable title="codeblocks">
<ResponseField name="theme" type="string">
A single Shiki theme name to use for both light and dark modes.

```json
"styling": {
"codeblocks": {
"theme": "dracula"
}
}
```
</ResponseField>

<ResponseField name="themes" type="object">
Separate themes for light and dark modes.

<Expandable title="themes">
<ResponseField name="light" type="string" required>
A Shiki theme name for light mode.
</ResponseField>
<ResponseField name="dark" type="string" required>
A Shiki theme name for dark mode.
</ResponseField>
```json
"styling": {
"codeblocks": {
"themes": {
"light": "github-light",
"dark": "github-dark"
}
}
}
```
</Expandable>
</ResponseField>
</Expandable>
</ResponseField>
</Expandable>
</ResponseField>
Expand Down Expand Up @@ -1449,7 +1493,7 @@

</CodeGroup>

If you already have the CLI installed, make sure it is up to date:

Check warning on line 1496 in settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

settings.mdx#L1496

Use 'command-line tool' instead of 'CLI'.

Check warning on line 1496 in settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

settings.mdx#L1496

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

```bash
mint update
Expand All @@ -1463,7 +1507,7 @@
mint upgrade
```

This command will create a `docs.json` file from your existing `mint.json`. Review the generated file to ensure all settings are correct.

Check warning on line 1510 in settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

settings.mdx#L1510

Avoid using 'will'.
</Step>
<Step title="Delete your mint.json file">
After verifying your `docs.json` is configured properly, you can safely delete your old `mint.json` file.
Expand Down
Loading