<commit_before># -*- coding: utf-8 -*-
"""
    Folio is an static website generator using jinja2 template engine.
"""

import os
import shutil
import fnmatch

from jinja2 import Environment, FileSystemLoader

from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

def log(message):
    print(' * %s' % (message, ))

class Folio(object):
    def __init__(self, build_path='build', template_path='templates',
                 static_path='static', encoding='utf-8'):
        self.build_path = os.path.abspath(build_path)
        self.template_path = os.path.abspath(template_path)
        self.static_path = os.path.abspath(static_path)
        self.encoding = encoding

        loader = FileSystemLoader(searchpath=template_path)

        self.contexts = {}
        self.builders = [('*.html', _default_builder)]
        self.env = Environment(loader=loader)

    def _remove_build(self):
        if os.path.exists(self.build_path):
            for path, dirs, files in os.walk(self.build_path, topdown=False):
                for file in files:
                    os.remove(os.path.join(path, file))
                os.rmdir(path)

    def watch(self):
        def wrapper(folio):
            def handler(self, event):
                if not event.is_directory:<commit_msg>Add jinja2 extensions parameter to Folio.<commit_after># -*- coding: utf-8 -*-
"""
    Folio is an static website generator using jinja2 template engine.
"""

import os
import shutil
import fnmatch

from jinja2 import Environment, FileSystemLoader

from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

def log(message):
    print(' * %s' % (message, ))

class Folio(object):
    def __init__(self, build_path='build', template_path='templates',
                 static_path='static', encoding='utf-8', extensions=None):
        if extensions is None:
            extensions = []

        self.build_path = os.path.abspath(build_path)
        self.template_path = os.path.abspath(template_path)
        self.static_path = os.path.abspath(static_path)
        self.encoding = encoding

        loader = FileSystemLoader(searchpath=template_path)

        self.contexts = {}
        self.builders = [('*.html', _default_builder)]
        self.env = Environment(loader=loader, extensions=extensions)

    def _remove_build(self):
        if os.path.exists(self.build_path):
            for path, dirs, files in os.walk(self.build_path, topdown=False):
                for file in files:
                    os.remove(os.path.join(path, file))
                os.rmdir(path)

    def watch(self):
        def wrapper(folio):
            def handler(self, event):
                if not event.is_directory:
{'fraction_non_alphanumeric': 0.108, 'fraction_numerical': 0.0032727272727272726, 'mean_word_length': 2.682730923694779, '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': '2662458', 'n_tokens_mistral': 805, 'n_tokens_neox': 786, 'n_words': 189}