@@ -6,18 +6,18 @@ use crate::engine::Engine;
6
6
use crate :: foundations:: { func, scope, Str , Value } ;
7
7
use crate :: loading:: { DataSource , Load , Readable } ;
8
8
9
- /// Reads structured data from a TOML file.
9
+ /// TOMLファイルから構造化データを読み込む。
10
10
///
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
+ /// 数値は整数値であれば整数型に、そうでなければ浮動小数点数型に変換されます。
16
16
///
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`のキーを持つテーブルで構成されています。
19
19
///
20
- /// # Example
20
+ /// # 例
21
21
/// ```example
22
22
/// #let details = toml("details.toml")
23
23
///
@@ -29,7 +29,7 @@ use crate::loading::{DataSource, Load, Readable};
29
29
#[ func( scope, title = "TOML" ) ]
30
30
pub fn toml (
31
31
engine : & mut Engine ,
32
- /// A [path ]($syntax/#paths) to a TOML file or raw TOML bytes.
32
+ /// TOMLファイルの[パス ]($syntax/#paths)、または生のTOMLバイト列。
33
33
source : Spanned < DataSource > ,
34
34
) -> SourceResult < Value > {
35
35
let data = source. load ( engine. world ) ?;
@@ -41,23 +41,23 @@ pub fn toml(
41
41
42
42
#[ scope]
43
43
impl toml {
44
- /// Reads structured data from a TOML string/bytes.
44
+ /// TOMLの文字列やバイト列から構造化データを読み込む。
45
45
#[ func( title = "Decode TOML" ) ]
46
- #[ deprecated = "`toml.decode` is deprecated, directly pass bytes to `toml` instead " ]
46
+ #[ deprecated = "`toml.decode`は非推奨です。代わりにバイト列を直接 `toml`に渡してください。 " ]
47
47
pub fn decode (
48
48
engine : & mut Engine ,
49
- /// TOML data.
49
+ /// TOMLデータ。
50
50
data : Spanned < Readable > ,
51
51
) -> SourceResult < Value > {
52
52
toml ( engine, data. map ( Readable :: into_source) )
53
53
}
54
54
55
- /// Encodes structured data into a TOML string.
55
+ /// 構造化データをTOML文字列にエンコードする。
56
56
#[ func( title = "Encode TOML" ) ]
57
57
pub fn encode (
58
- /// Value to be encoded.
58
+ /// エンコード対象の値。
59
59
value : Spanned < Value > ,
60
- /// Whether to pretty-print the resulting TOML.
60
+ /// TOMLを整形表示するかどうか。
61
61
#[ named]
62
62
#[ default( true ) ]
63
63
pretty : bool ,
0 commit comments