tomland icon indicating copy to clipboard operation
tomland copied to clipboard

Pretty-printing option to inline tables

Open vrom911 opened this issue 5 years ago • 2 comments

Currently it expands all tables into the following table structure:

[fooTable]
x = 1
y = true

sometimes it is nicer to have

fooTable = { x = 1, y = true }

vrom911 avatar May 15 '20 09:05 vrom911

@vrom911 That's a nice idea :+1: I'm only thinking about possible UI. What if we don't want all tables to be printed as inline tables? In that case, maybe the pretty-printing settings data type can take a function of type printAsInline :: Key -> Bool, which is const False by default. You can pass const True to print all tables as inline, or elem ["myExample", "anotherExample"] to print only specific keys as inline tables.

chshersh avatar May 15 '20 10:05 chshersh

I had some issues with understanding the valid specs (opened the issue in TOML), so I think this issue is a bit trickier than it could look. Needs to be done more carefully and tested properly.

vrom911 avatar May 18 '20 13:05 vrom911