]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Wiki.hs
Wrote more
[Rakka.git] / Rakka / Wiki.hs
index 0bf23987b5ffed8c5368fd13d85695183a3b89c8..613869b2a9091b83f1b234aa2c20b85ca08caab3 100644 (file)
@@ -16,6 +16,8 @@ module Rakka.Wiki
     )
     where
 
+import           Data.Generics
+import           Network.URI
 import           Rakka.Page
 
 
@@ -33,23 +35,38 @@ data BlockElement
     | Preformatted ![InlineElement]
     | Paragraph ![InlineElement]
     | Div ![Attribute] ![BlockElement]
+    | EmptyBlock
     | BlockCmd !BlockCommand
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data InlineElement
     = Text !String
     | Italic ![InlineElement]
     | Bold ![InlineElement]
+    | ObjectLink {
+        objLinkPage :: !PageName
+      , objLinkText :: !(Maybe String)
+      }
     | PageLink {
         linkPage     :: !(Maybe PageName)
       , linkFragment :: !(Maybe String)
       , linkText     :: !(Maybe String)
       }
+    | ExternalLink {
+        extLinkURI  :: !URI
+      , extLinkText :: !(Maybe String)
+      }
     | LineBreak ![Attribute]
     | Span ![Attribute] ![InlineElement]
+    | Image {
+        imgSource :: !PageName
+      , imgAlt    :: !(Maybe String)
+      }
+    | Anchor ![Attribute] ![InlineElement]
+    | EmptyInline
     | InlineCmd !InlineCommand
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data ListElement
@@ -57,13 +74,13 @@ data ListElement
         listType  :: !ListType
       , listItems :: ![ListItem]
       }
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data ListType
     = Bullet
     | Numbered
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 type ListItem = [Either ListElement InlineElement]
@@ -74,12 +91,13 @@ data Definition
         defTerm :: ![InlineElement]
       , defDesc :: ![InlineElement]
       }
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data CommandType
     = InlineCommandType
     | BlockCommandType
+    deriving (Eq, Show)
 
 
 type Attribute = (String, String)
@@ -91,7 +109,7 @@ data BlockCommand
       , bCmdAttributes :: ![Attribute]
       , bCmdContents   :: ![BlockElement]
       }
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data InlineCommand
@@ -100,4 +118,4 @@ data InlineCommand
       , iCmdAttributes :: ![Attribute]
       , iCmdContents   :: ![InlineElement]
       }
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)