Skip to content

feat: add CliCommand block with syntax highlighting and multi-example docs#390

Merged
huacnlee merged 25 commits intomainfrom
improve
Mar 27, 2026
Merged

feat: add CliCommand block with syntax highlighting and multi-example docs#390
huacnlee merged 25 commits intomainfrom
improve

Conversation

@huacnlee
Copy link
Member

Summary

  • New markdown-it plugin (cli-command.ts) renders <CliCommand> tags as styled code blocks with proper shiki dual-theme color variables (--shiki-light / --shiki-dark) for syntax highlighting: longbridge binary (purple), subcommands (blue), args and inline comments (gray)
  • Header changed from compact bar to h2-style title matching SDK Links section; Install CLI link floats right with no border, pointing to /docs/cli
  • Single-line <CliCommand>content</CliCommand> tokens (parsed as paragraph > inline by markdown-it) now correctly handled via Case 2 token splice
  • Expanded all non-trade <CliCommand> blocks from single-line to multi-line format with 2–4 real verified examples per command and locale-aware comments (en / zh-CN / zh-HK) across quote pull, content, subscribe, security, and watchlist docs

Test plan

  • Run bun run dev and verify CliCommand blocks render with correct syntax highlighting in light and dark mode
  • Verify h2 title "CLI" appears with Install CLI link on the right (no border)
  • Verify Install CLI link points to /docs/cli
  • Check a few pages across en / zh-CN / zh-HK locales

🤖 Generated with Claude Code

huacnlee and others added 13 commits March 27, 2026 12:02
… docs

- New markdown-it plugin (cli-command.ts) renders <CliCommand> tags as
  styled code blocks with shiki-compatible --shiki-light/--shiki-dark
  color variables for longbridge binary (purple), subcommands (blue),
  args and inline comments (gray)
- Header replaced with h2-style title matching SDK Links section; Install
  CLI link floats right with no border, pointing to /docs/cli
- Expanded all non-trade CliCommand blocks from single-line to multi-line
  format with 2–4 real examples per command and locale-aware comments
  (en / zh-CN / zh-HK) across quote pull, content, subscribe, security,
  and watchlist docs (~160 files across 3 locales)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
<CliCommand>
longbridge kline TSLA.US # Tesla 日 K 線(最近 100 根)
longbridge kline AAPL.US --period week # Apple 週K線
longbridge kline NVDA.US --period day --count 20 # NVDA 最近20根日K
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [AutoCorrect Lint] <AutoCorrect> reported by reviewdog 🐶

Suggested change
longbridge kline NVDA.US --period day --count 20 # NVDA 最近20根日K
longbridge kline NVDA.US --period day --count 20 # NVDA 最近 20 根日 K� K

huacnlee and others added 12 commits March 27, 2026 13:39
<order_id> was parsed as an unclosed HTML tag by Vue template compiler,
causing build failure. Replaced with a realistic fake order ID (693664675163312128)
across order_detail, withdraw, and replace docs in all 3 locales.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ceholder

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rkflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@huacnlee huacnlee merged commit e61c421 into main Mar 27, 2026
1 check passed
@huacnlee huacnlee deleted the improve branch March 27, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant