Commits

Luke Plant committed c832431

Various fixes to run on GHC 7.0 and much more recent versions of packages.

  • Participants
  • Parent commits 92b4bc2

Comments (0)

Files changed (9)

 Cabal-Version:  >= 1.2
 Build-Type:     Simple
 
-Executable migrate
-  Build-Depends:
-        base == 4.*,
-        haskell98 >= 1.0.1,
-        HDBC-sqlite3 >= 2.1.0,
-        HDBC >= 2.1.0,
-        containers,
-        utf8-string,
-        regex-pcre,
-        template >= 0.1.1.1,
-        regex-base,
-        bytestring >= 0.9.1
-  Main-is: Migrate.hs
-  hs-source-dirs: src
-
 Executable blog.cgi
   Build-Depends:
         base == 4.*,
         old-time >= 1.0.0.0,
         old-locale >= 1.0.0.0,
         MissingH >= 1.0.2,
-        pandoc >= 1.2.1,
+        pandoc >= 1.8,
+        pandoc-types >= 1.8,
         SHA >= 1.0.2,
         HStringTemplate >= 0.6.2,
         text >= 0.3,

src/Blog/Comment.hs

     , timestamp :: Int
     , name :: LB.ByteString
     , email :: LB.ByteString
-    , text_raw :: LB.ByteString
-    , text_formatted :: LB.ByteString
+    , textraw :: LB.ByteString
+    , textformatted :: LB.ByteString
     , format :: Format
     , hidden :: Bool
     , response :: LB.ByteString

src/Blog/Feeds.hs

           , entryUpdated = formatTimestamp $ Cm.timestamp comment
           , entryAuthors = [commentAuthor $ UTF8.toString $ Cm.name comment]
           , entryCategories = []
-          , entryContent = Just $ HTMLContent $ UTF8.toString $ Cm.text_formatted comment
+          , entryContent = Just $ HTMLContent $ UTF8.toString $ Cm.textformatted comment
           , entryContributor = []
           , entryLinks = [ htmlLink $ commentUrl comment post
                          ]

src/Blog/Formats.hs

 removeRawHtml :: PD.Pandoc -> PD.Pandoc
 removeRawHtml (PD.Pandoc m blocks) = PD.Pandoc m (filter (not . isRawHtml) blocks)
     where
-      isRawHtml (PD.RawHtml s) = True
+      isRawHtml (PD.RawBlock "html" s) = True
       isRawHtml _ = False
 
 formatRST :: String -> String

src/Blog/Forms.hs

                , timestamp = undefined
                , name = LB.empty
                , email = LB.empty
-               , text_raw = LB.empty
-               , text_formatted = undefined
+               , textraw = LB.empty
+               , textformatted = undefined
                , format = Plaintext
                , hidden = False
                , response = LB.empty
                     , timestamp = ts
                     , name = utf8 name
                     , email = utf8 email
-                    , text_raw = utf8 text
-                    , text_formatted = utf8 $ getFormatter format $ text
+                    , textraw = utf8 text
+                    , textformatted = utf8 $ getFormatter format $ text
                     , format = format
                     , hidden = False
                     , response = LB.empty

src/Blog/Model.hs

                          , toSql $ Cm.timestamp cm
                          , toSql $ Cm.name cm
                          , toSql $ Cm.email cm
-                         , toSql $ Cm.text_raw cm
-                         , toSql $ Cm.text_formatted cm
+                         , toSql $ Cm.textraw cm
+                         , toSql $ Cm.textformatted cm
                          , toSql $ fromEnum $ Cm.format cm
                          , toSql $ Cm.hidden cm
                          , toSql $ Cm.response cm
                , Cm.timestamp = fromSql (row !! 2)
                , Cm.name = fromSql (row !! 3)
                , Cm.email = fromSql (row !! 4)
-               , Cm.text_raw = fromSql (row !! 5)
-               , Cm.text_formatted = fromSql (row !! 6)
+               , Cm.textraw = fromSql (row !! 5)
+               , Cm.textformatted = fromSql (row !! 6)
                , Cm.format = toEnum $ fromSql (row !! 7)
                , Cm.hidden = fromSql (row !! 8)
                , Cm.response = fromSql (row !! 9)

src/Blog/Templates.hs

                                       , ("formattedName", ToSElemD $ formatName $ Cm.name cm)
                                       , ("isAuthor", ToSElemD $ Cm.name cm == utf8 Settings.blog_author_name)
                                       , ("date", ToSElemD $ showDate $ Cm.timestamp cm)
-                                      , ("textFormatted", ToSElemD $ Cm.text_formatted cm)
+                                      , ("textFormatted", ToSElemD $ Cm.textformatted cm)
                                       , ("email", ToSElemD $ Cm.email cm)
                                       , ("uid", ToSElemD $ Cm.uid cm)
                                       , ("hidden", ToSElemD $ Cm.hidden cm)
                                      , Cm.timestamp = read (row !! 2)
                                      , Cm.name = fixCodes $ row !! 3
                                      , Cm.email = LB.pack $ row !! 4
-                                     , Cm.text_raw = fixCodes $ row !! 5
-                                     , Cm.text_formatted = fixCodes $ row !! 5
+                                     , Cm.textraw = fixCodes $ row !! 5
+                                     , Cm.textformatted = fixCodes $ row !! 5
                                      , Cm.format = Formats.Rawhtml
                                      , Cm.hidden = False
                                      , Cm.response = utf8 ""

src/templates/post.st

         </tr>
       </table>
 
-      <div><textarea name="message" id="id_message" cols="80" rows="25">$commentData.text_raw$</textarea></div>
+      <div><textarea name="message" id="id_message" cols="80" rows="25">$commentData.textraw$</textarea></div>
       <div><input type="hidden" id="id_spamcheck" name="spamcheck" value="$commentExtra$">
       </div>
       <div>