Reputation: 228
How can I generate a UML sequence diagram from a file containing a textual representation of my process, with command-line tools in Linux?
Upvotes: 14
Views: 16054
Reputation: 403
Although PlantUML is listed in the accepted answer (among many other tools) it merits more attention.
In addition to being easily wrapped into a command line tool, PlantUML also has
However PlantUML comes as a java archive so the following setup may be required:
java and graphviz are available as packages for the major linux distros. PlantUML itself is available for Fedora and Ubuntu.
If your distribution does not provide a package, download a jar file from the main site and wrap as a bash script.
A bash wrapper (as follows) can be stored in a file named plantuml on your path i.e. one of the directories listed by echo $PATH
. Don't forget to make it executable with chmod u+x plantuml
.
#!/bin/bash
# from the vim syntax plugin README at aklt/plantuml-syntax on github
java -jar $HOME/path/to/plantuml.jar -tsvg $@
Then run plantuml apple.uml berry.uml
and plantuml will create apple.svg berry.svg.
Upvotes: 17
Reputation: 8208
There are many (many=more than 10) tools for this.
See a complete list.
Upvotes: 6
Reputation: 24617
Use a script to replace:
|
References
Upvotes: -1
Reputation: 4861
Put the following source into .html file and open it in a browser:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function () {
$('textarea').each(function () {
$(this).hide();
var source = $(this).html();
$('body').append('<img src="http://yuml.me/diagram/scruffy/class/'
+ source + '" />');
});
});
</script>
</head>
<body>
<textarea>
[note: You can stick notes on diagrams too!{bg:cornsilk}],
[Customer]<>1-orders 0..*>[Order],
[Order]++*-*>[LineItem],
[Order]-1>[DeliveryMethod],
[Order]*-*>[Product],
[Category]<->[Product],
[DeliveryMethod]^[National],
[DeliveryMethod]^[International]
</textarea>
</body>
</html>
You should be able to see the sample diagram corresponding to the source within the textarea tag. Correct the source according to the yuml samples to draw your own diagram.
Upvotes: 2