2015-12-12 16:58:18 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2015-12-12 17:57:44 +01:00
|
|
|
# Godot Engine documentation build configuration file
|
2015-12-12 16:58:18 +01:00
|
|
|
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
|
|
|
|
# -- General configuration ------------------------------------------------
|
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
needs_sphinx = '1.3'
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# Sphinx extension module names and templates location
|
2016-07-01 04:08:04 +02:00
|
|
|
sys.path.append(os.path.abspath('extensions'))
|
2019-10-29 08:34:57 +01:00
|
|
|
extensions = ['gdscript', 'sphinx_tabs.tabs', 'sphinx.ext.imgmath']
|
2019-10-03 03:01:53 +02:00
|
|
|
|
2015-12-12 16:58:18 +01:00
|
|
|
templates_path = ['_templates']
|
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# You can specify multiple suffix as a list of string: ['.rst', '.md']
|
2015-12-12 16:58:18 +01:00
|
|
|
source_suffix = '.rst'
|
2015-12-12 17:57:44 +01:00
|
|
|
source_encoding = 'utf-8-sig'
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# The master toctree document
|
2015-12-12 16:58:18 +01:00
|
|
|
master_doc = 'index'
|
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# General information about the project
|
|
|
|
project = 'Godot Engine'
|
2020-01-29 01:38:44 +01:00
|
|
|
copyright = '2014-2020, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0)'
|
2015-12-12 17:57:44 +01:00
|
|
|
author = 'Juan Linietsky, Ariel Manzur and the Godot community'
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# Version info for the project, acts as replacement for |version| and |release|
|
|
|
|
# The short X.Y version
|
|
|
|
version = 'latest'
|
|
|
|
# The full version, including alpha/beta/rc tags
|
|
|
|
release = 'latest'
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2019-07-15 17:51:39 +02:00
|
|
|
# Parse Sphinx tags passed from RTD via environment
|
2019-07-15 19:48:17 +02:00
|
|
|
env_tags = os.getenv('SPHINX_TAGS')
|
|
|
|
if env_tags != None:
|
|
|
|
for tag in env_tags.split(','):
|
|
|
|
print("Adding Sphinx tag: %s" % tag.strip())
|
|
|
|
tags.add(tag.strip())
|
2019-07-15 17:51:39 +02:00
|
|
|
|
|
|
|
# Language / i18n
|
2019-07-17 09:16:57 +02:00
|
|
|
language = os.getenv('READTHEDOCS_LANGUAGE', 'en')
|
2019-06-16 20:43:11 +02:00
|
|
|
is_i18n = tags.has('i18n')
|
2015-12-12 16:58:18 +01:00
|
|
|
|
|
|
|
exclude_patterns = ['_build']
|
|
|
|
|
2019-07-15 17:51:39 +02:00
|
|
|
# GDScript syntax highlighting
|
2016-07-01 04:08:04 +02:00
|
|
|
from gdscript import GDScriptLexer
|
|
|
|
from sphinx.highlighting import lexers
|
|
|
|
lexers['gdscript'] = GDScriptLexer()
|
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# Pygments (syntax highlighting) style to use
|
2015-12-12 16:58:18 +01:00
|
|
|
pygments_style = 'sphinx'
|
2016-07-01 04:08:04 +02:00
|
|
|
highlight_language = 'gdscript'
|
2015-12-12 16:58:18 +01:00
|
|
|
|
|
|
|
# -- Options for HTML output ----------------------------------------------
|
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
|
|
|
|
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2016-07-20 23:39:20 +02:00
|
|
|
import sphinx_rtd_theme
|
|
|
|
html_theme = 'sphinx_rtd_theme'
|
|
|
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
|
|
|
if on_rtd:
|
2018-11-20 11:02:11 +01:00
|
|
|
using_rtd_theme = True
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2016-07-07 15:34:44 +02:00
|
|
|
# Theme options
|
|
|
|
html_theme_options = {
|
2016-07-20 23:16:28 +02:00
|
|
|
# 'typekit_id': 'hiw1hhg',
|
|
|
|
# 'analytics_id': '',
|
|
|
|
# 'sticky_navigation': True # Set to False to disable the sticky nav while scrolling.
|
2016-07-20 23:17:05 +02:00
|
|
|
'logo_only': True, # if we have a html_logo below, this shows /only/ the logo with no title text
|
2016-07-20 23:16:28 +02:00
|
|
|
'collapse_navigation': False, # Collapse navigation (False makes it tree-like)
|
|
|
|
# 'display_version': True, # Display the docs version
|
|
|
|
# 'navigation_depth': 4, # Depth of the headers shown in the navigation bar
|
2016-07-07 15:34:44 +02:00
|
|
|
}
|
|
|
|
|
2018-03-05 13:19:11 +01:00
|
|
|
# VCS options: https://docs.readthedocs.io/en/latest/vcs.html#github
|
|
|
|
html_context = {
|
2019-06-16 20:43:11 +02:00
|
|
|
"display_github": not is_i18n, # Integrate GitHub
|
2018-03-05 13:19:11 +01:00
|
|
|
"github_user": "godotengine", # Username
|
|
|
|
"github_repo": "godot-docs", # Repo name
|
|
|
|
"github_version": "master", # Version
|
|
|
|
"conf_py_path": "/", # Path in the checkout to the docs root
|
|
|
|
}
|
|
|
|
|
2016-07-20 23:17:05 +02:00
|
|
|
html_logo = 'img/docs_logo.png'
|
2016-07-20 23:16:28 +02:00
|
|
|
|
2019-11-17 22:54:38 +01:00
|
|
|
# These folders are copied to the documentation's HTML output
|
|
|
|
html_static_path = ['_static']
|
|
|
|
|
2020-01-18 19:30:20 +01:00
|
|
|
html_extra_path = ['robots.txt']
|
|
|
|
|
2019-11-17 22:54:38 +01:00
|
|
|
# These paths are either relative to html_static_path
|
|
|
|
# or fully qualified paths (eg. https://...)
|
|
|
|
html_css_files = [
|
|
|
|
'css/custom.css',
|
|
|
|
]
|
|
|
|
|
2020-01-23 04:53:24 +01:00
|
|
|
html_js_files = [
|
|
|
|
'js/custom.js',
|
|
|
|
]
|
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# Output file base name for HTML help builder
|
2015-12-12 16:58:18 +01:00
|
|
|
htmlhelp_basename = 'GodotEnginedoc'
|
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# -- Options for reStructuredText parser ----------------------------------
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# Enable directives that insert the contents of external files
|
|
|
|
file_insertion_enabled = False
|
2015-12-12 16:58:18 +01:00
|
|
|
|
2015-12-12 17:57:44 +01:00
|
|
|
# -- Options for LaTeX output ---------------------------------------------
|
2015-12-12 16:58:18 +01:00
|
|
|
|
|
|
|
# Grouping the document tree into LaTeX files. List of tuples
|
|
|
|
# (source start file, target name, title,
|
|
|
|
# author, documentclass [howto, manual, or own class]).
|
|
|
|
latex_documents = [
|
2015-12-12 17:57:44 +01:00
|
|
|
(master_doc, 'GodotEngine.tex', 'Godot Engine Documentation',
|
|
|
|
'Juan Linietsky, Ariel Manzur and the Godot community', 'manual'),
|
2015-12-12 16:58:18 +01:00
|
|
|
]
|
2018-03-03 01:40:52 +01:00
|
|
|
|
2018-05-31 01:49:21 +02:00
|
|
|
# -- Options for linkcheck builder ----------------------------------------
|
|
|
|
|
|
|
|
# disable checking urls with about.html#this_part_of_page anchors
|
|
|
|
linkcheck_anchors = False
|
|
|
|
|
|
|
|
linkcheck_timeout = 10
|
|
|
|
|
2018-03-03 01:40:52 +01:00
|
|
|
# -- I18n settings --------------------------------------------------------
|
2018-03-28 15:45:34 +02:00
|
|
|
|
|
|
|
locale_dirs = ['../sphinx/po/']
|
2018-03-03 01:40:52 +01:00
|
|
|
gettext_compact = False
|
2019-07-28 05:22:50 +02:00
|
|
|
|
|
|
|
# Couldn't find a way to retrieve variables nor do advanced string
|
|
|
|
# concat from reST, so had to hardcode this in the "epilog" added to
|
|
|
|
# all pages. This is used in index.rst to display the Weblate badge.
|
|
|
|
# On English pages, the badge points to the language-neutral engage page.
|
|
|
|
rst_epilog = """
|
|
|
|
.. |weblate_widget| image:: https://hosted.weblate.org/widgets/godot-engine/{image_locale}/godot-docs/287x66-white.png
|
|
|
|
:alt: Translation status
|
|
|
|
:target: https://hosted.weblate.org/engage/godot-engine{target_locale}/?utm_source=widget
|
|
|
|
""".format(
|
|
|
|
image_locale='-' if language == 'en' else language,
|
|
|
|
target_locale='' if language == 'en' else '/' + language
|
|
|
|
)
|
|
|
|
|
2018-03-03 01:40:52 +01:00
|
|
|
# Exclude class reference when marked with tag i18n.
|
2019-06-16 20:43:11 +02:00
|
|
|
if is_i18n:
|
2018-03-03 01:40:52 +01:00
|
|
|
exclude_patterns = ['classes']
|