A parser, not a pattern
Tables, arrays of tables, dotted keys, inline tables, four string styles, four date and time forms and every radix for numbers are read by their rules. A quoted dot stays inside the key it belongs to.
Pikkola TOML, tool No. 52
Paste a pyproject.toml, a Cargo.toml or a wrangler.toml and read it as JSON or YAML. Change one value and the same document comes back as TOML. The reader follows TOML 1.0, a mistake is marked at its line and column, and nothing is uploaded.
The studio
The source and the target are separate choices, so any of the three formats can become either of the others. The result follows every keystroke.
There is no output yet. Paste something on the left, or load one of the examples.
No request, no account, no storage. The Content-Security-Policy sets connect-src to none, so the page could not upload a file even if it tried.
A converter is only as good as its reader. This one is a parser for the whole grammar, and a writer that keeps the order you wrote.
Tables, arrays of tables, dotted keys, inline tables, four string styles, four date and time forms and every radix for numbers are read by their rules. A quoted dot stays inside the key it belongs to.
Line and column come from the parser position, so a missing equals sign or a table declared twice is marked where it starts, not where the file ends. Press a finding and the editor scrolls to it.
Three readers and three writers, in files on this domain. No request, no account, no storage. Load the page once and it keeps working with the network off.
Syntax first, then the structures that are legal in one format and a mistake in another. Every finding names a line and a column, and the line in the editor is marked when you press it.
It checks the format, not the schema. A clean result means the file is well formed, not that pip or Cargo will accept it.
No. There is no endpoint to send it to. The three readers and three writers are JavaScript files on this domain, and the page's Content-Security-Policy sets connect-src to none. Load it once and it keeps working with the network off.
TOML 1.0.0. Bare and quoted keys, dotted keys, tables, arrays of tables, inline tables, basic, multiline basic, literal and multiline literal strings, integers in decimal, hex, octal and binary, floats including inf and nan, and offset, local, date and time values.
Turn on Keep comments and a TOML to TOML pass carries them back, attached to the key or the table they sat above, with the inline comment at the end of its line. JSON and YAML have no comment of their own, so the count of dropped comments is reported instead.
A TOML date keeps the text it was written as, so an offset date-time comes back with the same offset and the same fractional seconds. In JSON and YAML it becomes an ISO 8601 string, because a native date there would not survive a round trip through three formats.
Only a document whose root is an object. A JSON array or a bare value has no TOML form, so the output is withheld with the reason. Null has no TOML value at all, so a null key is left out and listed in the checks.
It checks the syntax and the structure of the format, not the keys pip, Cargo or Wrangler expect. A clean result means the file is well formed TOML, not that the service will accept it.