tree-view-0.4: Render trees as foldable HTML and Unicode art

Safe HaskellSafe
LanguageHaskell2010

Data.Tree.View

Synopsis

Documentation

showTree :: Tree String -> String Source #

Show a Tree using Unicode art

drawTree :: Tree String -> IO () Source #

Draw a Tree on the terminal using Unicode art

Example:

*Data.Tree.View> drawTree $ Node "Add" [Node "Sub" [Node "3" [], Node "Mul" [Node "1" [], Node "2" []]], Node "4" []]
Add
 ├╴Sub
 │  ├╴3
 │  └╴Mul
 │     ├╴1
 │     └╴2
 └╴4

data NodeInfo Source #

A tree node

Constructors

NodeInfo 

Fields

  • nodeName :: String

    Node name (to be displayed in the HTML tree view)

  • nodeInfo :: String

    Additional information (to be displayed when hovering the mouse over the node). This field may contain line breaks.

htmlTree :: Tree NodeInfo -> String Source #

Convert a Tree to HTML with foldable nodes

writeHtmlTree :: FilePath -> Tree NodeInfo -> IO () Source #

Convert a Tree to an HTML file with foldable nodes