From: Jukka Kurkela Date: Tue, 30 Mar 2021 20:19:59 +0000 (+0300) Subject: Generate API docs with vuepress-plugin-typedoc (#8755) X-Git-Tag: v3.0.0-rc.7~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93e07ebb480d96a43eeb00aaf87899efd03c0505;p=thirdparty%2FChart.js.git Generate API docs with vuepress-plugin-typedoc (#8755) * Generate API docs with vuepress-plugin-typedoc * Links, fixes, cleanup --- diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 3ce77e6e3..4b5146083 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49a4c85e3..652c39ff7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index babd64a92..61a6ac571 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -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: diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 37ffc2636..068eaf7cf 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -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 }} diff --git a/.gitignore b/.gitignore index 3adb827bd..3ba0279f2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,9 +9,10 @@ node_modules/ npm-debug.log* # Docs -.docusaurus .cache-loader build/ +# generated typedocs +docs/api # Development .DS_Store diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 26b89240f..48d3fbc41 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -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', diff --git a/docs/developers/plugins.md b/docs/developers/plugins.md index d0a60851e..95beb1453 100644 --- a/docs/developers/plugins.md +++ b/docs/developers/plugins.md @@ -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 diff --git a/package-lock.json b/package-lock.json index 9b605eae4..9ddc90a56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index f4e6cd81a..dd10d2cc6 100644 --- a/package.json +++ b/package.json @@ -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" } diff --git a/tsconfig.json b/tsconfig.json index 86c555b9c..05e80912c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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"