1-- | A module dealing with file extensions and associated file types.
2module Text.Hakyll.Internal.FileType
9import System.FilePath (takeExtension)
11-- | Datatype to represent the different file types Hakyll can deal with.
14 | LiterateHaskellMarkdown
19 deriving (Eq, Ord, Show, Read)
21-- | Get the file type for a certain file. The type is determined by extension.
22getFileType :: FilePath -> FileType
23getFileType = getFileType' . takeExtension
25 getFileType' ".htm" = Html
26 getFileType' ".html" = Html
27 getFileType' ".lhs" = LiterateHaskellMarkdown
28 getFileType' ".markdown" = Markdown
29 getFileType' ".md" = Markdown
30 getFileType' ".mdn" = Markdown
31 getFileType' ".mdown" = Markdown
32 getFileType' ".mdwn" = Markdown
33 getFileType' ".mkd" = Markdown
34 getFileType' ".mkdwn" = Markdown
35 getFileType' ".rst" = ReStructuredText
36 getFileType' ".tex" = LaTeX
37 getFileType' ".text" = Text
38 getFileType' ".txt" = Text
39 getFileType' _ = UnknownFileType
41-- | Check if a certain @FileType@ is renderable.
42isRenderable :: FileType -> Bool
43isRenderable UnknownFileType = False
46-- | Check if a certain file is renderable.
47isRenderableFile :: FilePath -> Bool
48isRenderableFile = isRenderable . getFileType
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list