
The tag name can also be completely omitted, in which case a is assumed.Īfter each tag, an id, multiple class names, and a list of attributes can follow. Tags with no content such as or are recognized and output accordingly. Every element that does not have a special meaning and begins with a letter and contains only letters, numbers, colons, dashes or underscores is treated as an HTML tag. This restriction will be removed in the future.Įxample: A minimal HTML page Content elements HTML elements Right now, it is necessary to begin the document with an HTML 5 header.

Note that indentation levels may never be skipped, so that the first indented line must always be indented by exactly one tab stop. The indentation style is inferred from the first line that is indented. The indentation style of a document is enforced to be consistent and can either be tabs or any number of spaces. The general structure uses indentation to manage nesting of HTML tags, similar to what Python does. The main difference is that you write D expressions and statements instead of JavaScript. Since there is no official syntax reference written yet, you can use the

The syntax equals that of Pugtemplates with the exception of some of the advanced syntax features. Dynamic pages thus have almost no runtime overhead and are often even faster than static pages on disk, because they are just written directly from RAM to the HTTP connection. This document is work-in-progress - please use the Pug documentation for any section that is not filled with content, Diet templates are kept as compatible as possible to Pug templates.ĭiet templates are HTML templates which are statically compiled down to native D code. An updated version of the specification is located in SPEC.md of the GitHub repository. Note that the original implementation of Diet templates has been superseded by the DietNG package, which supports a number of additional features.
