diff mbox

[dpdk-dev,v2,2/4] doc: Add Sphinx config to build pdf version of guides

Message ID 1422641608-8514-3-git-send-email-john.mcnamara@intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Mcnamara, John Jan. 30, 2015, 6:13 p.m. UTC
Add Python Sphinx config to allow conversion of guides
to PDF format.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
---
 doc/guides/conf.py                |   51 ++++++++++++++++++++++++++++++++++---
 doc/guides/freebsd_gsg/conf.py    |   41 +++++++++++++++++++++++++++++
 doc/guides/linux_gsg/conf.py      |   41 +++++++++++++++++++++++++++++
 doc/guides/prog_guide/conf.py     |   41 +++++++++++++++++++++++++++++
 doc/guides/rel_notes/conf.py      |   41 +++++++++++++++++++++++++++++
 doc/guides/sample_app_ug/conf.py  |   41 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/conf.py |   41 +++++++++++++++++++++++++++++
 7 files changed, 293 insertions(+), 4 deletions(-)
 create mode 100644 doc/guides/freebsd_gsg/conf.py
 create mode 100644 doc/guides/linux_gsg/conf.py
 create mode 100644 doc/guides/prog_guide/conf.py
 create mode 100644 doc/guides/rel_notes/conf.py
 create mode 100644 doc/guides/sample_app_ug/conf.py
 create mode 100644 doc/guides/testpmd_app_ug/conf.py

Comments

Thomas Monjalon Jan. 30, 2015, 9:03 p.m. UTC | #1
2015-01-30 18:13, John McNamara:
> Add Python Sphinx config to allow conversion of guides
> to PDF format.
> 
> Signed-off-by: John McNamara <john.mcnamara@intel.com>
> ---
>  doc/guides/conf.py                |   51 ++++++++++++++++++++++++++++++++++---
>  doc/guides/freebsd_gsg/conf.py    |   41 +++++++++++++++++++++++++++++
>  doc/guides/linux_gsg/conf.py      |   41 +++++++++++++++++++++++++++++
>  doc/guides/prog_guide/conf.py     |   41 +++++++++++++++++++++++++++++
>  doc/guides/rel_notes/conf.py      |   41 +++++++++++++++++++++++++++++
>  doc/guides/sample_app_ug/conf.py  |   41 +++++++++++++++++++++++++++++
>  doc/guides/testpmd_app_ug/conf.py |   41 +++++++++++++++++++++++++++++
>  7 files changed, 293 insertions(+), 4 deletions(-)
>  create mode 100644 doc/guides/freebsd_gsg/conf.py
>  create mode 100644 doc/guides/linux_gsg/conf.py
>  create mode 100644 doc/guides/prog_guide/conf.py
>  create mode 100644 doc/guides/rel_notes/conf.py
>  create mode 100644 doc/guides/sample_app_ug/conf.py
>  create mode 100644 doc/guides/testpmd_app_ug/conf.py

I think it is possible to use the existing conf.py.
The only thing different in all these files is the generated filename
which could be computed from the title or extracted from an rst comment.

> --- a/doc/guides/conf.py
> +++ b/doc/guides/conf.py
> +texinfo_documents = [
> +    ('index',
> +     '',
> +     '',
> +     '',
> +     '',
> +     '',
> +     'Miscellaneous')]

Why texinfo?

> +
> +# Override the dafault Latex formatter.

Typo: default

> +class CustomLatexFormatter(LatexFormatter):
> +
> +    def __init__(self, **options):
> +
> +        super(CustomLatexFormatter, self).__init__(**options)
> +
> +        self.verboptions = r"formatcom=\footnotesize"

Please comment this line. I don't understand.

