@@ -6,18 +6,18 @@ use crate::engine::Engine;
66use crate :: foundations:: { func, scope, Str , Value } ;
77use crate :: loading:: { DataSource , Load , Readable } ;
88
9- /// Reads structured data from a TOML file.
9+ /// TOMLファイルから構造化データを読み込む。
1010///
11- /// The file must contain a valid TOML table. TOML tables will be converted into
12- /// Typst dictionaries, and TOML arrays will be converted into Typst arrays.
13- /// Strings, booleans and datetimes will be converted into the Typst equivalents
14- /// and numbers will be converted to floats or integers depending on whether
15- /// they are whole numbers.
11+ /// 読み込むファイルには有効なTOMLテーブルが含まれていなければなりません。
12+ /// TOMLテーブルはTypstの辞書に変換され、
13+ /// TOML配列はTypstの配列に変換されます。
14+ /// 文字列、ブール値、日時はTypstの対応する型に変換され、
15+ /// 数値は整数値であれば整数型に、そうでなければ浮動小数点数型に変換されます。
1616///
17- /// The TOML file in the example consists of a table with the keys `title`,
18- /// `version`, and `authors`.
17+ /// この例におけるTOMLファイルは、
18+ /// `title`、` version`、および `authors`のキーを持つテーブルで構成されています。
1919///
20- /// # Example
20+ /// # 例
2121/// ```example
2222/// #let details = toml("details.toml")
2323///
@@ -29,7 +29,7 @@ use crate::loading::{DataSource, Load, Readable};
2929#[ func( scope, title = "TOML" ) ]
3030pub fn toml (
3131 engine : & mut Engine ,
32- /// A [path ]($syntax/#paths) to a TOML file or raw TOML bytes.
32+ /// TOMLファイルの[パス ]($syntax/#paths)、または生のTOMLバイト列。
3333 source : Spanned < DataSource > ,
3434) -> SourceResult < Value > {
3535 let data = source. load ( engine. world ) ?;
@@ -41,23 +41,23 @@ pub fn toml(
4141
4242#[ scope]
4343impl toml {
44- /// Reads structured data from a TOML string/bytes.
44+ /// TOMLの文字列やバイト列から構造化データを読み込む。
4545 #[ func( title = "Decode TOML" ) ]
46- #[ deprecated = "`toml.decode` is deprecated, directly pass bytes to `toml` instead " ]
46+ #[ deprecated = "`toml.decode`は非推奨です。代わりにバイト列を直接 `toml`に渡してください。 " ]
4747 pub fn decode (
4848 engine : & mut Engine ,
49- /// TOML data.
49+ /// TOMLデータ。
5050 data : Spanned < Readable > ,
5151 ) -> SourceResult < Value > {
5252 toml ( engine, data. map ( Readable :: into_source) )
5353 }
5454
55- /// Encodes structured data into a TOML string.
55+ /// 構造化データをTOML文字列にエンコードする。
5656 #[ func( title = "Encode TOML" ) ]
5757 pub fn encode (
58- /// Value to be encoded.
58+ /// エンコード対象の値。
5959 value : Spanned < Value > ,
60- /// Whether to pretty-print the resulting TOML.
60+ /// TOMLを整形表示するかどうか。
6161 #[ named]
6262 #[ default( true ) ]
6363 pretty : bool ,
0 commit comments