def toc_html(self):
if self._toc is None:<EOL><INDENT>return None<EOL><DEDENT>def indent():<EOL><INDENT>return '<STR_LIT:U+0020>' * (len(h_stack) - <NUM_LIT:1>)<EOL><DEDENT>lines = []<EOL>h_stack = [<NUM_LIT:0>]   <EOL>for level, id, name in self._toc:<EOL><INDENT>if level > h_stack[-<NUM_LIT:1>]:<EOL><INDENT>lines.append("<STR_LIT>" % indent())<EOL>h_stack.append(level)<EOL><DEDENT>elif level == h_stack[-<NUM_LIT:1>]:<EOL><INDENT>lines[-<NUM_LIT:1>] += "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>while level < h_stack[-<NUM_LIT:1>]:<EOL><INDENT>h_stack.pop()<EOL>if not lines[-<NUM_LIT:1>].endswith("<STR_LIT>"):<EOL><INDENT>lines[-<NUM_LIT:1>] += "<STR_LIT>"<EOL><DEDENT>lines.append("<STR_LIT>" % indent())<EOL><DEDENT><DEDENT>lines.append('<STR_LIT>' % (<EOL>indent(), id, name))<EOL><DEDENT>while len(h_stack) > <NUM_LIT:1>:<EOL><INDENT>h_stack.pop()<EOL>if not lines[-<NUM_LIT:1>].endswith("<STR_LIT>"):<EOL><INDENT>lines[-<NUM_LIT:1>] += "<STR_LIT>"<EOL><DEDENT>lines.append("<STR_LIT>" % indent())<EOL><DEDENT>return '<STR_LIT:\n>'.join(lines) + '<STR_LIT:\n>'<EOL>
Return the HTML for the current TOC.

        This expects the `_toc` attribute to have been set on this instance.