fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no luck doing logic in latex -- table is broken down in redundant xslt
[librarian.git]
/
librarian
/
epub.py
diff --git
a/librarian/epub.py
b/librarian/epub.py
index
8dc11c7
..
de136ea
100644
(file)
--- a/
librarian/epub.py
+++ b/
librarian/epub.py
@@
-330,6
+330,12
@@
def transform_chunk(chunk_xml, chunk_no, annotations, empty=False, _empty_html_s
return output_html, toc, chars
return output_html, toc, chars
+def flatten_image_paths(wldoc):
+ root = wldoc.edoc.getroot()
+ for node in root.findall(".//ilustr"):
+ node.attrib['src'] = os.path.basename(node.attrib['src'])
+ return wldoc
+
def render_latex(wldoc, prefix="latex"):
"""
Renders <latex>CODE</latex> as images and returns
def render_latex(wldoc, prefix="latex"):
"""
Renders <latex>CODE</latex> as images and returns
@@
-398,6
+404,8
@@
def transform(wldoc, verbose=False,
if main_text.tag == RDFNS('RDF'):
main_text = None
if main_text.tag == RDFNS('RDF'):
main_text = None
+ flatten_image_paths(wldoc)
+
if main_text is not None:
for chunk_xml in chop(main_text):
empty = False
if main_text is not None:
for chunk_xml in chop(main_text):
empty = False