This module defines simple helper functions for use with Text.PrettyPrint. It also re-exports all the pretty-printing combinators from that module.
You should only be using this module if you are writing custom node
types for use with Data.GraphViz.Types. For actual printing of
(which produces a
The Dot language specification specifies that any identifier is in one of four forms:
- Any string of alphabetic ([a-zA-Z200-377]) characters, underscores ('_') or digits ([0-9]), not beginning with a digit;
- a number [-]?(.[0-9]+ | [0-9]+(.[0-9]*)? );
- any double-quoted string ("...") possibly containing escaped quotes (\");
- an HTML string (...).
(Note that the first restriction is referring to a byte-by-byte
comparison using octal values; when using UTF-8 this corresponds to
ord c >= 128.)
Due to these restrictions, you should only use
text when you are
sure that the
String in question is static and quotes are
definitely needed/unneeded; it is better to use the
PrintDot. For more information, see the
- module Text.PrettyPrint
- type DotCode = Doc
- renderDot :: DotCode -> String
- class PrintDot a where
- printIt :: PrintDot a => a -> String
- addQuotes :: String -> DotCode -> DotCode
- unqtEscaped :: [Char] -> String -> DotCode
- printEscaped :: [Char] -> String -> DotCode
- wrap :: DotCode -> DotCode -> DotCode -> DotCode
- commaDel :: (PrintDot a, PrintDot b) => a -> b -> DotCode
- printField :: PrintDot a => String -> a -> DotCode
- angled :: DotCode -> DotCode
- rang :: DotCode
- lang :: DotCode
- fslash :: DotCode
A class used to correctly print parts of the Graphviz Dot language.
Minimal implementation is
The unquoted representation, for use when composing values to produce a larger printing value.
The actual quoted representation; this should be quoted if it
contains characters not permitted a plain ID String, a number
or it is not an HTML string.
The correct way of representing a list of this value when printed; not all Dot values require this to be implemented. Defaults to Haskell-like list representation.
Convert to DotCode; note that this has no indentation, as we can only have one of indentation and (possibly) infinite line lengths.
Escape the specified chars as well as
" and then wrap the
result in quotes.