HtmlRendererHelper

Helper providing shared HTML-building utilities for HTML renderers.

Parameters

renderer

renderer this helper builds tags for

context

additional information produced by the earlier stages of the pipeline

Constructors

Link copied to clipboard
constructor(renderer: BaseHtmlNodeRenderer, context: Context)

Functions

Link copied to clipboard
fun <T : CaptionableNode, LocationTrackableNode, LocalizedKind> captionedContent(builder: HtmlTagBuilder, node: T, positionProvider: CaptionPositionInfo.() -> CaptionPosition?, captionTagName: String = "figcaption", content: HtmlTagBuilder.() -> Unit): HtmlTagBuilder

Appends the given content along with the numbered caption of node (via numberedCaption), ordered according to the caption position.

Link copied to clipboard
fun <T : CaptionableNode, LocationTrackableNode, LocalizedKind> numberedCaption(builder: HtmlTagBuilder, node: T, position: CaptionPosition, captionTagName: String = "figcaption", idPrefix: String = node.kindLocalizationKey): HtmlTagBuilder

Retrieves the location-based label of the node, displays an optional caption preceded by the label, and also applies the label as its ID. The label is pre-formatted according to the current NumberingFormat.

Link copied to clipboard

Resolves the position of a caption, falling back to the document's default position.

Link copied to clipboard

Adds a data-localized-kind attribute to the localizable node. The kind name is localized according to the current locale.

Link copied to clipboard

Adds a data-location attribute to the location-trackable node, if its location is available. The location is formatted according to the current NumberingFormat.