X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fmix%2Ftasks%2Fpleroma%2Fdocs.ex;h=6088fc71d33c8759a17723fcdb13b28e5caeaccd;hb=9c672ecbb5d4477cd16d2139a2cb66d3923ac5c8;hp=5ae3b8716db5098143e9389bdf0e9735c25e7ef5;hpb=511d93fa5486a58b63576ce1b8af551bbafe703f;p=akkoma diff --git a/lib/mix/tasks/pleroma/docs.ex b/lib/mix/tasks/pleroma/docs.ex index 5ae3b8716..6088fc71d 100644 --- a/lib/mix/tasks/pleroma/docs.ex +++ b/lib/mix/tasks/pleroma/docs.ex @@ -8,13 +8,13 @@ defmodule Mix.Tasks.Pleroma.Docs do Supports two formats: `markdown` and `json`. - ## Generate markdown docs + ## Generate Markdown docs `mix pleroma.docs` - ## Generate json docs + ## Generate JSON docs - `mix pleroma.docs json`s + `mix pleroma.docs json` """ def run(["json"]) do @@ -27,14 +27,16 @@ defmodule Mix.Tasks.Pleroma.Docs do defp do_run(implementation) do start_pleroma() - descriptions = Config.Reader.read!("config/description.exs") - {:ok, file_path} = - Pleroma.Docs.Formatter.process( - implementation, - descriptions[:pleroma][:config_description] - ) + with descriptions <- Pleroma.Config.Loader.read("config/description.exs"), + {:ok, file_path} <- + Pleroma.Docs.Generator.process( + implementation, + descriptions[:pleroma][:config_description] + ) do + type = if implementation == Pleroma.Docs.Markdown, do: "Markdown", else: "JSON" - Mix.shell().info([:green, "Markdown docs successfully generated to #{file_path}."]) + Mix.shell().info([:green, "#{type} docs successfully generated to #{file_path}."]) + end end end