Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/earizon/2d_txt_diagram_beautify
Beautify TXT ("ASCII") diagrams
https://github.com/earizon/2d_txt_diagram_beautify
diagramming documentation low-code shell
Last synced: 12 days ago
JSON representation
Beautify TXT ("ASCII") diagrams
- Host: GitHub
- URL: https://github.com/earizon/2d_txt_diagram_beautify
- Owner: earizon
- Created: 2024-12-07T18:30:22.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-07T19:24:23.000Z (about 1 month ago)
- Last Synced: 2024-12-28T10:39:02.591Z (12 days ago)
- Topics: diagramming, documentation, low-code, shell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apropos
This Keep it simple and stupid script (KISS) lets you draw 2D diagrams
with your keyboard and then, beautify them with Unicode.Example:
```
ORIGIN TEXT BEAUTIFIED
DIAGRAM OUTPUT DIAGRAM
--------------- ---------------
Example 1:
/----v----\ ┌────┬────┐
| | | │ │ │
}----+----{ ├────┼────┤
| | | │ │ │
\----^----/ └────┴────┘
Example 2:}- level 1.1 ├─ level 1.1
| | │ │
| }- level 2.1 │ ├─ level 2.1
| | │ │
| \- level 2.2 │ └─ level 2.2
| │
\- level 1.2 └─ level 1.2NOTE: github use a CSS line height "too tall".
vertical lines do not look so "beautiful" :(/
It will look much better in your console,
IDE or some other markdown viewer with better
CSS default.
```# Writing Rules:
```
┌─········· ORIGINAL TEXT (easy to type in your keyboard)
· ┌─···· FINAL TEXT (beautified output)
v v
/- ┌─-v- ─┬─
-\ ─┐
}- ├─
-+- ─┼─
-{ ─┤
\- └─
-^- ─┴─
-/ ─┘
```# PRESETUP:
* Copy and place the script into your PATH.
* make it executable For example:```sh
chmod a+x ~/bin/b
```# Daily use:
```sh
$ cat input_2d.txt | b > output_2d.txt
```# TIPs:
- Consider using an editor with column and/or block mode
support to "draw" in 2D.
For example, to enter "block mode" edition in vim just
press: `[esc] ─> Ctrl+v`- Some editors (vim, Visual Code Studio, ....) allow to pass
selected text as input to a command, then the output is
replaced inside the text being edited.
For example, in vim:
1. Select text like:
```
[esc] -> v -> "move around" lines
```
2. Pass selected text to b(eautify) like:
```
:.! b
```