diff --git a/docs/Makefile b/docs/Makefile index 101260607b..e74f6866f9 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -190,3 +190,6 @@ pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +pdf: + $(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf diff --git a/docs/make-docsite.sh b/docs/make-docsite.sh index 8c2488ca04..bc317c3e63 100755 --- a/docs/make-docsite.sh +++ b/docs/make-docsite.sh @@ -11,4 +11,7 @@ else source virtualenv/Scripts/activate fi +# TODO: The PDF rendering is pretty ugly and can be improved a lot. +make pdf +mv build/pdf/corda-developer-site.pdf build/html/_static/corda-developer-site.pdf make html diff --git a/docs/requirements.txt b/docs/requirements.txt index f759847b57..fcb4fd0faf 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -10,3 +10,4 @@ six==1.10.0 snowballstemmer==1.2.1 Sphinx==1.4.4 sphinx-rtd-theme==0.1.9 +rst2pdf==0.93 diff --git a/docs/source/conf.py b/docs/source/conf.py index 9907563cf9..133f83c6bd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,7 +28,13 @@ import sphinx_rtd_theme # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = ['rst2pdf.pdfbuilder'] + +# PDF configuration +pdf_documents = [('index', u'corda-developer-site', u'Corda Developer Documentation', u'R3')] +pdf_stylesheets = ['sphinx', 'kerning', 'a4', 'murphy', 'tenpoint'] +pdf_compressed = True +pdf_fit_mode = "shrink" # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/source/index.rst b/docs/source/index.rst index 5a24540a8c..245c230beb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -22,8 +22,12 @@ If you have questions or comments, then get in touch on `Slack