def on_table_of_contents_updated(
        self, event: Markdown.TableOfContentsUpdated
    ) -> None:
        """Handle a table of contents update event.

        Args:
            event: The table of content update event to handle.
        """
        self.query_one(
            MarkdownTableOfContents
        ).table_of_contents = event.table_of_contents
Handle a table of contents update event.

        Args:
            event: The table of content update event to handle.
        
frogmouth/widgets/navigation_panes/table_of_contents.py