From f3c83030b9b0e186f283523af08ca886de33783c Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 14 Jan 2010 21:01:18 +0100 Subject: Parallel version bump. Conflicts: src/Text/Hakyll/Page.hs --- hakyll.cabal | 4 ++-- src/Text/Hakyll/Page.hs | 4 ++-- src/Text/Hakyll/Render/Internal.hs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hakyll.cabal b/hakyll.cabal index e9938f7..c1f7505 100644 --- a/hakyll.cabal +++ b/hakyll.cabal @@ -1,5 +1,5 @@ Name: hakyll -Version: 1.0 +Version: 1.0.1 Synopsis: A simple static site generator library. Description: @@ -34,7 +34,7 @@ library mtl >= 1.1, old-locale >= 1, time >= 1, - parallel >= 1 + parallel >= 2 exposed-modules: Text.Hakyll Text.Hakyll.Render Text.Hakyll.Renderable diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs index 0b7776b..6788240 100644 --- a/src/Text/Hakyll/Page.hs +++ b/src/Text/Hakyll/Page.hs @@ -10,7 +10,7 @@ import qualified Data.Map as M import qualified Data.List as L import Data.Maybe (fromMaybe) -import Control.Parallel.Strategies (rnf, ($|)) +import Control.Parallel.Strategies (rdeepseq, ($|)) import System.FilePath (FilePath, takeExtension) import System.IO @@ -123,7 +123,7 @@ readPage pagePath = do , ("path", pagePath) ] ++ metaData - seq (($|) id rnf rendered) $ hClose handle + seq (($|) id rdeepseq rendered) $ hClose handle -- Cache if needed if getFromCache then return () else cachePage page diff --git a/src/Text/Hakyll/Render/Internal.hs b/src/Text/Hakyll/Render/Internal.hs index 3b9bfbb..8679dfb 100644 --- a/src/Text/Hakyll/Render/Internal.hs +++ b/src/Text/Hakyll/Render/Internal.hs @@ -14,7 +14,7 @@ import Text.Hakyll.Context (Context, ContextManipulation) import Data.List (isPrefixOf, foldl') import Data.Char (isAlpha) import Data.Maybe (fromMaybe) -import Control.Parallel.Strategies (rnf, ($|)) +import Control.Parallel.Strategies (rdeepseq, ($|)) import Text.Hakyll.Renderable import Text.Hakyll.Page import Text.Hakyll.File @@ -54,7 +54,7 @@ pureRenderWith manipulation template context = let contextIgnoringRoot = M.insert "root" "$root" (manipulation context) body = regularSubstitute template contextIgnoringRoot -- Force the body to be rendered. - in ($|) id rnf (M.insert "body" body context) + in ($|) id rdeepseq (M.insert "body" body context) -- | A pure renderAndConcat function. pureRenderAndConcatWith :: ContextManipulation -- cgit v1.2.3 From 810e5982a30afc0695397205c9f9d67d56dab834 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 16 Jan 2010 09:24:23 +0100 Subject: Fixed issue in tutorial 1. Kudos to kamatsu for noticing. --- examples/hakyll/tutorial1.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/hakyll/tutorial1.markdown b/examples/hakyll/tutorial1.markdown index 5ba57e6..69c8f6b 100644 --- a/examples/hakyll/tutorial1.markdown +++ b/examples/hakyll/tutorial1.markdown @@ -133,8 +133,8 @@ one template, and our renderable object is simply a `PagePath`. ~~~~~{.haskell} import Text.Hakyll (hakyll) -import Text.Render (renderChain) -import Text.Renderables (createPagePath) +import Text.Hakyll.Render (renderChain) +import Text.Hakyll.Renderables (createPagePath) main = hakyll $ do renderChain ["templates/default.html"] (createPagePath "about.markdown") @@ -144,8 +144,8 @@ Or, to render all our three pages: ~~~~~{.haskell} import Text.Hakyll (hakyll) -import Text.Render (renderChain) -import Text.Renderables (createPagePath) +import Text.Hakyll.Render (renderChain) +import Text.Hakyll.Renderables (createPagePath) main = hakyll $ do render "about.markdown" render "index.markdown" @@ -170,7 +170,7 @@ use: ~~~~~{.haskell} import Text.Hakyll (hakyll) -import Text.Render (static) +import Text.Hakyll.Render (static) main = hakyll $ do static "css/default.css" ~~~~~ @@ -180,7 +180,7 @@ we want to use that, we would use `css` instead of `static`. ~~~~~{.haskell} import Text.Hakyll (hakyll) -import Text.Render (css) +import Text.Hakyll.Render (css) main = hakyll $ do css "css/default.css" ~~~~~ @@ -193,7 +193,7 @@ our example would become: ~~~~~{.haskell} import Text.Hakyll (hakyll) -import Text.Render (css) +import Text.Hakyll.Render (css) import Text.File (directory) main = hakyll $ do directory css "css" -- cgit v1.2.3 From 20bde6c55c95b54e981fbfe4881c951002d2648f Mon Sep 17 00:00:00 2001 From: Sebastian Schwarz Date: Sun, 17 Jan 2010 17:17:23 +0100 Subject: Ignore ctags' and etags' tag file. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 12aa4b3..ea6859a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,9 @@ *.swp *~ .DS_Store +TAGS dist +tags # Ignore test builds. tests/Tests -- cgit v1.2.3 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 ++++++++++- src/Text/Hakyll/Page.hs | 6 ++---- 2 files changed, 12 insertions(+), 5 deletions(-) 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 diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs index 6788240..d338542 100644 --- a/src/Text/Hakyll/Page.hs +++ b/src/Text/Hakyll/Page.hs @@ -60,10 +60,8 @@ renderFunction ".html" = id renderFunction ext = writeHtmlString writerOptions . readFunction ext defaultParserState where - readFunction ".markdown" = readMarkdown - readFunction ".md" = readMarkdown - readFunction ".tex" = readLaTeX - readFunction _ = readMarkdown + readFunction ".tex" = readLaTeX + readFunction _ = readMarkdown -- | Read metadata header from a file handle. readMetaData :: Handle -> IO [(String, String)] -- 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(+) 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