module PfeHtmlCmds where import Prelude hiding (putStr,putStrLn,writeFile) import HsName(ModuleName(..)) import PFE_HTML import PfeParse(moduleArgs,just) import AbstractIO import PrettyPrint(pp) --import CmdLineParser pfeHtmlCmds = [--("html" , moduleArgs showHtml), ("htmlfiles", (moduleArgs htmlfiles,"generate HTML files for modules")), ("webpages", (moduleArgs webpages, "generate web pages for modules"))] --showHtml = toHtml pfeURL (const putStrLn) . Just htmlfiles ms = toHtmlFiles htmlDir pfeURL (const id) (just ms) webpages ms = toHtmlFiles wwwDir wwwURL addHead (just ms) where addHead m body = unlines head++body where head = [doctype,"", title (pp m),style, "",h1 (pp m)] wwwURL m = htmlFile m pfeURL m = "pfe.cgi?"++simpModuleName m simpModuleName (PlainModule m) = m simpModuleName (MainModule path) = path --- Some HTML combinators that belong somewhere else... title=wrap "title" h1=wrap "h1" style= "" doctype = "" wrap tag html = start tag++html++end tag start tag = "<"++tag++">" end tag = start ('/':tag)