Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty-printing option to inline tables #275

Open
vrom911 opened this issue May 15, 2020 · 2 comments
Open

Pretty-printing option to inline tables #275

vrom911 opened this issue May 15, 2020 · 2 comments
Labels
pretty-printer Everything related to `Toml -> Text`

Comments

@vrom911
Copy link
Member

vrom911 commented May 15, 2020

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 vrom911 added the pretty-printer Everything related to `Toml -> Text` label May 15, 2020
@chshersh
Copy link
Contributor

@vrom911 That's a nice idea 👍 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.

@vrom911 vrom911 added this to the v1.3.0.0: Big update milestone May 15, 2020
@vrom911 vrom911 self-assigned this May 18, 2020
@vrom911 vrom911 removed this from the v1.3.0.0: Big update milestone May 18, 2020
@vrom911
Copy link
Member Author

vrom911 commented May 18, 2020

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 vrom911 removed their assignment May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pretty-printer Everything related to `Toml -> Text`
Projects
None yet
Development

No branches or pull requests

2 participants