docusaurus-plugin-typedoc 1.0.1 → 1.0.2

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.
package/README.md CHANGED
@@ -4,12 +4,6 @@
4
4
 
5
5
  > A Docusaurus plugin to integrate TypeDoc ( + typedoc-plugin-markdown ) into a Docusaurus project.
6
6
 
7
- ## Installation
8
-
9
- ```shell
10
- npm install docusaurus-plugin-typedoc --save-dev
11
- ```
12
-
13
7
  ## Documentation
14
8
 
15
9
  Please visit the [https://typedoc-plugin-markdown.org/plugins/docusaurus](https://typedoc-plugin-markdown.org/plugins/docusaurus) for comprehensive documentation, including options and usage guides.
package/dist/models.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PluginOptions as TypedocPluginMarkdownOptions } from 'typedoc-plugin-markdown';
2
- import { PluginOptions as DocusaurusOptions } from './options/option-types';
2
+ import { PluginOptions as DocusaurusOptions } from './types';
3
3
  export interface PluginOptions extends TypedocPluginMarkdownOptions, DocusaurusOptions {
4
4
  id: string;
5
5
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * All plugin types are exported from this module.
3
+ *
4
+ * @module
5
+ */
6
+ export * as declarations from './declarations';
7
+ export * as presets from './presets';
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * All plugin types are exported from this module.
4
+ *
5
+ * @module
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || function (mod) {
24
+ if (mod && mod.__esModule) return mod;
25
+ var result = {};
26
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
+ __setModuleDefault(result, mod);
28
+ return result;
29
+ };
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.presets = exports.declarations = void 0;
32
+ exports.declarations = __importStar(require("./declarations"));
33
+ exports.presets = __importStar(require("./presets"));
@@ -1,8 +1,7 @@
1
- declare const _default: {
1
+ export declare const presets: {
2
2
  out: string;
3
3
  hideBreadcrumbs: boolean;
4
4
  hidePageHeader: boolean;
5
5
  entryFileName: string;
6
6
  plugin: string[];
7
7
  };
8
- export default _default;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
3
+ exports.presets = void 0;
4
+ exports.presets = {
4
5
  out: './docs/api',
5
6
  hideBreadcrumbs: true,
6
7
  hidePageHeader: true,
package/dist/options.js CHANGED
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getPluginOptions = exports.DEFAULT_SIDEBAR_OPTIONS = void 0;
7
- const presets_1 = __importDefault(require("./options/presets"));
3
+ exports.DEFAULT_SIDEBAR_OPTIONS = void 0;
4
+ exports.getPluginOptions = getPluginOptions;
5
+ const presets_1 = require("./options/presets");
8
6
  exports.DEFAULT_SIDEBAR_OPTIONS = {
9
7
  autoConfiguration: true,
10
8
  pretty: false,
11
9
  };
12
10
  const DEFAULT_PLUGIN_OPTIONS = {
13
- ...presets_1.default,
11
+ ...presets_1.presets,
14
12
  id: 'default',
15
13
  sidebar: {
16
14
  ...exports.DEFAULT_SIDEBAR_OPTIONS,
@@ -30,4 +28,3 @@ function getPluginOptions(opts) {
30
28
  };
31
29
  return options;
32
30
  }
33
- exports.getPluginOptions = getPluginOptions;
package/dist/plugin.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PluginOptions } from '.';
1
+ import { PluginOptions } from './models';
2
2
  export default function pluginDocusaurus(context: any, opts: Partial<PluginOptions>): Promise<{
3
3
  name: string;
4
4
  extendCli(cli: any): void;
package/dist/plugin.js CHANGED
@@ -23,6 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.default = pluginDocusaurus;
26
27
  const fs = __importStar(require("fs"));
27
28
  const path = __importStar(require("path"));
28
29
  const typedoc_1 = require("typedoc");
@@ -54,7 +55,6 @@ async function pluginDocusaurus(context, opts) {
54
55
  },
55
56
  };
56
57
  }
57
- exports.default = pluginDocusaurus;
58
58
  /**
59
59
  * Initiates a new typedoc Application bootstrapped with plugin options
60
60
  */
@@ -62,20 +62,17 @@ async function generateTypedoc(context, opts) {
62
62
  const { siteDir } = context;
63
63
  const pluginOptions = (0, options_1.getPluginOptions)(opts);
64
64
  const { id, sidebar, ...optionsPassedToTypeDoc } = pluginOptions;
65
- const app = await typedoc_1.Application.bootstrapWithPlugins(optionsPassedToTypeDoc);
65
+ const outputDir = path.join(siteDir, pluginOptions.out);
66
+ if (!fs.existsSync(outputDir)) {
67
+ fs.mkdirSync(outputDir, { recursive: true });
68
+ }
69
+ const app = (await typedoc_1.Application.bootstrapWithPlugins(optionsPassedToTypeDoc));
66
70
  Object.entries(options).forEach(([name, option]) => {
67
71
  app.options.addDeclaration({
68
72
  name,
69
73
  ...option,
70
74
  });
71
75
  });
72
- // attempt to handle docusaurus linkify bug https://github.com/facebook/docusaurus/issues/9048
73
- app.renderer.on(typedoc_1.PageEvent.END, (event) => {
74
- event.contents = event.contents
75
- ?.replace(/\)\.\[/g, ') . [')
76
- .replace(/\\<\[/g, ' \\<[');
77
- });
78
- const outputDir = app.options.getValue('out');
79
76
  if (sidebar?.autoConfiguration) {
80
77
  const docsPreset = context.siteConfig?.presets?.find((preset) => Boolean(preset[1]?.docs));
81
78
  app.renderer.postRenderAsyncJobs.push(async (output) => {
package/dist/sidebar.js CHANGED
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSidebar = void 0;
3
+ exports.getSidebar = getSidebar;
4
4
  function getSidebar(navigation, basePath, numberPrefixParser) {
5
5
  return navigation
6
6
  .map((navigationItem) => getNavigationItem(navigationItem, basePath, numberPrefixParser))
7
7
  .filter((navItem) => Boolean(navItem));
8
8
  }
9
- exports.getSidebar = getSidebar;
10
9
  function getNavigationItem(navigationItem, basePath, numberPrefixParser) {
11
10
  const parsedUrl = numberPrefixParser === false
12
11
  ? navigationItem.path
@@ -0,0 +1,6 @@
1
+ /**
2
+ * All plugin types are exported from this module.
3
+ *
4
+ * @module
5
+ */
6
+ export * from './options';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * All plugin types are exported from this module.
4
+ *
5
+ * @module
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ __exportStar(require("./options"), exports);
@@ -1,13 +1,5 @@
1
- import { ManuallyValidatedOption } from 'typedoc';
2
- declare module 'typedoc' {
3
- interface TypeDocOptionMap {
4
- sidebar: ManuallyValidatedOption<Sidebar>;
5
- }
6
- }
7
1
  /**
8
2
  * Describes the options declared by the plugin.
9
- *
10
- * @category Options
11
3
  */
12
4
  export interface PluginOptions {
13
5
  /**
@@ -17,8 +9,6 @@ export interface PluginOptions {
17
9
  }
18
10
  /**
19
11
  *
20
- *
21
- * @category Options
22
12
  */
23
13
  export interface Sidebar {
24
14
  autoConfiguration: boolean;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-typedoc",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A Docusaurus plugin to integrate TypeDoc ( + typedoc-plugin-markdown ) into a Docusaurus project.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  "url": "git+https://github.com/typedoc2md/typedoc-plugin-markdown.git",
15
15
  "directory": "packages/docusaurus-plugin-typedoc"
16
16
  },
17
- "homepage": "http://typedoc.org/plugins/docusaurus",
17
+ "homepage": "http://typedoc-plugin-markdown.org/plugins/docusaurus",
18
18
  "peerDependencies": {
19
19
  "typedoc-plugin-markdown": ">=4.0.0"
20
20
  },
@@ -35,7 +35,7 @@
35
35
  "plugin"
36
36
  ],
37
37
  "devDependencies": {
38
- "@docusaurus/core": "^3.2.1",
39
- "@docusaurus/types": "^3.2.1"
38
+ "@docusaurus/core": "^3.4.0",
39
+ "@docusaurus/types": "^3.4.0"
40
40
  }
41
41
  }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // THIS FILE IS AUTO GENERATED FROM THE OPTIONS CONFIG. DO NOT EDIT DIRECTLY.
3
- Object.defineProperty(exports, "__esModule", { value: true });