diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-31 13:40:15 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-31 13:40:15 +0100 |
commit | fbd9ff95bdd9c9bd904d87f2b2f2d88470c68173 (patch) | |
tree | 23e773989107f17fdd1a65aa2c388d9acb9ab85b /src/Text/Hakyll.hs | |
parent | 7afabf5c098efc2f0df482ab66d9091d7aa3bd23 (diff) | |
download | hakyll-fbd9ff95bdd9c9bd904d87f2b2f2d88470c68173.tar.gz |
A little more documentation.
Diffstat (limited to 'src/Text/Hakyll.hs')
-rw-r--r-- | src/Text/Hakyll.hs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Text/Hakyll.hs b/src/Text/Hakyll.hs index 33b1b57..dfe7b02 100644 --- a/src/Text/Hakyll.hs +++ b/src/Text/Hakyll.hs @@ -1,3 +1,12 @@ +-- | This is the main Hakyll module, exporting the important @hakyl@ function. +-- +-- Most configurations would use this @hakyll@ function more or less as the +-- main function: +-- +-- > main = hakyll $ do +-- > directory css "css" +-- > directory static "images" +-- module Text.Hakyll ( defaultHakyllConfiguration , hakyll @@ -13,7 +22,7 @@ import System.Directory (doesDirectoryExist, removeDirectoryRecursive) import Network.Hakyll.SimpleServer (simpleServer) import Text.Hakyll.Hakyll --- | Default hakyll configuration. +-- | The default hakyll configuration. defaultHakyllConfiguration :: HakyllConfiguration defaultHakyllConfiguration = HakyllConfiguration { additionalContext = M.empty @@ -21,11 +30,11 @@ defaultHakyllConfiguration = HakyllConfiguration , cacheDirectory = "_cache" } --- | Hakyll with a default configuration. +-- | Main function to run Hakyll with the default configuration. hakyll :: Hakyll () -> IO () hakyll = hakyllWithConfiguration defaultHakyllConfiguration --- | Main function to run hakyll with a configuration. +-- | Main function to run hakyll with a custom configuration. hakyllWithConfiguration :: HakyllConfiguration -> Hakyll () -> IO () hakyllWithConfiguration configuration buildFunction = do args <- getArgs @@ -61,5 +70,6 @@ help = liftIO $ do ++ name ++ " preview [port] Generate site, then start a server.\n" ++ name ++ " server [port] Run a local test server.\n" +-- | Start a server at the given port number. server :: Integer -> Hakyll () server p = askHakyll siteDirectory >>= liftIO . simpleServer (fromIntegral p) |