Crystal docs - cli


I’m having an issue generating docs for my newest project.
When I run crystal docs it only uses the README. I have also tried crystal docs src/ but same result.

It usually works perfectly and I’m wondering if I’m missing something?

I think the main issue is that you’re defining this under the Kemal namespace, which doesn’t technically exist in your application, so it’s being skipped.

Could add like module Kemal; end to the top of the file to define this. Or setup the code to look like this instead:

module Kemal
  module Shield
    # ...

I see. I’ve always thought that module Foo::Bar; was the same as

module Foo
  module Bar

But I guess it is not always the case.

Thank you :)

My understanding is that they’re equivalent. But maybe something that can be improved in docs land? If I had to guess I’d say that that docs require the type to be defined in the code you’re building docs for, and using that short syntax doesn’t technically do it as it jus defines the inner module within the parent one without actually defining the parent namespace.

1 Like