| 1 |
import os |
| 2 |
import sys |
| 3 |
|
| 4 |
from sphinx.util import logging |
| 5 |
|
| 6 |
|
| 7 |
logging.getLogger('sphinx.ext.extlinks').setLevel(40) |
| 8 |
|
| 9 |
dir_ = os.path.dirname(os.path.realpath(__file__)) |
| 10 |
|
| 11 |
|
| 12 |
def exec_module(path): |
| 13 |
import importlib.machinery |
| 14 |
loader = importlib.machinery.SourceFileLoader("cairo", path) |
| 15 |
return loader.load_module() |
| 16 |
|
| 17 |
|
| 18 |
sys.modules["cairo"] = exec_module(os.path.join(dir_, "..", "cairo", "__init__.pyi")) |
| 19 |
|
| 20 |
extensions = [ |
| 21 |
'sphinx.ext.intersphinx', |
| 22 |
'sphinx.ext.extlinks', |
| 23 |
'sphinx.ext.autodoc', |
| 24 |
] |
| 25 |
intersphinx_mapping = { |
| 26 |
'python3': ('https://docs.python.org/3', None), |
| 27 |
} |
| 28 |
source_suffix = '.rst' |
| 29 |
master_doc = 'index' |
| 30 |
project = 'Pycairo' |
| 31 |
html_show_copyright = False |
| 32 |
exclude_patterns = ['_build'] |
| 33 |
pygments_style = 'friendly' |
| 34 |
html_theme = "sphinx_rtd_theme" |
| 35 |
html_theme_options = { |
| 36 |
"display_version": False, |
| 37 |
} |
| 38 |
html_context = { |
| 39 |
'extra_css_files': [ |
| 40 |
'_static/extra.css', |
| 41 |
], |
| 42 |
} |
| 43 |
|
| 44 |
html_static_path = [ |
| 45 |
"extra.css", |
| 46 |
] |
| 47 |
|
| 48 |
extlinks = { |
| 49 |
'fdobug': ('https://bugs.freedesktop.org/show_bug.cgi?id=%s', '#fdo-%s'), |
| 50 |
'bug': ('https://github.com/pygobject/pycairo/issues/%s', '#%s'), |
| 51 |
'pr': ('https://github.com/pygobject/pycairo/pull/%s', '#pr-%s'), |
| 52 |
'user': ('https://github.com/%s', '%s'), |
| 53 |
} |
| 54 |
suppress_warnings = ["image.nonlocal_uri"] |
| 55 |
|
| 56 |
autoclass_content = 'class' |
| 57 |
|
| 58 |
autodoc_default_options = { |
| 59 |
'member-order': 'bysource', |
| 60 |
} |
| 61 |
|
| 62 |
autodoc_type_aliases = { |
| 63 |
'_PathLike': 'cairo._PathLike', |
| 64 |
'_FileLike': 'cairo._FileLike', |
| 65 |
} |