QEDK / configparser-rs

A simple configuration parsing utility with no dependencies built on Rust.
https://crates.io/crates/configparser
Other
66 stars 21 forks source link

Add spacing between sections and option to add space between key and value #17

Closed callensm closed 11 months ago

callensm commented 3 years ago

As it stands now (unless i'm missing an option somewhere), all sections written to a file are smashed together without the option to add a buffer/space line between them which would be nice.

Additionally, it would be nice to have an option to add a space between the key, the delimiter and the value. For examples...instead of being forced to have it written as:

key=value

have an option to do:

key = value

Both of these are aesthetic features but would be nice for writing more user-friendly files.

QEDK commented 3 years ago

@callensm thought about doing this but aesthetics probably came at the bottom of the to-do list. Probably a pretty-print function? Not too sure about how I would customize it though.

QEDK commented 3 years ago

This will be added later as an altogether new function pretty_write with a customizable featureset of options.

relausen-tlg commented 11 months ago

I would love this too, also with a customizable indentation size for multiline values. Do you have an estimate of when this will be released? I would be happy to help out if you don't have the time!

QEDK commented 11 months ago

I would love this too, also with a customizable indentation size for multiline values. Do you have an estimate of when this will be released? I would be happy to help out if you don't have the time!

If you're able to, please make a PR, all contributions are welcome!

relausen-tlg commented 11 months ago

I would love this too, also with a customizable indentation size for multiline values. Do you have an estimate of when this will be released? I would be happy to help out if you don't have the time!

If you're able to, please make a PR, all contributions are welcome!

I'll give it a go - stay tuned šŸ˜„

relausen-tlg commented 11 months ago

PR created. I still need to write tests for the new stuff, but if you could have a look and say if you agree with my approach before I proceed then I would be a happy camper :-)

QEDK commented 11 months ago

Thanks @callensm for reporting @relausen-tlg for the PR, this should be done now, will be released in the next version. šŸš€

relausen-tlg commented 11 months ago

My pleasure! Will it be possible for you to say when the next version will be released? I'm working on a project where the users will love to have spacing in the written config file :-)

QEDK commented 11 months ago

Iā€™m hoping to publish the next version in the next couple of weeks, optimistically.

On Tue, 28 Nov 2023 at 19:23, Rune Lausen @.***> wrote:

My pleasure! Will it be possible for you to say when the next version will be released? I'm working on a project where the users will love to have spacing in the written config file :-)

ā€” Reply to this email directly, view it on GitHub https://github.com/QEDK/configparser-rs/issues/17#issuecomment-1830066699, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJWRQR3FND2SIBJW65EQCLYGX6YJAVCNFSM47RD6EFKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBTGAYDMNRWHE4Q . You are receiving this because you modified the open/close state.Message ID: @.***>