1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE TemplateHaskell #-}
4module Develop.StaticFiles
12import Prelude hiding (lookup)
13import qualified Data.ByteString as BS
14import Data.FileEmbed (bsToExp)
15import qualified Data.HashMap.Strict as HM
16import Language.Haskell.TH (runIO)
17import System.FilePath ((</>))
19import qualified Develop.StaticFiles.Build as Build
30lookup :: FilePath -> Maybe (BS.ByteString, MimeType)
35dict :: HM.HashMap FilePath (BS.ByteString, MimeType)
38 [ faviconPath ==> (favicon , "image/x-icon")
39 , waitingPath ==> (waiting , "image/gif")
40 , elmPath ==> (elm , "application/javascript")
41 , cssPath ==> (css , "text/css")
42 , codeFontPath ==> (codeFont, "font/ttf")
43 , sansFontPath ==> (sansFont, "font/ttf")
47(==>) :: a -> b -> (a,b)
56faviconPath :: FilePath
61waitingPath :: FilePath
63 "_elm" </> "waiting.gif"
73 "_elm" </> "styles.css"
76codeFontPath :: FilePath
78 "_elm" </> "source-code-pro.ttf"
81sansFontPath :: FilePath
83 "_elm" </> "source-sans-pro.ttf"
92 $(bsToExp =<< runIO Build.compile)
101 $(bsToExp =<< runIO (Build.readAsset "styles.css"))
108codeFont :: BS.ByteString
110 $(bsToExp =<< runIO (Build.readAsset "source-code-pro.ttf"))
113sansFont :: BS.ByteString
115 $(bsToExp =<< runIO (Build.readAsset "source-sans-pro.ttf"))
122favicon :: BS.ByteString
124 $(bsToExp =<< runIO (Build.readAsset "favicon.ico"))
127waiting :: BS.ByteString
129 $(bsToExp =<< runIO (Build.readAsset "waiting.gif"))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list