-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathconf.py
More file actions
139 lines (113 loc) · 4.31 KB
/
Copy pathconf.py
File metadata and controls
139 lines (113 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Configuration file for the Sphinx documentation builder.
import os
import subprocess
import sys
from natsort import natsorted
docs_dir = os.path.dirname(__file__)
repodir = os.path.abspath(os.path.join(__file__, r"../../.."))
gitdir = os.path.join(repodir, r".git")
# -- Project information -----------------------------------------------------
project = "Merlin"
copyright = "2022, NVIDIA" # pylint: disable=redefined-builtin
author = "NVIDIA"
# -- 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 = [
"myst_nb",
"sphinx_multiversion",
"sphinx_rtd_theme",
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.githubpages",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_external_toc",
"sphinxcontrib.copydirs",
]
# MyST configuration settings
external_toc_path = "toc.yaml"
myst_enable_extensions = [
"deflist",
"html_image",
"linkify",
"replacements",
"tasklist",
]
myst_linkify_fuzzy_links = False
myst_heading_anchors = 3
nb_execution_mode = "off"
# Some documents are RST and include `.. toctree::` directives.
suppress_warnings = ["etoc.toctree", "myst.header", "misc.highlighting_failure"]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = ["css/custom.css"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"titles_only": True,
"analytics_id": "G-NVJ1Y1YJHK",
}
html_copy_source = False
html_show_sourcelink = False
# Whitelist pattern for tags (set to None to ignore all tags)
# Determine if Sphinx is reading conf.py from the checked out
# repo (a Git repo) vs SMV reading conf.py from an archive of the repo
# at a commit (not a Git repo).
if os.path.exists(gitdir):
tag_refs = (
subprocess.check_output(["git", "tag", "-l", "v*"]).decode("utf-8").split()
)
tag_refs = natsorted(tag_refs)[-6:]
smv_tag_whitelist = r"^(" + r"|".join(tag_refs) + r")$"
else:
# SMV is reading conf.py from a Git archive of the repo at a
# specific commit.
smv_tag_whitelist = r"^v.*$"
# Only include main branch for now
smv_branch_whitelist = "^main$"
smv_refs_override_suffix = "-docs"
html_sidebars = {"**": ["versions.html"]}
html_baseurl = "https://nvidia-merlin.github.io/Merlin/main"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
source_suffix = [".rst", ".md"]
nbsphinx_allow_errors = True
autodoc_inherit_docstrings = False
autodoc_default_options = {
"members": True,
"undoc-members": True,
"show-inheritance": False,
"member-order": "bysource",
}
autosummary_generate = True
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"merlin-core": ("https://nvidia-merlin.github.io/core/main", None),
"merlin-systems": ("https://nvidia-merlin.github.io/systems/main", None),
"merlin-models": ("https://nvidia-merlin.github.io/models/main", None),
"NVTabular": ("https://nvidia-merlin.github.io/NVTabular/main", None),
}
copydirs_additional_dirs = ["../../examples/", "../../README.md"]
copydirs_file_rename = {
"README.md": "index.md",
}
# Generate the support matrix tables.
proc = subprocess.run(["python", "docs/smx2rst.py"], cwd=repodir, check=True)
if proc.returncode != 0:
print("Failed to generate support matrix table snippets.", file=sys.stderr)
sys.exit(1)