diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-28 11:36:59 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-28 11:36:59 +0100 |
commit | eaa190f1e3029573a4bf4ecf238d3b8c236ad4fa (patch) | |
tree | ea63c637390fab385020fe496e0f806c1e8ffdeb /src/Hakyll/Web/Pandoc | |
parent | d2d52133f6815b1f1516c98c156bbe1abd2b559b (diff) | |
download | hakyll-eaa190f1e3029573a4bf4ecf238d3b8c236ad4fa.tar.gz |
Fix .tex.lhs patch, add some test cases
Diffstat (limited to 'src/Hakyll/Web/Pandoc')
-rw-r--r-- | src/Hakyll/Web/Pandoc/FileType.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Hakyll/Web/Pandoc/FileType.hs b/src/Hakyll/Web/Pandoc/FileType.hs index 28698a7..46c8e24 100644 --- a/src/Hakyll/Web/Pandoc/FileType.hs +++ b/src/Hakyll/Web/Pandoc/FileType.hs @@ -8,7 +8,7 @@ module Hakyll.Web.Pandoc.FileType -------------------------------------------------------------------------------- -import System.FilePath (takeExtension) +import System.FilePath (splitExtension) -------------------------------------------------------------------------------- @@ -36,12 +36,16 @@ data FileType -------------------------------------------------------------------------------- -- | Get the file type for a certain file. The type is determined by extension. fileType :: FilePath -> FileType -fileType = uncurry fileType' . splitExtension +fileType = uncurry fileType' . splitExtension where fileType' _ ".css" = Css fileType' _ ".htm" = Html fileType' _ ".html" = Html - fileType' f ".lhs" = LiterateHaskell (fileType' (takeExtension f)) + fileType' f ".lhs" = LiterateHaskell $ case fileType f of + -- If no extension is given, default to Markdown + LiterateHaskell + Binary -> Markdown + -- Otherwise, LaTeX + LiterateHaskell or whatever the user specified + x -> x fileType' _ ".markdown" = Markdown fileType' _ ".md" = Markdown fileType' _ ".mdn" = Markdown |