-
Notifications
You must be signed in to change notification settings - Fork 11
/
mix.exs
147 lines (140 loc) · 3.86 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
defmodule MDEx.MixProject do
use Mix.Project
@source_url "https://github.com/leandrocp/mdex"
@version "0.3.0"
@dev? String.ends_with?(@version, "-dev")
@force_build? System.get_env("MDEX_BUILD") in ["1", "true"]
def project do
[
app: :mdex,
version: @version,
elixir: "~> 1.13",
start_permanent: Mix.env() == :prod,
package: package(),
docs: docs(),
deps: deps(),
aliases: aliases(),
name: "MDEx",
homepage_url: "https://github.com/leandrocp/mdex",
description: "A CommonMark-compliant fast and extensible Markdown parser and formatter."
]
end
def application do
[
extra_applications: [:logger]
]
end
defp package do
[
maintainers: ["Leandro Pereira"],
licenses: ["MIT"],
links: %{
Changelog: "https://hexdocs.pm/mdex/changelog.html",
GitHub: @source_url,
comrak: "https://crates.io/crates/comrak",
DockYard: "https://dockyard.com"
},
files: ~w[
lib/mdex.ex
lib/mdex
native/comrak_nif/src
native/comrak_nif/vendor
native/comrak_nif/.cargo
native/comrak_nif/Cargo.*
native/comrak_nif/Cross.toml
examples
mix.exs
benchmark.exs
README.md
LICENSE.md
CHANGELOG.md
checksum-Elixir.MDEx.Native.exs
]
]
end
defp docs do
[
main: "MDEx",
logo: "assets/images/mdex_icon.png",
source_ref: "v#{@version}",
source_url: @source_url,
extras: ["CHANGELOG.md"],
groups_for_modules: [
"Document Nodes": [
MDEx.FrontMatter,
MDEx.BlockQuote,
MDEx.List,
MDEx.ListItem,
MDEx.DescriptionList,
MDEx.DescriptionItem,
MDEx.DescriptionTerm,
MDEx.DescriptionDetails,
MDEx.CodeBlock,
MDEx.HtmlBlock,
MDEx.Paragraph,
MDEx.Heading,
MDEx.ThematicBreak,
MDEx.FootnoteDefinition,
MDEx.FootnoteReference,
MDEx.Table,
MDEx.TableRow,
MDEx.TableCell,
MDEx.Text,
MDEx.TaskItem,
MDEx.SoftBreak,
MDEx.LineBreak,
MDEx.Code,
MDEx.HtmlInline,
MDEx.Emph,
MDEx.Strong,
MDEx.Strikethrough,
MDEx.Superscript,
MDEx.Link,
MDEx.Image,
MDEx.ShortCode,
MDEx.Math,
MDEx.MultilineBlockQuote,
MDEx.Escaped,
MDEx.WikiLink,
MDEx.Underline,
MDEx.Subscript,
MDEx.SpoileredText,
MDEx.EscapedTag
]
],
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
before_closing_head_tag: fn type ->
if type == :html do
"""
<script>
if (location.hostname === "hexdocs.pm") {
var script = document.createElement("script");
script.src = "https://plausible.io/js/script.js";
script.setAttribute("defer", "defer")
script.setAttribute("data-domain", "mdexhexdocs")
document.head.appendChild(script);
}
</script>
"""
end
end
]
end
defp deps do
[
{:rustler, "~> 0.32", optional: not (@dev? or @force_build?)},
{:rustler_precompiled, "~> 0.7"},
{:ex_doc, "~> 0.34", only: :dev}
]
end
defp aliases do
[
"deps.vendorize": ["cmd cp -rv ../autumn/native/autumn native/comrak_nif/vendor"],
"gen.checksum": "rustler_precompiled.download MDEx.Native --all --print",
"gen.samples": "mdex.generate_samples",
"format.all": ["format", "rust.fmt"],
"rust.lint": ["cmd cargo clippy --manifest-path=native/comrak_nif/Cargo.toml -- -Dwarnings"],
"rust.fmt": ["cmd cargo fmt --manifest-path=native/comrak_nif/Cargo.toml --all"]
]
end
end