1 from ..base import WLElement
4 class Footnote(WLElement):
5 def txt_build(self, builder):
8 def html_build(self, builder):
9 builder.footnote_counter += 1
10 fn_no = builder.footnote_counter
11 footnote_id = 'footnote-idm{}'.format(self.attrib['_compat_ordered_id'])
12 anchor_id = 'anchor-idm{}'.format(self.attrib['_compat_ordered_id'])
14 builder.start_element('a', {"href": '#{}'.format(footnote_id), "class": "annotation"})
15 builder.push_text('[{}]'.format(fn_no))
18 builder.enter_fragment('footnotes')
19 builder.start_element('div', {'class': 'fn-{}'.format(self.tag)})
20 builder.push_text('\n') # Compat
21 builder.start_element('a', {'name': footnote_id})
23 builder.start_element('a', {
24 'href': '#{}'.format(anchor_id), 'class': 'annotation'
26 builder.push_text('[{}]'.format(fn_no))
29 builder.start_element('p')
30 super(Footnote, self).html_build(builder)
32 builder.push_text(' [{}]'.format(self.qualifier))
35 builder.exit_fragment()
39 """Przypis autorski."""
43 return _("author's footnote")
47 """Przypis tłumacza."""
51 return _("translator's footnote")
55 """Przypis redakcyjny."""
59 return _("editor's footnote")
63 """Przypis redakcji źródła."""
67 return _("source editor's footnote")