1-- | Dump a directed graph in dot format. Used for debugging purposes
3module Hakyll.Core.DirectedGraph.Dot
8import Hakyll.Core.DirectedGraph
9import qualified Data.Set as S
11-- | Convert a directed graph into dot format for debugging purposes
14 => (a -> String) -- ^ Convert nodes to dot names
15 -> DirectedGraph a -- ^ Graph to dump
16 -> String -- ^ Resulting string
17toDot showTag graph = unlines $ concat
18 [ return "digraph dependencies {"
19 , concatMap showNode (S.toList $ nodes graph)
23 showNode node = map (showEdge node) $ S.toList $ neighbours node graph
24 showEdge x y = " \"" ++ showTag x ++ "\" -> \"" ++ showTag y ++ "\";"
26-- | Write out the @.dot@ file to a given file path. See 'toDot' for more
29writeDot :: Ord a => FilePath -> (a -> String) -> DirectedGraph a -> IO ()
30writeDot path showTag = writeFile path . toDot showTag
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list