1# -*- coding: utf-8; mode: python -*-
2"""Implement some sphinx-build tools.
8from sphinx.util.pycompat import execfile_
10# ------------------------------------------------------------------------------
11def load_sphinx_config(namespace):
12# ------------------------------------------------------------------------------
14 u"""Load an additional configuration file into *namespace*.
16 The name of the configuration file is taken from the environment
17 ``SPHINX_CONF``. The external configuration file extends (or overwrites) the
18 configuration values from the origin ``conf.py``. With this you are able to
19 maintain *build themes*. To your docs/conf.py add::
21 from sphinx_build_tools import load_sphinx_config
24 # Since loadConfig overwrites settings from the global namespace, it has to be
25 # the last statement in the conf.py file
27 load_sphinx_config(globals())
31 config_file = os.environ.get("SPHINX_CONF", None)
32 if (config_file is not None
33 and os.path.normpath(namespace["__file__"]) != os.path.normpath(config_file) ):
34 config_file = os.path.abspath(config_file)
36 if os.path.isfile(config_file):
38 "load additional sphinx-config: %s\n"
40 config = namespace.copy()
41 config['__file__'] = config_file
42 execfile_(config_file, config)
43 del config['__file__']
44 namespace.update(config)
47 "WARNING: additional sphinx-config not found: %s\n"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list