MinifyXhtml Class

Summary

Minifies the XHTML content.
Assembly
Wyam.Minification.dll
Namespace
Wyam.Minification
Interfaces
Base Types
graph BT Type-->Base0["MinifierBase"] click Base0 "/api/Wyam.Minification/MinifierBase" Base0-->Base1["Object"] Type-.->Interface0["IModule"] click Interface0 "/api/Wyam.Common.Modules/IModule" Type["MinifyXhtml"] class Type type-node

Syntax

public class MinifyXhtml : MinifierBase, IModule

Examples

Pipelines.Add("Content",
    ReadFiles("*.md"),
    FrontMatter(Yaml()),
    Markdown(),
    Razor(),
    MinifyXhtml(),
    WriteFiles(".html")
);

Remarks

This module takes the XHTML content and uses minification to reduce the output.

Constructors

Name Summary
MinifyXhtml(bool) Minifies the XHTML content.

Methods

Name Value Summary
Execute(IReadOnlyList<IDocument>, IExecutionContext) IEnumerable<IDocument>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Minify(IReadOnlyList<IDocument>, IExecutionContext, Func<string, MinificationResultBase>, string) IEnumerable<IDocument>
Inherited from MinifierBase
RemoveHtmlComments(bool) MinifyXhtml
Flag for whether to remove all HTML comments, except conditional, noindex, KnockoutJS containerless comments and AngularJS comment directives.
RemoveTagsWithoutContent(bool) MinifyXhtml
Flag for whether to remove tags without content, except for textarea, tr, th and td tags, and tags with class, id, name, role, src and data-* attributes.
RenderEmptyTagsWithSpace(bool) MinifyXhtml
Flag for whether to allow the inserting space before slash in empty tags (for example, true -
; false -
).
WithSettings(Action<XhtmlMinificationSettings>) MinifyXhtml
Updates the minification settings.
GitHub