conf.py.in 2.5 KB

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