From d6c83ab9a5242a48edd82a866735f0271089eda9 Mon Sep 17 00:00:00 2001 From: Nuno Freire Date: Thu, 1 Sep 2022 14:56:12 +0100 Subject: [PATCH] Add @shortdoc for mix helper generation --- lib/mix/tasks/heroicons/generate.ex | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/mix/tasks/heroicons/generate.ex b/lib/mix/tasks/heroicons/generate.ex index 682c15f..91beb1c 100644 --- a/lib/mix/tasks/heroicons/generate.ex +++ b/lib/mix/tasks/heroicons/generate.ex @@ -2,6 +2,8 @@ defmodule Mix.Tasks.Heroicons.Generate do use Mix.Task import Mix.Heroicons.GeneratorHelpers + @shortdoc "Generate heroicons" + @icon_sets [ %{ module: Heroicons.Outline, @@ -42,7 +44,8 @@ defmodule Mix.Tasks.Heroicons.Generate do %{ module: Heroicons.Mini, path: "lib/heroicons/mini.ex", - moduledoc: "Solid style icons drawn with fills, packaged as Phoenix Components.\n\n For smaller elements like buttons, form elements, and to support text,\n designed to be rendered at 20x20.", + moduledoc: + "Solid style icons drawn with fills, packaged as Phoenix Components.\n\n For smaller elements like buttons, form elements, and to support text,\n designed to be rendered at 20x20.", icon_dir: "icons/mini/", # Following https://github.com/tailwindlabs/heroicons/blob/b933d51df1f27c35414389fea185e9bac0097481/svgo.20.solid.yaml svg_opts: [ @@ -59,14 +62,19 @@ defmodule Mix.Tasks.Heroicons.Generate do @impl Mix.Task def run(_args) do - for %{module: module, path: path, moduledoc: moduledoc, icon_dir: icon_dir, svg_opts: svg_opts} <- + for %{ + module: module, + path: path, + moduledoc: moduledoc, + icon_dir: icon_dir, + svg_opts: svg_opts + } <- @icon_sets do icon_paths = Path.absname(icon_dir, :code.priv_dir(:heroicons)) |> Path.join("*.svg") |> Path.wildcard() - Mix.Generator.create_file( path, EEx.eval_file(