diff options
| author | Rik Huijzer <github@huijzer.xyz> | 2024-04-08 12:10:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-08 10:10:08 +0000 |
| commit | 33d620ed2ed7066028c0f1abdac10c8d7b9bf953 (patch) | |
| tree | 4bdf0c912cb68dce2dffb74d96cca61a48105a6b | |
| parent | 351cf127f2849f5947e74449753ae790965df4b1 (diff) | |
Mention `fields` function in docs (#3897)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
| -rw-r--r-- | docs/reference/scripting.md | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/docs/reference/scripting.md b/docs/reference/scripting.md index dda5d989..dab80760 100644 --- a/docs/reference/scripting.md +++ b/docs/reference/scripting.md @@ -231,8 +231,11 @@ The body of a loop can be a code or content block: - `{while condition [..]}` ## Fields -You can use _dot notation_ to access fields on a value. The value in question -can be either: +You can use _dot notation_ to access fields on a value. For values of type +[`content`], you can also use the [`fields`]($content.fields) function to list +the fields. + +The value in question can be either: - a [dictionary] that has the specified key, - a [symbol] that has the specified modifier, - a [module] containing the specified definition, @@ -242,13 +245,15 @@ can be either: element was constructed. ```example +#let it = [= Heading] +#it.body \ +#it.depth \ +#it.fields() + #let dict = (greet: "Hello") #dict.greet \ #emoji.face -#let it = [= Heading] -#it.body \ -#it.depth ``` ## Methods |
