Skip to content

Commit 6a73273

Browse files
devversionvivian-hu-zz
authored andcommitted
build(docs): show exported constants in docs (#13168)
* Currently constants which are exported, will not show up in the docs. This introduces support for displaying `constants` in the docs. * Also creates a Nunjucks plugin that supports highlighting specific code snippets. This is helpful when rendering a type in the docs (similar to angular/aio) * Marks most animation constants as `@docs-private` because those shouldn't be relevant to users.
1 parent afb0352 commit 6a73273

20 files changed

+147
-10
lines changed

src/cdk/overlay/overlay-module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class OverlayModule {}
3636
/**
3737
* @deprecated Use `OverlayModule` instead.
3838
* @breaking-change 7.0.0
39+
* @docs-private
3940
*/
4041
export const OVERLAY_PROVIDERS: Provider[] = [
4142
Overlay,

src/lib/datepicker/datepicker-animations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import {
1414
AnimationTriggerMetadata,
1515
} from '@angular/animations';
1616

17-
/** Animations used by the Material datepicker. */
17+
/**
18+
* Animations used by the Material datepicker.
19+
* @docs-private
20+
*/
1821
export const matDatepickerAnimations: {
1922
readonly transformPanel: AnimationTriggerMetadata;
2023
readonly fadeInCalendar: AnimationTriggerMetadata;

src/lib/dialog/dialog-animations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ const animationBody = [
2626
animate('75ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({opacity: 0}))),
2727
];
2828

29-
/** Animations used by MatDialog. */
29+
/**
30+
* Animations used by MatDialog.
31+
* @docs-private
32+
*/
3033
export const matDialogAnimations: {
3134
readonly dialogContainer: AnimationTriggerMetadata;
3235
readonly slideDialog: AnimationTriggerMetadata;

src/lib/expansion/expansion-animations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
3434
* `collapsed` this acts a noop since no style values change.
3535
*
3636
* In the case where angular's animation state is out of sync with the expansion panel's state, the
37-
* expansion panel being `expanded` and angular animations being`void`, the animation from the
37+
* expansion panel being `expanded` and angular animations being `void`, the animation from the
3838
* `expanded`'s effective styles (though in a `void` animation state) to the collapsed state will
3939
* occur as expected.
4040
*
4141
* Angular Bug: https://github.com/angular/angular/issues/18847
42+
*
43+
* @docs-private
4244
*/
4345
export const matExpansionAnimations: {
4446
readonly indicatorRotate: AnimationTriggerMetadata;

src/lib/form-field/form-field-animations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import {
1414
AnimationTriggerMetadata,
1515
} from '@angular/animations';
1616

17-
/** Animations used by the MatFormField. */
17+
/**
18+
* Animations used by the MatFormField.
19+
* @docs-private
20+
*/
1821
export const matFormFieldAnimations: {
1922
readonly transitionMessages: AnimationTriggerMetadata
2023
} = {

src/lib/menu/menu-animations.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import{
2121
* Animations used by the mat-menu component.
2222
* Animation duration and timing values are based on:
2323
* https://material.io/guidelines/components/menus.html#menus-usage
24+
* @docs-private
2425
*/
2526
export const matMenuAnimations: {
2627
readonly transformMenu: AnimationTriggerMetadata;
@@ -65,11 +66,13 @@ export const matMenuAnimations: {
6566
/**
6667
* @deprecated
6768
* @breaking-change 7.0.0
69+
* @docs-private
6870
*/
6971
export const fadeInItems = matMenuAnimations.fadeInItems;
7072

7173
/**
7274
* @deprecated
7375
* @breaking-change 7.0.0
76+
* @docs-private
7477
*/
7578
export const transformMenu = matMenuAnimations.transformMenu;

src/lib/select/select-animations.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
* const containing the metadata for one animation.
2121
*
2222
* The values below match the implementation of the AngularJS Material mat-select animation.
23+
* @docs-private
2324
*/
2425
export const matSelectAnimations: {
2526
readonly transformPanel: AnimationTriggerMetadata;
@@ -74,11 +75,13 @@ export const matSelectAnimations: {
7475
/**
7576
* @deprecated
7677
* @breaking-change 7.0.0
78+
* @docs-private
7779
*/
7880
export const transformPanel = matSelectAnimations.transformPanel;
7981

8082
/**
8183
* @deprecated
8284
* @breaking-change 7.0.0
85+
* @docs-private
8386
*/
8487
export const fadeInContent = matSelectAnimations.fadeInContent;

src/lib/sidenav/drawer-animations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import {
1414
AnimationTriggerMetadata,
1515
} from '@angular/animations';
1616

17-
/** Animations used by the Material drawers. */
17+
/**
18+
* Animations used by the Material drawers.
19+
* @docs-private
20+
*/
1821
export const matDrawerAnimations: {
1922
readonly transformDrawer: AnimationTriggerMetadata;
2023
} = {

src/lib/snack-bar/snack-bar-animations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import {
1414
AnimationTriggerMetadata,
1515
} from '@angular/animations';
1616

17-
/** Animations used by the Material snack bar. */
17+
/**
18+
* Animations used by the Material snack bar.
19+
* @docs-private
20+
*/
1821
export const matSnackBarAnimations: {
1922
readonly snackBarState: AnimationTriggerMetadata;
2023
} = {

src/lib/sort/sort-animations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ import {AnimationCurves, AnimationDurations} from '@angular/material/core';
1919
const SORT_ANIMATION_TRANSITION = AnimationDurations.ENTERING + ' ' +
2020
AnimationCurves.STANDARD_CURVE;
2121

22-
/** Animations used by MatSort. */
22+
/**
23+
* Animations used by MatSort.
24+
* @docs-private
25+
*/
2326
export const matSortAnimations: {
2427
readonly indicator: AnimationTriggerMetadata;
2528
readonly leftPointer: AnimationTriggerMetadata;

0 commit comments

Comments
 (0)