Skip to content

Commit

Permalink
Generate ejabberd.yml.5 man page from source code directly
Browse files Browse the repository at this point in the history
Several documentation callbacks (doc/0 and mod_doc/0) are implemented
and `ejabberdctl man` command is added to generate a man page. Note
that the command requires a2x to be installed (which is a part of
asciidoc package).
  • Loading branch information
zinid committed Jan 8, 2020
1 parent c40d8fe commit 97da380
Show file tree
Hide file tree
Showing 62 changed files with 4,851 additions and 61 deletions.
6 changes: 5 additions & 1 deletion src/ejabberd_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,11 @@ get_commands_spec() ->
#ejabberd_commands{name = gc, tags = [server],
desc = "Force full garbage collection",
module = ?MODULE, function = gc,
args = [], result = {res, rescode}}
args = [], result = {res, rescode}},
#ejabberd_commands{name = man, tags = [documentation],
desc = "Generate Unix manpage for current ejabberd version",
module = ejabberd_doc, function = man,
args = [], result = {res, restuple}}
].


Expand Down
2 changes: 2 additions & 0 deletions src/ejabberd_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
-export([default_db/2, default_db/3, default_ram_db/2, default_ram_db/3]).
-export([beams/1, validators/1, globals/0, may_hide_data/1]).
-export([dump/0, dump/1, convert_to_yaml/1, convert_to_yaml/2]).
-export([callback_modules/1]).

%% Deprecated functions
-export([get_option/2, set_option/2]).
Expand Down Expand Up @@ -63,6 +64,7 @@
-callback opt_type(atom()) -> econf:validator().
-callback options() -> [atom() | {atom(), term()}].
-callback globals() -> [atom()].
-callback doc() -> any().

-optional_callbacks([globals/0]).

Expand Down
Loading

0 comments on commit 97da380

Please sign in to comment.