X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/295a1350b069ee750d2f7430e779e5ac6f23a673..f164694b5e7ad5ed5f6d95743f9259bd3a9292bd:/src/librarian/elements/footnotes/__init__.py diff --git a/src/librarian/elements/footnotes/__init__.py b/src/librarian/elements/footnotes/__init__.py index e18eaae..a342e05 100644 --- a/src/librarian/elements/footnotes/__init__.py +++ b/src/librarian/elements/footnotes/__init__.py @@ -1,13 +1,15 @@ -# -*- coding: utf-8 -from __future__ import unicode_literals - +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. +# from ..base import WLElement class Footnote(WLElement): NO_TOC = True + DISABLE_NUMBERING = True START_INLINE = True ASIDE = True + NUMBERING = 'fn' def signal(self, signal): if signal == 'INLINE': @@ -22,10 +24,9 @@ class Footnote(WLElement): if not builder.with_footnotes: return - builder.footnote_counter += 1 - fn_no = builder.footnote_counter - footnote_id = 'footnote-idm{}'.format(self.attrib['_compat_ordered_id']) - anchor_id = 'anchor-idm{}'.format(self.attrib['_compat_ordered_id']) + fn_no = self.attrib.get('_visible_numbering') + footnote_id = 'footnote-id{}'.format(fn_no) + anchor_id = 'anchor-id{}'.format(fn_no) # Add anchor. builder.start_element( @@ -133,3 +134,11 @@ class PE(Footnote): def qualifier(self): _ = self.gettext return _("source editor's footnote") + + +class PTrad(Footnote): + """Przypis tradycyjny.""" + @property + def qualifier(self): + _ = self.gettext + return _("traditional footnote")