Skip to content

Conversation

@ohmayr
Copy link
Contributor

@ohmayr ohmayr commented Oct 16, 2025

This PR creates a docs/index.rst file for a new library that is configured and generated using librarian.

@ohmayr ohmayr requested review from a team as code owners October 16, 2025 23:20
@ohmayr ohmayr force-pushed the create-index-docs-file branch from 514d6dc to b32d263 Compare October 16, 2025 23:49
@ohmayr ohmayr force-pushed the create-index-docs-file branch from 163f69f to ff47911 Compare October 17, 2025 02:47
@parthea parthea changed the title feat: create a docs index rst file chore(librarian): create docs/README.rst file during generation Oct 17, 2025
@parthea parthea marked this pull request as draft October 17, 2025 15:06
@ohmayr ohmayr marked this pull request as ready for review October 17, 2025 22:02
Comment on lines +526 to +528
# Read the content from the source, which will resolve any symlinks.
with open(source_path, "r") as f:
content = f.read()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use the _read_text_file function

def _read_text_file(path: str) -> str:
"""Helper function that reads a text file path and returns the content.
Args:
path(str): The file path to read.
Returns:
str: The contents of the file.
"""
with open(path, "r") as f:
return f.read()

_write_json_file(output_repo_metadata, metadata_content)


def _copy_readme_to_docs(output: str, library_id: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we create a follow up issue to track adding docs/README.rst to the output of gapic-generator?

@ohmayr ohmayr merged commit 0928066 into main Oct 18, 2025
27 checks passed
@ohmayr ohmayr deleted the create-index-docs-file branch October 18, 2025 00:43
parthea added a commit that referenced this pull request Oct 20, 2025
PR #14751 added
ability to generate docs/README.rst. As a result, in the subsequent
`librarian generate` PR
#14776 there were
a lot of unrelated changes where stale readmes in the `docs` directory
were updated. This PR updates the stale README files.
parthea added a commit that referenced this pull request Nov 5, 2025
As of #14751,
package level `docs/README.rst` files are included in the generated
output and are a copy of the package `README.rst`. We don't need to
preserve the existing version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants