Skip to content

docs(gazelle): POC the bare minimum for linking modules_mapping in docs. #3140

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dougthor42
Copy link
Collaborator

From #3132 (comment).

While this note exists, the PR description is WIP.

sphinx_stardocs(
name = "bzl_api_docs",
srcs = [
":gazelle_modules_mapping_def_bzl",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sphinx_stardocs doesn't like @rules_python_gazelle_plugin//modules_mapping:def_bzl with:

Error in _stardoc_input_helper:
illegal rule name:
_bzl_api_docs_@rules_python_gazelle_plugin//modules_mapping/def_bzl.primary_bzl_src:
invalid target name '_bzl_api_docs_@rules_python_gazelle_plugin//modules_mapping/def_bzl.primary_bzl_src':
target names may not contain '//' path separators

So I tried the alias thing and it worked 🤷. Having an alias for every bzl_library target is not feasible of course. Maybe a filegroup or a meta-target bzl_library(srcs = ["$ALL_BZL_LIBRARY_TARGETS"])...

With the alias, we are able to link with {bzl:obj}. It goes to: http://localhost:8000/api/rules_python_gazelle_plugin%2B/modules_mapping/def.html#modules_mapping where %2B is +:

rules_python_gazelle_plugin+/modules_mapping/def.html

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think some of the automatic inference withing sphinxdocs needs to be updated, but I am not sure where, I'd need to dig, maybe @rickeylev knows of his hat.

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