docstr: Add TOC tree processor to Markdown. 
docstr_tok: ["Add","TOC","tree","processor","to","Markdown","."]
code: def extendMarkdown(self, md):
      """Add TOC tree processor to Markdown."""
      md.registerExtension(self)
      self.md = md
      self.reset()
      tocext = self.TreeProcessorClass(md, self.getConfigs())
      md.treeprocessors.register(tocext, "toc", 5)
  
imports: from __future__ import annotations
  from .None import Extension
  from ..treeprocessors import Treeprocessor
  from ..util import code_escape, parseBoolValue, AMP_SUBSTITUTE, HTML_PLACEHOLDER_RE, AtomicString
  from ..treeprocessors import UnescapeTreeprocessor
  import re
  import html
  import unicodedata
  import xml.etree.ElementTree
  from typing import TYPE_CHECKING, Any, Iterator, MutableSet
label_desc: Use image node_id 2 for calling the TocExtension obj's underlying member method code with example usage: obj.extendMarkdown(md) without return types