aboutsummaryrefslogtreecommitdiff
path: root/src/mod_caps.erl
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2020-01-08 12:24:51 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2020-01-08 12:24:51 +0300
commit97da380acd8e3ba0c9a9618a99c4106eca1d1576 (patch)
treecc2b8fb7e175afcaf182a3595735f6f9177ec3dc /src/mod_caps.erl
parentUpdate deps (diff)
Generate ejabberd.yml.5 man page from source code directly
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).
Diffstat (limited to 'src/mod_caps.erl')
-rw-r--r--src/mod_caps.erl32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/mod_caps.erl b/src/mod_caps.erl
index 7a41d9ff2..8088c3614 100644
--- a/src/mod_caps.erl
+++ b/src/mod_caps.erl
@@ -49,12 +49,13 @@
handle_cast/2, terminate/2, code_change/3]).
-export([user_send_packet/1, user_receive_packet/1,
- c2s_presence_in/2, mod_opt_type/1, mod_options/1]).
+ c2s_presence_in/2, mod_opt_type/1, mod_options/1, mod_doc/0]).
-include("logger.hrl").
-include("xmpp.hrl").
-include("mod_caps.hrl").
+-include("translate.hrl").
-define(BAD_HASH_LIFETIME, 600).
@@ -563,3 +564,32 @@ mod_options(Host) ->
{cache_size, ejabberd_option:cache_size(Host)},
{cache_missed, ejabberd_option:cache_missed(Host)},
{cache_life_time, ejabberd_option:cache_life_time(Host)}].
+
+mod_doc() ->
+ #{desc =>
+ [?T("This module implements "
+ "https://xmpp.org/extensions/xep-0115.html"
+ "[XEP-0115: Entity Capabilities]."),
+ ?T("The main purpose of the module is to provide "
+ "PEP functionality (see 'mod_pubsub').")],
+ opts =>
+ [{db_type,
+ #{value => "mnesia | sql",
+ desc =>
+ ?T("Same as top-level 'default_db' option, but applied to this module only.")}},
+ {use_cache,
+ #{value => "true | false",
+ desc =>
+ ?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
+ {cache_size,
+ #{value => "pos_integer() | infinity",
+ desc =>
+ ?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
+ {cache_missed,
+ #{value => "true | false",
+ desc =>
+ ?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
+ {cache_life_time,
+ #{value => "timeout()",
+ desc =>
+ ?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}}]}.