> +
> +PygmentsBridge.latex_formatter = CustomLatexFormatter
Iremonger, Bernard Feb. 2, 2015, 10:19 a.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of John McNamara
> Sent: Friday, January 30, 2015 6:13 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 2/4] doc: Add Sphinx config to build pdf version of guides
> 
> Add Python Sphinx config to allow conversion of guides to PDF format.
> 
> Signed-off-by: John McNamara <john.mcnamara@intel.com>
> ---
>  doc/guides/conf.py                |   51 ++++++++++++++++++++++++++++++++++---
>  doc/guides/freebsd_gsg/conf.py    |   41 +++++++++++++++++++++++++++++
>  doc/guides/linux_gsg/conf.py      |   41 +++++++++++++++++++++++++++++
>  doc/guides/prog_guide/conf.py     |   41 +++++++++++++++++++++++++++++
>  doc/guides/rel_notes/conf.py      |   41 +++++++++++++++++++++++++++++
>  doc/guides/sample_app_ug/conf.py  |   41 +++++++++++++++++++++++++++++
>  doc/guides/testpmd_app_ug/conf.py |   41 +++++++++++++++++++++++++++++
>  7 files changed, 293 insertions(+), 4 deletions(-)  create mode 100644
> doc/guides/freebsd_gsg/conf.py  create mode 100644 doc/guides/linux_gsg/conf.py  create mode
> 100644 doc/guides/prog_guide/conf.py  create mode 100644 doc/guides/rel_notes/conf.py  create
> mode 100644 doc/guides/sample_app_ug/conf.py  create mode 100644
> doc/guides/testpmd_app_ug/conf.py
> 
> diff --git a/doc/guides/conf.py b/doc/guides/conf.py index 385af03..71253c5 100644
> --- a/doc/guides/conf.py
> +++ b/doc/guides/conf.py
> @@ -28,12 +28,55 @@
>  #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>  #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> 
> -import subprocess
> +from subprocess import check_output
> +from sphinx.highlighting import PygmentsBridge from
> +pygments.formatters.latex import LatexFormatter
> 
>  project = 'DPDK'
> -
>  copyright = '2014, Intel'

Copyright should be 2015 now.

> +master_doc = 'index'
> 
> -version = subprocess.check_output(["make","-sRrC","../../", "showversion"])
> 
> -master_doc = 'index'
> +# Configuration for latex/pdf files.
> +latex_preamble = r"""
> +\usepackage[utf8]{inputenc}
> +\usepackage{DejaVuSansMono}
> +\usepackage[T1]{fontenc}
> +\usepackage{helvet}
> +\renewcommand{\familydefault}{\sfdefault}
> +
> +\RecustomVerbatimEnvironment{Verbatim}{Verbatim}{xleftmargin=5mm}
> +"""
> +
> +latex_elements = {
> +    'papersize': 'a4paper',
> +    'pointsize': '11pt',
> +    'preamble': latex_preamble}
> +
> +latex_documents = [
> +    ('index',
> +     'dpdk_docs.tex',
> +     '',
> +     '',
> +     'manual')]
> +
> +texinfo_documents = [
> +    ('index',
> +     '',
> +     '',
> +     '',
> +     '',
> +     '',
> +     'Miscellaneous')]
> +
> +
> +# Override the dafault Latex formatter.
> +class CustomLatexFormatter(LatexFormatter):
> +
> +    def __init__(self, **options):
> +
> +        super(CustomLatexFormatter, self).__init__(**options)
> +
> +        self.verboptions = r"formatcom=\footnotesize"
> +
> +PygmentsBridge.latex_formatter = CustomLatexFormatter
> diff --git a/doc/guides/freebsd_gsg/conf.py b/doc/guides/freebsd_gsg/conf.py new file mode 100644
> index 0000000..fd97d69
> --- /dev/null
> +++ b/doc/guides/freebsd_gsg/conf.py
> @@ -0,0 +1,41 @@
> +#   BSD LICENSE
> +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.

Copyright should be 2010-2015 now.

