Skip to content

Commit 510904f

Browse files
committed
Update resources with new examples
1 parent 37a7641 commit 510904f

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

Simple-Yaml/src/test/java/org/simpleyaml/examples/YamlCommentsFormatExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static void main(String[] args) throws IOException {
9191

9292
// You can also set a custom formatted comment directly prefixing all lines with # (raw)
9393
yamlFile.path("custom.raw").set("This is a nested key")
94-
.comment("\n# ***\n#~ This is a multiline\n#~~ raw comment\n# ***\n", YamlCommentFormat.RAW);
94+
.comment("\n# ***\n#~ This is a multiline\n#~~ custom raw comment\n# ***\n", YamlCommentFormat.RAW);
9595

9696
// Save file
9797
yamlFile.save();
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
######################
2+
## HEADER COMMENT ##
3+
######################
4+
5+
# This comment has a blank line above (header separator)
6+
key-1: This is a root key
7+
8+
# This comment has a blank line above (pretty format)
9+
key-2:
10+
# This comment does not have a blank line above
11+
key-2-1: This is a nested key
12+
13+
# This comment has a blank line above
14+
key-2-2: This is a nested key
15+
16+
# This comment has a blank line above
17+
key-2-3: This is a nested key
18+
19+
#--------------------#
20+
# Custom block format
21+
#--------------------#
22+
custom:
23+
#--------------------#
24+
# This is a multiline
25+
# comment without
26+
# blank line above
27+
#--------------------#
28+
multiline: This is a nested key # Side comment
29+
30+
#--------------------#
31+
# This comment has
32+
# a blank line above
33+
# and custom format
34+
#--------------------#
35+
blank-line-custom: This is a nested key
36+
37+
# ***
38+
#~ This is a multiline
39+
#~~ custom raw comment
40+
# ***
41+
42+
raw: This is a nested key
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: "EN" # English(EN), French(FR)...
2+
string-list:
3+
- "Hello"
4+
- "World"
5+
boolean: true

0 commit comments

Comments
 (0)