pkl icon indicating copy to clipboard operation
pkl copied to clipboard

TOML support

Open padhia opened this issue 1 year ago • 6 comments

Hi, just came here to check Pkl out. Unless it's hidden somewhere, I didn't see TOML being supported as an output format. Would it be possible to add TOML support?

Thanks!

padhia avatar Feb 07 '24 14:02 padhia

Hi, at the moment, TOML support is implemented via a package, rather than in the standard library.

https://pkl-lang.org/package-docs/pkg.pkl-lang.org/pkl-pantry/pkl.toml/current/index.html

You can render TOML via:

import "package://pkg.pkl-lang.org/pkl-pantry/[email protected]#/toml.pkl"

output {
  renderer = new toml.Renderer {}
}

bioball avatar Feb 07 '24 15:02 bioball

Thank you for the link. Please consider adding TOML to a future version of the CLI to make generating TOML files easier.

padhia avatar Feb 07 '24 16:02 padhia

toml is extremely popular configuration/interchange format. Kindly do consider it adding it in the mainstream code

zaxebo1 avatar Feb 12 '24 07:02 zaxebo1

We're working on it!

bioball avatar Feb 23 '24 00:02 bioball