namespace Writer; using System; using System.Collections; class ImageIndexPage : Page { private String Layerinfo = new .("") ~ delete _; public this(params Span items) { this.AddHeading(3, "Abbildungsverzeichnis"); for (var i in items) AddItem(i); } public override void ComputeStyle(System.StringView className, System.String buffer) { buffer.Append(scope $""" .{className} \{ page: image-index; \} .article \{ display: flex; \} .article .item, .article .price \{ flex: 1 0 auto; \} .article .dots \{ flex: 0 1 auto; margin: 0 5px; /*Allows too long content to be hidden.*/ overflow: hidden; \} .dots::before \{ display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; content: ". . . . . . . . . . . . . . . . . . . . " ". . . . . . . . . . . . . . . . . . . . " ". . . . . . . . . . . . . . . . . . . . " ". . . . . . . . . . . . . . . . . . . . " \} """); } private void AddItem(TOCItem item) { this.[Friend]_content.Append(scope $"""
{item.Name} {item.Page}
"""); } }