description formatters
This commit is contained in:
parent
171cefd889
commit
67e4300931
3 changed files with 151 additions and 0 deletions
15
lib/pleroma/docs/json.ex
Normal file
15
lib/pleroma/docs/json.ex
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
defmodule Pleroma.Docs.JSON do
|
||||
@behaviour Pleroma.Docs.Formatter
|
||||
def process(descriptions) do
|
||||
config_path = "docs/generate_config.json"
|
||||
{:ok, file} = File.open(config_path, [:write])
|
||||
json = generate_json(descriptions)
|
||||
IO.write(file, json)
|
||||
:ok = File.close(file)
|
||||
{:ok, config_path}
|
||||
end
|
||||
|
||||
def generate_json(descriptions) do
|
||||
Jason.encode!(descriptions)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue