def insert_note(self, note_element=None, after=None, note_class='footnote', note_id=None, citation=None, body=None, *args, **kw): if note_element is None: note_element = odf_create_note(note_class=note_class, note_id=note_id, citation=citation, body=body) else: # XXX clone or modify the argument? if note_class: note_element.set_note_class(note_class) if note_id: note_element.set_note_id(note_id, *args, **kw) if citation: note_element.set_note_citation(citation) if body: note_element.set_note_body(body) note_element.check_validity() if type(after) is unicode: self._insert(note_element, after=after) elif isinstance(after, odf_element): after.insert(note_element, FIRST_CHILD) else: self.insert(note_element, FIRST_CHILD)
def convert_footnote_reference(node, context): refid = node.get("refid") citation = node.astext() footnote = odf_create_note(note_id=refid, citation=citation) context['top'].append(footnote) context['footnotes'][refid] = footnote
def convert_footnote_reference(node, context): refid = node.get("refid") citation = node.astext() footnote = odf_create_note(note_id=refid, citation=citation) context['top'].append(footnote) context['footnotes'][refid] = footnote
def insert_note(self, note_element=None, after=None, note_class='footnote', note_id=None, citation=None, body=None, *args, **kw): if note_element is None: note_element = odf_create_note(note_class=note_class, note_id=note_id, citation=citation, body=body) else: # XXX clone or modify the argument? if note_class: note_element.set_note_class(note_class) if note_id: note_element.set_note_id(note_id, *args, **kw) if citation: note_element.set_note_citation(citation) if body: note_element.set_note_body(body) note_element.check_validity() if type(after) is unicode: self._insert(note_element, after=after) elif isinstance(after, odf_element): after.insert_element(note_element, FIRST_CHILD) else: self.insert_element(note_element, FIRST_CHILD)