hakyll 4.12.0.1 → 4.12.1.0
raw patch · 11 files changed
+66/−59 lines, 11 filesdep −networkdep −regex-basedep ~http-types
Dependencies removed: network, regex-base
Dependency ranges changed: http-types
Files
- CHANGELOG.md +5/−0
- hakyll.cabal +26/−47
- lib/Hakyll.hs +5/−1
- lib/Hakyll/Core/Util/Parser.hs +0/−1
- lib/Hakyll/Web/Template/Context.hs +1/−1
- src/Init.hs +7/−4
- tests/Hakyll/Core/Rules/Tests.hs +1/−2
- tests/Hakyll/Core/Runtime/Tests.hs +1/−1
- tests/Hakyll/Web/Template/Tests.hs +3/−2
- tests/TestSuite.hs +5/−0
- tests/TestSuite/Util.hs +12/−0
CHANGELOG.md view
@@ -4,6 +4,11 @@ # Releases +## Hakyll 4.12.1.0++- Fix hakyll-init on older GHC versions+- Make the Pandoc dependency optional+ ## Hakyll 4.12.0.1 - Bump resourcet to 1.2 in test section
hakyll.cabal view
@@ -1,5 +1,5 @@ Name: hakyll-Version: 4.12.0.1+Version: 4.12.1.0 Synopsis: A static website compiler library Description:@@ -99,6 +99,11 @@ Default: False Manual: True +Flag usePandoc+ Description: Include Pandoc support+ Default: True+ Manual: True+ Library Ghc-Options: -Wall Hs-Source-Dirs: lib@@ -134,9 +139,6 @@ Hakyll.Web.Html Hakyll.Web.Html.RelativizeUrls Hakyll.Web.Paginate- Hakyll.Web.Pandoc- Hakyll.Web.Pandoc.Biblio- Hakyll.Web.Pandoc.FileType Hakyll.Web.Redirect Hakyll.Web.Tags Hakyll.Web.Template@@ -156,7 +158,6 @@ Hakyll.Core.Provider.Internal Hakyll.Core.Provider.MetadataCache Hakyll.Core.Util.Parser- Hakyll.Web.Pandoc.Binary Paths_hakyll Build-Depends:@@ -173,14 +174,10 @@ filepath >= 1.0 && < 1.5, lrucache >= 1.1.1 && < 1.3, mtl >= 1 && < 2.3,- network >= 2.6 && < 2.7, network-uri >= 2.6 && < 2.7,- pandoc >= 2.0.5 && < 2.2,- pandoc-citeproc >= 0.14 && < 0.15, parsec >= 3.0 && < 3.2, process >= 1.6 && < 1.7, random >= 1.0 && < 1.2,- regex-base >= 0.93 && < 0.94, regex-tdfa >= 1.1 && < 1.3, resourcet >= 1.1 && < 1.3, scientific >= 0.3.4 && < 0.4,@@ -222,6 +219,19 @@ Cpp-options: -DCHECK_EXTERNAL + If flag(usePandoc)+ Exposed-Modules:+ Hakyll.Web.Pandoc+ Hakyll.Web.Pandoc.Biblio+ Hakyll.Web.Pandoc.FileType+ Other-Modules:+ Hakyll.Web.Pandoc.Binary+ Build-Depends:+ pandoc >= 2.0.5 && < 2.2,+ pandoc-citeproc >= 0.14 && < 0.15+ Cpp-options:+ -DUSE_PANDOC+ Test-suite hakyll-tests Type: exitcode-stdio-1.0 Hs-source-dirs: tests@@ -243,7 +253,6 @@ Hakyll.Web.CompressCss.Tests Hakyll.Web.Html.RelativizeUrls.Tests Hakyll.Web.Html.Tests- Hakyll.Web.Pandoc.FileType.Tests Hakyll.Web.Template.Context.Tests Hakyll.Web.Template.Tests TestSuite.Util@@ -256,60 +265,30 @@ tasty-quickcheck >= 0.8 && < 0.11, -- Copy pasted from hakyll dependencies: base >= 4.8 && < 5,- binary >= 0.5 && < 0.10,- blaze-html >= 0.5 && < 0.10,- blaze-markup >= 0.5.1 && < 0.9, bytestring >= 0.9 && < 0.11, containers >= 0.3 && < 0.6,- cryptohash >= 0.7 && < 0.12,- data-default >= 0.4 && < 0.8,- deepseq >= 1.3 && < 1.5,- directory >= 1.0 && < 1.4, filepath >= 1.0 && < 1.5,- lrucache >= 1.1.1 && < 1.3,- mtl >= 1 && < 2.3,- network >= 2.6 && < 2.7,- network-uri >= 2.6 && < 2.7,- pandoc >= 2.0.5 && < 2.2,- pandoc-citeproc >= 0.14 && < 0.15,- parsec >= 3.0 && < 3.2,- process >= 1.6 && < 1.7,- random >= 1.0 && < 1.2,- regex-base >= 0.93 && < 0.94,- regex-tdfa >= 1.1 && < 1.3,- resourcet >= 1.1 && < 1.3,- scientific >= 0.3.4 && < 0.4,- tagsoup >= 0.13.1 && < 0.15, text >= 0.11 && < 1.3,- time >= 1.8 && < 1.10,- time-locale-compat >= 0.1 && < 0.2, unordered-containers >= 0.2 && < 0.3,- vector >= 0.11 && < 0.13,- yaml >= 0.8.11 && < 0.9,- optparse-applicative >= 0.12 && < 0.15+ yaml >= 0.8.11 && < 0.9 If flag(previewServer)- Build-depends:- wai >= 3.2 && < 3.3,- warp >= 3.2 && < 3.3,- wai-app-static >= 3.1 && < 3.2,- http-types >= 0.9 && < 0.13,- fsnotify >= 0.2 && < 0.3 Cpp-options: -DPREVIEW_SERVER If flag(watchServer)- Build-depends:- fsnotify >= 0.2 && < 0.3 Cpp-options: -DWATCH_SERVER If flag(checkExternal)- Build-depends:- http-conduit >= 2.2 && < 2.4,- http-types >= 0.7 && < 0.13 Cpp-options: -DCHECK_EXTERNAL++ If flag(usePandoc)+ Other-modules:+ Hakyll.Web.Pandoc.FileType.Tests+ Cpp-options:+ -DUSE_PANDOC Executable hakyll-init Main-is: Init.hs
lib/Hakyll.hs view
@@ -20,10 +20,12 @@ , module Hakyll.Web.Feed , module Hakyll.Web.Html , module Hakyll.Web.Html.RelativizeUrls- , module Hakyll.Web.Pandoc , module Hakyll.Web.Paginate+#ifdef USE_PANDOC+ , module Hakyll.Web.Pandoc , module Hakyll.Web.Pandoc.Biblio , module Hakyll.Web.Pandoc.FileType+#endif , module Hakyll.Web.Redirect , module Hakyll.Web.Tags , module Hakyll.Web.Template@@ -52,9 +54,11 @@ import Hakyll.Web.Html import Hakyll.Web.Html.RelativizeUrls import Hakyll.Web.Paginate+#ifdef USE_PANDOC import Hakyll.Web.Pandoc import Hakyll.Web.Pandoc.Biblio import Hakyll.Web.Pandoc.FileType+#endif import Hakyll.Web.Redirect import Hakyll.Web.Tags import Hakyll.Web.Template
lib/Hakyll/Core/Util/Parser.hs view
@@ -2,7 +2,6 @@ -- | Parser utilities module Hakyll.Core.Util.Parser ( metadataKey- , reservedKeys ) where
lib/Hakyll/Web/Template/Context.hs view
@@ -335,7 +335,7 @@ -------------------------------------------------------------------------------- modificationTimeField :: String -- ^ Key -> String -- ^ Format- -> Context a -- ^ Resuting context+ -> Context a -- ^ Resulting context modificationTimeField = modificationTimeFieldWith defaultTimeLocale
src/Init.hs view
@@ -6,7 +6,7 @@ -------------------------------------------------------------------------------- import Control.Arrow (first)-import Control.Monad (forM_)+import Control.Monad (forM, forM_) import Data.Char (isAlphaNum, isNumber) import Data.List (foldl', intercalate, isPrefixOf) import Data.Version (Version (..))@@ -23,6 +23,10 @@ --------------------------------------------------------------------------------+import Prelude+++-------------------------------------------------------------------------------- main :: IO () main = do progName <- getProgName@@ -66,16 +70,15 @@ createCabal cabalPath name fs -> do putStrLn $ "The following files will be overwritten:"- foldMap putStrLn fs+ mapM_ putStrLn fs putStrLn $ "Use -f to overwrite them" exitFailure existingFiles :: FilePath -> [FilePath] -> IO [FilePath]-existingFiles dstDir = foldMap $ \file -> do+existingFiles dstDir files = fmap concat $ forM files $ \file -> do let dst = dstDir </> file exists <- doesFileExist dst return $ if exists then [dst] else []- -- | Figure out a good cabal package name from the given (existing) directory -- name
tests/Hakyll/Core/Rules/Tests.hs view
@@ -17,7 +17,6 @@ import Hakyll.Core.Routes import Hakyll.Core.Rules import Hakyll.Core.Rules.Internal-import Hakyll.Web.Pandoc import System.FilePath ((</>)) import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (Assertion, (@=?))@@ -75,7 +74,7 @@ -- Compile some posts match "*.md" $ do route $ setExtension "html"- compile pandocCompiler+ compile copyFileCompiler -- Yeah. I don't know how else to test this stuff? preprocess $ writeIORef ioref True
tests/Hakyll/Core/Runtime/Tests.hs view
@@ -39,7 +39,7 @@ compile $ do getResourceBody >>= saveSnapshot "raw"- >>= renderPandoc+ >>= renderParagraphs match (fromList ["partial.html", "partial-helper.html"]) $ compile templateCompiler
tests/Hakyll/Web/Template/Tests.hs view
@@ -16,7 +16,6 @@ import Hakyll.Core.Identifier import Hakyll.Core.Item import Hakyll.Core.Provider-import Hakyll.Web.Pandoc import Hakyll.Web.Template import Hakyll.Web.Template.Context import Hakyll.Web.Template.Internal@@ -89,7 +88,9 @@ out <- resourceString provider outf tpl <- testCompilerDone store provider tplf templateBodyCompiler item <- testCompilerDone store provider itemf $- pandocCompiler >>= applyTemplate (itemBody tpl) testContext+ getResourceBody+ >>= renderParagraphs+ >>= applyTemplate (itemBody tpl) testContext out @=? itemBody item cleanTestEnv
tests/TestSuite.hs view
@@ -1,4 +1,5 @@ --------------------------------------------------------------------------------+{-# LANGUAGE CPP #-} module Main ( main ) where@@ -22,7 +23,9 @@ import qualified Hakyll.Web.CompressCss.Tests import qualified Hakyll.Web.Html.RelativizeUrls.Tests import qualified Hakyll.Web.Html.Tests+#ifdef USE_PANDOC import qualified Hakyll.Web.Pandoc.FileType.Tests+#endif import qualified Hakyll.Web.Template.Context.Tests import qualified Hakyll.Web.Template.Tests @@ -43,7 +46,9 @@ , Hakyll.Web.CompressCss.Tests.tests , Hakyll.Web.Html.RelativizeUrls.Tests.tests , Hakyll.Web.Html.Tests.tests+#ifdef USE_PANDOC , Hakyll.Web.Pandoc.FileType.Tests.tests+#endif , Hakyll.Web.Template.Context.Tests.tests , Hakyll.Web.Template.Tests.tests ]
tests/TestSuite/Util.hs view
@@ -8,6 +8,7 @@ , testCompilerDone , testConfiguration , cleanTestEnv+ , renderParagraphs ) where @@ -29,6 +30,7 @@ import Hakyll.Core.Store (Store) import qualified Hakyll.Core.Store as Store import Hakyll.Core.Util.File+import Hakyll.Core.Item --------------------------------------------------------------------------------@@ -102,3 +104,13 @@ removeDirectory $ destinationDirectory testConfiguration removeDirectory $ storeDirectory testConfiguration removeDirectory $ tmpDirectory testConfiguration+++--------------------------------------------------------------------------------+-- | like 'Hakyll.Web.Pandoc.renderPandoc'+-- | but allowing to test without the @usePandoc@ flag+renderParagraphs :: Item String -> Compiler (Item String)+renderParagraphs = withItemBody (return+ . intercalate "\n" -- no trailing line+ . map (("<p>"++) . (++"</p>"))+ . lines)