MarkdownRenderer
The MarkdownRenderer extends TypeDoc’s Renderer instance with custom hooks and async jobs.
Extends
Methods
on()
Call Signature
on(
event
,callback
):void
Parameters
Parameter | Type | Description |
---|---|---|
event | "beginPage" | "endPage" | Triggered before or after a document will be rendered. |
callback | (page ) => void | Receives the MarkdownPageEvent object as an argument. |
Returns
void
Example
app.renderer.on(MarkdownPageEvent.BEGIN, (renderer) => {});
Overrides
Renderer.on
Call Signature
on(
event
,callback
):void
Parameters
Parameter | Type | Description |
---|---|---|
event | "beginRender" | "endRender" | Triggered before or after rendering the project. |
callback | (page ) => void | Receives the MarkdownRendererEvent object as an argument. |
Returns
void
Example
app.renderer.on(MarkdownRendererEvent.BEGIN, (renderer) => {});
Overrides
Renderer.on
Properties
defineTheme()
defineTheme: (
name
,theme
) =>void
Define a new theme that can be used to render output.
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the theme. |
theme | (renderer ) => MarkdownTheme | The theme class to use. |
Returns
void
Overrides
Renderer.defineTheme
markdownHooks
markdownHooks:
EventHooks
<MarkdownRendererHooks
,string
>
preRenderAsyncJobs
preRenderAsyncJobs: (
output
) =>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.
Parameters
Parameter | Type |
---|---|
output | MarkdownRendererEvent |
Returns
Promise
<void
>
Overrides
Renderer.preRenderAsyncJobs
postRenderAsyncJobs
postRenderAsyncJobs: (
output
) =>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.
Parameters
Parameter | Type |
---|---|
output | MarkdownRendererEvent |
Returns
Promise
<void
>
Overrides
Renderer.postRenderAsyncJobs