mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Mention fields
function in docs (#3897)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
parent
351cf127f2
commit
33d620ed2e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user