yesod-links-0.2.1: A typeclass which simplifies creating link widgets throughout your site

Portabilityunportable
Stabilityunstable
Maintainerpbrisbin@gmail.com
Safe HaskellNone

Yesod.Links

Description

 

Synopsis

Documentation

data Destination m Source

An internal route or external url

Constructors

Internal (Route m) 
External Text 

data Link m Source

A link to a Destination with supplied titles and text to be used when showing the html.

Constructors

Link 

class YesodLinked m Source

A type family class used to generalize widgets printing routes that are internal to your site

 instance YesodLinked MySite where
     type Linked = MySite

Associated Types

type Linked Source

class IsLink a whereSource

Any type can represent a link.

 instance IsLink MyAppRoute where
     toLink RootR  = Link (Internal RootR)  "go home"         "home"
     toLink AboutR = Link (Internal AboutR) "about this site" "about"
     ...

 getRootR :: Handler RepHtml
 getRootR = defaultLayout $ do
     [hamlet|

         be sure to visit our ^{link AboutR} page.

         |]

Methods

toLink :: a -> Link LinkedSource

link :: IsLink a => a -> GWidget s Linked ()Source

Link to any IsLink type. This is simply link' . toLink.

link' :: Link m -> GWidget s m ()Source

Link to a raw Link. Can be used even if your site is not an instance of YesodLinked.