Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mstksg/configurator-export
Pretty printer and exporter for configurations from the 'configurator' library
https://github.com/mstksg/configurator-export
Last synced: about 2 months ago
JSON representation
Pretty printer and exporter for configurations from the 'configurator' library
- Host: GitHub
- URL: https://github.com/mstksg/configurator-export
- Owner: mstksg
- License: bsd-3-clause
- Created: 2016-01-15T10:04:20.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-29T04:13:39.000Z (over 5 years ago)
- Last Synced: 2024-05-02T00:12:06.496Z (8 months ago)
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/configurator-export
- Size: 93.8 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
configurator-export
===================[![configurator-export on Hackage](https://img.shields.io/hackage/v/configurator-export.svg?maxAge=2592000)](https://hackage.haskell.org/package/configurator-export)
[![configurator-export on Stackage LTS](http://stackage.org/package/configurator-export/badge/lts)](http://stackage.org/lts/package/configurator-export)
[![configurator-export on Stackage Nightly](http://stackage.org/package/configurator-export/badge/nightly)](http://stackage.org/nightly/package/configurator-export)
[![Build Status](https://travis-ci.org/mstksg/configurator-export.svg?branch=master)](https://travis-ci.org/mstksg/configurator-export)Pretty printers and exporters for 'Config's from the great
*[configurator](http://hackage.haskell.org/package/configurator)* library.All results are intended to be valid parsing files in the configuration file
syntax of the library.For a full round trip:
~~~haskell
main = do
cfg <- load [Required "config.cfg"]
writeConf "config.cfg" cfg
~~~This should load the config file, parse it, and then re-export it, rewriting
the original config file. The result should be an identical configuration
file (with keys potentially re-arranged and re-sorted, comments removed, etc.)Can also export/print any `HashMap Name Value`, in the form exported from a
`Config` using `getMap`. Modify a map yourself to dynically
generate/customize configuration files!Sample output:
~~~haskell
foo {
bar {
baz1 = true
baz2 = [1, 0.6, "hello", true]
}
aardvark = "banana"
monkey = [true, false, 1.9e-3]
zebra = 24
}foo2 {
bar = 8.1e-8
}apple = ["cake", true]
orange = 8943
~~~Further configuration on sorting of keys, displaying of bools and floats, etc.
is possible by passing in custom `ConfStyle` style option values.Documentation maintained at
### Copyright
Copyright (c) Justin Le 2016