From 1747df418e8cdd5d9de1a643354d7ac28591ed14 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 25 Aug 2019 20:15:53 +0100 Subject: chore(tazblog): Format source files with ormolu Ormolu's formatting is quite annoying (it uses a lot of unnecessary vertical space and doesn't align elements), but I can't be bothered to do manual formatting - especially because whatever formatting haskell-mode in Emacs produces seems to depend on an opaque state machine or something. --- services/tazblog/src/Blog.hs | 72 +++++++++++---------- services/tazblog/src/BlogStore.hs | 128 +++++++++++++++++++++----------------- services/tazblog/src/Locales.hs | 19 +++--- services/tazblog/src/RSS.hs | 44 +++++++------ services/tazblog/src/Server.hs | 75 +++++++++++----------- 5 files changed, 187 insertions(+), 151 deletions(-) (limited to 'services/tazblog') diff --git a/services/tazblog/src/Blog.hs b/services/tazblog/src/Blog.hs index d02836a3f3..15ac9993eb 100644 --- a/services/tazblog/src/Blog.hs +++ b/services/tazblog/src/Blog.hs @@ -1,26 +1,25 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE QuasiQuotes #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeFamilies #-} module Blog where import BlogStore -import Data.Text (Text, empty, pack) -import Data.Text.Lazy (fromStrict) -import Data.Time -import Locales -import Text.Blaze.Html (preEscapedToHtml) -import Text.Hamlet -import Text.Markdown - -import qualified Data.Text as T +import Data.Text (Text, empty, pack) +import qualified Data.Text as T +import Data.Text.Lazy (fromStrict) +import Data.Time +import Locales +import Text.Blaze.Html (preEscapedToHtml) +import Text.Hamlet +import Text.Markdown replace :: Eq a => a -> a -> [a] -> [a] replace x y = map (\z -> if z == x then y else z) @@ -29,9 +28,9 @@ replace x y = map (\z -> if z == x then y else z) markdownCutoff :: Day markdownCutoff = fromGregorian 2013 04 28 --- blog HTML blogTemplate :: BlogLang -> Text -> Html -> Html -blogTemplate lang t_append body = [shamlet| +blogTemplate lang t_append body = + [shamlet| $doctype 5 @@ -48,11 +47,12 @@ $doctype 5 ^{body} ^{showFooter} |] - where - rssUrl = T.concat ["/", show' lang, "/rss.xml"] + where + rssUrl = T.concat ["/", show' lang, "/rss.xml"] showFooter :: Html -showFooter = [shamlet| +showFooter = + [shamlet|