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

[ bsd3, graphics, library, program, tinytools ] [ Propose Tags ]

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


[Skip to Readme]

Modules

[Last Documentation]

  • Data
    • String
      • Unicode
        • Data.String.Unicode.Lookup
  • Potato
    • Flow
      • Potato.Flow.TutorialState
      • Vty
        • Potato.Flow.Vty.Alert
        • Potato.Flow.Vty.AppKbCmd
        • Potato.Flow.Vty.Attrs
        • Potato.Flow.Vty.Canvas
        • Potato.Flow.Vty.Common
        • Potato.Flow.Vty.Info
        • Potato.Flow.Vty.Input
        • Potato.Flow.Vty.Layer
        • Potato.Flow.Vty.Left
        • Potato.Flow.Vty.Main
        • Potato.Flow.Vty.OpenWindow
        • Potato.Flow.Vty.Params
        • Potato.Flow.Vty.PotatoReader
        • Potato.Flow.Vty.SaveAsWindow
        • Potato.Flow.Vty.ToolOptions
        • Potato.Flow.Vty.Tools
    • Reflex
      • Vty
        • Potato.Reflex.Vty.Helpers
        • Potato.Reflex.Vty.Host
        • Potato.Reflex.Vty.Widget
          • Potato.Reflex.Vty.Widget.FileExplorer
          • Potato.Reflex.Vty.Widget.Menu
          • Potato.Reflex.Vty.Widget.Popup
          • Potato.Reflex.Vty.Widget.ScrollBar
          • Potato.Reflex.Vty.Widget.TextInputHelpers
          • Potato.Reflex.Vty.Widget.Windows
  • Reflex
    • Vty
      • Test
        • Monad
          • Reflex.Vty.Test.Monad.Host
            • Reflex.Vty.Test.Monad.Host.TH

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.3, 0.1.0.4, 0.1.0.7
Change log ChangeLog.md
Dependencies aeson (>=2.1.2 && <2.2), aeson-pretty (>=0.8.10 && <0.9), ansi-terminal (>=1.0 && <1.1), base (>=4.7 && <5), bimap (>=0.5.0 && <0.6), bytestring (>=0.11.4 && <0.12), clock (>=0.8.4 && <0.9), constraints-extras (>=0.4.0 && <0.5), containers (>=0.6.7 && <0.7), data-default (>=0.7.1 && <0.8), dependent-map (>=0.4.0 && <0.5), dependent-sum (>=0.7.2 && <0.8), directory (>=1.3.8 && <1.4), extra (>=1.7.14 && <1.8), file-embed (>=0.0.15 && <0.1), filepath (>=1.4.100 && <1.5), http-conduit (>=2.3.8 && <2.4), ilist (>=0.4.0 && <0.5), lens (>=5.2.3 && <5.3), mtl (>=2.3.1 && <2.4), optparse-applicative (>=0.18.1 && <0.19), primitive (>=0.7.4 && <0.8), ref-tf (>=0.5.0 && <0.6), reflex (>=0.9.2 && <1), reflex-potatoes (>=0.1.0 && <0.2), reflex-test-host (>=0.1.2.3 && <0.2), reflex-vty (>=0.5.1 && <0.6), relude (>=1.2.1 && <1.3), semialign (>=1.3 && <1.4), template-haskell (>=2.18 && <2.21), text (>=2.0.2 && <2.1), these (>=1.2 && <1.3), time (>=1.12.2 && <1.13), tinytools (==0.1.0.7), tinytools-vty, vty (>=5.28 && <5.39) [details]
License BSD-3-Clause
Copyright 2023 minimaple (Peter Lu)
Author minimaple
Maintainer minimapletinytools@gmail.com
Category Graphics
Home page https://github.com/minimapletinytools/tinytools-vty#readme
Bug tracker https://github.com/minimapletinytools/tinytools-vty/issues
Source repo head: git clone https://github.com/minimapletinytools/tinytools-vty
Uploaded by minimaple at 2023-12-26T01:43:14Z
Distributions
Executables tinytools
Downloads 156 total (12 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2023-12-26 [all 2 reports]

Readme for tinytools-vty-0.1.0.7

[back to package description]

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
[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 😕.