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
32 changes: 14 additions & 18 deletions create/code.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Format code"
title: "change"
description: "Format code in your documentation with syntax highlighting, line numbers, diffs, copy buttons, and interactive code group features in MDX."
keywords: ["code blocks", "syntax highlighting", "code styling"]
---
Expand Down Expand Up @@ -143,7 +143,6 @@ class HelloWorld {
}
}
```

</Accordion>

### Twoslash
Expand All @@ -152,7 +151,7 @@ In JavaScript and TypeScript code blocks, use `twoslash` to enable interactive t

<CodeGroup>

```ts twoslash Twoslash example
```ts Twoslash example twoslash
type Pet = "cat" | "dog" | "hamster";

function adoptPet(name: string, type: Pet) {
Expand Down Expand Up @@ -235,7 +234,7 @@ Highlight specific lines in your code blocks using `highlight` with the line num

<CodeGroup>

```javascript Line highlighting example {1,2,5}
```javascript Line highlighting example highlight={1-2,5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
Expand All @@ -261,7 +260,7 @@ Focus on specific lines in your code blocks using `focus` with line numbers or r

<CodeGroup>

```javascript Line focusing example focus=2,4,5
```javascript Line focusing example focus={2,4-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
Expand Down Expand Up @@ -454,9 +453,9 @@ Add `[!code ++]` or `[!code --]` inside a comment at the end of a line to mark i

| Language | Added | Removed |
| --- | --- | --- |
| JavaScript, TypeScript, Java, C, C++, Go, Rust | `// [!code ++]` | `// [!code --]` |
| JavaScript, TypeScript, Java, C, C\+\+, Go, Rust | `// [!code ++]` | `// [!code --]` |
| Python, Ruby, Bash, YAML | `# [!code ++]` | `# [!code --]` |
| HTML, XML | `<!-- [!code ++] -->` | `<!-- [!code --] -->` |
| HTML, XML | `{/* [!code ++] */}` | `{/* [!code --] */}` |
| CSS | `/* [!code ++] */` | `/* [!code --] */` |
| SQL, Lua | `-- [!code ++]` | `-- [!code --]` |

Expand All @@ -478,8 +477,8 @@ sayHello();

```python Python diff lines
def greet():
print("Hello, World!") # [!code --]
print("Hello, Mintlify!") # [!code ++]
print("Hello, World!") # [!code --]
print("Hello, Mintlify!") # [!code ++]

greet()
```
Expand All @@ -498,8 +497,8 @@ sayHello();
````text Python format
```python Python diff lines
def greet():
print("Hello, World!") # [!code --]
print("Hello, Mintlify!") # [!code ++]
print("Hello, World!") // [!code --]
print("Hello, Mintlify!") // [!code ++]

greet()
```
Expand All @@ -522,8 +521,7 @@ Use the `<CodeBlock>` component in custom React components to programmatically r
</ResponseField>

<ResponseField name="icon" type="string">
The icon to display in the code block header. See [Icons](/components/icons)
for available options.
The icon to display in the code block header. See [Icons](/components/icons) for available options.
</ResponseField>

<ResponseField name="lines" type="boolean">
Expand All @@ -539,13 +537,11 @@ Use the `<CodeBlock>` component in custom React components to programmatically r
</ResponseField>

<ResponseField name="highlight" type="string">
The lines to highlight. Provide a stringified array of numbers. Example:
`"[1,3,4,5]"`.
The lines to highlight. Provide a stringified array of numbers. Example: `"[1,3,4,5]"`.
</ResponseField>

<ResponseField name="focus" type="string">
The lines to focus on. Provide a stringified array of numbers. Example:
`"[1,3,4,5]"`.
The lines to focus on. Provide a stringified array of numbers. Example: `"[1,3,4,5]"`.
</ResponseField>

### Example
Expand All @@ -570,4 +566,4 @@ export const CustomCodeBlock = ({
</CodeBlock>
);
};
```
```
15 changes: 12 additions & 3 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
"group": "Customize",
"icon": "paint-bucket",
"pages": [
"customize/custom-scripts",
"customize/custom-domain",
"customize/themes",
"customize/fonts",
"customize/custom-scripts",
"customize/themes",
"customize/react-components",
"customize/custom-404-page"
]
Expand All @@ -98,8 +98,8 @@
"editor/keyboard-shortcuts"
]
},
"create/text",
"create/code",
"create/text",
{
"group": "Agent",
"root": "agent/index",
Expand All @@ -112,6 +112,15 @@
]
},
"ai/mintlify-mcp",
{
"group": "Workflows",
"pages": [
"workflows/index",
"workflows/reference",
"workflows/manage",
"workflows/create"
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nav links missing workflow pages

Medium Severity

A new Workflows sidebar group lists workflows/index, reference, manage, and create, but no matching workflows/*.mdx pages exist in the repository. Those nav entries may fail validation or lead to missing pages unless separate content is added.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2a7265a. Configure here.

},
{
"group": "Automations",
"pages": [
Expand Down
Loading