Packages
Toolbox is a convenience library designed to streamline the creation of Altworx scenarios.
Current section
Files
Jump to
Current section
Files
altworx_toolbox
mix.exs
mix.exs
defmodule Toolbox.Mixfile do
use Mix.Project
@version "5.3.3"
def project do
[
app: :toolbox,
version: @version,
description: description(),
package: package(),
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps(),
docs: [
deps: [runbox: "https://hexdocs.pm/altworx_runbox/"],
before_closing_body_tag: &before_closing_body_tag/1,
formatters: ["html"],
extras: ["README.md", "CHANGELOG.md"],
main: "readme",
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
source_url_pattern:
"https://preview.hex.pm/preview/altworx_toolbox/#{@version}/show/%{path}#L%{line}"
],
dialyzer: [
list_unused_filters: true
]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp description do
"""
Toolbox is a convenience library designed to streamline the creation of Altworx scenarios.
"""
end
defp package do
[
name: :altworx_toolbox,
licenses: [
"BSD-3-Clause"
],
links: %{
"Changelog" => "https://hexdocs.pm/altworx_toolbox/changelog.html",
"Altworx Runbox" => "https://hex.pm/packages/altworx_runbox"
}
]
end
defp deps do
[
{:uuid, "~> 1.1"},
{:crontab, "~> 1.1.7"},
{:runbox, "~> 11.0.0", hex: :altworx_runbox},
# development tools
{:credo, "~> 1.6.3", only: [:dev, :test], runtime: false},
{:credo_naming, "~> 2.0.0", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.1.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.34.2", only: :dev, runtime: false},
{:junit_formatter, "~> 3.1", only: [:test]}
]
end
defp before_closing_body_tag(:html) do
"""
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.2.3/dist/mermaid.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({
startOnLoad: false,
theme: document.body.className.includes("dark") ? "dark" : "default"
});
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition).then(({svg, bindFunctions}) => {
graphEl.innerHTML = svg;
bindFunctions?.(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
end
defp before_closing_body_tag(_format), do: ""
end