lpod.toc

class lpod.toc.odf_index_title_template(native_element, cache=None)

Bases: lpod.element.odf_element

get_style()
set_style(name)
class lpod.toc.odf_toc(native_element, cache=None)

Bases: lpod.element.odf_element

fill(document=None, use_default_styles=True)

Fill the TOC with the titles found in the document. A TOC is not contextual so it will catch all titles before and after its insertion. If the TOC is not attached to a document, attach it beforehand or provide one as argument.

For having a pretty TOC, let use_default_styles by default.

Arguments:

document – odf_document

use_default_styles – bool

get_body()
get_formatted_text(context)
get_name()
get_outline_level()
get_protected()
get_style()
get_title()
set_body(body=None)
set_name(name)
set_outline_level(level)
set_protected(protected)
set_style(name)
set_title(title, style=None, text_style=None)
class lpod.toc.odf_toc_entry_template(native_element, cache=None)

Bases: lpod.element.odf_element

get_style()
set_style(name)
lpod.toc.odf_create_index_body()
lpod.toc.odf_create_index_title(title=None, name=None, style=None, text_style=None)

Create an index title

Arguments:

title – unicode

Return: odf_element

lpod.toc.odf_create_toc(title=u'Table of Contents', name=None, protected=True, outline_level=None, style=None, title_style=u'Contents_20_Heading', entry_style=u'Contents_20_%d')

Create a table of contents. Default parameters are what most people use: Protected from manual modifications and not limited in title levels.

The name is mandatory and derived automatically from the title if not given. Provide one in case of a conflict with other TOCs in the same document.

Arguments:

title – unicode

name – unicode

protected – bool

outline_level – int

style – unicode

title_style – unicode

entry_style – unicode

Return: odf_toc

lpod.toc.odf_create_toc_level_style(level)

Generate an automatic default style for the given TOC level.

lpod.toc.odf_create_toc_source(title=None, outline_level=10, title_style=u'Contents_20_Heading', entry_style=u'Contents_20_%d')

Previous topic

lpod.table

Next topic

lpod.tracked_changes

This Page