Debian Codegraph @

dev/tools/docs/build_html_brian2.py

raw
1 import os
2 import shutil
3 import sphinx
4 if not sphinx.version_info >= (1, 8):
5 raise ImportError('Need sphinx version 1.8')
6 from sphinx.cmd.build import main as sphinx_main
7 import sys
8
9 os.chdir(os.path.join(os.path.dirname(__file__), '../../../docs_sphinx'))
10 if os.path.exists('../docs'):
11 shutil.rmtree('../docs')
12 # Some code (e.g. the definition of preferences) might need to know that Brian
13 # is used to build the documentation. The READTHEDOCS variable is set
14 # on the readthedocs.io server automatically, so we reuse it here to signal
15 # a documentation build
16 os.environ['READTHEDOCS'] = 'True'
17 sys.exit(sphinx_main(['-b', 'html', '.', '../docs']))