/// <summary> /// Generates a <c><p></c> block containing the given markup, adding the given id /// and CSS class attributes to the <c><p></c> and setting its key, if provided. /// </summary> /// <remarks> /// Note: This block is automatically closed, so calling /// <see cref="FluentRenderTreeBuilder.Close(bool, int)">Close(...)</see> is unnecessary. /// </remarks> /// <param name="frtb">The <see cref="FluentRenderTreeBuilder"/>.</param> /// <param name="markup">The markup content to add in the block.</param> /// <param name="class">The optional CSS class name.</param> /// <param name="id">The optional id attribute value.</param> /// <param name="key">The optional key to set for this element.</param> /// <param name="paragraphPrettyPrint"><c>false</c> to prevent insertion of newline and /// indent whitespace before the markup for this element, even if /// <see cref="FluentRenderTreeBuilder.PrettyPrinting"/> is enabled.</param> /// <param name="markupPrettyPrint"><c>true</c> to insert newline and indent whitespace /// before the markup, as long as <see cref="FluentRenderTreeBuilder.PrettyPrinting"/> is /// enabled.</param> /// <param name="line">The source code line number used to generate the sequence number.</param> public static FluentRenderTreeBuilder P(this FluentRenderTreeBuilder frtb, object markup, string? @class = null, string?id = null, object?key = null, bool paragraphPrettyPrint = true, bool markupPrettyPrint = false, [CallerLineNumber] int line = 0) => frtb.Element("p", markup, @class, id, key, paragraphPrettyPrint && !markupPrettyPrint ? null : (bool?)paragraphPrettyPrint, line);
/// <summary> /// Generates a <c><td></c> block containing the given markup, adding the given CSS /// class attribute, and setting the key, if provided. /// </summary> /// <param name="frtb">The <see cref="FluentRenderTreeBuilder"/>.</param> /// <param name="markup">The markup content to add in the <c><td></c> block.</param> /// <param name="class">The optional CSS class name.</param> /// <param name="key">The optional key to set for this table cell.</param> /// <param name="line">The source code line number used to generate the sequence number.</param> public static FluentRenderTreeBuilder Cell(this FluentRenderTreeBuilder frtb, object markup, string? @class = null, object?key = null, [CallerLineNumber] int line = 0) => frtb.Element("td", markup, @class, key: key, line: line);
/// <summary> /// Generates a heading block containing the given markup, adding the given id and CSS /// class attributes to the heading, if provided. /// </summary> /// <remarks> /// Note: This block is automatically closed, so calling /// <see cref="FluentRenderTreeBuilder.Close(bool, int)">Close(...)</see> is unnecessary. /// </remarks> /// <param name="frtb">The <see cref="FluentRenderTreeBuilder"/>.</param> /// <param name="level">The heading level, e.g. <c>1</c>, <c>2</c>, <c>3</c>, etc.</param> /// <param name="markup">The markup content to add in the heading block.</param> /// <param name="class">The optional CSS class name.</param> /// <param name="id">The optional id attribute value.</param> /// <param name="line">The source code line number used to generate the sequence number.</param> public static FluentRenderTreeBuilder Heading(this FluentRenderTreeBuilder frtb, int level, object markup, string? @class = null, string?id = null, [CallerLineNumber] int line = 0) => frtb.Element($"h{level}", markup, @class, id, line: line);
/// <summary> /// Generates a <c><div></c> block containing the given markup, adding the given id /// and CSS class attributes to the <c><div></c> and setting its key, if provided. /// </summary> /// <param name="frtb">The <see cref="FluentRenderTreeBuilder"/>.</param> /// <param name="markup">The markup content to add in the <c><div></c> block.</param> /// <param name="class">The optional CSS class name.</param> /// <param name="id">The optional id attribute value.</param> /// <param name="key">The optional key to set for this element.</param> /// <param name="prettyPrint"><c>false</c> to prevent insertion of newline and indent /// whitespace before the markup for this element, even if /// <see cref="FluentRenderTreeBuilder.PrettyPrinting"/> is enabled.</param> /// <param name="line">The source code line number used to generate the sequence number.</param> public static FluentRenderTreeBuilder Div(this FluentRenderTreeBuilder frtb, object markup, string? @class = null, string?id = null, object?key = null, bool prettyPrint = true, [CallerLineNumber] int line = 0) => frtb.Element("div", markup, @class, id, key, prettyPrint, line);