Plantuml
The goal of this project is implement PlantUML tooling for Elixir.
Right now it has:
- Encoding/Decoding of diagrams https://plantuml.com/text-encoding
- Mix task to generate links with embedded diagrams pointing to a PlantUML web server
Installation
The package can be installed by adding plantuml to your list of dependencies in mix.exs:
def deps do
[
{:plantuml, "~> 0.1", only: :dev, runtime: false}
]
endConfiguration
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.
Documentation
The docs can be found at https://hexdocs.pm/plantuml.
Auto update markdown files
Running mix plantuml.generate_markdown_links 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.Tasks.Plantuml.GenerateMarkdownLinks).
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:
<!---->
Result:
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:
Contributing
See our contribution guidelines and our code of conduct