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

docs: add summary_overview template #1946

Merged
merged 13 commits into from
Apr 5, 2024
6 changes: 5 additions & 1 deletion synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ def py_mono_repo_library(self, relative_dir, **kwargs) -> Path:
self.excludes += ["docs/index.rst"]

# If the directory `google/cloud` exists, add kwargs to signal that the client library is for a Cloud API
if Path("google/cloud").exists():
if Path(f"{relative_dir}/google/cloud").exists():
kwargs["is_google_cloud_api"] = True
else:
self.excludes += ["docs/summary_overview.md"]

return self._generic_library("python_mono_repo_library", relative_dir, **kwargs)

Expand Down Expand Up @@ -299,6 +301,8 @@ def py_library(self, **kwargs) -> Path:
# If the directory `google/cloud` exists, add kwargs to signal that the client library is for a Cloud API
if Path("google/cloud").exists():
kwargs["is_google_cloud_api"] = True
else:
self.excludes += ["docs/summary_overview.md"]

# If Dockerfile exists in .kokoro/docker/samples, add kwargs to
# signal that a custom docker image should be used when testing samples.
Expand Down
4 changes: 4 additions & 0 deletions synthtool/gcp/templates/python_library/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ Python Client for {{ metadata['repo']['name_pretty'] }} API
.. |versions| image:: https://img.shields.io/pypi/pyversions/{{ metadata['repo']['distribution_name'] }}.svg
:target: https://pypi.org/project/{{ metadata['repo']['distribution_name'] }}/
.. _{{ metadata['repo']['name_pretty'] }} API: {{ metadata['repo']['product_documentation'] }}
{%- if is_google_cloud_api %}
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}/summary_overview
dandhlee marked this conversation as resolved.
Show resolved Hide resolved
{% else %}
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}
{% endif -%}
.. _Product Documentation: {{ metadata['repo']['product_documentation'] }}

Quick Start
Expand Down
22 changes: 22 additions & 0 deletions synthtool/gcp/templates/python_library/docs/summary_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
dandhlee marked this conversation as resolved.
Show resolved Hide resolved
This is a templated file. Adding content to this file may result in it being
reverted. Instead, if you want to place additional content, create an
"overview_content.md" file in `docs/` directory. The Sphinx tool will
pick up on the content and merge the content.
]: #

# {{ metadata['repo']['name_pretty'] }} API

Overview of the APIs available for {{ metadata['repo']['name_pretty'] }} API.

## All entries

Classes, methods and properties & attributes for
{{ metadata['repo']['name_pretty'] }} API.

[classes]({{ metadata['repo']['client_documentation'] }}/summary_class.html)

[methods]({{ metadata['repo']['client_documentation'] }}/summary_method.html)

[properties and
attributes]({{ metadata['repo']['client_documentation'] }}/summary_property.html)
dandhlee marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions synthtool/gcp/templates/python_mono_repo_library/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ Python Client for {{ metadata['repo']['name_pretty'] }}
.. |versions| image:: https://img.shields.io/pypi/pyversions/{{ metadata['repo']['distribution_name'] }}.svg
:target: https://pypi.org/project/{{ metadata['repo']['distribution_name'] }}/
.. _{{ metadata['repo']['name_pretty'] }}: {{ metadata['repo']['product_documentation'] }}
{%- if is_google_cloud_api %}
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}/summary_overview
{% else %}
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}
{% endif -%}
.. _Product Documentation: {{ metadata['repo']['product_documentation'] }}

Quick Start
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
This is a templated file. Adding content to this file may result in it being
reverted. Instead, if you want to place additional content, create an
"overview_content.md" file in `docs/` directory. The Sphinx tool will
pick up on the content and merge the content.
]: #

# {{ metadata['repo']['name_pretty'] }} API

Overview of the APIs available for {{ metadata['repo']['name_pretty'] }} API.

## All entries

Classes, methods and properties & attributes for
{{ metadata['repo']['name_pretty'] }} API.

[classes]({{ metadata['repo']['client_documentation'] }}/summary_class.html)

[methods]({{ metadata['repo']['client_documentation'] }}/summary_method.html)

[properties and
attributes]({{ metadata['repo']['client_documentation'] }}/summary_property.html)
Loading