-
Notifications
You must be signed in to change notification settings - Fork 45
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
Should not require rules to aliased before being documented #94
Comments
This is because loaded symbols are private to the file that loads them, unlike assigned global variables which are considered part of the module object defined by the .bzl file. So they're invisible to Stardoc. This will still be the case even after the rewrite of Stardoc to use a What I wonder is why are you loading these symbols if you don't also want to export them. I'd suggest that either you continue to assign |
The current stardoc rule only allows for one input file, doesn't it? It sometimes makes sense exposing multiple rules/macros in a single documentation page. I just hit the same issue trying to do just that. I'm not sure it's a totally legitimate use-case as I'm not entirely sure what I want to do with those docs, and maybe I don't want to do it this way, but that's how I encountered this issue as well. As a sidenote, the documentation should at least be updated to reflect this. |
This is difficult to do well in the general case.
And if you don't want to do it well in the general case, if your use case is very simple, you can just write a genrule to concatenate the markdown output of two stardoc rules :) |
Aliasing was a bit annoying but not a real problem in older versions of stardoc. However in newer versions, you end up with documentation like load("@//:rules_doc.bzl", "my_rule") rather than the correct load("@//:my_rule.bzl", "my_rule") I agree concatenation of the output markdown is probably the better way to go here, but then maybe https://github.com/bazelbuild/stardoc/blob/master/docs/generating_stardoc.md#multiple-files should be updated. |
When following the instructions for documenting multiple files the generated docs are empty. In order for content to be created, the rules need to aliased in some way.
That is, attempting to generate docs from the following will lead to an empty doc:
Whereas:
will lead to the expected documentation being generated. This is confusing and unexpected. In addition, many authors don't want to expose all the rules this way.
The text was updated successfully, but these errors were encountered: