Intro to the YINI Config Format
A short 10–15 minute introduction to the YINI configuration format — learn its syntax, structure, and supported features — step by step.
1. Sections
Group settings under a named header. A section header name starts with ^.
Start a section with ^, e.g.:
^ App
title = "AppName"Alternative section markers to
^are also supported:<,§,€(e.g.< Section).
See section 9 for more advanced marker and naming options.
2. Key = Value
Each line inside a section is a key (name) and value, separated by =.
Write settings as key = value:
maxConnections = 100
enableLogging = trueSee section 9 for more advanced marker and naming options.
💡Tip
Use backticks (`) to quote section or key names that contain spaces or special characters.
Key names with spaces/special characters can be backticked:
user id = 1 # Invalid ❌
`user id` = 1 # Valid ✅3. Values
Values can be:
- Strings (always quoted):
'hello'or"world"(either single or double quoted) - Numbers:
42,3.14or-10 - Booleans:
true,false,on,off,yes,no(all case-insensitive) - Nulls: Use
nullor leave the value blank after=(in lenient mode) - Lists:
- JSON‑style:
["red", "green", "blue"] - Colon‑style: (Planned – not yet implemented in parser)
- JSON‑style:
4. Comments
Various commenting styles are supported:
// This is a line comment
timeout = 30 // inline comment
# This is also a line comment (must have a space after #)
interval = 30 # inline comment (must have a space after #)
/* Block comment spanning
multiple lines */
; Full line comment (must be whole line).Tip: You can add comments anywhere—above, beside, or below any setting or section.
👆 Caveat 1: If you use
#for comments, always put a space after the#. (Otherwise, the parser might misinterpret it as part of a value.)
👆 Caveat 2: ; is used only for full-line comments. The ; must be the first non-whitespace character on a line (only spaces or tabs are allowed before it).
(If ; appears later in the line, the parser may treat it as part of a value or as a line delimiter, not as a comment.)
💡Tip: You can use any comment style in your file. For best readability, try to stick to one style per file.
5. Nested Sections
Use extra carets ^ for sub‑sections:
^ Parent
^^ Child
// Add another caret `^` and you get a sub-section
// of the previous section, and so...
^^^ SubChildIf you prefer, you can indent the nested section for visibility:
^ Main
^^ Sub
host = "db.example.com"One can nest multiple sections:
^ Root
^^ Sub
^^^ SubSub
^ BackToRootExample with indented sections:
^ Root
value = 'At level 1'
^^ Sub
value = 'At level 2'
^^^ SubSub
value = 'At level 3'
^ BackToRoot
value = 'Back at level 1'The above Yini code will produce the following JavaScript object:
// JS object
{
Root: {
value: 'At level 1',
Sub: { value: 'At level 2', SubSub: { value: 'At level 3' } }
},
BackToRoot: { value: 'Back at level 1' }
}See section 9 for more advanced marker and naming options.
6. Lists
// JSON‑style lists
colors = ["red", "green", "blue"]
numberList = [
10,
20,
30
]
// Colon‑style list
// 👆 Colon‑style list support is planned for an upcoming release.
fruits:
"Pear",
"Cherry",
"Banana"You can use either single or double quotes for string values in YINI.
7. Document Terminator (strict mode)
The /END marker is optional in both lenient (default) and in strict mode.
End a file explicitly with:
^ App
title = "MyTitle"
/END // Is only optional.8. Disabled Lines
Prefix any valid line with -- to skip it entirely:
--maxRetries = 59. Advanced: Alternative Section Markers & Naming
In addition to the standard syntax, YINI supports several advanced options:
-
(a.) Alternative section markers:
Besides^, you can use<,§, or€as section header markers.< MySection § Settings € MyApp -
(b.) Backticked section names and key names:
Use backticks (`) to allow spaces or special characters in section or key names:^ `Section name with spaces` `user id` = 42 -
(c.) Numeric shorthand section markers:
To create deeply nested sections (beyond 6 levels), use numeric shorthand:^7 DeepSection # Equivalent to 7 carets: ^^^^^^^ DeepSection <10 VeryDeep # Equivalent to <<<<<<<<<<< VeryDeep👆 Though, can not mix standard/classic and numeric shorthand markers in the same section header.
-
(d.) More features:
The YINI format supports even more features than listed here, such as additional number notations, string types, and advanced escaping. For full details, see the latest release of the YINI specification.
10. Complete Example
@yini # Optional marker to identify YINI format.
^ App
name = "MyApp"
version = "1.0.0"
debug = off // Turn on for debugging.
^^ Database
host = "db.local"
port = 5432
--user = "secret" # This line is disabled due to --.
userList = ["alice", "bob", "carol"]
/END // (optional)Next Steps
- ➡️ Get Started
Learn how to install and use YINI. - ➡️ Quick Tutorial
5-minute guided walkthrough of YINI.
