1.2.0 • Published 3 months ago

typedoc-plugin-include-example v1.2.0

Weekly downloads
-
License
-
Repository
github
Last release
3 months ago

The typedoc-plugin-include-example plugin allows TypeDoc users to include code examples from external files directly into their documentation.

Installation

npm install typedoc-plugin-include-example --save-dev

Usage

  1. In your TypeScript comments, add the @includeExample directive followed by the path of the file you wish to include:
/**
 * This is a sample function.
 *
 * @includeExample path/to/your/example.ts
 */
function myFunction() {
  // ...
}

@includeExample can also take in line numbers to include a specific range of lines from the file:

/**
 * This is a sample function of how to include lines 1-5 and 10 from `path/to/your/example.ts`
 *
 * @includeExample path/to/your/example.ts:1-5,10
 */
function myFunction() {
  // ...
}
  1. When generating documentation with TypeDoc, make sure to include the plugin:
typedoc --plugin typedoc-plugin-include-example

License

MIT

1.2.0

3 months ago

1.0.2

4 months ago

1.0.1

8 months ago

1.0.0

8 months ago