Exemple #1
0
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import openmdao
import sphinxcontrib
from numpydoc.docscrape import NumpyDocString, Reader

openmdao_path = os.path.split(os.path.abspath(openmdao.__file__))[0]

from openmdao.docutils import do_monkeypatch, generate_docs, embed_code, embed_options

do_monkeypatch()

sys.path.insert(0, os.path.join(openmdao_path, 'docs', '_exts'))
sys.path.insert(0, os.path.join(openmdao_path, 'docs', '_utils'))
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))

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

# 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.autosummary',
    'sphinx.ext.doctest',
from openmdao.docutils import do_monkeypatch, embed_code, embed_options, embed_compare
from openaerostruct.docs._utils.generate_sourcedocs import generate_docs

openmdao_path = os.path.split(os.path.abspath(openmdao.__file__))[0]
sys.path.insert(0, os.path.join(openmdao_path, 'docs', '_exts'))
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))

# Only mock the ones that don't import.
for mod_name in MOCK_MODULES:
    try:
        importlib.import_module(mod_name)
    except ImportError:
        sys.modules[mod_name] = Mock()

do_monkeypatch()

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

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

# 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',
              'sphinx.ext.coverage',
              'sphinx.ext.mathjax',
              'sphinx.ext.viewcode',