Safe Haskell | None |
---|---|
Language | Haskell2010 |
Convenient creation of command-line-driven executables for rendering diagrams to Braille.
defaultMain
creates an executable which can render a single diagram at various options.multiMain
is likedefaultMain
but allows for a list of diagrams from which the user can choose one to render.mainWith
is a generic form that does all of the above but with a slightly scarier type. See Diagrams.Backend.CmdLine. This form can also take a function type that has a suitable final result (any of arguments to the above types) andParseable
arguments.
For a tutorial on command-line diagram creation see http://projects.haskell.org/diagrams/doc/cmdline.html.
General form of main
mainWith :: Mainable d => d -> IO () #
Main entry point for command-line diagram creation. This is the method
that users will call from their program main
. For instance an expected
user program would take the following form.
import Diagrams.Prelude import Diagrams.Backend.TheBestBackend.CmdLine d :: Diagram B R2 d = ... main = mainWith d
Most backends should be able to use the default implementation. A different implementation should be used to handle more complex interactions with the user.
Supported forms of main
multiMain :: [(String, Diagram B)] -> IO () Source #
multiMain
takes a list of diagrams paired with names as input.
The generated executable then takes a --selection
option
specifying the name of the diagram that should be rendered. The
list of available diagrams may also be printed by passing the
option --list
.
Backend tokens
Instances
Orphan instances
TypeableFloat n => Mainable [(String, QDiagram B V2 n Any)] Source # | |
TypeableFloat n => Mainable (QDiagram B V2 n Any) Source # | |