Started building generation functionality, added useful haddock-style comments for several functions

This commit is contained in:
2022-07-22 12:27:35 -05:00
parent 10e3724a1a
commit b1a4251d95
11 changed files with 1703 additions and 34 deletions

View File

@ -18,7 +18,7 @@ app = do
-- Core Routes
get "/" $ do
html $ renderIndex "/" Nothing
html $ renderIndex "/"
get "/style.css" $ do
setHeader "Content-Type" "text/css"

View File

@ -20,5 +20,5 @@ main db = do
dbPath :: PurrAction String
dbPath = do
conf <- lift ask
conf <- lift ask
return $ dbFile conf

View File

@ -13,8 +13,13 @@ import qualified Data.Text.Lazy as LT
import Prelude
renderIndex :: String -> Maybe T.Text -> LT.Text
renderIndex link password = renderHtml ( $(shamletFile "./views/index.hamlet") )
renderIndex :: String -> LT.Text
renderIndex link = renderHtml ( $(shamletFile "./views/index.hamlet") )
where
hsUserLink = userLinkAttr link
renderStyle :: LT.Text
renderStyle = renderCss ( $(cassiusFile "./views/cassius/style.cassius") "/style.css" )
userLinkAttr :: String -> (String, String)
userLinkAttr str = ("hx-vals", "{\"userLink\": \"" <> str <> "\"}")

View File

@ -20,4 +20,5 @@ data DhallConfig = DhallConfig
, applicationHost :: String
, applicationPort :: Int
, dbFile :: String
, linkLength :: Int
} deriving (Generic, Show)