Skip to content

Commit

Permalink
fix: 301 and 404 links
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Mar 15, 2020
1 parent a5afcd2 commit d14b085
Show file tree
Hide file tree
Showing 125 changed files with 210 additions and 204 deletions.
14 changes: 10 additions & 4 deletions docs/scripts/buildApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as babel from '@babel/core';
import traverse from '@babel/traverse';
import { mkdir, readFileSync, writeFileSync } from 'fs';
import { getLineFeed } from './helpers';
import { rewriteUrlForNextExport } from 'next/dist/next-server/lib/router/rewrite-url-for-export';
import path from 'path';
import kebabCase from 'lodash/kebabCase';
import uniqBy from 'lodash/uniqBy';
Expand Down Expand Up @@ -140,16 +141,21 @@ async function annotateComponentDefinition(component, api) {
*
* Demos:
* - ${demos
.map(page => `{@link https://material-ui.com${page.pathname} ${pageToTitle(page)}}`)
.map(
page =>
`{@link https://material-ui.com${rewriteUrlForNextExport(page.pathname)} ${pageToTitle(
page,
)}}`,
)
.join('\n * - ')}
*
* API:
* - {@link https://material-ui.com/api/${api.name} ${api.name} API}
* ${
api.inheritance !== null
? `- inherits {@link https://material-ui.com/api/${api.inheritance.pathname} ${
api.inheritance.component
} API}`
? `- inherits {@link https://material-ui.com${rewriteUrlForNextExport(
api.inheritance.pathname,
)} ${api.inheritance.component} API}`
: ''
}
*/`;
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui-lab/src/Alert/Alert.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ export type AlertClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/alert Alert}
* - {@link https://material-ui.com/components/alert/ Alert}
*
* API:
* - {@link https://material-ui.com/api/Alert Alert API}
* - inherits {@link https://material-ui.com/api//api/paper Paper API}
* - inherits {@link https://material-ui.com/api/paper/ Paper API}
*/
export default function Alert(props: AlertProps): JSX.Element;
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export type AutocompleteClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/autocomplete Autocomplete}
* - {@link https://material-ui.com/components/autocomplete/ Autocomplete}
*
* API:
* - {@link https://material-ui.com/api/Autocomplete Autocomplete API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/AvatarGroup/AvatarGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type AvatarGroupClassKey = 'root' | 'avatar';
*
*
* Demos:
* - {@link https://material-ui.com/components/avatars Avatars}
* - {@link https://material-ui.com/components/avatars/ Avatars}
*
* API:
* - {@link https://material-ui.com/api/AvatarGroup AvatarGroup API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/Pagination/Pagination.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export type PaginationClassKey = 'root' | 'ul';
*
*
* Demos:
* - {@link https://material-ui.com/components/pagination Pagination}
* - {@link https://material-ui.com/components/pagination/ Pagination}
*
* API:
* - {@link https://material-ui.com/api/Pagination Pagination API}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface PaginationItemTypeMap<P = {}, D extends React.ElementType = 'di
*
*
* Demos:
* - {@link https://material-ui.com/components/pagination Pagination}
* - {@link https://material-ui.com/components/pagination/ Pagination}
*
* API:
* - {@link https://material-ui.com/api/PaginationItem PaginationItem API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/Rating/Rating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type RatingClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/rating Rating}
* - {@link https://material-ui.com/components/rating/ Rating}
*
* API:
* - {@link https://material-ui.com/api/Rating Rating API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/Skeleton/Skeleton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface SkeletonTypeMap<P = {}, D extends React.ElementType = 'span'> {
*
*
* Demos:
* - {@link https://material-ui.com/components/skeleton Skeleton}
* - {@link https://material-ui.com/components/skeleton/ Skeleton}
*
* API:
* - {@link https://material-ui.com/api/Skeleton Skeleton API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/SpeedDial/SpeedDial.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export type SpeedDialClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/speed-dial Speed Dial}
* - {@link https://material-ui.com/components/speed-dial/ Speed Dial}
*
* API:
* - {@link https://material-ui.com/api/SpeedDial SpeedDial API}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export type SpeedDialActionClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/speed-dial Speed Dial}
* - {@link https://material-ui.com/components/speed-dial/ Speed Dial}
*
* API:
* - {@link https://material-ui.com/api/SpeedDialAction SpeedDialAction API}
* - inherits {@link https://material-ui.com/api//api/tooltip Tooltip API}
* - inherits {@link https://material-ui.com/api/tooltip/ Tooltip API}
*/
export default function SpeedDialAction(props: SpeedDialActionProps): JSX.Element;
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type SpeedDialIconClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/speed-dial Speed Dial}
* - {@link https://material-ui.com/components/speed-dial/ Speed Dial}
*
* API:
* - {@link https://material-ui.com/api/SpeedDialIcon SpeedDialIcon API}
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui-lab/src/ToggleButton/ToggleButton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export type ToggleButtonTypeMap<
*
*
* Demos:
* - {@link https://material-ui.com/components/toggle-button Toggle Button}
* - {@link https://material-ui.com/components/toggle-button/ Toggle Button}
*
* API:
* - {@link https://material-ui.com/api/ToggleButton ToggleButton API}
* - inherits {@link https://material-ui.com/api//api/button-base ButtonBase API}
* - inherits {@link https://material-ui.com/api/button-base/ ButtonBase API}
*/
declare const ToggleButton: ExtendButtonBase<ToggleButtonTypeMap>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export type ToggleButtonGroupClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/toggle-button Toggle Button}
* - {@link https://material-ui.com/components/toggle-button/ Toggle Button}
*
* API:
* - {@link https://material-ui.com/api/ToggleButtonGroup ToggleButtonGroup API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/TreeItem/TreeItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export type TreeItemClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/tree-view Tree View}
* - {@link https://material-ui.com/components/tree-view/ Tree View}
*
* API:
* - {@link https://material-ui.com/api/TreeItem TreeItem API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/TreeView/TreeView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export type TreeViewClassKey = 'root';
*
*
* Demos:
* - {@link https://material-ui.com/components/tree-view Tree View}
* - {@link https://material-ui.com/components/tree-view/ Tree View}
*
* API:
* - {@link https://material-ui.com/api/TreeView TreeView API}
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/AppBar/AppBar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export type AppBarClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/app-bar App Bar}
* - {@link https://material-ui.com/components/app-bar/ App Bar}
*
* API:
* - {@link https://material-ui.com/api/AppBar AppBar API}
* - inherits {@link https://material-ui.com/api//api/paper Paper API}
* - inherits {@link https://material-ui.com/api/paper/ Paper API}
*/
export default function AppBar(props: AppBarProps): JSX.Element;
2 changes: 1 addition & 1 deletion packages/material-ui/src/Avatar/Avatar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface AvatarTypeMap<P = {}, D extends React.ElementType = 'div'> {
*
*
* Demos:
* - {@link https://material-ui.com/components/avatars Avatars}
* - {@link https://material-ui.com/components/avatars/ Avatars}
*
* API:
* - {@link https://material-ui.com/api/Avatar Avatar API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Backdrop/Backdrop.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type BackdropClassKey = 'root' | 'invisible';
*
*
* Demos:
* - {@link https://material-ui.com/components/backdrop Backdrop}
* - {@link https://material-ui.com/components/backdrop/ Backdrop}
*
* API:
* - {@link https://material-ui.com/api/Backdrop Backdrop API}
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/Badge/Badge.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export type BadgeClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/avatars Avatars}
* - {@link https://material-ui.com/components/badges Badges}
* - {@link https://material-ui.com/components/avatars/ Avatars}
* - {@link https://material-ui.com/components/badges/ Badges}
*
* API:
* - {@link https://material-ui.com/api/Badge Badge API}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type BottomNavigationClassKey = 'root';
*
*
* Demos:
* - {@link https://material-ui.com/components/bottom-navigation Bottom Navigation}
* - {@link https://material-ui.com/components/bottom-navigation/ Bottom Navigation}
*
* API:
* - {@link https://material-ui.com/api/BottomNavigation BottomNavigation API}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export type BottomNavigationActionTypeMap<
*
*
* Demos:
* - {@link https://material-ui.com/components/bottom-navigation Bottom Navigation}
* - {@link https://material-ui.com/components/bottom-navigation/ Bottom Navigation}
*
* API:
* - {@link https://material-ui.com/api/BottomNavigationAction BottomNavigationAction API}
* - inherits {@link https://material-ui.com/api//api/button-base ButtonBase API}
* - inherits {@link https://material-ui.com/api/button-base/ ButtonBase API}
*/
declare const BottomNavigationAction: ExtendButtonBase<
BottomNavigationActionTypeMap<{}, ButtonBaseTypeMap['defaultComponent']>
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Breadcrumbs/Breadcrumbs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface BreadcrumbsTypeMap<P = {}, D extends React.ElementType = 'nav'>
*
*
* Demos:
* - {@link https://material-ui.com/components/breadcrumbs Breadcrumbs}
* - {@link https://material-ui.com/components/breadcrumbs/ Breadcrumbs}
*
* API:
* - {@link https://material-ui.com/api/Breadcrumbs Breadcrumbs API}
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/src/Button/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export type ButtonTypeMap<
*
*
* Demos:
* - {@link https://material-ui.com/components/button-group Button Group}
* - {@link https://material-ui.com/components/buttons Buttons}
* - {@link https://material-ui.com/components/button-group/ Button Group}
* - {@link https://material-ui.com/components/buttons/ Buttons}
*
* API:
* - {@link https://material-ui.com/api/Button Button API}
* - inherits {@link https://material-ui.com/api//api/button-base ButtonBase API}
* - inherits {@link https://material-ui.com/api/button-base/ ButtonBase API}
*/
declare const Button: ExtendButtonBase<ButtonTypeMap>;

Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/ButtonBase/ButtonBase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export type ExtendButtonBase<M extends OverridableTypeMap> = ((
* It contains a load of style reset and some focus/ripple logic.
*
* Demos:
* - {@link https://material-ui.com/components/buttons Buttons}
* - {@link https://material-ui.com/components/buttons/ Buttons}
*
* API:
* - {@link https://material-ui.com/api/ButtonBase ButtonBase API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/ButtonGroup/ButtonGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface ButtonGroupTypeMap<P = {}, D extends React.ElementType = 'div'>
*
*
* Demos:
* - {@link https://material-ui.com/components/button-group Button Group}
* - {@link https://material-ui.com/components/button-group/ Button Group}
*
* API:
* - {@link https://material-ui.com/api/ButtonGroup ButtonGroup API}
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/Card/Card.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export type CardClassKey = 'root';
*
*
* Demos:
* - {@link https://material-ui.com/components/cards Cards}
* - {@link https://material-ui.com/components/cards/ Cards}
*
* API:
* - {@link https://material-ui.com/api/Card Card API}
* - inherits {@link https://material-ui.com/api//api/paper Paper API}
* - inherits {@link https://material-ui.com/api/paper/ Paper API}
*/
declare const Card: React.ComponentType<CardProps>;

Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/CardActionArea/CardActionArea.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export type CardActionAreaTypeMap<P, D extends React.ElementType> = ExtendButton
*
*
* Demos:
* - {@link https://material-ui.com/components/cards Cards}
* - {@link https://material-ui.com/components/cards/ Cards}
*
* API:
* - {@link https://material-ui.com/api/CardActionArea CardActionArea API}
* - inherits {@link https://material-ui.com/api//api/button-base ButtonBase API}
* - inherits {@link https://material-ui.com/api/button-base/ ButtonBase API}
*/
declare const CardActionArea: ExtendButtonBase<
CardActionAreaTypeMap<{}, ButtonBaseTypeMap['defaultComponent']>
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/CardActions/CardActions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type CardActionsClassKey = 'root' | 'spacing';
*
*
* Demos:
* - {@link https://material-ui.com/components/cards Cards}
* - {@link https://material-ui.com/components/cards/ Cards}
*
* API:
* - {@link https://material-ui.com/api/CardActions CardActions API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/CardContent/CardContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type CardContentClassKey = 'root';
*
*
* Demos:
* - {@link https://material-ui.com/components/cards Cards}
* - {@link https://material-ui.com/components/cards/ Cards}
*
* API:
* - {@link https://material-ui.com/api/CardContent CardContent API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/CardHeader/CardHeader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type CardHeaderClassKey = 'root' | 'avatar' | 'action' | 'content' | 'tit
*
*
* Demos:
* - {@link https://material-ui.com/components/cards Cards}
* - {@link https://material-ui.com/components/cards/ Cards}
*
* API:
* - {@link https://material-ui.com/api/CardHeader CardHeader API}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/CardMedia/CardMedia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface CardMediaTypeMap<P, D extends React.ElementType> {
*
*
* Demos:
* - {@link https://material-ui.com/components/cards Cards}
* - {@link https://material-ui.com/components/cards/ Cards}
*
* API:
* - {@link https://material-ui.com/api/CardMedia CardMedia API}
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/src/Checkbox/Checkbox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export type CheckboxClassKey =
*
*
* Demos:
* - {@link https://material-ui.com/components/checkboxes Checkboxes}
* - {@link https://material-ui.com/components/transfer-list Transfer List}
* - {@link https://material-ui.com/components/checkboxes/ Checkboxes}
* - {@link https://material-ui.com/components/transfer-list/ Transfer List}
*
* API:
* - {@link https://material-ui.com/api/Checkbox Checkbox API}
* - inherits {@link https://material-ui.com/api//api/icon-button IconButton API}
* - inherits {@link https://material-ui.com/api/icon-button/ IconButton API}
*/
declare const Checkbox: React.ComponentType<CheckboxProps>;

Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Chip/Chip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> {
* Chips represent complex entities in small blocks, such as a contact.
*
* Demos:
* - {@link https://material-ui.com/components/chips Chips}
* - {@link https://material-ui.com/components/chips/ Chips}
*
* API:
* - {@link https://material-ui.com/api/Chip Chip API}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type CircularProgressClassKey =
* attribute to `true` on that region until it has finished loading.
*
* Demos:
* - {@link https://material-ui.com/components/progress Progress}
* - {@link https://material-ui.com/components/progress/ Progress}
*
* API:
* - {@link https://material-ui.com/api/CircularProgress CircularProgress API}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export interface ClickAwayListenerProps {
* For instance, if you need to hide a menu when people click anywhere else on your page.
*
* Demos:
* - {@link https://material-ui.com/components/click-away-listener Click Away Listener}
* - {@link https://material-ui.com/components/menus Menus}
* - {@link https://material-ui.com/components/click-away-listener/ Click Away Listener}
* - {@link https://material-ui.com/components/menus/ Menus}
*
* API:
* - {@link https://material-ui.com/api/ClickAwayListener ClickAwayListener API}
Expand Down
Loading

0 comments on commit d14b085

Please sign in to comment.