Stream: beginners

Topic: Doc generation includes private modules


view this post on Zulip Jasper Woudenberg (Jul 10 2026 at 21:39):

I'm generating docs for my first new-compiler rock package. When I run roc docs package/main.roc the generated documentation includes two exposed modules, but also a private Util.roc module. Private helper types in the exposed modules are also included in the docs. I thought this might be a bug, but I saw that roc-unicode also has private modules but without including those in its docs. I don't see what I'm doing different. I'm on the most recent commit of the roc compiler as of writing.

Here's the code of the package:
https://git.sr.ht/~jwoudenberg/roc-gregorian/tree

And here's the generated documentation:
https://cdn.jasperwoudenberg.com/roc-gregorian/0.1.0/docs/

Am I holding Roc wrong?

view this post on Zulip Luke Boswell (Jul 10 2026 at 21:48):

We just fixed one thing https://github.com/roc-lang/roc/issues/9960

It could be another edge case ... when you say Util.roc and the helper types are private what does that look like? Are top-level helpers that aren't in the module's nominal type included in the docs?

view this post on Zulip Luke Boswell (Jul 10 2026 at 21:49):

Ah I'm guessing we fixed it for platform but not package module types, can you make a GH Issue for this?

view this post on Zulip Jasper Woudenberg (Jul 11 2026 at 06:44):

Luke Boswell said:

We just fixed one thing https://github.com/roc-lang/roc/issues/9960

It could be another edge case ... when you say Util.roc and the helper types are private what does that look like? Are top-level helpers that aren't in the module's nominal type included in the docs?

Yes, that's one half of the problem. The other is that helper modules are included as well!

Issue is here:
https://github.com/roc-lang/roc/issues/10077


Last updated: Jul 23 2026 at 13:15 UTC