]> gitweb @ CieloNegro.org - Rakka.git/blob - Rakka/Wiki/Interpreter/Base.hs
Record before an experiment
[Rakka.git] / Rakka / Wiki / Interpreter / Base.hs
1 module Rakka.Wiki.Interpreter.Base
2     ( baseInterpreters
3     )
4     where
5
6 import           Rakka.Wiki
7 import           Rakka.Wiki.Interpreter
8 import           Rakka.Wiki.Interpreter.Base.Image
9
10
11 baseInterpreters :: [Interpreter]
12 baseInterpreters = [ lineBreakInterp
13                    , spanInterp
14                    , divInterp
15                    , imageInterp
16                    , imgFrameInterp
17                    ]
18
19
20 lineBreakInterp :: Interpreter
21 lineBreakInterp = InlineCommandInterpreter {
22                     iciName      = "br"
23                   , iciInterpret
24                       = \ _ (InlineCommand _ attrs _) -> return $ LineBreak attrs
25                   }
26
27
28 spanInterp :: Interpreter
29 spanInterp = InlineCommandInterpreter {
30                iciName      = "span"
31              , iciInterpret
32                  = \ _ (InlineCommand _ attrs contents) -> return $ Span attrs contents
33              }
34
35
36 divInterp :: Interpreter
37 divInterp = BlockCommandInterpreter {
38               bciName      = "div"
39             , bciInterpret
40                 = \ _ (BlockCommand _ attrs contents) -> return $ Div attrs contents
41             }