Draw sequence diagram in text from terminal.

Overview

sequence-diagram-cli

Draw seqence diagram from terminal.

Installation

$ ~/sequence-diagram-cli > sh ./install.sh
$ ~/sequence-diagram-cli > seqdia 'YOUR_SEQUENCE_DIAGRAM_FILE'
$ ~/sequence-diagram-cli > seqdia 'YOUR_SEQUENCE_DIAGRAM_FILE' prefix='// ' suffix='|'

//example
$ ~/sequence-diagram-cli > seqdia tests/test.txt

Example ouput

./tests/test.txt
------------------
; participants
participant User
participant " * TODO
 - clean living room  " as todo
participant Dev
participant S

; connections
User->User: default asd
User-->Dev: styled arrow
todo->todo : "self connecting
with
new line"
User->Dev : yes? sd
User<--Dev : no
Dev-->Dev:jjjsdka
todo<--Dev: reverse arrow
S->todo: "EEEE
E
EEEE
E
EEEE"
S->S:aaaaeeaa
-------------------

$ ~/sequence-diagram-cli > seqdia tests/test.txt prefix='// ' suffix='|'
===================================================================
//         ╭────────────────────────╮                             |
// ╭──────╮│  * TODO                │   ╭─────╮      ╭───╮        |
// │ User ││  - clean living room   │   │ Dev │      │ S │        |
// ╰───┬──╯╰────────────┬───────────╯   ╰──┬──╯      ╰─┬─╯        |
//     │                │                  │           │          |
//     │                │                  │           │          |
//     │ default asd    │                  │           │          |
//     ├╌╌╌╌╌╌╌╌╌╌╌╌╮   │                  │           │          |
//     │            │   │                  │           │          |
//     │◀╌╌╌╌╌╌╌╌╌╌╌╯   │                  │           │          |
//     │                │                  │           │          |
//     │           styled arrow            │           │          |
//     ├╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶≻│           │          |
//     │                │                  │           │          |
//     │                │ self connecting  │           │          |
//     │                │ with             │           │          |
//     │                │ new line         │           │          |
//     │                ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮ │           │          |
//     │                │                │ │           │          |
//     │                │◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯ │           │          |
//     │                │                  │           │          |
//     │              yes? sd              │           │          |
//     ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌▶│           │          |
//     │                │                  │           │          |
//     │                no                 │           │          |
//     │≺╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┤           │          |
//     │                │                  │           │          |
//     │                │                  │ jjjsdka   │          |
//     │                │                  ├╶╶╶╶╶╶╶╶╮  │          |
//     │                │                  │        ┊  │          |
//     │                │                  │≺╴╴╴╴╴╴╴╯  │          |
//     │                │                  │           │          |
//     │                │  reverse arrow   │           │          |
//     │                │≺╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┤           │          |
//     │                │                  │           │          |
//     │                │            EEEE  │           │          |
//     │                │            E     │           │          |
//     │                │            EEEE  │           │          |
//     │                │            E     │           │          |
//     │                │            EEEE  │           │          |
//     │                │◀╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┤          |
//     │                │                  │           │          |
//     │                │                  │           │ aaaaeeaa |
//     │                │                  │           ├╌╌╌╌╌╌╌╌╌╮|
//     │                │                  │           │         │|
//     │                │                  │           │◀╌╌╌╌╌╌╌╌╯|
//     │                │                  │           │          |
//     │                │                  │           │          |
//     │                │                  │           │          |
//     │                │                  │           │          |
//     │                │                  │           │          |
//     │                │                  │           │          |
//     │                │                  │           │          |
//     │                │                  │           │          |
===================================================================

Syntax

participant

You don't need to define participant, but for alignment, you should.

participant User // this will be front
; or
participant "with [email protected]#!$" as A // you can use this like 'A -> User: ***'
; or
participant "new
line" as nl // this will be last

arrow

User->New: message // participant 'New' will defined automatically at here
; or
User-->New: message
; or
User<-A: message
; or
User<--A: message
; or
nl -> nl: " realllly // with multiple lines
looooooong
messageee"
; or
ee <- ee: "
  you can't use like this" // when using new line, you should add 1 character to first line at least. I'll fix this soon.

You can also customize styles by editing style.h.

TODO

  • note
  • more arrow design
