conf.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # -*- coding: utf-8 -*-
  2. #
  3. # Godot Engine documentation build configuration file
  4. import sys
  5. import os
  6. # -- General configuration ------------------------------------------------
  7. needs_sphinx = '1.3'
  8. # Sphinx extension module names and templates location
  9. sys.path.append(os.path.abspath('extensions'))
  10. extensions = ['gdscript', 'sphinx_tabs.tabs', 'sphinx.ext.imgmath']
  11. templates_path = ['_templates']
  12. # You can specify multiple suffix as a list of string: ['.rst', '.md']
  13. source_suffix = '.rst'
  14. source_encoding = 'utf-8-sig'
  15. # The master toctree document
  16. master_doc = 'index'
  17. # General information about the project
  18. project = 'Godot Engine'
  19. copyright = '2014-2018, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0)'
  20. author = 'Juan Linietsky, Ariel Manzur and the Godot community'
  21. # Version info for the project, acts as replacement for |version| and |release|
  22. # The short X.Y version
  23. version = 'latest'
  24. # The full version, including alpha/beta/rc tags
  25. release = 'latest'
  26. language = 'en'
  27. exclude_patterns = ['_build']
  28. from gdscript import GDScriptLexer
  29. from sphinx.highlighting import lexers
  30. lexers['gdscript'] = GDScriptLexer()
  31. # Pygments (syntax highlighting) style to use
  32. pygments_style = 'sphinx'
  33. highlight_language = 'gdscript'
  34. # -- Options for HTML output ----------------------------------------------
  35. # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
  36. on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
  37. import sphinx_rtd_theme
  38. html_theme = 'sphinx_rtd_theme'
  39. html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  40. if on_rtd:
  41. using_rtd_theme = True
  42. # Theme options
  43. html_theme_options = {
  44. # 'typekit_id': 'hiw1hhg',
  45. # 'analytics_id': '',
  46. # 'sticky_navigation': True # Set to False to disable the sticky nav while scrolling.
  47. 'logo_only': True, # if we have a html_logo below, this shows /only/ the logo with no title text
  48. 'collapse_navigation': False, # Collapse navigation (False makes it tree-like)
  49. # 'display_version': True, # Display the docs version
  50. # 'navigation_depth': 4, # Depth of the headers shown in the navigation bar
  51. }
  52. # VCS options: https://docs.readthedocs.io/en/latest/vcs.html#github
  53. html_context = {
  54. "display_github": True, # Integrate GitHub
  55. "github_user": "godotengine", # Username
  56. "github_repo": "godot-docs", # Repo name
  57. "github_version": "master", # Version
  58. "conf_py_path": "/", # Path in the checkout to the docs root
  59. }
  60. html_logo = 'img/docs_logo.png'
  61. # Output file base name for HTML help builder
  62. htmlhelp_basename = 'GodotEnginedoc'
  63. # -- Options for reStructuredText parser ----------------------------------
  64. # Enable directives that insert the contents of external files
  65. file_insertion_enabled = False
  66. # -- Options for LaTeX output ---------------------------------------------
  67. # Grouping the document tree into LaTeX files. List of tuples
  68. # (source start file, target name, title,
  69. # author, documentclass [howto, manual, or own class]).
  70. latex_documents = [
  71. (master_doc, 'GodotEngine.tex', 'Godot Engine Documentation',
  72. 'Juan Linietsky, Ariel Manzur and the Godot community', 'manual'),
  73. ]
  74. # -- Options for linkcheck builder ----------------------------------------
  75. # disable checking urls with about.html#this_part_of_page anchors
  76. linkcheck_anchors = False
  77. linkcheck_timeout = 10
  78. # -- I18n settings --------------------------------------------------------
  79. locale_dirs = ['../sphinx/po/']
  80. gettext_compact = False
  81. # Exclude class reference when marked with tag i18n.
  82. if tags.has('i18n'):
  83. exclude_patterns = ['classes']