bureaucromancy-0.1.0.2: Parse webforms & render to interactive hypertext
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.HTML.Form.WebApp

Description

Renders forms to an HTML menu, for the sake of highly-constrained browser engines. Like those dealing with TV remotes.

Synopsis

Documentation

renderPage :: Form -> [Text] -> Query -> IO (Maybe (Either Query Text)) Source #

Converts URI path & query to rendered hyper-linked HTML representing menus for selecting values to upload to the server as prescribed by the given form. These values are returned to caller on the Left-branch.

data Form Source #

A collection of controls intended to be handle by a particular URL endpoint.

Constructors

Form 

Fields

  • action :: URI

    The URL which should receive valid input from this form.

  • enctype :: Text

    How to encode the data to be received by the URL.

  • method :: Text

    Which HTTP method to use.

  • validate :: Bool

    Whether to validate the form data before submitting it to the endpoint.

  • target :: Text

    Where to display the response.

  • acceptCharset :: [Text]

    Which character sets to encode the data in.

  • autocomplete :: Bool

    Whether to offer autocompletions for all controls.

  • formName :: Text

    The name of this form.

  • rel :: Text

    The purpose of this form, typically using an external vocabulary.

  • inputs :: [Input]

    What data should be sent to the endpoint.

  • lang :: String

    Which human language the form is written? To which additional messages should be localized?

type Query = [(ByteString, Maybe ByteString)] Source #

The query string manipulated by this serverside webapp.