Current section
Files
Jump to
Current section
Files
mix.exs
defmodule Inherit.MixProject do
use Mix.Project
@source_url "https://github.com/dockyard/inherit"
@version "0.4.0"
def project do
[
app: :inherit,
version: @version,
elixir: "~> 1.18",
start_permanent: Mix.env() == :prod,
package: package(),
elixirc_paths: elixirc_paths(Mix.env()),
description: description(),
deps: deps(),
docs: docs()
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp docs do
[
extras: extras(),
main: "readme",
source_url: @source_url,
source_ref: @version,
before_closing_body_tag: &before_closing_body_tag/1
]
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(_), do: ""
def description do
"Pseudo-inheritance in Elixir"
end
def package do
%{
maintainers: ["Brian Cardarella"],
licenses: ["MIT"],
links: %{
"GitHub" => @source_url,
"Built by DockYard, Expert Elixir & Phoenix Consultants" => "https://dockyard.com/phoenix-consulting"
}
}
end
defp extras do
["README.md", "LICENSE.md"]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, "~> 0.31", only: :dev, runtime: false}
]
end
end