module

ContributorMural::SVG

Class methods

document(width : Int | Float64, height : Int | Float64, & : String::Builder -> ) : String
Source
escape(value : String) : String

Everything a person is named, labelled or grouped by reaches the document through here, so this is where it has to be made safe to put in one.

HTML.escape handles the markup, and leaves control characters alone — they are legal in HTML. XML allows exactly three of them (tab, newline, carriage return) and no parser will read a document carrying any of the others, so one stray byte in a display name does not garble a label, it costs the whole file: the run still exits 0 and still commits, and the mural renders as nothing at all.

Dropped rather than reported, because the name is not always the user's to correct — an API-sourced display name never passes through config validation, which is also why this cannot live there.

Source
num(value : Float64) : String

Formats a coordinate with at most two decimals and no trailing zeros, keeping output compact and golden files stable.

Source
num(value : Int) : String
Source