diff --git a/package-lock.json b/package-lock.json index b5aa7b11b..d9851b6eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,6 +66,7 @@ "lerna": "^6.4.0", "lodash.merge": "^4.6.2", "markdown-it": "^13.0.1", + "markdown-it-anchor": "^9.0.1", "prettier": "^2.5.1", "rimraf": "^5.0.9", "sass": "^1.47.0", @@ -15599,6 +15600,16 @@ "markdown-it": "bin/markdown-it.js" } }, + "node_modules/markdown-it-anchor": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-9.0.1.tgz", + "integrity": "sha512-cBt7aAzmkfX8X7FqAe8EBryiKmToXgMQEEMqkXzWCm0toDtfDYIGboKeTKd8cpNJArJtutrf+977wFJTsvNGmQ==", + "dev": true, + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", @@ -33433,6 +33444,12 @@ "uc.micro": "^1.0.5" } }, + "markdown-it-anchor": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-9.0.1.tgz", + "integrity": "sha512-cBt7aAzmkfX8X7FqAe8EBryiKmToXgMQEEMqkXzWCm0toDtfDYIGboKeTKd8cpNJArJtutrf+977wFJTsvNGmQ==", + "dev": true + }, "mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", diff --git a/package.json b/package.json index 7f178ccce..59c695d05 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,8 @@ "@typescript-eslint/eslint-plugin": "^5.9.0", "@typescript-eslint/parser": "^5.9.0", "@vitejs/plugin-vue2": "^2.2.0", - "@vue/vue2-jest": "^28.1.0", "@vue/test-utils": "^1.2.2", + "@vue/vue2-jest": "^28.1.0", "babel-core": "^7.0.0-bridge.0", "cesium": "^1.62.0", "copyfiles": "^2.4.1", @@ -78,6 +78,7 @@ "lerna": "^6.4.0", "lodash.merge": "^4.6.2", "markdown-it": "^13.0.1", + "markdown-it-anchor": "^9.0.1", "prettier": "^2.5.1", "rimraf": "^5.0.9", "sass": "^1.47.0", diff --git a/packages/core/README.md b/packages/core/README.md index e18f71ef6..b78e1e62b 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -199,7 +199,7 @@ The `<...masterportalAPI.fields>` means that any masterportalAPI field may also ##### -Plugins in POLAR are modular components that extend the functionality of the map client. They can be added using the [addPlugins](#addPlugins) method and configured through the `mapConfiguration` object. Each plugin has its own set of fields and options that can be customized. +Plugins in POLAR are modular components that extend the functionality of the map client. They can be added using the [addPlugins](#addplugins) method and configured through the `mapConfiguration` object. Each plugin has its own set of fields and options that can be customized. On how to configure a plugin, see the respective plugin. The configuration is given in the `mapConfiguration` object by the plugin's name as specified in its respective documentation. diff --git a/scripts/makeDocs.js b/scripts/makeDocs.js index 30a107c70..e7b375996 100644 --- a/scripts/makeDocs.js +++ b/scripts/makeDocs.js @@ -15,11 +15,16 @@ * docs and .md.) * * Call like `node ./scripts/makeDocs.js ./path/to/client`. + * + * Headings in markdowns will get a slugified ID by markdown-it-anchor to be linkable. + * It uses the default slugify function: + * (s) => encodeURIComponent(String(s).trim().toLowerCase().replace(/\s+/g, '-')) + * */ // IMPORTS const fs = require('fs') -const markdownIt = require('markdown-it')() +const markdownIt = require('markdown-it')().use(require('markdown-it-anchor')) // SETUP const fsOptions = { encoding: 'utf8' }