Skip to content

Commit

Permalink
Fix changebar pdf build and add to Travis releases
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
glikely authored and robherring committed Dec 15, 2017
1 parent fa2e42a commit c2926d0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ cache:
env:
global:
- SPHINXBUILD=~/.local/bin/sphinx-build
- DIFF_COMMIT=v0.1

git:
depth: false

addons:
apt:
packages:
- python-pip
- latexmk
- latexdiff
- libalgorithm-diff-perl
- texlive
- texlive-latex-extra
- texlive-humanities
Expand All @@ -25,8 +29,18 @@ install:
- pip install --user mako
- pip install --user Sphinx

before_script:
- wget https://github.com/ftilmann/latexdiff/releases/download/1.2.1/latexdiff-1.2.1.tar.gz
- tar xvf latexdiff-1.2.1.tar.gz
- export PATH=$PWD/latexdiff-1.2.1/:$PATH

script:
- git checkout $DIFF_COMMIT
- make latexpdf
- mv build/latex build/latex-previous
- git checkout $TRAVIS_COMMIT
- make latexpdf
- make latexdiff
- make html
- make singlehtml

Expand All @@ -36,7 +50,9 @@ deploy:
api_key:
secure: sUwxm3Vbv9p8Uvn/BedgpSbPwnqRJvg0k7ezicEWcJlOF3X6dewX8Qk2x9k9PQ2A8v8GPsf+66D4CABBgz2hIUs68GV7r5ngPHbYQDejI5TjOnYyAuOz8AaCt9+K1nfblqyvg2/4TXKRpHJh9MPzq3WlVB4fvYleGDp1P08xLGCUwrrpyVlA3FQlR3rjPl430GRVCsj/6gEtBs6jHe3/9YhJYUkdgnj8VJI0ISqsSia/wxQyyf1QoydaEhwXVwsapFFCGSX60uo72fs/HBZtBpJOPnkw4g6sZw6lory1k6ZpWxtgRANlDvYXpvnTddiViNprGGJdxvRaKn2uyg/vU4wnrxZsg34uCuvYIyudwDeLkmvsB6NEaRTmqozPH35CLjEkOSrrnTVawYbGVsCX3mtMtVM4ocuxkZSD5CeSX4CNixWMqRMcAtvyh2jtu+gGuuxESgnaWCUoKsPWik8zkBAdCvraN5N7SdwNRRgOiJKMqTAQMFeUklXXPVQt5tm4H79Qjz9vylboeYNDHEaj07/AXX9QSXxXSIXLEvF+haPDPMeoamhCuA1SGlKyBWKT7Uq/BpjpnfpPwvZv0tyW3roq6GN8CqfRQYdj6zKOsIJnU69pVgq8cXCTMTSrjLnlis7hp1gp9hS7kJts58J21v2Qw20+YwhBH3s/OCL4gvg=
file_glob: true
file: "build/latex/devicetree-specification.pdf"
file:
- "build/latex/devicetree-specification.pdf"
- "build/latex/devicetree-specification-changebars.pdf"
skip_cleanup: true
on:
tags: true
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ latex:
latexdiff:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Generating LaTeX changebars..."
$(LATEXDIFF) --type=CULINECHBAR $(BUILDDIR)/latex-previous/devicetree-specification.tex $(BUILDDIR)/latex/devicetree-specification.tex > $(BUILDDIR)/latex/devicetree-specification-changebars.tex
$(LATEXDIFF) --type=UNDERLINE --config VERBATIMENV=sphinxVerbatim $(BUILDDIR)/latex-previous/devicetree-specification.tex $(BUILDDIR)/latex/devicetree-specification.tex > $(BUILDDIR)/latex/devicetree-specification-changebars.tex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Requirements:
On Debian and Ubuntu:

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

0 comments on commit c2926d0

Please sign in to comment.