1.3.4 • Published 5 years ago

typedoc-plugin-base v1.3.4

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

typedoc-plugin-base

An example plugin with some helper classes to simplify plugin development for typedoc.

Installation

This module can be installed using npm:

$ npm install typedoc-plugin-base

Usage

After installing the module you can import its classes and use them in your own plugin project. Declaration files are also included, so that you can import classes in your TypeScript code like this:

import { PluginBase } from "typedoc-plugin-base/dist/plugin_base";

1. Create a plugin class just like ExamplePlugin

Your plugin class can extend the base class PluginBase. You can define your options and subscribe to the necessary events of TypeDoc just like the ExamplePlugin class does. All of your plugin's code can go into this file or other files that you import.

2. Create an index.ts file that exports a function called load

TypeDoc is looking for a function called load to load your plugin. So you should define one in your module's main entry point - index.ts in this example. The function could be as simple as this:

export function load(host: PluginHost): void {
    new ExamplePlugin().initialize(host.application);
}

TypeDoc background knowledge

The TypeDoc Application uses a Converter to scan the source files and create a ProjectReflection. Then the Application uses the Renderer (and a Theme) to create the doc output from the ProjectReflection.

The Application uses a PluginHost to search and load plugins. A plugin is loaded via a function call by the PluginHost passing itself as an argument. Using the PluginHost.application getter the plugin can access the Application.

The plugin can use the Application.options to add declarations (TypeDoc parameters) and later get their values.

The Converter and the Renderer emit events during their work. The plugin can register itself for events of the Converter and the Renderer to modify the output.

Please take a look at the TypeDoc API for detailed information: https://typedoc.org/api/

Any more questions? Please ask them on Gitter here: https://gitter.im/TypeStrong/typedoc

License

Internet Systems Consortium (ISC)

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago