parseDiet

Parses a Diet template document and outputs the resulting DOM tree.

The overload that takes a list of files will automatically resolve includes and extensions.

  1. Document parseDiet(string text, string filename)
    nothrow
    parseDiet
    ()
    (
    string text
    ,
    string filename = "string"
    )
    if (
    is(typeof(TR(string.init)) == string) ||
    is(typeof(TR(string.init, string.init)) == string)
    )
  2. Document parseDiet(F files)

Parameters

TR

An optional translation function that takes and returns a string. This function will be invoked whenever node text contents need to be translated at compile tile (for the & node suffix).

text string

For the single-file overload, specifies the contents of the Diet template.

filename string

For the single-file overload, specifies the file name that is displayed in error messages and stored in the DOM Locations.

Return Value

Type: Document

The list of parsed root nodes is returned.

Meta