conf.py 3.8 KB

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