Debian Codegraph @

dev/tools/docs/quick_rebuild_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.environ['BRIAN2_DOCS_QUICK_REBUILD'] = '1'
10 # Some code (e.g. the definition of preferences) might need to know that Brian
11 # is used to build the documentation. The READTHEDOCS variable is set
12 # on the readthedocs.io server automatically, so we reuse it here to signal
13 # a documentation build
14 os.environ['READTHEDOCS'] = 'True'
15
16 os.chdir(os.path.join(os.path.dirname(__file__), '../../../docs_sphinx'))
17 if os.path.exists('../docs'):
18 shutil.rmtree('../docs')
19 sys.exit(sphinx_main(['-b', 'html', '.', '../docs']))