Skip to content

Latest commit

 

History

History
63 lines (36 loc) · 1.17 KB

README.md

File metadata and controls

63 lines (36 loc) · 1.17 KB

pywsd.py

This is a utility script to create UML sequence diagrams using a plain-text notation. That is, this program converts

alice->bob: authentication request
bob-->alice: response

to

example.png

Typical Usage

Simplest:

$ ./pywsd.py example.txt
$ ls
example.png

Something fancy:

$ ./pywsd.py example.txt -s napkin
$ ls
example.png

The sequnce diagram should look like something you drew on a napkin.

Note: ./pywsd.py -h for a list of available styles.

If you want to get rid of the water marking at the bottom, use convert:

$ convert example.png -gravity South -chop 0x14 example.png

With a Makefile (because makefiles rock):

SOURCES = $(wildcard *.txt)
INTER = $(patsubst %.txt, %.png1, $(SOURCES))
PNGS = $(patsubst %.txt, %.png, $(SOURCES))

all: $(PNGS)

%.png1: %.txt
	./pywsd.py $< -o $@

%.png: %.png1
	convert $< -gravity South -chop 0x14 $@

clean:
	rm -f $(INTER)

clean-all:
	rm -f $(PNGS)
	
.PHONY: clean-all

Thanks to WebSequnceDiagrams.com for making such a handy and intuitive tool available for free on the web.