Documentation Guide
This guide covers how to contribute to the vLLM Semantic Router documentation.
Directory Structureâ
The documentation is built using Docusaurus.
website/docs/: Main English documentation (Markdown).website/i18n/: Localized documentation (e.g.,zh-Hansfor Chinese).website/docusaurus.config.ts: Site configuration.website/sidebars.ts: Sidebar navigation.
Editing Documentationâ
-
Locate the file: Find the Markdown file in
website/docs/. -
Make changes: Edit the content using Markdown syntax.
-
Preview locally:
cd website
npm run start -
Verify links: Ensure all relative links work correctly.
-
Lint check: Run
make markdown-lintto check for syntax issues.
Internationalization (i18n)â
We support multiple languages (e.g., English, Chinese). The default language is English.
Adding a New Pageâ
- Create the English file in
website/docs/. - Create the corresponding translated file in
website/i18n/{locale}/docusaurus-plugin-content-docs/current/.- Example for Chinese:
website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/.
- Example for Chinese:
- Ensure the filename and directory structure match exactly.
Adding a New Languageâ
- Configure the new locale in
website/docusaurus.config.ts. - Run
npm run write-translations -- --locale <new-locale>to generate JSON translation files. - Copy the
docsfolder structure towebsite/i18n/<new-locale>/...and translate the Markdown files.
Updating Translationsâ
When you update an English document, please also update the Chinese translation if possible. If you cannot translate it, please open an issue to request help.
Style Guideâ
- Headings: Use sentence case.
- Code Blocks: Specify the language (e.g., ```bash).
- Links: Use relative paths for internal links.
- Images: Place images in
website/static/img/and reference them as/img/....