From: Jan Szejko Date: Tue, 21 Mar 2017 11:15:48 +0000 (+0100) Subject: latex dir for debugging X-Git-Tag: 1.7~59 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/bed92f8bdda5330d7e8571c3a4ff4184ab6d9d70?ds=inline latex dir for debugging --- diff --git a/librarian/parser.py b/librarian/parser.py index 502192f..e4f1340 100644 --- a/librarian/parser.py +++ b/librarian/parser.py @@ -210,6 +210,12 @@ class WLDocument(object): cover_class = DefaultEbookCover return cover_class(self.book_info, *args, **kwargs).output_file() + # for debugging only + def latex_dir(self, *args, **kwargs): + kwargs['latex_dir'] = True + from librarian import pdf + return pdf.transform(self, *args, **kwargs) + def save_output_file(self, output_file, output_path=None, output_dir_path=None, make_author_dir=False, ext=None): if output_dir_path: save_path = output_dir_path diff --git a/librarian/pdf.py b/librarian/pdf.py index 927b50d..8e84dce 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -200,7 +200,7 @@ def package_available(package, args='', verbose=False): def transform(wldoc, verbose=False, save_tex=None, morefloats=None, - cover=None, flags=None, customizations=None, ilustr_path=''): + cover=None, flags=None, customizations=None, ilustr_path='', latex_dir=False): """ produces a PDF file with XeLaTeX wldoc: a WLDocument @@ -305,6 +305,9 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, shutil.copy(get_resource('pdf/wl.cls'), temp) shutil.copy(get_resource('res/wl-logo.png'), temp) + if latex_dir: + return temp + try: cwd = os.getcwd() except OSError: