1 from ..base import WLElement
4 class Footnote(WLElement):
5 def txt_build(self, builder):
8 def html_build(self, builder):
9 if not builder.with_footnotes:
12 builder.footnote_counter += 1
13 fn_no = builder.footnote_counter
14 footnote_id = 'footnote-idm{}'.format(self.attrib['_compat_ordered_id'])
15 anchor_id = 'anchor-idm{}'.format(self.attrib['_compat_ordered_id'])
17 builder.start_element('a', {"href": '#{}'.format(footnote_id), "class": "annotation"})
18 builder.push_text('[{}]'.format(fn_no))
21 builder.enter_fragment('footnotes')
22 builder.start_element('div', {'class': 'fn-{}'.format(self.tag)})
23 builder.push_text('\n') # Compat
24 builder.start_element('a', {'name': footnote_id})
26 builder.start_element('a', {
27 'href': '#{}'.format(anchor_id), 'class': 'annotation'
29 builder.push_text('[{}]'.format(fn_no))
32 builder.start_element('p')
33 super(Footnote, self).html_build(builder)
35 builder.push_text(' [{}]'.format(self.qualifier))
38 builder.exit_fragment()
42 """Przypis autorski."""
46 return _("author's footnote")
50 """Przypis tłumacza."""
54 return _("translator's footnote")
58 """Przypis redakcyjny."""
62 return _("editor's footnote")
66 """Przypis redakcji źródła."""
70 return _("source editor's footnote")