%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/reportlab/platypus/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/reportlab/platypus/__pycache__/tableofcontents.cpython-312.pyc |
� ��dS � � � d Z dZddlmZ ddlmZmZmZmZm Z m Z mZ ddlm Z mZ ddlmZ ddlmZ ddlmZ dd lmZmZ dd lmZ ddlmZ ddlmZ dd lZddl m!Z! d� Z" e# d"d�Z%dez Z&dez Z' e deddde'�� gZ( eg d�� Z) G d� de� Z*d� Z+ G d� de� Z,e,Z-d� Z. G d � d!e� Z/y # G d� de$� Z#Y �`xY w)#z3.5.32a Experimental class to generate Tables of Contents easily This module defines a single TableOfContents() class that can be used to create automatically a table of tontents for Platypus documents like this: story = [] toc = TableOfContents() story.append(toc) # some heading paragraphs here... doc = MyTemplate(path) doc.multiBuild(story) The data needed to create the table is a list of (level, text, pageNum) triplets, plus some paragraph styles for each level of the table itself. The triplets will usually be created in a document template's method like afterFlowable(), making notification calls using the notify() method with appropriate data like this: (level, text, pageNum) = ... self.notify('TOCEntry', (level, text, pageNum)) Optionally the list can contain four items in which case the last item is a destination key which the entry should point to. A bookmark with this key needs to be created first like this: key = 'ch%s' % self.seq.nextf('chapter') self.canv.bookmarkPage(key) self.notify('TOCEntry', (level, text, pageNum, key)) As the table of contents need at least two passes over the Platypus story which is why the multiBuild() method must be called. The level<NUMBER>ParaStyle variables are the paragraph styles used to format the entries in the table of contents. Their indentation is calculated like this: each entry starts at a multiple of some constant named delta. If one entry spans more than one line, all lines after the first are indented by the same constant named epsilon. � )�cm)� commasplit� escapeOnce�encode_label�decode_label�strTypes� asUnicode�asNative)�ParagraphStyle� _baseFontName)� sequencer)� Paragraph)�IndexingFlowable)� TableStyle�Table)�Spacer)�stringWidth��canvasN)�literal_evalc �&