2026-09-24 07:43 UTC
"Excuse me Sir, how can I define arrays in #YAML?"
# NOTE: flow style is similar to vanilla JSON.
# The following examples start with flow
# style and then the 'human-readable'
# block style.
# ----------------- EXAMPLE 1 ----------------- #
## Flow style
[1,2,3]
## Block style with YOLO spacing before elements
- 1
- 2
- 3
## Block style with YOLO spacing before the block
- 1
- 2
- 3
# ----------------- EXAMPLE 2 ----------------- #
# Flow style
[[[[1, 2], [3]], [[4]]]]
## Compact block style
- - - - 1
- 2
- - 3
- - - 4
## Block style with one level per line
-
-
-
- 1
- 2
-
- 3
-
-
- 4
## Block style with YOLO mix and match
- - - - 1
- 2
-
- 3
-
-
- 4
# ----------------- EXAMPLE 3 ----------------- #
# Flow style
[1, "2 - 3"]
## Because when will you ever have an extra erronous space in your code?
- 1
- 2
- 3
Replies (0)
No replies.