module EhsTools ( cgiPage ) where cgiPage :: IO String -> IO String -> IO String -> IO String cgiPage title pre body = do t <- title p <- pre b <- body return $ "#!/usr/local/bin/perl\n" ++ plPrint "Content-type: text/html\n\n" ++ plPrint "\n" ++ plPrint ("") ++ plPrint ("" ++ t ++ "") ++ plPrint ("

" ++ t ++ "

") ++ plPrint p ++ b ++ plPrint "\n" plPrint :: String -> String plPrint str = "print " ++ show str ++ ";\n"