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:
2e508c4
)
Fixes.
author
Radek Czajka
<rczajka@rczajka.pl>
Wed, 10 Apr 2024 11:00:30 +0000
(13:00 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Wed, 10 Apr 2024 11:00:30 +0000
(13:00 +0200)
src/librarian/html.py
patch
|
blob
|
history
diff --git
a/src/librarian/html.py
b/src/librarian/html.py
index
c2f41c0
..
2919498
100644
(file)
--- a/
src/librarian/html.py
+++ b/
src/librarian/html.py
@@
-39,7
+39,7
@@
def transform_abstrakt(abstrakt_element):
style = etree.parse(style_filename)
xml = etree.tostring(abstrakt_element, encoding='unicode')
document = etree.parse(io.StringIO(
style = etree.parse(style_filename)
xml = etree.tostring(abstrakt_element, encoding='unicode')
document = etree.parse(io.StringIO(
- xml.replace('
abstrakt', '
dlugi_cytat')
+ xml.replace('
<abstrakt', '<dlugi_cytat').replace('</abstrakt', '</
dlugi_cytat')
)) # HACK
result = document.xslt(style)
html = re.sub('<a name="sec[0-9]*"/>', '',
)) # HACK
result = document.xslt(style)
html = re.sub('<a name="sec[0-9]*"/>', '',
@@
-49,6
+49,10
@@
def transform_abstrakt(abstrakt_element):
def add_image_sizes(tree, gallery_path, gallery_url, base_url):
widths = [360, 600, 1200, 1800, 2400]
def add_image_sizes(tree, gallery_path, gallery_url, base_url):
widths = [360, 600, 1200, 1800, 2400]
+ try:
+ os.makedirs(gallery_path)
+ except:
+ pass
for i, ilustr in enumerate(tree.findall('//ilustr')):
rel_path = ilustr.attrib['src']
for i, ilustr in enumerate(tree.findall('//ilustr')):
rel_path = ilustr.attrib['src']