summaryrefslogtreecommitdiff
path: root/src/ejabberd_commands.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ejabberd_commands.erl')
-rw-r--r--src/ejabberd_commands.erl31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl
index be798c6f..b82c962b 100644
--- a/src/ejabberd_commands.erl
+++ b/src/ejabberd_commands.erl
@@ -230,7 +230,36 @@
init() ->
ets:new(ejabberd_commands, [named_table, set, public,
- {keypos, #ejabberd_commands.name}]).
+ {keypos, #ejabberd_commands.name}]),
+ register_commands([
+ #ejabberd_commands{name = gen_html_doc_for_commands, tags = [documentation],
+ desc = "Generates html documentation for ejabberd_commands",
+ module = ejabberd_commands_doc, function = generate_html_output,
+ args = [{file, binary}, {regexp, binary}, {examples, binary}],
+ result = {res, rescode},
+ args_desc = ["Path to file where generated "
+ "documentation should be stored",
+ "Regexp matching names of commands or modules "
+ "that will be included inside generated document",
+ "Comma separated list of languages (choosen from java, perl, xmlrpc, json)"
+ "that will have example invocation include in markdown document"],
+ result_desc = "0 if command failed, 1 when succedded",
+ args_example = ["/home/me/docs/api.html", "mod_admin", "java,json"],
+ result_example = ok},
+ #ejabberd_commands{name = gen_markdown_doc_for_commands, tags = [documentation],
+ desc = "Generates markdown documentation for ejabberd_commands",
+ module = ejabberd_commands_doc, function = generate_md_output,
+ args = [{file, binary}, {regexp, binary}, {examples, binary}],
+ result = {res, rescode},
+ args_desc = ["Path to file where generated "
+ "documentation should be stored",
+ "Regexp matching names of commands or modules "
+ "that will be included inside generated document",
+ "Comma separated list of languages (choosen from java, perl, xmlrpc, json)"
+ "that will have example invocation include in markdown document"],
+ result_desc = "0 if command failed, 1 when succedded",
+ args_example = ["/home/me/docs/api.html", "mod_admin", "java,json"],
+ result_example = ok}]).
-spec register_commands([ejabberd_commands()]) -> ok.