for bible 24.5.1
authorRadek Czajka <rczajka@rczajka.pl>
Tue, 3 Dec 2024 14:46:48 +0000 (15:46 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Tue, 3 Dec 2024 14:46:48 +0000 (15:46 +0100)
setup.py
src/librarian/elements/bible/__init__.py [new file with mode: 0644]

index 494b3f2..42cf475 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ def whole_tree(prefix, path):
 
 setup(
     name='librarian',
-    version='24.5',
+    version='24.5.1',
     description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats',
     author="Marek Stępniowski",
     author_email='marek@stepniowski.com',
diff --git a/src/librarian/elements/bible/__init__.py b/src/librarian/elements/bible/__init__.py
new file mode 100644 (file)
index 0000000..5c3c361
--- /dev/null
@@ -0,0 +1,35 @@
+from ..base import WLElement
+
+
+class Werset(WLElement):
+    STRIP = True
+    NUMBERING = 'main'
+
+    TXT_TOP_MARGIN = 1
+    TXT_BOTTOM_MARGIN = 1
+
+    EPUB_TAG = HTML_TAG = 'div'
+    EPUB_CLASS = 'verse-relig'
+    HTML_CLASS = 'wl verse-relig'
+
+    has_visible_numbering = True
+
+    def epub_build_inner(self, builder):
+        builder.numbering += 1
+        builder.push_text(str(builder.numbering))
+
+
+class Petucha(WLElement):
+    HTML_TAG = EPUB_TAG = 'span'
+    HTML_CLASS = EPUB_CLASS = 'petucha'
+
+    def html_build_inner(self, builder):
+        builder.push_text('{פ}')
+
+
+class Stuma(WLElement):
+    HTML_TAG = EPUB_TAG = 'span'
+    HTML_CLASS = EPUB_CLASS = 'stuma'
+
+    def html_build_inner(self, builder):
+        builder.push_text('{ס}')