Copyright | (c) Nathan Bloomfield 2017 |
---|---|
License | GPL-3 |
Maintainer | nbloomf@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- class Shortcode t where
- data ShortcodeTag a = ShortcodeTag String
- data ShortcodeAttribute t where
- YesNo :: String -> (YesNo -> t -> t) -> ShortcodeAttribute t
- OneOf :: String -> [(String, t -> t)] -> ShortcodeAttribute t
- Valid :: Validate a => String -> (a -> t -> t) -> ShortcodeAttribute t
- expandShortcodes :: Shortcode t => t -> String -> String
- missingError :: String -> String -> String
Documentation
class Shortcode t where Source #
Class representing abstract shortcode types.
tag :: ShortcodeTag t Source #
The tag for our shortcode.
attributes :: [ShortcodeAttribute t] Source #
The allowed keys for our shortcode.
An empty shortcode instance.
embedcode :: t -> String Source #
Convert t to HTML.
data ShortcodeTag a Source #
Type representing the tag of a shortcode; such as youtube
.
Show (ShortcodeTag a) Source # | |
data ShortcodeAttribute t where Source #
Type representing the allowed attributes of a shortcode. These come in three forms: Yes/No attributes, which are present or not; Enumerated attributes, which take on one of a given list of values; and Validated attributes, whose values are strings of a given form.
YesNo :: String -> (YesNo -> t -> t) -> ShortcodeAttribute t | |
OneOf :: String -> [(String, t -> t)] -> ShortcodeAttribute t | |
Valid :: Validate a => String -> (a -> t -> t) -> ShortcodeAttribute t |