Skip to content

Commit 43ca3e3

Browse files
authored
docs: rewrite typst-docs-web README in English (#275)
1 parent be042df commit 43ca3e3

File tree

2 files changed

+77
-5
lines changed

2 files changed

+77
-5
lines changed

website/typst-docs-web/README.md

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,76 @@
1-
# website
1+
# typst-docs-web
2+
3+
<div align="center">
4+
<img src="./images/preview.png" alt="">
5+
</div>
6+
7+
Build a website from the documentation JSON file generated by [typst-docs](https://github.com/typst/typst/blob/main/docs/Cargo.toml#L2).
8+
9+
## Required toolchains
10+
11+
- [Node.js](https://nodejs.org/)
12+
- [Bun](https://bun.sh/)
13+
14+
Using [mise](https://mise.jdx.dev/) is recommended, as it enables central management of all the toolchains required for both the SSG and the upstream typst-docs.
15+
16+
```toml
17+
# mise.toml
18+
[tools]
19+
rust = "1.83.0" # set required version for typst-docs
20+
node = "22.11.0"
21+
bun = "1.2.21"
22+
```
23+
24+
## Setup
225

326
> [!NOTE]
4-
> このドキュメントは執筆中です。
27+
> The JSON structure generated by typst-docs is not stable and may change at any time. This project is confirmed to be compatible with typst-docs [v0.13.1](https://github.com/typst/typst/tree/v0.13.1). Other versions are usually compatible as well, but they have not been tested carefully.
28+
29+
The typst-docs CLI outputs the static files required for building the documentation. Place the JSON file and assets generated by typst-docs in the `/public/` directory. In most use cases, symbolic links are convenient.
30+
31+
```sh
32+
# Run in the root directory of typst/typst repository
33+
cargo run --package typst-docs -- --assets-dir assets --out-file docs.json --base /docs/
34+
```
35+
36+
```plaintext
37+
public
38+
├── assets ⇒ /path/to/typst/assets
39+
└── docs.json ⇒ /path/to/typst/docs.json
40+
```
41+
42+
Create `/public/metadata.json` and describe the metadata for the documentation website. For details on each property, refer to the JSON schema. For example:
43+
44+
```json
45+
{
46+
"$schema": "../metadata.schema.json",
47+
"language": "ja-JP",
48+
"version": "0.13.1",
49+
"typstOfficialUrl": "https://typst.app",
50+
"typstOfficialDocsUrl": "https://typst.app/docs/",
51+
"githubOrganizationUrl": "https://github.com/typst-jp",
52+
"githubRepositoryUrl": "https://github.com/typst-jp/docs",
53+
"discordServerUrl": "https://discord.gg/9xF7k4aAuH",
54+
"originUrl": "https://typst-jp.github.io/",
55+
"basePath": "/docs/",
56+
"displayTranslationStatus": true
57+
}
58+
```
59+
60+
`/public/translation-status.json` is used to manage the translation progress and the classification of original content. This file is automatically updated when running the SSG, so manual editing is not necessary.
561

662
## Commands
763

64+
After installing dependencies with Bun, the following commands are available:
65+
66+
```sh
67+
bun install --frozen-lockfile
68+
```
69+
870
### Develop
971

1072
> [!NOTE]
11-
> 全文検索のインデックスは[pagefind](https://pagefind.app/)で生成していますが、インデックスの出力先が`dist/`になっているため、現在は開発サーバーで全文検索が機能しません。検索機能関連の開発をする場合は、`bun run build`を実行してから、`bun run preview`でビルド後の状態を確認してください。
73+
> The full-text search index is generated by [pagefind](https://pagefind.app/), but since the output directory is set to `/dist/`, full-text search functionality is currently unavailable in the development server. For developing search-related features, please execute `bun run build` first, then use `bun run preview` to inspect the built output.
1274
1375
```sh
1476
bun run dev
@@ -29,10 +91,10 @@ bun run preview
2991
### Check
3092

3193
```sh
32-
# コードスタイルをチェックする
94+
# Check code style
3395
bun run check
3496

35-
# 自動修正を行う
97+
# Apply automatic code fixes
3698
bun run check:write
3799
```
38100

@@ -41,3 +103,13 @@ bun run check:write
41103
```sh
42104
bun run test
43105
```
106+
107+
## Maintainers
108+
109+
- [@3w36zj6](https://github.com/3w36zj6)
110+
111+
## License
112+
113+
This project is derived from [typst/typst](https://github.com/typst/typst) and is licensed under the Apache-2.0 license.
114+
115+
Non-OSS assets distributed by the Typst web app are not included in this project.
108 KB
Loading

0 commit comments

Comments
 (0)