Issues
  • Add option to not print the surrounding === lines

    Add option to not print the surrounding === lines

    The lines surrounding the generated diagrams (========) are inconvenient when seqdia is used in scripts (or e.g. slides) to generate diagrams on the fly, especially because they are colour coded.

    This PR introduces the raw option which when specified, makes the renderer not print those lines.

    opened by danail-branekov 1
  • Error compiling: multiple definition of `style`

    Error compiling: multiple definition of `style`

    I think you've got a header include loop or something. (main.h includes renderer.h which includes style.h -- and style.c -> style.h)

    gcc main.o arrow_connection.o participant.o renderer.o parser.o scanner.o style.o fetch.o -o seqdia -I/usr/local/opt/curl/include -L/usr/local/opt/curl/lib -lcurl
    /usr/bin/ld: renderer.o:(.bss+0x0): multiple definition of `style'; main.o:(.bss+0x0): first defined here
    /usr/bin/ld: style.o:(.bss+0x0): multiple definition of `style'; main.o:(.bss+0x0): first defined here
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:22: seqdia] Error 1
    
    opened by pzl 0
Releases(v1.3.4)
Owner
Foreign student who live in Japan
null
A terminal emulator that runs in your terminal. Powered by Turbo Vision.

tvterm A terminal emulator that runs in your terminal. Powered by Turbo Vision. tvterm is an experimental terminal emulator widget and application bas

null 18 Jun 1, 2022
Spitfire is a basic terminal language that can exicute code via the terminal.

Spitfire is a basic terminal language that can exicute code via the terminal. It is easy to learn and runs fast, considering that its just a 300 line c++ file.

jhomas tefferson 0 Nov 18, 2021
Library for creating terminal applications with text-based widgets

Library for creating terminal applications with text-based widgets FINAL CUT is a C++ class library and widget toolkit with full mouse support for cre

Markus Gans 642 Jun 23, 2022
Small header only C++ library for writing multiplatform terminal applications

Terminal Terminal is small header only library for writing terminal applications. It works on Linux, macOS and Windows (in the native cmd.exe console)

Jupyter Xeus 208 Jun 30, 2022
:computer: C++ Functional Terminal User Interface. :heart:

FTXUI Functional Terminal (X) User interface A simple C++ library for terminal based user interface. Demo: Feature Functional style. Inspired by [1] a

Arthur Sonzogni 3.2k Jun 23, 2022
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Cacahuète Sans Sel 18 Apr 27, 2022
Terminal calculator made for programmers working with multiple number representations, sizes, and overall close to the bits

Programmer calculator The programmer calculator is a simple terminal tool designed to give maximum efficiency and flexibility to the programmer workin

romes 164 Jun 22, 2022
X terminal emulator rendering through OpenGL ES Compute Shaders

Zutty is a terminal emulator for the X Window System, functionally similar to several other X terminal emulators such as xterm, rxvt and countless others

Tom Szilagyi 212 Jun 22, 2022
The new Windows Terminal and the original Windows console host, all in the same place!

The new Windows Terminal and the original Windows console host, all in the same place!

Microsoft 83.8k Jun 27, 2022
n³ The unorthodox terminal file manager

n³ The unorthodox terminal file manager

Mischievous Meerkat 14.3k Jun 28, 2022
Graphs the activity of a chia harvester in a linux terminal.

Chia Harvest Graph Monitor for Chia Harvesting Introduction The chiaharvestgraph tool will graph Chia Harvesting activity in a linux terminal. Use a 2

Bram Stolk 219 Jun 3, 2022
a simple to use linux terminal

a simple to use linux terminal

notaweeb 7 Feb 17, 2022
Collection of human friendly terminal interface for git.

A collection of human friendly terminal user interface for git.

Arthur Sonzogni 61 Jun 26, 2022
Simple benchmark for terminal output

TermBench This is a simple timing utility you can use to see how slow your terminal program is at parsing escape-sequence-coded color output. It can b

Casey Muratori 171 May 30, 2022
tinytetris - 80x23 terminal tetris

tinytetris - 80x23 terminal tetris

Conor Taylor 1.8k Jul 2, 2022
Contour - A modern C++ Terminal Emulator

contour is a modern terminal emulator, for everyday use. It is aiming for power users with a modern feature mindset.

Contour Terminal Emulator 873 Jun 26, 2022
📺🗿 Terminal graphics for the 21st century.

???? Chafa is a command-line utility that converts all kinds of images, including animated GIFs, into sixel or ANSI/Unicode character output that can be displayed in a terminal.

Hans Petter Jansson 1.4k Jun 24, 2022
Simple Unix Terminal Football Manager-like game.

Superleage 2020/2021 It is a "work in progress" simple game based on some mechanics of Football Manager. The game is in a very early stage of Developm

sewe2000 2 Oct 14, 2021
timg - Terminal Image and Video Viewer

timg - Terminal Image and Video Viewer

Henner Zeller 1.2k Jun 27, 2022