GithubHelp home page GithubHelp logo

plantuml-clj's Introduction

plantuml-clj

tests

PlantUML is an open-source tool that uses simple textual descriptions to draw UML diagrams. Diagrams are defined using a simple and intuitive language.

plantuml-clj is a plugin for generating UML diagrams using PlantUML.

Pre-requirements

Install Graphviz to use plantuml-clj 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*'

Installation

To enable plantuml-clj for your project, create an alias for plantuml-clj (i.e: :plantuml), then put the following in the :extra-deps alias of your deps.edn file:

{:aliases {:plantuml {:extra-deps {plantuml-clj/plantuml-clj {:mvn/version "RELEASES"}}
                      :exec-fn plantuml-clj.core/plantuml
                      :exec-args {:input-dir "XXX"
                                  :fmt :format
                                  :output-dir "ZZZ"}}}}

then configure the keys :input-dir, :fmt and :output-dir of your :exec-args

Configuration

File formats:

  • :png - Portable Network Graphics format
  • :svg - Scalable Vector Graphics format
  • :txt, :utxt - Text file format
  • :eps, :eps:txt - Encapsulated PostScript format
  • :pdf - Portable Document Format ; NOTE: broken

Example configuration:

  {:aliases {:plantuml {:extra-deps {plantuml-clj/plantuml-clj {:mvn/version "1.0"}}
                        :exec-fn plantuml-clj.core/plantuml
                        :exec-args {:input-dir "resources/*.puml"
                                    :fmt :png
                                    :output-dir "target"}}}}

Usage

To generate UML image files using configuration from deps.edn, you should use:

clj -X:plantuml :input-dir "doc/*.puml" :fmt :png :output-dir "target/doc"

Examples

Detailed example

To test the plugin, you can create a simple file and run plantuml-clj:

@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:

uml-example

Example project

Just clone current repository and try to play with example project for better understanding how to use plantuml-clj.

Useful links

More examples could be found here:

Unit testing

To run unit tests:

clj -X:test

Adapted from

lein-plantuml is an awsome Leiningen plugin for generating UML diagrams using PlantUML.

plantuml-clj's People

Contributors

jeremyvdw avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.