conf.py.in 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. primary_domain = 'cmake'
  15. highlight_language = 'none'
  16. exclude_patterns = [
  17. 'dev', # ignore developer-only documentation
  18. ]
  19. extensions = ['cmake']
  20. templates_path = ['@conf_path@/templates']
  21. nitpicky = True
  22. cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
  23. cmake_manual_description = re.compile('^\.\. cmake-manual-description:(.*)$')
  24. man_pages = []
  25. for fpath in cmake_manuals:
  26. try:
  27. name, sec, rst = os.path.basename(fpath).split('.')
  28. desc = None
  29. f = open(fpath, 'r')
  30. for l in f:
  31. m = cmake_manual_description.match(l)
  32. if m:
  33. desc = m.group(1).strip()
  34. break
  35. f.close()
  36. if desc:
  37. man_pages.append(('manual/%s.%s' % (name, sec),
  38. name, desc, [], int(sec)))
  39. else:
  40. sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
  41. except Exception as e:
  42. sys.stderr.write("ERROR: %s\n" % str(e))
  43. man_show_urls = False
  44. html_show_sourcelink = True
  45. html_static_path = ['@conf_path@/static']
  46. html_style = 'cmake.css'
  47. html_theme = 'default'
  48. html_theme_options = {
  49. 'footerbgcolor': '#00182d',
  50. 'footertextcolor': '#ffffff',
  51. 'sidebarbgcolor': '#e4ece8',
  52. 'sidebarbtncolor': '#00a94f',
  53. 'sidebartextcolor': '#333333',
  54. 'sidebarlinkcolor': '#00a94f',
  55. 'relbarbgcolor': '#00529b',
  56. 'relbartextcolor': '#ffffff',
  57. 'relbarlinkcolor': '#ffffff',
  58. 'bgcolor': '#ffffff',
  59. 'textcolor': '#444444',
  60. 'headbgcolor': '#f2f2f2',
  61. 'headtextcolor': '#003564',
  62. 'headlinkcolor': '#3d8ff2',
  63. 'linkcolor': '#2b63a8',
  64. 'visitedlinkcolor': '#2b63a8',
  65. 'codebgcolor': '#eeeeee',
  66. 'codetextcolor': '#333333',
  67. }
  68. html_title = 'CMake %s Documentation' % release
  69. html_short_title = '%s Documentation' % release
  70. html_favicon = '@conf_path@/static/cmake-favicon.ico'
  71. # Not supported yet by sphinx:
  72. # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable
  73. # qthelp_namespace = "org.cmake"
  74. # qthelp_qch_name = "CMake-300.qch"