Skip to content

Augists/dot2ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dot2ascii

小脚本用来将 dot 文件转换成 ascii 输出,替换 graph-easy 工具(且 Graphviz 的 ascii 输出格式想要做到支持较为繁琐)

参考并使用了 dot-to-ascii 提供的脚本和 api,并可以将交叉编译后的可执行程序添加进环境变量里

Run

cp bin/dot2ascii-your-os /path/to/env
dot2ascii [--fancy] [--show] <dot文件路径>
  --fancy       可选,是否使用 boxart 字符(默认 false)
  --show        可选,是否打印读取的文件内容(默认 false)
  <dot文件路径> 必填,dot文件路径

Example

$ ./dot2ascii-darwin example/example.dot
+-----------+
|    Foo    |
+-----------+
  |
  |
  v
+-----------+
|     b     | -+
+-----------+  |
  |            |
  |            |
  v            |
+-----------+  |
|     c     |  |
+-----------+  |
  :            |
  : edgename   |
  v            |
+-----------+  |
|     d     | -+
+-----------+
$ dot2ascii --fancy example/example2.dot

                 ┌─────────┐
                 │         │
     ┌───┐     ┌───┐     ┌───┐     ┌───┐
  ┌─ │ 0 │ ─── │ 1 │ ─── │   │ ─── │ 3 │
  │  └───┘     └───┘     │   │     └───┘
  │    │                 │   │
  │    └──────────────── │ 2 │
  │                      │   │
  │                      │   │
  └───────────────────── │   │
                         └───┘