Skip to content

Commit f49da88

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/add-textlint-rule-prh
2 parents e5a8ac5 + 33282fe commit f49da88

File tree

7 files changed

+128
-75
lines changed

7 files changed

+128
-75
lines changed

bun.lock

Lines changed: 45 additions & 69 deletions
Large diffs are not rendered by default.

mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ run = [
2222

2323
[tasks.symlink-web-metadata]
2424
run = [
25+
"rm -rf website/typst-docs-web/public/favicon.png",
26+
"ln -s ../../favicon.png website/typst-docs-web/public/favicon.png",
2527
"rm -rf website/typst-docs-web/public/metadata.json",
2628
"ln -s ../../metadata.json website/typst-docs-web/public/metadata.json",
2729
"rm -rf website/typst-docs-web/public/translation-status.json",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"textlint-filter-rule-allowlist": "^4.0.0",
1313
"textlint-filter-rule-comments": "^1.2.2",
1414
"textlint-plugin-html": "^1.0.1",
15-
"textlint-rule-preset-jtf-style": "^3.0.2",
15+
"textlint-rule-preset-jtf-style": "^3.0.3",
1616
"textlint-rule-prh": "^6.1.0"
1717
},
1818
"peerDependencies": {
File renamed without changes.

website/typst-docs-web/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ node_modules/
22
dist/
33
public/assets
44
public/docs.json
5+
public/favicon.png
56
public/metadata.json
67
public/translation-status.json

website/typst-docs-web/README.md

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,78 @@
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.
61+
62+
The image provided in `public/favicon.png` is used as the favicon for the documentation website. Currently, this image is also used as the OGP `og:image`, so please provide it in PNG format.
563

664
## Commands
765

66+
After installing dependencies with Bun, the following commands are available:
67+
68+
```sh
69+
bun install --frozen-lockfile
70+
```
71+
872
### Develop
973

1074
> [!NOTE]
11-
> 全文検索のインデックスは[pagefind](https://pagefind.app/)で生成していますが、インデックスの出力先が`dist/`になっているため、現在は開発サーバーで全文検索が機能しません。検索機能関連の開発をする場合は、`bun run build`を実行してから、`bun run preview`でビルド後の状態を確認してください。
75+
> 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.
1276
1377
```sh
1478
bun run dev
@@ -29,10 +93,10 @@ bun run preview
2993
### Check
3094

3195
```sh
32-
# コードスタイルをチェックする
96+
# Check code style
3397
bun run check
3498

35-
# 自動修正を行う
99+
# Apply automatic code fixes
36100
bun run check:write
37101
```
38102

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

0 commit comments

Comments
 (0)