@@ -1,3 +1,12 @@
1+-- | This is the main Hakyll module, exporting the important @hakyl@ function.
2+--
3+-- Most configurations would use this @hakyll@ function more or less as the
4+-- main function:
5+--
6+-- > main = hakyll $ do
7+-- > directory css "css"
8+-- > directory static "images"
9+--
110module Text.Hakyll
211 ( defaultHakyllConfiguration
312 , hakyll
@@ -13,7 +22,7 @@ import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
1322import Network.Hakyll.SimpleServer (simpleServer)
1423import Text.Hakyll.Hakyll
1524
16−-- | Default hakyll configuration.
25+-- | The default hakyll configuration.
1726defaultHakyllConfiguration :: HakyllConfiguration
1827defaultHakyllConfiguration = HakyllConfiguration
1928 { additionalContext = M.empty
@@ -21,11 +30,11 @@ defaultHakyllConfiguration = HakyllConfiguration
2130 , cacheDirectory = "_cache"
2231 }
2332
24−-- | Hakyll with a default configuration.
33+-- | Main function to run Hakyll with the default configuration.
2534hakyll :: Hakyll () -> IO ()
2635hakyll = hakyllWithConfiguration defaultHakyllConfiguration
2736
28−-- | Main function to run hakyll with a configuration.
37+-- | Main function to run hakyll with a custom configuration.
2938hakyllWithConfiguration :: HakyllConfiguration -> Hakyll () -> IO ()
3039hakyllWithConfiguration configuration buildFunction = do
3140 args <- getArgs
@@ -61,5 +70,6 @@ help = liftIO $ do
6170 ++ name ++ " preview [port] Generate site, then start a server.\n"
6271 ++ name ++ " server [port] Run a local test server.\n"
6372
73+-- | Start a server at the given port number.
6474server :: Integer -> Hakyll ()
6575server p = askHakyll siteDirectory >>= liftIO . simpleServer (fromIntegral p)