├── .gitignore
├── text-diagram
├── welcome.htm
├── examples
│ ├── object_declaration.txt
│ ├── tcp_1.txt
│ ├── todd.txt
│ └── tcp_2.txt
├── t.gif
├── favicon.ico
├── contact.htm
├── seq.htm
├── style.css
├── index.htm
└── text-diagram.js
└── README
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 |
--------------------------------------------------------------------------------
/text-diagram/welcome.htm:
--------------------------------------------------------------------------------
1 | Welcome to Text Diagram!
2 |
--------------------------------------------------------------------------------
/text-diagram/examples/object_declaration.txt:
--------------------------------------------------------------------------------
1 | object x
2 | object y
3 | object z
4 | z->x
5 |
--------------------------------------------------------------------------------
/text-diagram/t.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/weidagang/text-diagram/HEAD/text-diagram/t.gif
--------------------------------------------------------------------------------
/text-diagram/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/weidagang/text-diagram/HEAD/text-diagram/favicon.ico
--------------------------------------------------------------------------------
/text-diagram/examples/tcp_1.txt:
--------------------------------------------------------------------------------
1 | note right of Server: Wait for client
2 | Client->Server: SYNC
3 | note right of Server: Received SYNC, send SYNC + ACK
4 |
5 |
--------------------------------------------------------------------------------
/text-diagram/examples/todd.txt:
--------------------------------------------------------------------------------
1 | Todd->April: April, what're you doing?
2 | note right of April: Shopping on taobao.
3 | April->Todd: Well, I'm taobaoing.
4 | Todd->Monad: And you?
5 | Monad->Todd: I'm reading book.
6 | Todd->Monad: Good boy!
--------------------------------------------------------------------------------
/text-diagram/examples/tcp_2.txt:
--------------------------------------------------------------------------------
1 | note left of Server: LISTEN
2 | Client->Server: #1 SYNC
3 | note right of Client: SYNC_SENT
4 | note left of Server: SYNC-RECEIVED
5 | Server->Client: #2 SYNC + ACK
6 | note right of Client: ESTABLISHED
7 | Client->Server: #3 ACK
8 | note left of Server: ESTABLISHED
9 |
--------------------------------------------------------------------------------
/text-diagram/contact.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Text Diagram - About me
5 |
6 |
7 |
8 |
9 |
10 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/text-diagram/seq.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
18 |
19 |
20 |
21 |
22 |
23 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/text-diagram/style.css:
--------------------------------------------------------------------------------
1 | .btn {
2 | color : black;
3 | display: inline-block;
4 | zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
5 | *display: inline;
6 | vertical-align: baseline;
7 | margin: 0 2px;
8 | outline: none;
9 | cursor: pointer;
10 | text-align: center;
11 | text-decoration: none;
12 | font: 14px/100% Arial, Helvetica, sans-serif;
13 | padding: .5em 2em .55em;
14 | text-shadow: 0 1px 1px rgba(0,0,0,.3);
15 | -webkit-border-radius: .5em;
16 | -moz-border-radius: .5em;
17 | border-radius: .5em;
18 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
19 | -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
20 | box-shadow: 0 1px 2px rgba(0,0,0,.2);
21 | }
22 |
23 | .btn:hover {
24 | text-decoration: none;
25 | }
26 |
27 | .btn:active {
28 | position: relative;
29 | top: 1px;
30 | }
31 |
32 | .white {
33 | color: #606060;
34 | border: solid 1px #b7b7b7;
35 | background: #fff;
36 | background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#d1d1d1));
37 | background: -moz-linear-gradient(top, #fff, #d1d1d1);
38 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#d1d1d1');
39 | }
40 |
41 | .white:hover {
42 | background: #d1d1d1;
43 | background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#c1c1c1));
44 | background: -moz-linear-gradient(top, #fff, #c1c1c1);
45 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#c1c1c1');
46 | }
47 |
48 | .white:active {
49 | color: #d1d1d1;
50 | background: -webkit-gradient(linear, left top, left bottom, from(#d1d1d1), to(#fff));
51 | background: -moz-linear-gradient(top, #d1d1d1, #fff);
52 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d1d1d1', endColorstr='#ffffff');
53 | }
54 |
55 | .code_box {
56 | font-family:'Bitstream Vera Sans Mono', 'Consolas', 'Courier New';
57 | line-height:16px;
58 | font-size: 0.8em;
59 |
60 | position:relative;
61 | padding:5px;
62 | border:2px solid #999999;
63 | color:#333;
64 | background:#fff;
65 | /* css3 */
66 | -webkit-border-radius:10px;
67 | -moz-border-radius:10px;
68 | border-radius:10px;
69 | }
70 |
71 | #btn_div {
72 | padding-top: 10px;
73 | padding-bottom: 5px;
74 | }
75 |
76 | #canvas pre {
77 | font-family:'Bitstream Vera Sans Mono', 'Lucida Console', 'Courier New';
78 | font-size: 0.8em;
79 | }
80 |
81 | #title {
82 | font-size: 1.2em;
83 | font-weight: bold;
84 | padding-right: 10px;
85 | }
86 |
87 | #header {
88 | padding-left: 5px;
89 | }
90 |
91 | #header a {
92 | font-size: 0.8em;
93 | }
94 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | TextDiagam is a web tool for drawing UML sequence diagram in pure text.
2 |
3 | http://weidagang.github.com/text-diagram
4 |
5 | Input:
6 |
7 | object April Todd Monad
8 | April->April: Prepare food for lunch.
9 | space 5
10 | note left of April: Lunch is ready.
11 | April->Todd: Todd, what are you doing?
12 | note right of Todd: @_@
13 | Todd->April: Well...\nI'm programming.
14 | space 5
15 | April->Monad: How about you?
16 | Monad->April: I'm reading book.
17 | April->Monad: Good boy!
18 | note right of Monad: ^_^
19 |
20 |
21 | Output:
22 |
23 | +-------+ +-------+ +-------+
24 | | April | | Todd | | Monad |
25 | +-------+ +-------+ +-------+
26 | | | |
27 | | Prepare food for lunch. | |
28 | |------------------------ | |
29 | | | | |
30 | |<----------------------- | |
31 | | | |
32 | | | |
33 | | | |
34 | | | |
35 | | | |
36 | ------------------\ | | |
37 | | Lunch is ready. |-| | |
38 | |-----------------| | | |
39 | | | |
40 | | Todd, what are you doing? | |
41 | |------------------------------>| |
42 | | | ------\ |
43 | | |-| @_@ | |
44 | | | |-----| |
45 | | | |
46 | | Well... | |
47 | | I'm programming. | |
48 | |<------------------------------| |
49 | | | |
50 | | | |
51 | | | |
52 | | | |
53 | | | |
54 | | | |
55 | | How about you? | |
56 | |------------------------------------------>|
57 | | | |
58 | | I'm reading book. |
59 | |<------------------------------------------|
60 | | | |
61 | | Good boy! | |
62 | |------------------------------------------>|
63 | | | | ------\
64 | | | |-| ^_^ |
65 | | | | |-----|
66 | | | |
67 |
--------------------------------------------------------------------------------
/text-diagram/index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Text Diagram
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
21 |
22 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/text-diagram/text-diagram.js:
--------------------------------------------------------------------------------
1 | /*
2 | * text-diagram.js
3 | *
4 | * Copyright 2011, Todd Wei
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | *
7 | * Author: weidagang@gmail.com
8 | */
9 |
10 | /*
11 | * Sequence diagram grammar:
12 | *
13 | * ::= |
14 | * ::=
15 | * ::= | | |
16 | * ::= "object"