> +#   All rights reserved.
> +#
> +#   Redistribution and use in source and binary forms, with or without
> +#   modification, are permitted provided that the following conditions
> +#   are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#   notice, this list of conditions and the following disclaimer in
> +#   the documentation and/or other materials provided with the
> +#   distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#   contributors may be used to endorse or promote products derived
> +#   from this software without specific prior written permission.
> +#
> +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +execfile('../conf.py')
> +
> +release = check_output(['make', '-sRrC', '../../../', 'showversion'])
> +
> +# Overide the latex_documents to change the output name.
> +latex_documents = [
> +    ('index',
> +     'dpdk_freebsd_getting_started_guide.tex',
> +     '',
> +     '',
> +     'manual')]
> diff --git a/doc/guides/linux_gsg/conf.py b/doc/guides/linux_gsg/conf.py new file mode 100644 index
> 0000000..8086763
> --- /dev/null
> +++ b/doc/guides/linux_gsg/conf.py
> @@ -0,0 +1,41 @@
> +#   BSD LICENSE
> +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.

Copyright should be 2010-2015 now.

> +#   All rights reserved.
> +#
> +#   Redistribution and use in source and binary forms, with or without
> +#   modification, are permitted provided that the following conditions
> +#   are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#   notice, this list of conditions and the following disclaimer in
> +#   the documentation and/or other materials provided with the
> +#   distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#   contributors may be used to endorse or promote products derived
> +#   from this software without specific prior written permission.
> +#
> +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +execfile('../conf.py')
> +
> +release = check_output(['make', '-sRrC', '../../../', 'showversion'])
> +
> +# Overide the latex_documents to change the output name.
> +latex_documents = [
> +    ('index',
> +     'dpdk_linux_getting_started_guide.tex',
> +     '',
> +     '',
> +     'manual')]
> diff --git a/doc/guides/prog_guide/conf.py b/doc/guides/prog_guide/conf.py new file mode 100644
> index 0000000..6a9e74c
> --- /dev/null
> +++ b/doc/guides/prog_guide/conf.py
> @@ -0,0 +1,41 @@
> +#   BSD LICENSE
> +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.

Copyright should be 2010-2015 now.

> +#   All rights reserved.
> +#
> +#   Redistribution and use in source and binary forms, with or without
> +#   modification, are permitted provided that the following conditions
> +#   are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#   notice, this list of conditions and the following disclaimer in
> +#   the documentation and/or other materials provided with the
> +#   distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#   contributors may be used to endorse or promote products derived
> +#   from this software without specific prior written permission.
> +#
> +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +execfile('../conf.py')
> +
> +release = check_output(['make', '-sRrC', '../../../', 'showversion'])
> +
> +# Overide the latex_documents to change the output name.
> +latex_documents = [
> +    ('index',
> +     'dpdk_programmers_guide.tex',
> +     '',
> +     '',
> +     'manual')]
> diff --git a/doc/guides/rel_notes/conf.py b/doc/guides/rel_notes/conf.py new file mode 100644
> index 0000000..9ddf4c2
> --- /dev/null
> +++ b/doc/guides/rel_notes/conf.py
> @@ -0,0 +1,41 @@
> +#   BSD LICENSE
> +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.

Copyright should be 2010-2015 now.

> +#   All rights reserved.
> +#
> +#   Redistribution and use in source and binary forms, with or without
> +#   modification, are permitted provided that the following conditions
> +#   are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#   notice, this list of conditions and the following disclaimer in
> +#   the documentation and/or other materials provided with the
> +#   distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#   contributors may be used to endorse or promote products derived
> +#   from this software without specific prior written permission.
> +#
> +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +execfile('../conf.py')
> +
> +release = check_output(['make', '-sRrC', '../../../', 'showversion'])
> +
> +# Overide the latex_documents to change the output name.
> +latex_documents = [
> +    ('index',
> +     'dpdk_release_notes.tex',
> +     '',
> +     '',
> +     'manual')]
> diff --git a/doc/guides/sample_app_ug/conf.py b/doc/guides/sample_app_ug/conf.py
> new file mode 100644
> index 0000000..def3132
> --- /dev/null
> +++ b/doc/guides/sample_app_ug/conf.py
> @@ -0,0 +1,41 @@
> +#   BSD LICENSE
> +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> +#   All rights reserved.
> +#
> +#   Redistribution and use in source and binary forms, with or without
> +#   modification, are permitted provided that the following conditions
> +#   are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#   notice, this list of conditions and the following disclaimer in
> +#   the documentation and/or other materials provided with the
> +#   distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#   contributors may be used to endorse or promote products derived
> +#   from this software without specific prior written permission.
> +#
> +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +execfile('../conf.py')
> +
> +release = check_output(['make', '-sRrC', '../../../', 'showversion'])
> +
> +# Overide the latex_documents to change the output name.
> +latex_documents = [
> +    ('index',
> +     'dpdk_sample_applications.tex',
> +     '',
> +     '',
> +     'manual')]
> diff --git a/doc/guides/testpmd_app_ug/conf.py b/doc/guides/testpmd_app_ug/conf.py
> new file mode 100644
> index 0000000..66d5d80
> --- /dev/null
> +++ b/doc/guides/testpmd_app_ug/conf.py
> @@ -0,0 +1,41 @@
> +#   BSD LICENSE
> +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.

