Support --toc-depth in context writer.