File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -285,9 +285,10 @@ defmodule ExDoc.Retriever do
285
285
defp get_docs_groups ( module_groups , nodes_groups , doc_nodes ) do
286
286
module_groups = Enum . map ( module_groups , & normalize_group / 1 )
287
287
288
- # Doc nodes already have normalized groups
289
288
nodes_groups_descriptions = Map . new ( nodes_groups , & { & 1 . title , & 1 . description } )
290
289
290
+ # Doc nodes already have normalized groups
291
+ nodes_groups = ExDoc.Utils . natural_sort_by ( nodes_groups , & & 1 . title )
291
292
normal_groups = module_groups ++ nodes_groups
292
293
nodes_by_group_title = Enum . group_by ( doc_nodes , & & 1 . group )
293
294
Original file line number Diff line number Diff line change @@ -402,8 +402,8 @@ defmodule Mix.Tasks.Docs do
402
402
* First, groups defined as `@moduledoc groups: [...]` in the given order.
403
403
* Then groups defined as keys in the `:groups_for_docs` configuration.
404
404
* Then default groups: Types, Callbacks and Functions.
405
- * Finally, other groups returned by `:default_group_for_doc` by order of
406
- appearance of their belonging elements .
405
+ * Finally, other groups returned by `:default_group_for_doc` by alphabetical
406
+ order .
407
407
408
408
## Meta-tags configuration
409
409
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ defmodule ExDoc.RetrieverTest do
78
78
79
79
config = % ExDoc.Config { }
80
80
{ [ mod ] , [ ] } = Retriever . docs_from_modules ( [ A ] , config )
81
- [ % { docs: [ bar ] } , % { docs: [ baz ] } , % { docs: [ foo ] } ] = mod . docs_groups
81
+ [ % { docs: [ foo ] } , % { docs: [ bar ] } , % { docs: [ baz ] } ] = mod . docs_groups
82
82
83
83
assert % { id: "c:foo/0" , group: "a" } = foo
84
84
assert % { id: "bar/0" , group: "b" } = bar
@@ -101,7 +101,7 @@ defmodule ExDoc.RetrieverTest do
101
101
102
102
config = % ExDoc.Config { group_for_doc: & & 1 [ :semi_group ] }
103
103
{ [ mod ] , [ ] } = Retriever . docs_from_modules ( [ A ] , config )
104
- [ % { docs: [ bar ] } , % { docs: [ baz ] } , % { docs: [ foo ] } ] = mod . docs_groups
104
+ [ % { docs: [ foo ] } , % { docs: [ bar ] } , % { docs: [ baz ] } ] = mod . docs_groups
105
105
106
106
assert % { id: "c:foo/0" , group: "a" } = foo
107
107
assert % { id: "bar/0" , group: "b" } = bar
You can’t perform that action at this time.
0 commit comments