diff --git a/tildewiki/compilation.py b/tildewiki/compilation.py
index 80c668b..53f7ccf 100644
--- a/tildewiki/compilation.py
+++ b/tildewiki/compilation.py
@@ -5,6 +5,7 @@ from shutil import copy
from typing import Optional, Callable
from markdown import markdown
+from markdown.extensions.toc import TocExtension
DOUBLE_NEWLINE_RE = re.compile(r'\n\n', flags=re.MULTILINE|re.DOTALL)
HEADER_TITLE_RE = re.compile(r'
\n'