Copyright should be 2010-2015 now.

> +#   All rights reserved.
> +#
> +#   Redistribution and use in source and binary forms, with or without
> +#   modification, are permitted provided that the following conditions
> +#   are met:
> +#
> +#   * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +#   * Redistributions in binary form must reproduce the above copyright
> +#   notice, this list of conditions and the following disclaimer in
> +#   the documentation and/or other materials provided with the
> +#   distribution.
> +#   * Neither the name of Intel Corporation nor the names of its
> +#   contributors may be used to endorse or promote products derived
> +#   from this software without specific prior written permission.
> +#
> +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +execfile('../conf.py')
> +
> +release = check_output(['make', '-sRrC', '../../../', 'showversion'])
> +
> +# Overide the latex_documents to change the output name.
> +latex_documents = [
> +    ('index',
> +     'dpdk_testpmd_guide.tex',
> +     '',
> +     '',
> +     'manual')]
> --
> 1.7.4.1
Thomas Monjalon Feb. 2, 2015, 10:25 a.m. UTC | #3
2015-02-02 10:19, Iremonger, Bernard:
> > +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> 
> Copyright should be 2010-2015 now.

Why 2010-2015?
As it's created in 2015, I would say Copyright 2015 only.
Am I wrong?
Iremonger, Bernard Feb. 2, 2015, 10:28 a.m. UTC | #4
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Monday, February 2, 2015 10:25 AM
> To: Iremonger, Bernard
> Cc: dev@dpdk.org; Mcnamara, John
> Subject: Re: [dpdk-dev] [PATCH v2 2/4] doc: Add Sphinx config to build pdf version of guides
> 
> 2015-02-02 10:19, Iremonger, Bernard:
> > > +#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> >
> > Copyright should be 2010-2015 now.
> 
> Why 2010-2015?
> As it's created in 2015, I would say Copyright 2015 only.
> Am I wrong?

Agreed, for new files it should be Copyright 2015

> 
> --
> Thomas
diff mbox

Patch

diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index 385af03..71253c5 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -28,12 +28,55 @@ 
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import subprocess
+from subprocess import check_output
+from sphinx.highlighting import PygmentsBridge
+from pygments.formatters.latex import LatexFormatter
 
 project = 'DPDK'
-
 copyright = '2014, Intel'
+master_doc = 'index'
 
-version = subprocess.check_output(["make","-sRrC","../../", "showversion"])
 
