<commit_before><template>

  <ul>
    <li v-for="anchor in anchors">
      <router-link :to="getAnchorLink(anchor.hash)">
        {{ anchor.label }}
      </router-link>
    </li>
  </ul>

</template>


<script>

  /**
   * A component for auto-generating a table of contents for a page. All
   * elements with an [id] attribute defined will be shown in the TOC.
   */

  const map = require('lodash/map');

  module.exports = {
    name: 'TableOfContents',
    data() {
      return {
        // These are all the anchors to show in the TOC.
        // They are objects with the "hash" and "label" properties.
        anchors: [],
      };
    },
    mounted() {
      this.route = this.$route.path.replace('/', '#');

      this.anchors = map(
        this.$parent.$el.querySelectorAll('[id]'),
        (sectionHeadingEl) => ({
          hash: `#${sectionHeadingEl.id}`,
          label: sectionHeadingEl.innerText
        }));
    },
    methods: {
      getAnchorLink(hash) {
        return this.$route.path + hash; // E.g. /style_guide/foo#bar
      },
    },
  };

</script>


<style lang="stylus" scoped>

  ul
    list-style-type: none

</style>
<commit_msg>Remove unused code.<commit_after><template>

  <ul>
    <li v-for="anchor in anchors">
      <router-link :to="getAnchorLink(anchor.hash)">
        {{ anchor.label }}
      </router-link>
    </li>
  </ul>

</template>


<script>

  /**
   * A component for auto-generating a table of contents for a page. All
   * elements with an [id] attribute defined will be shown in the TOC.
   */

  const map = require('lodash/map');

  module.exports = {
    name: 'TableOfContents',
    data() {
      return {
        // These are all the anchors to show in the TOC.
        // They are objects with the "hash" and "label" properties.
        anchors: [],
      };
    },
    mounted() {
      this.anchors = map(
        this.$parent.$el.querySelectorAll('[id]'),
        (sectionHeadingEl) => ({
          hash: `#${sectionHeadingEl.id}`,
          label: sectionHeadingEl.innerText
        }));
    },
    methods: {
      getAnchorLink(hash) {
        return this.$route.path + hash; // E.g. /style_guide/foo#bar
      },
    },
  };

</script>


<style lang="stylus" scoped>

  ul
    list-style-type: none

</style>

{'fraction_non_alphanumeric': 0.15556529360210342, 'fraction_numerical': 0.0, 'mean_word_length': 2.0851351351351353, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '7591601', 'n_tokens_mistral': 759, 'n_tokens_neox': 737, 'n_words': 184}