Lykah-0.0.2: A static website and blog generator

Safe HaskellNone
LanguageHaskell2010

Lykah.Assets

Description

Low-level module for Assets that are used to build websites.

Synopsis

Documentation

data Pathed c Source #

Constructors

Pathed 

Instances

Functor Pathed Source # 

Methods

fmap :: (a -> b) -> Pathed a -> Pathed b #

(<$) :: a -> Pathed b -> Pathed a #

Foldable Pathed Source # 

Methods

fold :: Monoid m => Pathed m -> m #

foldMap :: Monoid m => (a -> m) -> Pathed a -> m #

foldr :: (a -> b -> b) -> b -> Pathed a -> b #

foldr' :: (a -> b -> b) -> b -> Pathed a -> b #

foldl :: (b -> a -> b) -> b -> Pathed a -> b #

foldl' :: (b -> a -> b) -> b -> Pathed a -> b #

foldr1 :: (a -> a -> a) -> Pathed a -> a #

foldl1 :: (a -> a -> a) -> Pathed a -> a #

toList :: Pathed a -> [a] #

null :: Pathed a -> Bool #

length :: Pathed a -> Int #

elem :: Eq a => a -> Pathed a -> Bool #

maximum :: Ord a => Pathed a -> a #

minimum :: Ord a => Pathed a -> a #

sum :: Num a => Pathed a -> a #

product :: Num a => Pathed a -> a #

Traversable Pathed Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Pathed a -> f (Pathed b) #

sequenceA :: Applicative f => Pathed (f a) -> f (Pathed a) #

mapM :: Monad m => (a -> m b) -> Pathed a -> m (Pathed b) #

sequence :: Monad m => Pathed (m a) -> m (Pathed a) #

Show c => Show (Pathed c) Source # 

Methods

showsPrec :: Int -> Pathed c -> ShowS #

show :: Pathed c -> String #

showList :: [Pathed c] -> ShowS #

IDO (Pathed a) Source # 

Methods

getId :: Pathed a -> Identifier Source #

data Env a Source #

Environment for the currently rendered Ehtml's asset

Constructors

Env 

Fields

Instances

Functor Env Source # 

Methods

fmap :: (a -> b) -> Env a -> Env b #

(<$) :: a -> Env b -> Env a #

class IDO a where Source #

Minimal complete definition

getId

Methods

getId :: a -> Identifier Source #

Instances

root :: Pathed a -> Pathed () Source #

returns top-most parent

reference :: (IDO a, MonadWriter [Identifier] m, MonadTrans t) => a -> t m () Source #

reference a Pathed value to ensure it is included in output

data Asset Source #

is the result of the render method from the Content class

Constructors

Copy FilePath

the asset can be generated by copying this file

CopyDir FilePath

the asset can be generated by copying this directory

Write T.Text

the asset can be generated by writing this text

WriteIO (IO T.Text)

the asset can be generated by writing the result of an IO action

Concat [Asset]

the asset can be generated by concatenating the contents described by a list of assets

Instances

uniquify :: [Pathed ()] -> Env () Source #

generate a map of Pathed objects with unique IDs and paths

generateAssets Source #

Arguments

:: Bool

Debug

-> FilePath

target directory

-> Assets 
-> IO () 

Generates all assets and their depending assets in the target dir (careful: removes preexisting target dir)

onlyUsed :: [Identifier] -> Assets -> Assets Source #

Extract only these assets of a list of IDs that are actually used