Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit df9df95

Browse files
committed
updates the location of common macros for ads and non-ads templates
1 parent 78e2bbb commit df9df95

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

gapic/ads-templates/docs/conf.py.j2

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends '_base.py.j2' %}
22

33
{% block content %}
4+
{% from "docs/common_setup.py.j2" import sphinx_imports, sphinx_setup %}
45

56
#
67
# {{ api.naming.warehouse_package_name }} documentation build configuration file
@@ -18,6 +19,7 @@ import logging
1819
import os
1920
import shlex
2021
import sys
22+
{{ sphinx_imports() }}
2123

2224
# If extensions (or modules to document with autodoc) are in another directory,
2325
# add these directories to sys.path here. If the directory is relative to the
@@ -363,20 +365,6 @@ napoleon_use_ivar = False
363365
napoleon_use_param = True
364366
napoleon_use_rtype = True
365367

366-
# --- Specific warning filters not covered by suppress_warnings ---
367-
368-
class UnexpectedUnindentFilter(logging.Filter):
369-
"""Filter out warnings about unexpected unindentation following bullet lists."""
370-
def filter(self, record):
371-
# Return False to suppress the warning, True to allow it
372-
msg = record.getMessage()
373-
if "Bullet list ends without a blank line" in msg:
374-
return False
375-
return True
376-
377-
def setup(app):
378-
# Sphinx's logger is hierarchical. Adding a filter to the
379-
# root 'sphinx' logger will catch warnings from all sub-loggers.
380-
logger = logging.getLogger('sphinx')
381-
logger.addFilter(UnexpectedUnindentFilter())
368+
# Setup for sphinx behaviors such as warning filters.
369+
{{ sphinx_setup() }}
382370
{% endblock %}

gapic/templates/docs/common_setup.py.j2

Whitespace-only changes.

gapic/templates/docs/conf.py.j2

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends '_base.py.j2' %}
22

33
{% block content %}
4-
4+
{% from "docs/common_setup.py.j2" import sphinx_imports, sphinx_setup %}
55
#
66
# {{ api.naming.warehouse_package_name }} documentation build configuration file
77
#
@@ -18,6 +18,7 @@ import logging
1818
import os
1919
import shlex
2020
import sys
21+
{{ sphinx_imports() }}
2122

2223
# If extensions (or modules to document with autodoc) are in another directory,
2324
# add these directories to sys.path here. If the directory is relative to the
@@ -374,20 +375,5 @@ napoleon_use_ivar = False
374375
napoleon_use_param = True
375376
napoleon_use_rtype = True
376377

377-
# --- Specific warning filters not covered by suppress_warnings ---
378-
379-
class UnexpectedUnindentFilter(logging.Filter):
380-
"""Filter out warnings about unexpected unindentation following bullet lists."""
381-
def filter(self, record):
382-
# Return False to suppress the warning, True to allow it
383-
msg = record.getMessage()
384-
if "Bullet list ends without a blank line" in msg:
385-
return False
386-
return True
387-
388-
def setup(app):
389-
# Sphinx's logger is hierarchical. Adding a filter to the
390-
# root 'sphinx' logger will catch warnings from all sub-loggers.
391-
logger = logging.getLogger('sphinx')
392-
logger.addFilter(UnexpectedUnindentFilter())
378+
{{ sphinx_setup() }}
393379
{% endblock %}

0 commit comments

Comments
 (0)