MyNixOS website logo
Description

tinytools-vty is a terminal based monospace unicode diagram editing tool.

tinytools-vty

tinytools-vty is a mono-space unicode diagram editor written in Haskell

This repository contains the reflex-vty based view/controller implementation built on top of the tinytools model.

tinytools is still in BETA and may be quite unstable. Save often!!!

installation

pre-requisites

text-icu is required as a prerequisite. On mac

brew install icu4c
brew link icu4c --force
export PKG_CONFIG_PATH="$(brew --prefix)/opt/icu4c/lib/pkgconfig"

You will also need the haskell build tool cabal. The best way to do this is using ghcup

To install tiny tools run cabal install tinytools-vty and then you can run tinytools Or if you are building locally then cabal run tinytools

NOTE that tinytools is also the name of the base model library for tinytools-vty. If you just cabal install tinytools you will install the library and not the exe!!!

usage

When you first run tinytools a tutorial file will open which contains information on how to use tinytools-vty.

  • To open an empty document do tinytools --empty (or cabal run tinytools -- --empty)
  • In order to support unicode wide chars (optional), you must first generate the term width file for your terminal tinytools --widthtable

tinytools-vty has a very intuitive interface and most operations should be clear.

tools

[(v)select][(p)an][(b)ox]      
[(l)ine][pai(n)t]   

the [(v)select] tool

The select tool is your do all tool for interacting with existing elements in your document. Click on individual elements to select or modify it. Click and drag to select multiple elements.

the [(p)an] tool

click + drag in the canvas area with the pan tool to pan the canvas.

the [(b)ox] tool

Use the box tool to create boxes. After creating or selecting a box, click on the top border to add or modify a label. Click inside the box to add or modify text. You can change the styling of your lines in the left menu.

the [(l)ine] tool

Use the line tool to create lines. Lines can attach to existing boxes on either end. After selecting a line, you can move either end point of line or change their attachment. You click and drag in the middle of a line to add midpoints to your line. You can double click on a line to add a line label. Line labels can be moved by clicking and dragging on highlighted handle in the middle. You can change the styling of your lines in the left menu.

the [(t)ext] tool

Same as the box tool except you can immediately add text to the box without additional clicking!

the [pai(n)t] tool

The paint tool lets you create areas that take free form text. After selecting a paint area, you can move the cursor anywhere inside and add text.

layers

On the left hand side is a very sophisticated layering system. All elements will show up in the layer system. You can drag elements around to reorder them. You can add folders to create a hierarchical layer system. You can hide or lock elements in the layers menu. You can select elements in the layers menu.

shortucts

  • (ctrl-s) save
  • (ctrl-p) print
  • (ctrl-q) quit
  • (ctrl-c) copy
  • (ctrl-v) paste
  • (ctrl-z) undo
  • (ctrl-y) redo
  • (ctrl-o) open
  • (ctrl-n) new

menu

[new][open][save][save as]     
[write to "tt.txt"][quit] 
  • [new]: creates a new empty doc, prompts to save if there are unsaved changes
  • [open]: open a doc from disk, all docs must end .potato extension
  • [save]: save the doc to the existing file context, same as save as if no file context
  • [save as]: save the doc to a new file context
  • [write to "tt.txt"]: writes the doc to "tt.txt"
  • [quit]: quit the app, prompts to save if there are unsaved changes

unicode widechar and grapheme cluster support

Unicode character display width seems to vary by terminal. tinytools-vty uses the xterm-256 (mac default terminal) terminal width mappings by default. You can run tinytools-vty with the --widthtable arg to generate the table to your local config directory for the current terminal. Generating the table samples each unicode character inside the terminal and takes a few seconds to run. Please see the Graphics.Vty.UnicodeWidthTable module of the vty for more info. Grapheme clusters are not really supported by terminals so they are currently disabled 😭.

Also note that many mono-space text displays do not display unicode widechars at a width consistent with its mono-spacing 😕.

Metadata

Version

0.1.0.7

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows