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
This commit is contained in:
Andrew Hutchings 2012-11-18 10:17:34 +00:00
parent d01c2a82c1
commit 3437fb0d47
3 changed files with 14 additions and 30 deletions

View File

@ -27,8 +27,7 @@ import sys
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # 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. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@ -191,15 +190,15 @@ htmlhelp_basename = 'LBaaSdoc'
# (source start file, target name, title, author, # (source start file, target name, title, author,
# documentclass [howto/manual]). # documentclass [howto/manual]).
latex_documents = [ 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'), 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_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 name of an image file (relative to this directory) to place at the top of
# the title page. # the title page.

View File

@ -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

View File

@ -39,15 +39,22 @@ try:
class local_BuildDoc(BuildDoc): class local_BuildDoc(BuildDoc):
def run(self): def run(self):
# too hard to build PDFs on Mac
builders = ['html', 'man'] builders = ['html', 'man']
if sys.platform != 'darwin':
builders.append('pdf')
for builder in builders: for builder in builders:
self.builder = builder self.builder = builder
self.finalize_options() self.finalize_options()
BuildDoc.run(self) 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'] = local_BuildDoc
ci_cmdclass['build_sphinx_latex'] = local_BuildDoc_latex
except Exception: except Exception:
pass pass
@ -55,9 +62,6 @@ ci_cmdclass['test'] = PyTest
setup_reqs = ['Sphinx'] setup_reqs = ['Sphinx']
if sys.platform != 'darwin':
setup_reqs.append('rst2pdf')
# Get the version number # Get the version number
execfile('libra/__init__.py') execfile('libra/__init__.py')