File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/documentation/src/constants Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,17 @@ import ReactSVGIcon from "icons/ReactSVGIcon";
1515import createIdGenerator from "utils/createIdGenerator" ;
1616import { toTitle } from "utils/toTitle" ;
1717
18- import { PACKAGE_NAMES , SCSS_PACKAGES } from "./packages" ;
18+ import { PACKAGE_NAMES , SCSS_PACKAGES , TYPESCRIPT_PACKAGES } from "./packages" ;
1919import {
2020 RouteNavItem ,
2121 NavItem ,
2222 DividerNavItem ,
2323 SubheaderNavItem ,
2424} from "./meta/types" ;
25+ import { snakeCase } from "lodash" ;
2526
2627const uuid = createIdGenerator ( "nav" ) ;
28+ const TSDOCS_PREFIX = "/tsdocs/modules/_react_md_" ;
2729
2830const getPackageRoutes = ( name : string ) : RouteNavItem [ ] => {
2931 const routes : RouteNavItem [ ] = [ ] ;
@@ -52,6 +54,13 @@ const getPackageRoutes = (name: string): RouteNavItem[] => {
5254 children : "Installation" ,
5355 } ) ;
5456
57+ if ( name !== "material-icons" && TYPESCRIPT_PACKAGES . includes ( name ) ) {
58+ routes . push ( {
59+ href : `${ TSDOCS_PREFIX } ${ snakeCase ( name ) } .html` ,
60+ children : "API (typedoc)" ,
61+ } ) ;
62+ }
63+
5564 if ( SCSS_PACKAGES . includes ( name ) ) {
5665 routes . push ( {
5766 href : "/sassdoc" ,
@@ -226,7 +235,7 @@ function createNavItem(
226235 return tree ;
227236 }
228237
229- if ( ! navItem . href . startsWith ( "/" ) ) {
238+ if ( ! navItem . href . startsWith ( "/" ) || navItem . href . startsWith ( TSDOCS_PREFIX ) ) {
230239 const itemId = navItem . href ;
231240 tree [ itemId ] = {
232241 ...navItem ,
You can’t perform that action at this time.
0 commit comments