toml README

The project's README from github.com/toml-lang/toml. As one markdown file: README.md.

TOML logo

TOML

Tom's Obvious, Minimal Language.

By Tom Preston-Werner, Pradyun Gedam, et al.

This repository contains the in-development version of the TOML specification. You can find the released versions at https://toml.io.

Objectives

TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. TOML should be easy to parse into data structures in a wide variety of languages.

Example

# This is a TOML document.

title = "TOML Example"

[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates

[database]
server = "192.168.1.1"
ports = [ 8000, 8001, 8002 ]
connection_max = 5000
enabled = true

[servers]

  # Indentation (tabs and/or spaces) is allowed but not required
  [servers.alpha]
  ip = "10.0.0.1"
  dc = "eqdc10"

  [servers.beta]
  ip = "10.0.0.2"
  dc = "eqdc10"

[clients]
data = [ ["gamma", "delta"], [1, 2] ]

# Line breaks are OK when inside arrays
hosts = [
  "alpha",
  "omega"
]

Comparison with Other Formats

TOML shares traits with other file formats used for application configuration and data serialization, such as YAML and JSON. TOML and JSON both are simple and use ubiquitous data types, making them easy to code for or parse with machines. TOML and YAML both emphasize human readability features, like comments that make it easier to understand the purpose of a given line. TOML differs in combining these, allowing comments (unlike JSON) but preserving simplicity (unlike YAML).

Because TOML is explicitly intended as a configuration file format, parsing it is easy, but it is not intended for serializing arbitrary data structures. TOML always has a hash table at the top level of the file, which can easily have data nested inside its keys, but it doesn't permit top-level arrays or floats, so it cannot directly serialize some data. There is also no standard identifying the start or end of a TOML file, which can complicate sending it through a stream. These details must be negotiated on the application layer.

INI files are frequently compared to TOML for their similarities in syntax and use as configuration files. However, there is no standardized format for INI and they do not gracefully handle more than one or two levels of nesting.

Further reading:

Get Involved

Documentation, bug reports, pull requests, and all other contributions are welcome!

Wiki

We have an Official TOML Wiki that catalogs the following:

Please take a look if you'd like to view or add to that list. Thanks for being a part of the TOML community!

toml (toml-lang/toml)

Searching Database…

20.6K ·GitHub
Что это такое?TOML (Tom's Obvious, Minimal Language) — минималистичный формат конфигурационных файлов, созданный так, чтобы файл читался с первого взгляда, а его структура естественно ложилась на хеш-таблицу. В этом репозитории находится сама спецификация TOML, которая ещё в разработке.
То есть это инструмент, библиотека — что именно передо мной?Ни то, ни другое — это спецификация, документ, который определяет синтаксис. Сами программы — это отдельные библиотеки TOML, написанные для множества языков программирования.
Как мне начать пользоваться TOML?Из этого репозитория ничего устанавливать не нужно — TOML это текстовый формат, который вы пишете вручную и читаете с помощью библиотеки для своего языка. Точка входа — Official TOML Wiki: там собраны реализации, поддержка в редакторах и конвертеры.
Чего TOML не умеет?Два момента: верхний уровень файла — всегда хеш-таблица, массивов или чисел с плавающей точкой наверху быть не может, поэтому некоторые данные нельзя сериализовать напрямую; кроме того, у файлов нет стандартных маркеров начала и конца, что усложняет потоковую обработку.
Зачем нужен TOML, если уже были JSON и YAML?Потому что ни один из них не совмещал оба достоинства: JSON простой, но не допускает комментарии, а YAML читаемый, но сложный. TOML придумали, чтобы конфигурация приложений получила и то, и другое сразу.
Почему бы просто не использовать INI-файлы для конфигурации?INI выглядит похоже, но у него нет стандартизированного формата, и он плохо справляется с вложенностью глубже одного-двух уровней — TOML стандартизирован и вкладывает данные в ключи.
Спецификация TOML ещё меняется?Да — в этом репозитории находится версия спецификации в разработке, а стабильные версии публикуются отдельно, так что изменения появляются здесь в первую очередь.
TOML правда назван в честь человека по имени Том?Да — это Tom's Obvious, Minimal Language, в честь создателя Тома Престон-Вернера (Tom Preston-Werner); сегодня спецификацию поддерживают Pradyun Gedam и другие контрибьюторы.
Creator
toml-lang
Size
2.4 MB
Stars
20.6K
Age
13y
Commits · 90 Days