|
| 1 | +# xLLM Documentation |
| 2 | + |
| 3 | +[English](./README.md) | [简体中文](./README.zh-CN.md) |
| 4 | + |
| 5 | +This repository contains the Astro + Starlight documentation site for |
| 6 | +[xLLM](https://github.com/xLLM-AI/xllm), an LLM inference framework for |
| 7 | +high-performance serving on domestic AI accelerators. |
| 8 | + |
| 9 | +The site is built with Starlight and `starlight-theme-rapide`. It includes a |
| 10 | +custom header, bilingual navigation, and a page-level `Copy page` action for |
| 11 | +copying documentation content as Markdown. |
| 12 | + |
| 13 | +## Documentation Structure |
| 14 | + |
| 15 | +The documentation is maintained in two parallel language trees: |
| 16 | + |
| 17 | +- English: `src/content/docs/en` |
| 18 | +- Simplified Chinese: `src/content/docs/zh` |
| 19 | + |
| 20 | +The root path redirects to the English documentation: |
| 21 | + |
| 22 | +- `/` redirects to `/en/` |
| 23 | +- `/en/` serves the English documentation |
| 24 | +- `/zh/` serves the Simplified Chinese documentation |
| 25 | + |
| 26 | +When adding or moving pages, keep matching relative paths in both language |
| 27 | +trees so Starlight can switch between languages for the same topic. |
| 28 | + |
| 29 | +## Project Layout |
| 30 | + |
| 31 | +```text |
| 32 | +. |
| 33 | +├── astro.config.mjs # Starlight, locale, sidebar, and component config |
| 34 | +├── package.json # npm scripts and dependencies |
| 35 | +├── src/ |
| 36 | +│ ├── assets/ # Site-level assets such as the logo |
| 37 | +│ ├── components/ # Starlight component overrides |
| 38 | +│ ├── content/ |
| 39 | +│ │ └── docs/ |
| 40 | +│ │ ├── en/ # English documentation |
| 41 | +│ │ ├── zh/ # Simplified Chinese documentation |
| 42 | +│ │ └── assets/ # Documentation images and diagrams |
| 43 | +│ ├── pages/index.astro # Redirect from / to /en/ |
| 44 | +│ └── styles/theme.css # Project theme customizations |
| 45 | +└── public/ # Static public assets |
| 46 | +``` |
| 47 | + |
| 48 | +## Local Development |
| 49 | + |
| 50 | +Install dependencies: |
| 51 | + |
| 52 | +```sh |
| 53 | +npm install |
| 54 | +``` |
| 55 | + |
| 56 | +Start the local development server: |
| 57 | + |
| 58 | +```sh |
| 59 | +npm run dev |
| 60 | +``` |
| 61 | + |
| 62 | +Build the production site: |
| 63 | + |
| 64 | +```sh |
| 65 | +npm run build |
| 66 | +``` |
| 67 | + |
| 68 | +Preview the production build: |
| 69 | + |
| 70 | +```sh |
| 71 | +npm run preview |
| 72 | +``` |
| 73 | + |
| 74 | +## Editing Documentation |
| 75 | + |
| 76 | +- Put user-facing content under `src/content/docs/en` and |
| 77 | + `src/content/docs/zh`. |
| 78 | +- Keep English and Chinese files aligned by path when a page exists in both |
| 79 | + languages. |
| 80 | +- Store shared documentation images in `src/content/docs/assets`. |
| 81 | +- Update the `sidebar` section in `astro.config.mjs` when adding new sections |
| 82 | + that should appear in navigation. |
| 83 | +- Run `npm run build` before submitting changes to catch broken routes, |
| 84 | + frontmatter errors, and Starlight content issues. |
| 85 | + |
| 86 | +## Related Repository |
| 87 | + |
| 88 | +- xLLM source code: <https://github.com/xLLM-AI/xllm> |
0 commit comments