From 3437fb0d47580b570c48a495a63350a2ecb10708 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Sun, 18 Nov 2012 10:17:34 +0000 Subject: [PATCH] Switch to latex for PDF docs The output of latex is much nicer than rst2pdf. So: 1. Removed all the rst2pdf stuff 2. Made the latex build a new setup.py command 3. Configured latex build options in conf.py There are 2 final steps that need to be run to actually generate PDFs which will be included in the packaging Makefile coming soon. Change-Id: I1359790e23c02777866d0538180c67a0d0eb4d25 --- doc/conf.py | 9 ++++----- doc/libra.style | 19 ------------------- setup.py | 16 ++++++++++------ 3 files changed, 14 insertions(+), 30 deletions(-) delete mode 100644 doc/libra.style diff --git a/doc/conf.py b/doc/conf.py index 23f4e883..a7830667 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -27,8 +27,7 @@ import sys # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -if sys.platform != 'darwin': - extensions = ['rst2pdf.pdfbuilder'] +#extensions = ['rst2pdf.pdfbuilder'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -191,15 +190,15 @@ htmlhelp_basename = 'LBaaSdoc' # (source start file, target name, title, author, # documentclass [howto/manual]). latex_documents = [ - ('index', 'LBaaS.tex', u'LBaaS Worker and Pool Manager Documentation', + ('index', 'Libra-{0}.tex'.format(version), u'Libra Client, Worker and Pool Manager Documentation', u'Andrew Hutchings and David Shrewsbury', 'manual'), ] -pdf_documents = [('index', 'Libra-{0}'.format(version), u'Libra Client, Worker and Pool Manager Documentation', u'Andrew Hutchings and David Shrewsbury')] +#pdf_documents = [('index', 'Libra-{0}'.format(version), u'Libra Client, Worker and Pool Manager Documentation', u'Andrew Hutchings and David Shrewsbury')] #pdf_break_level = 1 -pdf_stylesheets = ['sphinx', 'libra'] +#pdf_stylesheets = ['sphinx', 'libra'] # The name of an image file (relative to this directory) to place at the top of # the title page. diff --git a/doc/libra.style b/doc/libra.style deleted file mode 100644 index 64740021..00000000 --- a/doc/libra.style +++ /dev/null @@ -1,19 +0,0 @@ -pageSetup: - margin-left: 8mm - margin-right: 8mm - -pageTemplates: - twoColumn: - frames: [] - [0cm, 0cm, 100%, 100%] - showHeader: true - showFooter: true - -styles: - heading: - backColor: transparent - borderColor: transparent - code: - borderPadding: [4, 4, 4, 4] - backColor: #EEFFFF - borderColor: #99CCCC diff --git a/setup.py b/setup.py index f138fce8..ff20b48d 100644 --- a/setup.py +++ b/setup.py @@ -39,15 +39,22 @@ try: class local_BuildDoc(BuildDoc): def run(self): - # too hard to build PDFs on Mac builders = ['html', 'man'] - if sys.platform != 'darwin': - builders.append('pdf') for builder in builders: self.builder = builder self.finalize_options() BuildDoc.run(self) + + class local_BuildDoc_latex(BuildDoc): + def run(self): + builders = ['latex'] + for builder in builders: + self.builder = builder + self.finalize_options() + BuildDoc.run(self) + ci_cmdclass['build_sphinx'] = local_BuildDoc + ci_cmdclass['build_sphinx_latex'] = local_BuildDoc_latex except Exception: pass @@ -55,9 +62,6 @@ ci_cmdclass['test'] = PyTest setup_reqs = ['Sphinx'] -if sys.platform != 'darwin': - setup_reqs.append('rst2pdf') - # Get the version number execfile('libra/__init__.py')