module Text.HTML.TreeList ( treeList )
where
import Data.Tree
import Data.List
mkHTMLBox :: String -> String -> String
mkHTMLBox cs co = "
"
++""++(mkHTMLLines cs)++" |
\n"
mkHTMLLines :: String -> String
mkHTMLLines x = intercalate "
" $ lines x
treeList :: Tree String -> String
treeList (Node s xs) = (mkHTMLBox s "lightyellow") ++ (mkList $ map treeList xs)
mkList :: [String] -> String
mkList [] = ""
mkList xs = let lnStart = ""
lnIn = map (\x -> "- "++x++"
") xs
lnEnd = ""
in unlines ([lnStart] ++ lnIn ++ [lnEnd])