Skip to content

Commit 42d12dd

Browse files
committed
Merge branch 'main' into assistant-docs
2 parents afb90f6 + bc300dd commit 42d12dd

File tree

3 files changed

+157
-154
lines changed

3 files changed

+157
-154
lines changed

code.mdx

Lines changed: 122 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22
title: "Code"
33
description: "Display inline code and code blocks"
44
icon: "code"
5+
tag: "New"
56
---
67

7-
## Basic
8+
## Adding code samples
89

9-
### Inline Code
10+
You can add inline code snippets or code blocks. Code blocks support meta options for syntax highlighting, titles, line highlighting, icons, and more.
11+
12+
### Inline code
1013

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

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

17-
### Code Block
20+
### Code blocks
1821

19-
Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language.
22+
Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks. Specify the programming language for syntax highlighting and to enable meta options. Add any meta options, like a title or icon, after the language.
2023

21-
```java HelloWorld.java
24+
```java HelloWorld.java lines icon="java"
2225
class HelloWorld {
2326
public static void main(String[] args) {
2427
System.out.println("Hello, World!");
@@ -27,7 +30,7 @@ class HelloWorld {
2730
```
2831

2932
````mdx
30-
```java HelloWorld.java
33+
```java HelloWorld.java lines icon="java"
3134
class HelloWorld {
3235
public static void main(String[] args) {
3336
System.out.println("Hello, World!");
@@ -36,9 +39,24 @@ class HelloWorld {
3639
```
3740
````
3841

39-
## Syntax Highlighting
42+
## Code block options
43+
44+
You can add meta options to your code blocks to customize their appearance.
45+
46+
<Note>
47+
You must specify a programming language for a code block before adding any other meta options.
48+
</Note>
49+
50+
### Option syntax
51+
52+
- **String and boolean options**: Wrap with `""`, `''`, or no quotes.
53+
- **Expression options**: Wrap with `{}`, `""`, or `''`.
4054

41-
Enable syntax highlighting by adding the language name after the opening backticks of a code snippet.
55+
### Syntax highlighting
56+
57+
Enable syntax highlighting by specifying the programming language after the opening backticks of a code block.
58+
59+
We use Shiki for syntax highlighting and support all available languages. See the full list of [languages](https://shiki.style/languages) in Shiki's documentation.
4260

4361
```java
4462
class HelloWorld {
@@ -58,124 +76,39 @@ class HelloWorld {
5876
```
5977
````
6078

61-
### Languages
62-
63-
We use [Shiki](https://shiki.style/languages) for syntax highlighting and support these languages using standard markdown syntax:
64-
65-
<table className="border-collapse">
66-
<thead>
67-
<tr>
68-
<th className="pr-12 py-2 text-left font-medium">Language</th>
69-
<th className="pr-12 py-2 text-left font-medium">ID</th>
70-
</tr>
71-
</thead>
72-
<tbody>
73-
<tr>
74-
<td className="pr-12 py-2">Bash</td>
75-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">bash</code></td>
76-
</tr>
77-
<tr className="">
78-
<td className="pr-12 py-2">Laravel Blade</td>
79-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">blade</code></td>
80-
</tr>
81-
<tr>
82-
<td className="pr-12 py-2">C</td>
83-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">c</code></td>
84-
</tr>
85-
<tr className="">
86-
<td className="pr-12 py-2">C++</td>
87-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">c++</code></td>
88-
</tr>
89-
<tr>
90-
<td className="pr-12 py-2">C#</td>
91-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">c#</code></td>
92-
</tr>
93-
<tr className="">
94-
<td className="pr-12 py-2">Dart</td>
95-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">dart</code></td>
96-
</tr>
97-
<tr>
98-
<td className="pr-12 py-2">Go</td>
99-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">go</code></td>
100-
</tr>
101-
<tr className="">
102-
<td className="pr-12 py-2">Java</td>
103-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">java</code></td>
104-
</tr>
105-
<tr>
106-
<td className="pr-12 py-2">JavaScript</td>
107-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">javascript</code></td>
108-
</tr>
109-
<tr className="">
110-
<td className="pr-12 py-2">JSON</td>
111-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">json</code></td>
112-
</tr>
113-
<tr>
114-
<td className="pr-12 py-2">JSX</td>
115-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">jsx</code></td>
116-
</tr>
117-
<tr className="">
118-
<td className="pr-12 py-2">Kotlin</td>
119-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">kotlin</code></td>
120-
</tr>
121-
<tr>
122-
<td className="pr-12 py-2">Log</td>
123-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">log</code></td>
124-
</tr>
125-
<tr className="">
126-
<td className="pr-12 py-2">Markdown</td>
127-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">markdown</code></td>
128-
</tr>
129-
<tr>
130-
<td className="pr-12 py-2">PHP</td>
131-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">php</code></td>
132-
</tr>
133-
<tr className="">
134-
<td className="pr-12 py-2">Python</td>
135-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">python</code></td>
136-
</tr>
137-
<tr>
138-
<td className="pr-12 py-2">Ruby</td>
139-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">ruby</code></td>
140-
</tr>
141-
<tr className="">
142-
<td className="pr-12 py-2">Swift</td>
143-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">swift</code></td>
144-
</tr>
145-
<tr>
146-
<td className="pr-12 py-2">TypeScript</td>
147-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">typescript</code></td>
148-
</tr>
149-
<tr className="">
150-
<td className="pr-12 py-2">TSX</td>
151-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">tsx</code></td>
152-
</tr>
153-
<tr>
154-
<td className="pr-12 py-2">YAML</td>
155-
<td className="pr-12 py-2"><code className="px-1 rounded text-sm">yaml</code></td>
156-
</tr>
157-
</tbody>
158-
</table>
159-
160-
## Names
161-
162-
Add a title after the programming language to set the name of your code example. The text can be anything as long as its all in one line.
79+
### Title
80+
81+
Add a title to label your code example. Use `title="Your title"` or a string on a single line.
16382

16483
```javascript Code Block Example
16584
const hello = "world";
16685
```
16786

168-
````mdx Code Block Example
87+
````mdx
16988
```javascript Code Block Example
17089
const hello = "world";
17190
```
17291
````
17392

174-
## Line Highlighting
93+
### Icon
94+
95+
Add an icon to your code block. You can use [FontAwesome](https://fontawesome.com/icons) icons, [Lucide](https://lucide.dev/icons/) icons, or absolute URLs.
96+
97+
```javascript icon="square-js"
98+
const hello = "world";
99+
```
100+
101+
````mdx
102+
```javascript icon="square-js"
103+
const hello = "world";
104+
```
105+
````
106+
107+
### Line Highlighting
175108

176-
Highlight specific lines in your code blocks by adding a special comment after the language identifier. Use curly braces `{}` and specify line numbers or ranges separated by commas.
109+
Highlight specific lines in your code blocks using `highlight` with the line numbers or ranges you want to highlight.
177110

178-
```javascript Line Highlighting Example {1,3-5}
111+
```javascript Line Highlighting Example highlight= {1-2,5}
179112
const greeting = "Hello, World!";
180113
function sayHello() {
181114
console.log(greeting);
@@ -184,7 +117,7 @@ sayHello();
184117
```
185118

186119
````mdx
187-
```javascript Line Highlighting Example {1,3-5}
120+
```javascript Line Highlighting Example highlight={1-2,5}
188121
const greeting = "Hello, World!";
189122
function sayHello() {
190123
console.log(greeting);
@@ -193,11 +126,55 @@ sayHello();
193126
```
194127
````
195128

196-
## Expandable
129+
### Line focusing
197130

198-
If you have a long code block and `[expandable]` after your title to make it close and expand.
131+
Focus on specific lines in your code blocks using `focus` with line numbers or ranges.
199132

200-
```python library.py [expandable]
133+
```javascript Line Focus Example focus= {2,4-5}
134+
const greeting = "Hello, World!";
135+
function sayHello() {
136+
console.log(greeting);
137+
}
138+
sayHello();
139+
```
140+
141+
````mdx
142+
```javascript Line Focus Example focus={2,4-5}
143+
const greeting = "Hello, World!";
144+
function sayHello() {
145+
console.log(greeting);
146+
}
147+
sayHello();
148+
```
149+
````
150+
151+
### Show line numbers
152+
153+
Display line numbers on the left side of your code block using `lines`.
154+
155+
```javascript Show Line Numbers Example lines
156+
const greeting = "Hello, World!";
157+
function sayHello() {
158+
console.log(greeting);
159+
}
160+
sayHello();
161+
```
162+
163+
````mdx
164+
```javascript Show Line Numbers Example lines
165+
const greeting = "Hello, World!";
166+
function sayHello() {
167+
console.log(greeting);
168+
}
169+
sayHello();
170+
```
171+
````
172+
173+
### Expandable
174+
175+
Allow users to expand and collapse long code blocks using `expandable`.
176+
177+
```python Expandable Example expandable
201178
from datetime import datetime, timedelta
202179
from typing import Dict, List, Optional
203180
from dataclasses import dataclass
@@ -288,8 +265,33 @@ if __name__ == "__main__":
288265
```
289266

290267
````mdx
291-
```javascript Expandable Example [expandable]
292-
const greeting = "Hello, World!";
268+
```python Expandable Example expandable
269+
from datetime import datetime, timedelta
270+
from typing import Dict, List, Optional
271+
from dataclasses import dataclass
272+
273+
# ...
274+
275+
if __name__ == "__main__":
276+
main()
277+
```
278+
````
279+
280+
### Wrap
281+
282+
Enable text wrapping for long lines using `wrap`. This prevents horizontal scrolling and makes long lines easier to read.
283+
284+
```javascript Wrap Example wrap
285+
const greeting = "Hello, World! I am a long line of text that will wrap to the next line.";
286+
function sayHello() {
287+
console.log(greeting);
288+
}
289+
sayHello();
290+
```
291+
292+
````mdx
293+
```javascript Wrap Example wrap
294+
const greeting = "Hello, World! I am a long line of text that will wrap to the next line.";
293295
function sayHello() {
294296
console.log(greeting);
295297
}

guides/hidden-pages.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ description: "Exclude pages from your navigation"
44
icon: "eye-closed"
55
---
66

7-
Hidden pages are removed from your site's navigation while remaining publicly accessible to anyone who knows their URL.
7+
Hidden pages are removed from your site's navigation but remain publicly accessible to anyone who knows their URL.
88

9-
Use hidden pages for content that you want to be accessible on your site, but not discoverable through the navigation. For content requiring strict access control, you must configure [authentication](/authentication-personalization/authentication-setup).
9+
Use hidden pages for content that you want to be accessible on your site or referenced as context for AI tools, but not discoverable through the navigation.
10+
11+
For content requiring strict access control, you must configure [authentication](/authentication-personalization/authentication-setup).
1012

1113
If you want to hide pages for specific groups of users, use personalization to control [page visibility](/authentication-personalization/overview#page-visibility).
1214

@@ -18,14 +20,14 @@ A page is hidden if it is not included in your `docs.json` navigation. To hide a
1820
Some navigation elements like sidebars, dropdowns, and tabs may appear empty or shift layout on hidden pages.
1921
</Note>
2022

21-
## Search and SEO
23+
## Search, SEO, and AI context
2224

23-
By default, hidden pages are excluded from indexing for search engines and internal search within your docs. To include hidden pages in search results, add this setting to your `docs.json`:
25+
By default, hidden pages are excluded from indexing for search engines, internal search within your docs, and as context for the AI assistant. To include hidden pages in search results and as context for the assistant, add the `seo` property to your `docs.json`:
2426

2527
```json
26-
"seo" {
28+
"seo": {
2729
"indexing": "all"
2830
}
2931
```
3032

31-
To exclude a specific page from search, add `noindex: true` to its frontmatter.
33+
To exclude a specific page, add `noindex: "true"` to its frontmatter.

0 commit comments

Comments
 (0)