projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timeline controller: rate limit timelines to 3 requests per 500ms per timeline per...
[akkoma]
/
lib
/
pleroma
/
docs
/
generator.ex
diff --git
a/lib/pleroma/docs/generator.ex
b/lib/pleroma/docs/generator.ex
index b57e47e8be71148fcfdb84975c83f637194716be..e0fc8cd02144de31766dbb22a204d1e53e7aa5d3 100644
(file)
--- a/
lib/pleroma/docs/generator.ex
+++ b/
lib/pleroma/docs/generator.ex
@@
-13,7
+13,7
@@
defmodule Pleroma.Docs.Generator do
|> Enum.filter(&String.ends_with?(&1, ".ex"))
|> Enum.map(fn filename ->
module = filename |> String.trim_trailing(".ex") |> Macro.camelize()
|> Enum.filter(&String.ends_with?(&1, ".ex"))
|> Enum.map(fn filename ->
module = filename |> String.trim_trailing(".ex") |> Macro.camelize()
- String.to_
existing_
atom(start <> module)
+ String.to_atom(start <> module)
end)
end
end
end)
end
end
@@
-58,15
+58,23
@@
defmodule Pleroma.Docs.Generator do
entity
|> Map.put(:suggestions, format_suggestions(suggestions))
|> format_key()
entity
|> Map.put(:suggestions, format_suggestions(suggestions))
|> format_key()
+ |> format_group()
|> format_children()
end
defp format_child(entity) do
entity
|> format_key()
|> format_children()
end
defp format_child(entity) do
entity
|> format_key()
+ |> format_group()
|> format_children()
end
|> format_children()
end
+ defp format_group(%{group: group} = entity) do
+ Map.put(entity, :group, format_suggestion(group))
+ end
+
+ defp format_group(entity), do: entity
+
defp atom_to_string(entity) when is_binary(entity), do: entity
defp atom_to_string(entity) when is_atom(entity), do: inspect(entity)
defp atom_to_string(entity) when is_binary(entity), do: entity
defp atom_to_string(entity) when is_atom(entity), do: inspect(entity)