-
Notifications
You must be signed in to change notification settings - Fork 13
docs: rewrite typst-docs-web README in English #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
091b89c
c7ef41e
3429602
59ed486
bd6f27b
c19540f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,73 @@ | ||
# website | ||
# typst-docs-web | ||
|
||
> [!NOTE] | ||
> このドキュメントは執筆中です。 | ||
<div align="center"> | ||
<img src="./images/preview.png" alt=""> | ||
</div> | ||
|
||
A generator that builds a website from a documentation JSON file generated by typst-docs. | ||
|
||
## Required toolchains | ||
|
||
- [Node.js](https://nodejs.org/) | ||
- [Bun](https://bun.sh/) | ||
|
||
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. | ||
|
||
```toml | ||
# mise.toml | ||
[tools] | ||
rust = "1.83.0" # set required version for typst-docs | ||
node = "22.11.0" | ||
bun = "1.2.21" | ||
``` | ||
|
||
## Setup | ||
|
||
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. | ||
|
||
```sh | ||
# Run in the root directory of typst/typst repository | ||
cargo run --package typst-docs -- --assets-dir assets --out-file docs.json --base /docs/ | ||
``` | ||
|
||
```plaintext | ||
public | ||
├── assets ⇒ /path/to/typst/assets | ||
└── docs.json ⇒ /path/to/typst/docs.json | ||
``` | ||
|
||
Create `/public/metadata.json` and describe the metadata for the documentation website. For details on each property, refer to the JSON schema. For example: | ||
|
||
```json | ||
{ | ||
"$schema": "/path/to/typst-docs-web/metadata.schema.json", | ||
|
||
"language": "ja-JP", | ||
"version": "0.13.1", | ||
"typstOfficialUrl": "https://typst.app", | ||
"typstOfficialDocsUrl": "https://typst.app/docs/", | ||
"githubOrganizationUrl": "https://github.com/typst-jp", | ||
"githubRepositoryUrl": "https://github.com/typst-jp/docs", | ||
"discordServerUrl": "https://discord.gg/9xF7k4aAuH", | ||
"originUrl": "https://typst-jp.github.io/", | ||
"basePath": "/docs/", | ||
"displayTranslationStatus": true | ||
} | ||
``` | ||
|
||
`/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. | ||
|
||
## Commands | ||
|
||
After installing dependencies with Bun, the following commands are available: | ||
|
||
```sh | ||
bun install --frozen-lockfile | ||
``` | ||
|
||
### Develop | ||
|
||
> [!NOTE] | ||
> 全文検索のインデックスは[pagefind](https://pagefind.app/)で生成していますが、インデックスの出力先が`dist/`になっているため、現在は開発サーバーで全文検索が機能しません。検索機能関連の開発をする場合は、`bun run build`を実行してから、`bun run preview`でビルド後の状態を確認してください。 | ||
> 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. | ||
|
||
```sh | ||
bun run dev | ||
|
@@ -29,10 +88,10 @@ bun run preview | |
### Check | ||
|
||
```sh | ||
# コードスタイルをチェックする | ||
# Check code style | ||
bun run check | ||
|
||
# 自動修正を行う | ||
# Apply automatic code fixes | ||
bun run check:write | ||
``` | ||
|
||
|
@@ -41,3 +100,11 @@ bun run check:write | |
```sh | ||
bun run test | ||
``` | ||
|
||
## Maintainers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we note the version of typst-docs json somewhere? For example:
The typst-docs says the JSON structure is not stable and may change at any time, and it is likely to change soon (because of typst/typst#6922). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's a good idea to clearly state the supported version. |
||
|
||
- [@3w36zj6](https://github.com/3w36zj6) | ||
|
||
## License | ||
|
||
This project is derived from [typst/typst](https://github.com/typst/typst) and is licensed under the Apache-2.0 license. |
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.