MinifyHtml Class

Summary

Minifies the HTML 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["MinifyHtml"] class Type type-node

Syntax

public class MinifyHtml : MinifierBase, IModule

Examples

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

Remarks

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

Constructors

Name Summary
MinifyHtml(bool) Minifies the HTML content.

Methods

Name Value Summary
EmptyTagRenderMode(HtmlEmptyTagRenderMode) MinifyHtml
Render mode of HTML empty tag. Can take the following values:
  • NoSlash.Without slash(for example, <br>).
  • Slash.With slash(for example, <br/>).
  • SpaceAndSlash.With space and slash(for example, <br />).
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) MinifyHtml
Flag for whether to remove all HTML comments, except conditional, noindex, KnockoutJS containerless comments and AngularJS comment directives.
RemoveOptionalEndTags(bool) MinifyHtml
Flag for whether to remove optional end tags (html, head, body, p, li, dt, dd, rt, rp, optgroup, option, colgroup, thead, tfoot, tbody, tr, th and td).
RemoveTagsWithoutContent(bool) MinifyHtml
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.
WithSettings(Action<HtmlMinificationSettings>) MinifyHtml
Updates the minification settings.
GitHub