Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including typedoc-plantuml with all npm packages installed. Try it out:

require("typedoc/package.json"); // typedoc is a peer dependency. var typedocPlantuml = require("typedoc-plantuml")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

typedoc-plantuml v1.4.1

Plugin for TypeDoc that generates images for PlantUML diagrams embedded in comments.

typedoc-plantuml

Plugin for TypeDoc that generates images for PlantUML diagrams embedded in comments.

Installation

The plugin can then be installed using npm:

$ npm install typedoc-plantuml --save-dev

Usage

TypeDoc automatically detects plugins installed via npm. After installation TypeDoc can be used normally and UML diagrams in comments will be processed.

The start of a UML diagram is indicated by the <uml> tag and closed by the </uml> tag. Alternate text for the generated image can optionally be specified using the alt attribute. For example <uml alt="Some diagram">.

Note that the parser that finds the xml tags in the comment text is not very smart, so avoid unnecessary whitespace or other attributes to the tag.

The following is an example of embedding a sequence diagram in a class description.

/**
 * Some class in a project.
 *
 * <uml>
 *     Bob->Alice : hello
 * </uml>
 */
export class SomeClass {

}

You can view the generated documentation here.

Please refer to the plantuml website for a full reference on the supported UML syntax.

Options

The following options are added to TypeDoc when the plugin is installed:

  • --umlLocation <local|remote>
    Specifies the location of the generated uml images. If local then local image files are created in the assets directory of the generated documentation. If remote then the image tag uses an encoded link to the plantuml server. Default is local.
  • --umlFormat <png|svg>
    Specifies the image format to use. Default is PNG.

License

Licensed under the Apache License 2.0.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free