From 974bf2654756debe3fb4d08e9ae4c234cbe06883 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 16:25:12 +0000 Subject: [PATCH 01/60] feat: add zh-CN (Simplified Chinese) translations for docs product - Add translations config to docs.yml with en (default) and zh-CN - Create fern/translations/zh-CN/ directory with 128 translated MDX files - Translate all docs product pages: getting started, configuration, writing content, components, AI features, preview & publish, customization, localization, accessibility, API references, SEO, authentication, security, self-hosted, integrations, developer tools - Preserve all MDX component syntax, code blocks, links, and frontmatter - Add sidebar-title frontmatter for Chinese sidebar navigation - Bump fern CLI version from 4.62.3 to 4.104.0 for BCP 47 locale support Co-Authored-By: Deep Singhvi --- fern/docs.yml | 5 + fern/fern.config.json | 2 +- .../accessibility/keyboard-shortcuts.mdx | 60 + .../docs/pages/accessibility/overview.mdx | 34 + .../products/docs/pages/ai/ai-examples.mdx | 54 + .../ai/llms-txt/analytics-integration.mdx | 51 + .../pages/ai/llms-txt/customize-llms-txt.mdx | 126 + .../docs/pages/ai/llms-txt/directives.mdx | 29 + .../docs/pages/ai/llms-txt/overview.mdx | 86 + .../products/docs/pages/ai/mcp-server.mdx | 31 + .../zh-CN/products/docs/pages/ai/overview.mdx | 47 + .../zh-CN/products/docs/pages/ai/writer.mdx | 105 + .../pages/api-references/api-explorer.mdx | 70 + .../pages/api-references/api-ref-content.mdx | 127 + .../docs/pages/api-references/audiences.mdx | 31 + .../api-references/customize-api-ref.mdx | 465 ++++ .../pages/api-references/generate-api-ref.mdx | 107 + .../api-references/generate-graphql-ref.mdx | 84 + .../api-references/generate-grpc-ref.mdx | 78 + .../api-references/generate-openrpc-ref.mdx | 76 + .../api-references/generate-webhook-ref.mdx | 114 + .../api-references/generate-websocket-ref.mdx | 72 + .../pages/api-references/http-snippets.mdx | 73 + .../pages/api-references/library-docs.mdx | 154 ++ .../docs/pages/api-references/overview.mdx | 44 + .../pages/api-references/sdk-snippets.mdx | 163 ++ .../docs/pages/ask-fern/api-get-started.mdx | 18 + .../docs/pages/ask-fern/content-sources.mdx | 60 + .../products/docs/pages/ask-fern/guidance.mdx | 43 + .../docs/pages/ask-fern/search-widget.mdx | 113 + .../docs/pages/ask-fern/slack-app.mdx | 157 ++ .../docs/pages/ask-fern/what-is-ask-fern.mdx | 140 + .../authentication/api-key-injection.mdx | 105 + .../docs/pages/authentication/jwt-setup.mdx | 205 ++ .../docs/pages/authentication/oauth-setup.mdx | 158 ++ .../docs/pages/authentication/overview.mdx | 37 + .../docs/pages/authentication/password.mdx | 20 + .../docs/pages/authentication/rbac.mdx | 95 + .../docs/pages/authentication/sso.mdx | 41 + .../custom-components/reusable-markdown.mdx | 86 + .../default-components/accordions.mdx | 110 + .../default-components/anchor.mdx | 99 + .../default-components/aside.mdx | 19 + .../default-components/badges.mdx | 85 + .../default-components/button.mdx | 189 ++ .../default-components/callouts.mdx | 94 + .../default-components/cards.mdx | 276 ++ .../default-components/code-blocks.mdx | 667 +++++ .../default-components/copy.mdx | 45 + .../default-components/download.mdx | 66 + .../endpoint-request-snippet.mdx | 151 ++ .../endpoint-response-snippet.mdx | 91 + .../endpoint-schema-snippet.mdx | 115 + .../default-components/files.mdx | 267 ++ .../default-components/frames.mdx | 53 + .../default-components/icons.mdx | 105 + .../default-components/if.mdx | 97 + .../default-components/indent.mdx | 158 ++ .../default-components/overview.mdx | 193 ++ .../default-components/parameter-fields.mdx | 91 + .../default-components/runnable-endpoint.mdx | 52 + .../default-components/schema-snippet.mdx | 60 + .../default-components/schema.mdx | 69 + .../default-components/steps.mdx | 208 ++ .../default-components/tables.mdx | 544 ++++ .../default-components/tabs.mdx | 214 ++ .../default-components/tooltips.mdx | 216 ++ .../default-components/versions.mdx | 146 ++ .../webhook-payload-snippet.mdx | 20 + .../docs/pages/component-library/demo.mdx | 120 + .../writing-content/markdown-basics.mdx | 91 + .../writing-content/markdown-media.mdx | 232 ++ .../writing-content/visual-editor.mdx | 105 + .../customization/announcement-banner.mdx | 55 + .../pages/customization/css-selectors.mdx | 2264 +++++++++++++++++ .../pages/customization/custom-css-js.mdx | 421 +++ .../customization/custom-header-footer.mdx | 280 ++ .../customization/custom-react-components.mdx | 84 + .../pages/customization/embedded-mode.mdx | 29 + .../pages/customization/global-themes.mdx | 125 + .../customization/hiding-content-example.mdx | 10 + .../pages/customization/hiding-content.mdx | 137 + .../docs/pages/customization/search.mdx | 101 + .../pages/customization/user-feedback.mdx | 58 + .../pages/developer-tools/asyncapi-spec.mdx | 41 + .../auto-update-last-updated.mdx | 106 + .../docs/pages/developer-tools/cursor.mdx | 343 +++ .../docs/pages/developer-tools/gitlab.mdx | 144 ++ .../pages/developer-tools/openapi-spec.mdx | 41 + .../orchestrate-docs-releases.mdx | 99 + .../docs/pages/developer-tools/vale.mdx | 76 + .../pages/developer-tools/view-markdown.mdx | 20 + .../pages/getting-started/how-it-works.mdx | 143 ++ .../docs/pages/getting-started/overview.mdx | 165 ++ .../getting-started/project-structure.mdx | 212 ++ .../docs/pages/getting-started/quickstart.mdx | 357 +++ .../getting-started/self-service-setup.mdx | 133 + .../integrations/analytics/fullstory.mdx | 37 + .../pages/integrations/analytics/google.mdx | 79 + .../pages/integrations/analytics/mixpanel.mdx | 107 + .../pages/integrations/analytics/posthog.mdx | 45 + .../pages/integrations/analytics/segment.mdx | 29 + .../docs/pages/integrations/context7.mdx | 41 + .../docs/pages/integrations/feature-flags.mdx | 120 + .../docs/pages/integrations/overview.mdx | 119 + .../docs/pages/integrations/postman.mdx | 17 + .../pages/integrations/support/intercom.mdx | 47 + .../docs/pages/localization/overview.mdx | 108 + .../docs/pages/navigation/changelogs.mdx | 129 + .../docs/pages/navigation/frontmatter.mdx | 489 ++++ .../docs/pages/navigation/navigation.mdx | 296 +++ .../docs/pages/navigation/overview.mdx | 44 + .../docs/pages/navigation/products.mdx | 395 +++ .../pages/navigation/site-level-settings.mdx | 1050 ++++++++ .../products/docs/pages/navigation/tabs.mdx | 275 ++ .../docs/pages/navigation/versions.mdx | 216 ++ .../preview-changes-locally.mdx | 339 +++ .../preview-publish/publishing-your-docs.mdx | 206 ++ .../setting-up-your-domain.mdx | 232 ++ .../pages/resources/stainless-comparison.mdx | 162 ++ .../products/docs/pages/security/overview.mdx | 25 + .../self-hosted/health-check-endpoints.mdx | 88 + .../self-hosted-authentication.mdx | 294 +++ .../pages/self-hosted/self-hosted-set-up.mdx | 521 ++++ .../self-hosted/self-hosted-static-export.mdx | 172 ++ .../docs/pages/self-hosted/self-hosted.mdx | 103 + .../docs/pages/seo/configuring-slugs.mdx | 197 ++ .../products/docs/pages/seo/metadata.mdx | 281 ++ .../products/docs/pages/seo/overview.mdx | 49 + .../products/docs/pages/seo/redirects.mdx | 62 + 130 files changed, 20431 insertions(+), 1 deletion(-) create mode 100644 fern/translations/zh-CN/products/docs/pages/accessibility/keyboard-shortcuts.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/accessibility/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/ai-examples.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/llms-txt/analytics-integration.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/llms-txt/customize-llms-txt.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/llms-txt/directives.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/llms-txt/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/mcp-server.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ai/writer.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/api-explorer.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/api-ref-content.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/audiences.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/customize-api-ref.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/generate-api-ref.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/generate-graphql-ref.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/generate-grpc-ref.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/generate-openrpc-ref.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/generate-webhook-ref.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/generate-websocket-ref.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/http-snippets.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/library-docs.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/api-references/sdk-snippets.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ask-fern/api-get-started.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ask-fern/content-sources.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ask-fern/guidance.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ask-fern/search-widget.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ask-fern/slack-app.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/ask-fern/what-is-ask-fern.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/authentication/api-key-injection.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/authentication/jwt-setup.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/authentication/oauth-setup.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/authentication/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/authentication/password.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/authentication/rbac.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/authentication/sso.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/custom-components/reusable-markdown.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/accordions.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/anchor.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/aside.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/badges.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/button.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/callouts.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/cards.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/code-blocks.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/copy.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/download.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/endpoint-request-snippet.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/endpoint-response-snippet.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/endpoint-schema-snippet.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/files.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/frames.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/icons.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/if.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/indent.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/parameter-fields.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/runnable-endpoint.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/schema-snippet.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/schema.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/steps.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/tables.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/tabs.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/tooltips.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/versions.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/default-components/webhook-payload-snippet.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/demo.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/writing-content/markdown-basics.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/writing-content/markdown-media.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/component-library/writing-content/visual-editor.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/announcement-banner.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/css-selectors.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/custom-css-js.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/custom-header-footer.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/custom-react-components.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/embedded-mode.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/global-themes.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/hiding-content-example.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/hiding-content.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/search.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/customization/user-feedback.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/asyncapi-spec.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/auto-update-last-updated.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/cursor.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/gitlab.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/openapi-spec.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/orchestrate-docs-releases.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/vale.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/developer-tools/view-markdown.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/getting-started/how-it-works.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/getting-started/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/getting-started/project-structure.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/getting-started/quickstart.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/getting-started/self-service-setup.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/analytics/fullstory.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/analytics/google.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/analytics/mixpanel.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/analytics/posthog.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/analytics/segment.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/context7.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/feature-flags.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/postman.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/integrations/support/intercom.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/localization/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/changelogs.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/frontmatter.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/navigation.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/products.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/site-level-settings.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/tabs.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/navigation/versions.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/preview-publish/preview-changes-locally.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/preview-publish/publishing-your-docs.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/preview-publish/setting-up-your-domain.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/resources/stainless-comparison.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/security/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/self-hosted/health-check-endpoints.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/self-hosted/self-hosted-authentication.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/self-hosted/self-hosted-set-up.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/self-hosted/self-hosted-static-export.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/self-hosted/self-hosted.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/seo/configuring-slugs.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/seo/metadata.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/seo/overview.mdx create mode 100644 fern/translations/zh-CN/products/docs/pages/seo/redirects.mdx diff --git a/fern/docs.yml b/fern/docs.yml index 6c44eab2fc..769db2c970 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -10,6 +10,11 @@ instances: title: Fern Documentation +translations: + - lang: en + default: true + - lang: zh-CN + ai-search: location: - docs diff --git a/fern/fern.config.json b/fern/fern.config.json index c9d7305b4e..f14350ee36 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "fern", - "version": "4.62.3" + "version": "4.104.0" } diff --git a/fern/translations/zh-CN/products/docs/pages/accessibility/keyboard-shortcuts.mdx b/fern/translations/zh-CN/products/docs/pages/accessibility/keyboard-shortcuts.mdx new file mode 100644 index 0000000000..d4bf422d26 --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/accessibility/keyboard-shortcuts.mdx @@ -0,0 +1,60 @@ +--- +title: "键盘快捷键" +description: "了解 Fern 文档中的键盘快捷键,包括导航快捷键、搜索命令、Ask AI 面板控制和 API playground 快捷键。" +sidebar-title: "键盘快捷键" +--- + +Fern 文档包含用于导航、搜索和交互功能的内置键盘快捷键。 + +## 交互元素 + +| 操作 | 快捷键 | +|--------|----------| +| 在交互元素之间移动焦点 | `Tab` | +| 在交互元素之间向后移动焦点 | `Shift` + `Tab` | +| 激活[按钮](/learn/docs/writing-content/components/button)和[可展开部分](/learn/docs/writing-content/components/accordions) | `Enter` 或 `Space` | +| 关闭打开的对话框、面板和 API playground | `Escape` | +| 切换 Ask AI 面板 | `Command` + `/` (macOS)
`Ctrl` + `/` (Windows/Linux) | +| 切换 API playground/explorer | `Ctrl` + `` ` `` | + + +`Command`/`Ctrl` + `/` 快捷键不同于单个 `/` 键,后者用于打开常规[搜索对话框](#search)。 + + +## 导航 + +| 操作 | 快捷键 | +|--------|----------| +| 导航到上一页或下一页 | `Command` + `← / →` (macOS)
`Alt` + `← / →` (Windows/Linux) | +| 滚动到页面顶部或底部 | `Command` + `↑ / ↓` (macOS)
`Ctrl` + `↑ / ↓` (Windows/Linux) | + + +某些浏览器可能会拦截这些快捷键用于前进/后退历史记录导航。 + + +## 搜索 + +| 操作 | 快捷键 | +|--------|----------| +| 打开搜索对话框 | `Command` + `K` (macOS)
`Ctrl` + `K` (Windows/Linux) | +| 当焦点不在文本输入框中时打开搜索对话框 | `/`(正斜杠) | + + +当在输入框、`textarea` 或 `contenteditable` 元素中输入时,`/` 快捷键不会生效。 + + +在搜索对话框中: + +| 操作 | 快捷键 | +|--------|----------| +| 在搜索结果之间导航 | `方向键` | +| 选择搜索结果 | `Enter` | + +## 故障排除 + +如果键盘快捷键不起作用: + +- **浏览器冲突**:某些浏览器对自己的功能使用相同的快捷键(例如,`Command` + `← / →` 用于历史记录导航)。 +- **操作系统冲突**:您的操作系统可能会拦截某些键盘组合。请检查您的系统键盘设置。 +- **输入框中的焦点**:当在文本框中输入时,`/` 快捷键不会生效。请使用 `Command`/`Ctrl` + `K` 代替。 +- **扩展程序冲突**:浏览器扩展程序可能会覆盖键盘快捷键。请尝试禁用扩展程序。 \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/accessibility/overview.mdx b/fern/translations/zh-CN/products/docs/pages/accessibility/overview.mdx new file mode 100644 index 0000000000..5990e1347e --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/accessibility/overview.mdx @@ -0,0 +1,34 @@ +--- +title: "概述" +description: "了解 Fern 文档中的无障碍功能,包括键盘导航、网页内容无障碍指南 (WCAG) 2.1 AA 颜色对比度执行和屏幕阅读器支持。" +sidebar-title: "概述" +--- + + +Fern 文档使用语义化 HTML 和 [ARIA 属性](https://www.w3.org/WAI/standards-guidelines/aria/)来支持屏幕阅读器和键盘导航。 + + + 如需报告无障碍问题或建议改进,请联系 support@buildwithfern.com。 + + +## 键盘导航 + +所有交互元素都支持使用 `Tab`、`Enter` 和 `Space` 键进行键盘导航。请查看[键盘快捷键](/learn/docs/accessibility/keyboard-shortcuts#interactive-elements)了解完整列表。 + +## 对话框和面板 + +Fern 文档中的对话框和面板专为[键盘无障碍](/learn/docs/accessibility/keyboard-shortcuts#interactive-elements)而设计。焦点会被限制在打开的对话框内,防止导航到对话框外部,搜索对话框支持使用方向键进行完整的键盘导航。 + +## 颜色对比度 + +Fern 自动执行 [WCAG 2.1 AA](https://www.w3.org/WAI/WCAG21/quickref/#contrast-minimum) 颜色对比度比率,确保文本和交互元素对所有用户都是可读的: + +- **普通文本**: 最低 4.5:1 ([WCAG AA](https://www.w3.org/WAI/WCAG21/quickref/#contrast-minimum)) +- **UI 元素**: 最低 3:1 +- **增强**: 在可行时达到 7:1 ([WCAG AAA](https://www.w3.org/WAI/WCAG21/quickref/#contrast-enhanced)) + +当您[在 `docs.yml` 文件中配置颜色](/learn/docs/configuration/site-level-settings#colors-configuration)时,Fern 会验证主色调颜色。如果您的主色调颜色相对于背景颜色不满足最低对比度比率,Fern 将: + +1. 在 `fern check` 验证期间显示警告 +2. 在运行时自动调整主色调颜色以满足 WCAG AA 标准 +3. 在可能的情况下尝试进一步调整到 WCAG AAA (7:1) \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/ai-examples.mdx b/fern/translations/zh-CN/products/docs/pages/ai/ai-examples.mdx new file mode 100644 index 0000000000..258e0e99a6 --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/ai-examples.mdx @@ -0,0 +1,54 @@ +--- +title: AI 生成的示例 +description: 使用 Fern 的 AI 功能自动创建真实的 API 示例。根据需要自定义示例样式或禁用 AI 生成。 +sidebar-title: AI 生成的示例 +--- + +Fern 使用 AI 为您的 [API Reference](/learn/docs/api-references/overview) 文档自动生成真实的请求和响应示例。此功能默认为所有 API Reference 页面启用。您将获得反映端点属性和描述的可信数据,而不是像 `username: "string"` 这样的占位符值。示例会随着您的规范变化自动更新。 + +AI 示例与在 [`x-fern-examples`](/learn/api-definitions/openapi/extensions/request-response-examples) 中定义的手动示例一起工作,手动示例具有优先级。 + + + + + 带有占位符字符串值的 API Reference + + + + + 带有 AI 生成真实示例值的 API Reference + + + + +## 配置 + +自定义生成示例的样式: + +```yaml docs.yml +ai-examples: + style: "Use names and emails that are inspired by plants." +``` + +或完全禁用此功能: + +```yaml docs.yml +ai-examples: + enabled: false +``` + +AI 生成的示例将写入 `ai_examples_override.yml`。编辑此文件以自定义特定示例。要在每次构建时重新生成示例,请将该文件添加到 `.gitignore`: + +```txt .gitignore +**/ai_examples_override.yml +``` + + +要使 AI 生成的示例可移植到非 Fern OpenAPI 工具,请使用 [`fern api enrich`](/learn/cli-api-reference/cli-reference/commands#fern-api-enrich) 将它们合并到原生 OpenAPI 示例字段中。 + \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/analytics-integration.mdx b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/analytics-integration.mdx new file mode 100644 index 0000000000..50cee5f30b --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/analytics-integration.mdx @@ -0,0 +1,51 @@ +--- +title: 分析和集成 +description: 在 Fern Dashboard 中跟踪对您文档的 LLM 流量,并通过按钮和导航栏链接向读者展示 llms.txt 端点。 +sidebar-title: 分析和集成 +--- + +`llms.txt` 和 `llms-full.txt` 会自动为您的站点生成,但读者和 AI 工具如何发现它们取决于您。在 Fern Dashboard 中跟踪使用情况,并在您的文档中直接展示端点。 + +## 跟踪 LLM 流量 + +[Fern Dashboard](https://dashboard.buildwithfern.com/) 提供 `llms.txt` 使用分析,包括: +- 按 LLM 提供商(Claude、ChatGPT、Cursor 等)分类的流量 +- Markdown 和 `llms.txt` 文件的机器人与人工访问者的页面级明细 + +## 向读者展示端点 + +要让人类读者能够发现端点,请添加按钮或导航链接: + + + +为您的 SDK 文档添加一个按钮,链接到您 API Reference 的 `llms-full.txt`。使用 `lang` 将代码示例过滤为一种语言,使用 `excludeSpec=true` 排除原始 OpenAPI 规范。 + +```jsx Markdown + +``` + +这为用户提供了一个干净的、特定语言的输出,他们可以在编写代码时将其提供给 AI 工具。 + + + +在导航栏中添加一个下拉菜单,链接到 `llms-full.txt` 的不同过滤版本,让用户轻松访问其偏好语言的 LLM 优化文档。 + +```yaml docs.yml +navbar-links: + - type: dropdown + text: LLMs + icon: fa-solid fa-robot + links: + - text: 完整文档 + href: /llms-full.txt + - text: Python SDK + href: /api-reference/llms-full.txt?lang=python&excludeSpec=true + - text: TypeScript SDK + href: /api-reference/llms-full.txt?lang=typescript&excludeSpec=true + - text: Go SDK + href: /api-reference/llms-full.txt?lang=go&excludeSpec=true +``` + + \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/customize-llms-txt.mdx b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/customize-llms-txt.mdx new file mode 100644 index 0000000000..123253993a --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/customize-llms-txt.mdx @@ -0,0 +1,126 @@ +--- +title: 自定义 LLM 输出 +description: 使用 noindex 排除页面,使用 llms-only 和 llms-ignore 标签过滤内容,使用查询参数过滤端点输出,或提供您自己的自定义文件。 +sidebar-title: 自定义 LLM 输出 +--- + +通过使用 `` 和 `` 标签在页面内过滤内容、使用查询参数过滤端点输出、使用 `noindex` 排除页面或提供您自己的自定义文件来自定义 LLM 从您的站点接收的内容。 + +## 页面内过滤 + +在页面内,使用 `` 和 `` 标签来控制哪些内容暴露给 AI,哪些内容显示给文档站点上的人类读者。 + +### 仅供 AI 使用的内容 + +`` 内容仅出现在外部代理(如 Claude、ChatGPT 或 Cursor)直接获取的 LLM 服务端点上:`/llms.txt`、`/llms-full.txt` 和每个页面的 [`.md`/`.mdx` 源文件](/learn/docs/developer-tools/view-markdown)。它在所有面向人类的界面中都被隐藏,包括渲染页面、[复制页面](/learn/docs/configuration/site-level-settings#page-actions-configuration)、搜索组件和 [Ask Fern](/learn/docs/ai-features/ask-fern/overview)。 + +使用 `` 用于: +- 对 AI 有帮助但过于冗长的技术上下文,如实现细节或架构说明 +- 会使人类 UI 混乱的代码相关元数据 +- 帮助 AI 理解页面之间关系的交叉引用 + +### 仅供人类使用的内容 + +`` 内容出现在所有面向人类的界面上,包括渲染页面、[复制页面](/learn/docs/configuration/site-level-settings#page-actions-configuration)、搜索组件和 [Ask Fern](/learn/docs/ai-features/ask-fern/overview)(它会索引并像引用其他页面内容一样引用此内容)。它会从 LLM 服务端点(`/llms.txt`、`/llms-full.txt` 和每个页面的 `.md`/`.mdx` 源文件)中被移除。 + +使用 `` 用于: +- 营销 CTA 或推广内容 +- 仅供人类读者使用的导航提示 +- 应该仅保留在源文件中的内部注释 + +### 示例 + +Fern 自己的 [docs 快速开始](https://github.com/fern-api/docs/blob/main/fern/products/docs/pages/getting-started/quickstart.mdx) 将 GitHub UI 点击步骤与其 CLI 等效操作配对: + +````jsx quickstart.mdx wordWrap +使用 `fern-api/docs-starter` 仓库作为您站点的模板: + + +1. 导航到 [fern-api/docs-starter](https://github.com/fern-api/docs-starter) 并点击 **Use this template** 按钮(位于此页面右上角)。您必须登录 GitHub。 +2. 选择 **create a new repository** 选项。将其命名为 `fern-docs`。 +3. 克隆您新创建的仓库并在您喜欢的代码编辑器中打开它(例如,Cursor、VS Code)。 + + + +使用 GitHub CLI 从模板创建新仓库并在本地克隆它: + +```bash +gh repo create my-org/fern-docs --template fern-api/docs-starter --private --clone +cd fern-docs +``` + +将 `my-org/fern-docs` 替换为您期望的所有者和仓库名称。如果您想要公共仓库,请使用 `--public` 而不是 `--private`。 + +```` + +
+
+ 使用 `fern-api/docs-starter` 仓库作为您站点的模板: + + + 1. 导航到 [fern-api/docs-starter](https://github.com/fern-api/docs-starter) 并点击 **Use this template** 按钮(位于此页面右上角)。您必须登录 GitHub。 + 2. 选择 **create a new repository** 选项。将其命名为 `fern-docs`。 + 3. 克隆您新创建的仓库并在您喜欢的代码编辑器中打开它(例如,Cursor、VS Code)。 + + + + 使用 GitHub CLI 从模板创建新仓库并在本地克隆它: + + ```bash + gh repo create my-org/fern-docs --template fern-api/docs-starter --private --clone + cd fern-docs + ``` + + 将 `my-org/fern-docs` 替换为您期望的所有者和仓库名称。如果您想要公共仓库,请使用 `--public` 而不是 `--private`。 + +
+
+ +在文档站点上,人类读者只能看到编号的 UI 步骤 —— `` 块被隐藏。读取此页面 Markdown 输出的 LLM 看到的相反:没有 UI 步骤,只有它们可以实际运行的 `gh repo create` 命令。每个受众都得到他们可以执行的路径。 + +指导原则:**仅 UI 元素属于人类读者,而它们的程序化等效操作属于 AI 代理。** 将可点击的卡片和 UI 演练包装在 `` 中,这样代理会跳过它们,并为每个 UI 步骤配对一个 `` 块,提供 CLI 或 API 等效操作。 + +要预览和调试 AI 在任何页面上看到的内容,您可以在页面 URL 后添加 `.md` 或 `.mdx` 来[查看其 Markdown 源文件](/learn/docs/developer-tools/view-markdown)。 + +## 过滤端点输出 + +使用 `lang` 和 `excludeSpec` 查询参数过滤 `llms.txt` 和 `llms-full.txt` 输出以减少令牌使用量。参数也可以组合使用。 + +```txt Example +/llms.txt?lang=python +/llms-full.txt?excludeSpec=true +/llms-full.txt?lang=python&excludeSpec=true +``` + + + 将 SDK 代码示例过滤到特定语言。也接受常见别名:`javascript`、`typescript`、`js`、`ts`、`py` 和 `golang`。不区分大小写。 + + + + 排除 OpenAPI 和 AsyncAPI 规范部分。 + + +## 排除整个页面 + +您可以通过[在页面的 frontmatter 中添加 `noindex: true`](/learn/docs/seo/setting-seo-metadata#noindex) 来从 LLM 端点(`llms.txt` 和 `llms-full.txt`)中排除整个页面。标记为 `noindex` 的页面不会被搜索引擎索引,但在您的侧边栏导航中保持可见,仍然可以通过 URL 直接访问。要同时从导航中隐藏页面,请参阅[隐藏内容](/learn/docs/customization/hiding-content)。 + +```mdx docs/pages/internal-notes.mdx +--- +title: 内部说明 +noindex: true +--- +``` + +## 提供自定义文件 + +要提供您自己的 `llms.txt` 或 `llms-full.txt` 而不是自动生成的版本,请在 [`docs.yml` 中的 `agents` 键](/learn/docs/configuration/site-level-settings#agents-configuration)下指向您的文件: + +```yaml docs.yml +agents: + llms-txt: ./path/to/llms.txt + llms-full-txt: ./path/to/llms-full.txt +``` + +路径相对于 `docs.yml` 文件。CLI 会验证每个文件是否存在,并将其作为文档部署的一部分上传。您的自定义文件在根级别的 `/llms.txt` 和 `/llms-full.txt` 端点提供服务。嵌套路径(例如,`/api-reference/llms.txt`)继续使用自动生成的输出。 + +您可以提供一个或两个文件。任何您未指定的文件都会回退到自动生成的版本。 \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/directives.mdx b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/directives.mdx new file mode 100644 index 0000000000..f21d3a2551 --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/directives.mdx @@ -0,0 +1,29 @@ +--- +title: Agent 指令 +description: 配置提供给 AI agents 的每个页面默认预置指令,或使用自定义指令覆盖它。 +sidebar-title: Agent 指令 +--- + +提供给 AI agents 的每个页面都会自动预置一个默认指令,告诉 agents 如何以编程方式导航您的文档: + +```text title="默认页面指令" wordWrap +For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.example.com/llms.txt. For full documentation content, see https://docs.example.com/llms-full.txt. +``` + +指令中的 URL 是根据您网站的域名和基础路径生成的。指令在前言元数据部分之后但页面正文之前注入,因此即使 agents 截断页面的其余部分,它们也会首先看到指令。它适用于单个页面 Markdown(`.md`/`.mdx` URLs)和 `llms-full.txt` 中的每个页面部分,面向人类的文档不受影响。 + +## 自定义 agent 指令 + +要覆盖默认指令,请使用 [`docs.yml` 中的 `agents` 键](/learn/docs/configuration/site-level-settings#agents-configuration)设置自定义指令: + +```yaml docs.yml +agents: + page-directive: "For a complete page index, fetch https://docs.example.com/llms.txt" +``` + +要完全禁用指令,请将 `page-directive` 设置为空字符串: + +```yaml docs.yml +agents: + page-directive: "" +``` \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/overview.mdx b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/overview.mdx new file mode 100644 index 0000000000..3140acc84b --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/llms-txt/overview.mdx @@ -0,0 +1,86 @@ +--- +title: "`llms.txt` 和 `llms-full.txt`" +description: Fern 自动生成 llms.txt 和 llms-full.txt Markdown 文件,以便 AI 工具可以发现和索引您的文档。 +sidebar-title: "`llms.txt` 和 `llms-full.txt`" +--- + +[`llms.txt`](https://llmstxt.org/) 是一个向 AI 开发工具暴露网站内容的标准。Fern 实现了这个标准,自动生成和维护 `llms.txt` 和 `llms-full.txt` Markdown 文件,以便 AI 工具可以发现和索引您的文档。 + +Fern 还在任何页面 URL 上提供[干净的 Markdown 而不是 HTML](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation),当请求包含 `Accept: text/markdown` 头时,确保代理只接收它们需要的内容。这些功能结合在一起可以减少 90% 以上的 token 消耗。 + + + 使用 llms.txt 的示例 + + +## 生成的文件 + +Fern 为 LLM 生成两个文件: + +- **`llms.txt`** 包含您的文档站点的轻量级摘要,每个页面都提炼为一句话描述和 URL。对于有 API 端点的站点,它还链接到您的 [OpenAPI 规范](/learn/docs/developer-tools/openapi-spec) 作为独立的、机器可读的文件,以便 AI 工具可以直接解析您的完整 API 模式。对于有 WebSocket 通道的站点,它还链接到您的 [AsyncAPI 规范](/learn/docs/developer-tools/asyncapi-spec)。 + +- **`llms-full.txt`** 包含完整的文档内容,包括所有页面的全文。对于 API 文档,这包括您的完整 API 参考,带有已解析的 OpenAPI 规范和启用语言的 SDK 代码示例。 + +这两个文件都可以在您的文档层次结构的任何级别获得(`/llms.txt`、`/llms-full.txt`、`/docs/llms.txt`、`/docs/ai-features/llms-full.txt` 等)。 + +示例:[Eleven Labs llms.txt](https://elevenlabs.io/docs/llms.txt),[Cash App llms-full.txt](https://developers.cash.app/llms-full.txt)。 + +## 页面描述 + +这两个文件都包含从 [frontmatter](/learn/docs/configuration/page-level-settings) 提取的页面描述。Fern 使用 `description` 字段(如果存在),否则回退到 `subtitle`。 + +```mdx title="Frontmatter" +--- +title: Fern Docs +subtitle: Build beautiful documentation websites with Fern. +--- +``` + +输出格式取决于您是否请求单个页面或部分: + + + +`llms.txt` 和 `llms-full.txt` 返回相同的格式: + +```txt title=".../page/llms.txt and .../page/llms-full.txt" +# Fern Docs + +> Build beautiful documentation websites with Fern. +``` + + + +这两个文件不同: + + +```txt title=".../section/llms.txt" +- [Fern Docs](https://example.com/docs): Build beautiful documentation websites with Fern. +``` + +```txt title=".../section/llms-full.txt" +# Fern Docs + +> Build beautiful documentation websites with Fern. +``` + + + + +## 了解更多 + + + + + 排除页面、使用标签过滤内容或提供您自己的自定义文件。 + + + + 配置默认指令,该指令会添加到每个提供给 AI 代理的页面前面。 + + + 跟踪 LLM 流量并向读者暴露 `llms.txt` 端点。 + + \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/mcp-server.mdx b/fern/translations/zh-CN/products/docs/pages/ai/mcp-server.mdx new file mode 100644 index 0000000000..fb7af145aa --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/mcp-server.mdx @@ -0,0 +1,31 @@ +--- +title: MCP 服务器 +description: 连接 AI 客户端如 Claude Code 和 Cursor 到您的文档站点的 MCP 服务器,获取即时答案。 +sidebar-title: MCP 服务器 +--- + +Fern 会自动为每个启用了 [Ask Fern](/learn/docs/ai-features/ask-fern/overview) 的文档站点生成并托管一个生产就绪的 [Model Context Protocol (MCP)](https://modelcontextprotocol.io) 服务器。该服务器将 AI 客户端(如 Claude Code、Cursor 和 Windsurf)连接到您的文档作为外部数据源,这样开发者就可以直接在开发环境中获得关于您产品的即时答案。 + +您的 MCP 服务器位于 `your-documentation-site.com/_mcp/server`。例如,本站的 MCP 服务器位于 [https://buildwithfern.com/learn/_mcp/server](https://buildwithfern.com/learn/_mcp/server)。 + +## 从您的文档站点连接 + +[页面操作](/learn/docs/configuration/site-level-settings#page-actions-configuration)按钮让用户可以一键连接到您的 MCP 服务器: + +- **连接到 Claude Code** 会复制一个 `claude mcp add` 命令到剪贴板,用于注册服务器。 +- **连接到 Cursor** 会打开 Cursor 并预填服务器 URL,实现一键安装。 + +启用了 Ask Fern 的站点默认启用这两个按钮。对于其他客户端(Claude Desktop、Windsurf 等),用户可以将 `your-documentation-site.com/_mcp/server` 添加到他们的 MCP 配置中。 + +## AI 代理的直接 API 访问 + +AI 代理可以通过 HTTP 直接访问您的文档。Fern 以清洁的 Markdown 格式提供内容,以提高令牌效率。 + +对于需要身份验证的站点,代理可以通过 Fern API 密钥使用 [`/api/fern-docs/get-jwt`](/learn/docs/fern-api-reference/get-jwt) 获取 JWT,以访问受保护的文档内容和搜索功能。 + +```bash Access protected content +curl https://docs.example.com/platform/overview \ + -H 'Accept: text/plain' \ + -H 'x-fern-host: docs.example.com' \ + -H 'FERN_TOKEN: your-jwt-here' +``` \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/overview.mdx b/fern/translations/zh-CN/products/docs/pages/ai/overview.mdx new file mode 100644 index 0000000000..a35bac7a2b --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/overview.mdx @@ -0,0 +1,47 @@ +--- +title: AI 功能 +description: Fern AI 功能通过 llms.txt 支持,帮助用户即时找到答案、自动化内容更新,并为 AI 工具优化文档。 +sidebar-title: AI 功能 +--- + +您的文档站点自带 AI 工具的自动优化,以及可安装的功能来帮助用户找到答案并保持内容更新。 + + + + AI 功能基于使用量计费,会消耗积分。每个[套餐](https://buildwithfern.com/pricing)都包含月度积分配额:Hobby 套餐获得 250 积分,Pro 套餐获得 1,000 积分,Enterprise 套餐获得自定义数量。 + + | 功能 | 积分 | + | --- | --- | + | Ask Fern | 每条消息 2 积分 | + | AI 生成示例 | 1 积分 | + | Fern Writer 会话 | 50 积分 | + + + +## 查找答案 + +帮助用户在任何工作场所即时获得来自文档的引用答案。Ask Fern 可作为嵌入式聊天小部件、用于自定义集成的 [API](/learn/docs/ai-features/ask-fern/api-reference/overview),以及为您的社区提供的 [Slack 应用](/learn/docs/ai-features/ask-fern/slack-app)。对于在 Claude Code、Cursor 和 Windsurf 等 AI 客户端中工作的开发者,Fern 还提供 MCP 服务器,以便他们可以直接从开发环境查询您的文档。 + + + + + + + +## 创建和更新内容 + +AI 帮助保持文档的时效性。Fern Writer 是一个基于 Slack 的技术写作代理,当您标记 `@Fern Writer` 请求更新时,它会创建包含针对性编辑的拉取请求。对于 API 参考文档,Fern 会从您的 OpenAPI 规范自动生成真实的示例,这些示例与规范变更保持同步,用可信的数据替换像 `"string"` 这样的占位符值。 + + + + + + +## 为 AI 优化 + +您的站点会自动为 AI 工具和搜索引擎进行优化。Fern 托管 `llms.txt` 和 `llms-full.txt` 文件,以便 LLM 能够高效索引您的文档,并向 AI 代理提供 Markdown 而非 HTML。这些功能减少了 token 消耗,帮助代理更快地处理您的内容。 + + + + + \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/ai/writer.mdx b/fern/translations/zh-CN/products/docs/pages/ai/writer.mdx new file mode 100644 index 0000000000..990c969469 --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/ai/writer.mdx @@ -0,0 +1,105 @@ +--- +title: Fern Writer +description: 基于 Slack 的技术写作代理,通过 GitHub 拉取请求更新您的文档 +sidebar-title: Fern Writer +--- + +Fern Writer 是一个基于 Slack 的技术写作代理,可在您的产品发展过程中保持文档同步。它由 [Cognition 的 Devin](https://cognition.ai/blog/introducing-devin) 驱动。Fern Writer 理解 Fern 组件和您的写作风格,并可通过文档仓库中的 `AGENTS.md` 文件进行自定义。 + + + Fern Writer in Slack + + +## 工作原理 + +### 发起请求 + +在您已添加 Fern Writer 的 Slack 频道中,标记 `@Fern Writer` 并描述您需要的更改。Fern Writer [仅在被直接标记时响应](#隐私和数据处理)。它会对您的消息进行表情反应以确认收到,然后创建拉取请求并回复链接。 + + + Fern Writer opening a PR + + +Fern Writer 支持图片和文件附件以提供额外的上下文。当在现有对话串中被标记时,它会读取完整对话以理解上下文后再响应。 + +| 用例 | 示例请求 | +|----------|----------------| +| 为新功能编写文档(基于拉取请求) | `@Fern Writer 为 PR #123 中添加的新速率限制功能编写文档` | +| 向现有页面添加新内容 | `@Fern Writer 在 webhook 指南中添加关于 webhook 重试行为的章节` | +| 重新组织和整合内容 | `@Fern Writer 合并身份验证和授权页面,并从旧的认证页面添加重定向` | +| 修复错误并提高清晰度 | `@Fern Writer 修复快速开始中损坏的代码示例,并将包版本更新到 v2.1.0` | + + + + + +### 审查和合并 + +通过在 Slack 对话串中评论来请求更改。一旦 PR 满足您的要求,就像合并其他任何拉取请求一样合并它。 + +### 拉取请求归属 + + + Fern Writer PR attribution + + +每个拉取请求在描述中都包含一个 **请求者** 字段,将更改归属于发起请求的人员或团队。提交已签名并归属于 `fern-support`,确保自动更改与您仓库历史记录中的手动贡献明确区分。 + +## 设置 + + + Fern Writer 仅支持 GitHub。不支持 GitLab 和其他 Git 提供商。 + + +要开始使用 Fern Writer,请将其添加到您的 Slack 工作区(您必须是 Slack 管理员)并将其邀请到您的团队讨论文档的频道中。 + + + + +[获取您组织的专属 Slack 安装链接](/learn/docs/scribe-api/fern-writer-api/get-fern-writer-install-link)。提供: +- 您的 [Fern 令牌](/learn/cli-api-reference/cli-reference/commands#fern-token) +- 包含您文档的 GitHub 仓库,格式为 `owner/repo`(例如 `acme/docs`)。[Fern GitHub App](https://github.com/apps/fern-api) 必须安装在该仓库中。 + +您也可以使用此 cURL 请求: +```bash +curl -G https://fai.buildwithfern.com/scribe/slack/get-install \ + -H "Authorization: Bearer " \ + --data-urlencode github_repo= +``` + +访问响应中返回的 URL。 + + + +您将被重定向到 Slack 以授权 Fern Writer。选择您想添加 Fern Writer 的工作区并点击 **允许**。 + + + + +安装完成后,将 Fern Writer 添加到您团队讨论文档的 Slack 频道中。 + + + + +## 隐私和数据处理 + +Fern Writer 不会直接存储您的 Slack 消息。当您标记 `@Fern Writer` 或引用消息或对话串时,内容会存储在会话中以生成文档拉取请求。任务完成后不会保留会话数据。 + +无论是 Fern 还是 [Devin](https://docs.devin.ai/admin/security#how-is-your-data-used-to-improve-devin) 都不会使用您的数据来训练 AI 模型。Fern 明确配置其 Devin 集成以选择退出任何用于模型训练的数据收集。您的频道消息、代码和文档内容永远不会用于训练目的。有关其他详细信息,请参阅 Devin 关于 [Slack 集成安全性](https://docs.devin.ai/admin/security#integrating-with-slack) 的文档。 \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/api-references/api-explorer.mdx b/fern/translations/zh-CN/products/docs/pages/api-references/api-explorer.mdx new file mode 100644 index 0000000000..169b3df995 --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/api-references/api-explorer.mdx @@ -0,0 +1,70 @@ +--- +title: API 探索器 +subtitle: 通过允许用户直接在 API 参考文档中对您的 API 进行真实调用,来减少"获得 200 响应的时间"。 +sidebar-title: API 探索器 +--- + +Fern 的 API 探索器允许用户在不离开文档的情况下对您的 API 发起经过身份验证的请求。 + +## 使用示例自动填充 +Fern 将自动使用 API 规范中设置的值填充端点的字段。 + +
+ +## 身份验证 + +API 探索器支持在您的 OpenAPI 规范或 `generators.yml` 中配置的[所有身份验证方案](/learn/api-definitions/openapi/authentication),包括多种身份验证方案。当有多种方案可用时,API 探索器会自动在下拉菜单中显示它们,允许用户在发送请求之前选择并配置其首选的身份验证方法。 + +一旦用户设置了身份验证凭据,他们的凭据将在整个探索会话期间保持不变。 + +
+ + +身份验证凭据仅使用 cookie 存储在客户端。不会收集或存储任何敏感的用户信息。 + + +要为已登录用户自动填充 API 密钥,请参阅 [API 密钥注入](/learn/docs/authentication/features/api-key-injection)。 + +## 多环境 + +当在 [OpenAPI](/learn/api-definitions/openapi/extensions/server-names-and-url-templating) 或 [Fern Definition](/learn/api-definitions/ferndef/api-yml/environments) 中配置了多个服务器 URL 时,用户可以从 API 探索器的下拉菜单中在不同环境(例如,生产环境和沙盒环境)之间切换。所选环境在他们在页面之间导航时保持不变。 + +
+ +用户还可以双击服务器 URL 手动编辑它,允许快速测试自定义环境或端点。 + +这是配置了多个服务器名称的 [Flagright 文档网站](https://docs.flagright.com/framl-api/api-reference/api-reference/transactions/get) 示例。 + + + + + ```yaml + openapi: 3.0.0 + servers: + - url: https://sandbox.api.flagright.com + x-fern-server-name: Sandbox API server (eu-1) + - url: https://sandbox-asia-1.api.flagright.com + x-fern-server-name: Sandbox API server (asia-1) + ``` + + + + + ```yaml + environments: + Sandbox API server (eu-1): https://sandbox.api.flagright.com + Sandbox API server (asia-1): https://sandbox-asia-1.api.flagright.com + ``` + + + + +## WebSocket Playground + +对于支持 WebSocket 连接的 API,API 探索器包含一个 **WebSocket** 特定的 Playground。WebSocket Playground 还允许用户与 API 建立连接,并实时发送/接收消息。 + +
+ +## 控制 API 探索器可用性 + +对于 OpenAPI 规范,API 探索器默认为所有端点启用。您可以使用 [`x-fern-explorer`](/learn/api-definitions/openapi/extensions/api-explorer-control) 扩展全局或按端点禁用它。这通常用于禁用破坏性操作、支付处理或仅限管理员端点的探索器。 \ No newline at end of file diff --git a/fern/translations/zh-CN/products/docs/pages/api-references/api-ref-content.mdx b/fern/translations/zh-CN/products/docs/pages/api-references/api-ref-content.mdx new file mode 100644 index 0000000000..3f24fc5b74 --- /dev/null +++ b/fern/translations/zh-CN/products/docs/pages/api-references/api-ref-content.mdx @@ -0,0 +1,127 @@ +--- +title: 在 API Reference 中编写 Markdown 内容 +description: 在 API 文档中编写丰富的 Markdown 内容。为端点添加描述,创建摘要页面,并自定义您的 API Reference 布局。 +sidebar-title: 编写 Markdown 内容 +--- + + +Fern Docs 允许您在 API Reference 文档中编写 Markdown 内容。此功能对于为 API 端点提供额外的上下文、示例或说明非常有用。 + +## 为端点添加 Markdown 内容 + +您可以使用 `description` 字段(OpenAPI)或 `docs` 字段(Fern Definition)在 API 定义中包含 Markdown 内容。这包括标注、代码块和[其他组件](/learn/docs/writing-content/components/overview)。 + +您还可以使用 `