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

Safe HaskellSafe-Inferred

Data.Tree.View

Synopsis

Documentation

showTree :: Tree String -> StringSource

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 :: FilePath -> Tree NodeInfo -> IO ()Source

Convert a Tree to HTML with foldable nodes