File tree Expand file tree Collapse file tree
java/org/simpleyaml/examples Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ();
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ language : " EN" # English(EN), French(FR)...
2+ string-list :
3+ - " Hello"
4+ - " World"
5+ boolean : true
You can’t perform that action at this time.
0 commit comments