Skip to content

Commit 514eaa2

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/add-textlint-rule-prh
2 parents f9f3533 + be042df commit 514eaa2

File tree

96 files changed

+2059
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2059
-517
lines changed

.github/workflows/website.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
2424
with:
2525
name: build-artifacts
26-
path: website/dist
26+
path: website/typst-docs-web/dist
2727
- name: Deploy
2828
if: github.ref == 'refs/heads/main'
2929
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
3030
with:
31-
folder: website/dist # The folder the action should deploy.
31+
folder: website/typst-docs-web/dist # The folder the action should deploy.
3232

3333
textlint-md:
3434
runs-on: ubuntu-24.04
@@ -52,7 +52,7 @@ jobs:
5252
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
5353
with:
5454
name: build-artifacts
55-
path: website/dist
55+
path: website/typst-docs-web/dist
5656
- uses: jdx/mise-action@13abe502c30c1559a5c37dff303831bab82c9402 # v2.2.3
5757
- name: Install dependencies
5858
run: bun install --frozen-lockfile
@@ -63,7 +63,7 @@ jobs:
6363
runs-on: ubuntu-24.04
6464
defaults:
6565
run:
66-
working-directory: ./website
66+
working-directory: website/typst-docs-web
6767
strategy:
6868
fail-fast: false
6969
matrix:

.mise.toml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.textlintignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# hayagrivaのsrc/csl/archive.rsで管理されている参考文献フォーマット
2-
website/dist/reference/model/bibliography/index.html
3-
website/dist/reference/model/cite/index.html
2+
website/typst-docs-web/dist/reference/model/bibliography/index.html
3+
website/typst-docs-web/dist/reference/model/cite/index.html

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: 743 additions & 0 deletions
Large diffs are not rendered by default.

bun.lockb

-155 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
/// 関数の戻り値を定義し、引数に依存させることができます。

crates/typst-library/src/pdf/embed.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ use crate::World;
1212

1313
/// 出力されるPDFに埋め込まれるファイル。
1414
///
15-
/// This can be used to distribute additional files that are related to the PDF
16-
/// within it. PDF readers will display the files in a file listing.
15+
/// この関数は、PDFに関連する追加のファイルをPDF内に埋め込んで配布するために使用できます。
16+
/// PDFリーダーはファイルリストにファイルを表示します。
1717
///
18-
/// Some international standards use this mechanism to embed machine-readable
19-
/// data (e.g., ZUGFeRD/Factur-X for invoices) that mirrors the visual content
20-
/// of the PDF.
18+
/// 一部の国際規格では、
19+
/// この仕組みを使用して、
20+
/// PDFの視覚的な内容を反映した機械可読データ(例:請求書のZUGFeRD/Factur-X)を埋め込んでいます。
2121
///
22-
/// # Example
22+
/// #
2323
/// ```typ
2424
/// #pdf.embed(
2525
/// "experiment.csv",
@@ -29,16 +29,16 @@ use crate::World;
2929
/// )
3030
/// ```
3131
///
32-
/// # Notes
33-
/// - This element is ignored if exporting to a format other than PDF.
34-
/// - File embeddings are not currently supported for PDF/A-2, even if the
35-
/// embedded file conforms to PDF/A-1 or PDF/A-2.
32+
/// # 注意
33+
/// - この要素はPDF以外の形式にエクスポートする場合は無視されます。
34+
/// - PDF/A-2へのエクスポートでは、埋め込みファイルは現在サポートされていません。
35+
/// たとえ埋め込まれるファイルがPDF/A-1やPDF/A-2に準拠していたとしてもです。
3636
#[elem(Show, Locatable)]
3737
pub struct EmbedElem {
38-
/// The [path]($syntax/#paths) of the file to be embedded.
38+
/// 埋め込まれるファイルの[パス]($syntax/#paths)
3939
///
40-
/// Must always be specified, but is only read from if no data is provided
41-
/// in the following argument.
40+
/// 常に指定する必要がありますが、
41+
/// 次の引数でデータが提供されていない場合にのみ読み取られます。
4242
#[required]
4343
#[parse(
4444
let Spanned { v: path, span } =
@@ -51,9 +51,9 @@ pub struct EmbedElem {
5151
#[borrowed]
5252
pub path: Derived<EcoString, EcoString>,
5353

54-
/// Raw file data, optionally.
54+
/// 任意で指定する生のファイルデータ。
5555
///
56-
/// If omitted, the data is read from the specified path.
56+
/// この引数が指定されない場合、データは指定されたパスから読み取られます。
5757
#[positional]
5858
// Not actually required as an argument, but always present as a field.
5959
// We can't distinguish between the two at the moment.
@@ -66,16 +66,16 @@ pub struct EmbedElem {
6666
)]
6767
pub data: Bytes,
6868

69-
/// The relationship of the embedded file to the document.
69+
/// 埋め込まれるファイルと文書との関係。
7070
///
71-
/// Ignored if export doesn't target PDF/A-3.
71+
/// エクスポート対象がPDF/A-3でない場合は無視されます。
7272
pub relationship: Option<EmbeddedFileRelationship>,
7373

74-
/// The MIME type of the embedded file.
74+
/// 埋め込まれるファイルのMIMEタイプ。
7575
#[borrowed]
7676
pub mime_type: Option<EcoString>,
7777

78-
/// A description for the embedded file.
78+
/// 埋め込まれるファイルの説明。
7979
#[borrowed]
8080
pub description: Option<EcoString>,
8181
}
@@ -94,12 +94,12 @@ impl Show for Packed<EmbedElem> {
9494
/// The relationship of an embedded file with the document.
9595
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Cast)]
9696
pub enum EmbeddedFileRelationship {
97-
/// The PDF document was created from the source file.
97+
/// PDF文書がそのソースファイルから作成されたことを示す。
9898
Source,
99-
/// The file was used to derive a visual presentation in the PDF.
99+
/// ファイルがPDFにおける視覚的表現を得るために使われたことを示す。
100100
Data,
101-
/// An alternative representation of the document.
101+
/// 文書の代替的な表現であることを示す。
102102
Alternative,
103-
/// Additional resources for the document.
103+
/// 文書への追加のリソースであることを示す。
104104
Supplement,
105105
}

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
セミコロン(`;`)はその前のカンマ区切りの引数を配列引数へとマージします。

0 commit comments

Comments
 (0)