Skip to content
Open
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
8 changes: 8 additions & 0 deletions customize/custom-scripts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
- `contextual-feedback-form-submit-button`: Submit button for the contextual feedback form.
</Accordion>
<Accordion title="Code snippet feedback">
- `code-snippet-feedback-popover-content`: Popover content for code snippet feedback.

Check warning on line 272 in customize/custom-scripts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

customize/custom-scripts.mdx#L272

Use 'popover' instead of 'Popover'.
- `code-snippet-feedback-form`: Feedback form for a code snippet.
- `code-snippet-feedback-textarea`: Text area within the code snippet feedback form.
- `code-snippet-feedback-form-title`: Title of the code snippet feedback form.
Expand Down Expand Up @@ -363,6 +363,14 @@

Mintlify includes any `.js` file inside your content directory on every page of your site. Custom JavaScript files run after the page becomes interactive. You cannot scope them to specific pages. When you include multiple `.js` files, they run without a guaranteed order.

To run code only on certain pages, branch on the current path inside your script. Mintlify sets `data-current-path` on `<html>` and updates it on client-side navigation, so it stays in sync during SPA transitions:

Check warning on line 366 in customize/custom-scripts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

customize/custom-scripts.mdx#L366

Spell out 'SPA', if it's unfamiliar to the audience.

```js Example per-page script
if (document.documentElement.dataset.currentPath?.startsWith('/api-reference/')) {
// Run only on pages under /api-reference/.
}
```

To load a third-party script, inject a `<script>` element from your custom JavaScript file instead of adding raw `<script src="...">` tags in MDX:

