<commit_before>// LICENSE : MIT
"use strict";
require(['gitbook'], function (gitbook) {
    function addBeforeHeader(element) {
        jQuery('.book-header > h1').before(element)
    }

    function createButton({
        user,
        repo,
        type,
        size,
        count
        }) {
        var width = size === "large" ? "170px" : "160xp";
        var height = size === "large" ? "30" : "20xp";
        var extraParam = type === "watch" ? "&v=2" : "";
        return `<iframe src="https://ghbtns.com/github-btn.html?user=${user}&repo=${repo}&type=${type}&count=${count}&size=${size}${extraParam}" frameborder="0" scrolling="0" width="${width}" height="${height}"></iframe>`;
    }


    function insertGitHubLink({
        user,
        repo,
        types,
        size,
        count
        }) {
        types.reverse().forEach(type => {
            var elementString = createButton({
                user,
                repo,
                type,
                size,
                count
            });
            addBeforeHeader(elementString);
        });
    }

    function init(config) {
        var repoPath = config.github.repo;
        var [user, repo] = repoPath.split("/");
        if (repoPath == null) {
            console.log("Should set github.repo");
            return;
        }
        var types = config.github.types || ["star", "watch"];
        var size = config.github.size || "large";
        var count = typeof config.github.count === "undefined" ? "true" : "false";
        insertGitHubLink({
            user,
            repo,
            types,
            size,
            count
        });
    }

    // injected by html hook
    function getPluginConfig() {
        return window["gitbook-plugin-github-buttons"];
    }

    gitbook.events.bind('page.change', function () {
        init(getPluginConfig());
    });
});
<commit_msg>fix config path<commit_after>// LICENSE : MIT
"use strict";
require(['gitbook'], function (gitbook) {
    function addBeforeHeader(element) {
        jQuery('.book-header > h1').before(element)
    }

    function createButton({
        user,
        repo,
        type,
        size,
        count
        }) {
        var width = size === "large" ? "170px" : "160xp";
        var height = size === "large" ? "30" : "20xp";
        var extraParam = type === "watch" ? "&v=2" : "";
        return `<iframe src="https://ghbtns.com/github-btn.html?user=${user}&repo=${repo}&type=${type}&count=${count}&size=${size}${extraParam}" frameborder="0" scrolling="0" width="${width}" height="${height}"></iframe>`;
    }


    function insertGitHubLink({
        user,
        repo,
        types,
        size,
        count
        }) {
        types.reverse().forEach(type => {
            var elementString = createButton({
                user,
                repo,
                type,
                size,
                count
            });
            addBeforeHeader(elementString);
        });
    }

    function init(config) {
        var repoPath = config.repo;
        var [user, repo] = repoPath.split("/");
        if (repoPath == null) {
            console.log("Should set github.repo");
            return;
        }
        var types = config.types || ["star", "watch"];
        var size = config.size || "large";
        var count = typeof config.count === "undefined" ? "true" : "false";
        insertGitHubLink({
            user,
            repo,
            types,
            size,
            count
        });
    }

    // injected by html hook
    function getPluginConfig() {
        return window["gitbook-plugin-github-buttons"];
    }

    gitbook.events.bind('page.change', function () {
        init(getPluginConfig());
    });
});

{'fraction_non_alphanumeric': 0.15540180947312401, 'fraction_numerical': 0.007450771687067589, 'mean_word_length': 1.7140794223826714, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '7097944', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1024, 'n_words': 220}