VdomSpectreTranslator

Class

Static helper methods for translating VNodes to Spectre.Console renderables.

Namespace: RazorConsole.Core.Rendering.Vdom
Assembly: RazorConsole.Core

Definition

public static class VdomSpectreTranslator

Methods

15
NameTypeDescription
CollectInnerText(VNode)()StringCollects all inner text content from a VNode and its children.
ComposeChildContent(IReadOnlyList<IRenderable>)()IRenderableComposes multiple child renderables into a single renderable.
EnumerateClassNames(string?)()IEnumerable<String>Enumerates class names from a space-separated class attribute value.
GetAttribute(VNode, string)()StringGets an attribute value from a VNode.
HasClass(VNode, string)()BooleanChecks if a VNode has a specific CSS class.
NormalizeTextNode(string?)()NormalizedTextNormalizes a text node by trimming whitespace and collapsing multiple spaces.
ParseHorizontalAlignment(string?)()HorizontalAlignmentParses a horizontal alignment value from a string.
ParseOptionalPositiveInt(string?)()Nullable<Int32>Parses an optional positive integer from a string.
ParseVerticalAlignment(string?)()VerticalAlignmentParses a vertical alignment value from a string.
ShouldBeBlock(VNode)()BooleanDetermines if a VNode should be rendered as a block element.
TryGetBoolAttribute(VNode, string, out bool)()BooleanTries to get a boolean attribute value from a VNode.
TryGetIntAttribute(VNode, string, int)()Int32Tries to get an integer attribute value from a VNode.
TryParsePadding(string?, out Padding?)()BooleanTries to parse a padding value from a string.
TryParsePositiveDouble(string?, out double)()BooleanTries to parse a positive double from a string.
TryParsePositiveInt(string?, out int)()BooleanTries to parse a positive integer from a string.