toBlock :: Event -> Maybe Text -> Blocks
toBlock (PushEvent _ r cs t) author =
  case commitList of
    [] -> mempty
    xs -> para (str ("PushEvent to " ++ unpack r ++ " at " ++ show (utcToJstTime t))) <>
          bulletList xs
  where
    commitList = flip Prelude.map (DV.toList $ DV.filter (\c -> name c `justEql` author) cs) $ \c ->
      plain (str (unpack $ name c `mappend` ": " `mappend` comment c `mappend` " : ") `mappend` link (commitUrl c) "Go To Commit" (linkStr c))
      where
        linkStr = str . Prelude.take 7 . unpack . sha
toBlock :: Event -> Maybe Text -> Blocks
toBlock (PushEvent _ r cs t) author =
  case commitList of
    [] -> mempty
    xs -> para (str ("PushEvent to " ++ unpack r ++ " at " ++ show (utcToJstTime t))) <>
          bulletList xs
  where
    commitList = flip Prelude.map (DV.toList $ DV.filter (\c -> name c `justEql` author) cs) $ \c ->
      plain (str (unpack $ name c `mappend` ": " `mappend` comment c `mappend` " : ") `mappend` link (commitUrl c) "Go To Commit" (linkStr c))
      where
        linkStr = str . Prelude.take 7 . unpack . sha
toBlock (PushEvent _ r cs t) author =
  case commitList of
    [] -> mempty
    xs -> para (str ("PushEvent to " ++ unpack r ++ " at " ++ show (utcToJstTime t))) <>
          bulletList xs
  where
    commitList = flip Prelude.map (DV.toList $ DV.filter (\c -> name c `justEql` author) cs) $ \c ->
      plain (str (unpack $ name c `mappend` ": " `mappend` comment c `mappend` " : ") `mappend` link (commitUrl c) "Go To Commit" (linkStr c))
      where
        linkStr = str . Prelude.take 7 . unpack . sha