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, Parseable (MainOpts 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
Eq Braille Source # | |
Ord Braille Source # | |
Read Braille Source # | |
Show Braille Source # | |
TypeableFloat n => Backend Braille V2 n Source # | |
TypeableFloat n => Renderable (Text n) Braille Source # | |
TypeableFloat n => Renderable (DImage n Embedded) Braille Source # | |
TypeableFloat n => Renderable (Path V2 n) Braille Source # | |
Show n => Show (Options Braille V2 n) Source # | |
Monoid (Render Braille V2 n) Source # | |
Hashable n => Hashable (Options Braille V2 n) Source # | |
type V Braille Source # | |
type N Braille Source # | |
data Options Braille V2 Source # | |
data Render Braille V2 Source # | |
type Result Braille V2 n Source # | |
type MainOpts [(String, QDiagram B V2 n Any)] # | |
type MainOpts (QDiagram B V2 n Any) # | |