Skip to content

Instantly share code, notes, and snippets.

@gregmac
Last active May 4, 2017 21:24
Show Gist options
  • Select an option

  • Save gregmac/fa89a3d86dcb1a008153 to your computer and use it in GitHub Desktop.

Select an option

Save gregmac/fa89a3d86dcb1a008153 to your computer and use it in GitHub Desktop.
Confluence UML Sequence Diagram user macro
## Macro title: UML Sequence Diagram
## Macro has a body: Y
## Body processing: Unrendered
##
## This macro allows use of js-sequence-diagrams from http://bramp.github.io/js-sequence-diagrams/
##
## Developed by: Greg MacLellan
## Date created: 2015-09-15
## Installed by: Greg MacLellan
## @param Theme:title=Theme|type=enum|required=true|enumValues=Hand drawn,Simple
#set( $id = $action.dateFormatter.calendar.timeInMillis)
<div id="diagram$id" class="sequence-diagram" data-sequence-theme="$paramTheme">$body</div>
<script type="text/javascript">
jQuery(function() {
if (typeof sequenceInitalized == "undefined") {
sequenceInitalized = true;
jQuery.getScript("https://cdn.rawgit.com/bramp/js-sequence-diagrams/gh-pages/js/raphael-min.js", function() {
jQuery.getScript("https://cdn.rawgit.com/bramp/js-sequence-diagrams/gh-pages/js/sequence-diagram-min.js", function() {
jQuery(".sequence-diagram").each(function(e) {
var jqe = jQuery(this);
var theme = jqe.attr('data-sequence-theme') == "Simple" ? "simple" : "hand";
jqe.sequenceDiagram({theme: theme});
});
});
});
}
});
</script>
@mathiasrw
Copy link

Love that !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment