Generate API docs with vuepress-plugin-typedoc (#8755)

* Generate API docs with vuepress-plugin-typedoc

* Links, fixes, cleanup
This commit is contained in:
Jukka Kurkela 2021-03-30 23:19:59 +03:00 committed by GitHub
parent 4b7b3f277f
commit 93e07ebb48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 42 additions and 10 deletions

View File

@ -45,7 +45,7 @@ template: |
* [npm](https://www.npmjs.com/package/chart.js)
* [Migration guide](https://www.chartjs.org/docs/next/getting-started/v3-migration)
* [Docs](https://www.chartjs.org/docs/next/)
* [API](https://www.chartjs.org/docs/next/typedoc/)
* [API](https://www.chartjs.org/docs/next/api/)
* [Samples](https://www.chartjs.org/samples/next/)
$CHANGES

View File

@ -71,7 +71,6 @@ jobs:
if: steps.changes.outputs.docs == 'true'
run: |
npm run docs
npm run typedoc
npm pack
- name: Coveralls Parallel - Chrome
if: steps.changes.outputs.src == 'true'

View File

@ -29,7 +29,6 @@ jobs:
npm run build
./scripts/docs-config.sh "master"
npm run docs
npm run typedoc
npm pack
./scripts/deploy-docs.sh "master"
env:

View File

@ -47,7 +47,6 @@ jobs:
npm run build
./scripts/docs-config.sh "${VERSION}"
npm run docs
npm run typedoc
npm pack
env:
VERSION: ${{ needs.setup.outputs.version }}

3
.gitignore vendored
View File

@ -9,9 +9,10 @@ node_modules/
npm-debug.log*
# Docs
.docusaurus
.cache-loader
build/
# generated typedocs
docs/api
# Development
.DS_Store

View File

@ -19,6 +19,19 @@ module.exports = {
'ga': 'UA-28909194-3'
}
],
[
'vuepress-plugin-typedoc',
{
entryPoints: ['../../types/index.esm.d.ts'],
hideInPageTOC: true,
tsconfig: '../../tsconfig.json',
sidebar: {
fullNames: true,
parentCategory: 'API',
},
},
],
],
chainWebpack(config) {
config.merge({
@ -49,6 +62,7 @@ module.exports = {
},
nav: [
{text: 'Home', link: '/'},
{text: 'API', link: '/api/'},
// TODO: Make local when samples moved to vuepress
{text: 'Samples', link: `https://www.chartjs.org/samples/${docsVersion}/`},
{
@ -62,6 +76,9 @@ module.exports = {
}
],
sidebar: {
'/api/': {
title: 'API'
},
'/': [
'',
{
@ -148,7 +165,7 @@ module.exports = {
children: [
'developers/',
'developers/api',
[`https://chartjs.org/docs/${docsVersion}/typedoc/`, 'TypeDoc'],
['api/', 'TypeDoc'],
'developers/updates',
'developers/plugins',
'developers/charts',

View File

@ -122,7 +122,7 @@ var chart = new Chart(ctx, {
## Plugin Core API
Read more about the [existing plugin extension hooks](https://github.com/chartjs/Chart.js/blob/master/types/index.esm.d.ts).
Read more about the [existing plugin extension hooks](../api/interfaces/plugin).
### Chart Initialization

15
package-lock.json generated
View File

@ -14782,6 +14782,15 @@
"integrity": "sha512-Jd5fYTiqzinZdoIY382W7tQXTwAzWRdg8KbHfaxmb78m1/3jL9riXtk23oBOKwhi8GFVykCOdPzEJKY87/D0LQ==",
"dev": true
},
"typedoc-plugin-markdown": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.6.0.tgz",
"integrity": "sha512-fg4xby3awJVVxB8TdhHNsZQfiTC5x1XmauVwhKXc6hGeu1bzTnqrkmDT8NCjxfUgw64si8cUX1jBfBjAHthWpQ==",
"dev": true,
"requires": {
"handlebars": "^4.7.6"
}
},
"typescript": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz",
@ -15590,6 +15599,12 @@
"integrity": "sha512-jooDlcMdBqhXgIaF1awFSaOTM56mleP6bbCiGxyQxTZexfvCfDvZhNLGpyXqMQA50ZmNGmvLrK82YYb63k1jfA==",
"dev": true
},
"vuepress-plugin-typedoc": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/vuepress-plugin-typedoc/-/vuepress-plugin-typedoc-0.6.0.tgz",
"integrity": "sha512-o4VdBs1U8Z7RboRoK3txiXony46ANELCQmcOaH3JijSdh+zx/e4jkrYbUWmN72zx9yFIE2dONdLQreDyUjlHbg==",
"dev": true
},
"vuepress-theme-chartjs": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/vuepress-theme-chartjs/-/vuepress-theme-chartjs-0.2.0.tgz",

View File

@ -46,8 +46,7 @@
"lint-tsc": "tsc",
"lint-types": "eslint \"types/**/*.ts\" && tsc -p types/tests/",
"lint": "concurrently \"npm:lint-*\"",
"test": "npm run lint && cross-env NODE_ENV=test karma start --auto-watch --single-run --coverage --grep",
"typedoc": "npx typedoc"
"test": "npm run lint && cross-env NODE_ENV=test karma start --auto-watch --single-run --coverage --grep"
},
"devDependencies": {
"@kurkle/color": "^0.1.9",
@ -90,11 +89,13 @@
"rollup-plugin-istanbul": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"typedoc": "^0.20.32",
"typedoc-plugin-markdown": "^3.6.0",
"typescript": "^4.1.5",
"vue-tabs-component": "^1.5.0",
"vuepress": "^1.8.2",
"vuepress-plugin-redirect": "^1.2.5",
"vuepress-plugin-tabs": "^0.3.0",
"vuepress-plugin-typedoc": "^0.6.0",
"vuepress-theme-chartjs": "^0.2.0",
"yargs": "^16.2.0"
}

View File

@ -12,7 +12,8 @@
},
"typedocOptions": {
"name": "Chart.js",
"entryPoints": ["src/index.esm.js"],
"entryPoints": ["types/index.esm.d.ts"],
"readme": "none",
"excludeExternals": true,
"includeVersion": true,
"out": "./dist/docs/typedoc"