Skip to content

Commit 84739af

Browse files
committed
chore(docs): Added simple API documentation with typedoc
1 parent cf54c35 commit 84739af

File tree

7 files changed

+127
-7
lines changed

7 files changed

+127
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ packages/*/*.tsbuildinfo
2222
/packages/documentation/.env*.local
2323

2424
# Copies/generated by dev-utils during builds
25+
/packages/documentation/public/tsdocs
2526
/packages/documentation/src/guides/contributing.md
2627
/packages/documentation/src/utils/toTitle.ts
2728
/packages/documentation/src/readmes

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"styles": "dev-utils styles",
1818
"variables": "dev-utils variables",
1919
"run-indexer": "dev-utils doc-index",
20-
"prebuild-docs": "npm-run-all sandbox sassdoc run-indexer",
20+
"generate-typedoc": "typedoc",
21+
"prebuild-docs": "npm-run-all sandbox sassdoc run-indexer generate-typedoc",
2122
"build-docs": "yarn workspace documentation build",
2223
"build-website": "npm-run-all prebuild-docs build-docs",
2324
"build-dev-utils": "yarn workspace @react-md/dev-utils build",

packages/dev-utils/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"rimraf": "^3.0.2",
4242
"sassdoc": "^2.7.2",
4343
"ts-morph": "^10.0.2",
44+
"typedoc": "^0.20.36",
4445
"typescript": "^4.2.4"
4546
},
4647
"devDependencies": {

packages/documentation/src/constants/navItems.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
BuildSVGIcon,
55
ColorLensSVGIcon,
66
DescriptionSVGIcon,
7+
FunctionsSVGIcon,
78
HomeSVGIcon,
89
InfoOutlineSVGIcon,
910
LibraryBooksSVGIcon,
@@ -146,6 +147,11 @@ const routes: NavItem[] = [
146147
routes: getPackageRoutes(name),
147148
})),
148149
},
150+
{
151+
href: "/tsdocs/index.html",
152+
children: "API (typedoc)",
153+
leftAddon: <FunctionsSVGIcon />,
154+
},
149155
{
150156
href: "/blog",
151157
children: "Blog",
@@ -223,7 +229,7 @@ function createNavItem(
223229

224230
let href: string | undefined = itemId;
225231
let parentId: string | null = null;
226-
if (lastSlashIndex > 0) {
232+
if (lastSlashIndex > 0 && !itemId.endsWith("/index.html")) {
227233
parentId = itemId.slice(0, lastSlashIndex);
228234
}
229235

tsconfig.typedoc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"noEmit": true,
5+
"composite": false
6+
},
7+
"include": ["packages/*/src"],
8+
"exclude": [
9+
"packages/dev-utils/**",
10+
"packages/documentation/**",
11+
"**/__tests__/**",
12+
"**/__mocks__/**"
13+
]
14+
}

typedoc.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"out": "./packages/documentation/public/tsdocs",
3+
"entryPoints": [
4+
"packages/alert/src/index.ts",
5+
"packages/app-bar/src/index.ts",
6+
"packages/autocomplete/src/index.ts",
7+
"packages/avatar/src/index.ts",
8+
"packages/badge/src/index.ts",
9+
"packages/button/src/index.ts",
10+
"packages/card/src/index.ts",
11+
"packages/chip/src/index.ts",
12+
"packages/dialog/src/index.ts",
13+
"packages/divider/src/index.ts",
14+
"packages/expansion-panel/src/index.ts",
15+
"packages/form/src/index.ts",
16+
"packages/icon/src/index.ts",
17+
"packages/layout/src/index.ts",
18+
"packages/link/src/index.ts",
19+
"packages/list/src/index.ts",
20+
"packages/media/src/index.ts",
21+
"packages/menu/src/index.ts",
22+
"packages/overlay/src/index.ts",
23+
"packages/portal/src/index.ts",
24+
"packages/progress/src/index.ts",
25+
"packages/sheet/src/index.ts",
26+
"packages/states/src/index.ts",
27+
"packages/table/src/index.ts",
28+
"packages/tabs/src/index.ts",
29+
"packages/tooltip/src/index.ts",
30+
"packages/transition/src/index.ts",
31+
"packages/tree/src/index.ts",
32+
"packages/typography/src/index.ts",
33+
"packages/utils/src/index.ts"
34+
],
35+
"tsconfig": "./tsconfig.typedoc.json",
36+
"readme": "packages/react-md/README.md",
37+
"listInvalidSymbolLinks": true
38+
}

yarn.lock

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3928,6 +3928,11 @@ colorette@^1.2.1, colorette@^1.2.2:
39283928
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
39293929
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
39303930

3931+
colors@^1.4.0:
3932+
version "1.4.0"
3933+
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
3934+
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
3935+
39313936
columnify@^1.5.4:
39323937
version "1.5.4"
39333938
resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb"
@@ -6887,7 +6892,7 @@ gzip-size@^6.0.0:
68876892
dependencies:
68886893
duplexer "^0.1.2"
68896894

