Copyright | (c) Eric Mertens 2023 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- type TomlDoc = Doc DocClass
- data DocClass
- prettyToml :: Table -> TomlDoc
- prettyValue :: Value -> TomlDoc
- prettyToken :: Token -> String
- prettySectionKind :: SectionKind -> NonEmpty String -> TomlDoc
- prettySimpleKey :: String -> Doc a
- prettyKey :: NonEmpty String -> TomlDoc
Types
type TomlDoc = Doc DocClass Source #
Pretty-printer document with TOML class attributes to aid in syntax-highlighting.
Annotation used to enable styling pretty-printed TOML
TableClass | top-level |
KeyClass | dotted keys, left-hand side of assignments |
StringClass | string literals |
NumberClass | number literals |
DateClass | date and time literals |
BoolClass | boolean literals |
semantic values
prettyToml :: Table -> TomlDoc Source #
Render a complete TOML document using top-level table and array of table sections where appropriate.
prettyValue :: Value -> TomlDoc Source #
Render a value suitable for assignment on the right-hand side of an equals sign. This value will always occupy a single line.
syntactic components
prettyToken :: Token -> String Source #
Render token for human-readable error messages.
prettySectionKind :: SectionKind -> NonEmpty String -> TomlDoc Source #
Pretty-print a section heading. The result is annotated as a TableClass
.
keys
prettySimpleKey :: String -> Doc a Source #
Renders a simple-key using quotes where necessary.