View Source 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
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}
]
endBut 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
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
Documentation
The docs can be found at https://hexdocs.pm/plantuml.
auto-update-markdown-files
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_linksThis 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
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
Contributing
See our contribution guidelines and our code of conduct