)
where
-import Control.Arrow
-import Control.Arrow.ListArrow
import Data.Map (Map)
import qualified Data.Map as M
import Data.Maybe
import Rakka.SystemConfig
import Rakka.Wiki
import Rakka.Wiki.Interpreter
-import Text.XML.HXT.Arrow.XmlArrow
-import Text.XML.HXT.Arrow.XmlNodeSet
+import Text.XML.HXT.Arrow
interpreters :: [Interpreter]
, newPageInterp
, editPageInterp
, loginInterp
+ , searchFieldInterp
+ , configurationInterp
]
pageNameInterp = InlineCommandInterpreter {
iciName = "pageName"
, iciInterpret
- = \ ctx _ -> return $ Text (ctxPageName ctx)
+ = \ ctx _ -> return $ Text (fromMaybe "" $ ctxPageName ctx)
}
iciName = "editPage"
, iciInterpret
= \ ctx (InlineCommand _ args _) ->
- let name = fromMaybe (ctxPageName ctx) (lookup "page" args)
+ let name = fromMaybe (fromMaybe "" $ ctxPageName ctx) (lookup "page" args)
label = fromMaybe "Edit this page" (lookup "label" args)
attrs = [ ("type" , "button")
, ("value" , label)
iciName = "login"
, iciInterpret
= \ _ _ ->
- let attrs = [ ("type" , "button")
- , ("value" , "Login")
- , ("class" , "loginButton")
+ let attrs = [ ("type" , "button")
+ , ("value", "Login")
+ , ("class", "loginButton")
]
in
return (Input attrs)
- }
\ No newline at end of file
+ }
+
+
+-- <input type="text"
+-- class="searchField" />
+searchFieldInterp :: Interpreter
+searchFieldInterp
+ = InlineCommandInterpreter {
+ iciName = "searchField"
+ , iciInterpret
+ = \ _ _ ->
+ let attrs = [ ("type" , "text")
+ , ("class", "searchField")
+ ]
+ in
+ return (Input attrs)
+ }
+
+-- <input type="button"
+-- value="Configuration"
+-- class="configButton" />
+configurationInterp :: Interpreter
+configurationInterp
+ = InlineCommandInterpreter {
+ iciName = "configuration"
+ , iciInterpret
+ = \ _ _ ->
+ let attrs = [ ("type" , "button")
+ , ("value", "Configuration")
+ , ("class", "configButton")
+ ]
+ in
+ return (Input attrs)
+ }