hakyll-shortcode-0.0.2: A shortcode extension module for Hakyll

Copyright(c) Nathan Bloomfield 2017
LicenseGPL-3
Maintainernbloomf@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Hakyll.Shortcode.Service

Description

 

Synopsis

Documentation

class Shortcode t where Source #

Class representing abstract shortcode types.

Minimal complete definition

tag, attributes, emptycode, embedcode

Methods

tag :: ShortcodeTag t Source #

The tag for our shortcode.

attributes :: [ShortcodeAttribute t] Source #

The allowed keys for our shortcode.

emptycode :: t Source #

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.

Constructors

ShortcodeTag String 

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.

Constructors

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 Source #

Generic shortcode expansion. This function almost certainly should not be called directly unless you are implementing a new shortcode.

missingError :: String -> String -> String Source #

Helper function for reporting errors; this one in case we are trying to expand a shortcode with a missing key value.