Skip to content

Commit

Permalink
Update resources with new examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Carleslc committed Mar 18, 2022
1 parent 37a7641 commit 510904f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static void main(String[] args) throws IOException {

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

// Save file
yamlFile.save();
Expand Down
42 changes: 42 additions & 0 deletions Simple-Yaml/src/test/resources/test-comments-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
######################
## HEADER COMMENT ##
######################

# This comment has a blank line above (header separator)
key-1: This is a root key

# This comment has a blank line above (pretty format)
key-2:
# This comment does not have a blank line above
key-2-1: This is a nested key

# This comment has a blank line above
key-2-2: This is a nested key

# This comment has a blank line above
key-2-3: This is a nested key

#--------------------#
# Custom block format
#--------------------#
custom:
#--------------------#
# This is a multiline
# comment without
# blank line above
#--------------------#
multiline: This is a nested key # Side comment

#--------------------#
# This comment has
# a blank line above
# and custom format
#--------------------#
blank-line-custom: This is a nested key

# ***
#~ This is a multiline
#~~ custom raw comment
# ***

raw: This is a nested key
5 changes: 5 additions & 0 deletions Simple-Yaml/src/test/resources/test-quote-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: "EN" # English(EN), French(FR)...
string-list:
- "Hello"
- "World"
boolean: true

0 comments on commit 510904f

Please sign in to comment.