Current section
Files
Jump to
Current section
Files
gnuplot_ex
mix.exs
mix.exs
defmodule GnuplotEx.MixProject do
use Mix.Project
@version "0.5.1"
@source_url "https://gitlab.com/tristanperalta/gnuplot_ex"
def project do
[
app: :gnuplot_ex,
version: @version,
elixir: "~> 1.18",
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
docs: docs(),
package: package(),
description: "Elixir wrapper for Gnuplot 6+ with SVG-first output and ergonomic API",
dialyzer: [
plt_add_apps: [:mix],
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
]
]
end
defp package do
[
licenses: ["MIT"],
links: %{
"GitLab" => @source_url,
"Changelog" => "#{@source_url}/-/blob/main/CHANGELOG.md"
},
files: ~w(lib .formatter.exs mix.exs README.md LICENSE CHANGELOG.md)
]
end
def application do
[
extra_applications: [:logger],
mod: {GnuplotEx.Application, []}
]
end
defp deps do
[
{:phoenix_live_view, "~> 1.0", optional: true},
{:nx, "~> 0.7", optional: true},
{:explorer, "~> 0.8", optional: true},
{:decimal, "~> 2.0 or ~> 3.0", optional: true},
{:ex_doc, "~> 0.35", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:benchee, "~> 1.0", only: :dev, runtime: false}
]
end
defp aliases do
[
docs: ["docs.examples", "docs.preprocess", "docs"],
lint: ["compile --warnings-as-errors", "format --check-formatted", "credo --strict"],
precommit: ["format", "lint", "dialyzer", "cmd MIX_ENV=test mix test"]
]
end
defp docs do
[
main: "readme",
extras: [
"README.md",
"guides/low-level-api.md",
"guides/high-level-api.md",
"guides/liveview.md",
"guides/ecosystem.md",
"guides/benchmarks.md"
],
groups_for_extras: [
Guides: ~r/guides\/.*/
],
assets: %{"guides/examples" => "guides/examples"},
before_closing_body_tag: fn
:html ->
"""
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/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
]
end
end