Copyright | (c) Eric Mertens 2017 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
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 :: ValueSpecs (Text,Maybe Int) configSpec = sectionsSpec "" $ liftA2 (,) (reqSection "username" "Name used to login") (optSection "attempts" "Number of login attempts") generateDocs configSpec -- Configuration file fields: -- username: REQUIRED text -- Name used to login -- attempts: integer -- Number of login attempts
- generateDocs :: ValueSpecs a -> Text
Documentation
generateDocs :: ValueSpecs a -> Text Source #
Default documentation generator. This generator is specifically
for configuration specifications where the top-level specification
is named with the empty string (""
).