| Copyright | (c) Eric Mertens 2017 |
|---|---|
| License | ISC |
| Maintainer | emertens@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Config.Schema.Docs
Description
This module generates a simple textual documentation format for a configuration schema. Each subsection and named value specification will generate it's own top-level component in the documentation.
This module is only one of the ways one could generate documentation for a particular configuration specification. All of the defintions would would need to be able to generate another form are exported by Config.Schema.Spec.
configSpec :: ValueSpec (Text,Maybe Int)
configSpec = sectionsSpec ""
$ liftA2 (,)
(reqSection "username" "Name used to login")
(optSection "attempts" "Number of login attempts")
generateDocs configSpec
-- Top-level configuration file fields:
-- username: REQUIRED text
-- Name used to login
-- attempts: integer
-- Number of login attempts
Synopsis
- generateDocs :: ValueSpec a -> Doc
Documentation
generateDocs :: ValueSpec a -> Doc Source #
Default documentation generator.