packages feed

tree-view 0.2 → 0.3

raw patch · 2 files changed

+8/−11 lines, 2 files

Files

src/Data/Tree/View.hs view
@@ -2,8 +2,8 @@     ( showTree     , drawTree     , NodeInfo (..)-    , showTreeHtml     , htmlTree+    , writeHtmlTree     ) where  @@ -85,13 +85,14 @@     =  [htmlNode n ++ "<span id=\"children_node" ++ show (snd n) ++ "\" class=\"children\">"]     ++ appLast (concat (indentChildren (map showTreeHtml' ns))) "</span>" -showTreeHtml :: Tree NodeInfo -> String-showTreeHtml tree = unlines $ lines template1 ++ showTreeHtml' (enumTree tree) ++ lines template2- -- | Convert a 'Tree' to HTML with foldable nodes-htmlTree :: FilePath -> Tree NodeInfo -> IO ()-htmlTree file = writeFile file . showTreeHtml+htmlTree :: Tree NodeInfo -> String+htmlTree tree = unlines $ lines template1 ++ showTreeHtml' (enumTree tree) ++ lines template2 +-- | Convert a 'Tree' to an HTML file with foldable nodes+writeHtmlTree :: FilePath -> Tree NodeInfo -> IO ()+writeHtmlTree file = writeFile file . htmlTree+ template1 =   "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\   \<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\@@ -100,10 +101,6 @@   \  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\   \  <title>Tree view</title>\n\   \  <style type=\"text/css\">\n\-  \    body {\n\-  \      font-family: monospace;\n\-  \      font-size:   12px;\n\-  \    }\n\   \    .node {\n\   \      color:       blue;\n\   \      font-weight: bold;\n\
tree-view.cabal view
@@ -1,5 +1,5 @@ name:                tree-view-version:             0.2+version:             0.3 synopsis:            Render trees as foldable HTML and Unicode art description:         Render trees as foldable HTML and Unicode art                      .