fnp
/
librarian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
261a330
)
Epub fixes.
author
Radek Czajka
<rczajka@rczajka.pl>
Thu, 8 Jul 2021 13:01:55 +0000
(15:01 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Thu, 8 Jul 2021 13:01:55 +0000
(15:01 +0200)
src/librarian/builders/epub.py
patch
|
blob
|
history
src/librarian/command_line.py
patch
|
blob
|
history
src/librarian/document.py
patch
|
blob
|
history
src/librarian/elements/__init__.py
patch
|
blob
|
history
src/librarian/elements/figures/ilustr.py
patch
|
blob
|
history
diff --git
a/src/librarian/builders/epub.py
b/src/librarian/builders/epub.py
index
167b8cd
..
4471e30
100644
(file)
--- a/
src/librarian/builders/epub.py
+++ b/
src/librarian/builders/epub.py
@@
-558,7
+558,8
@@
class EpubBuilder(Builder):
))
).text = str(m.url)
))
).text = str(m.url)
- newp().text = 'Tekst opracowany na podstawie: ' + m.source_name
+ if m.source_name:
+ newp().text = 'Tekst opracowany na podstawie: ' + m.source_name
newp().text = """
Wydawca:
newp().text = """
Wydawca:
diff --git
a/src/librarian/command_line.py
b/src/librarian/command_line.py
index
2fc7cc1
..
7b7eb38
100644
(file)
--- a/
src/librarian/command_line.py
+++ b/
src/librarian/command_line.py
@@
-58,6
+58,6
@@
def main(*args, **kwargs):
"mp3": args.mp3,
}
"mp3": args.mp3,
}
- output = document.build(builder, **kwargs)
+ output = document.build(builder,
base_url=args.base_url,
**kwargs)
with open(output_file_path, 'wb') as f:
f.write(output.get_bytes())
with open(output_file_path, 'wb') as f:
f.write(output.get_bytes())
diff --git
a/src/librarian/document.py
b/src/librarian/document.py
index
0dbb14f
..
e220c14
100644
(file)
--- a/
src/librarian/document.py
+++ b/
src/librarian/document.py
@@
-36,8
+36,8
@@
class WLDocument:
)
)
- def build(self, builder, **kwargs):
- return builder().build(self, **kwargs)
+ def build(self, builder,
base_url=None,
**kwargs):
+ return builder(
base_url=base_url
).build(self, **kwargs)
def _compat_assign_ordered_ids(self):
"""
def _compat_assign_ordered_ids(self):
"""
diff --git
a/src/librarian/elements/__init__.py
b/src/librarian/elements/__init__.py
index
c3a55fb
..
549d0cb
100644
(file)
--- a/
src/librarian/elements/__init__.py
+++ b/
src/librarian/elements/__init__.py
@@
-10,7
+10,8
@@
WL_ELEMENTS = {
"coverBarColor": etree.ElementBase,
"coverBoxPosition": etree.ElementBase,
"coverLogoUrl": etree.ElementBase,
"coverBarColor": etree.ElementBase,
"coverBoxPosition": etree.ElementBase,
"coverLogoUrl": etree.ElementBase,
-
+ "contentWarning": etree.ElementBase,
+
"utwor": root.Utwor,
"dramat_wierszowany_l": masters.Master,
"dramat_wierszowany_lp": masters.Master,
"utwor": root.Utwor,
"dramat_wierszowany_l": masters.Master,
"dramat_wierszowany_lp": masters.Master,
@@
-111,6
+112,8
@@
WL_ELEMENTS = {
"animacja": figures.Animacja,
"ilustr": figures.Ilustr,
"animacja": figures.Animacja,
"ilustr": figures.Ilustr,
+ "ref": etree.ElementBase,
+
# Inline MathML, should really be namespaced.
"mrow": etree.ElementBase,
"mi": etree.ElementBase,
# Inline MathML, should really be namespaced.
"mrow": etree.ElementBase,
"mi": etree.ElementBase,
diff --git
a/src/librarian/elements/figures/ilustr.py
b/src/librarian/elements/figures/ilustr.py
index
ab7c2b7
..
c6105f4
100644
(file)
--- a/
src/librarian/elements/figures/ilustr.py
+++ b/
src/librarian/elements/figures/ilustr.py
@@
-27,10
+27,9
@@
class Ilustr(WLElement):
else:
th = img.resize((width, round(width * img.size[1] / img.size[0])))
else:
th = img.resize((width, round(width * img.size[1] / img.size[0])))
- imgfile.close()
buffer = six.BytesIO()
th.save(buffer, format=th_format)
buffer = six.BytesIO()
th.save(buffer, format=th_format)
- ## TODO: Counter
+ imgfile.close()
file_name = 'image%d.%s' % (
builder.assign_image_number(),
ext
file_name = 'image%d.%s' % (
builder.assign_image_number(),
ext