summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web/FileType.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-03-30 17:37:56 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-03-30 17:37:56 +0200
commit1e5f2f0691150ce87d0abd81ac5cd193eec4506c (patch)
treee03e77dabb6670da30b29ad2608d7d957a41f6cf /src/Hakyll/Web/FileType.hs
parent5a3967ad4118de981bd8c3ac3bc959dbc5769af2 (diff)
downloadhakyll-1e5f2f0691150ce87d0abd81ac5cd193eec4506c.tar.gz
Move FileType module
Diffstat (limited to 'src/Hakyll/Web/FileType.hs')
-rw-r--r--src/Hakyll/Web/FileType.hs55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/Hakyll/Web/FileType.hs b/src/Hakyll/Web/FileType.hs
deleted file mode 100644
index cd1188a..0000000
--- a/src/Hakyll/Web/FileType.hs
+++ /dev/null
@@ -1,55 +0,0 @@
--- | A module dealing with common file extensions and associated file types.
---
-module Hakyll.Web.FileType
- ( FileType (..)
- , fileType
- , getFileType
- ) where
-
-import System.FilePath (takeExtension)
-import Control.Arrow ((>>^))
-
-import Hakyll.Core.Identifier
-import Hakyll.Core.Compiler
-
--- | Datatype to represent the different file types Hakyll can deal with by
--- default
---
-data FileType
- = Html
- | LaTeX
- | LiterateHaskell FileType
- | Markdown
- | Rst
- | PlainText
- | Css
- | Binary
- deriving (Eq, Ord, Show, Read)
-
--- | Get the file type for a certain file. The type is determined by extension.
---
-fileType :: FilePath -> FileType
-fileType = fileType' . takeExtension
- where
- fileType' ".htm" = Html
- fileType' ".html" = Html
- fileType' ".lhs" = LiterateHaskell Markdown
- fileType' ".markdown" = Markdown
- fileType' ".md" = Markdown
- fileType' ".mdn" = Markdown
- fileType' ".mdown" = Markdown
- fileType' ".mdwn" = Markdown
- fileType' ".mkd" = Markdown
- fileType' ".mkdwn" = Markdown
- fileType' ".page" = Markdown
- fileType' ".rst" = Rst
- fileType' ".tex" = LaTeX
- fileType' ".text" = PlainText
- fileType' ".txt" = PlainText
- fileType' ".css" = Css
- fileType' _ = Binary -- Treat unknown files as binary
-
--- | Get the file type for the current file
---
-getFileType :: Compiler a FileType
-getFileType = getIdentifier >>^ fileType . toFilePath