Skip to content

Commit 76312af

Browse files
authored
Merge branch 'main' into translate/pdf-embed
2 parents f07dc58 + 4668526 commit 76312af

File tree

15 files changed

+1335
-81
lines changed

15 files changed

+1335
-81
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ mise run textlint-md # Markdownファイルを翻訳した場合
8686
miseが導入されている環境で初めて当プロジェクトのルートディレクトリに移動すると、以下のように構成ファイルを信頼することを求められます。
8787

8888
```plaintext
89-
mise ERROR Config file /path/to/typst-jp.github.io/.mise.toml is not trusted.
89+
mise ERROR Config file /path/to/typst-jp.github.io/mise.toml is not trusted.
9090
Trust it with `mise trust`.
9191
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
9292
```

bun.lock

Lines changed: 689 additions & 0 deletions
Large diffs are not rendered by default.

bun.lockb

-146 KB
Binary file not shown.

crates/typst-library/src/foundations/func.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::foundations::{
2121
/// 関数名の直後に括弧で囲まれたカンマ区切りの関数の _引数_ のリストを書くことにより関数を呼び出すことができます。
2222
/// 加えて、通常の引数リストの後に任意の数のコンテンツブロック引数を関数に渡すこともできます。
2323
/// 通常の引数リストが空の場合は省略が可能です。
24-
/// Typstは位置引数とキーワード引数をサポートしています
24+
/// Typstは位置引数と名前付き引数をサポートしています
2525
/// 前者は位置と型によって識別され、後者は`name: value`のように書きます。
2626
///
2727
/// 数式モードでは、関数呼び出しは特殊な振る舞いをします。
@@ -57,7 +57,7 @@ use crate::foundations::{
5757
///
5858
/// # ユーザー定義関数
5959
/// [letバインディング]($scripting/#bindings)を用いることで、バインディング名の後に引数リストを持ったユーザー定義関数を定義することができます。
60-
/// 引数リストには必須の位置引数、デフォルト値を持つキーワード引数および[可変長引数]($arguments)を用いることができます。
60+
/// 引数リストには必須の位置引数、デフォルト値を持つ名前付き引数および[可変長引数]($arguments)を用いることができます。
6161
///
6262
/// 関数バインディングの右辺は関数本体で、ブロックか任意の式です。
6363
/// 関数の戻り値を定義し、引数に依存させることができます。

docs/reference/export/html.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
<div class="info-box">
22

3-
Typst's HTML export is currently under active development. The feature is still
4-
very incomplete and only available for experimentation behind a feature flag. Do
5-
not use this feature for production use cases. In the CLI, you can experiment
6-
with HTML export by passing `--features html` or setting the `TYPST_FEATURES`
7-
environment variables to `html`. In the web app, HTML export is not available at
8-
this time. Visit the [tracking issue](https://github.com/typst/typst/issues/5512)
9-
to follow progress on HTML export and learn more about planned features.
3+
TypstのHTMLエクスポートは現在積極的に開発が行われています。
4+
この機能はまだ非常に不完全であり、機能フラグを有効にした場合に、実験目的でのみ利用可能です。
5+
本番環境における利用ではこの機能を使用しないでください。
6+
CLIでは`--features html`オプションを指定するか環境変数`TYPST_FEATURES``html`を設定することでHTMLエクスポートを試すことができます。
7+
Webアプリでは、現時点でHTMLエクスポートは利用できません。
8+
HTMLエクスポートに関する進捗を追跡し、計画されている機能について詳しく知るには、
9+
[tracking issue](https://github.com/typst/typst/issues/5512)を参照してください。
1010
</div>
1111

12-
HTML files describe a document structurally. The aim of Typst's HTML export is
13-
to capture the structure of an input document and produce semantically rich HTML
14-
that retains this structure. The resulting HTML should be accessible,
15-
human-readable, and editable by hand and downstream tools.
16-
17-
PDF, PNG, and SVG export, in contrast, all produce _visual_ representations of a
18-
fully-laid out document. This divergence in the formats' intents means that
19-
Typst cannot simply produce perfect HTML for your existing Typst documents. It
20-
cannot always know what the best semantic HTML representation of your content
21-
is.
22-
23-
Instead, it gives _you_ full control: You can check the current export format
24-
through the [`target`]($target) function and when it is set to HTML, generate [raw HTML
25-
elements]($html.elem). The primary intended use of these elements is in
26-
templates and show rules. This way, the document's contents can be fully
27-
agnostic to the export target and content can be shared between PDF and HTML
28-
export.
29-
30-
Currently, Typst will always output a single HTML file. Support for outputting
31-
directories with multiple HTML documents and assets, as well as support for
32-
outputting fragments that can be integrated into other HTML documents is
33-
planned.
34-
35-
Typst currently does not output CSS style sheets, instead focussing on emitting
36-
semantic markup. You can of course write your own CSS styles and still benefit
37-
from sharing your _content_ between PDF and HTML. For the future, we plan to
38-
give you the option of automatically emitting CSS, taking more of your existing
39-
set rules into account.
40-
41-
# Exporting as HTML
42-
## Command Line
43-
Pass `--format html` to the `compile` or `watch` subcommand or provide an output
44-
file name that ends with `.html`. Note that you must also pass `--features html`
45-
or set `TYPST_FEATURES=html` to enable this experimental export target.
46-
47-
When using `typst watch`, Typst will spin up a live-reloading HTTP server. You
48-
can configure it as follows:
49-
50-
- Pass `--port` to change the port. (Defaults to the first free port in the
51-
range 3000-3005.)
52-
- Pass `--no-reload` to disable injection of a live reload script. (The HTML
53-
that is written to disk isn't affected either way.)
54-
- Pass `--no-serve` to disable the server altogether.
55-
56-
## Web App
57-
Not currently available.
58-
59-
# HTML-specific functionality
60-
Typst exposes HTML-specific functionality in the global `html` module. See below
61-
for the definitions it contains.
12+
HTMLファイルでは文書を構造的に記述します。
13+
TypstのHTMLエクスポートの目的は、入力文書の構造を捉え、
14+
この構造を保持する、意味付けが豊かなHTMLを生成することです。
15+
生成されるHTMLは、アクセシビリティに優れ、人間が読みやすく、手作業での編集や下流のツールによる処理が可能であるべきです。
16+
17+
対照的に、PDFPNG、SVGエクスポートはすべて、
18+
完全にレイアウト済みの文書の _視覚的_ 表現を生成します。
19+
このようなフォーマットの意図の違いにより、
20+
Typstは既存のTypst文書に対して完璧なHTMLを単純に生成することはできません。
21+
Typstがあなたのコンテンツにとって最適に意味付けされたHTML表現が何であるかを常に知ることはできないためです。
22+
23+
代わりに、Typstは _あなた_ に完全な制御を委ねます。
24+
[`target`]($target)関数で現在のエクスポート形式を確認でき、これがHTMLに設定されている場合、
25+
[生のHTML要素]($html.elem)を生成できます。
26+
これらの要素は主にテンプレートやshowルールでの使用を想定しています。
27+
このようにすることで、
28+
文書の内容はエクスポート先に依存せず、PDFとHTMLの両方で共有できます。
29+
30+
現時点では、
31+
Typstは常に単一のHTMLファイルを出力します。
32+
複数のHTML文書やアセットを含むディレクトリの出力、
33+
他のHTML文書に統合できるフラグメント出力は今後の実装が予定されています。
34+
35+
Typstは現状ではCSSスタイルシートを出力せず、意味付けされたマークアップの生成に重点を置いています。
36+
もちろん、独自にCSSスタイルを書くこともでき、
37+
そうすればPDFとHTMLの間で _コンテンツ_ を共有する利点をそのまま享受できます。
38+
将来的には、既存のsetルールをより多く考慮に入れた上で、
39+
CSSを自動的に出力するオプションを提供する予定です。
40+
41+
# HTML形式でのエクスポート
42+
## コマンドライン
43+
`compile`または`watch`サブコマンドに`--format html`オプションを指定するか、`.html`で終わる出力ファイル名を指定します。
44+
この実験的なエクスポートターゲットを有効にするには、`--features html`オプションを指定するか、
45+
環境変数`TYPST_FEATURES=html`を設定する必要があることに注意してください。
46+
47+
`typst watch`を使用すると、Typstはライブリロード対応のHTTPサーバーを起動します。
48+
設定は以下の方法で可能です。
49+
50+
- `--port`オプションでポート番号を変更します。
51+
(デフォルトでは3000-3005の範囲で最初に利用可能なポートが使用されます)。
52+
- `--no-reload`オプションでライブリロードスクリプトの注入を無効にします。
53+
(いずれにせよディスクに書き込まれるHTMLには影響しません)。
54+
- `--no-serve`オプションでサーバー機能が完全に無効になります。
55+
56+
## Webアプリ
57+
現在利用できません。
58+
59+
# HTML固有の機能
60+
Typstでは、グローバルな`html`モジュールを通じてHTMLに固有の機能を提供しています。
61+
そのモジュールに含まれる定義については、以下を参照してください。

docs/reference/library/math.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $ sum_(k=0)^n k
4444

4545
- その中では、Typstは依然として「数式モード」です。
4646
したがって、その中で数式を直接書くことができますが、コード式を渡すには(数式構文で利用可能なstringを除いて)ハッシュ構文を使う必要があります。
47-
- 位置引数、キーワード引数、引数展開をサポートしています。
47+
- 位置引数、名前付き引数、引数展開をサポートしています。
4848
- 後続のコンテンツブロックはサポートされていません。
4949
- 2次元引数リストのための追加の構文があります。
5050
セミコロン(`;`)はその前のカンマ区切りの引数を配列引数へとマージします。

.mise.toml renamed to mise.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
[tools]
22
rust = "1.83.0"
33
node = "22.11.0"
4-
bun = "1.1.37"
4+
bun = "1.2.21"
55
pinact = "3.1.1"
66

77
[settings]
88
yes = true
99
idiomatic_version_file_enable_tools = []
1010

11+
[vars]
12+
_.file = "website/metadata.json"
13+
1114
[tasks.generate-docs]
12-
run = "cargo run --package typst-docs -- --assets-dir assets --out-file docs.json --base /docs/"
15+
run = "cargo run --package typst-docs -- --assets-dir assets --out-file docs.json --base {{vars.basePath}}"
1316

1417
[tasks.generate-web]
1518
depends = ["install-website"]

0 commit comments

Comments
 (0)