From 2a957dfc7ea3a856349ed321e29735edb724573f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 15 Jul 2019 17:51:39 +0200 Subject: [PATCH] Sphinx: Set tags from RTD SPHINX_TAGS env variable Up until now I mistakenly thought that ReadTheDocs' tags were the same as Sphinx tags, and would be passed to the build. It turns out that aren't, so our `.. only:: i18n` logic did not work. Instead, we now use RTD environment variables to pass comma-separated tags to Sphinx. --- conf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conf.py b/conf.py index ee3b19bc..a9cf02f7 100644 --- a/conf.py +++ b/conf.py @@ -32,11 +32,19 @@ version = 'latest' # The full version, including alpha/beta/rc tags release = 'latest' +# Parse Sphinx tags passed from RTD via environment +env_tags = os.getenv('SPHINX_TAGS', []) +for tag in env_tags.split(','): + print("Adding Sphinx tag: %s" % tag.strip()) + tags.add(tag.strip()) + +# Language / i18n language = 'en' is_i18n = tags.has('i18n') exclude_patterns = ['_build'] +# GDScript syntax highlighting from gdscript import GDScriptLexer from sphinx.highlighting import lexers lexers['gdscript'] = GDScriptLexer()