Skip to content

Commit 7a79cd5

Browse files
authored
Merge branch 'main' into translate/png
2 parents 6e14844 + eb35bce commit 7a79cd5

File tree

94 files changed

+312
-5888
lines changed

Some content is hidden

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

94 files changed

+312
-5888
lines changed

.github/workflows/website.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
runs-on: ubuntu-24.04
1616
steps:
1717
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
submodules: recursive
1820
- uses: jdx/mise-action@13abe502c30c1559a5c37dff303831bab82c9402 # v2.2.3
1921
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
2022
- run: mise run generate-docs
@@ -23,18 +25,20 @@ jobs:
2325
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
2426
with:
2527
name: build-artifacts
26-
path: website/dist
28+
path: website/typst-docs-web/dist
2729
- name: Deploy
2830
if: github.ref == 'refs/heads/main'
2931
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
3032
with:
31-
folder: website/dist # The folder the action should deploy.
33+
folder: website/typst-docs-web/dist # The folder the action should deploy.
3234

3335
textlint-md:
3436
runs-on: ubuntu-24.04
3537
steps:
3638
- name: Checkout the repository
3739
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
with:
41+
submodules: recursive
3842
- name: Setup tools
3943
uses: jdx/mise-action@13abe502c30c1559a5c37dff303831bab82c9402 # v2.2.3
4044
- name: Install dependencies
@@ -48,38 +52,15 @@ jobs:
4852
steps:
4953
- name: Checkout the repository
5054
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
55+
with:
56+
submodules: recursive
5157
- name: Download build artifacts
5258
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
5359
with:
5460
name: build-artifacts
55-
path: website/dist
61+
path: website/typst-docs-web/dist
5662
- uses: jdx/mise-action@13abe502c30c1559a5c37dff303831bab82c9402 # v2.2.3
5763
- name: Install dependencies
5864
run: bun install --frozen-lockfile
5965
- name: Lint HTML using textlint
6066
run: bun run --bun textlint-html
61-
62-
website-ci:
63-
runs-on: ubuntu-24.04
64-
defaults:
65-
run:
66-
working-directory: ./website
67-
strategy:
68-
fail-fast: false
69-
matrix:
70-
include:
71-
- task: biome
72-
name: "Run Biome CI"
73-
command: "bun biome ci ."
74-
- task: vitest
75-
name: "Run test runner"
76-
command: "bun run test"
77-
steps:
78-
- name: Checkout the repository
79-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80-
- name: Setup tools
81-
uses: jdx/mise-action@13abe502c30c1559a5c37dff303831bab82c9402 # v2.2.3
82-
- name: Install dependencies
83-
run: bun install --frozen-lockfile
84-
- name: ${{ matrix.name }}
85-
run: ${{ matrix.command }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "website/typst-docs-web"]
2+
path = website/typst-docs-web
3+
url = ../../typst-community/typst-docs-web.git

