devicetree-spec.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: [PATCH] Add target to generate changebar pdfs
Date: Fri,  6 May 2016 15:36:08 +0100	[thread overview]
Message-ID: <1462545368-21103-1-git-send-email-grant.likely@linaro.org> (raw)

Add the "latexdiff" make target to generate a diff between the current
build and the previous release of the document. Type "make latexdiff" to
use this new target.

This patch is inelegant since it hard codes the file name, but it works.
It can be cleaned up to be more generic, but that isn't immediately
necessary.

Signed-off-by: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 Makefile  | 13 +++++++++++++
 README.md |  5 ++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 6c1247b3d0f4..8e3bd9f7c733 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,9 @@
 SPHINXOPTS    =
 SPHINXBUILD   = sphinx-build
 PAPER         =
+RELEASEDIR    = release
 BUILDDIR      = build
+LATEXDIFF     = latexdiff
 
 # User-friendly check for sphinx-build
 ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
@@ -34,6 +36,7 @@ help:
 	@echo "  epub       to make an epub"
 	@echo "  epub3      to make an epub3"
 	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexdiff  to make LaTeX files including changebars against previous release"
 	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
 	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
 	@echo "  text       to make text files"
@@ -138,6 +141,16 @@ latex:
 	@echo "Run \`make' in that directory to run these through (pdf)latex" \
 	      "(use \`make latexpdf' here to do that automatically)."
 
+.PHONY: latexdiff
+latexdiff:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Generating LaTeX changebars..."
+	$(LATEXDIFF) --type=CULINECHBAR $(RELEASEDIR)/latex/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
+	@echo "latexdiff finished; the PDF files are in $(BUILDDIR)/latex."
+
 .PHONY: latexpdf
 latexpdf:
 	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
diff --git a/README.md b/README.md
index 9f56146a1d2f..60415c07dc97 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,10 @@ Requirements:
 
 On Ubuntu:
 
-`# apt-get install python-sphinx texlive texlive-latex-extra texlive-humanities graphviz`
+```
+# apt-get install python-sphinx latexdiff texlive texlive-latex-extra \
+                  texlive-humanities texlive-generic-recommended graphviz
+```
 
 If the version of python-spinx installed is too old, then an additional
 new version can be installed with the Python package installer:
-- 
2.5.0

                 reply	other threads:[~2016-05-06 14:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462545368-21103-1-git-send-email-grant.likely@linaro.org \
    --to=grant.likely-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).