Skip to content

Commit a9284d5

Browse files
committed
Consistenly use __doc__ for metadata
1 parent a4ea93c commit a9284d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/ex_doc/config.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ defmodule ExDoc.Config do
133133
end
134134

135135
defp deprecated?(metadata), do: metadata[:deprecated] != nil
136-
defp exception?(metadata), do: metadata[:__type__] == :exception
136+
defp exception?(metadata), do: metadata[:__doc__] == :exception
137137

138138
defp normalize_nest_modules_by_prefix(nest_modules_by_prefix) do
139139
nest_modules_by_prefix

lib/ex_doc/retriever.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ defmodule ExDoc.Retriever do
105105

106106
# TODO: The default function groups must be returned by the language
107107
groups_for_functions =
108-
config.groups_for_functions ++ [Callbacks: & &1[:__callback__], Functions: fn _ -> true end]
108+
config.groups_for_functions ++ [Callbacks: & &1[:__doc__] == :callback, Functions: fn _ -> true end]
109109

110110
docs_groups = Enum.map(groups_for_functions, &elem(&1, 0))
111111
function_docs = get_docs(module_data, source, groups_for_functions)
112112
docs = function_docs ++ get_callbacks(module_data, source, groups_for_functions)
113113
types = get_types(module_data, source)
114114

115-
metadata = Map.put(metadata, :__type__, module_data.type)
115+
metadata = Map.put(metadata, :__doc__, module_data.type)
116116
group = GroupMatcher.match_module(config.groups_for_modules, module, module_data.id, metadata)
117117
{nested_title, nested_context} = module_data.nesting_info || {nil, nil}
118118

@@ -247,7 +247,7 @@ defmodule ExDoc.Retriever do
247247
annotations = callback_data.extra_annotations ++ annotations_from_metadata(metadata)
248248
doc_ast = doc_ast(content_type, doc, file: source.path, line: doc_line + 1)
249249

250-
metadata = Map.put(metadata, :__callback__, true)
250+
metadata = Map.put(metadata, :__doc__, :callback)
251251
group = GroupMatcher.match_function(groups_for_functions, metadata)
252252

253253
%ExDoc.FunctionNode{

0 commit comments

Comments
 (0)