vibe.d beta banner
get vibe.d

Enum HTMLOutputStyle

Determines how the generated HTML gets styled.

To use this, put an enum field named htmlOutputStyle into a diet traits struct and pass that to the render function.

The default output style is compact.

The enum base type is int .

Enum members

Name Description
compact Outputs no extraneous whitespace (including line breaks) around HTML tags
pretty Inserts line breaks and indents lines according to their nesting level in the HTML structure


struct Traits {
	enum htmlOutputStyle = HTMLOutputStyle.pretty;

import std.array : appender;
auto dst = appender!string();
dst.compileHTMLDietString!("html\n\tbody\n\t\tp Hello", Traits);
import std.conv : to;
assert( == "<html>\n\t<body>\n\t\t<p>Hello</p>\n\t</body>\n</html>", [].to!string);