Add support for predesigned covers to Marquise. Remove support for changing cover...
[librarian.git] / src / librarian / elements / tools / __init__.py
1 from ..base import WLElement
2
3
4 class Numeracja(WLElement):
5     pass
6
7
8 class Rownolegle(WLElement):
9     def build_epub(self, builder):
10         for i, block in enumerate(self):
11             attr = {"class": "rownolegly-blok"}
12             if not i:
13                 attr['class'] += ' first'
14             if i == len(self) - 1:
15                 attr['class'] += ' last'
16             builder.start_element('div', attr)
17             self.build_epub(block, builder)
18             builder.end_element()
19
20
21 class Tab(WLElement):
22     EPUB_TAG = HTML_TAG = 'span'
23
24     def get_html_attr(self, builder):
25         try:
26             szer = int(self.get('szer', 1))
27         except:
28             szer = 1
29         return {
30             "display": "inline-block",
31             "width": f"{szer}em",
32         }
33
34     get_epub_attr = get_html_attr
35