vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Enum HTMLOutputStyle

Determines how the generated HTML gets styled.

enum HTMLOutputStyle : int { ... }

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.

Enum members

NameDescription
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

Example

@dietTraits
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(dst.data == "<html>\n\t<body>\n\t\t<p>Hello</p>\n\t</body>\n</html>", [dst.data].to!string);
Authors
Copyright
License