aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_layout.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-04-25 10:42:09 +0200
committerHans Bolinder <[email protected]>2014-04-28 11:56:42 +0200
commiteafe7f889a4ff60d9e3155518bda095740efe143 (patch)
treeb7414677fed503f2db33adbc47b1cb44a8e6f23b /lib/edoc/src/edoc_layout.erl
parent15c6bea32b05ea1eca612c7637fc3df133937059 (diff)
downloadotp-eafe7f889a4ff60d9e3155518bda095740efe143.tar.gz
otp-eafe7f889a4ff60d9e3155518bda095740efe143.tar.bz2
otp-eafe7f889a4ff60d9e3155518bda095740efe143.zip
[edoc] Handle optional behaviour callbacks
Diffstat (limited to 'lib/edoc/src/edoc_layout.erl')
-rw-r--r--lib/edoc/src/edoc_layout.erl25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl
index e164ff060f..87018af25a 100644
--- a/lib/edoc/src/edoc_layout.erl
+++ b/lib/edoc/src/edoc_layout.erl
@@ -701,6 +701,8 @@ deprecated(Es, S) ->
end.
behaviours(Es, Name) ->
+ CBs = get_content(callbacks, Es),
+ OCBs = get_content(optional_callbacks, Es),
(case get_elem(behaviour, Es) of
[] -> [];
Es1 ->
@@ -709,13 +711,24 @@ behaviours(Es, Name) ->
?NL]
end
++
- case get_content(callbacks, Es) of
- [] -> [];
- Es1 ->
+ if CBs =:= [], OCBs =:= [] ->
+ [];
+ true ->
+ Req = if CBs =:= [] ->
+ [];
+ true ->
+ [br, " Required callback functions: "]
+ ++ seq(fun callback/1, CBs, ["."])
+ end,
+ Opt = if OCBs =:= [] ->
+ [];
+ true ->
+ [br, " Optional callback functions: "]
+ ++ seq(fun callback/1, OCBs, ["."])
+ end,
[{p, ([{b, ["This module defines the ", {tt, [Name]},
- " behaviour."]},
- br, " Required callback functions: "]
- ++ seq(fun callback/1, Es1, ["."]))},
+ " behaviour."]}]
+ ++ Req ++ Opt)},
?NL]
end).