]> gitweb @ CieloNegro.org - Rakka.git/blob - Rakka/Wiki/Interpreter/Base.hs
Implemented block commands
[Rakka.git] / Rakka / Wiki / Interpreter / Base.hs
1 module Rakka.Wiki.Interpreter.Base
2     ( baseInterpreters
3     )
4     where
5
6 import           Rakka.Wiki.Interpreter
7 import           Rakka.Wiki
8
9
10 baseInterpreters :: [Interpreter]
11 baseInterpreters = [ lineBreakInterp
12                    , spanInterp
13                    , divInterp
14                    ]
15
16
17 lineBreakInterp :: Interpreter
18 lineBreakInterp = pureInlineInterp "br" interpret
19     where
20       interpret (InlineCommand _ attrs _) _ = LineBreak attrs
21
22
23 spanInterp :: Interpreter
24 spanInterp = pureInlineInterp "span" interpret
25     where
26       interpret (InlineCommand _ attrs contents) _ = Span attrs contents
27
28
29 divInterp :: Interpreter
30 divInterp = pureBlockInterp "div" interpret
31     where
32       interpret (BlockCommand _ attrs contents) _ = Div attrs contents