conf.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Configuration file for the Sphinx documentation builder.
  2. #
  3. # This file only contains a selection of the most common options. For a full
  4. # list see the documentation:
  5. # https://www.sphinx-doc.org/en/master/usage/configuration.html
  6. # -- Path setup --------------------------------------------------------------
  7. # If extensions (or modules to document with autodoc) are in another directory,
  8. # add these directories to sys.path here. If the directory is relative to the
  9. # documentation root, use os.path.abspath to make it absolute, like shown here.
  10. #
  11. # import os
  12. # import sys
  13. # sys.path.insert(0, os.path.abspath('.'))
  14. import sys
  15. import datetime
  16. from pathlib import Path
  17. current_version = "dev"
  18. # String used in sidebar
  19. version = 'Version: ' + current_version
  20. if current_version == 'dev':
  21. version = 'Version: Current Development'
  22. # Version seen in documentation_options.js and hence in js switchers code
  23. release = current_version
  24. # -- Project information -----------------------------------------------------
  25. project = 'Bitbake'
  26. copyright = '2004-%s, Richard Purdie, Chris Larson, and Phil Blundell' \
  27. % datetime.datetime.now().year
  28. author = 'Richard Purdie, Chris Larson, and Phil Blundell'
  29. # external links and substitutions
  30. extlinks = {
  31. 'yocto_docs': ('https://docs.yoctoproject.org%s', None),
  32. 'oe_lists': ('https://lists.openembedded.org%s', None),
  33. }
  34. # -- General configuration ---------------------------------------------------
  35. # Add any Sphinx extension module names here, as strings. They can be
  36. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  37. # ones.
  38. extensions = [
  39. 'sphinx.ext.autosectionlabel',
  40. 'sphinx.ext.extlinks',
  41. 'sphinx.ext.autodoc',
  42. ]
  43. autosectionlabel_prefix_document = True
  44. # Add any paths that contain templates here, relative to this directory.
  45. templates_path = ['_templates']
  46. # List of patterns, relative to source directory, that match files and
  47. # directories to ignore when looking for source files.
  48. # This pattern also affects html_static_path and html_extra_path.
  49. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  50. # master document name. The default changed from contents to index. so better
  51. # set it ourselves.
  52. master_doc = 'index'
  53. # create substitution for project configuration variables
  54. rst_prolog = """
  55. .. |project_name| replace:: %s
  56. .. |copyright| replace:: %s
  57. .. |author| replace:: %s
  58. """ % (project, copyright, author)
  59. # -- Options for HTML output -------------------------------------------------
  60. # The theme to use for HTML and HTML Help pages. See the documentation for
  61. # a list of builtin themes.
  62. #
  63. try:
  64. import sphinx_rtd_theme
  65. html_theme = 'sphinx_rtd_theme'
  66. except ImportError:
  67. sys.stderr.write("The Sphinx sphinx_rtd_theme HTML theme was not found.\
  68. \nPlease make sure to install the sphinx_rtd_theme python package.\n")
  69. sys.exit(1)
  70. # Add any paths that contain custom static files (such as style sheets) here,
  71. # relative to this directory. They are copied after the builtin static files,
  72. # so a file named "default.css" will overwrite the builtin "default.css".
  73. html_static_path = ['sphinx-static']
  74. # Add customm CSS and JS files
  75. html_css_files = ['theme_overrides.css']
  76. html_js_files = ['switchers.js']
  77. # Hide 'Created using Sphinx' text
  78. html_show_sphinx = False
  79. # Add 'Last updated' on each page
  80. html_last_updated_fmt = '%b %d, %Y'
  81. # Remove the trailing 'dot' in section numbers
  82. html_secnumber_suffix = " "
  83. # autoconf needs the modules available to auto-generate documentation from the
  84. # code
  85. sys.path.insert(0, str(Path('..', 'lib').resolve()))