emanote-1.0.0.0: Emanate a structured view of your plain-text notes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Emanote.Route.R

Synopsis

Documentation

newtype R (ext :: FileType a) Source #

Represents the relative path to some file (or its isomporphic URL represetation).

Constructors

R 

Fields

Instances

Instances details
Indexable NoteIxs Note Source # 
Instance details

Defined in Emanote.Model.Note

Indexable SDataIxs SData Source # 
Instance details

Defined in Emanote.Model.SData

Indexable StaticFileIxs StaticFile Source # 
Instance details

Defined in Emanote.Model.StaticFile

HasExt ext => ToJSON (R ext) Source # 
Instance details

Defined in Emanote.Route.R

Methods

toJSON :: R ext -> Value #

toEncoding :: R ext -> Encoding #

toJSONList :: [R ext] -> Value #

toEncodingList :: [R ext] -> Encoding #

(Typeable a, Typeable ext) => Data (R ext) Source # 
Instance details

Defined in Emanote.Route.R

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> R ext -> c (R ext) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (R ext) #

toConstr :: R ext -> Constr #

dataTypeOf :: R ext -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (R ext)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (R ext)) #

gmapT :: (forall b. Data b => b -> b) -> R ext -> R ext #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> R ext -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> R ext -> r #

gmapQ :: (forall d. Data d => d -> u) -> R ext -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> R ext -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> R ext -> m (R ext) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> R ext -> m (R ext) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> R ext -> m (R ext) #

HasExt ext => Show (R ext) Source # 
Instance details

Defined in Emanote.Route.R

Methods

showsPrec :: Int -> R ext -> ShowS #

show :: R ext -> String #

showList :: [R ext] -> ShowS #

Eq (R ext) Source # 
Instance details

Defined in Emanote.Route.R

Methods

(==) :: R ext -> R ext -> Bool #

(/=) :: R ext -> R ext -> Bool #

Ord (R ext) Source # 
Instance details

Defined in Emanote.Route.R

Methods

compare :: R ext -> R ext -> Ordering #

(<) :: R ext -> R ext -> Bool #

(<=) :: R ext -> R ext -> Bool #

(>) :: R ext -> R ext -> Bool #

(>=) :: R ext -> R ext -> Bool #

max :: R ext -> R ext -> R ext #

min :: R ext -> R ext -> R ext #

mkRouteFromFilePath :: forall a (ext :: FileType a). HasExt ext => FilePath -> Maybe (R ext) Source #

Convert foo/bar.ext to a R

routeSlug :: R ext -> Maybe Slug Source #

If the route is a single-slug URL, return the only slug.

routeSlugWithPrefix :: NonEmpty Slug -> R ext -> Maybe Slug Source #

Like routeSlug but skips the given prefixes, returning the (only) pending slug.

routeBaseName :: R ext -> Text Source #

The base name of the route without its parent path.

routeInits :: R ext -> NonEmpty (R ext) Source #

For use in breadcrumbs

encodeRoute :: forall a (ft :: FileType a). HasExt ft => R ft -> FilePath Source #

Convert a route to filepath

decodeHtmlRoute :: FilePath -> R 'Html Source #

Parse our route from html file path