1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Mix.Tasks.Pleroma.Docs do
9 @shortdoc "Generates docs from descriptions.exs"
11 Generates docs from `descriptions.exs`.
13 Supports two formats: `markdown` and `json`.
15 ## Generate Markdown docs
21 `mix pleroma.docs json`
25 do_run(Pleroma.Docs.JSON)
29 do_run(Pleroma.Docs.Markdown)
32 defp do_run(implementation) do
35 with descriptions <- Pleroma.Config.Loader.read("config/description.exs"),
37 Pleroma.Docs.Generator.process(
39 descriptions[:pleroma][:config_description]
41 type = if implementation == Pleroma.Docs.Markdown, do: "Markdown", else: "JSON"
43 Mix.shell().info([:green, "#{type} docs successfully generated to #{file_path}."])