pylover / adia Goto Github PK
View Code? Open in Web Editor NEWASCII diagram language & generator for UML sequence diagram.
License: MIT License
ASCII diagram language & generator for UML sequence diagram.
License: MIT License
diagram: Authentication
version: 1.0
author: pylover
sequence: Foo
foo -> bar
sequence: Bar
bar -> baz
DIAGRAM: Authentication
author: pylover
version: 1.0
SEQUENCE: Bar
+-----+ +-----+ +-----+
| foo | | bar | | baz |
+-----+ +-----+ +-----+
| | |
|~~~~~~>| |
| | |
|<------| |
| | |
| |~~~~~~>|
| | |
| |<------|
| | |
+-----+ +-----+ +-----+
| foo | | bar | | baz |
+-----+ +-----+ +-----+
foo -> bar: hello => hi
diagram: Authentication
version: 1.0
author: pylover
sequence: Login
alice -> bob: authenticate(email, password) -> token
bob -> bob: db.ensure()
if: not db.is_connected
bob -> db: connect()
DIAGRAM: Authentication
author: pylover
version: 1.0
SEQUENCE: Login
+-------+ +-----+ +-----+
| alice | | bob | | db |
+-------+ +-----+ +-----+
| | |
|~~~authenticate(email, password)~~~~>| |
| |~~~db.ensure()~~~+ |
| | |
| ****************************
| * if not db.is_connected *
| ****************************
| | |
| |~~~connect()~~~~~~~>|
| | |
| |<-------------------|
| | |
| ****************************
| * end if *
| ****************************
| | | |
| |<----------------+ |
|<--token-----------------------------| |
| | |
+-------+ +-----+ +-----+
| alice | | bob | | db |
+-------+ +-----+ +-----+
diagram: Foo
<space><space>
# First section
Error
Syntax Error: BadSyntax: File "String", Interpreter: Diagram, line 3, col 0
Expected one of `# INDENT NEWLINE EOF NAME`, got: `DEDENT`.
diagram: Foo
sequence: Hello
foo -> bar
bar -> baz
baz -> qux
Output
DIAGRAM: Foo
SEQUENCE: Hello
+-----+ +-----+ +-----+ +-----+
| foo | | bar | | baz | | qux |
+-----+ +-----+ +-----+ +-----+
| | | |
|~~~~~~>| | |
| |~~~~~~>| |
| | | |
| |<------| |
| | | |
| | |~~~~~~>|
| | | |
| | |<------|
|<------| | |
| | | |
+-----+ +-----+ +-----+ +-----+
| foo | | bar | | baz | | qux |
+-----+ +-----+ +-----+ +-----+
aDia.__version__
Docs: https://www.sphinx-doc.org/en/master/usage/extensions/index.html
Similar implementation: https://github.com/mgaitan/sphinxcontrib-mermaid
Initial tokenizer based on CPython
implementation.
| Days off | Reason | Dates off | Days remaining |
|----------+----------------------+------------+----------------|
| 1 | Door installed | 10 January | 27 |
| 0.5 | Garage tidy | 28 January | 26.5 |
| 1 | Bank, garage, Hagino | 8 February | 25.5 |
And issue doctest
before each release.
test pcap main httpd
. . . .
. . . .
START . . .
| . . .
|________________ . .
| . .
fork . .
________________|\___________ .
| | .
test | .
| | .
stop fork .
|________________ |\______________
| | |
kill ------> kill ---------> loop
| | ______________|
wait |/
| join
| ___________|
|/
join
________________|
|
EXIT
adia
stands for ASCII Diagram
.
diagram: Authentication
version: 1.0
author: pylover
sequence: Login
bob -> db: ensure()
if: not db.is_connected
db -> db: connect()
DIAGRAM: Authentication
author: pylover
version: 1.0
SEQUENCE: Login
+-----+ +-----+
| bob | | db |
+-----+ +-----+
| |
|~~~ensure()~~~~~~~~~~~~~~~~~~~~~~>|
| |
| *******
| * if not db.is_connected
| *******
| |
| |~~~connect()~~~+
| | |
| |<--------------+
| |
| *******
| * end if
| *******
| |
|<---------------------------------|
| |
+-----+ +-----+
| bob | | db |
+-----+ +-----+
+---------------+ +------------------+
| struct peer | +------>| enum peer_state |
+---------------+ | +------------------+
| +fd | | | PS_READ |
| state >---+ | PS_WRITE |
| writebuff[] | +------------------+
| writerb |
| *handler | +------------------+
+---------------+ +-->| struct ev_epoll |
| +------------------+
+-----------------+ +---------------+ | | epollfd |
| struct ev | +-->| union ev_priv | | +------------------+
+-----------------+ | +---------------+ |
| id | | | ev_epoll >-------+ +------------------+
| forks | | | ev_select >---------->| struct ev_select |
| children[] | | | ev_mock >-------+ +------------------+
| private_data >--+ +---------------+ | | ? |
+-----------------+ | +----------------- +
| *on_recvd | |
| *on_writefinish | | +------------------+
+-----------------+ +-->| struct ev_mock |
^ ^ +------------------+
| | | ? |
| +--------------+ +------------------+
| |
+---^-----------+ +---^------------+
| struct ev_srv | | struct ev_clnt |
+---------------+ +----------------+
| +struct ev | | +struct ev |
| listenfd | | hostname |
| bind | | port |
+---------------+ +----------------+
| *on_connect | | ? |
+---------------+ +----------------+
Documentation and GH readme.
diagram: Authentication
version: 1.0
author: pylover
sequence: Login
alice.title: Alice
bob.title: Bob
db.title: Database
@alice ~ bob: Alice tries to authenticate herself
alice -> bob: authenticate(email, password) -> token
if: not db.is_connected
bob -> db: connect()
for: each oldtoken in db
bob -> db: delete(oldtoken)
@alice: |
Alice decides to
store the newly
received Token
in a safe place.
alice -> alice: store(token)
DIAGRAM: Authentication
author: pylover
version: 1.0
SEQUENCE: Login
+-------+ +-----+ +-----------+
| Alice | | Bob | | Database |
+-------+ +-----+ +-----------+
| | |
--------------------------------------------------- |
| Alice tries to authenticate herself | |
--------------------------------------------------- |
| | |
|~~~authenticate(email, password)~~~~~~~~~>| |
| | |
| ***********************************
| * if not db.is_connected *
| ***********************************
| | |
| |~~~connect()~~~~~~~~~~~>|
| | |
| |<-----------------------|
| | |
| ***********************************
| * end if *
| ***********************************
| | |
| ***********************************
| * for each oldtoken in db *
| ***********************************
| | |
| |~~~delete(oldtoken)~~~~>|
| | |
| |<-----------------------|
| | |
| ***********************************
| * end for *
| ***********************************
| | |
|<--token----------------------------------| |
| | |
--------------------- | |
| Alice decides to | | |
| store the newly | | |
| received Token | | |
| in a safe place. | | |
--------------------- | |
| | |
|~~~store(token)~~~+ | |
| | | |
|<-----------------+ | |
| | |
+-------+ +-----+ +-----------+
| Alice | | Bob | | Database |
+-------+ +-----+ +-----------+
diagram: ADia Web Wroker
author: Vahid Mardani
sequence:
a.title: adia.js
w.title: adia_worker.py
while: worker is not initialized
a -> a: Wait()
DIAGRAM: ADia Web Wroker
author: Vahid Mardani
+---------+ +-----------------+
| adia.js | | adia_worker.py |
+---------+ +-----------------+
| |
******************************** |
* while worker is not initialized |
******************************** |
| |
|~~~Wait()~~~+ |
| | |
|<-----------+ |
| |
******************************** |
* end while * |
******************************** |
| |
+---------+ +-----------------+
| adia.js | | adia_worker.py |
+---------+ +-----------------+
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.