Re-organize doc building

* Split out PDF building into a separate tox target
* Run HTML builder the same way as by Infra
* Omit Latex builder as it's not used

Change-Id: Idae8ce297fdcc05141749d31f343cb29ce89ca66
This commit is contained in:
Ilya Shakhat 2016-03-31 17:15:46 +03:00
parent 29a7ad7fce
commit f9d4e0e078
4 changed files with 38 additions and 15 deletions

View File

@ -170,39 +170,39 @@
toc7: toc7:
parent: toc parent: toc
leftIndent: 100 leftIndent: 120
toc8: toc8:
parent: toc parent: toc
leftIndent: 100 leftIndent: 140
toc9: toc9:
parent: toc parent: toc
leftIndent: 100 leftIndent: 160
toc10: toc10:
parent: toc parent: toc
leftIndent: 100 leftIndent: 160
toc11: toc11:
parent: toc parent: toc
leftIndent: 100 leftIndent: 160
toc12: toc12:
parent: toc parent: toc
leftIndent: 100 leftIndent: 160
toc13: toc13:
parent: toc parent: toc
leftIndent: 100 leftIndent: 160
toc14: toc14:
parent: toc parent: toc
leftIndent: 100 leftIndent: 160
toc15: toc15:
parent: toc parent: toc
leftIndent: 100 leftIndent: 160
footer: footer:
parent: normal parent: normal
@ -320,7 +320,7 @@
parent: heading parent: heading
fontName: stdBold fontName: stdBold
textColor: #D32F1A textColor: #D32F1A
fontSize: 200% fontSize: 250%
spaceBefore: 30 spaceBefore: 30
spaceAfter: 30 spaceAfter: 30
@ -328,20 +328,21 @@
parent: heading parent: heading
fontName: stdBold fontName: stdBold
textColor: #D32F1A textColor: #D32F1A
fontSize: 150% fontSize: 180%
spaceBefore: 20 spaceBefore: 20
spaceAfter: 14 spaceAfter: 14
heading3: heading3:
parent: heading parent: heading
fontName: stdBold fontName: stdBold
fontSize: 125% fontSize: 140%
spaceBefore: 12 spaceBefore: 12
spaceAfter: 8 spaceAfter: 8
heading4: heading4:
parent: heading parent: heading
fontName: stdBold fontName: stdBold
fontSize: 115%
spaceBefore: 12 spaceBefore: 12
spaceBefore: 8 spaceBefore: 8
@ -481,6 +482,7 @@
table-body: table-body:
parent : normal parent : normal
fontSize: 8
dedication: dedication:
parent : normal parent : normal

View File

@ -432,3 +432,5 @@ pdf_use_numbered_links = False
# Background images fitting mode # Background images fitting mode
pdf_fit_background_mode = 'scale' pdf_fit_background_mode = 'scale'
pdf_default_dpi = 72

11
tools/build_pdf.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash -xe
# copy sources to temporary folder
TEMP_DIR="$(mktemp -d)"
cp -r doc/source/* ${TEMP_DIR}
# convert SVG to PNG
find ${TEMP_DIR} -name *svg | sed "s/\.svg$//" | xargs -I% cairosvg "%.svg" -f pdf -o "%.pdf"
# run Sphinx
sphinx-build -b pdf ${TEMP_DIR} doc/build/pdf

14
tox.ini
View File

@ -25,9 +25,17 @@ commands = flake8
[testenv:docs] [testenv:docs]
commands = commands =
sphinx-build -b html doc/source/ doc/build/html python setup.py build_sphinx
sphinx-build -b latex doc/source/ doc/build/latex
sphinx-build -b pdf doc/source/ doc/build/pdf [testenv:pdf]
deps =
cairosvg
lxml
tinycss
cssselect
rst2pdf
whitelist_externals = bash
commands = bash tools/build_pdf.sh
[flake8] [flake8]
show-source = true show-source = true