summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Vershilov <alexander.vershilov@gmail.com>2013-01-28 11:29:43 +0400
committerJasper Van der Jeugt <m@jaspervdj.be>2013-01-28 11:19:56 +0100
commitd2d52133f6815b1f1516c98c156bbe1abd2b559b (patch)
tree22a49617e1113ed9a47832b1e7ae5818e5319147 /src
parent8daef26ac17c372afc4c3d3444738abaa358db25 (diff)
downloadhakyll-d2d52133f6815b1f1516c98c156bbe1abd2b559b.tar.gz
Read second extension to find our inner .lhs format
.md.lhs -> will be read as markdown + lhs .tex.lhs -> will be read as latex +lhs markdown format is default
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Web/Pandoc/FileType.hs40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/Hakyll/Web/Pandoc/FileType.hs b/src/Hakyll/Web/Pandoc/FileType.hs
index 1ae4c10..28698a7 100644
--- a/src/Hakyll/Web/Pandoc/FileType.hs
+++ b/src/Hakyll/Web/Pandoc/FileType.hs
@@ -36,27 +36,27 @@ data FileType
--------------------------------------------------------------------------------
-- | Get the file type for a certain file. The type is determined by extension.
fileType :: FilePath -> FileType
-fileType = fileType' . takeExtension
+fileType = uncurry fileType' . splitExtension
where
- fileType' ".css" = Css
- 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' ".org" = OrgMode
- fileType' ".page" = Markdown
- fileType' ".rst" = Rst
- fileType' ".tex" = LaTeX
- fileType' ".text" = PlainText
- fileType' ".textile" = Textile
- fileType' ".txt" = PlainText
- fileType' _ = Binary -- Treat unknown files as binary
+ fileType' _ ".css" = Css
+ fileType' _ ".htm" = Html
+ fileType' _ ".html" = Html
+ fileType' f ".lhs" = LiterateHaskell (fileType' (takeExtension f))
+ fileType' _ ".markdown" = Markdown
+ fileType' _ ".md" = Markdown
+ fileType' _ ".mdn" = Markdown
+ fileType' _ ".mdown" = Markdown
+ fileType' _ ".mdwn" = Markdown
+ fileType' _ ".mkd" = Markdown
+ fileType' _ ".mkdwn" = Markdown
+ fileType' _ ".org" = OrgMode
+ fileType' _ ".page" = Markdown
+ fileType' _ ".rst" = Rst
+ fileType' _ ".tex" = LaTeX
+ fileType' _ ".text" = PlainText
+ fileType' _ ".textile" = Textile
+ fileType' _ ".txt" = PlainText
+ fileType' _ _ = Binary -- Treat unknown files as binary
--------------------------------------------------------------------------------