Skip to content

Commit a4ea93c

Browse files
committed
Rename internal nodes for consistency
1 parent 5a0aa08 commit a4ea93c

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

lib/ex_doc/formatter/html/templates.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ defmodule ExDoc.Formatter.HTML.Templates do
184184
def module_summary(module_node) do
185185
entries =
186186
[Types: module_node.typespecs] ++
187-
function_groups(module_node.function_groups, module_node.docs)
187+
docs_groups(module_node.docs_groups, module_node.docs)
188188

189189
Enum.reject(entries, fn {_type, nodes} -> nodes == [] end)
190190
end
191191

192-
defp function_groups(groups, docs) do
192+
defp docs_groups(groups, docs) do
193193
for group <- groups, do: {group, Enum.filter(docs, &(&1.group == group))}
194194
end
195195

lib/ex_doc/nodes.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule ExDoc.ModuleNode do
1313
doc: nil,
1414
rendered_doc: nil,
1515
doc_line: nil,
16-
function_groups: [],
16+
docs_groups: [],
1717
docs: [],
1818
typespecs: [],
1919
source_path: nil,
@@ -35,7 +35,7 @@ defmodule ExDoc.ModuleNode do
3535
doc: ExDoc.DocAST.t() | nil,
3636
rendered_doc: String.t() | nil,
3737
doc_line: non_neg_integer(),
38-
function_groups: [atom()],
38+
docs_groups: [atom()],
3939
docs: [ExDoc.FunctionNode.t()],
4040
typespecs: [ExDoc.TypeNode.t()],
4141
source_path: String.t(),

lib/ex_doc/retriever.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ defmodule ExDoc.Retriever do
107107
groups_for_functions =
108108
config.groups_for_functions ++ [Callbacks: & &1[:__callback__], Functions: fn _ -> true end]
109109

110-
function_groups = Enum.map(groups_for_functions, &elem(&1, 0))
110+
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)
@@ -125,7 +125,7 @@ defmodule ExDoc.Retriever do
125125
module: module,
126126
type: module_data.type,
127127
deprecated: metadata[:deprecated],
128-
function_groups: function_groups,
128+
docs_groups: docs_groups,
129129
docs: ExDoc.Utils.natural_sort_by(docs, &"#{&1.name}/#{&1.arity}"),
130130
doc: moduledoc,
131131
doc_line: doc_line,

lib/mix/tasks/docs.ex

+8-7
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ defmodule Mix.Tasks.Docs do
215215
216216
A regex or the string name of the module is also supported.
217217
218-
### Grouping functions
218+
### Grouping functions and callbacks
219219
220-
Functions inside a module can also be organized in groups. This is done via
221-
the `:groups_for_functions` configuration which is a keyword list of group
222-
titles and filtering functions that receive the documentation metadata of
223-
functions as argument.
220+
Functions and callbacks inside a module can also be organized in groups.
221+
This is done via the `:groups_for_functions` configuration which is a
222+
keyword list of group titles and filtering functions that receive the
223+
documentation metadata of functions as argument.
224224
225225
For example, imagine that you have an API client library with a large surface
226226
area for all the API endpoints you need to support. It would be helpful to
@@ -247,8 +247,9 @@ defmodule Mix.Tasks.Docs do
247247
]
248248
249249
A function can belong to a single group only. If multiple group filters match,
250-
the first will take precedence. Functions that don't have a custom group will
251-
be listed under the default "Functions" group.
250+
the first will take precedence. Functions and callbacks that don't have a
251+
custom group will be listed under the default "Functions" and "Callbacks"
252+
group respectively.
252253
253254
## Additional JavaScript config
254255

test/ex_doc/retriever/erlang_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ defmodule ExDoc.Retriever.ErlangTest do
3030
deprecated: nil,
3131
doc_line: _,
3232
docs: [function1, function2],
33-
function_groups: [:Callbacks, :Functions],
33+
docs_groups: [:Callbacks, :Functions],
3434
group: nil,
3535
id: "mod",
3636
language: ExDoc.Language.Erlang,

0 commit comments

Comments
 (0)