-master_doc = 'index'
+# Configuration for latex/pdf files.
+latex_preamble = r"""
+\usepackage[utf8]{inputenc}
+\usepackage{DejaVuSansMono}
+\usepackage[T1]{fontenc}
+\usepackage{helvet}
+\renewcommand{\familydefault}{\sfdefault}
+
+\RecustomVerbatimEnvironment{Verbatim}{Verbatim}{xleftmargin=5mm}
+"""
+
+latex_elements = {
+    'papersize': 'a4paper',
+    'pointsize': '11pt',
+    'preamble': latex_preamble}
+
+latex_documents = [
+    ('index',
+     'dpdk_docs.tex',
+     '',
+     '',
+     'manual')]
+
+texinfo_documents = [
+    ('index',
+     '',
+     '',
+     '',
+     '',
+     '',
+     'Miscellaneous')]
+
+
+# Override the dafault Latex formatter.
+class CustomLatexFormatter(LatexFormatter):
+
+    def __init__(self, **options):
+
+        super(CustomLatexFormatter, self).__init__(**options)
+
+        self.verboptions = r"formatcom=\footnotesize"
+
+PygmentsBridge.latex_formatter = CustomLatexFormatter
diff --git a/doc/guides/freebsd_gsg/conf.py b/doc/guides/freebsd_gsg/conf.py
new file mode 100644
index 0000000..fd97d69
--- /dev/null
+++ b/doc/guides/freebsd_gsg/conf.py
@@ -0,0 +1,41 @@ 
+#   BSD LICENSE
+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+execfile('../conf.py')
+
+release = check_output(['make', '-sRrC', '../../../', 'showversion'])
+
+# Overide the latex_documents to change the output name.
+latex_documents = [
+    ('index',
+     'dpdk_freebsd_getting_started_guide.tex',
+     '',
+     '',
+     'manual')]
diff --git a/doc/guides/linux_gsg/conf.py b/doc/guides/linux_gsg/conf.py
new file mode 100644
index 0000000..8086763
--- /dev/null
+++ b/doc/guides/linux_gsg/conf.py
@@ -0,0 +1,41 @@ 
+#   BSD LICENSE
+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+execfile('../conf.py')
+
+release = check_output(['make', '-sRrC', '../../../', 'showversion'])
+
+# Overide the latex_documents to change the output name.
+latex_documents = [
+    ('index',
+     'dpdk_linux_getting_started_guide.tex',
+     '',
+     '',
+     'manual')]
diff --git a/doc/guides/prog_guide/conf.py b/doc/guides/prog_guide/conf.py
new file mode 100644
index 0000000..6a9e74c
--- /dev/null
+++ b/doc/guides/prog_guide/conf.py
@@ -0,0 +1,41 @@ 
+#   BSD LICENSE
+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+execfile('../conf.py')
+
+release = check_output(['make', '-sRrC', '../../../', 'showversion'])
+
+# Overide the latex_documents to change the output name.
+latex_documents = [
+    ('index',
+     'dpdk_programmers_guide.tex',
+     '',
+     '',
+     'manual')]
diff --git a/doc/guides/rel_notes/conf.py b/doc/guides/rel_notes/conf.py
new file mode 100644
index 0000000..9ddf4c2
--- /dev/null
+++ b/doc/guides/rel_notes/conf.py
@@ -0,0 +1,41 @@ 
+#   BSD LICENSE
+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+execfile('../conf.py')
+
+release = check_output(['make', '-sRrC', '../../../', 'showversion'])
+
+# Overide the latex_documents to change the output name.
+latex_documents = [
+    ('index',
+     'dpdk_release_notes.tex',
+     '',
+     '',
+     'manual')]
diff --git a/doc/guides/sample_app_ug/conf.py b/doc/guides/sample_app_ug/conf.py
new file mode 100644
index 0000000..def3132
--- /dev/null
+++ b/doc/guides/sample_app_ug/conf.py
@@ -0,0 +1,41 @@ 
+#   BSD LICENSE
+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+execfile('../conf.py')
+
+release = check_output(['make', '-sRrC', '../../../', 'showversion'])
+
+# Overide the latex_documents to change the output name.
+latex_documents = [
+    ('index',
+     'dpdk_sample_applications.tex',
+     '',
+     '',
+     'manual')]
diff --git a/doc/guides/testpmd_app_ug/conf.py b/doc/guides/testpmd_app_ug/conf.py
new file mode 100644
index 0000000..66d5d80
--- /dev/null
+++ b/doc/guides/testpmd_app_ug/conf.py
@@ -0,0 +1,41 @@ 
+#   BSD LICENSE
+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+execfile('../conf.py')
+
+release = check_output(['make', '-sRrC', '../../../', 'showversion'])
+
+# Overide the latex_documents to change the output name.
+latex_documents = [
+    ('index',
+     'dpdk_testpmd_guide.tex',
+     '',
+     '',
+     'manual')]