diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-26 14:10:10 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-26 14:10:10 +0100 |
commit | c9e345808326c52de9e1a43b0364c0932115760d (patch) | |
tree | bf193f53a9a177dfbdc5673805a6e8fb5bd4fe26 /src | |
parent | c8dd9b7f74affe979d5bf988a041711672471537 (diff) | |
download | hakyll-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.hs | 3 | ||||
-rw-r--r-- | src/Text/Hakyll/Internal/Page.hs | 1 |
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 |