-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
83 lines (76 loc) · 2.25 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
defmodule Charms.MixProject do
use Mix.Project
def project do
[
app: :charms,
version: "0.1.4-dev",
elixir: "~> 1.17",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
package: package(),
docs: docs()
]
end
def package do
[
description: "Elixir compiler for native targets",
licenses: ["Apache-2.0", "MIT"],
links: %{"GitHub" => "https://github.com/beaver-lodge/charms"}
]
end
defp elixirc_paths(:test), do: ["lib", "bench", "test/support"]
defp elixirc_paths(:dev), do: ["lib", "bench"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help compile.app" to learn about applications.
def application do
[
mod: {Charms.Application, []},
extra_applications: [:logger, :beaver]
]
end
defp before_closing_head_tag(_) do
"""
<script src="https://cdn.jsdelivr.net/npm/[email protected]/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 docs do
[
before_closing_head_tag: &before_closing_head_tag/1,
main: "Charms",
extras: [
"guides/programming-with-charms.livemd"
]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:beaver, "~> 0.4.1"},
{:benchee, "~> 1.0", only: :dev},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false}
]
end
end