Plain source file: pfe/PfeHtmlCmds.hs (2004-09-01)

PfeHtmlCmds is imported by: Main{-pfe/pfe.hs-}, PPfeCmds.

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)
    addHead m body = unlines head++body
         head = [doctype,"<html><head>", title (pp m),style,
	        "<body>",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"
 "<link rel=stylesheet type=\"text/css\" href=\"haskell.css\" title=Haskell>"
doctype = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"\">"

wrap tag html = start tag++html++end tag
start tag = "<"++tag++">"
end tag = start ('/':tag)


(HTML for this module was generated on 2006-08-12. About the conversion tool.)