module Rakka.Wiki.Interpreter.Base ( interpreters ) where import Rakka.Wiki import Rakka.Wiki.Interpreter interpreters :: [Interpreter] interpreters = [ lineBreakInterp , spanInterp , divInterp , pageNameInterp ] lineBreakInterp :: Interpreter lineBreakInterp = InlineCommandInterpreter { iciName = "br" , iciInterpret = \ _ (InlineCommand _ attrs _) -> return $ LineBreak attrs } spanInterp :: Interpreter spanInterp = InlineCommandInterpreter { iciName = "span" , iciInterpret = \ _ (InlineCommand _ attrs contents) -> return $ Span attrs contents } divInterp :: Interpreter divInterp = BlockCommandInterpreter { bciName = "div" , bciInterpret = \ _ (BlockCommand _ attrs contents) -> return $ Div attrs contents } pageNameInterp :: Interpreter pageNameInterp = InlineCommandInterpreter { iciName = "pageName" , iciInterpret = \ ctx _ -> return $ Text (ctxPageName ctx) }