@@ -69,7 +69,7 @@ defmodule ExDoc.Retriever do
6969
7070 defp sort_modules ( modules , config ) when is_list ( modules ) do
7171 Enum . sort_by ( modules , fn module ->
72- { GroupMatcher . group_index ( config . groups_for_modules , module . group ) , module . nested_context ,
72+ { GroupMatcher . index ( config . groups_for_modules , module . group ) , module . nested_context ,
7373 module . nested_title , module . id }
7474 end )
7575 end
@@ -135,21 +135,14 @@ defmodule ExDoc.Retriever do
135135 { doc_line , doc_file , format , source_doc , doc , metadata } = get_module_docs ( module_data , source )
136136
137137 # TODO: The default function groups must be returned by the language
138- groups_for_docs =
139- config . groups_for_docs ++
140- [
141- Types: & ( & 1 [ :kind ] in [ :type , :opaque , :nominal ] ) ,
142- Callbacks: & ( & 1 [ :kind ] in [ :callback , :macrocallback ] ) ,
143- Functions: fn _ -> true end
144- ]
145-
138+ groups_for_docs = config . groups_for_docs
146139 annotations_for_docs = config . annotations_for_docs
147140
148- docs_groups = Enum . map ( groups_for_docs , & elem ( & 1 , 0 ) ) |> Enum . uniq ( )
149- function_docs = get_docs ( module_data , source , groups_for_docs , annotations_for_docs )
141+ docs_groups =
142+ Enum . uniq ( Enum . map ( groups_for_docs , & elem ( & 1 , 0 ) ) ++ [ :Types , :Callbacks , :Functions ] )
150143
151144 docs =
152- function_docs ++
145+ get_docs ( module_data , source , groups_for_docs , annotations_for_docs ) ++
153146 get_callbacks ( module_data , source , groups_for_docs , annotations_for_docs )
154147
155148 types = get_types ( module_data , source , groups_for_docs , annotations_for_docs )
@@ -259,7 +252,7 @@ defmodule ExDoc.Retriever do
259252 ( source_doc && doc_ast ( content_type , source_doc , file: doc_file , line: doc_line + 1 ) ) ||
260253 function_data . doc_fallback . ( )
261254
262- group = GroupMatcher . match_function ( groups_for_docs , metadata )
255+ group = GroupMatcher . match_doc ( groups_for_docs , metadata ) || :Functions
263256
264257 % ExDoc.FunctionNode {
265258 id: nil_or_name ( name , arity ) ,
@@ -342,11 +335,7 @@ defmodule ExDoc.Retriever do
342335 doc_ast ( content_type , source_doc , file: doc_file , line: doc_line + 1 ) ||
343336 doc_fallback ( callback_data )
344337
345- group =
346- GroupMatcher . match_function (
347- groups_for_docs ,
348- metadata
349- )
338+ group = GroupMatcher . match_doc ( groups_for_docs , metadata ) || :Callbacks
350339
351340 % ExDoc.FunctionNode {
352341 id: "c:" <> nil_or_name ( name , arity ) ,
@@ -403,11 +392,7 @@ defmodule ExDoc.Retriever do
403392 doc_ast ( content_type , source_doc , file: doc_file , line: doc_line + 1 ) ||
404393 doc_fallback ( type_data )
405394
406- group =
407- GroupMatcher . match_function (
408- groups_for_docs ,
409- metadata
410- )
395+ group = GroupMatcher . match_doc ( groups_for_docs , metadata ) || :Types
411396
412397 % ExDoc.TypeNode {
413398 id: "t:" <> nil_or_name ( name , arity ) ,
0 commit comments