示例#1
0
# Store the examples and tutorials directory in an environment variable,
# used by the "example finder" that is called as part of the autoclass documentation
os.environ['BRIAN2_DOCS_EXAMPLE_DIR'] = root_dir = os.path.abspath('../examples')
os.environ['BRIAN2_DOCS_TUTORIALS_DIR'] = root_dir = os.path.abspath('../tutorials')

if 'BRIAN2_DOCS_QUICK_REBUILD' not in os.environ:
    # -- Automatically generate the reference documentation ------------------------
    import brian2.sphinxext.generate_reference as generate_reference
    # first generate the reference documentation
    target_dir = './reference'
    if os.path.exists(target_dir):
        shutil.rmtree(target_dir)
    os.makedirs(target_dir)
    abs_root = os.path.abspath('../brian2')
    generate_reference.main(abs_root, ['tests', 'sphinxext'], target_dir)
    
    # -- Automatically generate the examples documentation -------------------------
    import brian2.sphinxext.generate_examples as generate_examples
    target_dir = './examples'
    root_dir = os.path.abspath('../examples')
    generate_examples.main(root_dir, target_dir)

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.0.1'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
示例#2
0
文件: conf.py 项目: qduyhoang/brian2
# used by the "example finder" that is called as part of the autoclass documentation
os.environ['BRIAN2_DOCS_EXAMPLE_DIR'] = root_dir = os.path.abspath(
    '../examples')
os.environ['BRIAN2_DOCS_TUTORIALS_DIR'] = root_dir = os.path.abspath(
    '../tutorials')

if 'BRIAN2_DOCS_QUICK_REBUILD' not in os.environ:
    # -- Automatically generate the reference documentation ------------------------
    import brian2.sphinxext.generate_reference as generate_reference
    # first generate the reference documentation
    target_dir = './reference'
    if os.path.exists(target_dir):
        shutil.rmtree(target_dir)
    os.makedirs(target_dir)
    abs_root = os.path.abspath('../brian2')
    generate_reference.main(abs_root, ['tests', 'sphinxext'], target_dir)

    # -- Automatically generate the examples documentation -------------------------
    import brian2.sphinxext.generate_examples as generate_examples
    target_dir = './examples'
    root_dir = os.path.abspath('../examples')
    generate_examples.main(root_dir, target_dir)

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.5'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
示例#3
0
os.environ['BRIAN2_DOCS_EXAMPLE_DIR'] = root_dir = os.path.abspath(
    '../examples')
os.environ['BRIAN2_DOCS_TUTORIALS_DIR'] = root_dir = os.path.abspath(
    '../tutorials')

if 'BRIAN2_DOCS_QUICK_REBUILD' not in os.environ:
    # -- Automatically generate the reference documentation ------------------------
    import brian2.sphinxext.generate_reference as generate_reference
    # first generate the reference documentation
    target_dir = './reference'
    if os.path.exists(target_dir):
        shutil.rmtree(target_dir)
    os.makedirs(target_dir)
    abs_root = os.path.abspath('../brian2')
    generate_reference.main(abs_root,
                            exclude_dirs=['tests', 'sphinxext'],
                            exclude_files=['conftest.py'],
                            destdir=target_dir)

    # -- Automatically generate the examples documentation -------------------------
    import brian2.sphinxext.generate_examples as generate_examples
    target_dir = './examples'
    root_dir = os.path.abspath('../examples')
    generate_examples.main(root_dir, target_dir)

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.7'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.