| Copyright | (c) Nathan Bloomfield 2017 |
|---|---|
| License | GPL-3 |
| Maintainer | nbloomf@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Hakyll.Shortcode.Render
Description
Helper functions for constructing URLs and HTML fragments.
- data Scheme = HTTPS
- buildURL :: Scheme -> String -> [String] -> [String] -> [String] -> String
- class QueryParameter t where
- queryValid :: Show t => Maybe t -> String -> String
- queryOneOf :: QueryParameter t => Maybe t -> String
- queryYesNo :: Maybe YesNo -> String -> String -> String
- pathValid :: Show t => Maybe t -> String
- pathYesNo :: Maybe YesNo -> String -> String -> String
- pathValidPre :: Show t => String -> Maybe t -> [String]
- pathYesNoPre :: String -> Maybe YesNo -> String -> String -> [String]
- attrValid :: (Monoid a, Show b) => (AttributeValue -> a) -> Maybe b -> a
Documentation
Simple sum type representing URL schemes.
Constructors
| HTTPS |
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
Methods
renderQueryParameter :: t -> String Source #
Helper function for rendering Maybe Valid shortcode parameters as query parameters.
Arguments
| :: QueryParameter t | |
| => Maybe t | The |
| -> String |
Helper function for rendering Maybe OneOf shortcode parameters as query parameters.
Arguments
| :: Maybe YesNo | The |
| -> String | Parameter for the |
| -> String | Parameter for the |
| -> 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.
Arguments
| :: Maybe YesNo | The |
| -> String | Path for the |
| -> String | Path for the |
| -> String |
Helper function for rendering Maybe YesNo parameters as path components.
Helper function for rendering Maybe Valid parameters as path components, with a prefix.