# sample-config.toml: a commented TOML configuration file. # Free sample from 99helpers.com/file-types/toml # Valid TOML 1.0.0 (and so also TOML 1.1.0). The numbered comments mark # the parts explained on that page. # 1. Keys and values at the top, before any [table] header, belong to the root table. title = "Sample web app" version = "2.10" # 2. A string: TOML never guesses that this is a number debug = false # 3. Booleans are lowercase true or false, nothing else port = 8080 # 4. Integers are 64-bit; underscores aid reading max_upload = 104_857_600 ratio = 0.75 # a float permissions = 0o755 # octal, also 0x hex and 0b binary timeout = inf # floats may be inf or nan # 5. Four kinds of date and time, all written as in RFC 3339 released = 2026-10-27T09:30:00Z # offset date-time (a moment in time) maintenance = 2026-11-01T02:00:00 # local date-time (no time zone) launch_day = 2026-12-01 # local date backup_at = 03:15:00 # local time # 6. Strings: basic strings use escapes, literal strings ('...') don't greeting = "Hello, \"world\"\tand caf\u00e9" windows_path = 'C:\Users\ada\config' pattern = '^\d{4}-\d{2}$' # 7. A multi-line basic string; the first newline after """ is dropped motd = """ Welcome to the sample app. Maintenance runs on Sundays.""" # 8. Arrays: in square brackets, may span lines and end with a comma languages = ["en", "nl", "fr"] ports = [ 8080, 8081, ] # 9. Inline tables: a small table on one line (TOML 1.0 requires one line) owner = { name = "Ada Example", email = "ada@example.com" } # 10. A table: everything below the header, up to the next header, is inside it [database] host = "db.example.internal" port = 5432 pool.min = 2 # 11. Dotted keys create nested tables: database.pool pool.max = 10 # 12. A sub-table, written with a dotted header [database.replica] host = "replica.example.internal" read_only = true # 13. Quoted keys allow spaces, dots and non-ASCII characters [labels] "team name" = "Platform" "café" = "open" "example.com" = "a key with a dot in it" # 14. An array of tables: each [[servers]] adds one table to the "servers" list [[servers]] name = "web-1" region = "eu-west" weight = 3 [[servers]] name = "web-2" region = "us-east" weight = 1