Skip to content

Commit c2926d0

Browse files
glikelyrobherring
authored andcommitted
Fix changebar pdf build and add to Travis releases
Fix the changebar build caused by a bad interaction between Sphinx and latexdiff. latexdiff was not doing the right thing for changes in chapter headers due to "red" and "blue" getting uppercased to "RED" and "BLUE", and creating invalid output when adding some verbatim sections. Fixed by moving to latest latexdiff and adding sphinxVerbatim to the VERBATIMENV config variable. Also update the travis-ci control file to also build the changebar version of the document. Cc: Rob Herring <[email protected]> Signed-off-by: Grant Likely <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent fa2e42a commit c2926d0

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

.travis.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ cache:
77
env:
88
global:
99
- SPHINXBUILD=~/.local/bin/sphinx-build
10+
- DIFF_COMMIT=v0.1
11+
12+
git:
13+
depth: false
1014

1115
addons:
1216
apt:
1317
packages:
1418
- python-pip
1519
- latexmk
16-
- latexdiff
20+
- libalgorithm-diff-perl
1721
- texlive
1822
- texlive-latex-extra
1923
- texlive-humanities
@@ -25,8 +29,18 @@ install:
2529
- pip install --user mako
2630
- pip install --user Sphinx
2731

32+
before_script:
33+
- wget https://github.com/ftilmann/latexdiff/releases/download/1.2.1/latexdiff-1.2.1.tar.gz
34+
- tar xvf latexdiff-1.2.1.tar.gz
35+
- export PATH=$PWD/latexdiff-1.2.1/:$PATH
36+
2837
script:
38+
- git checkout $DIFF_COMMIT
39+
- make latexpdf
40+
- mv build/latex build/latex-previous
41+
- git checkout $TRAVIS_COMMIT
2942
- make latexpdf
43+
- make latexdiff
3044
- make html
3145
- make singlehtml
3246

@@ -36,7 +50,9 @@ deploy:
3650
api_key:
3751
secure: sUwxm3Vbv9p8Uvn/BedgpSbPwnqRJvg0k7ezicEWcJlOF3X6dewX8Qk2x9k9PQ2A8v8GPsf+66D4CABBgz2hIUs68GV7r5ngPHbYQDejI5TjOnYyAuOz8AaCt9+K1nfblqyvg2/4TXKRpHJh9MPzq3WlVB4fvYleGDp1P08xLGCUwrrpyVlA3FQlR3rjPl430GRVCsj/6gEtBs6jHe3/9YhJYUkdgnj8VJI0ISqsSia/wxQyyf1QoydaEhwXVwsapFFCGSX60uo72fs/HBZtBpJOPnkw4g6sZw6lory1k6ZpWxtgRANlDvYXpvnTddiViNprGGJdxvRaKn2uyg/vU4wnrxZsg34uCuvYIyudwDeLkmvsB6NEaRTmqozPH35CLjEkOSrrnTVawYbGVsCX3mtMtVM4ocuxkZSD5CeSX4CNixWMqRMcAtvyh2jtu+gGuuxESgnaWCUoKsPWik8zkBAdCvraN5N7SdwNRRgOiJKMqTAQMFeUklXXPVQt5tm4H79Qjz9vylboeYNDHEaj07/AXX9QSXxXSIXLEvF+haPDPMeoamhCuA1SGlKyBWKT7Uq/BpjpnfpPwvZv0tyW3roq6GN8CqfRQYdj6zKOsIJnU69pVgq8cXCTMTSrjLnlis7hp1gp9hS7kJts58J21v2Qw20+YwhBH3s/OCL4gvg=
3852
file_glob: true
39-
file: "build/latex/devicetree-specification.pdf"
53+
file:
54+
- "build/latex/devicetree-specification.pdf"
55+
- "build/latex/devicetree-specification-changebars.pdf"
4056
skip_cleanup: true
4157
on:
4258
tags: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ latex:
144144
latexdiff:
145145
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
146146
@echo "Generating LaTeX changebars..."
147-
$(LATEXDIFF) --type=CULINECHBAR $(BUILDDIR)/latex-previous/devicetree-specification.tex $(BUILDDIR)/latex/devicetree-specification.tex > $(BUILDDIR)/latex/devicetree-specification-changebars.tex
147+
$(LATEXDIFF) --type=UNDERLINE --config VERBATIMENV=sphinxVerbatim $(BUILDDIR)/latex-previous/devicetree-specification.tex $(BUILDDIR)/latex/devicetree-specification.tex > $(BUILDDIR)/latex/devicetree-specification-changebars.tex
148148
@echo "Running LaTeX files through pdflatex..."
149149
$(MAKE) -C $(BUILDDIR)/latex all-pdf
150150
@echo

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Requirements:
1919
On Debian and Ubuntu:
2020

2121
>```
22-
># apt-get install python-sphinx latexdiff texlive texlive-latex-extra \
22+
># apt-get install python-sphinx texlive texlive-latex-extra libalgorithm-diff-perl \
2323
> texlive-humanities texlive-generic-recommended graphviz \
2424
> texlive-generic-extra
2525
>```
@@ -33,6 +33,16 @@ On Debian and Ubuntu:
3333
>$ export SPHINXBUILD=~/.local/bin/sphinx-build
3434
>```
3535
>
36+
>You will need latexdiff v1.2.1 or later to create the changebars PDF version
37+
>of the document.
38+
>Until distributions catch up with the latest release you will need to install
39+
>it directly from the github repo.
40+
>
41+
>```
42+
>$ git clone https://github.com/ftilmann/latexdiff
43+
>$ export PATH=$PWD/latexdiff/:$PATH
44+
>```
45+
>
3646
>Export SPHINXBUILD (see above) if Sphinx was installed with pip --user, then follow Make commands below
3747
3848
On Mac OS X:

0 commit comments

Comments
 (0)