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.Render

Description

Helper functions for constructing URLs and HTML fragments.

Synopsis

Documentation

data Scheme Source #

Simple sum type representing URL schemes.

Constructors

HTTPS 

Instances

buildURL Source #

Arguments

:: Scheme

The scheme

-> String

The domain (not including ://)

-> [String]

List of path components, to be separated by /.

-> [String]

List of query components, to be separated by &.

-> [String]

List of fragment components.

-> String 

Helper function for safely building URLs.

class QueryParameter t where Source #

Minimal complete definition

renderQueryParameter

queryValid Source #

Arguments

:: Show t 
=> Maybe t

The Valid parameter.

-> String

The parameter key.

-> String 

Helper function for rendering Maybe Valid shortcode parameters as query parameters.

queryOneOf Source #

Arguments

:: QueryParameter t 
=> Maybe t

The OneOf parameter.

-> String 

Helper function for rendering Maybe OneOf shortcode parameters as query parameters.

queryYesNo Source #

Arguments

:: Maybe YesNo

The YesNo parameter.

-> String

Parameter for the Yes case.

-> String

Parameter for the No case.

-> String 

Helper function for rendering Maybe YesNo shortcode parameters as query parameters.

pathValid :: Show t => Maybe t -> String Source #

Helper function for rendering Maybe Valid parameters as path components.

pathYesNo Source #

Arguments

:: Maybe YesNo

The YesNo parameter.

-> String

Path for the Yes case.

-> String

Path for the No case.

-> String 

Helper function for rendering Maybe YesNo parameters as path components.

pathValidPre Source #

Arguments

:: Show t 
=> String

The prefix path.

-> Maybe t

The Valid parameter.

-> [String] 

Helper function for rendering Maybe Valid parameters as path components, with a prefix.

pathYesNoPre Source #

Arguments

:: String

The prefix path.

-> Maybe YesNo

The YesNo parameter.

-> String

Path for the Yes case.

-> String

Path for the No case.

-> [String] 

Helper function for rendering Maybe YesNo parameters as path components, with a prefix.

attrValid :: (Monoid a, Show b) => (AttributeValue -> a) -> Maybe b -> a Source #

Helper function for optionally rendering a Maybe as an HTML attribute.