typedoc-plugin-markdown

  • Version 4.3.3
  • Published
  • 315 kB
  • No dependencies
  • MIT license

Install

npm i typedoc-plugin-markdown
yarn add typedoc-plugin-markdown
pnpm add typedoc-plugin-markdown

Overview

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.

Index

Functions

function load

load: (app: Application) => void;
  • The function that is called by TypeDoc to bootstrap the plugin.

    Here we expose additional TypeDoc options and make some adjustments.

    This method is not intended to be consumed in any other context that via the plugin option.

Classes

class MarkdownPageEvent

class MarkdownPageEvent<Model = Reflection> extends Event {}
  • An event emitted before and after the markdown of a page is rendered.

constructor

constructor(name: string, model: {});

property BEGIN

static readonly BEGIN: string;
  • Triggered before a document will be rendered.

property contents

contents?: string;
  • The final markdown string content of the page.

    Should be rendered by layout templates and can be modified by plugins.

property END

static readonly END: string;
  • Triggered after a document has been rendered, just before it is written to disc.

property filename

filename: string;
  • The complete string filename where the file will be written..

property frontmatter

frontmatter?: Record<string, any>;
  • The frontmatter of this page represented as a key value object. This property can be utilised by other plugins.

property group

group?: string;
  • The group title of the group reflection belongs to.

property model

readonly model: {};
  • The model that that is being rendered on this page. Either a or .

property pageHeadings

pageHeadings: any;

property pageSections

pageSections: any;

property project

project: ProjectReflection;
  • The instance the renderer is currently processing.

property startNewSection

startNewSection: any;

property url

url: string;
  • The url string of the page.

class MarkdownRendererEvent

class MarkdownRendererEvent extends Event {}
  • An event emitted at the beginning and end of the rendering process.

constructor

constructor(name: string, outputDirectory: string, project: ProjectReflection);

property BEGIN

static readonly BEGIN: string;
  • Triggered before the renderer starts rendering a project.

property END

static readonly END: string;
  • Triggered after the renderer has written all documents.

property navigation

navigation?: NavigationItem[];
  • The navigation structure of the project that can be utilised by plugins.

property outputDirectory

readonly outputDirectory: string;
  • The path of the directory the documentation should be written to.

property project

readonly project: ProjectReflection;
  • The project the renderer is currently processing.

property urls

urls?: UrlMapping<Reflection>[];
  • A list of all pages that should be generated.

method createPageEvent

createPageEvent: <Model>(
mapping: UrlMapping<Model>
) => [RenderTemplate<MarkdownPageEvent<Model>>, MarkdownPageEvent<Model>];

Interfaces

interface MarkdownApplication

interface MarkdownApplication extends Application {}
  • The MarkdownApplication extends TypeDoc's instance with a custom renderer.

property renderer

