@microsoft/api-documenter
Version:
Read JSON files from api-extractor, generate documentation pages
47 lines • 1.62 kB
JavaScript
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { TypeUuid } from '@rushstack/node-core-library';
import { PluginFeature } from './PluginFeature';
/**
* Context object for {@link MarkdownDocumenterFeature}.
* Exposes various services that can be used by a plugin.
*
* @public
*/
export class MarkdownDocumenterFeatureContext {
/** @internal */
constructor(options) {
this.apiModel = options.apiModel;
this.outputFolder = options.outputFolder;
this.documenter = options.documenter;
}
}
const uuidMarkdownDocumenterFeature = '34196154-9eb3-4de0-a8c8-7e9539dfe216';
/**
* Inherit from this base class to implement an API Documenter plugin feature that customizes
* the generation of markdown output.
*
* @public
*/
export class MarkdownDocumenterFeature extends PluginFeature {
/**
* This event occurs before each markdown file is written. It provides an opportunity to customize the
* content of the file.
* @virtual
*/
onBeforeWritePage(eventArgs) {
// (implemented by child class)
}
/**
* This event occurs after all output files have been written.
* @virtual
*/
onFinished(eventArgs) {
// (implemented by child class)
}
static [Symbol.hasInstance](instance) {
return TypeUuid.isInstanceOf(instance, uuidMarkdownDocumenterFeature);
}
}
TypeUuid.registerClass(MarkdownDocumenterFeature, uuidMarkdownDocumenterFeature);
//# sourceMappingURL=MarkdownDocumenterFeature.js.map