1
1
import { heading } from '@plugin/libs/markdown/index.js' ;
2
2
import { MarkdownThemeContext } from '@plugin/theme/index.js' ;
3
+ import {
4
+ isNoneSection ,
5
+ sortNoneSectionFirst ,
6
+ } from '@plugin/theme/lib/index.js' ;
3
7
import {
4
8
ContainerReflection ,
5
9
DeclarationReflection ,
@@ -19,7 +23,7 @@ export function groups(
19
23
return groupTitle ;
20
24
} ;
21
25
22
- model . groups ?. forEach ( ( group ) => {
26
+ model . groups ?. sort ( sortNoneSectionFirst ) . forEach ( ( group ) => {
23
27
if (
24
28
group . title === i18n . kind_plural_module ( ) ||
25
29
group . children . every ( ( child ) => this . router . hasOwnDocument ( child ) )
@@ -31,14 +35,18 @@ export function groups(
31
35
if ( isPackages ) {
32
36
md . push ( heading ( options . headingLevel , i18n . theme_packages ( ) ) ) ;
33
37
} else {
34
- md . push ( heading ( options . headingLevel , group . title ) ) ;
38
+ if ( ! isNoneSection ( group ) ) {
39
+ md . push ( heading ( options . headingLevel , group . title ) ) ;
40
+ }
35
41
}
36
42
if ( group . description ) {
37
43
md . push ( this . helpers . getCommentParts ( group . description ) ) ;
38
44
}
39
45
if ( group . categories ) {
40
- group . categories . forEach ( ( categoryGroup ) => {
41
- md . push ( heading ( options . headingLevel + 1 , categoryGroup . title ) ) ;
46
+ group . categories . sort ( sortNoneSectionFirst ) . forEach ( ( categoryGroup ) => {
47
+ if ( ! isNoneSection ( categoryGroup ) ) {
48
+ md . push ( heading ( options . headingLevel + 1 , categoryGroup . title ) ) ;
49
+ }
42
50
if ( categoryGroup . description ) {
43
51
md . push ( this . helpers . getCommentParts ( categoryGroup . description ) ) ;
44
52
}
@@ -54,13 +62,17 @@ export function groups(
54
62
} else {
55
63
const isEventProps = getGroupTitle ( group . title ) === 'Events' ;
56
64
if ( group . categories ) {
57
- md . push ( heading ( options . headingLevel , getGroupTitle ( group . title ) ) ) ;
65
+ if ( ! isNoneSection ( group ) ) {
66
+ md . push ( heading ( options . headingLevel , getGroupTitle ( group . title ) ) ) ;
67
+ }
58
68
if ( group . description ) {
59
69
md . push ( this . helpers . getCommentParts ( group . description ) ) ;
60
70
}
61
71
md . push (
62
72
this . partials . categories ( group . categories , {
63
- headingLevel : options . headingLevel + 1 ,
73
+ headingLevel : isNoneSection ( group )
74
+ ? options . headingLevel
75
+ : options . headingLevel + 1 ,
64
76
} ) ,
65
77
) ;
66
78
} else {
@@ -72,7 +84,9 @@ export function groups(
72
84
( child ) => child . kind === ReflectionKind . EnumMember ,
73
85
) ;
74
86
75
- md . push ( heading ( options . headingLevel , getGroupTitle ( group . title ) ) ) ;
87
+ if ( ! isNoneSection ( group ) ) {
88
+ md . push ( heading ( options . headingLevel , getGroupTitle ( group . title ) ) ) ;
89
+ }
76
90
77
91
if ( group . description ) {
78
92
md . push ( this . helpers . getCommentParts ( group . description ) ) ;
@@ -100,7 +114,9 @@ export function groups(
100
114
if ( group . children ) {
101
115
md . push (
102
116
this . partials . members ( group . children as DeclarationReflection [ ] , {
103
- headingLevel : options . headingLevel + 1 ,
117
+ headingLevel : isNoneSection ( group )
118
+ ? options . headingLevel
119
+ : options . headingLevel + 1 ,
104
120
groupTitle : group . title ,
105
121
} ) ,
106
122
) ;
0 commit comments