<commit_before>'use strict'
const utils = require('loader-utils');
const pug = require('pug');

module.exports = function (source) {
    this.cacheable && this.cacheable(true);

    // get config
    let config = utils.getOptions(this);

    // fill out anything else needed in the config
    config.filename = this.resourcePath
    config.doctype = config.doctype || "html"
    config.compileDebug = config.compileDebug || false
    config.debug = config.debug || false
    config.pretty = config.pretty || false
    config.self = config.self || false
    config.cache = config.cache || false

    config.basedir = config.locals.basedir

    if (config.vue) (
        config.locals = Object.assign(
            config.locals,
            require("./plugins/django")(config.localConfig, config.locals)
        )
    )

    if (config.markdown) {
        config.locals.markdown = require("./plugins/markdown")
    }

    if (config.vefa) {
        config.locals = Object.assign(
            config.locals,
            {
                Vefa: require('vefa'),
                vefa: {},
                vefari: new Map()
            }
        )
    }

    let context = {
        context: config.context,
        content: source.content ? source.content : source
    }<commit_msg>add markdown filter for non-vue driven templating<commit_after>'use strict'
const utils = require('loader-utils');
const pug = require('pug');

module.exports = function (source) {
    this.cacheable && this.cacheable(true);

    // get config
    let config = utils.getOptions(this);

    // fill out anything else needed in the config
    config.filename = this.resourcePath
    config.doctype = config.doctype || "html"
    config.compileDebug = config.compileDebug || false
    config.debug = config.debug || false
    config.pretty = config.pretty || false
    config.self = config.self || false
    config.cache = config.cache || false

    config.basedir = config.locals.basedir

    if (config.vue) (
        config.locals = Object.assign(
            config.locals,
            require("./plugins/django")(config.localConfig, config.locals)
        )
    )

    if (config.markdown) {
        config.locals.markdown = require("./plugins/markdown")
    }
    if (config.markdown && !config.vue) {
        config.filters.markdown = require("./plugins/markdown")
    }

    if (config.vefa) {
        config.locals = Object.assign(
            config.locals,
            {
                Vefa: require('vefa'),
                vefa: {},
                vefari: new Map()
            }
        )
    }

    let context = {
        context: config.context,
        content: source.content ? source.content : source
    }
{'fraction_non_alphanumeric': 0.12213175425610659, 'fraction_numerical': 0.0, 'mean_word_length': 2.085616438356164, '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': '992373', 'n_tokens_mistral': 794, 'n_tokens_neox': 760, 'n_words': 167}