Bases: lpod.element.odf_element
A reference to a content marked by a reference mark. The odf_reference element (<text:reference-ref>) represents a field that references a <text:reference-mark-start> or <text:reference-mark> element. Its text:reference-format attribute specifies what is displayed from the referenced element. Default is ‘page’ Actual content is not updated except for the ‘text’ format by the update() method.
Consider using: lpod.paragraph.insert_reference()
The defined values for the text:reference-format attribute supported by all reference fields are: ‘chapter’: displays the number of the chapter in which the referenced item appears. ‘direction’: displays whether the referenced item is above or below the reference field. ‘page’: displays the number of the page on which the referenced item appears. ‘text’: displays the text of the referenced item. Additional defined values for the text:reference-format attribute supported by references to sequence fields are: ‘caption’: displays the caption in which the sequence is used. ‘category-and-value’: displays the name and value of the sequence. ‘value’: displays the value of the sequence.
References to bookmarks and other references support additional values, which display the list label of the referenced item. If the referenced item is contained in a list or a numbered paragraph, the list label is the formatted number of the paragraph which contains the referenced item. If the referenced item is not contained in a list or numbered paragraph, the list label is empty, and the referenced field therefore displays nothing. If the referenced bookmark or reference contains more than one paragraph, the list label of the paragraph at which the bookmark or reference starts is taken.
Additional defined values for the text:reference-format attribute supported by all references to bookmark’s or other reference fields are:
‘number’: displays the list label of the referenced item. [...] ‘number-all-superior’: displays the list label of the referenced item and adds the contents of all list labels of superior levels in front of it. [...] ‘number-no-superior’: displays the contents of the list label of the referenced item.
Set the text:reference-format attribute.
Arguments:
ref_format – unicode
Set the text:ref-name attribute.
Arguments:
name – unicode
Update the content of the reference text field. Currently only ‘text’ format is implemented. Other values, for example the ‘page’ text field, may need to be refreshed through a visual ODF parser.
Bases: lpod.element.odf_element
A point reference. A point reference marks a position in text and is represented by a single <text:reference-mark> element.
Only usefull for for subclasses.
Set the text:name attribute.
Arguments:
name – unicode
Bases: lpod.reference.odf_reference_mark
The <text:reference-mark-end> element represents the end of a range reference.
Return the text between reference-mark-start and reference-mark-end.
Bases: lpod.reference.odf_reference_mark_end
The <text:reference-mark-start> element represents the start of a range reference.
Delete the given element from the XML tree. If no element is given, “self” is deleted. The XML library may allow to continue to use an element now “orphan” as long as you have a reference to it.
For odf_reference_mark_start : delete the reference-end tag if exists.
Arguments:
child – odf_element
keep_tail – boolean (default to True), True for most usages.
Return the document content between the start and end tags of the reference. The content returned by this method can spread over several headers and paragraphs. By default, the content is returned as an <office:text> odf element.
Arguments:
- no_header – boolean (default to False), translate existing headers
- tags <text:h> into paragraphs <text:p>.
- clean – boolean (default to True), suppress unwanted tags. Striped
- tags are : ‘text:change’, ‘text:change-start’, ‘text:change-end’, ‘text:reference-mark’, ‘text:reference-mark-start’, ‘text:reference-mark-end’.
- as_xml – boolean (default to False), format the returned content as
- a XML string (serialization).
- as_list – boolean (default to False), do not embed the returned
- content in a <office:text’> element, instead simply return a raw list of odf elements.
Create a reference to a content marked by a reference mark. An actual reference mark with the provided name should exist. Consider using: lpod.paragraph.insert_reference()
The text:ref-name attribute identifies a <text:reference-mark> or <text:referencemark-start> element by the value of that element’s text:name attribute. If ref_format is ‘text’, the current text content of the reference_mark is retrieved. insert_reference Arguments:
name – unicode : name of the reference mark
- ref_format – unicode : format of the field. Default is ‘page’, allowed
- values are ‘chapter’, ‘direction’, ‘page’, ‘text’, ‘caption’, ‘category-and-value’, ‘value’, ‘number’, ‘number-all-superior’, ‘number-no-superior’.
A point reference. A point reference marks a position in text and is represented by a single <text:reference-mark> element. Consider using the wrapper: lpod.paragraph.set_reference_mark()
Arguments:
name – unicode
The <text:reference-mark-end> element represent the end of a range reference. Consider using the wrappers: lpod.paragraph.set_reference_mark() and lpod.paragraph.set_reference_mark_end()
Arguments:
name – unicode
The <text:reference-mark-start> element represent the start of a range reference. Consider using the wrapper: lpod.paragraph.set_reference_mark()
Arguments:
name – unicode
Remove all the ‘text:reference-mark’, ‘text:reference-mark-start’, and ‘text:reference-mark-end’ tags of the element, keeping inner sub elements. Nota : using the .delete() on the reference mark will delete inner content.
Remove the ‘text:reference-mark’, ‘text:reference-mark-start’, and ‘text:reference-mark-end’ tags of the element, identified by name or position, keeping inner sub elements. Nota : using the .delete() on the reference mark will delete inner content.
Remove all the ‘text:reference-ref’ tags of the element, keeping inner sub elements (for example the referenced valus if format is ‘text’). Nota : using the .delete() on the reference mark will delete inner content.