(Mirror 1)       (Mirror 2)       (Mirror 3)           

JQuery integration

Imagine that you could directly use PlantUML source code into HTML, something like:
<html>
<img uml="
Bob->Alice : foo
Bob<--Alice : foo
">
</html>
And that will display this:

This would be nice.

Well, using JQuery library, this will works.

You just have to use the following header in your html file:

<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery_plantuml.js"></script>
<!-- rawdeflate.js is implicity used by jquery_plantuml.js -->
</head>

The 3 files jquery.js, jquery_plantuml.js and rawdeflate.js have to be available on your server.

How does it works?

There is nothing magic here: You can see the working example here.
And you can download the complete package here.

Complete source example

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery_plantuml.js"></script>
<!-- rawdeflate.js is implicity used by jquery_plantuml.js -->
</head>

<body>
<p>Example</p>
<hr>
<img uml="
Bob->Alice : foo
Bob<--Alice : foo
">
<hr>
<img uml="
Bob->Alice : dummy
Bob<--Alice : dummy
">

</body>
</html> 

Support This Project Offer 250 Mo! Java profiler Follow PlantUML on Twitter