Turn comma-separated strings to ascii-charts. Try it live here
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 │
└─────────────┘ └──────────────┘
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 │───────┘
└────────┘
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>
MIT Copyright Daniel Lundin