2014-10-16 13:27:42 +00:00
|
|
|
# BSD LICENSE
|
2015-02-03 14:11:14 +00:00
|
|
|
# Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
|
2014-10-16 13:27:42 +00:00
|
|
|
# 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.
|
|
|
|
|
2014-10-15 20:17:02 +00:00
|
|
|
import subprocess
|
2015-02-03 14:11:15 +00:00
|
|
|
from sphinx.highlighting import PygmentsBridge
|
|
|
|
from pygments.formatters.latex import LatexFormatter
|
2014-10-15 20:17:02 +00:00
|
|
|
|
2014-10-15 20:12:20 +00:00
|
|
|
project = 'DPDK'
|
|
|
|
|
2015-03-12 10:59:29 +00:00
|
|
|
html_show_copyright = False
|
2014-10-15 20:17:02 +00:00
|
|
|
|
2015-03-18 17:25:51 +00:00
|
|
|
version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion']).decode('utf-8')
|
2015-02-03 14:11:14 +00:00
|
|
|
release = version
|
2014-10-15 20:17:02 +00:00
|
|
|
|
2014-10-15 20:12:20 +00:00
|
|
|
master_doc = 'index'
|
2015-02-03 14:11:14 +00:00
|
|
|
|
|
|
|
latex_documents = [
|
|
|
|
('index',
|
|
|
|
'doc.tex',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
'manual')
|
|
|
|
]
|
2015-02-03 14:11:15 +00:00
|
|
|
|
|
|
|
# Latex directives to be included directly in the latex/pdf docs.
|
|
|
|
latex_preamble = r"""
|
|
|
|
\usepackage[utf8]{inputenc}
|
|
|
|
\usepackage{DejaVuSansMono}
|
|
|
|
\usepackage[T1]{fontenc}
|
|
|
|
\usepackage{helvet}
|
|
|
|
\renewcommand{\familydefault}{\sfdefault}
|
|
|
|
\RecustomVerbatimEnvironment{Verbatim}{Verbatim}{xleftmargin=5mm}
|
|
|
|
"""
|
|
|
|
|
|
|
|
# Configuration for the latex/pdf docs.
|
|
|
|
latex_elements = {
|
|
|
|
'papersize': 'a4paper',
|
|
|
|
'pointsize': '11pt',
|
2015-03-18 17:41:57 +00:00
|
|
|
# remove blank pages
|
|
|
|
'classoptions': ',openany,oneside',
|
|
|
|
'babel': '\\usepackage[english]{babel}',
|
2015-02-03 14:11:15 +00:00
|
|
|
# customize Latex formatting
|
|
|
|
'preamble': latex_preamble
|
|
|
|
}
|
|
|
|
|
|
|
|
# Override the default Latex formatter in order to modify the
|
|
|
|
# code/verbatim blocks.
|
|
|
|
class CustomLatexFormatter(LatexFormatter):
|
|
|
|
def __init__(self, **options):
|
|
|
|
super(CustomLatexFormatter, self).__init__(**options)
|
|
|
|
# Use the second smallest font size for code/verbatim blocks.
|
|
|
|
self.verboptions = r'formatcom=\footnotesize'
|
|
|
|
|
|
|
|
# Replace the default latex formatter.
|
|
|
|
PygmentsBridge.latex_formatter = CustomLatexFormatter
|