From d7aaf3d18b14c21204420496966affa4e6fd5c67 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 01:30:31 +0000 Subject: [PATCH] Document deep link support for View component Generated-By: mintlify-agent --- components/view.mdx | 26 ++++++++++++++++++++++++++ es/components/view.mdx | 28 ++++++++++++++++++++++++++++ fr/components/view.mdx | 28 ++++++++++++++++++++++++++++ guides/linking.mdx | 16 ++++++++++++++++ zh/components/view.mdx | 28 ++++++++++++++++++++++++++++ 5 files changed, 126 insertions(+) diff --git a/components/view.mdx b/components/view.mdx index 4c4969bdf..5606f7172 100644 --- a/components/view.mdx +++ b/components/view.mdx @@ -46,6 +46,32 @@ Use the `View` component to create content that changes based on the selected vi ```` +## 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. diff --git a/es/components/view.mdx b/es/components/view.mdx index 27a80a6a6..14f5cdf8a 100644 --- a/es/components/view.mdx +++ b/es/components/view.mdx @@ -48,6 +48,34 @@ Usa el componente `View` para crear contenido que cambie según la vista selecci ```` + + +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. +
## Comportamiento de la tabla de contenidos
diff --git a/fr/components/view.mdx b/fr/components/view.mdx index 07e624145..65db961ca 100644 --- a/fr/components/view.mdx +++ b/fr/components/view.mdx @@ -48,6 +48,34 @@ Utilisez le composant `View` pour créer du contenu qui change en fonction de la ```` + + +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. +
## Comportement de la table des matières
diff --git a/guides/linking.mdx b/guides/linking.mdx index 3b688caef..bcd3772a1 100644 --- a/guides/linking.mdx +++ b/guides/linking.mdx @@ -84,6 +84,22 @@ By default, the hash derives from the accordion's `title`. Use the `id` property 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: diff --git a/zh/components/view.mdx b/zh/components/view.mdx index 9ccfa906c..f608a7307 100644 --- a/zh/components/view.mdx +++ b/zh/components/view.mdx @@ -48,6 +48,34 @@ keywords: ["选择器", "特定语言内容", "内容切换"] ```` + + +每个视图会根据其标题自动生成一个 URL 友好的 ID。你可以使用锚点链接直接链接到特定视图或视图内的内容。 + +### 链接到视图 + +将视图的 slugified 标题作为 URL hash 附加,即可在页面加载时激活该视图: + +```text +https://你的文档地址/页面路径#javascript +``` + +当用户访问此 URL 时,对应的视图会自动激活。 + +### 链接到视图内的内容 + +你还可以链接到视图内的标题或其他锚点元素。当 URL hash 匹配某个视图内的元素时,该视图会自动激活并滚动到目标元素: + +```text +https://你的文档地址/页面路径#安装-sdk +``` + +### URL hash 更新 + +当用户通过下拉菜单切换视图时,URL hash 会更新以反映当前选中的视图。这意味着用户可以分享或收藏当前的视图状态。 +
## 目录行为