All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Fix changebar pdf build and add to Travis releases
@ 2017-12-15 14:19 Grant Likely
       [not found] ` <20171215141912.14414-1-grant.likely-5wv7dgnIgG8@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Likely @ 2017-12-15 14:19 UTC (permalink / raw)
  To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA; +Cc: Grant Likely, Rob Herring

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 <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Grant Likely <grant.likely-5wv7dgnIgG8@public.gmane.org>
---
Hi Rob,

I've not figured out how to test this yet. I'll ping you on IRC about running it through its paces before committing the patch.

Cheers,
g.

 .travis.yml | 19 +++++++++++++++++--
 Makefile    |  2 +-
 README.md   | 12 +++++++++++-
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 4026ecb..a4ab9bd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,13 +7,16 @@ cache:
 env:
   global:
       - SPHINXBUILD=~/.local/bin/sphinx-build
+      - DIFF_COMMIT=v0.1
+
+git:
+  depth: false
 
 addons:
   apt:
     packages:
       - python-pip
       - latexmk
-      - latexdiff
       - texlive
       - texlive-latex-extra
       - texlive-humanities
@@ -25,8 +28,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 /tmp/latexdiff.tar.gz
+  - tar xvf /tmp/latexdiff.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
 
@@ -36,7 +49,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
diff --git a/Makefile b/Makefile
index d8eb85e..a2c41a9 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/README.md b/README.md
index 55717b4..e519a58 100644
--- a/README.md
+++ b/README.md
@@ -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 \
 >                  texlive-humanities texlive-generic-recommended graphviz \
 >                  texlive-generic-extra
 >```
@@ -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:
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] Fix changebar pdf build and add to Travis releases
       [not found] ` <20171215141912.14414-1-grant.likely-5wv7dgnIgG8@public.gmane.org>
@ 2017-12-15 22:46   ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2017-12-15 22:46 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, Grant Likely

On Fri, Dec 15, 2017 at 8:19 AM, Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> 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 <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Grant Likely <grant.likely-5wv7dgnIgG8@public.gmane.org>
> ---
> Hi Rob,
>
> I've not figured out how to test this yet. I'll ping you on IRC about running it through its paces before committing the patch.

I fixed up an issue with wget and a missing package dependency and pushed.

Rob

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-15 22:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-15 14:19 [RFC] Fix changebar pdf build and add to Travis releases Grant Likely
     [not found] ` <20171215141912.14414-1-grant.likely-5wv7dgnIgG8@public.gmane.org>
2017-12-15 22:46   ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.