Bases: lpod.element.odf_element
Specialised element for paragraphs.
Append unicode plain text to the paragraph, replacing <CR>, <TAB> and multiple spaces by ODF corresponding tags.
Insert a bookmark before or after the characters in the text which match the regex before/after. When the regex matches more of one part of the text, position can be set to choose which part must be used. If before and after are None, we use only position that is the number of characters. So, by default, this function inserts a bookmark before the first character of the content. Role can be None, “start” or “end”, we insert respectively a position bookmark a bookmark-start or a bookmark-end. If content is not None these 2 calls are equivalent:
paragraph.set_bookmark("bookmark", content="xyz")
and:
paragraph.set_bookmark("bookmark", before="xyz", role="start")
paragraph.set_bookmark("bookmark", after="xyz", role="end")
If position is a 2-tuple, these 2 calls are equivalent:
paragraph.set_bookmark("bookmark", position=(10, 20))
and:
paragraph.set_bookmark("bookmark", position=10, role="start")
paragraph.set_bookmark("bookmark", position=20, role="end")
Arguments:
name – str
before – unicode regex
after – unicode regex
position – int or (int, int)
role – None, “start” or “end”
content – unicode regex
Make a link from text content matching the regex OR the positional arguments.
Apply the given style to text content matching the regex OR the positional arguments offset and length.
Arguments:
style – style element or name
regex – unicode regular expression
offset – int
length – int
Bases: lpod.paragraph.odf_paragraph
This element represents a line break.
Return odf_element
Create a paragraph element of the given style containing the optional given text.
Arguments:
text – unicode or odf_element
style – unicode
Return: odf_element
This element shall be used to represent the second and all following “ “ (U+0020, SPACE) characters in a sequence of “ “ (U+0020, SPACE) characters. Note: It is not an error if the character preceding the element is not a white space character, but it is good practice to use this element only for the second and all following SPACE characters in a sequence.
Arguments:
number – int
Return odf_element
This element represents the [UNICODE] tab character (HORIZONTAL TABULATION, U+0009).
The position attribute contains the number of the tab-stop to which a tab character refers. The position 0 marks the start margin of a paragraph. Note: The position attribute is only a hint to help non-layout oriented consumers to determine the tab/tab-stop association. Layout oriented consumers should determine the tab positions based on the style information
Arguments:
number – int
Return odf_element