Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ def py_library(self, **kwargs) -> Path:
):
self.excludes += ["docs/index.rst"]

# Add kwargs to signal that UPGRADING.md should be included in docs/index.rst if it exists
if Path("docs/UPGRADING.md").exists():
kwargs["include_uprading_doc"] = True

# Assume the python-docs-samples Dockerfile is used for samples by default
if "custom_samples_dockerfile" not in kwargs:
kwargs["custom_samples_dockerfile"] = False
Expand Down
11 changes: 6 additions & 5 deletions synthtool/gcp/templates/python_library/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@ API Reference
{{ version }}/services
{{ version }}/types
{% endfor %}
{%- if migration_guide_version %}
{% if include_uprading_doc %}
Migration Guide
---------------

See the guide below for instructions on migrating to the {{ migration_guide_version }} release of this library.
See the guide below for instructions on migrating to the latest version.

.. toctree::
:maxdepth: 2

UPGRADING
 UPGRADING

{% endif %}
Changelog
---------

For a list of all ``{{ metadata['repo']['distribution_name'] }}`` releases:

.. toctree::
:maxdepth: 2
:maxdepth: 2

changelog
changelog