You can edit the CFG source below, and see the results at right:
# You can have comments anywhere in a configuration. # You can have standard JSON-like key-value mapping. "writer": "Oscar Fingal O'Flahertie Wills Wilde", # But also use single-quotes for keys and values. 'a dimension': 'length: 5"', # You can use identifiers for the keys. string_value: 'a string value', integer_value: 3, float_value = 2.71828, # you can use = instead of : as a key-value separator complex_value: 3 + 2j, negative_integer: -42, big_number_with_underscores: 123_456_789.012_345, boolean_value: true, # these values are just like in JSON opposite_boolean_value: false, null_value: null interpolated: `the whole gamut of emotions from ${list_value[2][1]} to ${list_value[2][3]}` list_value: [ 123, 4.5 # note the absence of a comma - a newline acts as a separator, too. [ 1, 'A', 2, 'B', # note the trailing comma - doesn't cause errors ] ] # a comma isn't needed here. nested_mapping: { integer_as_hex: 0x123 integer_as_oct: 0o123 integer_as_bin: 0b01101001 float_value: .14159, # note the trailing comma - doesn't cause errors } # no comma needed here either. # You can use escape sequences ... snowman_escaped: '\u2603' # or not, and use e.g. utf-8 encoding. snowman_unescaped: '☃' # You can refer to code points outside the Basic Multilingual Plane face_with_tears_of_joy: '\U0001F602' unescaped_face_with_tears_of_joy: '😂' # Refer to other values in this configuration. refer_1: ${string_value}, # -> 'a string value' refer_2: ${list_value[1]}, # -> 4.5 refer_3: ${nested_mapping.float_value}, # -> 0.14159 # Special values are implementation-dependent. s_val_1: `$LANG|en_GB.UTF-8` # -> environment var with default s_val_2: `2019-03-28T23:27:04.314159` # -> date/time value # Expressions. # N.B. backslash immediately followed by newline is seen as a continuation: pi_approx: ${integer_value} + \ ${nested_mapping.float_value} # -> 3.14159 sept_et_demi: ${integer_value} + \ ${list_value[1]} # -> 7.5 multi_valued_1: '''abc def''' multi_valued_2: """ghi jkl"""
Choose the display format for the results shown below:
JSON
YAML