Newer
Older
"""We need to run Sphinx inside MantidPlot to document the internal
module. This script calls the sphinx entry point with the necessary
# Update path to find mantid
sys.path.insert(0, "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
# Update environment with screenshots path
screenshots_dir = "@SCREENSHOTS_DIR@"
if screenshots_dir != "":
os.environ["SCREENSHOTS_DIR"] = screenshots_dir
src_dir = "@SPHINX_SRC_DIR@"
sphinx_build_dir = "@SPHINX_BUILD_DIR@"
output_dir = os.path.join(sphinx_build_dir, builder)
doctree_dir = os.path.join(sphinx_build_dir, "doctrees", builder)
# See if we have been told to only process a particular file
src_file = os.environ.get("SPHINX_SRC_FILE", None)
argv = [sys.executable, "-b", builder, "-d", doctree_dir, src_dir, output_dir]
if src_file is not None:
argv.append(src_file)
# run
sys.exit(sphinx.main(argv))
##################################################################################
if __name__ == "__main__":
main()