diff --git a/CLAUDE.md b/CLAUDE.md index a0f0ffa0..81e0cfaa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -62,7 +62,7 @@ title: 'Page Title' id: category_filename # 例:quote_pull-static slug: '/quote/pull/static' # 以 / 开头,对应 URL 路径 sidebar_position: 3 # 数字越小越靠前 -sidebar_icon: book # 可选:book | zap | cpu | terminal | sparkles +sidebar_icon: book # 可选:book_open | book | zap | cpu | terminal | sparkles --- ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e4c5e15..a51e9f82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,10 +66,10 @@ Every `.md` file requires frontmatter: ```yaml --- title: 'Page Title' -id: category_file-name # e.g., quote_pull-static -slug: '/quote/pull/static' # must start with /, matches the URL path -sidebar_position: 3 # lower = higher in sidebar -sidebar_icon: book # optional: book | zap | cpu | terminal | sparkles +id: category_file-name # e.g., quote_pull-static +slug: '/quote/pull/static' # must start with /, matches the URL path +sidebar_position: 3 # lower = higher in sidebar +sidebar_icon: book # optional: book_open | book | zap | cpu | terminal | sparkles --- ``` @@ -96,9 +96,11 @@ The sidebar is **auto-generated** from the filesystem by `docs/.vitepress/theme/ ```markdown + ![diagram](../../static/diagram.png) + ![diagram](https://pub.pbkrs.com/files/xxx/diagram.png) ``` @@ -106,14 +108,14 @@ The sidebar is **auto-generated** from the filesystem by `docs/.vitepress/theme/ These components are globally registered and can be used directly in any `.md` file: -| Component | Purpose | -|-----------|---------| -| `` / `` | Code group tabs | -| `` | Callout/tip boxes | -| `` | Interactive API playground | -| `` / `` | SDK download links | -| `` | AI Skill feature showcase | -| `` | Homepage layout | +| Component | Purpose | +| ---------------------- | -------------------------- | +| `` / `` | Code group tabs | +| `` | Callout/tip boxes | +| `` | Interactive API playground | +| `` / `` | SDK download links | +| `` | AI Skill feature showcase | +| `` | Homepage layout | To add a new component: create the Vue file in `docs/.vitepress/theme/components/` and export it from `index.ts`. @@ -159,6 +161,7 @@ skills/longbridge/SKILL.md ### When to update the Skill Update `SKILL.md` when: + - A new API endpoint is added or an existing one changes - A new SDK language is supported - New features are added to the CLI or MCP server @@ -167,6 +170,7 @@ Update `SKILL.md` when: ### Skill structure The Skill is a self-contained Markdown document that gives an AI agent everything needed to call Longbridge APIs correctly. It includes: + - Authentication and environment setup - All major API endpoints with parameters and response shapes - Common workflows (quote → order → confirm) @@ -180,11 +184,11 @@ Keep the Skill accurate and current — AI agents may invoke it instead of readi ### Locale configuration -| Locale | Directory | URL prefix | Config path | -|--------|-----------|------------|-------------| -| English | `docs/en/` | `/` (root) | `docs/.vitepress/locales/en/` | -| Simplified Chinese | `docs/zh-CN/` | `/zh-CN/` | `docs/.vitepress/locales/zh-CN/` | -| Traditional Chinese | `docs/zh-HK/` | `/zh-HK/` | `docs/.vitepress/locales/zh-HK/` | +| Locale | Directory | URL prefix | Config path | +| ------------------- | ------------- | ---------- | -------------------------------- | +| English | `docs/en/` | `/` (root) | `docs/.vitepress/locales/en/` | +| Simplified Chinese | `docs/zh-CN/` | `/zh-CN/` | `docs/.vitepress/locales/zh-CN/` | +| Traditional Chinese | `docs/zh-HK/` | `/zh-HK/` | `docs/.vitepress/locales/zh-HK/` | ### Adding nav items @@ -209,6 +213,7 @@ docs/.vitepress/theme/locales/zh-HK.json ### Route rewriting The `docs/.vitepress/utils.ts` `rewriteMarkdownPath` function handles URL generation. The `slug` frontmatter field overrides the default path: + - An absolute `slug` like `/trade-order-create` replaces the entire path segment - A relative `slug` resolves relative to the file's directory @@ -231,11 +236,13 @@ git submodule update --remote --merge Contains the canonical OpenAPI specification and multi-language SDK source code (Python, Rust, Go, Node.js, Java, C++). **Sync when:** + - An API endpoint is added, removed, or its parameters/response shape changes - A new SDK language is added - An existing SDK method is renamed or its signature changes **What to change:** + - `openapi/openapi.yaml` — the authoritative API spec; all other changes derive from this - SDK source files for any affected method across all languages @@ -244,11 +251,13 @@ Contains the canonical OpenAPI specification and multi-language SDK source code The official Go SDK. Method names, parameter types, and response structs must stay consistent with what is documented in `docs/{lang}/` and defined in `openapi/openapi.yaml`. **Sync when:** + - An API method signature changes (parameter added/removed/renamed) - A new endpoint is added that needs a Go implementation - Response struct fields change **What to change:** + - Go struct definitions and method signatures in `openapi-go/` - Ensure Go method names in `SDKLinks` component (`docs/.vitepress/theme/components/SDKLinks.vue`) match @@ -257,11 +266,13 @@ The official Go SDK. Method names, parameter types, and response structs must st The `longbridge` CLI distributed via Homebrew. CLI docs (`docs/{lang}/docs/cli.md`) and `` examples in API docs must reflect the actual CLI behavior. **Sync when:** + - A new CLI command or flag is added - A command's output format or behavior changes - A command is deprecated or removed **What to change:** + - CLI source in `longbridge-terminal/` - `docs/{lang}/docs/cli.md` in all three locales - Any `` blocks in docs that use the affected command diff --git a/docs/.vitepress/md-plugins/cli-command.ts b/docs/.vitepress/md-plugins/cli-command.ts index 2eb92df4..0429d9d1 100644 --- a/docs/.vitepress/md-plugins/cli-command.ts +++ b/docs/.vitepress/md-plugins/cli-command.ts @@ -79,7 +79,7 @@ function getUsageTitle(localeIndex: string): string { } function getInstallUrl(localeIndex: string): string { - return `${getLocalePrefix(localeIndex)}/docs/cli/installation` + return `${getLocalePrefix(localeIndex)}/docs/cli/install` } function extractFirstCommand(content: string): string | null { diff --git a/docs/.vitepress/theme/components/ApiReference.vue b/docs/.vitepress/theme/components/ApiReference.vue index 05ba45b3..15366111 100644 --- a/docs/.vitepress/theme/components/ApiReference.vue +++ b/docs/.vitepress/theme/components/ApiReference.vue @@ -102,6 +102,7 @@ const PAGE_ICONS: Record = { lock: ``, activity: ``, 'alert-circle': ``, + book: ``, } interface TagGroup { name: string diff --git a/docs/.vitepress/theme/utils/gen.ts b/docs/.vitepress/theme/utils/gen.ts index 291c6a46..d9f91457 100644 --- a/docs/.vitepress/theme/utils/gen.ts +++ b/docs/.vitepress/theme/utils/gen.ts @@ -5,7 +5,8 @@ import { type DefaultTheme } from 'vitepress' import { isPageIncluded } from '../../region-utils' const SIDEBAR_ICONS: Record = { - book: ``, + book_open: ``, + book: ``, zap: ``, cpu: ``, terminal: ``, @@ -20,6 +21,8 @@ const SIDEBAR_ICONS: Record = { star: ``, newspaper: ``, github: ``, + 'arrow-down-to-line': ``, + 'badge-question-mark': ``, } export const SIDEBAR_ICONS_MAP = SIDEBAR_ICONS @@ -129,7 +132,8 @@ function generateSidebarItems( const { data } = matter(fileContent) const rawTitle = data['sidebar_label'] || data['title'] || getDefaultTitle(file) const iconKey = data['sidebar_icon'] as string | undefined - const iconHtml = iconKey && SIDEBAR_ICONS[iconKey] ? `${SIDEBAR_ICONS[iconKey]}` : '' + const iconHtml = + iconKey && SIDEBAR_ICONS[iconKey] ? `${SIDEBAR_ICONS[iconKey]}` : '' const title = iconHtml ? `${iconHtml}${rawTitle}` : rawTitle const slug = data['slug'] @@ -169,7 +173,8 @@ function generateSidebarItems( if (subItems.length > 0) { const dirTitle = subCategoryConfig?.label || formatDirName(dir) const iconKey = subCategoryConfig?.icon - const iconHtml = iconKey && SIDEBAR_ICONS[iconKey] ? `${SIDEBAR_ICONS[iconKey]}` : '' + const iconHtml = + iconKey && SIDEBAR_ICONS[iconKey] ? `${SIDEBAR_ICONS[iconKey]}` : '' const text = iconHtml ? `${iconHtml}${dirTitle}` : dirTitle const collapsed = depth === 0 ? false : (subCategoryConfig?.collapsed ?? true) const position = subCategoryConfig?.position diff --git a/docs/en/docs/api.md b/docs/en/docs/api.md index 3a5e4430..04d75bed 100644 --- a/docs/en/docs/api.md +++ b/docs/en/docs/api.md @@ -2,4 +2,5 @@ layout: api-reference title: API Reference sidebar: false +sidebar_icon: book --- diff --git a/docs/en/docs/changelog.md b/docs/en/docs/changelog.md index 734b9fb5..6460330a 100644 --- a/docs/en/docs/changelog.md +++ b/docs/en/docs/changelog.md @@ -3,6 +3,7 @@ id: changelog title: Changelog slug: changelog sidebar_position: 7 +sidebar_icon: newspaper --- ## 2026-04-09 diff --git a/docs/en/docs/cli/index.md b/docs/en/docs/cli/index.md index fd5c4fab..41453a76 100644 --- a/docs/en/docs/cli/index.md +++ b/docs/en/docs/cli/index.md @@ -2,7 +2,7 @@ title: 'Longbridge CLI' sidebar_label: 'Overview' sidebar_position: 1 -sidebar_icon: terminal +sidebar_icon: book_open --- # Longbridge CLI @@ -15,7 +15,7 @@ scripting, AI-agent tool-calling, and daily workflows from the terminal. ## Quick Start -See [Installation](/docs/cli/installation) for platform-specific install instructions and authentication setup. After installing, try any command: +See [Installation](/docs/cli/install) for platform-specific install instructions and authentication setup. After installing, try any command: ```bash # Check real-time price diff --git a/docs/en/docs/cli/installation.md b/docs/en/docs/cli/install.md similarity index 98% rename from docs/en/docs/cli/installation.md rename to docs/en/docs/cli/install.md index b8b3465d..92631be5 100644 --- a/docs/en/docs/cli/installation.md +++ b/docs/en/docs/cli/install.md @@ -2,7 +2,7 @@ title: 'Installation' sidebar_label: 'Installation' sidebar_position: 2 -sidebar_icon: cpu +sidebar_icon: arrow-down-to-line --- # Installation diff --git a/docs/en/docs/cli/release-notes.md b/docs/en/docs/cli/release-notes.md index ee22a1ae..f6bcd005 100644 --- a/docs/en/docs/cli/release-notes.md +++ b/docs/en/docs/cli/release-notes.md @@ -2,6 +2,7 @@ title: 'Release Notes' sidebar_label: 'Release Notes' sidebar_position: 100 +sidebar_icon: newspaper --- # Release Notes diff --git a/docs/en/docs/cli/tui.md b/docs/en/docs/cli/tui.md index 45b8fadb..2e28869f 100644 --- a/docs/en/docs/cli/tui.md +++ b/docs/en/docs/cli/tui.md @@ -2,6 +2,7 @@ title: 'tui' sidebar_label: 'TUI' sidebar_position: 99 +sidebar_icon: sparkles --- # longbridge tui diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md index 737ab8b1..4fc2173e 100644 --- a/docs/en/docs/index.md +++ b/docs/en/docs/index.md @@ -1,8 +1,8 @@ --- sidebar_position: -999 -title: Platform Introduction -id: getting_started_introduce -sidebar_icon: book +title: Overview +id: overview +sidebar_icon: book_open --- Longbridge Developers provides programmatic quote trading interfaces for investors with research and development capabilities and assists them to build trading or quote strategy analysis tools based on their own investment strategies. The functions fall into the following categories: diff --git a/docs/en/docs/qa/_category_.json b/docs/en/docs/qa/_category_.json index 7b212186..f39a6e80 100644 --- a/docs/en/docs/qa/_category_.json +++ b/docs/en/docs/qa/_category_.json @@ -4,5 +4,5 @@ "collapsed": true, "link": null, "position": 6.5, - "icon": "book-open" + "icon": "badge-question-mark" } diff --git a/docs/zh-CN/docs/changelog.md b/docs/zh-CN/docs/changelog.md index cd5007d3..fedad790 100644 --- a/docs/zh-CN/docs/changelog.md +++ b/docs/zh-CN/docs/changelog.md @@ -3,6 +3,7 @@ id: changelog title: 更新日志 slug: changelog sidebar_position: 7 +sidebar_icon: newspaper --- ## 2026-04-09 diff --git a/docs/zh-CN/docs/cli/index.md b/docs/zh-CN/docs/cli/index.md index 093be7dd..3a4af339 100644 --- a/docs/zh-CN/docs/cli/index.md +++ b/docs/zh-CN/docs/cli/index.md @@ -2,7 +2,7 @@ title: 'Longbridge CLI' sidebar_label: '概述' sidebar_position: 1 -sidebar_icon: terminal +sidebar_icon: book_open --- # Longbridge CLI @@ -13,7 +13,7 @@ Longbridge CLI(`longbridge`)是面向 Longbridge OpenAPI 全端点的 AI 原 ## 快速开始 -参见[安装说明](/zh-CN/docs/cli/installation)了解平台安装方式与鉴权配置。安装后可直接运行任意命令: +参见[安装说明](/zh-CN/docs/cli/install)了解平台安装方式与鉴权配置。安装后可直接运行任意命令: ```bash # 查询实时行情 @@ -39,11 +39,11 @@ longbridge quote TSLA.US NVDA.US --format json 标的代码采用 `代码.市场` 格式: -| 示例 | 市场 | -| ------------- | ------------------ | -| `TSLA.US` | 美股 | -| `700.HK` | 港股 | -| `600519.SH` | A 股(上交所) | -| `000568.SZ` | A 股(深交所) | -| `D05.SG` | 新加坡 | -| `BTCUSD.HAS` | 加密货币(Longbridge 专属)| +| 示例 | 市场 | +| ------------ | --------------------------- | +| `TSLA.US` | 美股 | +| `700.HK` | 港股 | +| `600519.SH` | A 股(上交所) | +| `000568.SZ` | A 股(深交所) | +| `D05.SG` | 新加坡 | +| `BTCUSD.HAS` | 加密货币(Longbridge 专属) | diff --git a/docs/zh-CN/docs/cli/installation.md b/docs/zh-CN/docs/cli/install.md similarity index 98% rename from docs/zh-CN/docs/cli/installation.md rename to docs/zh-CN/docs/cli/install.md index e634dca5..202920be 100644 --- a/docs/zh-CN/docs/cli/installation.md +++ b/docs/zh-CN/docs/cli/install.md @@ -2,7 +2,7 @@ title: '安装' sidebar_label: '安装' sidebar_position: 2 -sidebar_icon: cpu +sidebar_icon: arrow-down-to-line --- # 安装 diff --git a/docs/zh-CN/docs/cli/release-notes.md b/docs/zh-CN/docs/cli/release-notes.md index b19d1962..9ad0d81d 100644 --- a/docs/zh-CN/docs/cli/release-notes.md +++ b/docs/zh-CN/docs/cli/release-notes.md @@ -2,6 +2,7 @@ title: 'Release Notes' sidebar_label: 'Release Notes' sidebar_position: 100 +sidebar_icon: newspaper --- # Release Notes diff --git a/docs/zh-CN/docs/cli/tui.md b/docs/zh-CN/docs/cli/tui.md index aee0bb25..bc6fe9fa 100644 --- a/docs/zh-CN/docs/cli/tui.md +++ b/docs/zh-CN/docs/cli/tui.md @@ -2,6 +2,7 @@ title: 'tui' sidebar_label: 'TUI' sidebar_position: 99 +sidebar_icon: sparkles --- # longbridge tui diff --git a/docs/zh-CN/docs/index.md b/docs/zh-CN/docs/index.md index 6ec03440..8d304167 100644 --- a/docs/zh-CN/docs/index.md +++ b/docs/zh-CN/docs/index.md @@ -2,7 +2,7 @@ sidebar_position: -999 title: 平台介绍 id: getting_started_introduce -sidebar_icon: book +sidebar_icon: book_open --- Longbridge Developers 为有研发能力的投资者提供程序化行情交易接口,助力投资者根据自身投资策略搭建交易或行情策略分析工具。覆盖以下类别功能: diff --git a/docs/zh-CN/docs/qa/_category_.json b/docs/zh-CN/docs/qa/_category_.json index 505ef91a..8a9836cb 100644 --- a/docs/zh-CN/docs/qa/_category_.json +++ b/docs/zh-CN/docs/qa/_category_.json @@ -4,5 +4,5 @@ "collapsed": true, "link": null, "position": 6.5, - "icon": "book-open" + "icon": "badge-question-mark" } diff --git a/docs/zh-HK/docs/changelog.md b/docs/zh-HK/docs/changelog.md index 35d7bd13..51d7d57f 100644 --- a/docs/zh-HK/docs/changelog.md +++ b/docs/zh-HK/docs/changelog.md @@ -3,6 +3,7 @@ id: changelog title: 更新日誌 slug: changelog sidebar_position: 7 +sidebar_icon: newspaper --- ## 2026-04-09 diff --git a/docs/zh-HK/docs/cli/index.md b/docs/zh-HK/docs/cli/index.md index 0e5a4a1a..e2ca4e7d 100644 --- a/docs/zh-HK/docs/cli/index.md +++ b/docs/zh-HK/docs/cli/index.md @@ -2,7 +2,7 @@ title: 'Longbridge CLI' sidebar_label: '概述' sidebar_position: 1 -sidebar_icon: terminal +sidebar_icon: book_open --- # Longbridge CLI @@ -13,7 +13,7 @@ Longbridge CLI(`longbridge`)是面向 Longbridge OpenAPI 全端點的 AI 原 ## 快速開始 -參見[安裝說明](/zh-HK/docs/cli/installation)了解平台安裝方式與鑑權配置。安裝後可直接執行任意命令: +參見[安裝說明](/zh-HK/docs/cli/install)了解平台安裝方式與鑑權配置。安裝後可直接執行任意命令: ```bash # 查詢即時行情 @@ -39,11 +39,11 @@ longbridge quote TSLA.US NVDA.US --format json 標的代碼採用 `代碼.市場` 格式: -| 示例 | 市場 | -| ------------- | ------------------ | -| `TSLA.US` | 美股 | -| `700.HK` | 港股 | -| `600519.SH` | A 股(上交所) | -| `000568.SZ` | A 股(深交所) | -| `D05.SG` | 新加坡 | -| `BTCUSD.HAS` | 加密貨幣(Longbridge 專屬)| +| 示例 | 市場 | +| ------------ | --------------------------- | +| `TSLA.US` | 美股 | +| `700.HK` | 港股 | +| `600519.SH` | A 股(上交所) | +| `000568.SZ` | A 股(深交所) | +| `D05.SG` | 新加坡 | +| `BTCUSD.HAS` | 加密貨幣(Longbridge 專屬) | diff --git a/docs/zh-HK/docs/cli/installation.md b/docs/zh-HK/docs/cli/install.md similarity index 98% rename from docs/zh-HK/docs/cli/installation.md rename to docs/zh-HK/docs/cli/install.md index e2684370..9553c077 100644 --- a/docs/zh-HK/docs/cli/installation.md +++ b/docs/zh-HK/docs/cli/install.md @@ -2,7 +2,7 @@ title: '安裝' sidebar_label: '安裝' sidebar_position: 2 -sidebar_icon: cpu +sidebar_icon: arrow-down-to-line --- # 安裝 diff --git a/docs/zh-HK/docs/cli/release-notes.md b/docs/zh-HK/docs/cli/release-notes.md index 9105e17d..c1f4fc44 100644 --- a/docs/zh-HK/docs/cli/release-notes.md +++ b/docs/zh-HK/docs/cli/release-notes.md @@ -2,6 +2,7 @@ title: 'Release Notes' sidebar_label: 'Release Notes' sidebar_position: 100 +sidebar_icon: newspaper --- # Release Notes diff --git a/docs/zh-HK/docs/cli/tui.md b/docs/zh-HK/docs/cli/tui.md index 71e2c5e2..97603aea 100644 --- a/docs/zh-HK/docs/cli/tui.md +++ b/docs/zh-HK/docs/cli/tui.md @@ -2,6 +2,7 @@ title: 'tui' sidebar_label: 'TUI' sidebar_position: 99 +sidebar_icon: sparkles --- # longbridge tui diff --git a/docs/zh-HK/docs/index.md b/docs/zh-HK/docs/index.md index d2d207ec..4481441d 100644 --- a/docs/zh-HK/docs/index.md +++ b/docs/zh-HK/docs/index.md @@ -2,7 +2,7 @@ sidebar_position: -999 title: 平台介紹 id: getting_started_introduce -sidebar_icon: book +sidebar_icon: book_open --- Longbridge Developers 為有研發能力的投資者提供程序化行情交易接口,助力投資者根據自身投資策略搭建交易或行情策略分析工具。覆蓋以下類別功能: diff --git a/docs/zh-HK/docs/qa/_category_.json b/docs/zh-HK/docs/qa/_category_.json index 7b212186..f39a6e80 100644 --- a/docs/zh-HK/docs/qa/_category_.json +++ b/docs/zh-HK/docs/qa/_category_.json @@ -4,5 +4,5 @@ "collapsed": true, "link": null, "position": 6.5, - "icon": "book-open" + "icon": "badge-question-mark" } diff --git a/openapi.yaml b/openapi.yaml index e1ea40f6..8df54093 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -9,7 +9,7 @@ x-pages: - id: overview title: Overview x-title-zh: 概览 - x-icon: lock + x-icon: book content: | This page is reorganized as a practical **OAuth 2.0 access flow** for new integrations. diff --git a/region.config.ts b/region.config.ts index de1e4d03..4230eade 100644 --- a/region.config.ts +++ b/region.config.ts @@ -35,6 +35,9 @@ export const regionConfig: Record = { includePages: [ // Only CLI under /docs/ '**/docs/cli.md', + '**/docs/cli/index.md', + '**/docs/cli/install.md', + '**/docs/cli/release-notes.md', // AI Skills '**/skill/**',