Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(python): include docs/UPGRADING.md in docs/index.rst if it exists #1245

Merged
merged 8 commits into from
Oct 19, 2021
4 changes: 4 additions & 0 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ def py_library(self, **kwargs) -> Path:
):
self.excludes += ["docs/index.rst"]

# Add kwargs to signal that upgrading.rst should be included in docs/index.rst if it exists
if Path("docs/upgrading.rst").exists():
parthea marked this conversation as resolved.
Show resolved Hide resolved
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
12 changes: 2 additions & 10 deletions synthtool/gcp/templates/python_library/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ API Reference
{{ version }}/services
{{ version }}/types
{% endfor %}
{%- if migration_guide_version %}
Migration Guide
---------------

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

.. toctree::
:maxdepth: 2

UPGRADING
{% if include_uprading_doc %}
.. include:: upgrading.rst
{% endif %}
Changelog
---------
Expand Down