aboxd

0.4.0 • Public • Published

aboxd

Build Status npm version

Turn comma-separated strings to ascii-charts. Try it live here

img

Examples

npx aboxd 'left,right' will yield:

┌──────┐   ┌───────┐
│ left │───│ right │
└──────┘   └───────┘

npx aboxd $',top\nbottom-left,bottom-right' will yield:

                  ┌──────────────┐
                  │     top      │
                  └──────────────┘
                         │        
┌─────────────┐   ┌──────────────┐
│ bottom-left │───│ bottom-right │
└─────────────┘   └──────────────┘

Use a dot(".") to connect boxes without text:

npx aboxd $'.,top\nbottom-left,bottom-right' will yield:


                  ┌──────────────┐
       ┌──────────│     top      │
       │          └──────────────┘
       │                 │        
┌─────────────┐   ┌──────────────┐
│ bottom-left │───│ bottom-right │
└─────────────┘   └──────────────┘

From files

aboxd will read from stdin if no arguments are given

Given a file:

,Sky
Sweden,Norway
Subway,.

cat file | npx aboxd


             ┌────────┐
             │  Sky   │
             └────────┘
                 │     
┌────────┐   ┌────────┐
│ Sweden │───│ Norway │
└────────┘   └────────┘
    │            │     
┌────────┐       │     
│ Subway │───────┘     
└────────┘             

Vim plugin

Plugin is a stretch, but add this to .vimrc to trigger aboxd on the current selection with <leader>a:

vnoremap <leader>a :!npx aboxd<CR>

LICENSE

MIT Copyright Daniel Lundin

Readme

Keywords

Package Sidebar

Install

npm i aboxd

Weekly Downloads

2

Version

0.4.0

License

MIT

Unpacked Size

787 kB

Total Files

15

Last publish

Collaborators

  • daniel-lundin