<commit_before>/* Inserts Anchors and Link Elements for internal page navigation */

function initPageNav(list, selector, offset) {
    var idx = 0;
    var navId = $(list).parent('div, nav').attr('id');
    $(selector).each(function() {
       var tokens = ($(this).html().trim() || '').replace(/[-\s,.;]+/,'-').split('-');
       var name = tokens[0];
       if(tokens.length == 0 || name == '') { return; }
       if(tokens.length == 2) {
           name = tokens[0] + ' ' + tokens[1];
       }
       var id = idx++;
       var newLink = document.createElement('a');
       $(newLink).attr('href', '#section' + id);
       $(newLink).attr('id', 'goto-section' + id);
       newLink.innerHTML = name;
       var listItem = document.createElement('li');
       $(listItem).append(newLink);
       $(list).append(listItem);<commit_msg>smint navigation is created using hash references on current page href<commit_after>/* Inserts Anchors and Link Elements for internal page navigation */

function initPageNav(list, selector, offset) {
    var idx = 0;
    var navId = $(list).parent('div, nav').attr('id');
    $(selector).each(function() {
       var tokens = ($(this).html().trim() || '').replace(/[-\s,.;]+/,'-').split('-');
       var name = tokens[0];
       if(tokens.length == 0 || name == '') { return; }
       if(tokens.length == 2) {
           name = tokens[0] + ' ' + tokens[1];
       }
       var id = idx++;
       var newLink = document.createElement('a');
       $(newLink).attr('href', window.location.href.concat('#section' + id));
       $(newLink).attr('id', 'goto-section' + id);
       newLink.innerHTML = name;
       var listItem = document.createElement('li');
       $(listItem).append(newLink);
       $(list).append(listItem);
{'fraction_non_alphanumeric': 0.2030716723549488, 'fraction_numerical': 0.006825938566552901, 'mean_word_length': 2.790948275862069, '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': '3929436', 'n_tokens_mistral': 537, 'n_tokens_neox': 526, 'n_words': 123}