2 from __future__ import unicode_literals
4 from ..base import WLElement
7 class Footnote(WLElement):
8 def txt_build(self, builder):
11 def html_build(self, builder):
12 if not builder.with_footnotes:
15 builder.footnote_counter += 1
16 fn_no = builder.footnote_counter
17 footnote_id = 'footnote-idm{}'.format(self.attrib['_compat_ordered_id'])
18 anchor_id = 'anchor-idm{}'.format(self.attrib['_compat_ordered_id'])
21 builder.start_element(
24 "href": '#{}'.format(footnote_id),
25 "class": "annotation-anchor",
29 builder.push_text('[{}]'.format(fn_no))
32 # Add actual footnote.
33 builder.enter_fragment('footnotes')
34 builder.start_element('div', {'class': 'fn-{}'.format(self.tag)})
35 builder.push_text('\n') # Compat
36 builder.start_element('a', {'name': footnote_id})
38 builder.start_element('a', {
39 'href': '#{}'.format(anchor_id), 'class': 'annotation'
41 builder.push_text('[{}]'.format(fn_no))
44 builder.start_element('p')
45 super(Footnote, self).html_build(builder)
47 builder.push_text(' [{}]'.format(self.qualifier))
50 builder.exit_fragment()
54 """Przypis autorski."""
58 return _("author's footnote")
62 """Przypis tłumacza."""
66 return _("translator's footnote")
70 """Przypis redakcyjny."""
74 return _("editor's footnote")
78 """Przypis redakcji źródła."""
82 return _("source editor's footnote")