conf.py.in 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. import sys
  4. import os
  5. import re
  6. import glob
  7. sys.path.insert(0, r'@conf_path@')
  8. source_suffix = '.rst'
  9. master_doc = 'index'
  10. project = 'CMake'
  11. copyright = '@conf_copyright@'
  12. version = '@conf_version@' # feature version
  13. release = '@conf_release@' # full version string
  14. pygments_style = 'colors.CMakeTemplateStyle'
  15. language = 'en'
  16. primary_domain = 'cmake'
  17. highlight_language = 'none'
  18. exclude_patterns = [
  19. 'dev', # ignore developer-only documentation
  20. ]
  21. extensions = ['cmake']
  22. templates_path = ['@conf_path@/templates']
  23. nitpicky = True
  24. smartquotes = False
  25. cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
  26. cmake_manual_description = re.compile(r'^\.\. cmake-manual-description:(.*)$')
  27. man_pages = []
  28. for fpath in cmake_manuals:
  29. try:
  30. name, sec, rst = os.path.basename(fpath).split('.')
  31. desc = None
  32. f = open(fpath, 'r')
  33. for l in f:
  34. m = cmake_manual_description.match(l)
  35. if m:
  36. desc = m.group(1).strip()
  37. break
  38. f.close()
  39. if desc:
  40. man_pages.append(('manual/%s.%s' % (name, sec),
  41. name, desc, [], int(sec)))
  42. else:
  43. sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
  44. except Exception as e:
  45. sys.stderr.write("ERROR: %s\n" % str(e))
  46. man_show_urls = False
  47. man_make_section_directory = False
  48. html_baseurl = '@conf_baseurl@'
  49. html_show_sourcelink = True
  50. html_static_path = ['@conf_path@/static']
  51. html_style = 'cmake.css'
  52. html_theme = 'default'
  53. html_theme_options = {
  54. 'footerbgcolor': '#00182d',
  55. 'footertextcolor': '#ffffff',
  56. 'sidebarbgcolor': '#e4ece8',
  57. 'sidebarbtncolor': '#00a94f',
  58. 'sidebartextcolor': '#333333',
  59. 'sidebarlinkcolor': '#00a94f',
  60. 'relbarbgcolor': '#00529b',
  61. 'relbartextcolor': '#ffffff',
  62. 'relbarlinkcolor': '#ffffff',
  63. 'bgcolor': '#ffffff',
  64. 'textcolor': '#444444',
  65. 'headbgcolor': '#f2f2f2',
  66. 'headtextcolor': '#003564',
  67. 'headlinkcolor': '#3d8ff2',
  68. 'linkcolor': '#2b63a8',
  69. 'visitedlinkcolor': '#2b63a8',
  70. 'codebgcolor': '#eeeeee',
  71. 'codetextcolor': '#333333',
  72. }
  73. html_title = 'CMake %s Documentation' % release
  74. html_short_title = '%s Documentation' % release
  75. html_favicon = '@conf_path@/static/cmake-favicon.ico'
  76. # Not supported yet by sphinx:
  77. # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable
  78. # qthelp_namespace = "org.cmake"
  79. # qthelp_qch_name = "CMake.qch"
  80. linkcheck_ignore = [
  81. r'about:',
  82. r'https://gitlab\.kitware\.com/cmake/community/-/wikis/doc/cpack',
  83. r'https://www.intel.com/',
  84. ]
  85. linkcheck_allowed_redirects = {
  86. r'https://cdash\.org': r'https://www\.cdash\.org/',
  87. r'https://cmake.org/get-involved/': r'https://cmake.org/documentation/',
  88. r'https://docs\.nvidia\.com/cuda/': r'https://docs\.nvidia\.com/cuda/index\.html',
  89. r'https://learn\.microsoft\.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support': r'https://learn\.microsoft\.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support\?.*',
  90. r'https://learn\.microsoft\.com/en-us/cpp/c-language/parsing-c-command-line-arguments': r'https://learn\.microsoft\.com/en-us/cpp/c-language/parsing-c-command-line-arguments\?.*',
  91. r'https://openjdk\.java\.net/jeps/313': r'https://openjdk\.org:443/jeps/313',
  92. r'https://www\.sphinx-doc\.org': r'https://www\.sphinx-doc\.org/en/master/',
  93. }