1 # -*- coding: utf-8 -*-
3 # The U-Boot documentation build configuration file, created by
4 # sphinx-quickstart on Fri Feb 12 13:51:46 2016.
6 # This file is execfile()d with the current directory set to its
9 # Note that not all possible configuration values are present in this
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
20 major, minor, patch = sphinx.version_info[:3]
23 # If extensions (or modules to document with autodoc) are in another directory,
24 # add these directories to sys.path here. If the directory is relative to the
25 # documentation root, use os.path.abspath to make it absolute, like shown here.
26 sys.path.insert(0, os.path.abspath('sphinx'))
27 from load_config import loadConfig
29 # -- General configuration ------------------------------------------------
31 # If your documentation needs a minimal Sphinx version, state it here.
34 latex_engine = 'xelatex'
36 # Add any Sphinx extension module names here, as strings. They can be
37 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39 extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'kfigure']
42 # cdomain is badly broken in Sphinx 3+. Leaving it out generates *most*
43 # of the docs correctly, but not all.
46 if (major > 3) or (minor > 0 or patch >= 2):
47 sys.stderr.write('''The build process with Sphinx 3+ is broken.
48 You will have to remove -W in doc/Makefile.
50 # Sphinx c function parser is more pedantic with regards to type
51 # checking. Due to that, having macros at c:function cause problems.
52 # Those needed to be escaped by using c_id_attributes[] array
55 # include/linux/compiler.h
61 # include/efi_loader.h
66 extensions.append('cdomain')
68 # The name of the math extension changed on Sphinx 1.4
69 if (major == 1 and minor > 3) or (major > 1):
70 extensions.append("sphinx.ext.imgmath")
72 extensions.append("sphinx.ext.pngmath")
74 # Add any paths that contain templates here, relative to this directory.
75 templates_path = ['_templates']
77 # The suffix(es) of source filenames.
78 # You can specify multiple suffix as a list of string:
79 # source_suffix = ['.rst', '.md']
80 source_suffix = '.rst'
82 # The encoding of source files.
83 #source_encoding = 'utf-8-sig'
85 # The master toctree document.
88 # General information about the project.
89 project = 'Das U-Boot'
90 copyright = 'The U-Boot development community'
91 author = 'The U-Boot development community'
93 # The version info for the project you're documenting, acts as replacement for
94 # |version| and |release|, also used in various other places throughout the
97 # In a normal build, version and release are are set to KERNELVERSION and
98 # KERNELRELEASE, respectively, from the Makefile via Sphinx command line
101 # The following code tries to extract the information by reading the Makefile,
102 # when Sphinx is run directly (e.g. by Read the Docs).
104 makefile_version = None
105 makefile_patchlevel = None
106 for line in open('../Makefile'):
107 key, val = [x.strip() for x in line.split('=', 2)]
109 makefile_version = val
110 elif key == 'PATCHLEVEL':
111 makefile_patchlevel = val
112 if makefile_version and makefile_patchlevel:
117 if makefile_version and makefile_patchlevel:
118 version = release = makefile_version + '.' + makefile_patchlevel
120 version = release = "unknown version"
122 # The language for content autogenerated by Sphinx. Refer to documentation
123 # for a list of supported languages.
125 # This is also used if you do content translation via gettext catalogs.
126 # Usually you set "language" from the command line for these cases.
129 # There are two options for replacing |today|: either, you set today to some
130 # non-false value, then it is used:
132 # Else, today_fmt is used as the format for a strftime call.
133 #today_fmt = '%B %d, %Y'
135 # List of patterns, relative to source directory, that match files and
136 # directories to ignore when looking for source files.
137 exclude_patterns = ['output']
139 # The reST default role (used for this markup: `text`) to use for all
143 # If true, '()' will be appended to :func: etc. cross-reference text.
144 #add_function_parentheses = True
146 # If true, the current module name will be prepended to all description
147 # unit titles (such as .. function::).
148 #add_module_names = True
150 # If true, sectionauthor and moduleauthor directives will be shown in the
151 # output. They are ignored by default.
152 #show_authors = False
154 # The name of the Pygments (syntax highlighting) style to use.
155 pygments_style = 'sphinx'
157 # A list of ignored prefixes for module index sorting.
158 #modindex_common_prefix = []
160 # If true, keep warnings as "system message" paragraphs in the built documents.
161 #keep_warnings = False
163 # If true, `todo` and `todoList` produce output, else they produce nothing.
164 todo_include_todos = False
167 highlight_language = 'none'
169 # -- Options for HTML output ----------------------------------------------
171 # The theme to use for HTML and HTML Help pages. See the documentation for
172 # a list of builtin themes.
174 # The Read the Docs theme is available from
175 # - https://github.com/snide/sphinx_rtd_theme
176 # - https://pypi.python.org/pypi/sphinx_rtd_theme
177 # - python-sphinx-rtd-theme package (on Debian)
179 import sphinx_rtd_theme
180 html_theme = 'sphinx_rtd_theme'
181 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
183 sys.stderr.write('Warning: The Sphinx \'sphinx_rtd_theme\' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.\n')
185 # Theme options are theme-specific and customize the look and feel of a theme
186 # further. For a list of options available for each theme, see the
188 #html_theme_options = {}
190 # Add any paths that contain custom themes here, relative to this directory.
191 #html_theme_path = []
193 # The name for this set of Sphinx documents. If None, it defaults to
194 # "<project> v<release> documentation".
197 # A shorter title for the navigation bar. Default is the same as html_title.
198 #html_short_title = None
200 # The name of an image file (relative to this directory) to place at the top
202 html_logo = '../tools/logos/u-boot_logo.svg'
204 # The name of an image file (within the static path) to use as favicon of the
205 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
209 # Add any paths that contain custom static files (such as style sheets) here,
210 # relative to this directory. They are copied after the builtin static files,
211 # so a file named "default.css" will overwrite the builtin "default.css".
213 html_static_path = ['sphinx-static']
217 '_static/theme_overrides.css',
221 # Add any extra paths that contain custom files (such as robots.txt or
222 # .htaccess) here, relative to this directory. These files are copied
223 # directly to the root of the documentation.
224 #html_extra_path = []
226 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
227 # using the given strftime format.
228 #html_last_updated_fmt = '%b %d, %Y'
230 # If true, SmartyPants will be used to convert quotes and dashes to
231 # typographically correct entities.
232 #html_use_smartypants = True
234 # Custom sidebar templates, maps document names to template names.
237 # Additional templates that should be rendered to pages, maps page names to
239 #html_additional_pages = {}
241 # If false, no module index is generated.
242 #html_domain_indices = True
244 # If false, no index is generated.
245 #html_use_index = True
247 # If true, the index is split into individual pages for each letter.
248 #html_split_index = False
250 # If true, links to the reST sources are added to the pages.
251 #html_show_sourcelink = True
253 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
254 #html_show_sphinx = True
256 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
257 #html_show_copyright = True
259 # If true, an OpenSearch description file will be output, and all pages will
260 # contain a <link> tag referring to it. The value of this option must be the
261 # base URL from which the finished HTML is served.
262 #html_use_opensearch = ''
264 # This is the file name suffix for HTML files (e.g. ".xhtml").
265 #html_file_suffix = None
267 # Language to be used for generating the HTML full-text search index.
268 # Sphinx supports the following languages:
269 # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
270 # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
271 #html_search_language = 'en'
273 # A dictionary with options for the search language support, empty by default.
274 # Now only 'ja' uses this config value
275 #html_search_options = {'type': 'default'}
277 # The name of a javascript file (relative to the configuration directory) that
278 # implements a search results scorer. If empty, the default will be used.
279 #html_search_scorer = 'scorer.js'
281 # Output file base name for HTML help builder.
282 htmlhelp_basename = 'TheUBootdoc'
284 # -- Options for LaTeX output ---------------------------------------------
287 # The paper size ('letterpaper' or 'a4paper').
288 'papersize': 'a4paper',
290 # The font size ('10pt', '11pt' or '12pt').
293 # Latex figure (float) alignment
294 #'figure_align': 'htbp',
296 # Don't mangle with UTF-8 chars
300 # Additional stuff for the LaTeX preamble.
302 % Use some font with UTF-8 support with XeLaTeX
303 \\usepackage{fontspec}
304 \\setsansfont{DejaVu Serif}
305 \\setromanfont{DejaVu Sans}
306 \\setmonofont{DejaVu Sans Mono}
311 # Fix reference escape troubles with Sphinx 1.4.x
312 if major == 1 and minor > 3:
313 latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
315 if major == 1 and minor <= 4:
316 latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}'
317 elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)):
318 latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in'
319 latex_elements['preamble'] += '\\fvset{fontsize=auto}\n'
321 # Customize notice background colors on Sphinx < 1.6:
322 if major == 1 and minor < 6:
323 latex_elements['preamble'] += '''
326 % Put notes in color and let them be inside a table
327 \\definecolor{NoteColor}{RGB}{204,255,255}
328 \\definecolor{WarningColor}{RGB}{255,204,204}
329 \\definecolor{AttentionColor}{RGB}{255,255,204}
330 \\definecolor{ImportantColor}{RGB}{192,255,204}
331 \\definecolor{OtherColor}{RGB}{204,204,204}
332 \\newlength{\\mynoticelength}
333 \\makeatletter\\newenvironment{coloredbox}[1]{%
334 \\setlength{\\fboxrule}{1pt}
335 \\setlength{\\fboxsep}{7pt}
336 \\setlength{\\mynoticelength}{\\linewidth}
337 \\addtolength{\\mynoticelength}{-2\\fboxsep}
338 \\addtolength{\\mynoticelength}{-2\\fboxrule}
339 \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\mynoticelength}}{\\end{minipage}\\end{lrbox}%
341 {\\equal{\\py@noticetype}{note}}%
342 {\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}%
345 {\\equal{\\py@noticetype}{warning}}%
346 {\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}%
349 {\\equal{\\py@noticetype}{attention}}%
350 {\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}%
353 {\\equal{\\py@noticetype}{important}}%
354 {\\colorbox{ImportantColor}{\\usebox{\\@tempboxa}}}%
355 {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}%
362 \\renewenvironment{notice}[2]{%
363 \\def\\py@noticetype{#1}
364 \\begin{coloredbox}{#1}
367 \\csname py@noticestart@#1\\endcsname
370 \\csname py@noticeend@\\py@noticetype\\endcsname
377 # With Sphinx 1.6, it is possible to change the Bg color directly
379 # \definecolor{sphinxnoteBgColor}{RGB}{204,255,255}
380 # \definecolor{sphinxwarningBgColor}{RGB}{255,204,204}
381 # \definecolor{sphinxattentionBgColor}{RGB}{255,255,204}
382 # \definecolor{sphinximportantBgColor}{RGB}{192,255,204}
384 # However, it require to use sphinx heavy box with:
386 # \renewenvironment{sphinxlightbox} {%
387 # \\begin{sphinxheavybox}
389 # \\end{sphinxheavybox}
392 # Unfortunately, the implementation is buggy: if a note is inside a
393 # table, it isn't displayed well. So, for now, let's use boring
394 # black and white notes.
396 # Grouping the document tree into LaTeX files. List of tuples
397 # (source start file, target name, title,
398 # author, documentclass [howto, manual, or own class]).
399 # Sorted in alphabetical order
401 ('index', 'u-boot-hacker-manual.tex', 'U-Boot Hacker Manual',
402 'The U-Boot development community', 'manual'),
405 # The name of an image file (relative to this directory) to place at the top of
409 # For "manual" documents, if this is true, then toplevel headings are parts,
411 #latex_use_parts = False
413 # If true, show page references after internal links.
414 #latex_show_pagerefs = False
416 # If true, show URL addresses after external links.
417 #latex_show_urls = False
419 # Documents to append as an appendix to all manuals.
420 #latex_appendices = []
422 # If false, no module index is generated.
423 #latex_domain_indices = True
426 # -- Options for manual page output ---------------------------------------
428 # One entry per manual page. List of tuples
429 # (source start file, name, description, authors, manual section).
431 (master_doc, 'dasuboot', 'The U-Boot Documentation',
435 # If true, show URL addresses after external links.
436 #man_show_urls = False
439 # -- Options for Texinfo output -------------------------------------------
441 # Grouping the document tree into Texinfo files. List of tuples
442 # (source start file, target name, title, author,
443 # dir menu entry, description, category)
444 texinfo_documents = [
445 (master_doc, 'DasUBoot', 'The U-Boot Documentation',
446 author, 'DasUBoot', 'One line description of project.',
450 # Documents to append as an appendix to all manuals.
451 #texinfo_appendices = []
453 # If false, no module index is generated.
454 #texinfo_domain_indices = True
456 # How to display URL addresses: 'footnote', 'no', or 'inline'.
457 #texinfo_show_urls = 'footnote'
459 # If true, do not generate a @detailmenu in the "Top" node's menu.
460 #texinfo_no_detailmenu = False
463 # -- Options for Epub output ----------------------------------------------
465 # Bibliographic Dublin Core info.
468 epub_publisher = author
469 epub_copyright = copyright
471 # The basename for the epub file. It defaults to the project name.
472 #epub_basename = project
474 # The HTML theme for the epub output. Since the default themes are not
475 # optimized for small screen space, using the same theme for HTML and epub
476 # output is usually not wise. This defaults to 'epub', a theme designed to save
480 # The language of the text. It defaults to the language option
481 # or 'en' if the language is not set.
484 # The scheme of the identifier. Typical schemes are ISBN or URL.
487 # The unique identifier of the text. This can be a ISBN number
488 # or the project homepage.
489 #epub_identifier = ''
491 # A unique identification for the text.
494 # A tuple containing the cover image and cover page html template filenames.
497 # A sequence of (type, uri, title) tuples for the guide element of content.opf.
500 # HTML files that should be inserted before the pages created by sphinx.
501 # The format is a list of tuples containing the path and title.
504 # HTML files that should be inserted after the pages created by sphinx.
505 # The format is a list of tuples containing the path and title.
506 #epub_post_files = []
508 # A list of files that should not be packed into the epub file.
509 epub_exclude_files = ['search.html']
511 # The depth of the table of contents in toc.ncx.
514 # Allow duplicate toc entries.
517 # Choose between 'default' and 'includehidden'.
518 #epub_tocscope = 'default'
520 # Fix unsupported image types using the Pillow.
521 #epub_fix_images = False
523 # Scale large images.
524 #epub_max_image_width = 0
526 # How to display URL addresses: 'footnote', 'no', or 'inline'.
527 #epub_show_urls = 'inline'
529 # If false, no index is generated.
530 #epub_use_index = True
535 # Grouping the document tree into PDF files. List of tuples
536 # (source start file, target name, title, author, options).
538 # See the Sphinx chapter of http://ralsina.me/static/manual.pdf
540 # FIXME: Do not add the index file here; the result will be too big. Adding
541 # multiple PDF files here actually tries to get the cross-referencing right
542 # *between* PDF files.
544 ('uboot-documentation', u'U-Boot', u'U-Boot', u'J. Random Bozo'),
547 # kernel-doc extension configuration for running Sphinx directly (e.g. by Read
548 # the Docs). In a normal build, these are supplied from the Makefile via command
550 kerneldoc_bin = '../scripts/kernel-doc'
551 kerneldoc_srctree = '..'
553 # ------------------------------------------------------------------------------
554 # Since loadConfig overwrites settings from the global namespace, it has to be
555 # the last statement in the conf.py file
556 # ------------------------------------------------------------------------------
557 loadConfig(globals())