Current section
Files
Jump to
Current section
Files
mix.exs
defmodule Subaru.MixProject do
use Mix.Project
@version "0.1.0"
def project do
[
app: :subaru,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package(),
docs: docs(),
description: "A graph database built on Mnesia"
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
mod: {Subaru.Application, []},
extra_applications: [:logger, :mnesia, :crypto]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, "~> 0.38", only: :docs}
]
end
defp package do
[
licenses: ["MIT"],
links: %{}
]
end
defp docs do
[
main: "Subaru",
source_ref: "v#{@version}",
source_url: "https://github.com/subaru-db/subaru",
formatters: ["html"],
extras: ["README.md", "LICENSE"],
before_closing_body_tag: &before_closing_body_tag/1
]
end
defp before_closing_body_tag(:html) do
"""
<script defer src="https://cdn.jsdelivr.net/npm/mermaid@10.2.3/dist/mermaid.min.js"></script>
<script>
let initialized = false;
window.addEventListener("exdoc:loaded", () => {
if (!initialized) {
mermaid.initialize({
startOnLoad: false,
theme: document.body.className.includes("dark") ? "dark" : "default"
});
initialized = true;
}
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: ""
end