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

Implemented "Exporting"/"Pretty printing"; is it worth integrating? #27

Open
mstksg opened this issue Jan 16, 2016 · 2 comments
Open

Implemented "Exporting"/"Pretty printing"; is it worth integrating? #27

mstksg opened this issue Jan 16, 2016 · 2 comments

Comments

@mstksg
Copy link

mstksg commented Jan 16, 2016

First of all, thanks for the great library.

Just letting you know that I've implemented a "configuration exporter", which uses pretty to pretty-print a valid configuration file given a Config or a HashMap Name Value:

https://github.com/mstksg/configurator-export

It's somewhat related to #14, but is less geared towards generating files with specific comments and structures and more towards "round-trip" sort of processes that end in "dumping" actual Configs/HashMaps -- load a config, modify it (potentially) and re-export its modified version (or a modified HashMap) as a valid configuration file. Also usable for "merging" several configuration files together, or inlining interpolations/imports.

Was wondering if you thought the best path would be to integrate/pull in that library as just an extra module of functionality into configurator, or if it's best left as a side/companion package of utilities.

(It does add a dependency on pretty, and I also used semigroups's NonEmpty for writing one of the algorithms,)

@deepfire
Copy link

@mstksg, how would you approach saving a modified config? I see no way to produce a value of Config, other than the load* functions..

@mstksg
Copy link
Author

mstksg commented Mar 21, 2016

@deepfire ah yeah, you don't really ever "modify" a Config explicitly; you can just add more and more files to its dependencies and potentially modify the contents of those files, which would auto-reload a properly loaded Config.

I suppose with configurator-export, one could also directly modify the hashmap and use the export functions to overwrite watched files, which would update the Config appropriately.

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

2 participants