6890-
handlebars@^4.7.6:
6895+
handlebars@^4.7.6, handlebars@^4.7.7:
68916896
version "4.7.7"
68926897
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
68936898
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
@@ -9289,13 +9294,25 @@ lru-cache@^4.0.1, lru-cache@^4.1.1:
92899294
pseudomap "^1.0.2"
92909295
yallist "^2.1.2"
92919296

9297+
lru-cache@^5.1.1:
9298+
version "5.1.1"
9299+
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
9300+
integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==
9301+
dependencies:
9302+
yallist "^3.0.2"
9303+
92929304
lru-cache@^6.0.0:
92939305
version "6.0.0"
92949306
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
92959307
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
92969308
dependencies:
92979309
yallist "^4.0.0"
92989310

9311+
lunr@^2.3.9:
9312+
version "2.3.9"
9313+
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1"
9314+
integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==
9315+
92999316
lz-string@^1.4.4:
93009317
version "1.4.4"
93019318
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26"
@@ -9621,7 +9638,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
96219638
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
96229639
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
96239640

9624-
minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2:
9641+
minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2:
96259642
version "3.0.4"
96269643
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
96279644
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
@@ -10495,6 +10512,13 @@ onetime@^5.1.0, onetime@^5.1.2:
1049510512
dependencies:
1049610513
mimic-fn "^2.1.0"
1049710514

10515+
onigasm@^2.2.5:
10516+
version "2.2.5"
10517+
resolved "https://registry.yarnpkg.com/onigasm/-/onigasm-2.2.5.tgz#cc4d2a79a0fa0b64caec1f4c7ea367585a676892"
10518+
integrity sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==
10519+
dependencies:
10520+
lru-cache "^5.1.1"
10521+
1049810522
open@^6.3.0:
1049910523
version "6.4.0"
1050010524
resolved "https://registry.yarnpkg.com/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9"
@@ -11728,7 +11752,7 @@ progress@^1.1.8:
1172811752
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
1172911753
integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=
1173011754

11731-
progress@^2.0.0:
11755+
progress@^2.0.0, progress@^2.0.3:
1173211756
version "2.0.3"
1173311757
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
1173411758
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
@@ -13077,7 +13101,7 @@ shelljs@^0.6.0:
1307713101
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.6.1.tgz#ec6211bed1920442088fe0f70b2837232ed2c8a8"
1307813102
integrity sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=
1307913103

13080-
shelljs@^0.8.3:
13104+
shelljs@^0.8.3, shelljs@^0.8.4:
1308113105
version "0.8.4"
1308213106
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
1308313107
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
@@ -13091,6 +13115,14 @@ shellwords@^0.1.1:
1309113115
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
1309213116
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
1309313117

13118+
shiki@^0.9.3:
13119+
version "0.9.3"
13120+
resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.9.3.tgz#7bf7bcf3ed50ca525ec89cc09254abce4264d5ca"
13121+
integrity sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==
13122+
dependencies:
13123+
onigasm "^2.2.5"
13124+
vscode-textmate "^5.2.0"
13125+
1309413126
shortid@^2.2.8:
1309513127
version "2.2.15"
1309613128
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122"
@@ -14383,6 +14415,28 @@ typedarray@^0.0.6:
1438314415
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
1438414416
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1438514417

14418+
typedoc-default-themes@^0.12.10:
14419+
version "0.12.10"
14420+
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz#614c4222fe642657f37693ea62cad4dafeddf843"
14421+
integrity sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==
14422+
14423+
typedoc@^0.20.36:
14424+
version "0.20.36"
14425+
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.20.36.tgz#ee5523c32f566ad8283fc732aa8ea322d1a45f6a"
14426+
integrity sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==
14427+
dependencies:
14428+
colors "^1.4.0"
14429+
fs-extra "^9.1.0"
14430+
handlebars "^4.7.7"
14431+
lodash "^4.17.21"
14432+
lunr "^2.3.9"
14433+
marked "^2.0.3"
14434+
minimatch "^3.0.0"
14435+
progress "^2.0.3"
14436+
shelljs "^0.8.4"
14437+
shiki "^0.9.3"
14438+
typedoc-default-themes "^0.12.10"
14439+
1438614440
typescript@^4.2.4:
1438714441
version "4.2.4"
1438814442
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
@@ -14821,6 +14875,11 @@ vm-browserify@1.1.2, vm-browserify@^1.0.1:
1482114875
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
1482214876
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
1482314877

14878+
vscode-textmate@^5.2.0:
14879+
version "5.4.0"
14880+
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.4.0.tgz#4b25ffc1f14ac3a90faf9a388c67a01d24257cd7"
14881+
integrity sha512-c0Q4zYZkcLizeYJ3hNyaVUM2AA8KDhNCA3JvXY8CeZSJuBdAy3bAvSbv46RClC4P3dSO9BdwhnKEx2zOo6vP/w==
14882+
1482414883
w3c-hr-time@^1.0.2:
1482514884
version "1.0.2"
1482614885
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"
@@ -15161,7 +15220,7 @@ yallist@^2.1.2:
1516115220
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
1516215221
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=
1516315222

15164-
yallist@^3.0.0, yallist@^3.0.3:
15223+
yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3:
1516515224
version "3.1.1"
1516615225
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
1516715226
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

0 commit comments

Comments
 (0)