| 
 | 1 | +# Configuration file for the Sphinx documentation builder.  | 
 | 2 | +#  | 
 | 3 | +# This file only contains a selection of the most common options. For a full  | 
 | 4 | +# list see the documentation:  | 
 | 5 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html  | 
 | 6 | + | 
 | 7 | +# -- Path setup --------------------------------------------------------------  | 
 | 8 | + | 
 | 9 | +# If extensions (or modules to document with autodoc) are in another directory,  | 
 | 10 | +# add these directories to sys.path here. If the directory is relative to the  | 
 | 11 | +# documentation root, use os.path.abspath to make it absolute, like shown here.  | 
 | 12 | +#  | 
 | 13 | +import os  | 
 | 14 | +import subprocess  | 
 | 15 | +import sys  | 
 | 16 | + | 
 | 17 | +sys.path.insert(0, os.path.abspath('..'))  | 
 | 18 | + | 
 | 19 | +# -- Project information -----------------------------------------------------  | 
 | 20 | + | 
 | 21 | +project = 'MMSegmentation'  | 
 | 22 | +copyright = '2020-2021, OpenMMLab'  | 
 | 23 | +author = 'MMSegmentation Authors'  | 
 | 24 | +version_file = '../mmseg/version.py'  | 
 | 25 | + | 
 | 26 | + | 
 | 27 | +def get_version():  | 
 | 28 | +    with open(version_file, 'r') as f:  | 
 | 29 | +        exec(compile(f.read(), version_file, 'exec'))  | 
 | 30 | +    return locals()['__version__']  | 
 | 31 | + | 
 | 32 | + | 
 | 33 | +# The full version, including alpha/beta/rc tags  | 
 | 34 | +release = get_version()  | 
 | 35 | + | 
 | 36 | +# -- General configuration ---------------------------------------------------  | 
 | 37 | + | 
 | 38 | +# Add any Sphinx extension module names here, as strings. They can be  | 
 | 39 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom  | 
 | 40 | +# ones.  | 
 | 41 | +extensions = [  | 
 | 42 | +    'sphinx.ext.autodoc',  | 
 | 43 | +    'sphinx.ext.napoleon',  | 
 | 44 | +    'sphinx.ext.viewcode',  | 
 | 45 | +    'recommonmark',  | 
 | 46 | +    'sphinx_markdown_tables',  | 
 | 47 | +]  | 
 | 48 | + | 
 | 49 | +autodoc_mock_imports = ['matplotlib', 'pycocotools', 'mmseg.version']  | 
 | 50 | + | 
 | 51 | +# Add any paths that contain templates here, relative to this directory.  | 
 | 52 | +templates_path = ['_templates']  | 
 | 53 | + | 
 | 54 | +# The suffix(es) of source filenames.  | 
 | 55 | +# You can specify multiple suffix as a list of string:  | 
 | 56 | +#  | 
 | 57 | +source_suffix = {  | 
 | 58 | +    '.rst': 'restructuredtext',  | 
 | 59 | +    '.md': 'markdown',  | 
 | 60 | +}  | 
 | 61 | + | 
 | 62 | +# The master toctree document.  | 
 | 63 | +master_doc = 'index'  | 
 | 64 | + | 
 | 65 | +# List of patterns, relative to source directory, that match files and  | 
 | 66 | +# directories to ignore when looking for source files.  | 
 | 67 | +# This pattern also affects html_static_path and html_extra_path.  | 
 | 68 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']  | 
 | 69 | + | 
 | 70 | +# -- Options for HTML output -------------------------------------------------  | 
 | 71 | + | 
 | 72 | +# The theme to use for HTML and HTML Help pages.  See the documentation for  | 
 | 73 | +# a list of builtin themes.  | 
 | 74 | +#  | 
 | 75 | +html_theme = 'sphinx_rtd_theme'  | 
 | 76 | + | 
 | 77 | +# Add any paths that contain custom static files (such as style sheets) here,  | 
 | 78 | +# relative to this directory. They are copied after the builtin static files,  | 
 | 79 | +# so a file named "default.css" will overwrite the builtin "default.css".  | 
 | 80 | +html_static_path = ['_static']  | 
 | 81 | + | 
 | 82 | +language = 'zh_CN'  | 
 | 83 | + | 
 | 84 | + | 
 | 85 | +def builder_inited_handler(app):  | 
 | 86 | +    subprocess.run(['./stat.py'])  | 
 | 87 | + | 
 | 88 | + | 
 | 89 | +def setup(app):  | 
 | 90 | +    app.connect('builder-inited', builder_inited_handler)  | 
0 commit comments