Skip to content

rorokimdim/mindra

Repository files navigation

mindra

A command-line wrapper for diagrams and gloss so we can leverage them outside haskell.

The goal is to provide a good subset of features from both libraries.

See mindra-clj for an example of a client library. It talks to mindra via stdin/stdout using just formatted text.

Current status

Diagrams

Only the SVG backend is supported, and only a very small subset of diagrams is exposed. See svg-parser for what is supported and how the commands are parsed into diagram(s).

See mindra-clj-diagrams for some examples.

Gloss

Most of the gloss features are supported. We should be able to use mindra for creating both static pictures and animations (with event handling!). See gloss-parser for what is supported and how the commands are parsed into gloss picture(s).

See mindra-clj-gloss for some examples.

Installation

Linux and Mac

Install:

brew install rorokimdim/brew/mindra

Upgrade:

brew upgrade mindra

Uninstall:

brew uninstall mindra

Windows

Binaries are available at releases.

Others

No pre-built binaries available at this time. We will need to build from source using stack install or cabal install.

Install stack, clone this repository and run the following in repository directory.

stack install

Basic usage

A. Start mindra command

mindra

It should print READY INIT which means it is ready to receive the INIT (initialization) command.

B. Initialize it for either diagrams or gloss

For diagrams

Configure for SVG of size 300px by 400px:

INIT Diagrams SVG 300 400

Note: Each command should be followed by a blank line.

For gloss

Configure for a window of size 500px by 500px, at position 10px, 10px on the screen, with the title "My Title", and white background color (red, green, blue, alpha values):

INIT Gloss
Window 500 500 10 10 "My Title"
Color 255 255 255 255

Note: Each command should be followed by a blank line.

C. Draw something

For diagrams

SVG Circle 100

For gloss

PICTURE Circle 100

Note: Each command should be followed by a blank line.

Hit ESC to close window.

Credits

  1. Haskell
  2. Diagrams and Gloss
  3. All of these libraries and all the things they depend on

About

A command line wrapper for diagrams and gloss.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published