code: func NewTemplate(s string) *Graph {
  	p := NewParser(bytes.NewBuffer([]byte(s)))
  	p.Template()
  
  	t := p.Graph()
  	t.This = TypeTemplate
  
  	t.ast()
  	t.simplify()
  	t.flow()
  
  	return t
  }
docs: // NewTemplate parses a text template given as a string and converts it to a Graph.
  // Templates have fixed and variable parts. Variables all begin with '$'.
  //
  // A template is a text file in any format: plain text, HTML, XML, OGDL or
  // whatever. The dolar sign acts as an escape character that switches from the
  // text to the variable plane. Parsed templates are converted back to text
  // by evaluating the variable parts against a Graph object, by means of the
  // Process() method.
  //
  // Template grammar
  //
  //     template ::= ( text | variable )*
  //
  //     variable ::= ('$' path) | ('$' '(' expression ')') | ('$' '{' expression '}')
  //     path ::= as defined in path.go
  //     expression ::= as defined in expression.go
  //
  // Some variables act as directives: $if, $else, $end, $for, $break.
  //
  //    $if(expression)
  //    $else
  //    $end
  //
  //    $for(destPath,sourcepath)
  //      $break
  //    $end
  //