• Stars
    star
    380
  • Rank 109,379 (Top 3 %)
  • Language
    Haskell
  • License
    BSD 3-Clause "New...
  • Created almost 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tart - draw ASCII art in the terminal with your mouse!

tart - terminal art program

 _____  _    ____ _____  _
(_   _)/ \  |    (_   _)| |
  | | / ^ \ |  O  || |  |_|
  | |/ ___ \|  _ < | |   _
  |_|_/   \_|_| \_\|_|  |_|

Tart is a program that provides an image-editor-like interface to creating ASCII art - in the terminal, with your mouse! This program is written using my purely-functional terminal user interface toolkit, Brick.

Status

Expectation management: This is a fun hobby project that I spent time on when I first created it many years ago. Since then, I have only done a little bit to keep it working. Since it was (and still is) mostly intended as a proof of concept, and since I do not use the tool actively, I have not been putting much energy into maintaining it beyond keeping it building. While that isn't likely to change, I am happy to support people who want to contribute to the tool and I may have energy to fix small things as they are reported. Use at your own risk. If other tools are more mature or perform better, you are probably better off using them!

Building

tart is a Haskell project. You'll need GHC (preferably at least 8.2) and cabal-install (preferably at least 2.0). Then:

$ git clone https://github.com/jtdaugherty/tart.git
$ cd tart
$ cabal new-build
$ $(find . -name tart -type f)

By default, tart is built as both a library and a command-line tool. But if you want to use tart only for its Haskell library and avoid the additional executable dependencies, you can build with the libonly cabal build flag.

Features

  • Drawing tools: freehand, line, box, flood fill, text string
  • Utility tools: repaint, restyle, eyedropper, eraser
  • Multiple graphical styles for boxes
  • Named image layers with reordering, visibility toggling
  • Character selection for freehand and flood fill tools
  • Set foreground color, background color, and text style independently
  • Full mouse interaction and keyboard shortcuts
  • Paste text from clipboard into canvas
  • Undo and redo
  • Text styles: bold, blink, underline, reverse video
  • Load and save ASCII art files (binary)
  • Save plain versions of ASCII art for embedding in documents
  • Save color versions of ASCII art with terminal escape sequences for printing to terminals
  • Import existing plaintext files as the basis for new ASCII art files
  • Set arbitrary canvas size

Terminal Emulator Support

tart has been tested extensively with the following terminal emulators and is known to work well with them:

  • OS X: iTerm2
  • OS X: Terminal.app

Please let me know if you use tart with another emulator and let me know how well it works!

Keybindings

Tools / styles:

  • 0..9: select tool
  • y: open the attribute style selector
  • !/@/#/$: select attribute style
  • f/b: open foreground / background palette selectors
  • c: set tool drawing character (where applicable)
  • </>: decrease / increase tool size (where applicable)
  • Esc: cancel tool drag (e.g. box)

Canvas:

  • w/a/s/d: move canvas
  • C: re-center canvas
  • v: set canvas size
  • -/+: decrease / increase canvas size

Layers:

  • C-a: add new layer
  • C-r: rename current layer
  • C-n/C-p: select next/previous layer
  • C-x: delete selected layer
  • C-u/C-d: move current layer up / down
  • C-v: toggle selected layer's visibility
  • C-l: toggle visibility of layer list

General:

  • q: quit (and optionally save)
  • C-s: save
  • u: undo
  • r: redo
  • OS paste: paste text into canvas

How It Works

Tart requires a terminal with mouse support. You use various tools (such as freehand drawing, boxes, etc.) to draw ASCII pictures. You can set a current foreground and background color. You can also resize the drawing canvas to get the desired output size. When you're finished, you can save to disk, at which point Tart creates three files:

  • A binary file (say foo.tart) suitable for reloading with Tart for further editing later
  • A text file foo.color.txt containing the ASCII art with terminal color escape sequences, suitable for emitting to terminals
  • A text file foo.plain.txt containing the ASCII art without terminal color escape sequences, suitable for embedding in documentation

