Skip to content
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

crystal docs do not generate the documentation in case of module extending standard library #8553

Open
anykeyh opened this issue Dec 4, 2019 · 1 comment

Comments

@anykeyh
Copy link

anykeyh commented Dec 4, 2019

I've wrote about it on the forum here

Reproducible code:

src/ext.cr

require "json"

module JSON::ANewModule
        # some documentation here
        def test
        end
end

Then run the document generation

crystal docs && open docs/index.html

Expectation: Documentation is generated for JSON::ANewModule object
Result: The class/module is ignored at all in the documentation and doesn't exists.

@straight-shoota
Copy link
Member

The issue is probably that the documentation generator filters at the top level which namespaces are to be included into the documentation. Since JSON is not reopened in user code, it doesn't qualify and ass such, the entire tree including JSON::ANewModule is not included.

When we change that, there's a question which behaviour we'd expect. Should the documentation include all of JSON namespace, or just JSON::ANewModule?
I suppose the latter is better. When necessary, you can include the entire namespace using a different means (see #8550).

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

No branches or pull requests

2 participants