X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/82c0860d1520489be56457829d49eb17f165b9cd..23d025c8875cca1404f274aca7170c9db5e980e7:/src/librarian/elements/base.py diff --git a/src/librarian/elements/base.py b/src/librarian/elements/base.py index 1f22929..2d656ae 100644 --- a/src/librarian/elements/base.py +++ b/src/librarian/elements/base.py @@ -37,7 +37,9 @@ class WLElement(etree.ElementBase): EPUB_ATTR = {} EPUB_CLASS = None EPUB_START_CHUNK = False - + + FB2_TAG = None + CAN_HAVE_TEXT = True STRIP = False NUMBERING = None @@ -209,6 +211,25 @@ class WLElement(etree.ElementBase): if self.HTML_TAG: builder.end_element() + def fb2_build(self, builder): + if self.SECTION_PRECEDENCE: + builder.start_section(self.SECTION_PRECEDENCE) + builder.start_element('title') + builder.start_element('p') + + if self.FB2_TAG: + builder.start_element( + self.FB2_TAG, + #self.get_fb2_attr(builder), + ) + + self.build_inner(builder) + if self.FB2_TAG: + builder.end_element() + if self.SECTION_PRECEDENCE: + builder.end_element() + builder.end_element() + def epub_build_inner(self, builder): self.build_inner(builder)