GithubHelp home page GithubHelp logo

jeremyvdw / lein-plantuml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kumarshantanu/lein-plantuml

0.0 2.0 0.0 523 KB

A Leiningen plugin for generating UML diagrams using PlantUML

License: Eclipse Public License 1.0

Clojure 100.00%

lein-plantuml's Introduction

lein-plantuml

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.

Build Status Clojars Project

Pre-requirements

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*'

Installation

To enable lein-plantuml for your project, put the following in the :plugins vector of your project.clj file:

; Use latest version instead of "X.X.X"
:plugins [[lein-plantuml "X.X.X"]]

Configuration

To configure PlantUML generator, you need to setup :plantuml option as a list of triplets: "glob pattern" ["file format"] ["output directory"]

Description:

  • Glob pattern is based on wildcard characters, see Glob for additional information.
  • Files format is an image file format for output data (optional parameter, default value is :png). You could use both variants (keywords and text values) to configure file format.
  • Output directory is an optional parameter, files will be generated in the same directory by default.

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

Example configuration:

  :plantuml [["resources/*.puml" :png "target"]
             ["presentation/*.txt" "svg"]]

Usage

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

Examples

Detailed example

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:

uml-example

Example project

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

Useful links

More examples could be found here:

Unit testing

To run unit tests:

lein test

Thanks to

PlantUML developers for the really great project and adding lein-planuml on the official site.

Might also like

  • lein-asciidoctor - a Leiningen plugin for generating documentation using Asciidoctor.
  • lein-jshint - a Leiningen plugin for running javascript code through JSHint.
  • lein-jslint - a Leiningen plugin for running javascript code through JSLint.
  • lein-coffeescript - a Leiningen plugin for running CoffeeScript compiler.
  • lein-typescript - a Leiningen plugin for running TypeScript compiler.
  • jabberjay - a simple framework for creating Jabber bots.
  • coderwall-clj - a tiny CoderWall client for Clojure.

License

Copyright © 2014 Vladislav Bauer

Distributed under the Eclipse Public License, the same as Clojure.

lein-plantuml's People

Contributors

vbauer avatar

Watchers

 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.