summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-26 14:10:10 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-26 14:10:10 +0100
commitc9e345808326c52de9e1a43b0364c0932115760d (patch)
treebf193f53a9a177dfbdc5673805a6e8fb5bd4fe26 /src
parentc8dd9b7f74affe979d5bf988a041711672471537 (diff)
downloadhakyll-c9e345808326c52de9e1a43b0364c0932115760d.tar.gz
Added `.txt` support, tests update.
- Pure text files are now supported. - We now hide the Internal modules. - Tests should be run through ghci. - Added testing of page reading.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Hakyll/Internal/FileType.hs3
-rw-r--r--src/Text/Hakyll/Internal/Page.hs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Hakyll/Internal/FileType.hs b/src/Text/Hakyll/Internal/FileType.hs
index e3a73cd..e762e9a 100644
--- a/src/Text/Hakyll/Internal/FileType.hs
+++ b/src/Text/Hakyll/Internal/FileType.hs
@@ -14,6 +14,7 @@ data FileType = Html
| LiterateHaskellMarkdown
| Markdown
| ReStructuredText
+ | Text
| UnknownFileType
deriving (Eq, Ord, Show, Read)
@@ -33,6 +34,8 @@ getFileType = getFileType' . takeExtension
getFileType' ".mkdwn" = Markdown
getFileType' ".rst" = ReStructuredText
getFileType' ".tex" = LaTeX
+ getFileType' ".text" = Text
+ getFileType' ".txt" = Text
getFileType' _ = UnknownFileType
-- | Check if a certain @FileType@ is renderable.
diff --git a/src/Text/Hakyll/Internal/Page.hs b/src/Text/Hakyll/Internal/Page.hs
index 8500693..8f1b9d6 100644
--- a/src/Text/Hakyll/Internal/Page.hs
+++ b/src/Text/Hakyll/Internal/Page.hs
@@ -38,6 +38,7 @@ writerOptions = defaultWriterOptions
-- | Get a render function for a given extension.
getRenderFunction :: FileType -> (String -> String)
getRenderFunction Html = id
+getRenderFunction Text = id
getRenderFunction fileType = writeHtmlString writerOptions
. readFunction fileType (readOptions fileType)
where