handlebars/src/main/java/com/github/jknack/handlebars/helper/PrecompileHelper.java
public void registerTemplate(final StringBuilder buffer, final String name,
        final String function) {
      buffer.append("\n  var template = Handlebars.template(").append(function).append(");\n");
      String[] namespaces = {"templates", "partials"};
      String separator = ";\n";
      for (String namespace : namespaces) {
        buffer.append("  var ").append(namespace).append(" = Handlebars.").append(namespace)
            .append(" = Handlebars.").append(namespace).append(" || {};\n");
        buffer.append("  ").append(namespace).append("['").append(name).append("'] = template")
            .append(separator);
      }
    }
/**
     * Register a template function.
     *
     * @param buffer The returning buffer.
     * @param name The template's name.
     * @param function The JavaScript function.
     */
Register a template function.
@param buffer The returning buffer.
@param name The template's name.
@param function The JavaScript function.
Register a template function . @param buffer The returning buffer . @param name The template ' s name . @param function The JavaScript function .
public void registerTemplate(final StringBuilder buffer, final String name,
        final String function) {
      buffer.append("\n  var template = Handlebars.template(").append(function).append(");\n");
      String[] namespaces = {"templates", "partials"};
      String separator = ";\n";
      for (String namespace : namespaces) {
        buffer.append("  var ").append(namespace).append(" = Handlebars.").append(namespace)
            .append(" = Handlebars.").append(namespace).append(" || {};\n");
        buffer.append("  ").append(namespace).append("['").append(name).append("'] = template")
            .append(separator);
      }
    }
public void registerTemplate ( final StringBuilder buffer , final String name , final String function ) { buffer . append ( "\n  var template = Handlebars.template(" ) . append ( function ) . append ( ");\n" ) ; String [ ] namespaces = { "templates" , "partials" } ; String separator = ";\n" ; for ( String namespace : namespaces ) { buffer . append ( "  var " ) . append ( namespace ) . append ( " = Handlebars." ) . append ( namespace ) . append ( " = Handlebars." ) . append ( namespace ) . append ( " || {};\n" ) ; buffer . append ( "  " ) . append ( namespace ) . append ( "['" ) . append ( name ) . append ( "'] = template" ) . append ( separator ) ; } }
Register a template function.
Register a template function .