Contributing

If you decide to contribute, that's great! Here are some guidelines you should consider to make submitting patches easier for all concerned:

  • If you want to take on big things, talk to me first; let's have a design/vision discussion before you start coding. Create a GitHub issue and we can use that as the place to hash things out.
  • Please make changes consistent with the conventions I've used in the codebase.
  • Please adjust or provide Haddock and/or user guide documentation relevant to any changes you make.

More Repositories

1

brick

A declarative Unix terminal UI library written in Haskell
Haskell
1,565
star
2

vty

A high-level ncurses alternative written in Haskell
Haskell
322
star
3

dbmigrations

A library for the creation, management, and installation of schema updates for relational databases.
Haskell
74
star
4

vty-ui

A terminal user interface programming library similar to graphical interfaces such as GTK and QT. (DEPRECATED, see https://github.com/jtdaugherty/brick)
Haskell
72
star
5

mathblog

A package for managing a static, mathematically-inclined web log
Haskell
25
star
6

tracy

A Haskell ray tracer largely based on http://www.raytracegroundup.com/
Haskell
23
star
7

text-zipper

A text editor zipper libary
Haskell
18
star
8

brick-skylighting

Display syntax-highlighted text in Brick user interfaces
Haskell
12
star
9

dbmigrations-postgresql

This is the PostgreSQL support package for dbmigrations.
Haskell
8
star
10

word-wrap

A Haskell library for wrapping long lines of text
Haskell
8
star
11

tmux-config

My tmux configuration
Shell
7
star
12

mutt-tutorial

6
star
13

vty-unix

Unix backend for Vty
Haskell
4
star
14

ccat

Colorize just about any text file in a terminal with Pygments
Python
4
star
15

toot

Console twitter client
Haskell
3
star
16

t2

An interactive ray tracer powered by OpenCL
C
3
star
17

text-markup

Text markup data structure
Haskell
3
star
18

smtp

Haskell client support for SMTP
Haskell
3
star
19

vty-crossplatform

Build-time cross-platform package for Vty
Haskell
3
star
20

vty-ui-builder-tool

A command-line tool interface for the vty-ui-builder library and document reader backends
Haskell
2
star
21

flux

A ray tracer implementation in Rust
Rust
2
star
22

vty-ui-builder

A user interface code generator for vty-ui
Haskell
2
star
23

dbmigrations-client

An interactive terminal client for dbmigrations
Haskell
2
star
24

vimrc

My Vim configuration
Vim Script
2
star
25

dbmigrations-mysql

This is the MySQL support package for dbmigrations.
Haskell
2
star
26

rules

A library for structured data validation and extraction
Haskell
2
star
27

vty-ui-extras

Extra functionality not included in the core vty-ui package
Haskell
2
star
28

vty-ui-builder-xml

vty-ui-builder XML input document reader
Haskell
2
star
29

mix-assembler

Haskell implementation of an assembler for the MIXAL assembly language
Haskell
2
star
30

language-mixal

Haskell parser and pretty-printer for the MIXAL assembly language
Haskell
2
star
31

jtdaugherty.github.com

github site
CSS
2
star
32

prj

A shell script tool for managing project environment configurations
Shell
2
star
33

rttest

Haskell
1
star
34

rebound

A ray tracer project in Rust based on Ray Tracing In One Weekend
Rust
1
star
35

brick-devlunch

Haskell
1
star
36

dbmigrations-sqlite

This is the SQLite support package for dbmigrations.
Haskell
1
star
37

sdl-sandbox

An SDL sandbox codebase for 2-D game engine explorations
C++
1
star
38

text-zipper-benchmarks

Criterion benchmarks for the text-zipper library
Haskell
1
star
39

emacs-config

Obligatory emacs configuration repository
Emacs Lisp
1
star