<commit_before>import React from 'react';
import Link from 'gatsby-link';
import PropTypes from 'prop-types';
import './toc.scss';

const TableItem = ({ url, name }) => (
  <li>
    <Link
      href={url}
      to={url}
    >
      {name}
    </Link>
  </li>
);

TableItem.propTypes = {
  url: PropTypes.string.isRequired,
  name: PropTypes.string.isRequired,
};

const Table = ({ items }) => (
  <ul>
    {items.map(item => <TableItem url={`#${item}`} name={item} key={item} />)}
  </ul>
);

const TableOfContent = ({ toc }) => (
  <div
    className="col-lg-2 d-none d-lg-block order-11 toc-wrap"
  >
    <Table items={toc} />
  </div>
);
<commit_msg>Fix toc scrolling<commit_after>import React from 'react';
import Link from 'gatsby-link';
import PropTypes from 'prop-types';
import './toc.scss';

const TableItem = ({ url, name }) => (
  <li>
    <a
      href={url}
      data-scroll
    >
      {name}
    </a>
  </li>
);

TableItem.propTypes = {
  url: PropTypes.string.isRequired,
  name: PropTypes.string.isRequired,
};

const Table = ({ items }) => (
  <ul>
    {items.map(item => <TableItem url={`#${item}`} name={item} key={item} />)}
  </ul>
);

const TableOfContent = ({ toc }) => (
  <div
    className="col-lg-2 d-none d-lg-block order-11 toc-wrap"
  >
    <Table items={toc} />
  </div>
);

{'fraction_non_alphanumeric': 0.2019892884468248, 'fraction_numerical': 0.0045906656465187455, 'mean_word_length': 2.892857142857143, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 31, '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': '3732774', 'n_tokens_mistral': 496, 'n_tokens_neox': 496, 'n_words': 106}