From bed92f8bdda5330d7e8571c3a4ff4184ab6d9d70 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 21 Mar 2017 12:15:48 +0100 Subject: [PATCH 1/1] latex dir for debugging --- librarian/parser.py | 6 ++++++ librarian/pdf.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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: -- 2.20.1