```js Example third-party script
Expand Down Expand Up @@ -416,7 +424,7 @@

If your site uses [authentication](/deploy/authentication-setup) or [personalization](/create/personalization), custom scripts can read the identified visitor from `window.mintlify.user`. This is the same object exposed to MDX pages as the [`user` variable](/create/personalization#dynamic-mdx-content), so it reflects the `content` field of your user data.

Because custom scripts run before user info resolves, listen for the `mintlify:user` event to identify when the user object is available. The event fires when user info resolves and again on any change. Its `detail` is the user object, or `null` when the visitor is signed out or unidentified.

Check warning on line 427 in customize/custom-scripts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

customize/custom-scripts.mdx#L427

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

```js Read the user after it resolves
window.addEventListener('mintlify:user', (event) => {
Expand All @@ -436,7 +444,7 @@
}
```

`window.mintlify.user` is `undefined` until user info resolves and when the visitor is signed out or unidentified. Use optional chaining when reading nested fields.

Check warning on line 447 in customize/custom-scripts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

customize/custom-scripts.mdx#L447

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

<Warning>
Client-side scripts can access anything you place in the user `content` field. Do not include secrets or credentials that shouldn't be readable in the browser.
Expand Down
2 changes: 1 addition & 1 deletion editor/pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ When editing a code block in visual mode, you can:
- **Move**: Drag and drop pages to reorder them in navigation.
- **Rename**: Right-click a page and select **Rename**.
- **Duplicate**: Right-click a page and select **Duplicate**.
- **Delete**: Right-click a page and select **Delete**. The editor removes the page from navigation automatically.
- **Delete**: Right-click a page and select **Delete**. The editor removes the page from navigation automatically. To recover a deleted page, revert the delete commit in your Git provider, then reload the editor.

### Move private pages to the workspace

Expand Down
2 changes: 1 addition & 1 deletion editor/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@
using its relative path.
```

### Main branch autocommits

Check warning on line 85 in editor/settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/settings.mdx#L85

Did you really mean 'autocommits'?

When you enable main branch autocommits, the editor commits changes shortly after you stop typing.

Check warning on line 87 in editor/settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/settings.mdx#L87

Did you really mean 'autocommits'?

Use this setting when your team edits the deployment branch directly and wants updates to reach Git without a manual publish step. If you want to review changes before they publish to your sire, do not use autocommits.
Use this setting when your team edits the deployment branch directly and wants updates to reach Git without a manual publish step. If you want to review changes before they publish to your site, do not use autocommits.

Check warning on line 89 in editor/settings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

editor/settings.mdx#L89

Did you really mean 'autocommits'?

Edits on feature branches created from the editor autocommit regardless of this setting. Changes on a feature branch never publish unless you merge them into your deployment branch.

Expand Down
8 changes: 8 additions & 0 deletions es/customize/custom-scripts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ El JavaScript personalizado te permite agregar código ejecutable a nivel global

Mintlify incluye cualquier archivo `.js` dentro de tu directorio de contenido en cada página de tu sitio de documentación, incluidas las páginas en modo personalizado y las páginas de aterrizaje. Los archivos JavaScript personalizados se ejecutan después de que la página se vuelve interactiva. No puedes limitarlos a páginas específicas y, cuando hay varios archivos `.js` presentes, todos se ejecutan sin un orden garantizado.

Para ejecutar código solo en ciertas páginas, evalúa la ruta actual dentro de tu script. Mintlify establece `data-current-path` en `<html>` y lo actualiza durante la navegación del lado del cliente, por lo que permanece sincronizado en las transiciones SPA:

```js Example per-page script
if (document.documentElement.dataset.currentPath?.startsWith('/api-reference/')) {
// Run only on pages under /api-reference/.
}
```

Para cargar un script de terceros, inyecta un elemento `<script>` desde tu archivo JavaScript personalizado en lugar de agregar etiquetas `<script src="...">` directamente en MDX:

```js
Expand Down
2 changes: 1 addition & 1 deletion es/editor/pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Al editar un bloque de código en modo visual, puede:
- **Mover**: Arrastre y suelte las páginas para reordenarlas en la navegación.
- **Renombrar**: Haga clic con el botón derecho en una página y seleccione **Rename**.
- **Duplicar**: Haga clic con el botón derecho en una página y seleccione **Duplicate**.
- **Eliminar**: Haga clic con el botón derecho en una página y seleccione **Delete**. El editor quita la página de la navegación automáticamente.
- **Eliminar**: Haga clic con el botón derecho en una página y seleccione **Delete**. El editor quita la página de la navegación automáticamente. Para recuperar una página eliminada, revierta el commit de eliminación en su proveedor de Git y vuelva a cargar el editor.

### Mover páginas privadas al workspace

Expand Down
2 changes: 1 addition & 1 deletion es/guides/knowledge-base.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Configura el assistant desde tu [dashboard](https://dashboard.mintlify.com/produ
### Agrega el assistant a Slack
</div>

El [bot de Slack](/es/ai/slack-bot) permite que tu equipo le haga preguntas al assistant sin salir de Slack. Crea un canal donde el bot responda a cada mensaje o deja que las personas mencionen al bot con @ en cualquier canal.
El [agente de Mintlify en Slack](/es/agent/slack) permite que tu equipo haga preguntas sobre tu base de conocimiento sin salir de Slack. Instala el agente y, después, envíale un mensaje directo o menciónalo con `@mention` en cualquier canal para obtener una respuesta con citas de las fuentes.

<div id="enable-team-contributions">
## Permitir contribuciones del equipo
Expand Down
8 changes: 8 additions & 0 deletions fr/customize/custom-scripts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ Le JavaScript personnalisé vous permet d'ajouter du code exécutable personnali

Mintlify inclut tout fichier `.js` situé dans le répertoire de contenu de votre documentation dans chaque page de votre site de documentation, y compris les pages en mode personnalisé et les pages d'accueil. Les fichiers JavaScript personnalisés s'exécutent une fois que la page devient interactive. Vous ne pouvez pas les limiter à des pages spécifiques, et lorsque plusieurs fichiers `.js` sont présents, ils s'exécutent tous sans ordre garanti.

Pour n'exécuter du code que sur certaines pages, testez le chemin courant depuis votre script. Mintlify définit `data-current-path` sur `<html>` et le met à jour lors de la navigation côté client, afin qu'il reste synchronisé pendant les transitions SPA :

```js Example per-page script
if (document.documentElement.dataset.currentPath?.startsWith('/api-reference/')) {
// Run only on pages under /api-reference/.
}
```

Pour charger un script tiers, injectez un élément `<script>` depuis votre fichier JavaScript personnalisé plutôt que d'ajouter des balises `<script src="...">` brutes en MDX :

```js
Expand Down
2 changes: 1 addition & 1 deletion fr/editor/pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Lors de l'édition d'un bloc de code en mode visuel, vous pouvez :
- **Déplacer** : Faites glisser-déposer les pages pour les réorganiser dans la navigation.
- **Renommer** : Faites un clic droit sur une page et sélectionnez **Rename**.
- **Dupliquer** : Faites un clic droit sur une page et sélectionnez **Duplicate**.
- **Supprimer** : Faites un clic droit sur une page et sélectionnez **Delete**. L'éditeur retire automatiquement la page de la navigation.
- **Supprimer** : Faites un clic droit sur une page et sélectionnez **Delete**. L'éditeur retire automatiquement la page de la navigation. Pour récupérer une page supprimée, annulez le commit de suppression chez votre fournisseur Git, puis rechargez l'éditeur.

### Déplacer les pages privées vers l'espace de travail

Expand Down
2 changes: 1 addition & 1 deletion fr/guides/knowledge-base.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Configurez l’Assistant depuis votre [dashboard](https://dashboard.mintlify.com
### Ajouter l&#39;Assistant à Slack
</div>

Le [bot Slack](/fr/ai/slack-bot) permet à votre équipe de poser des questions à l&#39;Assistant directement dans Slack. Créez un canal dans lequel le bot répond à chaque message ou laissez les membres de l&#39;équipe mentionner le bot avec @ dans n&#39;importe quel canal.
L'[agent Mintlify dans Slack](/fr/agent/slack) permet à votre équipe de poser des questions sur votre base de connaissances sans quitter Slack. Installez l'agent, puis envoyez-lui un message direct ou mentionnez-le avec `@mention` dans n'importe quel canal pour obtenir une réponse avec citations des sources.

<div id="enable-team-contributions">
## Activer les contributions de l’équipe
Expand Down
2 changes: 1 addition & 1 deletion guides/knowledge-base.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

### Add the assistant to Slack

The [Slack bot](/ai/slack-bot) lets your team ask the assistant questions without leaving Slack. Create a channel where the bot responds to every message or let people @mention the bot in any channel.
The [Mintlify agent in Slack](/agent/slack) lets your team ask questions about your knowledge base without leaving Slack. Install the agent, then direct-message it or `@mention` it in any channel to get an answer with source citations.

## Enable team contributions

Expand Down Expand Up @@ -264,7 +264,7 @@
</Step>

<Step title="Monitor usage metrics">
Review how your team uses the knowledge base to prioritize content and identify areas for improvement. Set a regular cadence for reviewing usage metrics—monthly or quarterly are good intervals.

Check warning on line 267 in guides/knowledge-base.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/knowledge-base.mdx#L267

Did you really mean 'orit'?

- Which articles get the most views? Invest in keeping these accurate and easy to read.
- Which articles get no views? Consider removing them or improving discoverability.
Expand Down
8 changes: 8 additions & 0 deletions zh/customize/custom-scripts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ Mintlify 提供两种类型的 CSS 定位钩子:

Mintlify 会将文档站点的 content 目录中的任何 `.js` 文件注入到每个文档页面,包括自定义模式页面和落地页。自定义 JavaScript 文件会在页面变为可交互后运行,无法将其作用范围限定到特定页面;当存在多个 `.js` 文件时,它们都会执行,但执行顺序无法保证。

若只想在特定页面上运行代码,请在脚本中根据当前路径进行判断。Mintlify 会在 `<html>` 上设置 `data-current-path`,并在客户端导航时更新它,因此在 SPA 切换过程中它始终保持同步:

```js Example per-page script
if (document.documentElement.dataset.currentPath?.startsWith('/api-reference/')) {
// Run only on pages under /api-reference/.
}
```

若要加载第三方脚本,请从你的自定义 JavaScript 文件中注入 `<script>` 元素,而不是在 MDX 中直接添加原始的 `<script src="...">` 标签:

```js
Expand Down
2 changes: 1 addition & 1 deletion zh/editor/pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Restore 会将所选快照应用到当前页面。对于公开页面,它会恢
### 删除页面
</div>

右键点击页面并选择 **Delete**。删除页面后,它会自动从导航中移除。
右键点击页面并选择 **Delete**。删除页面后,它会自动从导航中移除。若要恢复已删除的页面,请在你的 Git 提供商中回滚该删除提交,然后重新加载编辑器。

<div id="hide-pages">
### 隐藏页面
Expand Down
2 changes: 1 addition & 1 deletion zh/guides/knowledge-base.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ AI 助手会自动为 Pro 和 Enterprise 套餐启用。AI 助手让你的团队
### 将 AI 助手添加到 Slack
</div>

[Slack 机器人](/zh/ai/slack-bot) 让你的团队无需离开 Slack 就能向 AI 助手提问。你可以创建一个频道,让机器人回复其中的每一条消息,或者让团队成员在任意频道中通过 @ 提及该机器人来获取回复
[Slack 中的 Mintlify 智能代理](/zh/agent/slack)让你的团队无需离开 Slack 就能向知识库提问。安装该代理后,直接向它发送私信,或在任意频道中使用 `@mention` 提及它,即可获得带有来源引用的答复

<div id="enable-team-contributions">
## 启用团队共建
Expand Down