25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Change formatting of commands markdown documentation

This commit is contained in:
Paweł Chmielowski 2018-02-13 16:27:39 +01:00
parent 9dbdeba6c1
commit 60a8623929

View File

@ -363,10 +363,6 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
args=Args, args_desc=ArgsDesc, args=Args, args_desc=ArgsDesc,
result=Result, result_desc=ResultDesc}=Cmd, HTMLOutput, Langs) -> result=Result, result_desc=ResultDesc}=Cmd, HTMLOutput, Langs) ->
try try
LDesc = case LongDesc of
"" -> Desc;
_ -> LongDesc
end,
ArgsText = case ArgsDesc of ArgsText = case ArgsDesc of
none -> none ->
[?TAG(ul, "args-list", [gen_param(AName, Type, undefined, HTMLOutput) [?TAG(ul, "args-list", [gen_param(AName, Type, undefined, HTMLOutput)
@ -393,11 +389,15 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
end end
end, end,
[?TAG(h1, [?TAG(strong, atom_to_list(Name)), <<" - ">>, ?RAW(Desc)]), [?TAG(h1, atom_to_list(Name)),
?TAG(p, ?RAW(LDesc)), ?TAG(p, ?RAW(Desc)),
?TAG(h2, <<"Arguments:">>), ArgsText, case LongDesc of
?TAG(h2, <<"Result:">>), ResultText, "" -> [];
?TAG(h2, <<"Examples:">>), gen_calls(Cmd, HTMLOutput, Langs)] _ -> ?TAG(p, ?RAW(LongDesc))
end,
?TAG(h2, <<"Arguments:">>), ArgsText,
?TAG(h2, <<"Result:">>), ResultText,
?TAG(h2, <<"Examples:">>), gen_calls(Cmd, HTMLOutput, Langs)]
catch catch
_:Ex -> _:Ex ->
throw(iolist_to_binary(io_lib:format( throw(iolist_to_binary(io_lib:format(