From 47fae0ed2a075d6e685963c1ce411fe28d1fcfd5 Mon Sep 17 00:00:00 2001 From: Sebastian Schwarz Date: Mon, 18 Jan 2010 17:51:28 +0100 Subject: Added support for other common Markdown file extensions. --- src/Text/Hakyll/File.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Text/Hakyll/File.hs') diff --git a/src/Text/Hakyll/File.hs b/src/Text/Hakyll/File.hs index 0ed91d5..2378ae9 100644 --- a/src/Text/Hakyll/File.hs +++ b/src/Text/Hakyll/File.hs @@ -39,7 +39,16 @@ toCache path = "_cache" (removeLeadingSeparator path) -- | Get the url for a given page. toURL :: FilePath -> FilePath -toURL path = if takeExtension path `elem` [".markdown", ".md", ".tex"] +toURL path = if takeExtension path `elem` [ ".markdown" + , ".md" + , ".mdn" + , ".mdwn" + , ".mkd" + , ".mkdn" + , ".mkdwn" + , ".text" + , ".tex" + ] then flip addExtension ".html" $ dropExtension path else path -- cgit v1.2.3 From e01531bd7593b871d8fb18c5ea509394eb8785ba Mon Sep 17 00:00:00 2001 From: Sebastian Schwarz Date: Mon, 18 Jan 2010 18:00:39 +0100 Subject: Added reStructuredText support. Why not? Quickly tested. Seems to work fine. --- src/Text/Hakyll/File.hs | 1 + src/Text/Hakyll/Page.hs | 1 + 2 files changed, 2 insertions(+) (limited to 'src/Text/Hakyll/File.hs') diff --git a/src/Text/Hakyll/File.hs b/src/Text/Hakyll/File.hs index 2378ae9..81c4170 100644 --- a/src/Text/Hakyll/File.hs +++ b/src/Text/Hakyll/File.hs @@ -46,6 +46,7 @@ toURL path = if takeExtension path `elem` [ ".markdown" , ".mkd" , ".mkdn" , ".mkdwn" + , ".rst" , ".text" , ".tex" ] diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs index d338542..e807442 100644 --- a/src/Text/Hakyll/Page.hs +++ b/src/Text/Hakyll/Page.hs @@ -60,6 +60,7 @@ renderFunction ".html" = id renderFunction ext = writeHtmlString writerOptions . readFunction ext defaultParserState where + readFunction ".rst" = readRST readFunction ".tex" = readLaTeX readFunction _ = readMarkdown -- cgit v1.2.3