Skip to content

Commit 41db4fd

Browse files
committed
Add code example for title property syntax on code blocks
Generated-By: mintlify-agent
1 parent 1c987f8 commit 41db4fd

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

create/code.mdx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,35 @@ const message = adoptPet("Mintie", "cat");
180180

181181
### Title
182182

183-
Add a title to label your code example. Place the title after the language identifier. Use `title="Your title"` or a string on a single line. Titles can contain multiple words and file paths.
183+
Add a title to label your code example. Place the title after the language identifier. Titles can contain multiple words and file paths.
184+
185+
You can set the title two ways:
186+
187+
- **Inline**: Place the title directly after the language identifier.
188+
- **`title` property**: Use `title="Your title"` for titles that need special characters or explicit quoting.
184189

185190
<CodeGroup>
186191

187192
```javascript Example title
188193
const hello = "world";
189194
```
190195

191-
````mdx Format
196+
```javascript title="utils/hello.js"
197+
const hello = "world";
198+
```
199+
200+
````mdx Inline format
192201
```javascript Example title
193202
const hello = "world";
194203
```
195204
````
196205

206+
````mdx title property format
207+
```javascript title="utils/hello.js"
208+
const hello = "world";
209+
```
210+
````
211+
197212
</CodeGroup>
198213

199214
### Icon

0 commit comments

Comments
 (0)