]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Wiki.hs
Implemented block commands
[Rakka.git] / Rakka / Wiki.hs
index 3b1802f0e4cc42928fc4341e03f2eb36116eb1a1..0bf23987b5ffed8c5368fd13d85695183a3b89c8 100644 (file)
@@ -6,6 +6,13 @@ module Rakka.Wiki
     , ListElement(..)
     , ListType(..)
     , ListItem
+
+    , Definition(..)
+
+    , CommandType(..)
+    , Attribute
+    , BlockCommand(..)
+    , InlineCommand(..)
     )
     where
 
@@ -22,18 +29,26 @@ 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]
+    | InlineCmd !InlineCommand
     deriving (Eq, Show)
 
 
@@ -52,3 +67,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)