MCPcopy
hub / github.com/pandas-dev/pandas / _sphinx_build

Method _sphinx_build

doc/make.py:121–151  ·  view source on GitHub ↗

Call sphinx to build documentation. Attribute `num_jobs` from the class is used. Parameters ---------- kind : {'html', 'latex', 'linkcheck'} Examples -------- >>> DocBuilder(num_jobs=4)._sphinx_build("html")

(self, kind: str)

Source from the content-addressed store, hash-verified

119 subprocess.check_call(args, stdout=sys.stdout, stderr=sys.stderr)
120
121 def _sphinx_build(self, kind: str):
122 """
123 Call sphinx to build documentation.
124
125 Attribute `num_jobs` from the class is used.
126
127 Parameters
128 ----------
129 kind : {'html', 'latex', 'linkcheck'}
130
131 Examples
132 --------
133 >>> DocBuilder(num_jobs=4)._sphinx_build("html")
134 """
135 if kind not in ("html", "latex", "linkcheck"):
136 raise ValueError(f"kind must be html, latex or linkcheck, not {kind}")
137
138 cmd = ["sphinx-build", "-b", kind]
139 if self.num_jobs:
140 cmd += ["-j", self.num_jobs]
141 if self.warnings_are_errors:
142 cmd += ["-W", "--keep-going"]
143 if self.verbosity:
144 cmd.append(f"-{'v' * self.verbosity}")
145 cmd += [
146 "-d",
147 os.path.join(BUILD_PATH, "doctrees"),
148 SOURCE_PATH,
149 os.path.join(BUILD_PATH, kind),
150 ]
151 return subprocess.call(cmd)
152
153 def _open_browser(self, single_doc_html) -> None:
154 """

Callers 3

htmlMethod · 0.95
latexMethod · 0.95
linkcheckMethod · 0.95

Calls 2

appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected