From 03a7b3516b7dbfa8c1a985fba8bf21715a578fcb Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 16 Oct 2015 22:24:24 +0200 Subject: [PATCH] Add an environment variable to the API build process, to make it easier to biuld your own API docs --- api/source/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/source/conf.py b/api/source/conf.py index 3eefed0..b4c3c2e 100644 --- a/api/source/conf.py +++ b/api/source/conf.py @@ -19,8 +19,11 @@ import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -path_to_code = os.path.abspath(os.path.join(os.path.split(__file__)[0], - '..', '..', '..', '..', 'openlp', 'trunk')) +if 'OPENLP_SOURCE' in os.environ: + path_to_code = os.path.abspath(os.environ['OPENLP_SOURCE']) +else: + path_to_code = os.path.abspath(os.path.join(os.path.split(__file__)[0], + '..', '..', '..', '..', 'openlp', 'trunk')) if not os.path.exists(path_to_code): print('Incorrect path to code, expecting "%s"' % path_to_code) sys.exit(1)