Skip to content

Commit 55d319c

Browse files
committed
chore: simplify doc selection
1 parent 717a630 commit 55d319c

File tree

1 file changed

+18
-48
lines changed

1 file changed

+18
-48
lines changed

mix.exs

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -66,58 +66,11 @@ defmodule AshPostgres.MixProject do
6666
]
6767
end
6868

69-
defp extras() do
70-
"documentation/**/*.{md,livemd,cheatmd}"
71-
|> Path.wildcard()
72-
|> Enum.map(fn path ->
73-
title =
74-
path
75-
|> Path.basename(".md")
76-
|> Path.basename(".livemd")
77-
|> Path.basename(".cheatmd")
78-
|> String.split(~r/[-_]/)
79-
|> Enum.map_join(" ", &capitalize/1)
80-
|> case do
81-
"F A Q" ->
82-
"FAQ"
83-
84-
other ->
85-
other
86-
end
87-
88-
{String.to_atom(path),
89-
[
90-
title: title
91-
]}
92-
end)
93-
end
94-
95-
defp capitalize(string) do
96-
string
97-
|> String.split(" ")
98-
|> Enum.map(fn string ->
99-
[hd | tail] = String.graphemes(string)
100-
String.capitalize(hd) <> Enum.join(tail)
101-
end)
102-
end
103-
104-
defp groups_for_extras() do
105-
[
106-
Tutorials: [
107-
~r'documentation/tutorials'
108-
],
109-
"How To": ~r'documentation/how_to',
110-
Topics: ~r'documentation/topics',
111-
DSLs: ~r'documentation/dsls'
112-
]
113-
end
114-
11569
defp docs do
11670
[
11771
main: "get-started-with-postgres",
11872
source_ref: "v#{@version}",
11973
logo: "logos/small-logo.png",
120-
extras: extras(),
12174
before_closing_head_tag: fn type ->
12275
if type == :html do
12376
"""
@@ -133,7 +86,24 @@ defmodule AshPostgres.MixProject do
13386
"""
13487
end
13588
end,
136-
groups_for_extras: groups_for_extras(),
89+
extras: [
90+
"documentation/tutorials/get-started-with-postgres.md",
91+
"documentation/how_to/join-manual-relationships.md",
92+
"documentation/how_to/test-with-postgres.md",
93+
"documentation/how_to/using-fragments.md",
94+
"documentation/topics/migrations_and_tasks.md",
95+
"documentation/topics/polymorphic_resources.md",
96+
"documentation/topics/postgres-expressions.md",
97+
"documentation/topics/references.md",
98+
"documentation/topics/schema-based-multitenancy.md",
99+
"documentation/dsls/DSL:-AshPostgres.DataLayer.md"
100+
],
101+
groups_for_extras: [
102+
Tutorials: ~r'documentation/tutorials',
103+
"How To": ~r'documentation/how_to',
104+
Topics: ~r'documentation/topics',
105+
DSLs: ~r'documentation/dsls'
106+
],
137107
nest_modules_by_prefix: [
138108
AshPostgres.Functions
139109
],

0 commit comments

Comments
 (0)