DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: john.mcnamara@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v5 4/7] doc: add pdf output
Date: Thu, 19 Mar 2015 12:23:21 +0100	[thread overview]
Message-ID: <1426764204-3882-5-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1426764204-3882-1-git-send-email-thomas.monjalon@6wind.com>

From: John McNamara <john.mcnamara@intel.com>

Add make system support for building PDF versions of
the guides. Requires Python Sphinx and TexLive Full.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 doc/guides/conf.py | 13 +++++++++++--
 mk/rte.sdkdoc.mk   | 46 ++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index fba34a6..264b0cd 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -1,5 +1,5 @@
 #   BSD LICENSE
-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,15 @@ project = 'DPDK'
 
 html_show_copyright = False
 
-version = subprocess.check_output(["make","-sRrC","../../", "showversion"])
+version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion'])
+release = version
 
 master_doc = 'index'
+
+latex_documents = [
+    ('index',
+     'doc.tex',
+     '',
+     '',
+     'manual')
+]
diff --git a/mk/rte.sdkdoc.mk b/mk/rte.sdkdoc.mk
index dabc0d6..5b44083 100644
--- a/mk/rte.sdkdoc.mk
+++ b/mk/rte.sdkdoc.mk
@@ -1,7 +1,7 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
-#   Copyright(c) 2013 6WIND S.A.
+#   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+#   Copyright(c) 2013-2015 6WIND S.A.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -37,23 +37,33 @@ endif
 endif
 
 RTE_SPHINX_BUILD = sphinx-build
+RTE_PDFLATEX_VERBOSE := --interaction=nonstopmode
+
 ifndef V
 RTE_SPHINX_VERBOSE := -q
+RTE_PDFLATEX_VERBOSE := --interaction=batchmode
+RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
 endif
 ifeq '$V' '0'
 RTE_SPHINX_VERBOSE := -q
+RTE_PDFLATEX_VERBOSE := --interaction=batchmode
+RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
 endif
 
+RTE_PDF_DPI ?= 300
+
+RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/))
+
 .PHONY: help
 help:
 	@cat $(RTE_SDK)/doc/build-sdk-quick.txt
 	@$(MAKE) -rR showconfigs | sed 's,^,\t\t\t\t,'
 
 .PHONY: all
-all: api-html guides-html
+all: api-html guides-html guides-pdf
 
 .PHONY: clean
-clean: api-html-clean guides-html-clean
+clean: api-html-clean guides-html-clean guides-pdf-clean
 
 .PHONY: api-html
 api-html: api-html-clean
