<commit_before>package xitrum.view

import xitrum.Controller
import xitrum.controller.Action

trait TemplateEngine {
  def renderTemplate(
    controller: Controller, action: Action,
    controllerName: String, actionName: String,
    options: Map[String, Any]
  ): String

  def renderTemplate(
    controller: Controller, controllerClass: Class[_],
    options: Map[String, Any]
  ): String

  def renderFragment(
    controller: Controller, controllerClass: Class[_], fragment: String,<commit_msg>Add doc for TemplateEngine<commit_after>package xitrum.view

import xitrum.Controller
import xitrum.controller.Action

/** Template engines should extend this trait and implement its methods. */
trait TemplateEngine {
  /** Renders the template associated with the action of the controller. */
  def renderTemplate(
    controller: Controller, action: Action,
    controllerName: String, actionName: String,
    options: Map[String, Any]
  ): String

  /** Renders the template associated with the controller. */
  def renderTemplate(
    controller: Controller, controllerClass: Class[_],
    options: Map[String, Any]
  ): String

  /** Renders the template fragment associated with the controller. */
  def renderFragment(
    controller: Controller, controllerClass: Class[_], fragment: String,
{'fraction_non_alphanumeric': 0.08782742681047766, 'fraction_numerical': 0.0, 'mean_word_length': 4.575107296137339, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3130711', 'n_tokens_mistral': 332, 'n_tokens_neox': 329, 'n_words': 117}