<commit_before>from os import sep as path_separator

import sass


class SassRenderer(object):
    def __init__(self, include_path):
        self.include_path = include_path
        if not include_path.endswith(path_separator):
            self.include_path += path_separator

    def render(self, source):
        # Chop of the include path and replace the file extension
        destination = source[len(self.include_path):-4] + 'css'
        return destination, sass.compile(filename=source).encode('UTF-8')


def register(context, plugin_config):
    sass_extensions = ['sass', 'scss']
    sass_renderer = SassRenderer(context.config.folders['include'])
    context.includer.add(sass_extensions, sass_renderer.render)
<commit_msg>Converted the plugin back to be a content renderer plugin again<commit_after>import sass


def render_sass(raw_content):
    return sass.compile(string=raw_content)


def register(context, plugin_config):
    sass_extensions = ['sass', 'scss']
    context.content_renderer.add_renderer(sass_extensions, render_sass)

{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.0019047619047619048, 'mean_word_length': 4.473958333333333, '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': '2323076', 'n_tokens_mistral': 320, 'n_tokens_neox': 314, 'n_words': 73}