@@ -79,7 +89,31 @@ guides-%-clean:
 	$(Q)rm -rf $(RTE_OUTPUT)/doc/$*/guides
 	$(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/$* 2>&- || true
 
+guides-pdf-clean: guides-pdf-img-clean
+guides-pdf-img-clean:
+	$(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
+
+guides-pdf: $(addprefix guides-pdf-, $(notdir $(RTE_GUIDES:/=))) ;
 guides-%:
-	@echo 'sphinx for guides...'
+	@echo 'sphinx processing $@...'
 	$(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \
-		-c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides $(RTE_OUTPUT)/doc/$*/guides
+		-c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides \
+		$(RTE_OUTPUT)/doc/$*/guides
+
+guides-pdf-%:
+	@echo 'sphinx processing $@...'
+	$(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \
+		-c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides/$* \
+		$(RTE_OUTPUT)/doc/pdf/guides/$*
+	$(Q)rm -f $^
+	@echo 'pdflatex processing $@...'
+	$(Q)$(MAKE) all-pdf -sC $(RTE_OUTPUT)/doc/pdf/guides/$* \
+		LATEXOPTS=$(RTE_PDFLATEX_VERBOSE)
+	$(Q)mv $(RTE_OUTPUT)/doc/pdf/guides/$*/doc.pdf \
+		$(RTE_OUTPUT)/doc/pdf/guides/$*.pdf
+
+# Each PDF depends on generated images *.pdf from *.svg
+$(foreach guide, $(RTE_GUIDES), $(foreach img, $(wildcard $(guide)img/*.svg), \
+	$(eval guides-pdf-$(notdir $(guide:/=)): $(img:svg=pdf))))
+%.pdf: %.svg
+	$(Q)inkscape -d $(RTE_PDF_DPI) -D -f $< -A $@ $(RTE_INKSCAPE_VERBOSE)
-- 
2.2.2

  parent reply	other threads:[~2015-03-19 11:24 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 17:14 [dpdk-dev] [PATCH RFC 0/1] Add 'make pdf' target to convert guide docs to pdf John McNamara
2015-01-14 17:14 ` [dpdk-dev] [PATCH 1/2] doc: " John McNamara
2015-01-30 18:13 ` [dpdk-dev] [PATCH v2 0/4] " John McNamara
2015-01-30 18:13   ` [dpdk-dev] [PATCH v2 1/4] mk: Add 'make doc-pdf' " John McNamara
2015-01-30 20:52     ` Thomas Monjalon
     [not found]       ` <B27915DBBA3421428155699D51E4CFE2EAC4D2@IRSMSX103.ger.corp.intel.com>
     [not found]         ` <2564393.TY2qeNvaqR@xps13>
2015-02-03 13:24           ` Mcnamara, John
2015-01-30 18:13   ` [dpdk-dev] [PATCH v2 2/4] doc: Add Sphinx config to build pdf version of guides John McNamara
2015-01-30 21:03     ` Thomas Monjalon
2015-01-30 18:13   ` [dpdk-dev] [PATCH v2 3/4] doc: Fix encoding of (r) character John McNamara
2015-01-30 18:13   ` [dpdk-dev] [PATCH v2 4/4] doc: Refactored split cell formatting in one table John McNamara
2015-01-30 21:05     ` Thomas Monjalon
2015-01-30 20:25   ` [dpdk-dev] [PATCH v2 0/4] doc: Add 'make pdf' target to convert guide docs to pdf Thomas Monjalon
     [not found] ` <1422882967-27060-1-git-send-email-john.mcnamara@intel.com>
     [not found]   ` <1422882967-27060-3-git-send-email-john.mcnamara@intel.com>
2015-02-03 10:30     ` [dpdk-dev] [PATCH v3 2/4] doc: Add Sphinx config to build pdf version of guides Iremonger, Bernard
2015-02-03 14:11 ` [dpdk-dev] [PATCH v4 0/5] doc: Add 'make pdf' target to convert guide docs to pdf John McNamara
2015-02-03 14:11   ` [dpdk-dev] [PATCH v4 1/5] mk: Add 'make doc-pdf' " John McNamara
2015-02-16 12:19     ` Iremonger, Bernard
2015-02-16 12:55       ` Mcnamara, John
2015-02-16 14:16       ` Iremonger, Bernard
2015-02-03 14:11   ` [dpdk-dev] [PATCH v4 2/5] doc: Add Sphinx config to build pdf version of guides John McNamara
2015-02-16 14:20     ` Iremonger, Bernard
2015-02-03 14:11   ` [dpdk-dev] [PATCH v4 3/5] doc: Fix encoding of (r) character John McNamara
2015-02-13 14:29     ` Iremonger, Bernard
2015-02-13 15:59       ` Mcnamara, John
2015-02-13 16:42         ` Iremonger, Bernard
2015-02-16 14:22     ` Iremonger, Bernard
2015-02-03 14:11   ` [dpdk-dev] [PATCH v4 4/5] doc: Refactored split cell formatting in one table John McNamara
2015-02-16 14:23     ` Iremonger, Bernard
2015-02-03 14:11   ` [dpdk-dev] [PATCH v4 5/5] doc: Convert image extensions to wildcard John McNamara
2015-02-16 12:09     ` Iremonger, Bernard
2015-02-16 12:43       ` Mcnamara, John
2015-02-16 14:25     ` Iremonger, Bernard
2015-03-19 11:23   ` [dpdk-dev] [PATCH v5 0/7] add doc-guides-pdf target Thomas Monjalon
2015-03-19 11:23     ` [dpdk-dev] [PATCH v5 1/7] doc: fix encoding of (r) character Thomas Monjalon
2015-03-19 11:23     ` [dpdk-dev] [PATCH v5 2/7] doc: refactor split cell formatting in table Thomas Monjalon
2015-03-19 11:23     ` [dpdk-dev] [PATCH v5 3/7] doc: convert image extensions to wildcard Thomas Monjalon
2015-03-19 11:23     ` Thomas Monjalon [this message]
2015-03-19 11:23     ` [dpdk-dev] [PATCH v5 5/7] doc: fix version for python 3 Thomas Monjalon
2015-03-19 11:23     ` [dpdk-dev] [PATCH v5 6/7] doc: tune pdf fonts Thomas Monjalon
2015-03-19 11:23     ` [dpdk-dev] [PATCH v5 7/7] doc: remove blank pages in pdf Thomas Monjalon
2015-03-19 13:47     ` [dpdk-dev] [PATCH v5 0/7] add doc-guides-pdf target Mcnamara, John
2015-03-19 17:04       ` Thomas Monjalon

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=1426764204-3882-5-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    /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 NNTP newsgroup(s).