Skip to content

Commit

Permalink
chore(docs): Added simple API documentation with typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed May 11, 2021
1 parent cf54c35 commit 84739af
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ packages/*/*.tsbuildinfo
/packages/documentation/.env*.local

# Copies/generated by dev-utils during builds
/packages/documentation/public/tsdocs
/packages/documentation/src/guides/contributing.md
/packages/documentation/src/utils/toTitle.ts
/packages/documentation/src/readmes
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"styles": "dev-utils styles",
"variables": "dev-utils variables",
"run-indexer": "dev-utils doc-index",
"prebuild-docs": "npm-run-all sandbox sassdoc run-indexer",
"generate-typedoc": "typedoc",
"prebuild-docs": "npm-run-all sandbox sassdoc run-indexer generate-typedoc",
"build-docs": "yarn workspace documentation build",
"build-website": "npm-run-all prebuild-docs build-docs",
"build-dev-utils": "yarn workspace @react-md/dev-utils build",
Expand Down
1 change: 1 addition & 0 deletions packages/dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"rimraf": "^3.0.2",
"sassdoc": "^2.7.2",
"ts-morph": "^10.0.2",
"typedoc": "^0.20.36",
"typescript": "^4.2.4"
},
"devDependencies": {
Expand Down
8 changes: 7 additions & 1 deletion packages/documentation/src/constants/navItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
BuildSVGIcon,
ColorLensSVGIcon,
DescriptionSVGIcon,
FunctionsSVGIcon,
HomeSVGIcon,
InfoOutlineSVGIcon,
LibraryBooksSVGIcon,
Expand Down Expand Up @@ -146,6 +147,11 @@ const routes: NavItem[] = [
routes: getPackageRoutes(name),
})),
},
{
href: "/tsdocs/index.html",
children: "API (typedoc)",
leftAddon: <FunctionsSVGIcon />,
},
{
href: "/blog",
children: "Blog",
Expand Down Expand Up @@ -223,7 +229,7 @@ function createNavItem(

let href: string | undefined = itemId;
let parentId: string | null = null;
if (lastSlashIndex > 0) {
if (lastSlashIndex > 0 && !itemId.endsWith("/index.html")) {
parentId = itemId.slice(0, lastSlashIndex);
}

Expand Down
14 changes: 14 additions & 0 deletions tsconfig.typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"noEmit": true,
"composite": false
},
"include": ["packages/*/src"],
"exclude": [
"packages/dev-utils/**",
"packages/documentation/**",
"**/__tests__/**",
"**/__mocks__/**"
]
}
38 changes: 38 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"out": "./packages/documentation/public/tsdocs",
"entryPoints": [
"packages/alert/src/index.ts",
"packages/app-bar/src/index.ts",
"packages/autocomplete/src/index.ts",
"packages/avatar/src/index.ts",
"packages/badge/src/index.ts",
"packages/button/src/index.ts",
"packages/card/src/index.ts",
"packages/chip/src/index.ts",
"packages/dialog/src/index.ts",
"packages/divider/src/index.ts",
"packages/expansion-panel/src/index.ts",
"packages/form/src/index.ts",
"packages/icon/src/index.ts",
"packages/layout/src/index.ts",
"packages/link/src/index.ts",
"packages/list/src/index.ts",
"packages/media/src/index.ts",
"packages/menu/src/index.ts",
"packages/overlay/src/index.ts",
"packages/portal/src/index.ts",
"packages/progress/src/index.ts",
"packages/sheet/src/index.ts",
"packages/states/src/index.ts",
"packages/table/src/index.ts",
"packages/tabs/src/index.ts",
"packages/tooltip/src/index.ts",
"packages/transition/src/index.ts",
"packages/tree/src/index.ts",
"packages/typography/src/index.ts",
"packages/utils/src/index.ts"
],
"tsconfig": "./tsconfig.typedoc.json",
"readme": "packages/react-md/README.md",
"listInvalidSymbolLinks": true
}
69 changes: 64 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3928,6 +3928,11 @@ colorette@^1.2.1, colorette@^1.2.2:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==

colors@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==

columnify@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb"
Expand Down Expand Up @@ -6887,7 +6892,7 @@ gzip-size@^6.0.0:
dependencies:
duplexer "^0.1.2"

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

lru-cache@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==
dependencies:
yallist "^3.0.2"

lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"

lunr@^2.3.9:
version "2.3.9"
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1"
integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==

lz-string@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26"
Expand Down Expand Up @@ -9621,7 +9638,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=

minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2:
minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
Expand Down Expand Up @@ -10495,6 +10512,13 @@ onetime@^5.1.0, onetime@^5.1.2:
dependencies:
mimic-fn "^2.1.0"

onigasm@^2.2.5:
version "2.2.5"
resolved "https://registry.yarnpkg.com/onigasm/-/onigasm-2.2.5.tgz#cc4d2a79a0fa0b64caec1f4c7ea367585a676892"
integrity sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==
dependencies:
lru-cache "^5.1.1"

open@^6.3.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9"
Expand Down Expand Up @@ -11728,7 +11752,7 @@ progress@^1.1.8:
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=

progress@^2.0.0:
progress@^2.0.0, progress@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
Expand Down Expand Up @@ -13077,7 +13101,7 @@ shelljs@^0.6.0:
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.6.1.tgz#ec6211bed1920442088fe0f70b2837232ed2c8a8"
integrity sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=

shelljs@^0.8.3:
shelljs@^0.8.3, shelljs@^0.8.4:
version "0.8.4"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
Expand All @@ -13091,6 +13115,14 @@ shellwords@^0.1.1:
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==

shiki@^0.9.3:
version "0.9.3"
resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.9.3.tgz#7bf7bcf3ed50ca525ec89cc09254abce4264d5ca"
integrity sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==
dependencies:
onigasm "^2.2.5"
vscode-textmate "^5.2.0"

shortid@^2.2.8:
version "2.2.15"
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122"
Expand Down Expand Up @@ -14383,6 +14415,28 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typedoc-default-themes@^0.12.10:
version "0.12.10"
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz#614c4222fe642657f37693ea62cad4dafeddf843"
integrity sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==

typedoc@^0.20.36:
version "0.20.36"
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.20.36.tgz#ee5523c32f566ad8283fc732aa8ea322d1a45f6a"
integrity sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==
dependencies:
colors "^1.4.0"
fs-extra "^9.1.0"
handlebars "^4.7.7"
lodash "^4.17.21"
lunr "^2.3.9"
marked "^2.0.3"
minimatch "^3.0.0"
progress "^2.0.3"
shelljs "^0.8.4"
shiki "^0.9.3"
typedoc-default-themes "^0.12.10"

typescript@^4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
Expand Down Expand Up @@ -14821,6 +14875,11 @@ vm-browserify@1.1.2, vm-browserify@^1.0.1:
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==

vscode-textmate@^5.2.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.4.0.tgz#4b25ffc1f14ac3a90faf9a388c67a01d24257cd7"
integrity sha512-c0Q4zYZkcLizeYJ3hNyaVUM2AA8KDhNCA3JvXY8CeZSJuBdAy3bAvSbv46RClC4P3dSO9BdwhnKEx2zOo6vP/w==

w3c-hr-time@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"
Expand Down Expand Up @@ -15161,7 +15220,7 @@ yallist@^2.1.2:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=

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

1 comment on commit 84739af

@vercel
Copy link

@vercel vercel bot commented on 84739af May 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.