]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Wiki.hs
Implemented the outline command
[Rakka.git] / Rakka / Wiki.hs
index 0bf23987b5ffed8c5368fd13d85695183a3b89c8..0fcf38a6bca33b31550bb2ddbc8d5d49f37a19e7 100644 (file)
@@ -16,6 +16,8 @@ module Rakka.Wiki
     )
     where
 
+import           Data.Generics
+import           Network.URI
 import           Rakka.Page
 
 
@@ -33,8 +35,9 @@ data BlockElement
     | Preformatted ![InlineElement]
     | Paragraph ![InlineElement]
     | Div ![Attribute] ![BlockElement]
+    | EmptyBlock
     | BlockCmd !BlockCommand
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data InlineElement
@@ -46,10 +49,17 @@ data InlineElement
       , linkFragment :: !(Maybe String)
       , linkText     :: !(Maybe String)
       }
+    | ExternalLink {
+        extLinkURI  :: !URI
+      , extLinkText :: !(Maybe String)
+      }
     | LineBreak ![Attribute]
     | Span ![Attribute] ![InlineElement]
+    | Image ![Attribute]
+    | Anchor ![Attribute] ![InlineElement]
+    | EmptyInline
     | InlineCmd !InlineCommand
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data ListElement
@@ -57,13 +67,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 +84,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 +102,7 @@ data BlockCommand
       , bCmdAttributes :: ![Attribute]
       , bCmdContents   :: ![BlockElement]
       }
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)
 
 
 data InlineCommand
@@ -100,4 +111,4 @@ data InlineCommand
       , iCmdAttributes :: ![Attribute]
       , iCmdContents   :: ![InlineElement]
       }
-    deriving (Eq, Show)
+    deriving (Eq, Show, Typeable, Data)