assets.ex (616B)
1 defmodule ExDoc.Formatter.HTML.Assets do 2 @moduledoc false 3 4 defmacrop embed_pattern(pattern) do 5 ["formatters/html", pattern] 6 |> Path.join() 7 |> Path.wildcard() 8 |> Enum.map(&{Path.basename(&1), File.read!(&1)}) 9 end 10 11 def dist(proglang), do: dist_js() ++ dist_css(proglang) ++ dist_license() 12 13 defp dist_js(), do: embed_pattern("dist/*.js") 14 defp dist_css(:elixir), do: embed_pattern("dist/html-elixir-*.css") 15 defp dist_css(:erlang), do: embed_pattern("dist/html-erlang-*.css") 16 defp dist_license(), do: embed_pattern("dist/*.LICENSE.txt") 17 18 def fonts, do: embed_pattern("dist/*.woff2") 19 end