mirror of
https://github.com/ash-project/ash_hq.git
synced 2024-09-20 05:13:23 +12:00
improvement: proper module linking for AshAuthentication.Phoenix
This commit is contained in:
parent
907373d632
commit
053d5746cb
3 changed files with 22 additions and 5 deletions
|
@ -365,10 +365,27 @@ defmodule AshHq.Docs.Extensions.RenderMarkdown.Highlighter do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp library_for(module, libraries) do
|
@doc false
|
||||||
Enum.find(libraries, fn library ->
|
def library_for(module, libraries) do
|
||||||
Enum.any?(library.module_prefixes, &String.starts_with?(module, &1 <> "."))
|
libraries
|
||||||
|
|> Enum.map(fn library ->
|
||||||
|
{library,
|
||||||
|
Enum.find(library.module_prefixes, fn prefix ->
|
||||||
|
prefix == module || String.starts_with?(module, prefix <> ".")
|
||||||
|
end)}
|
||||||
end)
|
end)
|
||||||
|
|> Enum.filter(fn
|
||||||
|
{_library, nil} ->
|
||||||
|
false
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
true
|
||||||
|
end)
|
||||||
|
|> Enum.sort_by(fn {_library, match} ->
|
||||||
|
-String.length(match)
|
||||||
|
end)
|
||||||
|
|> Enum.at(0)
|
||||||
|
|> elem(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp render_code(lang, lexer, lexer_opts, code) do
|
defp render_code(lang, lexer, lexer_opts, code) do
|
||||||
|
|
2
mix.lock
2
mix.lock
|
@ -3,7 +3,7 @@
|
||||||
"absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"},
|
"absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"},
|
||||||
"ash": {:git, "https://github.com/ash-project/ash.git", "22e07c06b5e0da531e7e6f632009290031429875", []},
|
"ash": {:git, "https://github.com/ash-project/ash.git", "22e07c06b5e0da531e7e6f632009290031429875", []},
|
||||||
"ash_admin": {:git, "https://github.com/ash-project/ash_admin.git", "cdb3b469abeeadddda884e7cfcf67c6fea10f9ef", []},
|
"ash_admin": {:git, "https://github.com/ash-project/ash_admin.git", "cdb3b469abeeadddda884e7cfcf67c6fea10f9ef", []},
|
||||||
"ash_authentication": {:git, "https://github.com/team-alembic/ash_authentication.git", "d4f3bec947b3cef160fa8e6768396884a3ee6149", []},
|
"ash_authentication": {:git, "https://github.com/team-alembic/ash_authentication.git", "00f082cc8dfa0f56d3e2dec3eaf178a58d6d4b4a", []},
|
||||||
"ash_authentication_phoenix": {:git, "https://github.com/team-alembic/ash_authentication_phoenix.git", "14c38739cf56c4821797963b9ee261597a261b00", []},
|
"ash_authentication_phoenix": {:git, "https://github.com/team-alembic/ash_authentication_phoenix.git", "14c38739cf56c4821797963b9ee261597a261b00", []},
|
||||||
"ash_blog": {:git, "https://github.com/ash-project/ash_blog.git", "9254773dfedabfc7987af6326a62885c24c3655b", []},
|
"ash_blog": {:git, "https://github.com/ash-project/ash_blog.git", "9254773dfedabfc7987af6326a62885c24c3655b", []},
|
||||||
"ash_csv": {:git, "https://github.com/ash-project/ash_csv.git", "2a068cea47d13065f23a3686f4c28bf875353ffd", []},
|
"ash_csv": {:git, "https://github.com/ash-project/ash_csv.git", "2a068cea47d13065f23a3686f4c28bf875353ffd", []},
|
||||||
|
|
|
@ -87,7 +87,7 @@ AshHq.Docs.Library.create!(
|
||||||
%{
|
%{
|
||||||
name: "ash_authentication_phoenix",
|
name: "ash_authentication_phoenix",
|
||||||
display_name: "AshAuthenticationPhoenix",
|
display_name: "AshAuthenticationPhoenix",
|
||||||
module_prefixes: ["AshAuthenticationPhoenix"],
|
module_prefixes: ["AshAuthentication.Phoenix"],
|
||||||
order: 56,
|
order: 56,
|
||||||
repo_org: "team-alembic",
|
repo_org: "team-alembic",
|
||||||
description: """
|
description: """
|
||||||
|
|
Loading…
Reference in a new issue