Text.Digestive.Html
Description
General functions for forms that are rendered to some sort of HTML
- data FormHtmlConfig = FormHtmlConfig {
- htmlInputClasses :: [String]
- htmlLabelClasses :: [String]
- htmlErrorClasses :: [String]
- htmlErrorListClasses :: [String]
- newtype FormHtml a = FormHtml {
- unFormHtml :: FormHtmlConfig -> a
- applyClasses :: (a -> String -> a) -> [FormHtmlConfig -> [String]] -> FormHtmlConfig -> a -> a
- defaultHtmlConfig :: FormHtmlConfig
- emptyHtmlConfig :: FormHtmlConfig
- renderFormHtml :: FormHtml a -> a
- renderFormHtmlWith :: FormHtmlConfig -> FormHtml a -> a
Documentation
data FormHtmlConfig Source
Settings for classes in generated HTML.
Constructors
| FormHtmlConfig | |
Fields
| |
Instances
HTML describing a form
Constructors
| FormHtml | |
Fields
| |
Arguments
| :: (a -> String -> a) | Apply the class attribute |
| -> [FormHtmlConfig -> [String]] | Labels to apply |
| -> FormHtmlConfig | Label configuration |
| -> a | HTML element |
| -> a | Resulting element |
Apply all classes to an HTML element. If no classes are found, nothing happens.
defaultHtmlConfig :: FormHtmlConfigSource
Default configuration
emptyHtmlConfig :: FormHtmlConfigSource
Empty configuration (no classes are set)
renderFormHtml :: FormHtml a -> aSource
Render FormHtml using the default configuration
renderFormHtmlWith :: FormHtmlConfig -> FormHtml a -> aSource
Render FormHtml using a custom configuration