X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FWiki.hs;h=f0e38fedd47994f629efdd6ae1f2dbe74ac4b784;hb=7c3065043cdfbd96539a9bf6bff9b1d4281c0b2a;hp=3b1802f0e4cc42928fc4341e03f2eb36116eb1a1;hpb=16b140fe235a43f9dfb9b57e69ebc302beeaea27;p=Rakka.git diff --git a/Rakka/Wiki.hs b/Rakka/Wiki.hs index 3b1802f..f0e38fe 100644 --- a/Rakka/Wiki.hs +++ b/Rakka/Wiki.hs @@ -6,6 +6,13 @@ module Rakka.Wiki , ListElement(..) , ListType(..) , ListItem + + , Definition(..) + + , CommandType(..) + , Attribute + , BlockCommand(..) + , InlineCommand(..) ) where @@ -22,18 +29,28 @@ data BlockElement } | HorizontalLine | List !ListElement - | LeadingSpaced ![InlineElement] + | DefinitionList ![Definition] + | Preformatted ![InlineElement] | Paragraph ![InlineElement] + | Div ![Attribute] ![BlockElement] + | BlockCmd !BlockCommand deriving (Eq, Show) data InlineElement = Text !String + | Italic ![InlineElement] + | Bold ![InlineElement] | PageLink { linkPage :: !(Maybe PageName) , linkFragment :: !(Maybe String) , linkText :: !(Maybe String) } + | LineBreak ![Attribute] + | Span ![Attribute] ![InlineElement] + | Image ![Attribute] + | Anchor ![Attribute] ![InlineElement] + | InlineCmd !InlineCommand deriving (Eq, Show) @@ -52,3 +69,37 @@ data ListType type ListItem = [Either ListElement InlineElement] + + +data Definition + = Definition { + defTerm :: ![InlineElement] + , defDesc :: ![InlineElement] + } + deriving (Eq, Show) + + +data CommandType + = InlineCommandType + | BlockCommandType + + +type Attribute = (String, String) + + +data BlockCommand + = BlockCommand { + bCmdName :: !String + , bCmdAttributes :: ![Attribute] + , bCmdContents :: ![BlockElement] + } + deriving (Eq, Show) + + +data InlineCommand + = InlineCommand { + iCmdName :: !String + , iCmdAttributes :: ![Attribute] + , iCmdContents :: ![InlineElement] + } + deriving (Eq, Show)