-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
101 lines (93 loc) · 3.04 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
defmodule Bia.MixProject do
use Mix.Project
@source_url "https://github.com/matiascr/bia"
def project do
[
app: :bia,
name: "Bia",
version: "0.1.0",
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
source_url: @source_url,
deps: deps(),
docs: docs(),
package: package()
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:ex_doc, "~> 0.30", only: :dev, runtime: false},
{:nx, ">= 0.6.0"},
{:nimble_options, ">= 0.5.2"},
{:exla, ">= 0.6.0", optional: true},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}
]
end
defp docs do
[
main: "Bia",
source_url: @source_url,
extra_section: "Guides",
extras: [
"README.md",
"notebooks/pso_example.livemd"
],
groups_for_modules: [
Heuristics: [
PSO
]
],
before_closing_body_tag: &before_closing_body_tag/1
]
end
defp package do
[
maintainers: ["Matias Carlander-Reuterfelt"],
description: "Bio inspired algorithms using Elixir",
licenses: ["Apache-2.0"],
links: %{"GitHub" => @source_url}
]
end
defp before_closing_body_tag(:html) do
"""
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-t5CR+zwDAROtph0PXGte6ia8heboACF9R5l/DiY+WZ3P2lxNgvJkQk5n7GPvLMYw" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-FaFLTlohFghEIZkw6VGwmf9ISTubWAVYW8tG8+w2LAIftJEULZABrF9PPFv+tVkH" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-bHBqxz8fokvgoJ/sc17HODNxa42TlaEhB+w8ZJXTc2nZf1VgEaFZeZvT4Mznfz0v" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
]
});
});
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
for (const codeEl of document.querySelectorAll("pre code.vega-lite")) {
try {
const preEl = codeEl.parentElement;
const spec = JSON.parse(codeEl.textContent);
const plotEl = document.createElement("div");
preEl.insertAdjacentElement("afterend", plotEl);
vegaEmbed(plotEl, spec);
preEl.remove();
} catch (error) {
console.log("Failed to render Vega-Lite plot: " + error)
}
}
});
</script>
"""
end
defp before_closing_body_tag(_), do: ""
end