Skip Navigation
Type MethodMethod

referenceMarkup(for:additionalClass:)

Builds the icon of a topic type like markup(for:additionalClass:), but referring to a drawing defined once in the document.

static func referenceMarkup(
    for type: String,
    additionalClass: String = ""
) -> String

Parameters

type

A type name; it is normalised with normalisedType(_:).

additionalClass

Further classes of the wrapper, such as navigator-icon.

Return Value

A <span> with the class className holding the referring icon.

Discussion

The icon keeps the wrapper and the classes of swift-docc-render’s icon, whose size the stylesheet sets, and draws its content with a <use> element that refers to the drawing symbolDefinitions(for:additionalDrawings:) defines for the type, with the icon’s view box. A document that lists many topics then holds each drawing only once.