conf.py 17 KB

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