renderer: MarkdownRenderer & Renderer;

    interface MarkdownRenderer

    interface MarkdownRenderer extends Renderer {}
    • The MarkdownRenderer extends TypeDoc's instance with custom hooks and async jobs.

    property defineTheme

    defineTheme: (
    name: string,
    theme: new (renderer: Renderer) => MarkdownTheme
    ) => void;
    • Define a new theme that can be used to render output.

      Parameter name

      The name of the theme.

      Parameter theme

      The theme class to use.

    property markdownHooks

    markdownHooks: EventHooks<MarkdownRendererHooks, string>;

      property postRenderAsyncJobs

      postRenderAsyncJobs: Array<(output: MarkdownRendererEvent) => Promise<void>>;
      • A list of async jobs which must be completed after rendering output files but before generation is considered successful. These functions will be called after all documents have been written to the filesystem.

        Note: This array is cleared after calling the contained functions on each call.

      property preRenderAsyncJobs

      preRenderAsyncJobs: Array<(output: MarkdownRendererEvent) => Promise<void>>;
      • A list of async jobs which must be completed before rendering output.

        Note: This array is cleared after calling the contained functions on each call.

      method on

      on: {
      (
      event: typeof MarkdownPageEvent.BEGIN | typeof MarkdownPageEvent.END,
      callback: (page: MarkdownPageEvent) => void
      ): void;
      (
      event: 'beginRender' | 'endRender',
      callback: (page: MarkdownRendererEvent) => void
      ): void;
      };
      • Parameter event

        Triggered before or after a document will be rendered.

        Parameter callback

        Receives the MarkdownPageEvent object as an argument.

        Example 1

        app.renderer.on(MarkdownPageEvent.BEGIN, (renderer) => {});
      • Parameter event

        Triggered before or after rendering the project.

        Parameter callback

        Receives the MarkdownRendererEvent object as an argument.

        Example 1

        app.renderer.on(MarkdownRendererEvent.BEGIN, (renderer) => {});

      interface MarkdownRendererHooks

      interface MarkdownRendererHooks {}
      • Describes the hooks available to inject output in the markdown theme.

      property ['content.begin']

      ['content.begin']: [MarkdownThemeContext];
      • Applied before the main markdown content is rendered.

        Hooks

      property ['index.page.begin']

      ['index.page.begin']: [MarkdownThemeContext];
      • Applied at the start of the markdown output on the index page.

        Hooks

      property ['index.page.end']

      ['index.page.end']: [MarkdownThemeContext];
      • Applied at the end of the markdown output on the index page.

        Hooks

      property ['page.begin']

      ['page.begin']: [MarkdownThemeContext];
      • Applied at the start of the markdown output.

        Hooks

      property ['page.end']

      ['page.end']: [MarkdownThemeContext];
      • Applied at the end of the markdown output.

        Hooks

      interface NavigationItem {}
      • The model used to define the navigation structure.

      children?: NavigationItem[];
        kind?: ReflectionKind;
          path?: string | null;
            title: string;

              interface PluginOptions

              interface PluginOptions {}
              • Describes the options declared by the plugin.

              property anchorPrefix

              anchorPrefix: string;
              • Custom anchor prefix when anchoring to in-page symbols.

              property blockTagsPreserveOrder

              blockTagsPreserveOrder: string[];
              • Specifies comment block tags that should preserve their position.

              property classPropertiesFormat

              classPropertiesFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of property groups for classes.

              property entryFileName

              entryFileName: string;
              • The file name of the entry page.

              property entryModule

              entryModule: string;
              • The name of a module that should act as the root page for the documentation.

              property enumMembersFormat

              enumMembersFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of enumeration members.

              property excludeGroups

              excludeGroups: boolean;
              • Deprecated

                This option has been renamed hideGroupHeadings to better reflect its purpose.

              property excludeScopesInPaths

              excludeScopesInPaths: boolean;
              • Exclude writing @ scope directories in paths.

              property expandObjects

              expandObjects: boolean;
              • Expand objects inside declarations.

              property expandParameters

              expandParameters: boolean;
              • Expand parameters in signature parentheses to display type information.

              property fileExtension

              fileExtension: string;
              • Specify the file extension for generated output files.

              property flattenOutputFiles

              flattenOutputFiles: boolean;
              • Flatten output files to a single directory.

              property formatWithPrettier

              formatWithPrettier: boolean;
              • Apply additional output formatting with Prettier.

              property hideBreadcrumbs

              hideBreadcrumbs: boolean;
              • Do not print breadcrumbs.

              property hideGroupHeadings

              hideGroupHeadings: boolean;
              • Excludes grouping by kind so all members are rendered at the same level.

              property hidePageHeader

              hidePageHeader: boolean;
              • Do not print page header.

              property hidePageTitle

              hidePageTitle: boolean;
              • Do not print page title.

              property indexFormat

              indexFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of index items.

              property interfacePropertiesFormat

              interfacePropertiesFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of property groups for interfaces.

              property membersWithOwnFile

              membersWithOwnFile: (
              | 'Enum'
              | 'Variable'
              | 'Function'
              | 'Class'
              | 'Interface'
              | 'TypeAlias'
              )[];
              • Determines which members are exported to their own file.

              property mergeReadme

              mergeReadme: boolean;
              • Appends the documentation index page to the readme page.

              property modulesFileName

              modulesFileName: string;
              • The file name of the separate modules / index page.

              property navigationModel

              navigationModel: {
              excludeGroups: boolean;
              excludeCategories: boolean;
              excludeFolders: boolean;
              };
              • Deprecated

                This option has been deprecated in favour of TypeDoc navigation option.

              property outputFileStrategy

              outputFileStrategy: 'members' | 'modules';
              • Determines how output files are generated.

              property pageTitleTemplates

              pageTitleTemplates: {
              index: string | ((name: { projectName: string; version: string }) => string);
              member:
              | string
              | ((name: { name: string; kind: string; group: string }) => string);
              module: string | ((name: { name: string; kind: string }) => string);
              };
              • Change specific text placeholders in the template.

              property parametersFormat

              parametersFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of parameter and type parameter groups.

              property preserveAnchorCasing

              preserveAnchorCasing: boolean;
              • Preserve anchor casing when generating link to symbols.

              property prettierConfigFile

              prettierConfigFile: string;
              • Specify a custom Prettier configuration file location.

              property propertiesFormat

              propertiesFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of property groups for interfaces and classes.

              property propertyMembersFormat

              propertyMembersFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of style for property members for interfaces and classes.

              property publicPath

              publicPath: string;
              • Specify the base path for all urls.

              property sanitizeComments

              sanitizeComments: boolean;
              • Sanitize HTML and JSX inside JsDoc comments.

              property tableColumnSettings

              tableColumnSettings: {
              hideDefaults: boolean;
              hideInherited: boolean;
              hideModifiers: boolean;
              hideOverrides: boolean;
              hideSources: boolean;
              hideValues: boolean;
              leftAlignHeaders: boolean;
              };
              • Control how table columns are configured and displayed.

              property textContentMappings

              textContentMappings: {
              'header.title': string;
              'breadcrumbs.home': string;
              'title.indexPage': string;
              'title.memberPage': string;
              'title.modulePage': string;
              };
              • Change specific text placeholders in the template.

              property typeDeclarationFormat

              typeDeclarationFormat: 'list' | 'table' | 'htmlTable';
              • Sets the format of style for type declaration members.

              property typeDeclarationVisibility

              typeDeclarationVisibility: 'compact' | 'verbose';
              • Set the visibility level for type declaration documentation.

              property useCodeBlocks

              useCodeBlocks: boolean;
              • Wraps signatures and declarations in code blocks.

              property useHTMLAnchors

              useHTMLAnchors: boolean;
              • Add HTML named anchors to headings and table rows.

              property useHTMLEncodedBrackets

              useHTMLEncodedBrackets: boolean;
              • Use HTML encoded entities for angle brackets.

              interface UrlMapping

              interface UrlMapping<Model> {}
              • The model used to define the URL mapping structure.

              property group

              group?: string;

                property model

                model: Model;

                  property template

                  template: (data: MarkdownPageEvent<Model>) => string;

                    property url

                    url: string;

                      Package Files (8)

                      Dependencies (0)

                      No dependencies.

                      Dev Dependencies (0)

                      No dev dependencies.

                      Peer Dependencies (1)

                      Badge

                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/typedoc-plugin-markdown.

                      • Markdown
                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/typedoc-plugin-markdown)
                      • HTML
                        <a href="https://www.jsdocs.io/package/typedoc-plugin-markdown"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>