fnp
/
librarian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0efff78
)
turn off hyphenator
author
Jan Szejko
<j-sz@o2.pl>
Thu, 18 Feb 2016 15:13:53 +0000
(16:13 +0100)
committer
Jan Szejko
<j-sz@o2.pl>
Thu, 18 Feb 2016 15:13:53 +0000
(16:13 +0100)
librarian/epub.py
patch
|
blob
|
history
librarian/mobi.py
patch
|
blob
|
history
diff --git
a/librarian/epub.py
b/librarian/epub.py
index
bf2d4d9
..
831639b
100644
(file)
--- a/
librarian/epub.py
+++ b/
librarian/epub.py
@@
-406,7
+406,7
@@
def transform_chunk(chunk_xml, chunk_no, annotations, empty=False, _empty_html_s
def transform(wldoc, verbose=False,
style=None, html_toc=False,
def transform(wldoc, verbose=False,
style=None, html_toc=False,
- sample=None, cover=None, flags=None):
+ sample=None, cover=None, flags=None
, hyphenate=False
):
""" produces a EPUB file
sample=n: generate sample e-book (with at least n paragraphs)
""" produces a EPUB file
sample=n: generate sample e-book (with at least n paragraphs)
@@
-419,8
+419,9
@@
def transform(wldoc, verbose=False,
replace_characters(wldoc.edoc.getroot())
replace_characters(wldoc.edoc.getroot())
- hyphenator = set_hyph_language(wldoc.edoc.getroot())
- hyphenate_and_fix_conjunctions(wldoc.edoc.getroot(), hyphenator)
+ if hyphenate:
+ hyphenator = set_hyph_language(wldoc.edoc.getroot())
+ hyphenate_and_fix_conjunctions(wldoc.edoc.getroot(), hyphenator)
# every input file will have a TOC entry,
# pointing to starting chunk
# every input file will have a TOC entry,
# pointing to starting chunk
diff --git
a/librarian/mobi.py
b/librarian/mobi.py
index
a0e463a
..
61a6de1
100644
(file)
--- a/
librarian/mobi.py
+++ b/
librarian/mobi.py
@@
-13,7
+13,7
@@
from librarian import OutputFile
def transform(wldoc, verbose=False, sample=None, cover=None,
def transform(wldoc, verbose=False, sample=None, cover=None,
- use_kindlegen=False, flags=None):
+ use_kindlegen=False, flags=None
, hyphenate=True
):
""" produces a MOBI file
wldoc: a WLDocument
""" produces a MOBI file
wldoc: a WLDocument
@@
-26,7
+26,8
@@
def transform(wldoc, verbose=False, sample=None, cover=None,
del wldoc
epub = document.as_epub(verbose=verbose, sample=sample,
del wldoc
epub = document.as_epub(verbose=verbose, sample=sample,
- html_toc=True, cover=cover or True, flags=flags)
+ html_toc=True, cover=cover or True, flags=flags,
+ hyphenate=hyphenate)
if verbose:
kwargs = {}
else:
if verbose:
kwargs = {}
else: