YINI Cheat Sheet
Based on the official YINI Specification (v1.0 Release Candidate)
A quick reference for writing clean, readable YINI configuration files.
YINI makes data files (such as configuration files and application settings) easy for humans to read
and predictable for machines to process β like INI, but with real structure, lists (arrays), objects, and comments.
More structured than INI, less noisy than JSON, and less fragile than YAML.
π§± Basic Syntax
| Element | YINI Syntax |
|---|---|
| Section heading: levelΒ 1 | ^ App |
| Section heading: levelΒ 2 | ^^ Database |
| Section heading: levelΒ 3 | ^^^ Pool |
| String | "text" or 'text' |
| Number | 42, 3.14, 1e4 |
| Boolean | true, false, on, off, yes, no (case-insensitive) |
| Null | null, Null, (or blank in lenient mode) |
| List / Array | [1, 2, 3] |
| Inline object (map/dict) | { a: 1, b: 2 } |
| Comment | // Default comment |
| Alt. comment | # Comment (must be #β or #\t)β #Missing space before comment startβ # This is an OK comment |
| Multi-line (block) comment | /* comment *//* Multi-line comment*/ |
| Full-line comment | ; This is a full-line comment (only full lines) |
| Disable line | --debug = true |
π Naming Rules
- Section names and keys can include spaces.
- Use backticks (
`) for special characters or reserved words:
^ `My App`
`api-key` = "abc123"
`user.name` = "Alex"π‘ Style Convention (Optional)
- Section names typically start with a Capital letter.
- Keys typically start with a lowercase letter.
This is a readability convention β not a requirement.
π§© Inline Objects & Nested Data
(Objects are also called maps or dictionaries in general sense.)
Simple object
db = { host: "localhost", port: 5432 }Nested objects
service = {
http: { port: 8080, secure: true },
limits: { rpm: 1000 }
}π§ Important Rules
- Indentation is cosmetic β structure is defined by section markers (
^,^^,^^^, etc.). - Strings must be quoted using
'...'or"...". - Inside a section,
name: "John"creates a list.
Usename = "John"for a single value. - Trailing commas are allowed in lists and objects (lenient mode).
- Duplicate keys are disallowed by default.
#starts a comment only if followed by a space or tab.
π’ Number Formats
YINI supports multiple numeric formats:
| Format | Example |
|---|---|
| Integer | 42β 01 (Donβt use zero before a digit)β 1β 0 |
| Float | 3.14β 3,14β 0.14 |
| Scientific | 1e6, 5.2E-3 |
| Hexadecimal | #FFAA00β # FFAA00 (Parsed as a comment)β #ffaa00 (Hex color literal) |
| Binary | 0b101010 |
| Octal | 0o755 |
All numeric forms are parsed as real numbers β no quotes required.
π§ͺ Minimal Real-World Example
^ App
name = "Nebula"
version = "2.3.1"
^^ Network
ports = [80, 443]
ssl = Yes // boolean (case-insensitive)
^^ `Rate Limits`
requests = { perMinute: 1200, burst: 60 }
timeout = nullNext Steps
- β‘οΈ YINI Code Examples
Explore real-world configurations. - β‘οΈ Get YINI Tools
CLI, parser libraries, and editor tools.
