1-- | A module dealing with common file extensions and associated file types.
3module Hakyll.Web.FileType
9import System.FilePath (takeExtension)
10import Control.Applicative ((<$>))
12import Hakyll.Core.Identifier
13import Hakyll.Core.Target
15-- | Datatype to represent the different file types Hakyll can deal with by
21 | LiterateHaskell FileType
27 deriving (Eq, Ord, Show, Read)
29-- | Get the file type for a certain file. The type is determined by extension.
31fileType :: FilePath -> FileType
32fileType = fileType' . takeExtension
34 fileType' ".htm" = Html
35 fileType' ".html" = Html
36 fileType' ".lhs" = LiterateHaskell Markdown
37 fileType' ".markdown" = Markdown
38 fileType' ".md" = Markdown
39 fileType' ".mdn" = Markdown
40 fileType' ".mdown" = Markdown
41 fileType' ".mdwn" = Markdown
42 fileType' ".mkd" = Markdown
43 fileType' ".mkdwn" = Markdown
44 fileType' ".page" = Markdown
45 fileType' ".rst" = ReStructuredText
46 fileType' ".tex" = LaTeX
47 fileType' ".text" = PlainText
48 fileType' ".txt" = PlainText
49 fileType' ".css" = Css
50 fileType' _ = Binary -- Treat unknown files as binary
52-- | Get the file type for the current file
54getFileType :: TargetM a FileType
55getFileType = fileType . toFilePath <$> getIdentifier
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