conf.py 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Configuration file for the Sphinx documentation builder.
  2. #
  3. # SPDX-License-Identifier: CC-BY-2.0-UK
  4. #
  5. # This file only contains a selection of the most common options. For a full
  6. # list see the documentation:
  7. # https://www.sphinx-doc.org/en/master/usage/configuration.html
  8. # -- Path setup --------------------------------------------------------------
  9. # If extensions (or modules to document with autodoc) are in another directory,
  10. # add these directories to sys.path here. If the directory is relative to the
  11. # documentation root, use os.path.abspath to make it absolute, like shown here.
  12. #
  13. import os
  14. import sys
  15. import datetime
  16. current_version = "dev"
  17. # String used in sidebar
  18. version = 'Version: ' + current_version
  19. if current_version == 'dev':
  20. version = 'Version: Current Development'
  21. # Version seen in documentation_options.js and hence in js switchers code
  22. release = current_version
  23. # -- Project information -----------------------------------------------------
  24. project = 'The Yocto Project'
  25. copyright = '2010-%s, The Linux Foundation' % datetime.datetime.now().year
  26. author = 'The Linux Foundation'
  27. # -- General configuration ---------------------------------------------------
  28. # to load local extension from the folder 'sphinx'
  29. sys.path.insert(0, os.path.abspath('sphinx'))
  30. # Add any Sphinx extension module names here, as strings. They can be
  31. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  32. # ones.
  33. extensions = [
  34. 'sphinx.ext.autosectionlabel',
  35. 'sphinx.ext.extlinks',
  36. 'sphinx.ext.intersphinx',
  37. 'yocto-vars'
  38. ]
  39. autosectionlabel_prefix_document = True
  40. # Add any paths that contain templates here, relative to this directory.
  41. templates_path = ['_templates']
  42. # List of patterns, relative to source directory, that match files and
  43. # directories to ignore when looking for source files.
  44. # This pattern also affects html_static_path and html_extra_path.
  45. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'boilerplate.rst']
  46. # master document name. The default changed from contents to index. so better
  47. # set it ourselves.
  48. master_doc = 'index'
  49. # create substitution for project configuration variables
  50. rst_prolog = """
  51. .. |project_name| replace:: %s
  52. .. |copyright| replace:: %s
  53. .. |author| replace:: %s
  54. """ % (project, copyright, author)
  55. # external links and substitutions
  56. extlinks = {
  57. 'yocto_home': ('https://yoctoproject.org%s', None),
  58. 'yocto_wiki': ('https://wiki.yoctoproject.org%s', None),
  59. 'yocto_dl': ('https://downloads.yoctoproject.org%s', None),
  60. 'yocto_lists': ('https://lists.yoctoproject.org%s', None),
  61. 'yocto_bugs': ('https://bugzilla.yoctoproject.org%s', None),
  62. 'yocto_ab': ('https://autobuilder.yoctoproject.org%s', None),
  63. 'yocto_docs': ('https://docs.yoctoproject.org%s', None),
  64. 'yocto_git': ('https://git.yoctoproject.org%s', None),
  65. 'oe_home': ('https://www.openembedded.org%s', None),
  66. 'oe_lists': ('https://lists.openembedded.org%s', None),
  67. }
  68. # Intersphinx config to use cross reference with Bitbake user manual
  69. intersphinx_mapping = {
  70. 'bitbake': ('https://docs.yoctoproject.org/bitbake/', None)
  71. }
  72. # -- Options for HTML output -------------------------------------------------
  73. # The theme to use for HTML and HTML Help pages. See the documentation for
  74. # a list of builtin themes.
  75. #
  76. html_theme = 'sphinx_rtd_theme'
  77. html_theme_options = {
  78. 'sticky_navigation': False,
  79. }
  80. html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg'
  81. # Add any paths that contain custom static files (such as style sheets) here,
  82. # relative to this directory. They are copied after the builtin static files,
  83. # so a file named "default.css" will overwrite the builtin "default.css".
  84. html_static_path = ['sphinx-static']
  85. html_context = {
  86. 'current_version': current_version,
  87. }
  88. # Add customm CSS and JS files
  89. html_css_files = ['theme_overrides.css']
  90. html_js_files = ['switchers.js']
  91. # Hide 'Created using Sphinx' text
  92. html_show_sphinx = False
  93. # Add 'Last updated' on each page
  94. html_last_updated_fmt = '%b %d, %Y'
  95. # Remove the trailing 'dot' in section numbers
  96. html_secnumber_suffix = " "