1 module Rakka.Wiki.Interpreter
3 , InterpreterContext(..)
5 , commandName -- private
6 , commandType -- private
12 import Rakka.SystemConfig
17 = InlineCommandInterpreter {
19 , iciInterpret :: !(InterpreterContext -> InlineCommand -> IO InlineElement)
21 | BlockCommandInterpreter {
23 , bciInterpret :: !(InterpreterContext -> BlockCommand -> IO BlockElement)
27 data InterpreterContext
28 = InterpreterContext {
29 ctxPageName :: !PageName
30 , ctxTree :: !WikiPage
31 , ctxStorage :: !Storage
32 , ctxSysConf :: !SystemConfig
36 commandName :: Interpreter -> String
37 commandName (InlineCommandInterpreter name _) = name
38 commandName (BlockCommandInterpreter name _) = name
41 commandType :: Interpreter -> CommandType
42 commandType (InlineCommandInterpreter _ _) = InlineCommandType
43 commandType (BlockCommandInterpreter _ _) = BlockCommandType