improvement: struct type mapping

This commit is contained in:
Zach Daniel 2023-06-07 20:13:08 -04:00
parent 6d6ed9b860
commit 4b8206154a
2 changed files with 5 additions and 0 deletions

View file

@ -436,6 +436,9 @@ defmodule AshHq.Docs.Extensions.RenderMarkdown.PostProcessors.Highlighter do
)
~s(<code class="not-prose makeup #{lang} highlight">#{highlighted}</code>)
rescue
_ ->
~s(<code class="text-black dark:text-white">#{code}</code>)
end
entities = [{"&amp;", ?&}, {"&lt;", ?<}, {"&gt;", ?>}, {"&quot;", ?"}, {"&#39;", ?'}]

View file

@ -542,6 +542,8 @@ defmodule Utils do
defp type(:mfa), do: "MFA"
defp type(:mod_arg), do: "Module and Arguments"
defp type(:map), do: "Map"
defp type(:struct), do: "Struct"
defp type({:struct, struct}), do: "#{inspect(struct)}"
defp type(nil), do: "nil"
defp type({:fun, arity}), do: "Function/#{arity}"
defp type({:one_of, choices}), do: type({:in, choices})