Class FormatExtensions
- Namespace
- AngleSharp
- Assembly
- AngleSharp.dll
Extensions for formatting, e.g., markup or styling.
public static class FormatExtensions
- Inheritance
-
FormatExtensions
- Inherited Members
Methods
Minify(IMarkupFormattable)
Returns a minified serialization of the node guided by the MinifyMarkupFormatter with the default options.
public static string Minify(this IMarkupFormattable markup)
Parameters
markup
IMarkupFormattableThe markup node to format.
Returns
- string
The source code snippet.
Prettify(IMarkupFormattable)
Returns a prettified serialization of the node guided by the PrettyMarkupFormatter with the default options.
public static string Prettify(this IMarkupFormattable markup)
Parameters
markup
IMarkupFormattableThe markup node to format.
Returns
- string
The source code snippet.
ToCss(IStyleFormattable)
Returns the (complete) CSS style representation of the node.
public static string ToCss(this IStyleFormattable style)
Parameters
style
IStyleFormattableThe style node to format.
Returns
- string
The source code snippet.
ToCss(IStyleFormattable, IStyleFormatter)
Returns the (complete) CSS style representation of the node.
public static string ToCss(this IStyleFormattable style, IStyleFormatter formatter)
Parameters
style
IStyleFormattableThe style node to format.
formatter
IStyleFormatterThe formatter to use.
Returns
- string
The source code snippet.
ToCss(IStyleFormattable, TextWriter)
Writes the serialization of the node guided by the formatter.
public static void ToCss(this IStyleFormattable style, TextWriter writer)
Parameters
style
IStyleFormattableThe style node to format.
writer
TextWriterThe output target of the serialization.
ToCssAsync(IStyleFormattable, Stream)
Writes the serialization of the node guided by the formatter to the given stream.
public static Task ToCssAsync(this IStyleFormattable style, Stream stream)
Parameters
style
IStyleFormattableThe style node to format.
stream
StreamThe output stream to use.
Returns
ToCssAsync(IStyleFormattable, TextWriter)
Writes the serialization of the node guided by the formatter.
public static Task ToCssAsync(this IStyleFormattable style, TextWriter writer)
Parameters
style
IStyleFormattableThe style node to format.
writer
TextWriterThe output target of the serialization.
Returns
ToHtml(IMarkupFormattable)
Returns the (complete) HTML markup representation of the node.
public static string ToHtml(this IMarkupFormattable markup)
Parameters
markup
IMarkupFormattableThe markup node to format.
Returns
- string
The source code snippet.
ToHtml(IMarkupFormattable, IMarkupFormatter)
Returns the serialization of the node guided by the formatter.
public static string ToHtml(this IMarkupFormattable markup, IMarkupFormatter formatter)
Parameters
markup
IMarkupFormattableThe markup node to format.
formatter
IMarkupFormatterThe formatter to use.
Returns
- string
The source code snippet.
ToHtml(IMarkupFormattable, TextWriter)
Writes the serialization of the node guided by the formatter.
public static void ToHtml(this IMarkupFormattable markup, TextWriter writer)
Parameters
markup
IMarkupFormattableThe markup node to format.
writer
TextWriterThe output target of the serialization.
ToHtmlAsync(IMarkupFormattable, Stream)
Writes the serialization of the node guided by the formatter to the given stream.
public static Task ToHtmlAsync(this IMarkupFormattable markup, Stream stream)
Parameters
markup
IMarkupFormattableThe markup node to format.
stream
StreamThe output stream to use.
Returns
ToHtmlAsync(IMarkupFormattable, TextWriter)
Writes the serialization of the node guided by the formatter.
public static Task ToHtmlAsync(this IMarkupFormattable markup, TextWriter writer)
Parameters
markup
IMarkupFormattableThe markup node to format.
writer
TextWriterThe output target of the serialization.