1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from ..base import WLElement
12 TXT_LEGACY_TOP_MARGIN = 1
13 TXT_LEGACY_BOTTOM_MARGIN = 0
15 EPUB_TAG = HTML_TAG = 'div'
17 HTML_CLASS = 'wl verse'
23 if hasattr(self, 'stanza'):
24 return self.stanza.meta
25 return super(Wers, self).meta
27 def _epub_build_inner(self, builder):
28 super()._epub_build_inner(builder)
29 builder.push_text('''\u00a0''')
32 def has_visible_numbering(self):
34 number = int(self.attrib['_visible_numbering'])
37 return number == 1 or not(number % 5)
40 def is_stretched(self):
41 return self.find('.//tab[@szer="*"]') is not None
43 def get_html_attr(self, builder):
44 attr = super().get_html_attr(builder)
46 attr['class'] += ' verse-stretched'
49 def _html_build_inner(self, builder):
51 builder.start_element('span')
52 super()._html_build_inner(builder)