code: def toc(self):
          
          from mistletoe.block_token import List
          def get_indent(level):
              if self.omit_title:
                  level -= 1
              return ' ' * 4 * (level - 1)
  
          def build_list_item(heading):
              level, content = heading
              template = '{indent}- {content}\n'
              return template.format(indent=get_indent(level), content=content)
  
          return List([build_list_item(heading) for heading in self._headings])
docs: Returns table of contents as a block_token.List instance.