configr can be used to parse JSON, INI, YAML and TOML format configuration files. Examples of json, ini, yaml, toml format configuration file is as follows. Some of parsed result using configr also be present with raw and parsed in different sections.

Configuration file format

TOML

# This is a TOML document. Jianfeng.

title = "TOML Example"

[default]
debug = "{{debug}} {{debug2}}"

[comments]
version = "0.2.3"

[extra_list_parse]
raw = "{{yes}}"
parsed = "1"

[other_config_parse]
raw = "{{key:yes_flag}} {{key:no_flag}}"
parsed = "yes no"

[bash_parse]
raw = "#>#echo bash#<#"
parsed = "bash"

[mulitple_parse]
raw = "@>@str_replace('config','g$','gr')@<@, #>#echo configr#<#, {{key:yes_flag}}, {{yes}}, @>@str_replace('configr','r','')@<@, #>#echo config#<#, {{key:no_flag}}, {{no}}"
parsed = "configr, configr, yes, 1, config, config, no, 0"

[glue_parse]
raw_1 = "!!glue {1:10}"
parsed_1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
raw_2 = "!!glue_numeric {1:10}"
parsed_2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

More infomation and example of TOML can be founded in and toml-lang/toml and TOML-wikipedia.