X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FWiki.hs;h=3b1802f0e4cc42928fc4341e03f2eb36116eb1a1;hb=16b140fe235a43f9dfb9b57e69ebc302beeaea27;hp=f08aa96b5a8d363434d28738131b8006c36c644d;hpb=8a7556db44cd91ac0bb52279472bcc2abaa3f18e;p=Rakka.git diff --git a/Rakka/Wiki.hs b/Rakka/Wiki.hs index f08aa96..3b1802f 100644 --- a/Rakka/Wiki.hs +++ b/Rakka/Wiki.hs @@ -1,29 +1,54 @@ module Rakka.Wiki ( WikiPage - , WikiElement(..) , BlockElement(..) , InlineElement(..) + + , ListElement(..) + , ListType(..) + , ListItem ) where -type WikiPage = [WikiElement] +import Rakka.Page -data WikiElement - = Block !BlockElement - | Inline !InlineElement - deriving (Eq, Show) +type WikiPage = [BlockElement] data BlockElement - = Header { - hdLevel :: !Int - , hdText :: !String + = Heading { + headingLevel :: !Int + , headingText :: !String } - | EmptyLine + | HorizontalLine + | List !ListElement + | LeadingSpaced ![InlineElement] + | Paragraph ![InlineElement] deriving (Eq, Show) data InlineElement = Text !String + | PageLink { + linkPage :: !(Maybe PageName) + , linkFragment :: !(Maybe String) + , linkText :: !(Maybe String) + } + deriving (Eq, Show) + + +data ListElement + = ListElement { + listType :: !ListType + , listItems :: ![ListItem] + } + deriving (Eq, Show) + + +data ListType + = Bullet + | Numbered deriving (Eq, Show) + + +type ListItem = [Either ListElement InlineElement]