]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Generate API docs with vuepress-plugin-typedoc (#8755)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Tue, 30 Mar 2021 20:19:59 +0000 (23:19 +0300)
committerGitHub <noreply@github.com>
Tue, 30 Mar 2021 20:19:59 +0000 (16:19 -0400)
* Generate API docs with vuepress-plugin-typedoc

* Links, fixes, cleanup

.github/release-drafter.yml
.github/workflows/ci.yml
.github/workflows/deploy-docs.yml
.github/workflows/npmpublish.yml
.gitignore
docs/.vuepress/config.js
docs/developers/plugins.md
package-lock.json
package.json
tsconfig.json

index 3ce77e6e3143dcfa1d308aeba4d7ce8fcbc58fd5..4b51460834cab1014019aad700e3608ffb9df599 100644 (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
index 49a4c85e3f7c142e1d5961f5984d0273c40140b5..652c39ff7a84dfb851d4618dc3238363cc345542 100644 (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'
index babd64a92c00f18305702907b8df890ffa67ec78..61a6ac57197e82f1f1751439317460fe11ddbb40 100644 (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:
index 37ffc2636673c4fb33996615fbfaa291dd2b9d41..068eaf7cf04a1578957038fedcdfa5c524ba4cfb 100644 (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 }}
index 3adb827bd0c73bcdefc58aa524cf544af5ee6811..3ba0279f2be9e5d2ac67e09e350cf6e3a021d15e 100644 (file)
@@ -9,9 +9,10 @@ node_modules/
 npm-debug.log*
 
 # Docs
-.docusaurus
 .cache-loader
 build/
+# generated typedocs
+docs/api
 
 # Development
 .DS_Store
index 26b89240fc9c78b7c5658639f4380f4db5563d00..48d3fbc41cca50af713f6b2f025e6f061167bfb4 100644 (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',
index d0a60851ee9a55dd26e1f15f0871a30db722642f..95beb1453b92a6971043e9f0574f5f84220d5f3f 100644 (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
 
index 9b605eae422e325a0d34f279accf3277b6c0f873..9ddc90a56954014ed0d7c885502233de337a19f8 100644 (file)
       "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",
       "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",
index f4e6cd81a92306a4d0a2dca68dd0db18d1d1100a..dd10d2cc6b4b29da2d42e4e8110405eba6caef06 100644 (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",
     "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"
   }
index 86c555b9c3c1284408a44626cfe1922ad0ace9e7..05e80912c99f0081b0983860049766d42e885f15 100644 (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"