coenm / PlantUml.Net

a .Net wrapper for PlantUml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PlantUml.Net

Build status

PlantUml.Net is a .Net wrapper for PlantUml

Installation

Add to your project via NuGet.

Usage

var factory = new RendererFactory();

var renderer = factory.CreateRenderer(new PlantUmlSettings());

var bytes = await renderer.Render("Bob -> Alice : Hello", OutputFormat.Png);
File.WriteAllBytes("out.png", bytes);

Rendering Modes

PlantUml.Net can render in 2 modes, Local and Remote.

Remote Rendering (default)

Remote rendering mode uses the PlantUml hosted service to render diagrams.

Docker

You can also spin your own PlantUml server using docker.

docker run -d -p 8080:8080 plantuml/plantuml-server:jetty

Now you can use the remote rendering with http://localhost:8080 as url.

Local Rendering

Local rendering mode uses a local copy of PlantUml to render diagrams.

Requirements

Java

Install Java. Ensure that the JAVA_HOME environment variable is set.

PlantUml

Download PlantUml. By default PlantUml.Net looks for plantuml.jar in the woring directory; you can specify an alternate location in PlantUmlSettings.

GraphViz Dot (optional)

GraphViz Dot is required for Local rendering mode of any diagram other than sequence.

Install GraphViz Dot You may need to set the GRAPHVIZ_DOT environment variable

see the PlantUml documentation for more detailed instructions.

About

a .Net wrapper for PlantUml

License:MIT License


Languages

Language:C# 100.0%