Skip to content
cho-jsPublic

About

Cho documentation

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

62 Commits

Folders and files

Repository files navigation

cho-docs

The documentation of the chō framework, built with VitePress.

npm install
npm run dev      # local server, with hot reload
npm run build    # static site in docs/.vitepress/dist
npm run preview  # serve the built site

The guides start with the application model. Each application section has its own overview for HTTP, commands and messaging. Edit the section navigation in docs/.vitepress/sidebar.ts and the top-level menu in docs/.vitepress/config.ts.

Deployment

.github/workflows/deploy.yml builds the site and publishes it to GitHub Pages on every push to main. In the repository settings, set Pages → Source to GitHub Actions. The site is served from the root of its own domain (chojs.io): base in docs/.vitepress/config.ts is /.

.github/workflows/check.yml builds every pull request, and type-checks the files of docs/examples/ against the main branch of the framework.

The release of chō that the pages describe is choVersion in docs/.vitepress/config.ts: it is shown in the top bar.

Languages

The English pages are the source, at the root of docs/. A translation has a folder of its own with the same paths: docs/zh/ (Simplified Chinese), docs/ja/ (Japanese), docs/es/ (Spanish), docs/fr/ (French) and docs/ar/ (Arabic, written from right to left). The API pages, the blog and the press kit are in English only; a link to them from a translated page leads to the English page. The words of the interface (top bar, sidebar groups, footer, search) are in docs/.vitepress/i18n.ts. The sidebar of a language takes the title of each page from the translated page itself.

A translated page differs from the English one in its prose only. Code blocks, the ids of the headings (## 标题 {#the-english-id}), link targets and includes stay as they are, and scripts/check-locale.py checks it on every pull request.

  • After an English page changes, make the same change in the folder of each language, then run python3 scripts/check-locale.py zh (and the same for ja, es, fr, ar).
  • A new English page: npm run build, then python3 scripts/locale-skeleton.py zh (and the same for the other languages) copies it into the language with its heading ids and its links ready, to be translated in place.
  • A link whose text is the title of its target is written with the English title. python3 scripts/locale-titles.py zh replaces it with the translated title, and follows a title that changes later.
  • A new language: add it to i18n.ts, run the skeleton script with its key, and translate. A language written from right to left also sets dir: "rtl" there.

About

Cho documentation

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages