toc¶
table of content directive.
- class rstobj.directives.toc.TableOfContent(class_: Optional[str] = None, name: Optional[str] = None, title: Optional[str] = None, depth: Optional[int] = None, local: bool = False, backlinks: Optional[str] = None)[source]¶
.. contents::
directive.parameter definition see here: http://docutils.sourceforge.net/docs/ref/rst/directives.html#table-of-contents
- Parameters
title – str, required.
depth – int, optional.
local – bool, optional.
backlinks (str) – optional. one of
TableOfContent.BacklinksOptions
.
Example:
toc = TableOfContent(title="Table of Contents", depth=2) toc.render()
Output:
.. contents:: Table of Contents :depth: 2