From 33d620ed2ed7066028c0f1abdac10c8d7b9bf953 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Mon, 8 Apr 2024 12:10:08 +0200 Subject: [PATCH] Mention `fields` function in docs (#3897) Co-authored-by: Laurenz --- docs/reference/scripting.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/reference/scripting.md b/docs/reference/scripting.md index dda5d9894..dab80760b 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