Skip Navigation
Type MethodMethod

anchor(for:)

Returns the anchor of a chapter or section title, as swift-docc-render forms it.

static func anchor(for title: String) -> String

Parameters

title

The title to form an anchor for.

Return Value

The anchor, without a leading #.

Discussion

White space and the characters `, ", < and > become dashes, leading dashes are removed and the result is lowercased.