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

Add 'PrintOptions' for 'tomlToText' function #11

Closed
chshersh opened this issue Mar 29, 2018 · 3 comments
Closed

Add 'PrintOptions' for 'tomlToText' function #11

chshersh opened this issue Mar 29, 2018 · 3 comments
Labels
ast Type of TOML Hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@chshersh
Copy link
Contributor

No description provided.

@chshersh chshersh added the ast Type of TOML label Mar 29, 2018
@chshersh chshersh added this to the v1.0.0: Public release milestone May 22, 2018
@vrom911 vrom911 added the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Sep 30, 2018
@vrom911 vrom911 added this to To do in #2: Hacktoberfest (October, 2018) via automation Sep 30, 2018
@astynax
Copy link
Contributor

astynax commented Oct 2, 2018

Hi! I think I can handle this. But I need more info about the task.

@chshersh
Copy link
Contributor Author

chshersh commented Oct 2, 2018

@astynax I highly appreciate your help on this issue!

This issue is about modifying these function:

prettyToml :: TOML -> Text
prettyToml = Text.drop 1 . prettyTomlInd 0 ""

So there should be two functions:

  1. prettyOptions that takes PrintOptions
  2. pretty: renamed version of prettyToml that calls prettyOptions with some defaultOptions

For now I can imagine the following two things that can be configurable (fields of PrintOptions):

  1. shouldSort :: Bool: specifes where keys should be sorted or not (default set to True)
  2. indent :: Int: indentation for nested tables (default set to 2). Use in this function:
    tab :: Int -> Text
    tab n = Text.cons '\n' (Text.replicate (2*n) " ")

If you have any other ideas regarding what we can configure in printing, please, feel free to suggest!

@astynax
Copy link
Contributor

astynax commented Oct 2, 2018

Ok 👌

#2: Hacktoberfest (October, 2018) automation moved this from To do to Done: Issues Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast Type of TOML Hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
No open projects
Development

No branches or pull requests

3 participants