Skip to content

Commit d7c2271

Browse files
dandhleeparthea
andauthored
docs: add summary_overview template (#1946)
* docs: add summary_overview template * docs: update README link to summary overview * docs: fix readme link * Apply suggestions from code review Co-authored-by: Anthonios Partheniou <[email protected]> * Update summary_overview.md * Update README.rst * Update README.rst * Apply suggestions from code review Co-authored-by: Anthonios Partheniou <[email protected]> * docs: exclude docs/summary_overview for non-Cloud libraries * Update synthtool/gcp/common.py Co-authored-by: Anthonios Partheniou <[email protected]> --------- Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 4b49307 commit d7c2271

File tree

5 files changed

+57
-1
lines changed

5 files changed

+57
-1
lines changed

synthtool/gcp/common.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,10 @@ def py_mono_repo_library(self, relative_dir, **kwargs) -> Path:
233233
self.excludes += ["docs/index.rst"]
234234

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

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

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

303307
# If Dockerfile exists in .kokoro/docker/samples, add kwargs to
304308
# signal that a custom docker image should be used when testing samples.

synthtool/gcp/templates/python_library/README.rst

+4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ Python Client for {{ metadata['repo']['name_pretty'] }} API
1515
.. |versions| image:: https://img.shields.io/pypi/pyversions/{{ metadata['repo']['distribution_name'] }}.svg
1616
:target: https://pypi.org/project/{{ metadata['repo']['distribution_name'] }}/
1717
.. _{{ metadata['repo']['name_pretty'] }} API: {{ metadata['repo']['product_documentation'] }}
18+
{%- if is_google_cloud_api %}
19+
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}/summary_overview
20+
{% else %}
1821
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}
22+
{% endif -%}
1923
.. _Product Documentation: {{ metadata['repo']['product_documentation'] }}
2024

2125
Quick Start
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
This is a templated file. Adding content to this file may result in it being
3+
reverted. Instead, if you want to place additional content, create an
4+
"overview_content.md" file in `docs/` directory. The Sphinx tool will
5+
pick up on the content and merge the content.
6+
]: #
7+
8+
# {{ metadata['repo']['name_pretty'] }} API
9+
10+
Overview of the APIs available for {{ metadata['repo']['name_pretty'] }} API.
11+
12+
## All entries
13+
14+
Classes, methods and properties & attributes for
15+
{{ metadata['repo']['name_pretty'] }} API.
16+
17+
[classes]({{ metadata['repo']['client_documentation'] }}/summary_class.html)
18+
19+
[methods]({{ metadata['repo']['client_documentation'] }}/summary_method.html)
20+
21+
[properties and
22+
attributes]({{ metadata['repo']['client_documentation'] }}/summary_property.html)

synthtool/gcp/templates/python_mono_repo_library/README.rst

+4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ Python Client for {{ metadata['repo']['name_pretty'] }}
1515
.. |versions| image:: https://img.shields.io/pypi/pyversions/{{ metadata['repo']['distribution_name'] }}.svg
1616
:target: https://pypi.org/project/{{ metadata['repo']['distribution_name'] }}/
1717
.. _{{ metadata['repo']['name_pretty'] }}: {{ metadata['repo']['product_documentation'] }}
18+
{%- if is_google_cloud_api %}
19+
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}/summary_overview
20+
{% else %}
1821
.. _Client Library Documentation: {{ metadata['repo']['client_documentation'] }}
22+
{% endif -%}
1923
.. _Product Documentation: {{ metadata['repo']['product_documentation'] }}
2024

2125
Quick Start
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
This is a templated file. Adding content to this file may result in it being
3+
reverted. Instead, if you want to place additional content, create an
4+
"overview_content.md" file in `docs/` directory. The Sphinx tool will
5+
pick up on the content and merge the content.
6+
]: #
7+
8+
# {{ metadata['repo']['name_pretty'] }} API
9+
10+
Overview of the APIs available for {{ metadata['repo']['name_pretty'] }} API.
11+
12+
## All entries
13+
14+
Classes, methods and properties & attributes for
15+
{{ metadata['repo']['name_pretty'] }} API.
16+
17+
[classes]({{ metadata['repo']['client_documentation'] }}/summary_class.html)
18+
19+
[methods]({{ metadata['repo']['client_documentation'] }}/summary_method.html)
20+
21+
[properties and
22+
attributes]({{ metadata['repo']['client_documentation'] }}/summary_property.html)

0 commit comments

Comments
 (0)