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.
This commit is contained in:
parent
bafd8b654e
commit
2a957dfc7e
8
conf.py
8
conf.py
|
@ -32,11 +32,19 @@ version = 'latest'
|
||||||
# The full version, including alpha/beta/rc tags
|
# The full version, including alpha/beta/rc tags
|
||||||
release = 'latest'
|
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'
|
language = 'en'
|
||||||
is_i18n = tags.has('i18n')
|
is_i18n = tags.has('i18n')
|
||||||
|
|
||||||
exclude_patterns = ['_build']
|
exclude_patterns = ['_build']
|
||||||
|
|
||||||
|
# GDScript syntax highlighting
|
||||||
from gdscript import GDScriptLexer
|
from gdscript import GDScriptLexer
|
||||||
from sphinx.highlighting import lexers
|
from sphinx.highlighting import lexers
|
||||||
lexers['gdscript'] = GDScriptLexer()
|
lexers['gdscript'] = GDScriptLexer()
|
||||||
|
|
Loading…
Reference in New Issue