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
26 changes: 26 additions & 0 deletions components/view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</Tip>

<View title="JavaScript" icon="js">
This content is only visible when JavaScript is selected.

Check warning on line 14 in components/view.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

components/view.mdx#L14

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

```javascript
console.log("Hello from JavaScript!");
Expand All @@ -19,7 +19,7 @@
</View>

<View title="Python" icon="python">
This content is only visible when Python is selected.

Check warning on line 22 in components/view.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

components/view.mdx#L22

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

```python
print("Hello from Python!")
Expand All @@ -38,7 +38,7 @@
</View>

<View title="Python" icon="python">
This content is only visible when Python is selected.

Check warning on line 41 in components/view.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

components/view.mdx#L41

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

```python
print("Hello from Python!")
Expand All @@ -46,6 +46,32 @@
</View>
````

## Deep links

Each view automatically gets a URL-friendly ID based on its title. You can link directly to a specific view or to content inside a view using anchor links.

### Link to a view

Append the view's slugified title as a URL hash to activate that view on page load:

```text
https://your-docs-url/page-path#javascript
```

When a user visits this URL, the corresponding view activates automatically.

### Link to content inside a view

You can also link to headings or other anchored elements inside a view. When the URL hash matches an element inside a specific view, that view activates and the page scrolls to the element:

```text
https://your-docs-url/page-path#install-the-sdk
```

### URL hash updates

When a user switches views using the dropdown, the URL hash updates to reflect the selected view. This means users can share or bookmark the current view state.

## Table of contents behavior

The table of contents automatically updates to show only the headings for the currently selected view. When you switch between views using the multi-view dropdown, the table of contents refreshes to display the relevant headings for that view.
Expand Down
28 changes: 28 additions & 0 deletions es/components/view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,34 @@ Usa el componente `View` para crear contenido que cambie según la vista selecci
</View>
````

<div id="deep-links">
## Enlaces profundos
</div>

Cada vista obtiene automáticamente un ID compatible con URL basado en su título. Puedes enlazar directamente a una vista específica o a contenido dentro de una vista usando enlaces de anclaje.

### Enlazar a una vista

Agrega el título slugificado de la vista como hash de URL para activar esa vista al cargar la página:

```text
https://tu-url-de-docs/ruta-de-pagina#javascript
```

Cuando un usuario visita esta URL, la vista correspondiente se activa automáticamente.

### Enlazar a contenido dentro de una vista

También puedes enlazar a encabezados u otros elementos anclados dentro de una vista. Cuando el hash de la URL coincide con un elemento dentro de una vista específica, esa vista se activa y la página se desplaza hasta el elemento:

```text
https://tu-url-de-docs/ruta-de-pagina#instalar-el-sdk
```

### Actualización del hash de la URL

Cuando un usuario cambia de vista usando el menú desplegable, el hash de la URL se actualiza para reflejar la vista seleccionada. Esto permite a los usuarios compartir o guardar en favoritos el estado actual de la vista.

<div id="table-of-contents-behavior">
## Comportamiento de la tabla de contenidos
</div>
Expand Down
28 changes: 28 additions & 0 deletions fr/components/view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,34 @@ Utilisez le composant `View` pour créer du contenu qui change en fonction de la
</View>
````

<div id="deep-links">
## Liens profonds
</div>

Chaque vue obtient automatiquement un identifiant compatible avec les URL basé sur son titre. Vous pouvez créer un lien direct vers une vue spécifique ou vers du contenu à l'intérieur d'une vue en utilisant des liens d'ancrage.

### Lier à une vue

Ajoutez le titre slugifié de la vue comme hash d'URL pour activer cette vue au chargement de la page :

```text
https://votre-url-docs/chemin-de-page#javascript
```

Lorsqu'un utilisateur visite cette URL, la vue correspondante s'active automatiquement.

### Lier à du contenu à l'intérieur d'une vue

Vous pouvez également lier à des titres ou d'autres éléments ancrés à l'intérieur d'une vue. Lorsque le hash de l'URL correspond à un élément à l'intérieur d'une vue spécifique, cette vue s'active et la page défile jusqu'à l'élément :

```text
https://votre-url-docs/chemin-de-page#installer-le-sdk
```

### Mise à jour du hash de l'URL

Lorsqu'un utilisateur change de vue via le menu déroulant, le hash de l'URL est mis à jour pour refléter la vue sélectionnée. Cela permet aux utilisateurs de partager ou de mettre en favoris l'état actuel de la vue.

<div id="table-of-contents-behavior">
## Comportement de la table des matières
</div>
Expand Down
16 changes: 16 additions & 0 deletions guides/linking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@

This accordion is reachable at `#install` instead of the auto-generated `#installation-steps`. See [Accordions](/components/accordions) for more.

### View deep links

When you use `View` components on a page, each view automatically gets a URL-friendly ID based on its title. Link directly to a specific view using the hash:

```text
https://your-docs-url/page-path#python
```

You can also link to headings or other anchored elements inside a view. The correct view activates automatically and the page scrolls to the target:

```text
https://your-docs-url/page-path#install-the-sdk
```

When a user switches views using the dropdown, the URL hash updates to match the selected view. See [View](/components/view#deep-links) for more details.

### API playground deep links

To open the API playground in a link, append `?playground=open` to any endpoint page URL:
Expand Down Expand Up @@ -125,7 +141,7 @@

### Link prerequisites explicitly

When a page assumes prior steps, link to them at the top rather than assuming users will find them:

Check warning on line 144 in guides/linking.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/linking.mdx#L144

Avoid using 'will'.

```mdx
## Prerequisites
Expand All @@ -139,7 +155,7 @@

### Build topic clusters

Link related content together to help users—and search engines—understand how your documentation is organized:

Check warning on line 158 in guides/linking.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/linking.mdx#L158

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

```mdx
## Related topics
Expand Down Expand Up @@ -196,7 +212,7 @@
</Accordion>

<Accordion title="What happens to bookmarked links when I reorganize my documentation?">
Without redirects, bookmarked and shared links become 404 errors. Set up redirects in your `docs.json` whenever you move or rename a page. Redirects are cheap to add and prevent a poor user experience for anyone who linked to your documentation from an external source—blog posts, Stack Overflow answers, internal wikis.

Check warning on line 215 in guides/linking.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/linking.mdx#L215

Use the Oxford comma in 'Without redirects, bookmarked and'.
</Accordion>

<Accordion title="How many internal links should a page have?">
Expand Down
28 changes: 28 additions & 0 deletions zh/components/view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,34 @@ keywords: ["选择器", "特定语言内容", "内容切换"]
</View>
````

<div id="deep-links">
## 深度链接
</div>

每个视图会根据其标题自动生成一个 URL 友好的 ID。你可以使用锚点链接直接链接到特定视图或视图内的内容。

### 链接到视图

将视图的 slugified 标题作为 URL hash 附加,即可在页面加载时激活该视图:

```text
https://你的文档地址/页面路径#javascript
```

当用户访问此 URL 时,对应的视图会自动激活。

### 链接到视图内的内容

你还可以链接到视图内的标题或其他锚点元素。当 URL hash 匹配某个视图内的元素时,该视图会自动激活并滚动到目标元素:

```text
https://你的文档地址/页面路径#安装-sdk
```

### URL hash 更新

当用户通过下拉菜单切换视图时,URL hash 会更新以反映当前选中的视图。这意味着用户可以分享或收藏当前的视图状态。

<div id="table-of-contents-behavior">
## 目录行为
</div>
Expand Down
Loading