Open apekter opened 5 years ago
Stardoc can indeed handle .bzl files from remote repositories. Can you provide some more details on how to reproduce this error?
As an example, Stardoc self-documents its Starlark rule (stardoc.bzl), and directly depends on @bazel_skylib
.
It's important you specify the dependencies of the bzl files you want to generate documentation for. See this example.
You are correct about a case where you load a rule from a .bzl file from a remote repo and use it a s a dependency. What I am trying to do is to have a stardoc rule that uses a .bzl file directly from a remote repo as input without loading it for example:
stardoc(
name = "my_rule_doc",
input = "@remote_repo//custom_rules/bazel:my_rule.bzl",
out = "my_rule_doc.md",
visibility = ["//visibility:public"],
)
Aha. I'll take a look. Thanks for the info.
The main reason of this approach is to separate the project dependencies from the documentation dependencies as well as to have the capabilities to document multiple projects at once.
For the first part, it might be enough to separate the documentation targets into separate packages within your main repo. The idea is that you might avoid loading any packages that cause documentation dependencies to be downloaded. Admittedly that doesn't address the possible bug we're talking about.
Chris, do you recall anything about this issue? Is this kind of use case supported?
Idea: Create a bazel project for the purpose of documenting another bazel project. The main reason of this approach is to separate the project dependencies from the documentation dependencies as well as to have the capabilities to document multiple projects at once.
Issue: Stardoc rules cannot handle .bzl files from remote repositories. The result of running the build is the following error: