1
0

conf.py.in 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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('^\.\. 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_show_sourcelink = True
  49. html_static_path = ['@conf_path@/static']
  50. html_style = 'cmake.css'
  51. html_theme = 'default'
  52. html_theme_options = {
  53. 'footerbgcolor': '#00182d',
  54. 'footertextcolor': '#ffffff',
  55. 'sidebarbgcolor': '#e4ece8',
  56. 'sidebarbtncolor': '#00a94f',
  57. 'sidebartextcolor': '#333333',
  58. 'sidebarlinkcolor': '#00a94f',
  59. 'relbarbgcolor': '#00529b',
  60. 'relbartextcolor': '#ffffff',
  61. 'relbarlinkcolor': '#ffffff',
  62. 'bgcolor': '#ffffff',
  63. 'textcolor': '#444444',
  64. 'headbgcolor': '#f2f2f2',
  65. 'headtextcolor': '#003564',
  66. 'headlinkcolor': '#3d8ff2',
  67. 'linkcolor': '#2b63a8',
  68. 'visitedlinkcolor': '#2b63a8',
  69. 'codebgcolor': '#eeeeee',
  70. 'codetextcolor': '#333333',
  71. }
  72. html_title = 'CMake %s Documentation' % release
  73. html_short_title = '%s Documentation' % release
  74. html_favicon = '@conf_path@/static/cmake-favicon.ico'
  75. # Not supported yet by sphinx:
  76. # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable
  77. # qthelp_namespace = "org.cmake"
  78. # qthelp_qch_name = "CMake.qch"