, otherLangsInterp
, newPageInterp
, editPageInterp
+ , loginInterp
]
lineBreakInterp :: Interpreter
lineBreakInterp = InlineCommandInterpreter {
- iciName = "br"
+ iciName = "br"
, iciInterpret
= \ _ (InlineCommand _ attrs _) -> return $ LineBreak attrs
}
spanInterp :: Interpreter
spanInterp = InlineCommandInterpreter {
- iciName = "span"
+ iciName = "span"
, iciInterpret
= \ _ (InlineCommand _ attrs contents) -> return $ Span attrs contents
}
divInterp :: Interpreter
divInterp = BlockCommandInterpreter {
- bciName = "div"
+ bciName = "div"
, bciInterpret
= \ _ (BlockCommand _ attrs contents)
-> return $ Div attrs (map Block contents)
pageNameInterp :: Interpreter
pageNameInterp = InlineCommandInterpreter {
- iciName = "pageName"
+ iciName = "pageName"
, iciInterpret
= \ ctx _ -> return $ Text (ctxPageName ctx)
}
otherLangsInterp :: Interpreter
otherLangsInterp
= BlockCommandInterpreter {
- bciName = "inOtherLanguages"
+ bciName = "inOtherLanguages"
, bciInterpret
= \ ctx _ ->
let linkTable = case ctxMainPage ctx of
newPageInterp :: Interpreter
newPageInterp
= InlineCommandInterpreter {
- iciName = "newPage"
+ iciName = "newPage"
, iciInterpret
= \ _ (InlineCommand _ args _) ->
let label = fromMaybe "Create new page" (lookup "label" args)
editPageInterp :: Interpreter
editPageInterp
= InlineCommandInterpreter {
- iciName = "editPage"
+ iciName = "editPage"
, iciInterpret
= \ ctx (InlineCommand _ args _) ->
let name = fromMaybe (ctxPageName ctx) (lookup "page" args)
in
return (Input attrs)
}
+
+
+-- <input type="button"
+-- value="Login"
+-- class="loginButton" />
+loginInterp :: Interpreter
+loginInterp
+ = InlineCommandInterpreter {
+ iciName = "login"
+ , iciInterpret
+ = \ _ _ ->
+ let attrs = [ ("type" , "button")
+ , ("value" , "Login")
+ , ("class" , "loginButton")
+ ]
+ in
+ return (Input attrs)
+ }
\ No newline at end of file