{- Xml2Html Read BLAST Output in XML format, and output as a set of HTML files. In contrast to almost everything else out there, we generate HTML tables, rather than a GIF or similar for the graphical output. -} module Html where import Tabulate import Bio.Alignment.BlastData import Data.ByteString.Lazy.Char8 (unpack,ByteString) import Text.XHtml import System.Directory import System.IO import Text.Printf import Debug.Trace (trace) import Options (htmldir) instance HTML ByteString where toHtml = toHtml . unpack makeDirectory :: FilePath -> IO () makeDirectory f = do createDirectory f `catch` (\e -> fail ("Couldn't create directory: '" ++ f++ "'\n"++show e)) doctype, htmlfooter, default_bg :: String -- manual open tags doctype = "\n" htmlheader :: BlastResult -> [String] -> String htmlheader b hs = doctype ++ "" ++ renderHtmlFragment (header << thetitle << "Blast") ++ "
" ++ renderHtmlFragment pagehdr ++ "\n