Top Description Methods
com.vladsch.flexmark.html.renderer

public Interface NodeRendererContext

extends LinkResolverContext
Known Direct Implementers
com.vladsch.flexmark.html.HtmlRenderer.MainNodeRenderer, com.vladsch.flexmark.html.HtmlRenderer.MainNodeRenderer.SubNodeRenderer, com.vladsch.flexmark.html.NodeRendererSubContext
Imports
com.vladsch.flexmark.html.HtmlRendererOptions, .HtmlWriter, com.vladsch.flexmark.util.ast.Node, com.vladsch.flexmark.util.html.Attributes, .MutableAttributes, org.jetbrains.annotations.NotNull, .Nullable

The context for node rendering, including configuration and functionality for the node renderer to use.

Method Summary

Modifier and TypeMethod and Description
public void
delegateRender()

pass node rendering to previously registered handler

public @NotNull MutableAttributes

Returns:

the extended attributes with added/updated/removed entries
extendRenderingNodeAttributes
(@NotNull AttributablePart
the tag of the node being rendered, some nodes render multiple tags with attributes
part
,
@Nullable Attributes
the attributes that were calculated by the renderer or null, these may be modified. To preserve originals pass a copy.
attributes
)

Extend the attributes by extensions for the node being currently rendered.

public @NotNull MutableAttributes

Returns:

the extended attributes with added/updated/removed entries
extendRenderingNodeAttributes
(@NotNull Node
node for which to get attributes
node
,
@NotNull AttributablePart
the tag of the node being rendered, some nodes render multiple tags with attributes
part
,
@Nullable Attributes
the attributes that were calculated by the renderer or null, these may be modified. To preserve originals pass a copy.
attributes
)

Extend the attributes by extensions for the node being currently rendered.

public @NotNull NodeRendererContext

Returns:

a new rendering context with a given appendable for its output
getDelegatedSubContext
(boolean
whether the html writer of the sub-context should inherit the current context's indentation level or start with 0 indentation
inheritIndent
)

Creates a child rendering context that can be used to collect rendered html text of the previously registered node renderer.

public @NotNull HtmlRendererOptions

Returns:

the HtmlRendererOptions for the context.
getHtmlOptions
()

public @NotNull HtmlWriter

Returns:

the HTML writer to use
getHtmlWriter
()

public @Nullable String

Returns:

id string or null
getNodeId
(@NotNull Node
node for which to get an id, depends on the HtmlIdGenerator assigned for the context. Default generator only creates ids for com.vladsch.flexmark.ast.Heading nodes or custom nodes that implement com.vladsch.flexmark.ast.AnchorRefTarget interface.
node
)

Get the id attribute for the given node.

public @NotNull RenderingPhase

Returns:

current rendering phase
getRenderingPhase
()

public @NotNull NodeRendererContext

Returns:

a new rendering context with a given appendable for its output
getSubContext
(boolean
whether the html writer of the sub-context should inherit the current context's indentation level or start with 0 indentation
inheritIndent
)

Creates a child rendering context that can be used to collect rendered html text.

Inherited from com.vladsch.flexmark.html.renderer.LinkResolverContext:
encodeUrlgetCurrentNodegetDocumentgetOptionsrenderrenderChildrenresolveLinkresolveLink

Method Detail

delegateRenderback to summary
public void delegateRender()

pass node rendering to previously registered handler

extendRenderingNodeAttributesback to summary
public @NotNull MutableAttributes extendRenderingNodeAttributes(@NotNull AttributablePart part, @Nullable Attributes attributes)

Extend the attributes by extensions for the node being currently rendered.

Parameters
part:@NotNull AttributablePart

the tag of the node being rendered, some nodes render multiple tags with attributes

attributes:@Nullable Attributes

the attributes that were calculated by the renderer or null, these may be modified. To preserve originals pass a copy.

Returns:@NotNull MutableAttributes

the extended attributes with added/updated/removed entries

Annotations
@NotNull
extendRenderingNodeAttributesback to summary
public @NotNull MutableAttributes extendRenderingNodeAttributes(@NotNull Node node, @NotNull AttributablePart part, @Nullable Attributes attributes)

Extend the attributes by extensions for the node being currently rendered.

Parameters
node:@NotNull Node

node for which to get attributes

part:@NotNull AttributablePart

the tag of the node being rendered, some nodes render multiple tags with attributes

attributes:@Nullable Attributes

the attributes that were calculated by the renderer or null, these may be modified. To preserve originals pass a copy.

Returns:@NotNull MutableAttributes

the extended attributes with added/updated/removed entries

Annotations
@NotNull
getDelegatedSubContextback to summary
public @NotNull NodeRendererContext getDelegatedSubContext(boolean inheritIndent)

Creates a child rendering context that can be used to collect rendered html text of the previously registered node renderer. The child context inherits everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.

Parameters
inheritIndent:boolean

whether the html writer of the sub-context should inherit the current context's indentation level or start with 0 indentation

Returns:@NotNull NodeRendererContext

a new rendering context with a given appendable for its output

Annotations
@NotNull
getHtmlOptionsback to summary
public @NotNull HtmlRendererOptions getHtmlOptions()
Returns:@NotNull HtmlRendererOptions

the HtmlRendererOptions for the context.

Annotations
@NotNull
getHtmlWriterback to summary
public @NotNull HtmlWriter getHtmlWriter()
Returns:@NotNull HtmlWriter

the HTML writer to use

Annotations
@NotNull
getNodeIdback to summary
public @Nullable String getNodeId(@NotNull Node node)

Get the id attribute for the given node.

Parameters
node:@NotNull Node

node for which to get an id, depends on the HtmlIdGenerator assigned for the context. Default generator only creates ids for com.vladsch.flexmark.ast.Heading nodes or custom nodes that implement com.vladsch.flexmark.ast.AnchorRefTarget interface.

Returns:@Nullable String

id string or null

Annotations
@Nullable
getRenderingPhaseback to summary
public @NotNull RenderingPhase getRenderingPhase()
Returns:@NotNull RenderingPhase

current rendering phase

Annotations
@NotNull
getSubContextback to summary
public @NotNull NodeRendererContext getSubContext(boolean inheritIndent)

Creates a child rendering context that can be used to collect rendered html text. The child context inherits everything but the HtmlRenderer, renderedNode, renderingHandler and doNotRenderLinksNesting from the parent.

Parameters
inheritIndent:boolean

whether the html writer of the sub-context should inherit the current context's indentation level or start with 0 indentation

Returns:@NotNull NodeRendererContext

a new rendering context with a given appendable for its output

Annotations
@NotNull