-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: grab repository metadata #364
Conversation
docfx_yaml/extension.py
Outdated
@@ -2086,9 +2106,11 @@ def convert_module_to_package_if_needed(obj): | |||
file_name_set.add(filename) | |||
|
|||
for entry in yaml_data: | |||
if not app.env.library_shortname: | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would apply to the whole library, right? If so, I think you can just break
instead of continue
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, done.
docfx_yaml/extension.py
Outdated
@@ -26,6 +26,7 @@ | |||
import shutil | |||
import black | |||
import logging | |||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: import ordering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I was able to sort through the first party libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Verified that new changes did not change the result.
docfx_yaml/extension.py
Outdated
@@ -26,6 +26,7 @@ | |||
import shutil | |||
import black | |||
import logging | |||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I was able to sort through the first party libraries.
docfx_yaml/extension.py
Outdated
@@ -2086,9 +2106,11 @@ def convert_module_to_package_if_needed(obj): | |||
file_name_set.add(filename) | |||
|
|||
for entry in yaml_data: | |||
if not app.env.library_shortname: | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, done.
I've noticed an issue with the rest of the libraries not being able to properly find the library names from the given Sphinx info.
Seems like I need to extract the
.repo-metadata.json
file directly to source this information - Sphinx has very limited ways to deliver this information throughdocs/conf.py
.Based on the
googleapis/
repo search, it seems that usingname
suffices for shortname for the library. If I encounter ones that don't work, I'll create an exception around those few. I've sampled ~100 and seems to work with usingname
instead ofapi_shortname
.Verified that existing library generation demo for bigframes and logging still works.
If the repository metadata could not be retrieved, skip over getting the summary page details.
Fixes b/331977022.