docs: function compile(tmpl, conf) {
    let str = tmpl || '';
    const c = Object.assign({}, settings, conf);
    const blocks = {};
  
    str = str
      // allow the use of ' in the body
      .replace(/'/g, '\\\'')
  
      // handle block def
      .replace(c.blockDef, (m, name, argStr, body) => {
        blocks[name] = {
          args: argStr.split(',').map(a => a.trim()),
          body,
        };
        return '';
      })
  
      // handle block call
      .replace(c.block, handleBlockCall(c, blocks))
  
      // convert models
      .replace(c.interpolate, (m, code) => `';out+=${jsValue(code)};out+='`)
  
      // raw js
      .replace(c.evaluate, (m, code) => `';${jsValue(code)}out+='`);
  
    // build the template function body
    str = `var out='${str}';return out;`
      // remove the newlines or '' will break
      .replace(/\r/g, '\\r')
      .replace(/\n/g, '\\n')
      .replace(/\t/g, '\\t')
      .replace(/(\s|;|\}|^|\{)out\+='';/g, '$1')
      .replace(/\+''/g, '');
  
    return new Function(c.varname, str); // eslint-disable-line
  }