module Rakka.Wiki.Interpreter ( Interpreter(..) , commandName -- private , commandType -- private , pureInlineInterp ) where import Rakka.Page import Rakka.Storage import Rakka.SystemConfig import Rakka.Wiki data Interpreter = InlineCommandInterpreter { iciName :: String , iciInterpret :: InlineCommand -> Maybe Page -> Storage -> SystemConfig -> IO InlineElement } commandName :: Interpreter -> String commandName (InlineCommandInterpreter name _) = name commandType :: Interpreter -> CommandType commandType (InlineCommandInterpreter _ _) = InlineCommandType pureInlineInterp :: String -> (InlineCommand -> Maybe Page -> InlineElement) -> Interpreter pureInlineInterp name f = InlineCommandInterpreter name $ \ cmd page _ _ -> return $ f cmd page