conf.py.in 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file LICENSE.rst 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. # Ignore developer-only documentation
  20. 'dev',
  21. # NOTE Ignore shared RST files used in `.. include::` directives
  22. 'include/*.rst',
  23. '**/include/*.rst'
  24. ]
  25. extensions = ['cmake']
  26. templates_path = ['@conf_path@/templates']
  27. nitpicky = True
  28. smartquotes = False
  29. if @conf_cmakeorg@:
  30. tags.add('cmakeorg')
  31. cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
  32. cmake_manual_description = re.compile(r'^\.\. cmake-manual-description:(.*)$')
  33. man_pages = []
  34. for fpath in cmake_manuals:
  35. try:
  36. name, sec, rst = os.path.basename(fpath).split('.')
  37. desc = None
  38. f = open(fpath, 'r')
  39. for l in f:
  40. m = cmake_manual_description.match(l)
  41. if m:
  42. desc = m.group(1).strip()
  43. break
  44. f.close()
  45. if desc:
  46. man_pages.append(('manual/%s.%s' % (name, sec),
  47. name, desc, [], int(sec)))
  48. else:
  49. sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
  50. except Exception as e:
  51. sys.stderr.write("ERROR: %s\n" % str(e))
  52. man_show_urls = False
  53. man_make_section_directory = False
  54. html_baseurl = '@conf_baseurl@'
  55. html_show_sourcelink = True
  56. html_static_path = ['@conf_path@/static']
  57. html_style = 'cmake.css'
  58. html_theme = 'default'
  59. html_theme_options = {
  60. 'footerbgcolor': '#00182d',
  61. 'footertextcolor': '#ffffff',
  62. 'sidebarbgcolor': '#e4ece8',
  63. 'sidebarbtncolor': '#00a94f',
  64. 'sidebartextcolor': '#333333',
  65. 'sidebarlinkcolor': '#00a94f',
  66. 'relbarbgcolor': '#00529b',
  67. 'relbartextcolor': '#ffffff',
  68. 'relbarlinkcolor': '#ffffff',
  69. 'bgcolor': '#ffffff',
  70. 'textcolor': '#444444',
  71. 'headbgcolor': '#f2f2f2',
  72. 'headtextcolor': '#003564',
  73. 'headlinkcolor': '#3d8ff2',
  74. 'linkcolor': '#2b63a8',
  75. 'visitedlinkcolor': '#2b63a8',
  76. 'codebgcolor': '#eeeeee',
  77. 'codetextcolor': '#333333',
  78. }
  79. html_title = 'CMake %s Documentation' % release
  80. html_short_title = '%s Documentation' % release
  81. html_favicon = '@conf_path@/static/cmake-favicon.ico'
  82. # Not supported yet by sphinx:
  83. # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable
  84. # qthelp_namespace = "org.cmake"
  85. # qthelp_qch_name = "CMake.qch"
  86. linkcheck_ignore = [
  87. r'about:',
  88. r'https://gitlab\.kitware\.com/cmake/community/-/wikis/doc/cpack',
  89. r'https://web\.archive\.org/',
  90. r'https://www\.gnu\.org/',
  91. r'https://www\.intel\.com/',
  92. r'https://[a-z0-9]+\.sourceforge\.net/?$',
  93. r'https://www\.tasking\.com($|/)',
  94. ]
  95. linkcheck_allowed_redirects = {
  96. r'https://cdash\.org': r'https://www\.cdash\.org/',
  97. r'https://cmake.org/get-involved/': r'https://cmake.org/documentation/',
  98. r'https://docs\.nvidia\.com/cuda/': r'https://docs\.nvidia\.com/cuda/index\.html',
  99. r'https://learn\.microsoft\.com/en-us/cpp/build/reference/export-exports-a-function': r'https://learn\.microsoft\.com/en-us/cpp/build/reference/export-exports-a-function\?.*',
  100. 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\?.*',
  101. 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\?.*',
  102. r'https://openjdk\.java\.net/jeps/313': r'https://openjdk\.org:443/jeps/313',
  103. r'https://www\.renesas\.com': r'https://www\.renesas\.com/en',
  104. r'https://www\.sphinx-doc\.org': r'https://www\.sphinx-doc\.org/en/master/',
  105. }
  106. linkcheck_report_timeouts_as_broken = False