-
Notifications
You must be signed in to change notification settings - Fork 7
Dictionary
Giorgio Garofalo edited this page Dec 11, 2024
·
4 revisions
In Quarkdown, a dictionary is a collection of key-value pairs, without duplicate keys. A key is always a string value, while a value can be of any type.
The syntax for dictionaries recalls the YAML one, as it uses Markdown lists:
- key1: value1
- key2: value2
- key3: value3
If the called function accepts it (.localization
for instance), values can be nested dictionaries.
- English:
- greeting: Hello
- food: Fish and chips
- Italian:
- greeting: Ciao
- food: Pasta
Trailing colons that precede nested dictionaries are not mandatory and can be omitted:
- English
- greeting: Hello
- food: Fish and chips
- Italian
- greeting: Ciao
- food: Pasta
A dictionary can be passed to any function that accepts an iterable (it is treated as an iterable of pairs), along with:
.get {key} {dictionary}
-
.get {key} {dictionary} {orelse}
(fallback value if the key doesn't exist)
- Syntax of a function call
- Declaring functions
- Dynamic typing
- Localization
- Including other Quarkdown files
- Importing external libraries
- Document metadata
- Theme
- Page format
- Page margin content
- Page counter
- Automatic page break
- Numbering
- Table of contents
- Stacks (row, column, grid)
- Align
- Container
- Box
- Collapsible
- Whitespace
- String
- Number
- Markdown content
- Boolean
- Enumeration entry
- Iterable
- Dictionary
- Range
- Lambda
- Size(s)
- Color
- Dynamic