Skip to content

ceolinrenato/plantuml

Repository files navigation

Plantuml

The goal of this project is implement PlantUML tooling for Elixir.

Right now it has:

Installation

The package can be installed by adding plantuml to your list of dependencies in mix.exs, you don't need to include it on runtime if you're just using the mix task.

def deps do
  [
    {:plantuml, "~> 0.1", only: :dev, runtime: false}
  ]
end

But if you need to Encode/Decode diagrams on application runtime you can add the following to your deps:

def deps do
  [
    {:plantuml, "~> 0.1"}
  ]
end

Configuration

You can host your own instance of PlantUML server https://plantuml.com/server.

There's also a Docker image available on: https://hub.docker.com/r/plantuml/plantuml-server/.

config :plantuml, plantuml_server_url: "https://your-hosted-plantuml-server.com"

The default server url used is https://plantuml.com/plantuml.

You can also use Kroki.io public server, this one supports SSL

config :plantuml, plantuml_server_url: "https://kroki.io/plantuml"

Documentation

The docs can be found at https://hexdocs.pm/plantuml.

Auto update markdown files

Running the Mix.Tasks.Plantuml.GenerateMarkdownLinks mix task on the project will search for all markdown files and look for markdown comments with links referencing to a PlantUML file in the project.

mix plantuml.generate_markdown_links

This feature was inspired by https://github.com/danielyaa5/puml-for-markdown, a CLI tool built with JavaScript.

The diagrams are rendered by passing an encoded diagram to a PlantUML Web Service.

Example

You can add an embedded diagram by adding a comment to your markdown file like this:

<!--![Diagram Image Link](./priv/test_assets/example_diagram.plantuml)-->

Result:

Diagram Image Link

You can also render a link to a diagram, by doing the same thing but without prepending the !

<!--[Link to Diagram](./priv/test_assets/example_diagram.plantuml)-->

Result:

Link to Diagram

Contributing

See our contribution guidelines and our code of conduct

Changelog

Changelog

About

PlantUML tooling for Elixir

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages