1 defmodule Mix.Tasks.Pleroma.Docs do
5 @shortdoc "Generates docs from descriptions.exs"
7 Generates docs from `descriptions.exs`.
9 Supports two formats: `markdown` and `json`.
11 ## Generate Markdown docs
17 `mix pleroma.docs json`
21 do_run(Pleroma.Docs.JSON)
25 do_run(Pleroma.Docs.Markdown)
28 defp do_run(implementation) do
31 with descriptions <- Pleroma.Config.Loader.load("config/description.exs"),
33 Pleroma.Docs.Generator.process(
35 descriptions[:pleroma][:config_description]
37 type = if implementation == Pleroma.Docs.Markdown, do: "Markdown", else: "JSON"
39 Mix.shell().info([:green, "#{type} docs successfully generated to #{file_path}."])