From d2d52133f6815b1f1516c98c156bbe1abd2b559b Mon Sep 17 00:00:00 2001 From: Alexander Vershilov Date: Mon, 28 Jan 2013 11:29:43 +0400 Subject: 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 --- src/Hakyll/Web/Pandoc/FileType.hs | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/Hakyll') 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 -------------------------------------------------------------------------------- -- cgit v1.2.3