ema-0.10.0.0: Static site generator library with hot reload
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ema.Route.Class

Synopsis

Documentation

class IsRoute r where Source #

Class of Ema routes

An Ema route has a Prism' routePrism, that knows how to convert it to/from filepaths. As well as an universe function, routeUniverse, that gives all possible route values in a static site.

Both functions take the associated model, `RouteModel r`, as an argument.

Associated Types

type RouteModel r :: Type Source #

Methods

routePrism :: RouteModel r -> Prism_ FilePath r Source #

An optics Prism` that denotes how to encode and decode a route.

routeUniverse :: RouteModel r -> [r] Source #

All possible route values for the given RouteModel.

This is used in determining the pages to statically generate.

Instances

Instances details
IsRoute () Source # 
Instance details

Defined in Ema.Route.Class

Associated Types

type RouteModel () Source #

KnownSymbol fn => IsRoute (FileRoute fn) Source # 
Instance details

Defined in Ema.Route.Lib.File

Associated Types

type RouteModel (FileRoute fn) Source #

(IsRoute r, IsRoute (MultiRoute rs), RouteModel (MultiRoute rs) ~ NP I (MultiModel rs)) => IsRoute (MultiRoute (r ': rs)) Source # 
Instance details

Defined in Ema.Route.Lib.Multi

Associated Types

type RouteModel (MultiRoute (r ': rs)) Source #

Methods

routePrism :: RouteModel (MultiRoute (r ': rs)) -> Prism_ FilePath (MultiRoute (r ': rs)) Source #

routeUniverse :: RouteModel (MultiRoute (r ': rs)) -> [MultiRoute (r ': rs)] Source #

IsRoute (MultiRoute ('[] :: [Type])) Source # 
Instance details

Defined in Ema.Route.Lib.Multi

Associated Types

type RouteModel (MultiRoute '[]) Source #

(IsRoute r, KnownSymbol prefix) => IsRoute (FolderRoute prefix r) Source # 
Instance details

Defined in Ema.Route.Lib.Folder

Associated Types

type RouteModel (FolderRoute prefix r) Source #