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 print edn when marshalling #24

Open
ghost opened this issue May 27, 2020 · 1 comment
Open

Pretty print edn when marshalling #24

ghost opened this issue May 27, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented May 27, 2020

Is it possible to marshal edn data into nicely formatted string? Currently MarshelIndent produces this:

{
  :deps {
    io.netty/netty-buffer {
      :mvn/version "4.1.30.Final"
    },
    potemkin {
      :mvn/version "0.4.5"
    }
  }
}

when I want this:

{:deps    {potemkin              {:mvn/version "0.4.5"}
           io.netty/netty-buffer {:mvn/version "4.1.30.Final"}}}
@hypirion
Copy link
Member

@fctorial: Hi! Sorry for being slow to reply here: It's possible to use MarshalPPrint or PPrint to get a similar, but not quite identical result. For your input, PPrint would generate

{:deps {io.netty/netty-buffer {:mvn/version "4.1.30.Final"},
        potemkin {:mvn/version "0.4.5"}}}

or potemkin before io.netty, depending on how you input the data.

See https://play.golang.org/p/8FWtHZgWf39 for code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant