PlantUML is an open-source tool that uses simple textual descriptions to draw UML diagrams. Diagrams are defined using a simple and intuitive language.
lein-plantuml is a Leiningen plugin for generating UML diagrams using PlantUML.
Install Graphviz to use lein-plantuml plugin. PlantUML should be working with any version of GraphViz, starting with 2.26.3
brew install graphviz
sudo apt-get install graphviz
yum list available 'graphviz*'
yum install 'graphviz*'
To enable lein-plantuml for your project, put the following in the :plugins vector of your project.clj file:
To configure PlantUML generator, you need to setup :plantuml option as a list of triplets: "glob pattern" ["file format"] ["output directory"]
Description:
File formats:
Example configuration:
:plantuml [["resources/*.puml" :png "target"]
["presentation/*.txt" "svg"]]
To generate UML image files using configuration from project.clj, you should use:
lein plantuml
To enable this plugin at compile stage, use the following hook:
:hooks [lein-plantuml.plugin]
To run PlantUML generator using command line interface without configuration in project.clj file, you need to use following command:
lein plantuml <source folder> [<file format>] [<output folder>]
By default, generator will use PNG output format and input directory for output files.
To show help for CLI:
lein help plantuml
To test the plugin, you can create a simple file and run lein-plantuml:
@startuml
User -> (Start)
User --> (Use the application) : A small label
:Main Admin: ---> (Use the application) : This is\nyet another\nlabel
@enduml
Output UML diagram should look like this:
Just clone current repository and try to play with example project for better understanding how to use lein-planuml.
More examples could be found here:
To run unit tests:
lein test
PlantUML developers for the really great project and adding lein-planuml on the official site.
Copyright © 2014 Vladislav Bauer
Distributed under the Eclipse Public License, the same as Clojure.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close