Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/reference/language/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,21 @@ I got an ice cream for
\$1.50! \u{1f600}
```

## Identifiers
Names of variables, functions, and so on (_identifiers_) can contain letters,
numbers, hyphens (`-`), and underscores (`_`). They must start with a letter or
an underscore.

More specifically, the identifier syntax in Typst is based on the
[Unicode Standard Annex #31](https://www.unicode.org/reports/tr31/), with two
extensions: Allowing `_` as a starting character, and allowing both `_` and `-`
as continuing characters.

For multi-word identifiers, the recommended case convention is
[Kebab case](https://en.wikipedia.org/wiki/Letter_case#Kebab_case). In Kebab
case, words are written in lowercase and separated by hyphens (as in
`top-edge`). This is especially relevant when developing modules and packages
for others to use, as it keeps things predictable.
## 識別子 { #identifiers }
Comment thread
ultimatile marked this conversation as resolved.
Resolved
変数名や関数名など(_識別子_)には、
文字、数字、ハイフン(`-`)、アンダースコア(`_`)を使用できます。
先頭は文字またはアンダースコアでなければなりません。

より厳密には、Typstにおける識別子の構文は[Unicode Standard Annex #31](https://www.unicode.org/reports/tr31/)に基づいていますが、
2つの拡張を行っています。
開始文字として`_`を許可すること、
継続文字として`_`と`-`の両方を許可することです。

複数の単語からなる識別子の場合、
推奨される表記規約は[ケバブケース](https://en.wikipedia.org/wiki/Letter_case#Kebab_case)です。
ケバブケースでは、単語は小文字で書かれ、ハイフンで区切られます(例: `top-edge`)。
これは、予測可能性を維持できるため、
他の人が利用するモジュールやパッケージを開発する際に特に重要です。

```example
#let kebab-case = [Using hyphen]
Expand Down
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"/docs/tutorial/advanced-styling/": "partially_translated",
"/docs/tutorial/making-a-template/": "partially_translated",
"/docs/reference/": "translated",
"/docs/reference/syntax/": "partially_translated",
"/docs/reference/syntax/": "translated",
"/docs/reference/styling/": "partially_translated",
"/docs/reference/scripting/": "translated",
"/docs/reference/context/": "translated",
Expand Down
Loading