docusaurus-plugin-typedoc 1.0.0-next.26 → 1.0.0-next.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/sidebar.js +14 -3
  2. package/package.json +5 -4
package/dist/sidebar.js CHANGED
@@ -11,9 +11,20 @@ function getNavigationItem(navigationItem, basePath, filteredIds, numberPrefixPa
11
11
  const parsedUrl = numberPrefixParser === false
12
12
  ? navigationItem.url
13
13
  : navigationItem.url?.replace(/\d+\-/g, '');
14
- const id = navigationItem.url
15
- ? `${basePath}/${parsedUrl}`.replace(/(.*).md/, '$1')
16
- : null;
14
+ const getId = () => {
15
+ const idParts = [];
16
+ if (basePath.length > 0) {
17
+ idParts.push(basePath);
18
+ }
19
+ if (parsedUrl) {
20
+ idParts.push(parsedUrl);
21
+ }
22
+ if (navigationItem.url) {
23
+ return idParts.join('/').replace(/(.*).md/, '$1');
24
+ }
25
+ return null;
26
+ };
27
+ const id = getId();
17
28
  if (navigationItem.children?.length) {
18
29
  return {
19
30
  type: 'category',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-typedoc",
3
- "version": "1.0.0-next.26",
3
+ "version": "1.0.0-next.27",
4
4
  "description": "A Docusaurus plugin to integrate TypeDoc into a Docusaurus project.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -16,15 +16,15 @@
16
16
  },
17
17
  "homepage": "https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc",
18
18
  "peerDependencies": {
19
- "typedoc-plugin-markdown": ">=4.0.0-next.44"
19
+ "typedoc-plugin-markdown": ">=4.0.0-next.45"
20
20
  },
21
21
  "scripts": {
22
22
  "lint": "eslint ./src --ext .ts",
23
23
  "prepublishOnly": "npm run lint && npm run build",
24
24
  "build": "rm -rf ./dist && tsc",
25
- "build-and-test": "npm run build && npm run test",
25
+ "pretest": "rm -rf ./test/out && docusaurus generate-typedoc",
26
26
  "test": "jest",
27
- "test:update": "npm test -- -u"
27
+ "test:update": "npm run build && npm test -- -u"
28
28
  },
29
29
  "author": "Thomas Grey",
30
30
  "license": "MIT",
@@ -37,6 +37,7 @@
37
37
  "api"
38
38
  ],
39
39
  "devDependencies": {
40
+ "@docusaurus/core": "^3.1.1",
40
41
  "@docusaurus/types": "^3.1.1"
41
42
  }
42
43
  }