.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
@@ -16,7 +16,7 @@ Typst日本語ドキュメント翻訳プロジェクトにご興味をお持ち
1616
> [!WARNING]
1717
> ここに記載されている内容は改訂中です。現在の手順は最新の[Pull Request](https://github.com/typst-jp/docs/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aopen)を参照してください。
1818
19-
1. このGitHubリポジトリをフォークします。
19+
1. このGitHubリポジトリをフォークします。Git submoduleを含むため、リポジトリを`git clone`する際に`--recursive`オプションを付けてください。
2020
2. ドキュメントの実体は、主にMarkdownファイルおよびコンパイラのソースコード内のコメントの2種類から構成されています。それぞれ、下記の注意書きに従って翻訳作業をお願いします。
2121
- `./crates/typst-library/src/`内の`.rs`ファイル群は、Typstのコンパイラのソースコードです。ソースコード内に含まれている、**既存のコメントを直接書き換えて翻訳してください**
2222
- 例1:[Reference > Foundations](https://typst.app/docs/reference/foundations/)を翻訳する際は、`./crates/typst-library/src/foundations/mod.rs`のコメントを編集してください。

bun.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"textlint": "^15.2.2",
99
"textlint-filter-rule-comments": "^1.2.2",
1010
"textlint-plugin-html": "^1.0.1",
11-
"textlint-rule-preset-jtf-style": "^3.0.2",
11+
"textlint-rule-preset-jtf-style": "^3.0.3",
1212
},
1313
"peerDependencies": {
1414
"typescript": "^5.0.0",
@@ -534,7 +534,7 @@
534534

535535
"textlint-rule-helper": ["[email protected]", "", { "dependencies": { "@textlint/ast-node-types": "^13.4.1", "structured-source": "^4.0.0", "unist-util-visit": "^2.0.3" } }, "sha512-b1bijvyiUmKinfFE5hkQMSXs3Ky8jyZ3Y6SOoTRJKV9HLL2LWUVFAUezO7z4FpAkVvYruDYWCwA5qWV8GmvyUw=="],
536536

537-
"textlint-rule-preset-jtf-style": ["[email protected].2", "", { "dependencies": { "analyze-desumasu-dearu": "^2.1.2", "japanese-numerals-to-number": "^1.0.2", "match-index": "^1.0.3", "moji": "^0.5.1", "regexp.prototype.flags": "^1.5.3", "regx": "^1.0.4", "textlint-rule-helper": "^2.3.1", "textlint-rule-prh": "^6.0.0" } }, "sha512-rpB1OCIK4KZqZOnM+vVxDCBkgzDH3XINCRiHQ+gV8SRydtfppPWx9WAoxCvq8lm7YuRdGiFU6XartIix2Fc2kA=="],
537+
"textlint-rule-preset-jtf-style": ["[email protected].3", "", { "dependencies": { "analyze-desumasu-dearu": "^2.1.2", "japanese-numerals-to-number": "^1.0.2", "match-index": "^1.0.3", "moji": "^0.5.1", "regexp.prototype.flags": "^1.5.3", "regx": "^1.0.4", "textlint-rule-helper": "^2.3.1", "textlint-rule-prh": "^6.0.0" } }, "sha512-NTvqjg3oMTGjSDoH6MnYu+DDWW6cEghA66Lb8N0bheTphAj99aaG10HGhwTfDbaH2P6NfPQvRP5ISxiXCT9zdg=="],
538538

539539
"textlint-rule-prh": ["[email protected]", "", { "dependencies": { "@babel/parser": "^7.27.0", "prh": "^5.4.4", "textlint-rule-helper": "^2.3.1" } }, "sha512-KrchADHw1/LZ/tAQ2XwL/XdUhunKCvlNmwgp+6hdyzuWX7uojOkDdJWWV0KAN4XWsK6Te5w/SZcYwQ7X6i3B0A=="],
540540

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

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ use crate::foundations::{
99
cast, func, repr, scope, ty, Array, Dict, FromValue, IntoValue, Repr, Str, Value,
1010
};
1111

12-
/// Captured arguments to a function.
12+
/// 関数に渡された引数。
1313
///
14-
/// # Argument Sinks
15-
/// Like built-in functions, custom functions can also take a variable number of
16-
/// arguments. You can specify an _argument sink_ which collects all excess
17-
/// arguments as `..sink`. The resulting `sink` value is of the `arguments`
18-
/// type. It exposes methods to access the positional and named arguments.
14+
/// # 引数シンク
15+
/// 組み込み関数と同様に、カスタム関数も可変長引数を受け取れます。
16+
/// 余分にある引数をすべてまとめて受け取る _引数シンク_(キッチンシンクのようにさまざまなものが流れ込む先)は、`..sink`の形で指定できます。このとき生成される`sink`の値は`arguments`型になります。この型は、位置引数と名前付き引数の両方にアクセスするためのメソッドを提供しています。
1917
///
2018
/// ```example
2119
/// #let format(title, ..authors) = {
@@ -29,9 +27,8 @@ use crate::foundations::{
2927
/// #format("ArtosFlow", "Jane", "Joe")
3028
/// ```
3129
///
32-
/// # Spreading
33-
/// Inversely to an argument sink, you can _spread_ arguments, arrays and
34-
/// dictionaries into a function call with the `..spread` operator:
30+
/// # 引数の展開
31+
/// 引数シンクとは逆に、`..spread`演算子を使うと、関数呼び出しにおいて引数や配列、辞書を展開して渡すことができます。
3532
///
3633
/// ```example
3734
/// #let array = (2, 3, 5)
@@ -43,15 +40,14 @@ use crate::foundations::{
4340
#[derive(Clone, Hash)]
4441
#[allow(clippy::derived_hash_with_manual_eq)]
4542
pub struct Args {
46-
/// The callsite span for the function. This is not the span of the argument
47-
/// list itself, but of the whole function call.
43+
/// 関数呼び出し箇所のスパン。これは引数リスト自体のスパンではなく、関数呼び出し全体のものです。
4844
pub span: Span,
4945
/// The positional and named arguments.
5046
pub items: EcoVec<Arg>,
5147
}
5248

5349
impl Args {
54-
/// Create positional arguments from a span and values.
50+
/// スパンと値から位置引数を作成します。
5551
pub fn new<T: IntoValue>(span: Span, values: impl IntoIterator<Item = T>) -> Self {
5652
let items = values
5753
.into_iter()
@@ -64,20 +60,20 @@ impl Args {
6460
Self { span, items }
6561
}
6662

67-
/// Attach a span to these arguments if they don't already have one.
63+
/// 引数にスパンがアタッチされていない場合はアタッチします。
6864
pub fn spanned(mut self, span: Span) -> Self {
6965
if self.span.is_detached() {
7066
self.span = span;
7167
}
7268
self
7369
}
7470

75-
/// Returns the number of remaining positional arguments.
71+
/// 残りの位置引数の個数を返します。
7672
pub fn remaining(&self) -> usize {
7773
self.items.iter().filter(|slot| slot.name.is_none()).count()
7874
}
7975

80-
/// Insert a positional argument at a specific index.
76+
/// 指定したインデックスに位置引数を挿入します。
8177
pub fn insert(&mut self, index: usize, span: Span, value: Value) {
8278
self.items.insert(
8379
index,
@@ -89,7 +85,7 @@ impl Args {
8985
)
9086
}
9187

92-
/// Push a positional argument.
88+
/// 位置引数をプッシュします。
9389
pub fn push(&mut self, span: Span, value: Value) {
9490
self.items.push(Arg {
9591
span: self.span,
@@ -98,7 +94,7 @@ impl Args {
9894
})
9995
}
10096

101-
/// Consume and cast the first positional argument if there is one.
97+
/// 最初の位置引数がある場合、それを取り出してキャストします。
10298
pub fn eat<T>(&mut self) -> SourceResult<Option<T>>
10399
where
104100
T: FromValue<Spanned<Value>>,
@@ -113,7 +109,7 @@ impl Args {
113109
Ok(None)
114110
}
115111

116-
/// Consume n positional arguments if possible.
112+
/// 可能ならn個の位置引数を取り出します。
117113
pub fn consume(&mut self, n: usize) -> SourceResult<Vec<Arg>> {
118114
let mut list = vec![];
119115

@@ -133,10 +129,9 @@ impl Args {
133129
Ok(list)
134130
}
135131

136-
/// Consume and cast the first positional argument.
132+
/// 最初の位置引数を取り出してキャストします。
137133
///
138-
/// Returns a `missing argument: {what}` error if no positional argument is
139-
/// left.
134+
/// 位置引数が残っていなければ、`missing argument: {what}`エラーを返します。
140135
pub fn expect<T>(&mut self, what: &str) -> SourceResult<T>
141136
where
142137
T: FromValue<Spanned<Value>>,
@@ -147,7 +142,7 @@ impl Args {
147142
}
148143
}
149144

150-
/// The error message for missing arguments.
145+
/// 引数が足りない場合のエラーメッセージ。
151146
fn missing_argument(&self, what: &str) -> SourceDiagnostic {
152147
for item in &self.items {
153148
let Some(name) = item.name.as_deref() else { continue };
@@ -295,9 +290,9 @@ impl Args {
295290

296291
#[scope]
297292
impl Args {
298-
/// Construct spreadable arguments in place.
293+
/// 展開可能な引数をその場で生成します。
299294
///
300-
/// This function behaves like `{let args(..sink) = sink}`.
295+
/// この関数は、`{let args(..sink) = sink}`のように動作します。
301296
///
302297
/// ```example
303298
/// #let args = arguments(stroke: red, inset: 1em, [Body])
@@ -306,27 +301,23 @@ impl Args {
306301
#[func(constructor)]
307302
pub fn construct(
308303
args: &mut Args,
309-
/// The arguments to construct.
304+
/// 作成する引数。
310305
#[external]
311306
#[variadic]
312307
arguments: Vec<Value>,
313308
) -> Args {
314309
args.take()
315310
}
316311

317-
/// Returns the positional argument at the specified index, or the named
318-
/// argument with the specified name.
312+
/// 指定したインデックスの位置引数、または指定した名前の名前付き引数を返します。
319313
///
320-
/// If the key is an [integer]($int), this is equivalent to first calling
321-
/// [`pos`]($arguments.pos) and then [`array.at`]. If it is a [string]($str),
322-
/// this is equivalent to first calling [`named`]($arguments.named) and then
323-
/// [`dictionary.at`].
314+
/// キーが[整数型]($int)の場合、それはまず[`pos`]($arguments.pos)メソッドを呼んでから、次に[`array.at`]を呼ぶのと同等です。キーが[文字列型]($str)である場合、まず[`named`]($arguments.named)メソッドを呼び、次に[`dictionary.at`]を呼ぶのと同等です。
324315
#[func]
325316
pub fn at(
326317
&self,
327-
/// The index or name of the argument to get.
318+
/// 取得する引数のインデックスまたは名前。
328319
key: ArgumentKey,
329-
/// A default value to return if the key is invalid.
320+
/// キーが無効な場合に返すデフォルト値。
330321
#[named]
331322
default: Option<Value>,
332323
) -> StrResult<Value> {
@@ -336,7 +327,7 @@ impl Args {
336327
.ok_or_else(|| missing_key_no_default(key))
337328
}
338329

339-
/// Returns the captured positional arguments as an array.
330+
/// 渡された位置引数を配列の形で返します。
340331
#[func(name = "pos", title = "Positional")]
341332
pub fn to_pos(&self) -> Array {
342333
self.items
@@ -346,7 +337,7 @@ impl Args {
346337
.collect()
347338
}
348339

349-
/// Returns the captured named arguments as a dictionary.
340+
/// 渡された名前付き引数を辞書の形で返します。
350341
#[func(name = "named")]
351342
pub fn to_named(&self) -> Dict {
352343
self.items

0 commit comments

Comments
 (0)