|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | -# Copyright 2024 Google LLC |
| 2 | +# Copyright 2025 Google LLC |
3 | 3 | # |
4 | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | # you may not use this file except in compliance with the License. |
6 | 6 | # You may obtain a copy of the License at |
7 | 7 | # |
8 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 | # |
10 | 10 | # Unless required by applicable law or agreed to in writing, software |
11 | 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
12 | 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | 13 | # See the License for the specific language governing permissions and |
14 | 14 | # limitations under the License. |
15 | | -# |
16 | | -# google-cloud-firestore documentation build configuration file |
| 15 | +## |
| 16 | +# google-cloud-firestore-admin documentation build configuration file |
17 | 17 | # |
18 | 18 | # This file is execfile()d with the current directory set to its |
19 | 19 | # containing dir. |
|
24 | 24 | # All configuration values have a default; values that are commented out |
25 | 25 | # serve to show the default. |
26 | 26 |
|
| 27 | +import logging |
27 | 28 | import os |
28 | 29 | import shlex |
29 | 30 | import sys |
| 31 | +from typing import Any |
30 | 32 |
|
31 | 33 | # If extensions (or modules to document with autodoc) are in another directory, |
32 | 34 | # add these directories to sys.path here. If the directory is relative to the |
|
42 | 44 | # -- General configuration ------------------------------------------------ |
43 | 45 |
|
44 | 46 | # If your documentation needs a minimal Sphinx version, state it here. |
45 | | -needs_sphinx = "1.5.5" |
| 47 | +needs_sphinx = "4.5.0" |
46 | 48 |
|
47 | 49 | # Add any Sphinx extension module names here, as strings. They can be |
48 | 50 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
|
80 | 82 | root_doc = "index" |
81 | 83 |
|
82 | 84 | # General information about the project. |
83 | | -project = "google-cloud-firestore" |
84 | | -copyright = "2019, Google" |
| 85 | +project = "google-cloud-firestore-admin" |
| 86 | +copyright = "2025, Google, LLC" |
85 | 87 | author = "Google APIs" |
86 | 88 |
|
87 | 89 | # The version info for the project you're documenting, acts as replacement for |
|
109 | 111 | # List of patterns, relative to source directory, that match files and |
110 | 112 | # directories to ignore when looking for source files. |
111 | 113 | exclude_patterns = [ |
| 114 | + "**/firestore.rst", |
| 115 | + "**/firestore_admin.rst", |
| 116 | + "**/services_.rst", |
| 117 | + "**/types_.rst", |
112 | 118 | "_build", |
113 | 119 | "**/.nox/**/*", |
114 | 120 | "samples/AUTHORING_GUIDE.md", |
|
154 | 160 | # further. For a list of options available for each theme, see the |
155 | 161 | # documentation. |
156 | 162 | html_theme_options = { |
157 | | - "description": "Google Cloud Client Libraries for google-cloud-firestore", |
| 163 | + "description": "Google Cloud Client Libraries for google-cloud-firestore-admin", |
158 | 164 | "github_user": "googleapis", |
159 | 165 | "github_repo": "google-cloud-python", |
160 | 166 | "github_banner": True, |
|
248 | 254 | # html_search_scorer = 'scorer.js' |
249 | 255 |
|
250 | 256 | # Output file base name for HTML help builder. |
251 | | -htmlhelp_basename = "google-cloud-firestore-doc" |
| 257 | +htmlhelp_basename = "google-cloud-firestore-admin-doc" |
252 | 258 |
|
253 | 259 | # -- Options for warnings ------------------------------------------------------ |
254 | 260 |
|
|
266 | 272 |
|
267 | 273 | latex_elements = { |
268 | 274 | # The paper size ('letterpaper' or 'a4paper'). |
269 | | - #'papersize': 'letterpaper', |
| 275 | + # 'papersize': 'letterpaper', |
270 | 276 | # The font size ('10pt', '11pt' or '12pt'). |
271 | | - #'pointsize': '10pt', |
| 277 | + # 'pointsize': '10pt', |
272 | 278 | # Additional stuff for the LaTeX preamble. |
273 | | - #'preamble': '', |
| 279 | + # 'preamble': '', |
274 | 280 | # Latex figure (float) alignment |
275 | | - #'figure_align': 'htbp', |
| 281 | + # 'figure_align': 'htbp', |
276 | 282 | } |
277 | 283 |
|
278 | 284 | # Grouping the document tree into LaTeX files. List of tuples |
|
281 | 287 | latex_documents = [ |
282 | 288 | ( |
283 | 289 | root_doc, |
284 | | - "google-cloud-firestore.tex", |
285 | | - "google-cloud-firestore Documentation", |
| 290 | + "google-cloud-firestore-admin.tex", |
| 291 | + "google-cloud-firestore-admin Documentation", |
286 | 292 | author, |
287 | 293 | "manual", |
288 | 294 | ) |
|
316 | 322 | man_pages = [ |
317 | 323 | ( |
318 | 324 | root_doc, |
319 | | - "google-cloud-firestore", |
320 | | - "google-cloud-firestore Documentation", |
| 325 | + "google-cloud-firestore-admin", |
| 326 | + "google-cloud-firestore-admin Documentation", |
321 | 327 | [author], |
322 | 328 | 1, |
323 | 329 | ) |
|
335 | 341 | texinfo_documents = [ |
336 | 342 | ( |
337 | 343 | root_doc, |
338 | | - "google-cloud-firestore", |
339 | | - "google-cloud-firestore Documentation", |
| 344 | + "google-cloud-firestore-admin", |
| 345 | + "google-cloud-firestore-admin Documentation", |
340 | 346 | author, |
341 | | - "google-cloud-firestore", |
342 | | - "google-cloud-firestore Library", |
| 347 | + "google-cloud-firestore-admin", |
| 348 | + "google-cloud-firestore-admin Library", |
343 | 349 | "APIs", |
344 | 350 | ) |
345 | 351 | ] |
|
382 | 388 | napoleon_use_ivar = False |
383 | 389 | napoleon_use_param = True |
384 | 390 | napoleon_use_rtype = True |
| 391 | + |
| 392 | + |
| 393 | +# Setup for sphinx behaviors such as warning filters. |
| 394 | +class UnexpectedUnindentFilter(logging.Filter): |
| 395 | + """Filter out warnings about unexpected unindentation following bullet lists.""" |
| 396 | + |
| 397 | + def filter(self, record: logging.LogRecord) -> bool: |
| 398 | + """Filter the log record. |
| 399 | +
|
| 400 | + Args: |
| 401 | + record (logging.LogRecord): The log record. |
| 402 | +
|
| 403 | + Returns: |
| 404 | + bool: False to suppress the warning, True to allow it. |
| 405 | + """ |
| 406 | + msg = record.getMessage() |
| 407 | + if "Bullet list ends without a blank line" in msg: |
| 408 | + return False |
| 409 | + return True |
| 410 | + |
| 411 | + |
| 412 | +def setup(app: Any) -> None: |
| 413 | + """Setup the Sphinx application. |
| 414 | +
|
| 415 | + Args: |
| 416 | + app (Any): The Sphinx application. |
| 417 | + """ |
| 418 | + # Sphinx's logger is hierarchical. Adding a filter to the |
| 419 | + # root 'sphinx' logger will catch warnings from all sub-loggers. |
| 420 | + logger = logging.getLogger("sphinx") |
| 421 | + logger.addFilter(UnexpectedUnindentFilter()) |
0 commit comments