1 module Rakka.Wiki.Interpreter.Base
8 import Rakka.Wiki.Interpreter
9 import Rakka.Wiki.Interpreter.Base.Image
12 baseInterpreters :: [Interpreter]
13 baseInterpreters = [ lineBreakInterp
23 lineBreakInterp :: Interpreter
24 lineBreakInterp = InlineCommandInterpreter {
27 = \ _ (InlineCommand _ attrs _) -> return $ LineBreak attrs
31 spanInterp :: Interpreter
32 spanInterp = InlineCommandInterpreter {
35 = \ _ (InlineCommand _ attrs contents) -> return $ Span attrs contents
39 divInterp :: Interpreter
40 divInterp = BlockCommandInterpreter {
43 = \ _ (BlockCommand _ attrs contents) -> return $ Div attrs contents
47 pageNameInterp :: Interpreter
48 pageNameInterp = InlineCommandInterpreter {
51 = \ ctx (InlineCommand _ _ _) -> case ctxPage ctx of
52 Nothing -> return $ Text "(None)"
53 Just page -> return $ Text $ pageName page