Safe Haskell | None |
---|---|
Language | GHC2021 |
Web.Rep.Page
Description
Representations of a web page, covering Html, CSS & JS artifacts.
Synopsis
- data Page = Page {}
- data PageConfig = PageConfig {}
- defaultPageConfig :: FilePath -> PageConfig
- data Concerns a = Concerns {
- cssConcern :: a
- jsConcern :: a
- htmlConcern :: a
- suffixes :: Concerns FilePath
- concernNames :: FilePath -> FilePath -> Concerns FilePath
- data PageConcerns
- data PageStructure
- newtype Css = Css {}
- renderCss :: RenderStyle -> Css -> ByteString
- cssColorScheme :: Css
- newtype Js = Js {}
- onLoad :: Js -> Js
Documentation
Components of a web page.
A web page can take many forms but still have the same underlying representation. For example, CSS can be linked to in a separate file, or can be inline within html, but still be the same css and have the same expected external effect. A Page represents the practical components of what makes up a static snapshot of a web page.
Constructors
Page | |
Instances
data PageConfig Source #
Configuration options when rendering a Page
.
Constructors
PageConfig | |
Fields
|
Instances
Generic PageConfig Source # | |||||
Defined in Web.Rep.Page Associated Types
| |||||
Show PageConfig Source # | |||||
Defined in Web.Rep.Page Methods showsPrec :: Int -> PageConfig -> ShowS # show :: PageConfig -> String # showList :: [PageConfig] -> ShowS # | |||||
Eq PageConfig Source # | |||||
Defined in Web.Rep.Page | |||||
type Rep PageConfig Source # | |||||
Defined in Web.Rep.Page type Rep PageConfig = D1 ('MetaData "PageConfig" "Web.Rep.Page" "web-rep-0.13.0.0-XUyJJnH52HD579uoRfgvk" 'False) (C1 ('MetaCons "PageConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "concerns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PageConcerns) :*: S1 ('MetaSel ('Just "structure") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PageStructure)) :*: (S1 ('MetaSel ('Just "renderStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RenderStyle) :*: (S1 ('MetaSel ('Just "filenames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Concerns FilePath)) :*: S1 ('MetaSel ('Just "localdirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]))))) |
defaultPageConfig :: FilePath -> PageConfig Source #
Default configuration is inline ecma and css, separate html header and body, minified code, with the suggested filename prefix.
A web page typically is composed of some css, javascript and html.
Concerns
abstracts this structural feature of a web page.
Constructors
Concerns | |
Fields
|
Instances
Applicative Concerns Source # | |||||
Functor Concerns Source # | |||||
Foldable Concerns Source # | |||||
Defined in Web.Rep.Page Methods fold :: Monoid m => Concerns m -> m # foldMap :: Monoid m => (a -> m) -> Concerns a -> m # foldMap' :: Monoid m => (a -> m) -> Concerns a -> m # foldr :: (a -> b -> b) -> b -> Concerns a -> b # foldr' :: (a -> b -> b) -> b -> Concerns a -> b # foldl :: (b -> a -> b) -> b -> Concerns a -> b # foldl' :: (b -> a -> b) -> b -> Concerns a -> b # foldr1 :: (a -> a -> a) -> Concerns a -> a # foldl1 :: (a -> a -> a) -> Concerns a -> a # elem :: Eq a => a -> Concerns a -> Bool # maximum :: Ord a => Concerns a -> a # minimum :: Ord a => Concerns a -> a # | |||||
Traversable Concerns Source # | |||||
Generic (Concerns a) Source # | |||||
Defined in Web.Rep.Page Associated Types
| |||||
Show a => Show (Concerns a) Source # | |||||
Eq a => Eq (Concerns a) Source # | |||||
type Rep (Concerns a) Source # | |||||
Defined in Web.Rep.Page type Rep (Concerns a) = D1 ('MetaData "Concerns" "Web.Rep.Page" "web-rep-0.13.0.0-XUyJJnH52HD579uoRfgvk" 'False) (C1 ('MetaCons "Concerns" 'PrefixI 'True) (S1 ('MetaSel ('Just "cssConcern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: (S1 ('MetaSel ('Just "jsConcern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Just "htmlConcern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))) |
concernNames :: FilePath -> FilePath -> Concerns FilePath Source #
Create filenames for each Concern element.
data PageConcerns Source #
Is the rendering to include all Concerns
(typically in a html file) or be separated (tyypically into separate files and linked in the html file)?
Instances
Generic PageConcerns Source # | |||||
Defined in Web.Rep.Page Associated Types
| |||||
Show PageConcerns Source # | |||||
Defined in Web.Rep.Page Methods showsPrec :: Int -> PageConcerns -> ShowS # show :: PageConcerns -> String # showList :: [PageConcerns] -> ShowS # | |||||
Eq PageConcerns Source # | |||||
Defined in Web.Rep.Page | |||||
type Rep PageConcerns Source # | |||||
data PageStructure Source #
Various ways that a Html file can be structured.
Constructors
HeaderBody | |
Headless | |
Snippet |
Instances
Generic PageStructure Source # | |||||
Defined in Web.Rep.Page Associated Types
| |||||
Show PageStructure Source # | |||||
Defined in Web.Rep.Page Methods showsPrec :: Int -> PageStructure -> ShowS # show :: PageStructure -> String # showList :: [PageStructure] -> ShowS # | |||||
Eq PageStructure Source # | |||||
Defined in Web.Rep.Page Methods (==) :: PageStructure -> PageStructure -> Bool # (/=) :: PageStructure -> PageStructure -> Bool # | |||||
type Rep PageStructure Source # | |||||
Defined in Web.Rep.Page type Rep PageStructure = D1 ('MetaData "PageStructure" "Web.Rep.Page" "web-rep-0.13.0.0-XUyJJnH52HD579uoRfgvk" 'False) (C1 ('MetaCons "HeaderBody" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Headless" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Snippet" 'PrefixI 'False) (U1 :: Type -> Type))) |
css as a string.
Constructors
Css | |
Fields |
Instances
Monoid Css Source # | |||||
Semigroup Css Source # | |||||
Generic Css Source # | |||||
Defined in Web.Rep.Page Associated Types
| |||||
Show Css Source # | |||||
Eq Css Source # | |||||
type Rep Css Source # | |||||
Defined in Web.Rep.Page type Rep Css = D1 ('MetaData "Css" "Web.Rep.Page" "web-rep-0.13.0.0-XUyJJnH52HD579uoRfgvk" 'True) (C1 ('MetaCons "Css" 'PrefixI 'True) (S1 ('MetaSel ('Just "cssByteString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) |
renderCss :: RenderStyle -> Css -> ByteString Source #
Render Css
as text.
cssColorScheme :: Css Source #
Css snippet for reponsiveness to preferred color-scheme.
Javascript as string
Constructors
Js | |
Fields |
Instances
Monoid Js Source # | |||||
Semigroup Js Source # | |||||
Generic Js Source # | |||||
Defined in Web.Rep.Page Associated Types
| |||||
Show Js Source # | |||||
Eq Js Source # | |||||
type Rep Js Source # | |||||
Defined in Web.Rep.Page type Rep Js = D1 ('MetaData "Js" "Web.Rep.Page" "web-rep-0.13.0.0-XUyJJnH52HD579uoRfgvk" 'True) (C1 ('MetaCons "Js" 'PrefixI 'True) (S1 ('MetaSel ('Just "jsByteString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) |