YINI — Frequently Asked Questions

A quick, practical FAQ for the YINI configuration format.
If you’re new, you might want to start with Get Started.

Below, you will find questions and answers grouped into the following topics:


1. Understanding YINI

Q – What is an YINI config file?

A YINI config file is a human-friendly configuration file (like INI) that adds real structure: nested sections, arrays, objects, and clear, predictable rules with comments allowed. It can be used to store app or service settings in files like config.yini.

Example (YINI):

^ App
name = "Demo"                       // This is a comment.
features = ["search", "dark-mode"]   # This is also a comment.

^^ Server                            # Define section "App.Server"
host = "0.0.0.0"
port = 8080

Q – What is the format of an YINI file?

YINI is the name of the markup format itself. A YINI file is a plain text file with human readable syntax. It’s based on key-value pairs, section markers, and optional comments.

It supports:

Q – But, why exactly another config format like YINI?

YINI was created to offer a modern, structured, and readable configuration language that feels familiar — yet while addressing some of the historical limitations found in INI and YAML.

It aims to combine simplicity, structure, and safety:

Q – Why not just use INI/JSON/YAML/TOML?

Use whatever suits your project best. YINI aims to:

Q – What file extension should I use?

YINI documents use the .yini file extension.

Q – Is YINI production-ready?

Not quite yet — but it’s getting close:

Q – Who maintains YINI?

YINI is created and maintained by Marko K. Seppänen and the YINI-lang organization. It’s an open-source project released under the Apache 2.0 license.

Q – What encoding should I use?

YINI files should be saved as UTF-8 without BOM for maximum compatibility.


2. Structure and Syntax

Q – How do I define sections?

Each section starts with ^. (Settings are grouped in sections.)

Start a section with ^ and then a name without spaces, e.g.:

^ App
title = "AppName"

Here the text “App” is the section name.

One can add more sections, for example:

^ App
title = "My App Title"
items = 25

^ Style
isDarkTheme = OFF

Q – How do I make another section inside a section?

To nest sections, add more carets (^) at the start of a line.

Example:

    ^ App
      name = 'Demo'
      version = '1.0.0'

    ^ Database
      host = 'localhost'
      port = 5432

        // Add another caret `^` and you get a sub-section
        ^^ Credentials
           user = 'admin'
           password = "secret"

Q – Are tabs and whitespace important?

No (in the same sense as in Python or YAML).
In YINI, spaces and tabs don’t change meaning - indentation is just for human readability.

Q – Can YINI include or import other files?

No (not yet, at least). YINI files are parsed independently.
Tooling may later support includes or imports as an optional extension.

Q – How does YINI handle duplicate keys or sections?

The YINI specification (1.0 RC.3) states that:

However, in the official YINI-lib yini-parser (Node.js), the behavior for handling duplicates in lenient mode is customizable.

Q – Does the order of keys or sections matter?

No, order may be preserved for readability but has no semantic meaning.


3. Readability and Formatting

Q – Can I use comments alongside values?

Yes, various commenting styles are supported in YINI:

// 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).

Q – Is indentation required?

No. Indentation is purely for readability.
The hierarchy is defined only by the caret (^) section marker (and alternative section markers) — not by indentation.


4. Data and Values

Q – What value types are supported?

Common scalars and collections:

Q – Arrays and objects?

Yes and yes.

list = [1, 2, 3, 'four', true, null]

obj = { host: 'localhost', port: 5432 }

Q – Are strings required to be quoted?

Yes. Strings must be enclosed in single ' or double " quotes.
Triple-quoted strings are allowed for multi-line text.

Q – Are keys and section names case-sensitive?

Yes, keys and section names are case-sensitive. Keep a consistent style (e.g., lower_snake_case).
Note: However, key words for null and booleans are not!

Q – Are booleans and null case-insensitive?

Yes, key words are case-insensitive.
true, True, ON, off, null, Null all parse the same.

Q – Are numeric values automatically typed?

Yes. Integers and floating-point numbers are automatically detected; you don’t need suffixes.


5. Help and Next Steps

Q – Is there a CLI for YINI?

Yes. Use npx yini-cli (requires Node.js installed) for parsing or validating files.

Q – Syntax highlighting for YINI config files?

Yes, check out https://github.com/YINI-lang/yini-syntax
The repository includes definitions in tmLanguage, that enable syntax highlighting in VSCode and any editor supporting TextMate grammars.


Didn’t find your answer?