| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
Slab.Syntax
Synopsis
- data Block- = BlockDoctype
- | BlockElem Elem TrailingSym [Attr] [Block]
- | BlockText TextSyntax [Inline]
- | BlockInclude (Maybe Text) FilePath (Maybe [Block])
- | BlockFragmentDef Text [Text] [Block]
- | BlockFragmentCall Text [Expr] [Block]
- | BlockFor Text (Maybe Text) Expr [Block]
- | BlockComment CommentType Text
- | BlockFilter Text Text
- | BlockRawElem Text [Block]
- | BlockDefault Text [Block]
- | BlockImport FilePath (Maybe [Block]) [Block]
- | BlockRun Text (Maybe [Block])
- | BlockReadJson Text FilePath (Maybe Value)
- | BlockAssignVar Text Expr
- | BlockIf Expr [Block] [Block]
- | BlockList [Block]
- | BlockCode Expr
 
- isDoctype :: Block -> Bool
- data CommentType
- data Elem- = Html
- | Body
- | Div
- | Span
- | Br
- | Hr
- | H1
- | H2
- | H3
- | H4
- | H5
- | H6
- | Header
- | Head
- | Meta
- | Main
- | Link
- | A
- | P
- | Ul
- | Li
- | Title
- | Table
- | Thead
- | Tbody
- | Tr
- | Td
- | Dl
- | Dt
- | Dd
- | Footer
- | Figure
- | Form
- | Label
- | Blockquote
- | Button
- | Figcaption
- | Audio
- | Script
- | Style
- | Small
- | Source
- | Pre
- | Code
- | Img
- | IFrame
- | Input
- | I
- | Svg
- | Textarea
- | Canvas
 
- data TrailingSym
- data Attr
- data TextSyntax
- data Expr
- data Inline
- data Env = Env {- envVariables :: [(Text, Expr)]
 
- emptyEnv :: Env
- trailingSym :: Block -> TrailingSym
- freeVariables :: Expr -> [Text]
- thunk :: Env -> Expr -> Expr
- extractClasses :: [Block] -> [Text]
- extractFragments :: [Block] -> [BlockFragment]
- findFragment :: Text -> [BlockFragment] -> Maybe [Block]
- idNamesFromAttrs :: [Attr] -> [Text]
- classNamesFromAttrs :: [Attr] -> [Text]
- namesFromAttrs :: [Attr] -> [(Text, Text)]
- groupAttrs :: [Attr] -> [Attr]
Documentation
Constructors
| BlockDoctype | Only  | 
| BlockElem Elem TrailingSym [Attr] [Block] | |
| BlockText TextSyntax [Inline] | |
| BlockInclude (Maybe Text) FilePath (Maybe [Block]) | 
 | 
| BlockFragmentDef Text [Text] [Block] | This doesn't exist in Pug. This is like a mixin than receive block arguments.
 Or like a parent template that can be  | 
| BlockFragmentCall Text [Expr] [Block] | |
| BlockFor Text (Maybe Text) Expr [Block] | |
| BlockComment CommentType Text | |
| BlockFilter Text Text | |
| BlockRawElem Text [Block] | |
| BlockDefault Text [Block] | 
 | 
| BlockImport FilePath (Maybe [Block]) [Block] | Similar to an anonymous fragment call, where the fragment body is the content of the referenced file. | 
| BlockRun Text (Maybe [Block]) | |
| BlockReadJson Text FilePath (Maybe Value) | Allow to assign the content of a JSON file to a variable. The syntax
 is specific to how Struct has a  | 
| BlockAssignVar Text Expr | |
| BlockIf Expr [Block] [Block] | |
| BlockList [Block] | |
| BlockCode Expr | 
data CommentType Source #
A "passthrough" comment will be included in the generated HTML.
Constructors
| NormalComment | |
| PassthroughComment | 
Instances
| Show CommentType Source # | |
| Defined in Slab.Syntax Methods showsPrec :: Int -> CommentType -> ShowS # show :: CommentType -> String # showList :: [CommentType] -> ShowS # | |
| Eq CommentType Source # | |
| Defined in Slab.Syntax | |
data TrailingSym Source #
Instances
| Show TrailingSym Source # | |
| Defined in Slab.Syntax Methods showsPrec :: Int -> TrailingSym -> ShowS # show :: TrailingSym -> String # showList :: [TrailingSym] -> ShowS # | |
| Eq TrailingSym Source # | |
| Defined in Slab.Syntax | |
data TextSyntax Source #
Constructors
| Normal | The text follows an element on the same line. | 
| Pipe | The text follows a pipe character. Multiple lines each introduced by a
 pipe symbol are grouped as a single  | 
| Dot | The text is part of a text block following a trailing dot. | 
| Include | The text is the content of an include statement without a .slab extension. | 
| RunOutput | The text is the output of command. | 
Instances
| Show TextSyntax Source # | |
| Defined in Slab.Syntax Methods showsPrec :: Int -> TextSyntax -> ShowS # show :: TextSyntax -> String # showList :: [TextSyntax] -> ShowS # | |
| Eq TextSyntax Source # | |
| Defined in Slab.Syntax | |
Simple expression language.
Constructors
| Env | |
| Fields 
 | |
trailingSym :: Block -> TrailingSym Source #
freeVariables :: Expr -> [Text] Source #
extractClasses :: [Block] -> [Text] Source #
extractFragments :: [Block] -> [BlockFragment] Source #
idNamesFromAttrs :: [Attr] -> [Text] Source #
classNamesFromAttrs :: [Attr] -> [Text] Source #
groupAttrs :: [Attr] -> [Attr] Source #
Group multiple classes or IDs in a single class or ID, and transform the
 other attributes in SingleQuoteStrings.