Started building generation functionality, added useful haddock-style comments for several functions
This commit is contained in:
@ -18,7 +18,7 @@ app = do
|
||||
|
||||
-- Core Routes
|
||||
get "/" $ do
|
||||
html $ renderIndex "/" Nothing
|
||||
html $ renderIndex "/"
|
||||
|
||||
get "/style.css" $ do
|
||||
setHeader "Content-Type" "text/css"
|
||||
|
@ -20,5 +20,5 @@ main db = do
|
||||
|
||||
dbPath :: PurrAction String
|
||||
dbPath = do
|
||||
conf <- lift ask
|
||||
conf <- lift ask
|
||||
return $ dbFile conf
|
||||
|
@ -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 <> "\"}")
|
||||
|
@ -20,4 +20,5 @@ data DhallConfig = DhallConfig
|
||||
, applicationHost :: String
|
||||
, applicationPort :: Int
|
||||
, dbFile :: String
|
||||
, linkLength :: Int
|
||||
} deriving (Generic, Show)
|
||||
|
Reference in New Issue
Block a user