wai-static-pages-0.3: generate static html pages from a WAI application

Safe HaskellNone
LanguageHaskell98

Network.WAI.Application.StaticPages

Synopsis

Documentation

parseRoutePaths :: Text -> [Text] Source

Conveniently specify paths through nested indentation This is a partial function which calls error on invalid input.

 import Shakespeare.Text (st)

 staticPaths = parseRoutePaths [st|
/pages
        about
        faq
        /
-- commented out
|]
staticPaths == ["/pages/about", "/pages/faq", "/pages"]

renderStaticPages Source

Arguments

:: Application 
-> Text

directory

-> [Text]

request paths

-> IO () 

Render the paths in the application, writing the results to the given directory with an .html extension.

renderStaticPagesTo Source

Arguments

:: Application 
-> [Text]

request paths

-> (Text -> Request -> FilePath)

convert the request path and request to a FilePath

-> IO () 

Render the paths in the application, passing the path through the given function to determine the filepath on disk.