Python sphinx.apidoc.__file__() Examples

The following are 13 code examples of sphinx.apidoc.__file__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module sphinx.apidoc , or try the search function .
Example #1
Source File: conf.py    From python-template with Apache License 2.0 6 votes vote down vote up
def run_apidoc(_):
    here = os.path.dirname(__file__)
    out = os.path.abspath(os.path.join(here, 'apidocs'))
    src = os.path.abspath(os.path.join(here, '..', '{{ cookiecutter.project_slug }}'))

    ignore_paths = []

    argv = [
        "-f",
        "-T",
        "-e",
        "-M",
        "-o", out,
        src
    ] + ignore_paths

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #2
Source File: p2pdocs.py    From pulse2percept with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def run_apidoc(_):
    ignore_paths = [
        os.path.join('..', '..', 'pulse2percept', '*', 'tests')
    ]

    argv = [
        "-f",
        "-M",
        "-e",
        "-E",
        "-T",
        "-o", "aaapi",
        os.path.join('..', 'pulse2percept')
    ] + ignore_paths

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #3
Source File: conf.py    From dipper with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def run_apidoc(_):

    current_dir = os.path.abspath(os.path.dirname(__file__))
    module = os.path.join(current_dir, "..", "dipper")

    argv = [
        "-f",
        "-T",
        "-e",
        "-M",
        "-o", current_dir,
        module
    ]

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #4
Source File: conf.py    From DeepDIVA with GNU Lesser General Public License v3.0 6 votes vote down vote up
def run_apidoc(_):
    ignore_paths = []

    argv = [
        "-f",
        "-o", "source",
        ".."
    ] + ignore_paths

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #5
Source File: conf.py    From BIRL with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def run_apidoc(_):
    for pkg in PACKAGES:
        argv = ['-e',
                '-o', os.path.join(PATH_HERE, 'api'),
                os.path.join(PATH_HERE, PATH_ROOT, pkg),
                '**/test_*',
                '--force',
                '--private',
                '--module-first']
        try:
            # Sphinx 1.7+
            from sphinx.ext import apidoc
            apidoc.main(argv)
        except ImportError:
            # Sphinx 1.6 (and earlier)
            from sphinx import apidoc
            argv.insert(0, apidoc.__file__)
            apidoc.main(argv) 
Example #6
Source File: conf.py    From scriptcwl with Apache License 2.0 6 votes vote down vote up
def run_apidoc(_):
    here = os.path.dirname(__file__)
    out = os.path.abspath(os.path.join(here, 'apidocs'))
    src = os.path.abspath(os.path.join(here, '..', 'scriptcwl'))

    ignore_paths = []

    argv = [
        "-f",
        "-T",
        "-e",
        "-M",
        "-o", out,
        src
    ] + ignore_paths

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #7
Source File: conf.py    From pyImSegm with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def run_apidoc(_):
    for pkg in PACKAGES:
        argv = ['-e',
                '-o', os.path.join(PATH_HERE, 'api'),
                os.path.join(PATH_HERE, PATH_ROOT, pkg),
                'tests/*',
                '--force']
        try:
            # Sphinx 1.7+
            from sphinx.ext import apidoc
            apidoc.main(argv)
        except ImportError:
            # Sphinx 1.6 (and earlier)
            from sphinx import apidoc
            argv.insert(0, apidoc.__file__)
            apidoc.main(argv) 
Example #8
Source File: conf.py    From dowel with MIT License 6 votes vote down vote up
def run_apidoc(_):
    ignore_paths = []

    argv = [
        '-f',
        '-T',
        '-M',
        '-o', './_apidoc',
        '../src/'
    ] + ignore_paths  # yapf: disable

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #9
Source File: conf.py    From ocs-ci with MIT License 6 votes vote down vote up
def run_apidoc(_):
    ignore_paths = []

    argv = [
        "-f",
        "-o", "apidoc",
        "./ocs_ci"
    ] + ignore_paths

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #10
Source File: conf.py    From kopf with MIT License 6 votes vote down vote up
def run_apidoc(_):
    ignore_paths = [
    ]

    docs_path = os.path.relpath(os.path.dirname(__file__))
    root_path = os.path.relpath(os.path.dirname(os.path.dirname(__file__)))

    argv = [
        '--force',
        '--no-toc',
        '--separate',
        '--module-first',
        '--output-dir', os.path.join(docs_path, 'packages'),
        os.path.join(root_path, 'kopf'),
    ] + ignore_paths

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #11
Source File: conf.py    From recipy with Apache License 2.0 5 votes vote down vote up
def run_apidoc(_):
    here = os.path.dirname(__file__)
    out = os.path.abspath(os.path.join(here, '_apidoc'))
    src = os.path.abspath(os.path.join(here, '..'))

    ignore_paths = [
        os.path.join(src, 'integration_test'),
        os.path.join(src, 'setup.py'),
        os.path.join(src, 'process_changelog.py'),
        os.path.join(src, 'recipyGui', 'tests'),
        os.path.join(src, 'recipyCommon', 'tests'),
        os.path.join(src, 'recipy', 'tests'),
    ]

    argv = [
        "-f",
        "-l",
        "-e",
        "-M",
        "-o", out,
        src,
    ] + ignore_paths

    print(' '.join(argv))

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
        apidoc.main(argv)
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)
        apidoc.main(argv) 
Example #12
Source File: conf.py    From dask-image with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def run_apidoc(_):
    ignore_paths = [
        "../setup.py",
        "../tests",
        "../travis_pypi_setup.py",
        "../versioneer.py"
    ]

    argv = [
        "-f",
        "-T",
        "-e",
        "-M",
        "-o", ".",
        ".."
    ] + ignore_paths

    try:
        # Sphinx 1.7+
        from sphinx.ext import apidoc
    except ImportError:
        # Sphinx 1.6 (and earlier)
        from sphinx import apidoc
        argv.insert(0, apidoc.__file__)

    apidoc.main(argv) 
Example #13
Source File: conf.py    From asteroid with MIT License 5 votes vote down vote up
def run_apidoc(_):
    os.makedirs(os.path.join(PATH_HERE, 'apidoc'), exist_ok=True)
    for pkg in PACKAGES:
        argv = ['-e', '-o', os.path.join(PATH_HERE, 'apidoc'),
                os.path.join(PATH_HERE, PATH_ROOT, pkg), '**/test_*',
                '--force', '--private', '--module-first']
        try:
            # Sphinx 1.7+
            from sphinx.ext import apidoc
            apidoc.main(argv)
        except ImportError:
            # Sphinx 1.6 (and earlier)
            from sphinx import apidoc
            argv.insert(0, apidoc.__file__)
            apidoc.main(argv)