conf.py 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. # -*- coding: utf-8 -*-
  2. #
  3. # The U-Boot documentation build configuration file, created by
  4. # sphinx-quickstart on Fri Feb 12 13:51:46 2016.
  5. #
  6. # This file is execfile()d with the current directory set to its
  7. # containing dir.
  8. #
  9. # Note that not all possible configuration values are present in this
  10. # autogenerated file.
  11. #
  12. # All configuration values have a default; values that are commented out
  13. # serve to show the default.
  14. import sys
  15. import os
  16. import sphinx
  17. # Get Sphinx version
  18. major, minor, patch = sphinx.version_info[:3]
  19. # If extensions (or modules to document with autodoc) are in another directory,
  20. # add these directories to sys.path here. If the directory is relative to the
  21. # documentation root, use os.path.abspath to make it absolute, like shown here.
  22. sys.path.insert(0, os.path.abspath('sphinx'))
  23. from load_config import loadConfig
  24. # -- General configuration ------------------------------------------------
  25. # If your documentation needs a minimal Sphinx version, state it here.
  26. needs_sphinx = '1.3'
  27. # Add any Sphinx extension module names here, as strings. They can be
  28. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  29. # ones.
  30. extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain', 'kfigure']
  31. # The name of the math extension changed on Sphinx 1.4
  32. if major == 1 and minor > 3:
  33. extensions.append("sphinx.ext.imgmath")
  34. else:
  35. extensions.append("sphinx.ext.pngmath")
  36. # Add any paths that contain templates here, relative to this directory.
  37. templates_path = ['_templates']
  38. # The suffix(es) of source filenames.
  39. # You can specify multiple suffix as a list of string:
  40. # source_suffix = ['.rst', '.md']
  41. source_suffix = '.rst'
  42. # The encoding of source files.
  43. #source_encoding = 'utf-8-sig'
  44. # The master toctree document.
  45. master_doc = 'index'
  46. # General information about the project.
  47. project = 'Das U-Boot'
  48. copyright = 'The U-Boot development community'
  49. author = 'The U-Boot development community'
  50. # The version info for the project you're documenting, acts as replacement for
  51. # |version| and |release|, also used in various other places throughout the
  52. # built documents.
  53. #
  54. # In a normal build, version and release are are set to KERNELVERSION and
  55. # KERNELRELEASE, respectively, from the Makefile via Sphinx command line
  56. # arguments.
  57. #
  58. # The following code tries to extract the information by reading the Makefile,
  59. # when Sphinx is run directly (e.g. by Read the Docs).
  60. try:
  61. makefile_version = None
  62. makefile_patchlevel = None
  63. for line in open('../Makefile'):
  64. key, val = [x.strip() for x in line.split('=', 2)]
  65. if key == 'VERSION':
  66. makefile_version = val
  67. elif key == 'PATCHLEVEL':
  68. makefile_patchlevel = val
  69. if makefile_version and makefile_patchlevel:
  70. break
  71. except:
  72. pass
  73. finally:
  74. if makefile_version and makefile_patchlevel:
  75. version = release = makefile_version + '.' + makefile_patchlevel
  76. else:
  77. version = release = "unknown version"
  78. # The language for content autogenerated by Sphinx. Refer to documentation
  79. # for a list of supported languages.
  80. #
  81. # This is also used if you do content translation via gettext catalogs.
  82. # Usually you set "language" from the command line for these cases.
  83. language = None
  84. # There are two options for replacing |today|: either, you set today to some
  85. # non-false value, then it is used:
  86. #today = ''
  87. # Else, today_fmt is used as the format for a strftime call.
  88. #today_fmt = '%B %d, %Y'
  89. # List of patterns, relative to source directory, that match files and
  90. # directories to ignore when looking for source files.
  91. exclude_patterns = ['output']
  92. # The reST default role (used for this markup: `text`) to use for all
  93. # documents.
  94. #default_role = None
  95. # If true, '()' will be appended to :func: etc. cross-reference text.
  96. #add_function_parentheses = True
  97. # If true, the current module name will be prepended to all description
  98. # unit titles (such as .. function::).
  99. #add_module_names = True
  100. # If true, sectionauthor and moduleauthor directives will be shown in the
  101. # output. They are ignored by default.
  102. #show_authors = False
  103. # The name of the Pygments (syntax highlighting) style to use.
  104. pygments_style = 'sphinx'
  105. # A list of ignored prefixes for module index sorting.
  106. #modindex_common_prefix = []
  107. # If true, keep warnings as "system message" paragraphs in the built documents.
  108. #keep_warnings = False
  109. # If true, `todo` and `todoList` produce output, else they produce nothing.
  110. todo_include_todos = False
  111. primary_domain = 'c'
  112. highlight_language = 'none'
  113. # -- Options for HTML output ----------------------------------------------
  114. # The theme to use for HTML and HTML Help pages. See the documentation for
  115. # a list of builtin themes.
  116. # The Read the Docs theme is available from
  117. # - https://github.com/snide/sphinx_rtd_theme
  118. # - https://pypi.python.org/pypi/sphinx_rtd_theme
  119. # - python-sphinx-rtd-theme package (on Debian)
  120. try:
  121. import sphinx_rtd_theme
  122. html_theme = 'sphinx_rtd_theme'
  123. html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  124. except ImportError:
  125. 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')
  126. # Theme options are theme-specific and customize the look and feel of a theme
  127. # further. For a list of options available for each theme, see the
  128. # documentation.
  129. #html_theme_options = {}
  130. # Add any paths that contain custom themes here, relative to this directory.
  131. #html_theme_path = []
  132. # The name for this set of Sphinx documents. If None, it defaults to
  133. # "<project> v<release> documentation".
  134. #html_title = None
  135. # A shorter title for the navigation bar. Default is the same as html_title.
  136. #html_short_title = None
  137. # The name of an image file (relative to this directory) to place at the top
  138. # of the sidebar.
  139. html_logo = '../tools/logos/u-boot_logo.svg'
  140. # The name of an image file (within the static path) to use as favicon of the
  141. # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
  142. # pixels large.
  143. #html_favicon = None
  144. # Add any paths that contain custom static files (such as style sheets) here,
  145. # relative to this directory. They are copied after the builtin static files,
  146. # so a file named "default.css" will overwrite the builtin "default.css".
  147. html_static_path = ['sphinx-static']
  148. html_context = {
  149. 'css_files': [
  150. '_static/theme_overrides.css',
  151. ],
  152. }
  153. # Add any extra paths that contain custom files (such as robots.txt or
  154. # .htaccess) here, relative to this directory. These files are copied
  155. # directly to the root of the documentation.
  156. #html_extra_path = []
  157. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  158. # using the given strftime format.
  159. #html_last_updated_fmt = '%b %d, %Y'
  160. # If true, SmartyPants will be used to convert quotes and dashes to
  161. # typographically correct entities.
  162. #html_use_smartypants = True
  163. # Custom sidebar templates, maps document names to template names.
  164. #html_sidebars = {}
  165. # Additional templates that should be rendered to pages, maps page names to
  166. # template names.
  167. #html_additional_pages = {}
  168. # If false, no module index is generated.
  169. #html_domain_indices = True
  170. # If false, no index is generated.
  171. #html_use_index = True
  172. # If true, the index is split into individual pages for each letter.
  173. #html_split_index = False
  174. # If true, links to the reST sources are added to the pages.
  175. #html_show_sourcelink = True
  176. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  177. #html_show_sphinx = True
  178. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  179. #html_show_copyright = True
  180. # If true, an OpenSearch description file will be output, and all pages will
  181. # contain a <link> tag referring to it. The value of this option must be the
  182. # base URL from which the finished HTML is served.
  183. #html_use_opensearch = ''
  184. # This is the file name suffix for HTML files (e.g. ".xhtml").
  185. #html_file_suffix = None
  186. # Language to be used for generating the HTML full-text search index.
  187. # Sphinx supports the following languages:
  188. # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
  189. # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
  190. #html_search_language = 'en'
  191. # A dictionary with options for the search language support, empty by default.
  192. # Now only 'ja' uses this config value
  193. #html_search_options = {'type': 'default'}
  194. # The name of a javascript file (relative to the configuration directory) that
  195. # implements a search results scorer. If empty, the default will be used.
  196. #html_search_scorer = 'scorer.js'
  197. # Output file base name for HTML help builder.
  198. htmlhelp_basename = 'TheUBootdoc'
  199. # -- Options for LaTeX output ---------------------------------------------
  200. latex_elements = {
  201. # The paper size ('letterpaper' or 'a4paper').
  202. 'papersize': 'a4paper',
  203. # The font size ('10pt', '11pt' or '12pt').
  204. 'pointsize': '8pt',
  205. # Latex figure (float) alignment
  206. #'figure_align': 'htbp',
  207. # Don't mangle with UTF-8 chars
  208. 'inputenc': '',
  209. 'utf8extra': '',
  210. # Additional stuff for the LaTeX preamble.
  211. 'preamble': '''
  212. % Use some font with UTF-8 support with XeLaTeX
  213. \\usepackage{fontspec}
  214. \\setsansfont{DejaVu Serif}
  215. \\setromanfont{DejaVu Sans}
  216. \\setmonofont{DejaVu Sans Mono}
  217. '''
  218. }
  219. # Fix reference escape troubles with Sphinx 1.4.x
  220. if major == 1 and minor > 3:
  221. latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
  222. if major == 1 and minor <= 4:
  223. latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}'
  224. elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)):
  225. latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in'
  226. latex_elements['preamble'] += '\\fvset{fontsize=auto}\n'
  227. # Customize notice background colors on Sphinx < 1.6:
  228. if major == 1 and minor < 6:
  229. latex_elements['preamble'] += '''
  230. \\usepackage{ifthen}
  231. % Put notes in color and let them be inside a table
  232. \\definecolor{NoteColor}{RGB}{204,255,255}
  233. \\definecolor{WarningColor}{RGB}{255,204,204}
  234. \\definecolor{AttentionColor}{RGB}{255,255,204}
  235. \\definecolor{ImportantColor}{RGB}{192,255,204}
  236. \\definecolor{OtherColor}{RGB}{204,204,204}
  237. \\newlength{\\mynoticelength}
  238. \\makeatletter\\newenvironment{coloredbox}[1]{%
  239. \\setlength{\\fboxrule}{1pt}
  240. \\setlength{\\fboxsep}{7pt}
  241. \\setlength{\\mynoticelength}{\\linewidth}
  242. \\addtolength{\\mynoticelength}{-2\\fboxsep}
  243. \\addtolength{\\mynoticelength}{-2\\fboxrule}
  244. \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\mynoticelength}}{\\end{minipage}\\end{lrbox}%
  245. \\ifthenelse%
  246. {\\equal{\\py@noticetype}{note}}%
  247. {\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}%
  248. {%
  249. \\ifthenelse%
  250. {\\equal{\\py@noticetype}{warning}}%
  251. {\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}%
  252. {%
  253. \\ifthenelse%
  254. {\\equal{\\py@noticetype}{attention}}%
  255. {\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}%
  256. {%
  257. \\ifthenelse%
  258. {\\equal{\\py@noticetype}{important}}%
  259. {\\colorbox{ImportantColor}{\\usebox{\\@tempboxa}}}%
  260. {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}%
  261. }%
  262. }%
  263. }%
  264. }\\makeatother
  265. \\makeatletter
  266. \\renewenvironment{notice}[2]{%
  267. \\def\\py@noticetype{#1}
  268. \\begin{coloredbox}{#1}
  269. \\bf\\it
  270. \\par\\strong{#2}
  271. \\csname py@noticestart@#1\\endcsname
  272. }
  273. {
  274. \\csname py@noticeend@\\py@noticetype\\endcsname
  275. \\end{coloredbox}
  276. }
  277. \\makeatother
  278. '''
  279. # With Sphinx 1.6, it is possible to change the Bg color directly
  280. # by using:
  281. # \definecolor{sphinxnoteBgColor}{RGB}{204,255,255}
  282. # \definecolor{sphinxwarningBgColor}{RGB}{255,204,204}
  283. # \definecolor{sphinxattentionBgColor}{RGB}{255,255,204}
  284. # \definecolor{sphinximportantBgColor}{RGB}{192,255,204}
  285. #
  286. # However, it require to use sphinx heavy box with:
  287. #
  288. # \renewenvironment{sphinxlightbox} {%
  289. # \\begin{sphinxheavybox}
  290. # }
  291. # \\end{sphinxheavybox}
  292. # }
  293. #
  294. # Unfortunately, the implementation is buggy: if a note is inside a
  295. # table, it isn't displayed well. So, for now, let's use boring
  296. # black and white notes.
  297. # Grouping the document tree into LaTeX files. List of tuples
  298. # (source start file, target name, title,
  299. # author, documentclass [howto, manual, or own class]).
  300. # Sorted in alphabetical order
  301. latex_documents = [
  302. ('index', 'u-boot-hacker-manual.tex', 'U-Boot Hacker Manual',
  303. 'The U-Boot development community', 'manual'),
  304. ]
  305. # The name of an image file (relative to this directory) to place at the top of
  306. # the title page.
  307. #latex_logo = None
  308. # For "manual" documents, if this is true, then toplevel headings are parts,
  309. # not chapters.
  310. #latex_use_parts = False
  311. # If true, show page references after internal links.
  312. #latex_show_pagerefs = False
  313. # If true, show URL addresses after external links.
  314. #latex_show_urls = False
  315. # Documents to append as an appendix to all manuals.
  316. #latex_appendices = []
  317. # If false, no module index is generated.
  318. #latex_domain_indices = True
  319. # -- Options for manual page output ---------------------------------------
  320. # One entry per manual page. List of tuples
  321. # (source start file, name, description, authors, manual section).
  322. man_pages = [
  323. (master_doc, 'dasuboot', 'The U-Boot Documentation',
  324. [author], 1)
  325. ]
  326. # If true, show URL addresses after external links.
  327. #man_show_urls = False
  328. # -- Options for Texinfo output -------------------------------------------
  329. # Grouping the document tree into Texinfo files. List of tuples
  330. # (source start file, target name, title, author,
  331. # dir menu entry, description, category)
  332. texinfo_documents = [
  333. (master_doc, 'DasUBoot', 'The U-Boot Documentation',
  334. author, 'DasUBoot', 'One line description of project.',
  335. 'Miscellaneous'),
  336. ]
  337. # Documents to append as an appendix to all manuals.
  338. #texinfo_appendices = []
  339. # If false, no module index is generated.
  340. #texinfo_domain_indices = True
  341. # How to display URL addresses: 'footnote', 'no', or 'inline'.
  342. #texinfo_show_urls = 'footnote'
  343. # If true, do not generate a @detailmenu in the "Top" node's menu.
  344. #texinfo_no_detailmenu = False
  345. # -- Options for Epub output ----------------------------------------------
  346. # Bibliographic Dublin Core info.
  347. epub_title = project
  348. epub_author = author
  349. epub_publisher = author
  350. epub_copyright = copyright
  351. # The basename for the epub file. It defaults to the project name.
  352. #epub_basename = project
  353. # The HTML theme for the epub output. Since the default themes are not
  354. # optimized for small screen space, using the same theme for HTML and epub
  355. # output is usually not wise. This defaults to 'epub', a theme designed to save
  356. # visual space.
  357. #epub_theme = 'epub'
  358. # The language of the text. It defaults to the language option
  359. # or 'en' if the language is not set.
  360. #epub_language = ''
  361. # The scheme of the identifier. Typical schemes are ISBN or URL.
  362. #epub_scheme = ''
  363. # The unique identifier of the text. This can be a ISBN number
  364. # or the project homepage.
  365. #epub_identifier = ''
  366. # A unique identification for the text.
  367. #epub_uid = ''
  368. # A tuple containing the cover image and cover page html template filenames.
  369. #epub_cover = ()
  370. # A sequence of (type, uri, title) tuples for the guide element of content.opf.
  371. #epub_guide = ()
  372. # HTML files that should be inserted before the pages created by sphinx.
  373. # The format is a list of tuples containing the path and title.
  374. #epub_pre_files = []
  375. # HTML files that should be inserted after the pages created by sphinx.
  376. # The format is a list of tuples containing the path and title.
  377. #epub_post_files = []
  378. # A list of files that should not be packed into the epub file.
  379. epub_exclude_files = ['search.html']
  380. # The depth of the table of contents in toc.ncx.
  381. #epub_tocdepth = 3
  382. # Allow duplicate toc entries.
  383. #epub_tocdup = True
  384. # Choose between 'default' and 'includehidden'.
  385. #epub_tocscope = 'default'
  386. # Fix unsupported image types using the Pillow.
  387. #epub_fix_images = False
  388. # Scale large images.
  389. #epub_max_image_width = 0
  390. # How to display URL addresses: 'footnote', 'no', or 'inline'.
  391. #epub_show_urls = 'inline'
  392. # If false, no index is generated.
  393. #epub_use_index = True
  394. #=======
  395. # rst2pdf
  396. #
  397. # Grouping the document tree into PDF files. List of tuples
  398. # (source start file, target name, title, author, options).
  399. #
  400. # See the Sphinx chapter of http://ralsina.me/static/manual.pdf
  401. #
  402. # FIXME: Do not add the index file here; the result will be too big. Adding
  403. # multiple PDF files here actually tries to get the cross-referencing right
  404. # *between* PDF files.
  405. pdf_documents = [
  406. ('uboot-documentation', u'U-Boot', u'U-Boot', u'J. Random Bozo'),
  407. ]
  408. # kernel-doc extension configuration for running Sphinx directly (e.g. by Read
  409. # the Docs). In a normal build, these are supplied from the Makefile via command
  410. # line arguments.
  411. kerneldoc_bin = '../scripts/kernel-doc'
  412. kerneldoc_srctree = '..'
  413. # ------------------------------------------------------------------------------
  414. # Since loadConfig overwrites settings from the global namespace, it has to be
  415. # the last statement in the conf.py file
  416. # ------------------------------------------------------------------------------
  417. loadConfig(globals())