summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Hakyll/File.hs1
-rw-r--r--src/Text/Hakyll/Page.hs5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Hakyll/File.hs b/src/Text/Hakyll/File.hs
index 852436b..992490c 100644
--- a/src/Text/Hakyll/File.hs
+++ b/src/Text/Hakyll/File.hs
@@ -56,6 +56,7 @@ toURL path = if takeExtension path `elem` [ ".markdown"
, ".rst"
, ".text"
, ".tex"
+ , ".lhs"
]
then flip addExtension ".html" $ dropExtension path
else path
diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs
index e522605..7aa6a25 100644
--- a/src/Text/Hakyll/Page.hs
+++ b/src/Text/Hakyll/Page.hs
@@ -67,12 +67,15 @@ writerOptions = defaultWriterOptions
getRenderFunction :: String -> (String -> String)
getRenderFunction ".html" = id
getRenderFunction ext = writeHtmlString writerOptions
- . readFunction ext readerOptions
+ . readFunction ext (readOptions ext)
where
readFunction ".rst" = readRST
readFunction ".tex" = readLaTeX
readFunction _ = readMarkdown
+ readOptions ".lhs" = readerOptions { stateLiterateHaskell = True }
+ readOptions _ = readerOptions
+
-- | Split a page into sections.
splitAtDelimiters :: [String] -> [[String]]
splitAtDelimiters [] = []