def __init__(
        self,
        template_root,
        template_name,
        js_module_format=None,
        runtime_path="jinja-to-js",
        include_prefix="",
        include_ext="",
        child_blocks=None,
        dependencies=None,
        custom_filters=None,
    ):
        """
        Args:
            template_root (str): The path to where templates should be loaded from.
            template_name (str): The name of the template to compile (relative to `template_root`).
            js_module_format (str, optional): The JavaScript module format to use.
                                              One of ('amd', 'commonjs', 'es6')
            runtime_path (str, optional): If `js_module_format` is specified then the JavaScript
                                          runtime will be imported using the appropriate method.
                                          It defaults to assuming it will be imported from
                                          `node_modules` but you can change it using this option.
            include_prefix (str, optional): If using the `amd` module format you can use this option
                                            to add a prefix to every include path as AMD imports are
                                            generally relative to the main file, not the module
                                            importing.
            include_ext (str, optional): By default any includes will be references without an
                                         extension, as neither AMD, commonJS or ES6 require the
                                         '.js' extension. If you want to use an extension, say
                                         '.template' then set this option to a string including
                                         the leading '.'
            child_blocks (dict, optional): Used internally when handling templates that extend
                                           other templates.
            dependencies (list of tuple, optional): Used internally when handling templates that
                                                    extend other templates.
            custom_filters (list of str, optional): List of custom filters which should be allowed.
                                                    These may be filters supported by Jinja but not
                                                    supported by jinja-to-js. These filters MUST be
                                                    registered with the jinja-to-js JS runtime.
        """

        self.environment = Environment(
            loader=FileSystemLoader(template_root),
            autoescape=True,
        )
        self.output = StringIO()
        self.stored_names = set()
        self.temp_var_names = temp_var_names_generator()
        self.state = STATE_DEFAULT
        self.child_blocks = child_blocks or {}
        self.dependencies = dependencies or []
        self._runtime_function_cache = []
        self.js_module_format = js_module_format
        self.runtime_path = runtime_path
        self.include_prefix = include_prefix
        self.include_ext = include_ext
        self.template_root = template_root
        self.template_name = template_name
        self.custom_filters = custom_filters or []

        # The name of the JavaScript function that will output this template. By using a named
        # function the template can call itself which is required to support recursive includes.
        self.js_function_name = "template" + "".join(
            x.title()
            for x in re.split(r"[^\w]|_", path.splitext(self.template_name)[0])
        )

        self.context_name = "context"

        self._add_dependency(self.runtime_path, "jinjaToJS")

        # Jinja2 doesn't accept Windows filepaths
        if os.name == "nt":
            self.template_name = self.template_name.replace(os.pathsep, "/")

        template_string, template_path, _ = self.environment.loader.get_source(
            self.environment, self.template_name
        )

        # It is assumed that this will be the absolute path to the template. It is used to work out
        # related paths for inclues.
        self.template_path = template_path

        if self.js_module_format not in JS_MODULE_FORMATS.keys():
            raise ValueError(
                "The js_module_format option must be one of: %s"
                % JS_MODULE_FORMATS.keys()
            )

        self.ast = self.environment.parse(template_string)

        try:
            for node in self.ast.body:
                self._process_node(node)
        except ExtendsException:
            pass

        Args:
            template_root (str): The path to where templates should be loaded from.
            template_name (str): The name of the template to compile (relative to `template_root`).
            js_module_format (str, optional): The JavaScript module format to use.
                                              One of ('amd', 'commonjs', 'es6')
            runtime_path (str, optional): If `js_module_format` is specified then the JavaScript
                                          runtime will be imported using the appropriate method.
                                          It defaults to assuming it will be imported from
                                          `node_modules` but you can change it using this option.
            include_prefix (str, optional): If using the `amd` module format you can use this option
                                            to add a prefix to every include path as AMD imports are
                                            generally relative to the main file, not the module
                                            importing.
            include_ext (str, optional): By default any includes will be references without an
                                         extension, as neither AMD, commonJS or ES6 require the
                                         '.js' extension. If you want to use an extension, say
                                         '.template' then set this option to a string including
                                         the leading '.'
            child_blocks (dict, optional): Used internally when handling templates that extend
                                           other templates.
            dependencies (list of tuple, optional): Used internally when handling templates that
                                                    extend other templates.
            custom_filters (list of str, optional): List of custom filters which should be allowed.
                                                    These may be filters supported by Jinja but not
                                                    supported by jinja-to-js. These filters MUST be
                                                    registered with the jinja-to-js JS runtime.
        
website/setup/jinja_to_js.py