Commits

Luke Plant committed 4322a03

reformmatting

Comments (0)

Files changed (1)

 
 -- Reading functions
 readCategories = makeItems "categories.txt" mkCat
-    where mkCat row = C.Category { C.uid = read (row !! 0),
-                                   C.name = row !! 1,
-                                   C.slug = ""}
+    where mkCat row = C.Category { C.uid = read (row !! 0)
+                                 , C.name = row !! 1
+                                 , C.slug = ""
+                                 }
 
 readPosts = makeItems "posts.txt" mkPost
             >>= mapM addFullText
             >>= return . sortBy (comparing P.timestamp)
-    where mkPost row = P.Post { P.uid = read (row !! 0),
-                                P.title = row !! 1,
-                                P.slug = "",
-                                P.post_raw = "",
-                                P.post_formatted = "",
-                                P.summary_raw = row !! 4,
-                                P.summary_formatted = row !! 4,
-                                P.format_id = Formats.rawhtml,
-                                P.timestamp = read (row !! 2),
-                                P.comments_open = True
+    where mkPost row = P.Post { P.uid = read (row !! 0)
+                              , P.title = row !! 1
+                              , P.slug = ""
+                              , P.post_raw = ""
+                              , P.post_formatted = ""
+                              , P.summary_raw = row !! 4
+                              , P.summary_formatted = row !! 4
+                              , P.format_id = Formats.rawhtml
+                              , P.timestamp = read (row !! 2)
+                              , P.comments_open = True
                               }
           addFullText p = do let dataFile = Settings.old_data_path ++ "posts/" ++ (show $ P.uid p)
                              f <- readFile dataFile
 
 createRedirectFile postUrlMap categoryUrlMap = do
     tpl <- readTemplate Settings.redirect_file_template
-    let ctx = Map.fromList ([(utf8 "postIdsToUrls",
-                              utf8 $ makePHPMap postUrlMap),
-                             (utf8 "categoryIdsToUrls",
-                              utf8 $ makePHPMap categoryUrlMap)])
+    let ctx = Map.fromList [(utf8 "postIdsToUrls", utf8 $ makePHPMap postUrlMap)
+                           ,(utf8 "categoryIdsToUrls", utf8 $ makePHPMap categoryUrlMap)]
     renderToFile Settings.redirect_file_output tpl ctx
 
 main = handleSqlError $ do
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.